.gallery-admin-page {
    --home-page-max: min(1540px, calc(100vw - 48px));
}

.gallery-admin-main {
    padding: 0;
}

.gallery-admin-page-section {
    padding: 0 0 56px;
}

.gallery-admin-page .gallery-admin-page-section > .container {
    max-width: var(--home-page-max);
    padding: 0;
}

@media (max-width: 1024px) {
    .gallery-admin-page .gallery-admin-page-section > .container {
        padding: 0 var(--gutter, 28px);
    }
}

.gallery-admin-title-card,
.gallery-admin-wrap {
    background: linear-gradient(135deg, #ead4ab 0%, #f3e3c6 58%, #fbf1df 100%);
    border: 1px solid rgba(154, 122, 44, 0.22);
    border-left: 6px solid #b88712;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(91, 7, 16, 0.13);
    box-sizing: border-box;
}

.gallery-admin-title-card {
    margin-bottom: 26px;
    padding: var(--home-card-padding, clamp(28px, 4vw, 42px));
}

.gallery-admin-title-card h1 {
    margin: 0;
    color: var(--dalesmen-burgundy, #5b0710);
    font-family: "Libre Baskerville", "Cormorant Garamond", Georgia, "Times New Roman", serif;
    font-size: var(--section-title-size, clamp(30px, 3.4vw, 42px));
    font-weight: 500;
    line-height: 1.08;
}

.gallery-admin-wrap {
    max-width: none;
    margin: 0;
    padding: var(--home-card-padding, clamp(28px, 4vw, 42px));
}

.gallery-admin-wrap h1,
.gallery-admin-wrap h2,
.gallery-admin-wrap h3 {
    margin-top: 0;
}

.gallery-admin-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    align-items: start;
}

.gallery-card,
.gallery-edit-card {
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.gallery-edit-wrap {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem 2rem;
}

.gallery-flash {
    margin-bottom: 1rem;
    padding: .9rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    line-height: 1.5;
}

.gallery-flash.success {
    background: #edf8ef;
    border: 1px solid #b7dbbf;
    color: #1f5a2b;
}

.gallery-flash.error {
    background: #fff3f3;
    border: 1px solid #e1b7b7;
    color: #812525;
}

.gallery-field {
    margin-bottom: 1rem;
}

.gallery-field label {
    display: block;
    margin-bottom: .35rem;
    font-weight: 700;
}

.gallery-field input[type="text"],
.gallery-field input[type="email"],
.gallery-field input[type="number"],
.gallery-field input[type="file"],
.gallery-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: .7rem .8rem;
    border: 1px solid #bfbfbf;
    border-radius: 8px;
    font: inherit;
}

.gallery-field textarea {
    resize: vertical;
    min-height: 130px;
}

.gallery-edit-wrap .gallery-field textarea {
    min-height: 140px;
}

.gallery-help {
    margin: -.35rem 0 0;
    font-size: .92rem;
    color: #555;
    line-height: 1.4;
}

.gallery-checkbox {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
}

.gallery-submit,
.gallery-save {
    display: inline-block;
    padding: .7rem 1rem;
    border: 0;
    border-radius: 8px;
    background: #1f3c88;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.gallery-submit:hover {
    opacity: .95;
}

.gallery-list {
    display: grid;
    gap: 1rem;
}

.gallery-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1rem;
    border: 1px solid #dddddd;
    border-radius: 12px;
    padding: 1rem;
    background: #fafafa;
}

.gallery-thumb img {
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    background: #eee;
}

.gallery-meta {
    font-size: .95rem;
    color: #444;
    margin: .5rem 0 .75rem;
}

.gallery-description {
    margin: 0 0 .85rem;
    line-height: 1.5;
}

.gallery-actions,
.gallery-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.gallery-actions a,
.gallery-actions button {
    display: inline-block;
    text-decoration: none;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.gallery-actions a.edit-link,
.gallery-cancel {
    color: #1f3c88;
}

.gallery-actions button.delete-link {
    color: #a32020;
}

.gallery-actions form {
    margin: 0;
}

.gallery-top-links {
    margin-bottom: 1rem;
}

.gallery-top-links a,
.gallery-cancel {
    font-weight: 700;
    text-decoration: none;
}

.gallery-cancel {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.gallery-image-preview img {
    max-width: 100%;
    width: 420px;
    height: auto;
    border-radius: 12px;
    display: block;
    background: #eee;
}

.gallery-edit-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 10000;
}

.gallery-edit-modal.is-open {
    display: block;
}

.gallery-edit-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.gallery-edit-modal__dialog {
    position: relative;
    width: min(940px, calc(100% - 24px));
    height: min(86vh, 800px);
    margin: 5vh auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gallery-edit-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 10px 14px;
    border-bottom: 1px solid #ddd;
}

.gallery-edit-modal__header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.gallery-edit-modal__close {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
}

.gallery-edit-modal iframe {
    width: 100%;
    flex: 1;
    border: 0;
}

.modal-edit-body .gallery-edit-wrap {
    max-width: none;
    margin: 0;
    padding: 1rem;
}

.modal-edit-body .gallery-edit-wrap h1 {
    margin-top: 0;
}

.modal-edit-body .gallery-edit-wrap > p:first-child {
    display: none;
}

@media (max-width: 900px) {
    .gallery-admin-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item {
        grid-template-columns: 1fr;
    }

    .gallery-thumb img {
        height: auto;
        max-height: 280px;
    }
}
.gallery-access-card { max-width:680px; margin-inline:auto; }
.gallery-access-card .gallery-field input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    border: 1px solid #bfbfbf;
    border-radius: 8px;
    font: inherit;
    line-height: 22px;
}
.gallery-top-links { display:flex; flex-wrap:wrap; gap:16px; margin-bottom:24px; }
.gallery-top-links a { color:var(--dalesmen-burgundy,#5b0710); font-weight:700; }
.gallery-button,.gallery-admin-wrap button { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:0 20px; border:1px solid #d2a827; border-radius:5px; background:#d2a827; color:#fff; font-weight:700; cursor:pointer; }
.gallery-admin-wrap button.danger { background:#8c1d2c; border-color:#8c1d2c; }
.gallery-admin-wrap button.approve { background:#356b3d; border-color:#356b3d; }
.gallery-admin-wrap select { width:100%; padding:10px; border:1px solid #cdbf9e; background:#fff; }
.gallery-upload-form #album-title,
.gallery-upload-form #upload-sort {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 40px;
    padding: 10px;
    border: 1px solid #cdbf9e;
    border-radius: 0;
    background: #fff;
    font: 14px Arial, sans-serif;
}
.gallery-upload-form .gallery-help {
    margin-top: 10px;
}
.gallery-upload-form { max-width: none; }
.gallery-upload-form > .gallery-button { margin-top: 16px; }
.gallery-upload-note { padding: 14px 16px; border-left: 4px solid #d2a827; background: #fffaf0; line-height: 1.5; border-radius: 4px; }
.gallery-upload-form .gallery-upload-check { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.gallery-upload-check input { width: auto; flex: none; }
.gallery-upload-preview { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; margin: 16px 0 24px; }
.gallery-upload-preview > img, .gallery-upload-preview > video { width: 128px; height: 128px; object-fit: contain; background: #fff; border: 1px solid #ccc; box-sizing: border-box; }
.gallery-upload-preview label { overflow-wrap: anywhere; }
.gallery-upload-preview textarea { min-height: 80px; }
.gallery-upload-preview .gallery-upload-order { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.gallery-upload-order input[type="number"] { width: 96px; padding: 6px; border-radius: 0; }
.gallery-upload-order input[readonly] { background: #eee; }
.gallery-upload-form .gallery-upload-permission { margin-top: 20px; }
@media (max-width: 600px) {
    .gallery-upload-preview { grid-template-columns: minmax(0, 1fr); }
    .gallery-upload-form button { margin-bottom: 8px; }
}
.gallery-manage-list { display:grid; gap:24px; margin-top:24px; }
.gallery-manage-item { display:grid; grid-template-columns:minmax(180px,280px) 1fr; gap:24px; padding:20px; border:2px solid rgba(210,168,39,.55); border-radius:8px; background:#fffaf0; box-shadow:0 10px 24px rgba(91,7,16,.13); }
.gallery-manage-item.is-pending { border-left:7px solid #d2a827; }
.gallery-manage-preview img,.gallery-manage-preview video { width:100%; max-height:280px; object-fit:contain; background:#160104; }
.gallery-item-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.gallery-admin-actions { display:flex; justify-content:flex-end; }
@media(max-width:760px){.gallery-manage-item{grid-template-columns:1fr}.gallery-admin-wrap{padding:18px}.gallery-manage-preview img,.gallery-manage-preview video{max-height:360px}}

.gallery-review-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; }
.gallery-uploader-group { margin-top:28px; }
.gallery-uploader-group + .gallery-uploader-group { padding-top:24px; border-top:1px solid rgba(91,7,16,.25); }
.gallery-uploader-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; }
.gallery-uploader-heading h2 { margin:0 0 6px; color:#5b0710; font-size:1.3rem; overflow-wrap:anywhere; }
.gallery-uploader-heading p { margin:4px 0; color:#675a50; overflow-wrap:anywhere; }
.gallery-uploader-heading form { margin:0; }
.gallery-status-filters { display:flex; flex-wrap:wrap; gap:10px; }
.gallery-admin-page .gallery-status-filters a { display:inline-flex; align-items:center; min-height:44px; box-sizing:border-box; padding:8px 16px; border:1px solid #b88712; border-radius:5px; background:#fffaf0; color:#5b0710; text-decoration:none; font-weight:700; }
.gallery-admin-page .gallery-status-filters a.is-active,
.gallery-admin-page .gallery-status-filters a:hover { background:#5b0710; color:#fff; }
.gallery-admin-thumbnails { grid-template-columns:repeat(4,minmax(0,1fr)); gap:18px; }
.gallery-admin-thumbnails .gallery-manage-item { display:flex; flex-direction:column; gap:0; min-width:0; padding:0; overflow:hidden; }
.gallery-admin-thumbnails .gallery-manage-preview img,
.gallery-admin-thumbnails .gallery-manage-preview video { display:block; width:100%; height:170px; object-fit:contain; }
.gallery-manage-summary { display:flex; flex:1; flex-direction:column; padding:14px; min-width:0; }
.gallery-manage-summary h2 { margin:0 0 6px; font-size:1rem; color:#5b0710; overflow-wrap:anywhere; }
.gallery-manage-date { margin:0 0 8px; font-size:.8rem; color:#675a50; }
.gallery-manage-description { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; margin:0 0 10px; font-size:.9rem; line-height:1.4; }
.gallery-manage-status { margin-top:auto; color:#675a50; }
.gallery-admin-thumbnails .gallery-item-actions { gap:8px; }
.gallery-admin-thumbnails .gallery-item-actions form { margin:0; }
.gallery-admin-thumbnails .gallery-item-actions button { min-height:38px; padding:0 15px; }
html.gallery-editor-open { overflow:hidden; }
.gallery-admin-editor { width:min(860px,calc(100vw - 32px)); max-height:90vh; box-sizing:border-box; padding:0; border:1px solid #d2a827; border-radius:10px; background:#fffaf0; color:#221712; }
.gallery-admin-editor::backdrop { background:rgba(18,1,4,.75); }
.gallery-editor-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 22px; border-bottom:1px solid #ddc99f; }
.gallery-editor-header h2 { margin:0; font-size:1.3rem; color:#5b0710; }
.gallery-editor-body { display:grid; grid-template-columns:minmax(0, .8fr) minmax(0,1.2fr); gap:24px; padding:22px; }
.gallery-editor-body > form { min-width:0; }
.gallery-editor-preview img,.gallery-editor-preview video { display:block; width:100%; max-height:360px; object-fit:contain; background:#160104; }
.gallery-admin-editor .gallery-field label { display:block; }
.gallery-admin-editor .gallery-field input,.gallery-admin-editor .gallery-field textarea,.gallery-admin-editor .gallery-field select { display:block; width:100%; box-sizing:border-box; margin-top:6px; font:inherit; }
.gallery-admin-editor .gallery-field textarea { min-height:100px; }
.gallery-my-uploads-page .gallery-admin-page-section > .container { width:100%; max-width:min(1540px,calc(100% - 48px)); }
.gallery-my-uploads-page .gallery-admin-editor .gallery-item-actions { gap:12px; margin-top:20px; }
@media(max-width:1200px) { .gallery-admin-thumbnails { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:900px) { .gallery-admin-thumbnails { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) {
    .gallery-admin-thumbnails { grid-template-columns:1fr; }
    .gallery-editor-body { grid-template-columns:1fr; padding:16px; gap:16px; }
    .gallery-editor-preview img,.gallery-editor-preview video { max-height:180px; }
    .gallery-editor-header { padding:14px 16px; }
}
