:root {
    --forest: #2f4a3a;
    --forest-dark: #22372b;
    --moss: #6b8f5e;
    --birch: #f6f3ec;
    --bark: #5a4a3b;
    --line: #e2dccf;
    --bs-primary: #2f4a3a;
    --bs-primary-rgb: 47, 74, 58;
    --bs-link-color: #2f6b4a;
    --bs-link-color-rgb: 47, 107, 74;
    --bs-link-hover-color: #22372b;
}

html { font-size: 15px; position: relative; min-height: 100%; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    background: var(--birch);
    color: #2a2a26;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body > .container { flex: 1; }
h1, h2, h3 { color: var(--forest-dark); font-family: Georgia, "Times New Roman", serif; }

.btn-primary { --bs-btn-bg: var(--forest); --bs-btn-border-color: var(--forest); --bs-btn-hover-bg: var(--forest-dark); --bs-btn-hover-border-color: var(--forest-dark); --bs-btn-active-bg: var(--forest-dark); }
.btn-outline-primary { --bs-btn-color: var(--forest); --bs-btn-border-color: var(--forest); --bs-btn-hover-bg: var(--forest); --bs-btn-hover-border-color: var(--forest); }
.form-control:focus, .form-check-input:focus { border-color: var(--moss); box-shadow: 0 0 0 .2rem rgba(107, 143, 94, .3); }
.form-check-input:checked { background-color: var(--forest); border-color: var(--forest); }

/* Nav + footer */
.site-nav { background: var(--forest); }
.site-nav .navbar-brand { font-family: Georgia, serif; font-weight: 600; display: inline-flex; align-items: center; gap: .55rem; }
.brand-icon { border-radius: 7px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.site-nav .btn-link.nav-link { border: 0; }
.site-footer { border-top: 1px solid var(--line); color: #7a7466; font-size: .9rem; padding: 1.25rem 0; }

/* Home */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    background: linear-gradient(135deg, var(--forest) 0%, #3f6650 60%, var(--moss) 100%);
    color: #fff;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 2rem;
}
/* The artwork has a blank strip along its bottom edge; crop it off. */
.hero-image { position: relative; overflow: hidden; background: #f3ead7; }
/* At least 85% as tall as wide, but stretches to match the text column. */
.hero-image::before { content: ""; display: block; padding-top: 85%; }
.hero-image img { position: absolute; top: 0; left: 0; width: 100%; height: 116%; object-fit: cover; object-position: center top; }
.hero-text { padding: 2.5rem 2.25rem; display: flex; flex-direction: column; justify-content: center; }
.hero h1 { color: #fff; font-size: 2.8rem; margin-bottom: .25rem; }
.hero-tagline { font-size: 1.2rem; opacity: .9; margin-bottom: .5rem; }
.hero-intro { max-width: 46rem; opacity: .9; margin: 1rem 0 0; }
@media (max-width: 767.98px) {
    .hero { grid-template-columns: 1fr; }
    .hero-text { padding: 1.5rem 1.25rem 1.75rem; }
    .hero h1 { font-size: 2.1rem; }
}
.section-title { font-size: 1.5rem; margin-bottom: 1rem; }

.gallery-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.gallery-card {
    display: flex; flex-direction: column;
    background: #fff; border: 1px solid var(--line); border-radius: .75rem; overflow: hidden;
    color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.gallery-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); color: inherit; }
.gallery-card-image { aspect-ratio: 4 / 3; background: #dfe6d9; display: flex; align-items: center; justify-content: center; }
.gallery-card-image img { width: 100%; height: 100%; object-fit: cover; }
.gallery-card-icon { font-size: 2.5rem; opacity: .6; }
.gallery-card-body { padding: 1rem 1.1rem 1.1rem; }
.gallery-card-body h3 { font-size: 1.2rem; margin-bottom: .35rem; }
.gallery-card-status { margin: .5rem 0 0; color: var(--bs-link-color); font-weight: 500; font-size: .9rem; }

.meta { color: #6f6a5f; font-size: .9rem; margin-bottom: .25rem; display: flex; flex-wrap: wrap; gap: .25rem .9rem; align-items: center; }

/* Gallery page */
.gallery-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; margin-bottom: .75rem; }
.gallery-header h1 { margin-bottom: .25rem; }
.gallery-header-actions { display: flex; gap: .5rem; }
.gallery-description { font-size: 1.1rem; max-width: 50rem; }
.notes {
    white-space: pre-line; background: #fff; border-left: 4px solid var(--moss);
    border-radius: .25rem; padding: .9rem 1.1rem; max-width: 50rem; margin-bottom: 1.5rem;
}

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; margin-top: 1.5rem; }
.photo { margin: 0; }
.photo-link { display: block; border-radius: .5rem; overflow: hidden; background: #dfe6d9; aspect-ratio: 4 / 3; }
.photo-link img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.photo-link:hover img { transform: scale(1.03); }
.photo figcaption { padding: .35rem .1rem 0; font-size: .88rem; display: flex; flex-direction: column; }
.photo-caption { font-weight: 500; }
.photo-date { color: #7a7466; font-size: .8rem; }

/* Tags */
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 0; }
.tag-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    background: #e6eee1; color: var(--forest-dark); border-radius: 999px;
    padding: .2rem .7rem; font-size: .85rem; text-decoration: none; white-space: nowrap;
}
.tag-chip:hover { background: #d3e2ca; color: var(--forest-dark); }
.tag-chip span { background: rgba(47, 74, 58, .15); border-radius: 999px; padding: 0 .4rem; font-size: .75rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--moss); font-weight: 600; margin-bottom: .1rem; }
.photo-gallery { font-size: .8rem; color: var(--bs-link-color); text-decoration: none; }
.photo-gallery:hover { text-decoration: underline; }
.tag-tools { background: #fff; border: 1px solid var(--line); border-radius: .75rem; padding: .75rem .9rem; margin-bottom: .75rem; }

/* Lightbox */
.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(12, 16, 13, .96); color: #eee; display: flex; flex-direction: column; }
.lightbox[hidden] { display: none; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 3rem 3.5rem 1rem; }
.lb-img, .lb-video { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 4px 30px rgba(0, 0, 0, .5); }
.lb-img[hidden], .lb-video[hidden] { display: none; }
.lb-video { background: #000; }
.lb-video-error { max-width: 30rem; text-align: center; color: #eee; background: rgba(255, 255, 255, .06); border-radius: .75rem; padding: 1.5rem; }
.lb-video-error[hidden] { display: none; }
.lb-video-error p { margin: 0; }
.thumb-fix { background: #fff8e6; border: 1px solid #f0dca8; border-radius: .75rem; padding: .9rem 1rem; margin-top: 1rem; }
.upload-list .warn .upload-status { color: #8a6d1f; }

/* Video tiles */
.photo-link, .edit-thumb-link { position: relative; display: block; }
.video-badge {
    position: absolute; right: .4rem; bottom: .4rem;
    background: rgba(0, 0, 0, .65); color: #fff; border-radius: .3rem;
    padding: .05rem .4rem; font-size: .75rem; font-weight: 600; pointer-events: none;
}
.video-placeholder {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
    background: #2a352e; color: #fff; font-size: 2.2rem;
}
.photo-edit-thumb .video-placeholder { height: 112px; border-radius: .4rem; }
.lb-info { padding: .75rem 1.5rem 1.25rem; max-width: 60rem; margin: 0 auto; width: 100%; text-align: center; }
.lb-caption { font-size: 1.15rem; font-weight: 500; }
.lb-meta { color: #b9b9b0; font-size: .9rem; margin-top: .25rem; }
.lb-meta a { color: #cfe3c4; }
.lb-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; margin-top: .5rem; }
.lb-tags[hidden] { display: none; }
.lb-tags .tag-chip { background: rgba(255, 255, 255, .12); color: #e3efdc; }
.lb-tags .tag-chip:hover { background: rgba(255, 255, 255, .22); }
.lb-notes { white-space: pre-line; margin-top: .5rem; color: #ddd; font-size: .95rem; max-height: 8rem; overflow-y: auto; }
.lb-btn { position: absolute; background: rgba(255, 255, 255, .08); border: 0; color: #fff; font-size: 2rem; line-height: 1; width: 3rem; height: 3rem; border-radius: 50%; cursor: pointer; z-index: 1; }
.lb-btn:hover, .lb-btn:focus-visible { background: rgba(255, 255, 255, .2); }
.lb-close { top: .75rem; right: .75rem; }
.lb-prev { left: .5rem; top: 45%; }
.lb-next { right: .5rem; top: 45%; }

/* Password forms */
.auth-card { max-width: 26rem; margin: 2rem auto; background: #fff; border: 1px solid var(--line); border-radius: 1rem; padding: 2rem; }
.auth-card h1 { font-size: 1.6rem; }
.auth-card.wide { max-width: 34rem; }
.unlock-all { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; background: #fff; border: 1px solid var(--line); border-radius: .75rem; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.unlock-all-text { flex: 1 1 16rem; }
.unlock-all-text p { margin: 0; }
.unlock-all-form { display: flex; gap: .5rem; flex: 1 1 18rem; }
.auth-icon { font-size: 2.2rem; margin-bottom: .5rem; }

/* Admin */
.admin-form, .upload-box, .photo-edit, .danger-zone, .admin-table { background: #fff; }
.admin-form { border: 1px solid var(--line); border-radius: .75rem; padding: 1.5rem; }
.password-box { border: 1px solid var(--line); border-radius: .5rem; padding: 1rem 1.25rem; background: #fbfaf6; }
.password-box legend { font-size: 1.05rem; font-weight: 600; float: none; width: auto; padding: 0 .4rem; margin-bottom: 0; }
.danger-zone { border: 1px solid #f1c7c7; border-radius: .75rem; padding: 1.25rem 1.5rem; margin-top: 2rem; }
.danger-zone h2 { font-size: 1.1rem; color: #8a2b2b; font-family: inherit; }
.admin-table { border-radius: .5rem; overflow: hidden; }

.upload-box { border-radius: .75rem; }
.upload-drop {
    display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center;
    border: 2px dashed var(--moss); border-radius: .75rem; padding: 1.75rem 1rem; cursor: pointer; color: #555;
}
.upload-drop strong { font-size: 1.15rem; color: var(--forest); }
.upload-drop.drag { background: #eef4ea; }
.upload-drop.busy { opacity: .6; pointer-events: none; }
.upload-list { list-style: none; padding: 0 1rem; margin: 0; }
.upload-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.upload-list li:last-child { border-bottom: 0; margin-bottom: .75rem; }
.upload-list .done .upload-status { color: #2f7a43; }
.upload-list .error .upload-status { color: #b02a37; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.photo-edit-list { display: flex; flex-direction: column; gap: .75rem; }
.photo-edit { display: flex; gap: 1rem; border: 1px solid var(--line); border-radius: .75rem; padding: .9rem; }
.photo-edit-thumb { width: 150px; flex-shrink: 0; }
.photo-edit-thumb img { width: 150px; height: 112px; object-fit: cover; border-radius: .4rem; background: #dfe6d9; }
.photo-edit-fields { flex: 1; margin: 0; }
.photo-edit .form-label { margin-bottom: .1rem; color: #6f6a5f; }
@media (max-width: 640px) {
    .photo-edit { flex-direction: column; }
    .photo-edit-thumb, .photo-edit-thumb img { width: 100%; height: auto; }
}
/* Reorder page */
.order-toolbar { background: #fff; border: 1px solid var(--line); border-radius: .75rem; padding: .9rem 1rem; margin-bottom: 1rem; }
.order-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.order-tile {
    position: relative; background: #fff; border: 1px solid var(--line); border-radius: .6rem; padding: .35rem;
    cursor: grab; user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; gap: .15rem;
}
.order-tile:focus-visible { outline: 3px solid var(--moss); outline-offset: 2px; }
.order-tile.dragging { opacity: .45; outline: 2px dashed var(--forest); }
.order-grid.is-dragging, .order-grid.is-dragging .order-tile { cursor: grabbing; }
.order-media { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: .4rem; overflow: hidden; background: #dfe6d9; }
.order-media img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.order-media .video-placeholder { height: 100%; }
.order-number {
    position: absolute; top: .55rem; left: .55rem; z-index: 1; min-width: 1.6rem; text-align: center;
    background: var(--forest); color: #fff; border-radius: 999px; font-size: .75rem; font-weight: 600; padding: .05rem .4rem;
}
.order-handle {
    position: absolute; top: .45rem; right: .45rem; z-index: 1; touch-action: none; cursor: grab;
    background: rgba(255, 255, 255, .9); border-radius: .35rem; padding: .1rem .45rem; font-size: 1.1rem; line-height: 1.2;
}
.order-caption { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-date { font-size: .7rem; color: #7a7466; }

.sticky-save { position: sticky; bottom: 0; padding: .75rem 0; background: linear-gradient(transparent, var(--birch) 30%); text-align: right; }
