/* ==========================================================================
   DAP Préizerdaul — Heritage Warm theme + accessibility layer
   [DAP-REDESIGN] Loaded after style.css/yamm.css so it refines existing rules.
   All text colours used here meet WCAG 2.2 AA contrast on their background.
   ========================================================================== */

:root {
    /* ----- HERITAGE WARM DESIGN TOKENS ----- */
    --bg: #F7F2E8; /* Paper Cream  */
    --bg-soft: #ECE3CF; /* Sand         */
    --paper: #FFFCF4; /* Paper        */
    --ink: #14110C; /* Préizerdaul Black */
    --ink-2: #3A332A; /* Walnut ink   */
    --muted: #635A4C; /* Walnut Mute */
    --line: #DDD2BB; /* Hairline     */
    --accent: #B89F75; /* DAP Beige  — DECORATIVE ONLY */
    --accent-2: #7A3B1D; /* Burnt Sienna — text/links/buttons */
    --highlight: #C28A4D; /* Bronze Highlight */
    --focus: #7A3B1D; /* focus ring colour */
    --on-dark: #F7F2E8; /* text colour on ink backgrounds */
    --on-dark-2: #D8CBB0; /* secondary text on ink */

    /* Compatibility Aliases */
    --dap-bg: var(--bg);
    --dap-bg-soft: var(--bg-soft);
    --dap-paper: var(--paper);
    --dap-ink: var(--ink);
    --dap-ink-2: var(--ink-2);
    --dap-muted: var(--muted);
    --dap-line: var(--line);
    --dap-accent: var(--accent);
    --dap-accent-2: var(--accent-2);
    --dap-highlight: var(--highlight);
    --dap-on-dark: var(--on-dark);

    --maxw: 75rem; /* 1200px */
    --radius: 0.375rem;
    --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---- Skip link (WCAG 2.4.1) ---- */
.dap-skip-link {
    position: absolute;
    left: 8px;
    top: -100px;
    z-index: 2000;
    background: var(--dap-ink);
    color: var(--dap-on-dark);
    padding: 12px 20px;
    border-radius: 0 0 6px 6px;
    font-weight: 600;
    text-decoration: none;
    transition: top .15s ease;
}

.dap-skip-link:focus {
    top: 0;
    color: var(--dap-on-dark);
}

/* ---- Visible keyboard focus, never removed (WCAG 2.4.7) ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--dap-accent-2);
    outline-offset: 2px;
}

/* main is programmatically focused after the skip link but should not show a ring */
#main:focus {
    outline: none;
}

/* ---- Language bar (top of every page) ---- */
.dap-langbar {
    background: var(--dap-ink);
    color: var(--dap-on-dark);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.dap-langbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    flex-wrap: wrap;
}

.dap-langbar__msg {
    color: var(--dap-bg-soft);
}

.dap-lang-switch ul {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.dap-lang-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 32px;
    padding: 4px 10px; /* comfortable touch target */
    border-radius: 999px;
    color: #D8CBB0;
    font-weight: 600;
    text-decoration: none;
}

.dap-lang-switch a:hover {
    color: #fff;
}

.dap-lang-switch a[aria-current="true"] {
    background: var(--dap-on-dark);
    color: var(--dap-ink);
}

/* ---- Logos ---- */
.site-logo {
    height: 78px;
    width: auto;
    max-width: 100%;
}

@media (max-width: 768px) {
    .site-logo {
        height: 63px;
    }
}

.dap-commune-logo {
    height: 126px;
    width: auto;
    display: inline-block;
    margin-bottom: 12px;
}

/* ---- Minimum touch target for interactive controls (WCAG 2.5.8) ---- */
.navbar-nav .nav-link,
.btn,
button[type="submit"] {
    min-height: 44px;
}

/* ---- Search inputs inherit a usable size & visible border ---- */
.searchbox-phone input,
form.v2 input {
    min-height: 40px;
}

/* ---- Honour reduced-motion preference ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   STYLING EXTENDED FROM MOCKUP (dap.css)
   ========================================================================== */

/* Appliquer la police et fond warm */
body {
    background: var(--bg) !important;
    color: var(--ink) !important;
    font-family: var(--sans) !important;
}

/* Typographies et éléments de base */
.serif {
    font-family: var(--serif);
}

.eyebrow {
    font-size: 0.6875rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    margin: 0;
}

/* Boutons, cartes, grille et sections du nouveau thème */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.7rem 1.35rem;
    border-radius: 999px;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    border: 1.5px solid var(--ink);
    background: var(--ink);
    color: var(--on-dark);
    cursor: pointer;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.btn:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
}

.btn-ghost:hover {
    background: var(--ink);
    color: var(--on-dark);
}

.btn-sm {
    min-height: 2.25rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.8125rem;
}

.icon-btn {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.icon-btn:hover {
    border-color: var(--ink);
    background: var(--paper);
}

/* --- HERO SECTION --- */
.hero {
    padding: 4rem 0 3rem;
    border-bottom: 1px solid var(--line);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 64rem) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.hero h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin: 1.25rem 0 1.5rem;
    color: var(--ink);
}

.hero h1 em {
    font-style: italic;
    color: var(--accent-2);
    font-weight: 500;
}

.hero-lede {
    font-size: 1.125rem;
    color: var(--ink-2);
    max-width: 34rem;
    margin: 0 0 1.75rem;
}

.hero-cta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

figure.media {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-soft);
}

.hero-image {
    aspect-ratio: 16/9;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.08) contrast(1.02) saturate(0.95);
    transition: opacity .6s ease;
}

.hero-image.is-fading img {
    opacity: 0;
}

figure.media figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--on-dark);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: linear-gradient(to top, rgba(20, 17, 12, 0.78), transparent);
}

/* --- STATS --- */
.stats {
    padding: 3.5rem 0;
    border-bottom: 1px solid var(--line);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 64rem) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

.stat-num {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 3rem;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.stat-label {
    margin-top: 0.6rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

/* --- SECTIONS --- */
section {
    padding: 5rem 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.section-head h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0.75rem 0 0;
    max-width: 39rem;
    color: var(--ink);
}

.section-head p {
    color: var(--muted);
    max-width: 24rem;
    margin: 0;
    font-size: 0.9375rem;
}

.section-head p.eyebrow {
    max-width: none;
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    color: var(--accent-2);
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 1.5px solid var(--accent-2);
    padding-bottom: 0.25rem;
}

.section-link:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* --- COLLECTIONS --- */
.collections {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 64rem) {
    .collections {
        grid-template-columns: repeat(2, 1fr);
    }
}

.coll-card {
    display: block;
    text-decoration: none;
    color: var(--ink);
}

.coll-card:hover {
    color: var(--ink);
}

.coll-img {
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-soft);
}

.coll-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.1) contrast(1.02) saturate(0.9);
    transition: transform .6s ease;
}

.coll-card:hover .coll-img img, .coll-card:focus-visible .coll-img img {
    transform: scale(1.04);
}

.coll-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.coll-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1.2;
    margin: 0.5rem 0 0.25rem;
    color: var(--ink);
}

.coll-desc {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0;
}

/* --- EDITORIAL --- */
.editorial {
    background: var(--paper);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.editorial-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 5rem;
    align-items: center;
}

@media (max-width: 64rem) {
    .editorial-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.edit-img {
    aspect-ratio: 5/6;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-soft);
    margin: 0;
}

.edit-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.1) contrast(1.02) saturate(0.9);
}

.edit-body h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 1rem 0 1.5rem;
}

.edit-body p {
    color: var(--ink-2);
    font-size: 1.0625rem;
    line-height: 1.7;
    margin: 0 0 1rem;
}

.sig {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 0.9rem;
    align-items: center;
}

.sig-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--bg-soft);
    overflow: hidden;
    flex-shrink: 0;
}

.sig-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.1);
}

.sig-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.sig-role {
    font-size: 0.75rem;
    color: var(--muted);
}

/* --- PHOTO WALL & GALLERY --- */
.view-toggle {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
}

.view-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.25rem;
    padding: 0.4rem 0.9rem;
    border: 0;
    background: transparent;
    border-radius: 999px;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
}

.view-toggle button[aria-pressed="true"] {
    background: var(--ink);
    color: var(--on-dark);
}

/* Column counts mirror the Macy breakpoints in macy_gallery.js, so the CSS
   fallback (CMS edit mode, or no JS) matches the masonry layout. */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 64rem) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 40rem) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tile {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-soft);
    text-decoration: none;
    color: var(--ink);
    aspect-ratio: 1;
}

.tile.portrait {
    aspect-ratio: 3/4;
}

.tile.landscape {
    aspect-ratio: 4/3;
}

.tile.feat {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: auto;
}

@media (max-width: 40rem) {
    .tile.feat {
        grid-column: span 2;
        grid-row: auto;
        aspect-ratio: 4/3;
    }
}

.tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.1) contrast(1.02) saturate(0.9);
    transition: transform .6s ease;
}

.tile:hover img, .tile:focus-visible img {
    transform: scale(1.05);
}

.tile-tag {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    padding: 0.25rem 0.6rem;
    background: rgba(20, 17, 12, 0.72);
    color: var(--on-dark);
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: 3px;
}

.tile-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(20, 17, 12, 0.82), transparent);
    color: var(--on-dark);
    font-size: 0.8125rem;
}

.tile-caption .t {
    display: block;
    font-weight: 600;
}

.tile-caption .s {
    display: block;
    color: var(--on-dark-2);
    font-size: 0.75rem;
}

/* Wall layout hover caption */
.wall .tile-caption {
    opacity: 0;
    transition: opacity .25s ease;
}

.wall .tile:hover .tile-caption, .wall .tile:focus-visible .tile-caption {
    opacity: 1;
}

/* List view for photos */
.gallery-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gallery-grid[hidden],
.gallery-grid.macy-active[hidden],
.gallery-list[hidden] {
    display: none !important;
}

.gallery-list li {
    border-top: 1px solid var(--line);
}

.gallery-list li:last-child {
    border-bottom: 1px solid var(--line);
}

.gallery-list a {
    display: grid;
    grid-template-columns: 10rem 1fr auto;
    gap: 1.25rem;
    align-items: center;
    padding: 1rem 0.25rem;
    text-decoration: none;
    color: var(--ink);
}

@media (max-width: 64rem) {
    .gallery-list a {
        gap: 2.5rem;
    }
}

.gallery-list a:hover {
    color: var(--ink);
    background: var(--paper);
}

/* Large enough to recognise the picture; contain shows the whole photo
   whatever its orientation. */
.gallery-list .thumb {
    display: block;
    width: 10rem;
    aspect-ratio: 4/3;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-soft);
}

.gallery-list .thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: sepia(0.1);
}

.gallery-list .t {
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 500;
}

.gallery-list .s {
    font-size: 0.8125rem;
    color: var(--muted);
}

.gallery-list .code {
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.05em;
}

@media (max-width: 40rem) {
    .gallery-list a {
        grid-template-columns: 6.5rem 1fr;
        gap: 1rem;
    }

    .gallery-list .thumb {
        width: 6.5rem;
    }

    .gallery-list .code {
        display: none;
    }
}

.load-more {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3.5rem;
    flex-wrap: wrap;
}

.load-more .count {
    color: var(--muted);
    font-size: 0.8125rem;
}

/* --- FILTERS --- */
.page-hero {
    padding: 3.5rem 0 3rem;
    border-bottom: 1px solid var(--line);
}

.page-hero h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin: 1rem 0;
}

.page-hero h1 em {
    font-style: italic;
    color: var(--accent-2);
    font-weight: 500;
}

.page-hero-lede {
    font-size: 1.0625rem;
    color: var(--ink-2);
    max-width: 36rem;
    margin: 0;
}

.hero-meta {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.hero-meta .stat-num {
    font-size: 2rem;
}

.filterbar {
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}

.filterbar-inner {
    max-width: 82rem;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: grid;
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 40rem) {
    .filterbar-inner {
        grid-template-columns: 1fr;
    }
}

.search {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.55rem 1.1rem;
    background: var(--bg);
}

.search input {
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 0.9375rem;
    flex: 1;
    color: var(--ink);
    min-width: 8rem;
}

.search svg {
    color: var(--muted);
    flex-shrink: 0;
}

.sort label {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-right: 0.4rem;
}

.sort select {
    border: 1px solid var(--line);
    background: var(--bg);
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    font: inherit;
    font-size: 0.8125rem;
    min-height: 2.25rem;
    color: var(--ink);
    cursor: pointer;
}

.chips {
    max-width: var(--maxw);
    margin: 0 auto;
    margin-block: .2rem;
    padding: 0 2rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

.chips.row1 {
    padding-top: 1rem;
}

.chips.last {
    padding-bottom: 1rem;
}

.chip-group {
    font-size: 0.6875rem;
    color: var(--muted);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
    margin-right: 0.25rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.25rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg);
    font: inherit;
    font-size: 0.8125rem;
    color: var(--ink-2);
    cursor: pointer;
}

.chip:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.chip[aria-pressed="true"] {
    background: var(--ink);
    color: var(--on-dark);
    border-color: var(--ink);
}

.chip .count {
    color: var(--muted);
    font-size: 0.75rem;
}

.chip[aria-pressed="true"] .count {
    color: var(--on-dark-2);
}

/* --- DOCUMENTS --- */
.tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.tab {
    min-height: 2.5rem;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    background: transparent;
    border: 0;
}

.tab[aria-selected="true"] {
    background: var(--ink);
    color: var(--on-dark);
}

.modes {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.modes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 64rem) {
    .modes-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.modes h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 3.4vw, 3rem);
    letter-spacing: -0.02em;
    margin: 1rem 0 1.25rem;
    line-height: 1.08;
}

.modes > .container > .modes-grid > div > p {
    color: var(--ink-2);
    font-size: 1.0625rem;
    line-height: 1.7;
}

.mode-cards {
    display: grid;
    gap: 0.9rem;
}

.mode {
    display: grid;
    grid-template-columns: 3.5rem 1fr;
    gap: 1.25rem;
    align-items: start;
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.mode-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 8px;
    background: var(--bg-soft);
    display: grid;
    place-items: center;
    color: var(--accent-2);
}

.mode h3 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.25rem;
    margin: 0 0 0.4rem;
}

.mode p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--muted);
}

.docs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
}

@media (max-width: 64rem) {
    .docs {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 40rem) {
    .docs {
        grid-template-columns: 1fr;
    }
}

.doc-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doc-cover {
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 4px;
    background: var(--bg-soft);
    position: relative;
    box-shadow: 0 18px 36px -20px rgba(20, 17, 12, 0.25);
    transition: transform .3s ease;
    text-decoration: none;
}

.doc-cover::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1rem;
    background: linear-gradient(to right, rgba(20, 17, 12, 0.2), rgba(20, 17, 12, 0));
    z-index: 2;
}

.doc-card:hover .doc-cover {
    transform: translateY(-4px);
}

.doc-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doc-badge {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 3;
    padding: 0.25rem 0.6rem;
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(255, 252, 244, 0.95);
    border-radius: 3px;
    color: var(--ink);
}

.doc-info h3 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.25rem;
    margin: 0 0 0.4rem;
    line-height: 1.2;
}

.doc-meta {
    display: flex;
    gap: 0.9rem;
    color: var(--muted);
    font-size: 0.8125rem;
    flex-wrap: wrap;
}

.doc-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.25rem;
    font-size: 0.8125rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink-2);
    cursor: pointer;
    text-decoration: none;
}

.mini-btn:hover {
    border-color: var(--ink);
    color: var(--ink);
}

/* --- FILMS --- */
.films-bg {
    background: var(--ink);
    color: var(--on-dark);
}

.films-bg .eyebrow {
    color: var(--highlight);
}

.films-bg h2 {
    color: var(--on-dark);
}

.films-bg .section-head p {
    color: var(--on-dark-2);
}

.films-bg .section-link {
    color: var(--on-dark);
    border-color: var(--on-dark-2);
}

.films {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2.5rem 1.75rem;
    margin-top: 2.5rem;
}

@media (max-width: 64rem) {
    .films {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 36rem) {
    .films {
        grid-template-columns: 1fr;
    }
}

.film {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.film-poster {
    position: relative;
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #2a241b, #14110c);
    border: 1px solid rgba(255, 252, 244, 0.12);
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.film-poster:hover,
.film-poster:focus-visible {
    border-color: rgba(255, 252, 244, 0.45);
}

.film-poster-fallback {
    position: absolute;
    top: 0.75rem;
    left: 0.9rem;
    font-family: var(--serif);
    font-size: 1.125rem;
    letter-spacing: 0.04em;
    color: var(--on-dark-2);
}

.film-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    filter: sepia(0.1) contrast(1.1) saturate(0.8);
}

.film-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.film-play span {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: rgba(255, 252, 244, 0.95);
    color: var(--ink);
    display: grid;
    place-items: center;
}

.film-duration {
    position: absolute;
    bottom: 0.6rem;
    right: 0.6rem;
    padding: 0.2rem 0.5rem;
    background: rgba(20, 17, 12, 0.8);
    color: var(--on-dark);
    font-size: 0.6875rem;
    border-radius: 3px;
}

.film-info h3 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.1875rem;
    line-height: 1.3;
    margin: 0 0 0.5rem;
    color: var(--on-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.film-info .doc-meta {
    color: var(--on-dark-2);
}

.film-info p {
    color: var(--on-dark-2);
    font-size: 0.9375rem;
    margin: 0.5rem 0 1rem;
}

.film-info .mini-btn {
    background: transparent;
    color: var(--on-dark);
    border-color: rgba(247, 242, 232, 0.4);
}

.film-info .mini-btn:hover {
    border-color: var(--on-dark);
    background: rgba(247, 242, 232, 0.12);
}

/* --- FORMS --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 5rem;
    align-items: start;
}

@media (max-width: 64rem) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.form-intro h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.85rem, 3.2vw, 2.75rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 1rem 0 1.25rem;
}

.form-intro p {
    color: var(--ink-2);
    font-size: 1.0625rem;
    line-height: 1.7;
    margin: 0 0 1.25rem;
}

.benefits {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: grid;
    gap: 0;
}

.benefits li {
    display: flex;
    gap: 0.9rem;
    align-items: start;
    color: var(--ink-2);
    font-size: 0.9375rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--line);
}

.benefits li:first-child {
    border-top: 0;
}

.benefits li svg {
    color: var(--accent-2);
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.form-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.5rem;
}

.field {
    margin-bottom: 1.5rem;
}

.field label {
    display: block;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    color: var(--ink-2);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.field .req {
    color: var(--accent-2);
}

.field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--bg);
    border-radius: 6px;
    padding: 0.7rem 0.85rem;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    min-height: 2.75rem;
}

.field textarea {
    resize: vertical;
    min-height: 7rem;
}

.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--ink);
}

.field .hint {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 0.35rem;
}


.dropzone {
    border: 1.5px dashed var(--line);
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
    background: var(--bg-soft);
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.dropzone svg {
    color: var(--accent-2);
    margin: 0 auto 0.6rem;
}

.dropzone strong {
    display: block;
    color: var(--ink);
    margin-bottom: 0.25rem;
}

.dropzone small {
    font-size: 0.8125rem;
}

.form-submit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.form-note {
    color: var(--muted);
    font-size: 0.8125rem;
    max-width: 22rem;
    margin: 0;
}

/* --- CONTACT --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: stretch;
}

@media (max-width: 64rem) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.contact-info h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 3.4vw, 3rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin: 1rem 0 1.5rem;
}

.contact-cards {
    display: grid;
    margin-top: 2rem;
}

.ci {
    padding: 1.4rem 0;
    display: grid;
    grid-template-columns: 2.5rem 1fr auto;
    align-items: center;
    gap: 1.1rem;
    border-top: 1px solid var(--line);
}

.ci:last-child {
    border-bottom: 1px solid var(--line);
}

.ci-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--bg-soft);
    display: grid;
    place-items: center;
    color: var(--accent-2);
}

.ci-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.2rem;
}

.ci-val {
    font-size: 1rem;
    color: var(--ink);
    font-weight: 600;
}

.map {
    position: relative;
    aspect-ratio: 4/5;
    min-height: 28rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

.map-img {
    position: absolute;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
    opacity: 0.7;
    filter: sepia(0.1) contrast(1.02) saturate(0.9);
}

.map-pin {
    position: absolute;
    top: 46%;
    left: 50%;
    transform: translate(-50%, -100%);
    display: grid;
    place-items: center;
    gap: 0.4rem;
}

.map-pin .label {
    background: var(--paper);
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink);
    box-shadow: 0 10px 20px rgba(20, 17, 12, 0.2);
}

.map-pin .dot {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 0 6px rgba(122, 59, 29, 0.25);
}

.map-credit {
    position: absolute;
    bottom: 0.6rem;
    right: 0.75rem;
    font-size: 0.625rem;
    letter-spacing: 0.06em;
    color: var(--ink-2);
    text-transform: uppercase;
    background: rgba(247, 242, 232, 0.85);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

/* --- PORTRAITS / TEAM --- */
.team-wrap {
    background: var(--paper);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.team {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 64rem) {
    .team {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 40rem) {
    .team {
        grid-template-columns: 1fr 1fr;
    }
}

.member-photo {
    aspect-ratio: 4/5;
    overflow: hidden;
    border-radius: 4px;
    background: var(--bg-soft);
    margin: 0 0 1rem;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.08) contrast(1.02) saturate(0.9);
}

.member h3 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.125rem;
    margin: 0 0 0.25rem;
}

.member-role {
    font-size: 0.75rem;
    color: var(--muted);
}

/* --- PHOTO / ITEM DETAIL --- */
.detail-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 3.5rem;
    align-items: start;
}

@media (max-width: 64rem) {
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.detail-figure {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

.detail-figure img {
    width: 100%;
    height: auto;
}

.detail-code {
    display: inline-block;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    color: var(--accent-2);
    background: var(--bg-soft);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
}

.detail h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.85rem, 3.4vw, 2.75rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 1rem 0;
}

.meta-list {
    list-style: none;
    margin: 1.5rem 0;
    padding: 0;
}

.meta-list div {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 1rem;
    padding: 0.8rem 0;
    border-top: 1px solid var(--line);
}

@media (max-width: 64rem) {
    .meta-list div {
        grid-template-columns: 7rem 1fr;
    }
}

.meta-list dt {
    color: var(--muted);
    font-size: 0.875rem;
}

.meta-list dd {
    margin: 0;
    color: var(--ink);
    font-size: 0.9375rem;
}

.meta-list a {
    color: var(--accent-2);
}

.detail-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

/* --- PROSE PAGES --- */
.prose {
    max-width: 48rem;
}

.prose h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    letter-spacing: -0.015em;
    margin: 2.5rem 0 1rem;
    line-height: 1.15;
}

.prose h3 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.3rem;
    margin: 1.75rem 0 0.6rem;
}

.prose p {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--ink-2);
    margin: 0 0 1rem;
}

.prose ul, .prose ol {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--ink-2);
    padding-left: 1.4rem;
    margin: 0 0 1.25rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose a {
    color: var(--accent-2);
}

/* --- USABILITY CARDS --- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 64rem) {
    .features {
        grid-template-columns: 1fr;
    }
}

.feature {
    padding: 1.75rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.feature .fnum {
    font-family: var(--serif);
    font-size: 2.5rem;
    color: var(--accent-2);
    line-height: 1;
}

.feature .ficon {
    width: 3rem;
    height: 3rem;
    border-radius: 8px;
    background: var(--bg-soft);
    display: grid;
    place-items: center;
    color: var(--accent-2);
    margin-bottom: 1rem;
}

.feature h3 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.2rem;
    margin: 0.75rem 0 0.5rem;
}

.feature p {
    font-size: 0.9375rem;
    color: var(--ink-2);
    margin: 0;
    line-height: 1.6;
}

.feature .tag {
    display: inline-block;
    margin-top: 0.9rem;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
}

.standards {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
}

.standards caption {
    text-align: left;
    color: var(--muted);
    font-size: 0.8125rem;
    margin-bottom: 0.6rem;
}

.standards th, .standards td {
    text-align: left;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.standards thead th {
    background: var(--bg-soft);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.standards tbody th {
    font-weight: 600;
    color: var(--ink);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
}

.status-ok {
    background: #E4EAD9;
    color: #355024;
}

.status-partial {
    background: #F4E6CE;
    color: #6E4A12;
}

/* --- CTA SECTION --- */
.cta {
    padding: 7rem 0;
    background: var(--ink);
    color: var(--on-dark);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-bg {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background-size: cover;
    background-position: center;
    filter: sepia(0.3) contrast(1.05);
}

.cta .container {
    position: relative;
    z-index: 2;
}

.cta .eyebrow {
    color: var(--highlight);
}

.cta h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.25rem, 4.4vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 1rem auto 1.5rem;
    max-width: 48rem;
    color: var(--on-dark);
}

.cta p {
    color: var(--on-dark-2);
    max-width: 35rem;
    margin: 0 auto 2.5rem;
    font-size: 1.0625rem;
}

.cta .btn {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--paper);
}

.cta .btn:hover {
    background: var(--highlight);
    border-color: var(--highlight);
    color: var(--ink);
}

.cta .btn-ghost {
    background: transparent;
    color: var(--on-dark);
    border-color: rgba(247, 242, 232, 0.4);
}

.cta .btn-ghost:hover {
    background: var(--on-dark);
    color: var(--ink);
}

/* --- FOOTER --- */
footer.site {
    padding: 5rem 0 2rem;
    background: var(--bg);
    border-top: 1px solid var(--line);
}

.foot-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 3.5rem;
    border-bottom: 1px solid var(--line);
}

@media (max-width: 64rem) {
    .foot-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 40rem) {
    .foot-grid {
        grid-template-columns: 1fr;
    }
}

.foot-brand {
    max-width: 20rem;
}

.foot-brand p {
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.foot-logo {
    height: 3.9rem;
    width: auto;
    display: block;
    margin-bottom: 0.5rem;
}

.foot-commune-logo {
    height: 6.75rem;
    width: auto;
    display: block;
    margin-bottom: 1rem;
}

.foot h2 {
    font-size: 0.6875rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    margin: 0.4rem 0 1.1rem;
}

.foot ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.foot ul a {
    color: var(--ink-2);
    font-size: 0.875rem;
    text-decoration: none;
}

.foot ul a:hover {
    color: var(--accent-2);
    text-decoration: underline;
}

.foot address {
    font-style: normal;
    color: var(--ink-2);
    font-size: 0.875rem;
    line-height: 1.7;
}

.foot-bottom {
    display: flex;
    justify-content: space-between;
    padding-top: 1.75rem;
    color: var(--muted);
    font-size: 0.75rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.foot-bottom a {
    color: var(--muted);
}

/* --- SCROLL CHIPS (photos page list styling) --- */
.view-toggle button[aria-pressed="true"] {
    background: var(--ink) !important;
    color: var(--on-dark) !important;
}

[hidden] {
    display: none !important;
}

/* ==========================================================================
   HEADER / NAV (DAP-REDESIGN MOCKUP IMPLEMENTATION)
   ========================================================================== */
header.site {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: rgba(247, 242, 232, 0.92) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line) !important;
}

.nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
    max-width: 90rem;
    margin: 0 auto;
    padding: 0.9rem 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--ink);
}

.brand:hover {
    color: var(--ink);
    text-decoration: none;
}

.brand-logo {
    height: 4.35rem;
    width: auto;
    display: block;
}

@media (max-width: 40rem) {
    .brand-logo {
        height: 3.6rem;
    }
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 1.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative; /* Necessary for absolute positioning of #magic-line */
}

.nav-links a {
    color: var(--ink-2);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.4rem 0.15rem;
    position: relative;
    display: inline-block;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--ink);
    text-decoration: none;
}

.nav-links a.active,
.nav-links li.active > a,
.nav-links a[aria-current="page"] {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

/* Magic line interactive navigation indicator */
#magic-line {
    position: absolute;
    bottom: -2px;
    height: 2px;
    background-color: var(--accent-2);
    transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    z-index: 10;
}

/* On mobile/tablet, disable magic-line and show default active underlines */
@media (max-width: 64rem) {
    #magic-line {
        display: none !important;
    }

    .nav-links a.active::after,
    .nav-links li.active > a::after,
    .nav-links a[aria-current="page"]::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -2px;
        height: 2px;
        background: var(--accent-2);
    }
}

/* On desktop, hide static pseudo-elements active underlines as magic-line handles it */
@media (min-width: 64.01rem) {
    .nav-links a.active::after,
    .nav-links li.active > a::after,
    .nav-links a[aria-current="page"]::after {
        display: none !important;
    }
}

.nav-actions {
    display: flex;
    gap: 0.625rem;
    align-items: center;
}

/* Expandable Nav search form */
.nav-search-form {
    position: relative;
}

.nav-search-form input {
    padding: 0.4rem 1rem 0.4rem 2.25rem;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    font-size: 0.875rem;
    background: transparent;
    width: 150px;
    color: var(--ink);
    transition: width 0.3s ease, border-color 0.2s ease;
}

.nav-search-form input:focus {
    width: 220px;
    border-color: var(--accent-2);
    outline: none;
    background: var(--paper);
}

.nav-search-form svg {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
}

/* Reset Bootstrap/style.css conflict on screen-reader span inside toggle */
#nav-toggle span.sr-only {
    background: transparent !important;
    height: 1px !important;
    width: 1px !important;
    position: absolute !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
#nav-toggle span.sr-only::before,
#nav-toggle span.sr-only::after {
    display: none !important;
}

@media (max-width: 64rem) {
    .nav {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.9rem 1.5rem;
        width: 100% !important;
    }

    .brand {
        width: auto !important;
        float: none !important;
        padding: 0 !important;
    }

    .nav-links {
        display: none !important;
    }

    /* Hide the parent <nav> element wrapping .nav-links so it doesn't take space */
    .nav > nav {
        display: none !important;
    }

    .nav-toggle {
        display: grid !important;
    }

    .nav-actions .nav-search-form,
    .nav-actions .btn {
        display: none !important;
    }
}

/* Dropdown menu overrides & animated transitions */
.nav-links li.dropdown {
    position: relative !important;
}

.nav-links .dropdown-menu {
    display: block !important;
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(8px) !important;
    right: auto !important;
    width: max-content !important;
    min-width: 14rem !important;
    max-width: 22rem !important;
    background: var(--paper) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(20, 17, 12, 0.08), 0 1px 3px rgba(20, 17, 12, 0.02) !important;
    padding: 0.75rem !important;
    z-index: 1000;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

/* Adjust yamm/bootstrap grid margins inside standard dropdowns */
.nav-links .dropdown-menu .yamm-content {
    padding: 0 !important;
}

.nav-links .dropdown-menu .row {
    margin: 0 !important;
    display: block !important;
}

.nav-links .dropdown-menu ul {
    margin: 0 !important;
    padding: 0 !important;
}

/* Reveal menu on hover and when .open is set by JS */
.nav-links li.dropdown:hover .dropdown-menu,
.nav-links li.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) !important;
    pointer-events: auto;
}

.nav-links .dropdown-menu a {
    color: var(--ink-2) !important;
    padding: 0.5rem 1rem;
    display: block;
    border-radius: calc(var(--radius) - 2px);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-links .dropdown-menu a:hover {
    background: var(--bg-soft) !important;
    color: var(--ink) !important;
    text-decoration: none;
}

.nav-links .dropdown-menu li.active > a {
    font-weight: 600;
    color: var(--ink) !important;
    background: var(--bg-soft) !important;
}

/* Desktop Dropdown Chevron Indicator */
.nav-links li.dropdown > a::after {
    content: "";
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.35rem;
    border-left: 0.25rem solid transparent;
    border-right: 0.25rem solid transparent;
    border-top: 0.3rem solid var(--ink-2);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-top-color 0.2s ease;
}

.nav-links li.dropdown:hover > a::after,
.nav-links li.dropdown.open > a::after {
    transform: rotate(180deg);
    border-top-color: var(--ink);
}

/* Mobile Accordion Dropdowns Animation */
.mobile-nav .dropdown-menu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    display: block !important;
    position: static;
    float: none;
    padding: 0 !important;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent !important;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.mobile-nav li.dropdown.open > .dropdown-menu,
.mobile-nav li.dropdown.show > .dropdown-menu,
.mobile-nav li.open > .dropdown-menu,
.mobile-nav li.show > .dropdown-menu {
    max-height: 800px;
    opacity: 1;
    padding: 0.5rem 0 0.5rem 1rem !important; /* Indent sub-items for clear hierarchy */
}

/* Mobile toggle caret indicator transition */
.mobile-nav li .caretmobile {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav li.open .caretmobile,
.mobile-nav li.show .caretmobile {
    transform: rotate(180deg);
}

/* --- DUAL RANGE SLIDER --- */
.dual-range-slider {
    position: absolute !important;
    width: 100% !important;
    top: -10px !important;
    height: 24px !important;
    left: 0 !important;
    background: none !important;
    pointer-events: none !important;
    -webkit-appearance: none !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
}

.dual-range-slider::-webkit-slider-runnable-track {
    background: none;
    border: none;
}

.dual-range-slider::-moz-range-track {
    background: none;
    border: none;
}

.dual-range-slider::-webkit-slider-thumb {
    pointer-events: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-2);
    border: 4px solid #ffffff;
    cursor: pointer;
    -webkit-appearance: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
    margin-top: -10px; /* center on 4px track */
}

.dual-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.dual-range-slider::-moz-range-thumb {
    pointer-events: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-2);
    border: 4px solid #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.dual-range-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
}

/* ==========================================================================
   MOBILE MENU DRAWER THEME & Z-INDEX OVERRIDES
   ========================================================================== */

/* Fix main background so it does not get covered by style.css white backgrounds */
#main {
    background-color: transparent !important;
}

/* Off-canvas mobile navigation drawer styling */
nav.mobile-nav {
    background-color: var(--paper) !important;
    border-right: 1px solid var(--line) !important;
    z-index: 100000 !important; /* Display on top of content & header but below admin toolbar */
    padding: 2.5rem 1.5rem !important;
}

/* Mobile nav search input styling */
.mobile-nav .searchbox-phone {
    margin-bottom: 2rem !important;
    margin-top: 0 !important;
    padding: 0 !important;
}

.mobile-nav .searchbox-phone input {
    background: var(--bg) !important;
    border: 1px solid var(--line) !important;
    color: var(--ink) !important;
    border-radius: 6px !important;
    padding: 0.75rem 1rem !important;
    font-family: var(--sans) !important;
}

/* Mobile nav links */
.mobile-nav .main-menu {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.mobile-nav .main-menu > li {
    border-bottom: 1px solid var(--line) !important;
    line-height: normal !important;
    padding: 0.85rem 0 !important;
}

.mobile-nav .main-menu > li > a {
    font-family: var(--sans) !important;
    font-size: 1.125rem !important;
    font-weight: 500 !important;
    color: var(--ink) !important;
    text-decoration: none !important;
    display: block !important;
}

.mobile-nav .main-menu > li > a:hover,
.mobile-nav .main-menu > li.active > a {
    color: var(--accent-2) !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   RESPONSIVE TARGET BREAKPOINTS (Mobile, iPad, Macbook Air)
   ========================================================================== */

/* 1. MOBILE VERSION (max-width: 48rem / 768px) */
@media (max-width: 48rem) {
    body {
        font-size: 0.9375rem !important; /* Keep readable size, override style.css 12px */
    }

    .container {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Collapse grids to single column */
    .hero-grid, .collections, .editorial-grid, .modes-grid,
    .form-grid, .contact-grid, .detail-grid, .page-hero .hero-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Key figures stay on a single row: one column per figure, so the 3 or 4
       stats (films are optional) always share the width evenly. */
    .stats {
        padding: 2rem 0;
    }

    .stats-grid {
        grid-template-columns: none !important;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        gap: 0.75rem !important;
    }

    .stats .stat-num {
        font-size: 1.75rem;
    }

    .stats .stat-label {
        margin-top: 0.4rem;
        font-size: 0.6875rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .docs {
        grid-template-columns: 1fr !important;
    }

    .films, .film {
        grid-template-columns: 1fr !important;
    }

    .foot-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

/* 2. IPAD VERSION (PORTRAIT & LANDSCAPE) (min-width: 48.0625rem) and (max-width: 64rem) (769px - 1024px) */
@media (min-width: 48.0625rem) and (max-width: 64rem) {
    /* Hide desktop menu and show toggle hamburger to prevent nav overflow wrap */
    .nav-links {
        display: none !important;
    }

    .nav-toggle {
        display: grid !important;
    }

    .nav-actions .nav-search-form,
    .nav-actions .btn {
        display: none !important;
    }

    /* Grids and columns designed for tablets */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .docs {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .collections {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .foot-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .container {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* 3. SMALL SCREEN VERSION (Macbook Air) (min-width: 64.0625rem) and (max-width: 90rem) (1025px - 1440px) */
@media (min-width: 64.0625rem) and (max-width: 90rem) {
    /* Optimize navigation link gaps for small screens */
    .nav-links {
        gap: 1.25rem !important;
    }

    .nav-links a {
        font-size: 0.9375rem !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .docs {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* 4. LARGE SCREENS & CONTAINER WIDTH (min-width: 64.0625rem / 1025px and up) */
@media (min-width: 64.0625rem) {
    .container {
        width: 100% !important;
        max-width: 82rem !important; /* Allow width expansion up to 1312px */
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* ==========================================================================
   MASONRY GRID LAYOUT OVERRIDES
   ========================================================================== */

/* 1. Common Masonry Container Styles */
.gallery-grid.wall,
.collections.masonry-active,
.docs.masonry-active {
    display: block !important;
    position: relative;
    width: 100% !important;
}

.gallery-grid.wall:after,
.collections.masonry-active:after,
.docs.masonry-active:after {
    content: '';
    display: block;
    clear: both;
}

/* 2. Recent Photos Wall Masonry */
.gallery-grid.wall .grid-sizer {
    width: 23.4%;
}

.gallery-grid.wall .gutter-sizer {
    width: 2%;
}

.gallery-grid.wall .tile {
    width: 23.4%;
    margin-bottom: 1rem;
    aspect-ratio: auto !important;
    height: auto !important;
}

.gallery-grid.wall .tile img {
    height: auto !important;
    display: block;
    width: 100%;
}

.gallery-grid.wall .tile.feat {
    width: 48.8%;
}

@media (max-width: 64rem) {
    .gallery-grid.wall .grid-sizer {
        width: 31.2%;
    }

    .gallery-grid.wall .gutter-sizer {
        width: 3%;
    }

    .gallery-grid.wall .tile {
        width: 31.2%;
        margin-bottom: 1rem;
    }

    .gallery-grid.wall .tile.feat {
        width: 65.4%;
    }
}

@media (max-width: 48rem) {
    .gallery-grid.wall .grid-sizer {
        width: 47.8%;
    }

    .gallery-grid.wall .gutter-sizer {
        width: 4%;
    }

    .gallery-grid.wall .tile {
        width: 47.8%;
        margin-bottom: 1rem;
    }

    .gallery-grid.wall .tile.feat {
        width: 100% !important;
    }
}

@media (max-width: 30rem) {
    .gallery-grid.wall .grid-sizer,
    .gallery-grid.wall .tile,
    .gallery-grid.wall .tile.feat {
        width: 100% !important;
        margin-bottom: 1rem !important;
    }

    .gallery-grid.wall .gutter-sizer {
        width: 0% !important;
    }
}

/* 3. Collections Masonry */
.collections.masonry-active .grid-sizer {
    width: 23.4%;
}

.collections.masonry-active .gutter-sizer {
    width: 2%;
}

.collections.masonry-active .coll-card {
    width: 23.4%;
    margin-bottom: 1.5rem;
}

@media (max-width: 64rem) {
    .collections.masonry-active .grid-sizer {
        width: 47.8%;
    }

    .collections.masonry-active .gutter-sizer {
        width: 4%;
    }

    .collections.masonry-active .coll-card {
        width: 47.8%;
    }
}

@media (max-width: 48rem) {
    .collections.masonry-active .grid-sizer,
    .collections.masonry-active .coll-card {
        width: 100% !important;
    }

    .collections.masonry-active .gutter-sizer {
        width: 0% !important;
    }
}

/* 4. Documents Library Masonry */
.docs.masonry-active .grid-sizer {
    width: 31.2%;
}

.docs.masonry-active .gutter-sizer {
    width: 3%;
}

.docs.masonry-active .doc-card {
    width: 31.2%;
    margin-bottom: 1.75rem;
}

@media (max-width: 64rem) {
    .docs.masonry-active .grid-sizer {
        width: 47.8%;
    }

    .docs.masonry-active .gutter-sizer {
        width: 4%;
    }

    .docs.masonry-active .doc-card {
        width: 47.8%;
    }
}

@media (max-width: 48rem) {
    .docs.masonry-active .grid-sizer,
    .docs.masonry-active .doc-card {
        width: 100% !important;
    }

    .docs.masonry-active .gutter-sizer {
        width: 0% !important;
    }
}

/* --- STITCH ERGONOMIC GALLERY FILTER PANEL --- */
.stitch-filter-card {
    width: 100%;
    margin: 1.5rem 0 2.5rem 0;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(20, 17, 12, 0.04);
}

@media (max-width: 48rem) {
    .stitch-filter-card {
        margin: 1rem 0 1.5rem 0;
    }
}

/* Timeline Slider Section (Full-width top section) */
.stitch-slider-section {
    padding: 2rem;
    border-bottom: 1px solid var(--line);
}

.stitch-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stitch-slider-title {
    font-family: var(--sans);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--ink);
    margin: 0;
}

.stitch-reset-btn {
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stitch-reset-btn:hover:not(:disabled) {
    background: var(--bg-soft);
    color: var(--ink);
    border-color: var(--muted);
}

.stitch-reset-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.stitch-slider-body {
    padding: 0 1rem;
}

/* Track layout */
.slider-track-wrapper {
    position: relative;
    height: 4px;
    background: var(--line);
    border-radius: 999px;
    margin: 2rem 0 1.5rem 0;
}

.slider-track-active {
    position: absolute;
    height: 100%;
    background: var(--accent-2);
    border-radius: 999px;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    padding: 0 0.5rem;
    margin-top: 0.5rem;
}

/* Categorical Filters Section (Stacked bottom section) */
.stitch-categories-section {
    padding: 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

.stitch-category-row {
    display: flex;
    align-items: center;
    gap: 2rem;
}

@media (max-width: 48rem) {
    .stitch-category-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

.stitch-category-label {
    width: 6rem;
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 800;
    flex-shrink: 0;
}

.stitch-chips-list {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Collapsible chip rows: folded to a single line of pills, with a "+N"
   toggle when some pills wrap below. The script in album_detail.html
   measures the overflow and drives max-height. */
.stitch-category-row:has(.stitch-chips-collapsible) {
    align-items: flex-start;
}

.stitch-category-row:has(.stitch-chips-collapsible) .stitch-category-label {
    display: flex;
    align-items: center;
    min-height: calc(2.25rem + 4px);
}

.stitch-chips-collapsible {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.stitch-chips-collapsible .stitch-chips-list {
    position: relative; /* offsetParent for the pills, used to find hidden ones */
    flex: 1 1 auto;
    min-width: 0;
    padding: 2px; /* room for the pill focus ring inside the clipped box */
    overflow: hidden;
    transition: max-height .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chips-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.25rem;
    margin-top: 2px;
    padding: 0.4rem 0.9rem;
    border: 1px dashed var(--line);
    border-radius: 999px;
    background: transparent;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chips-toggle[hidden] {
    display: none;
}

.chips-toggle:hover,
.chips-toggle:focus-visible {
    border-style: solid;
    border-color: var(--ink);
    color: var(--ink);
}

/* A selected pill sits in the hidden part: make the toggle stand out. */
.chips-toggle.has-hidden-active {
    border-style: solid;
    border-color: var(--accent-2);
    color: var(--accent-2);
    background: var(--bg-soft);
}

.chips-toggle-icon {
    font-size: 0.7rem;
    transition: transform .3s ease;
}

.chips-toggle[aria-expanded="true"] .chips-toggle-icon {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .stitch-chips-collapsible .stitch-chips-list,
    .chips-toggle-icon {
        transition: none;
    }
}

/* Hide scrollbar utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* Ergonomic Tag Pills */
.pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.25rem;
    padding: 0.4rem 1.15rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    font: inherit;
    font-size: 0.8125rem;
    color: var(--ink-2);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.pill-tag:hover {
    border-color: var(--ink);
    color: var(--ink);
    background: var(--bg);
}

/* Active Pill tag with warm sand/sienna accent styling */
.pill-tag[aria-pressed="true"] {
    background: var(--bg-soft) !important;
    color: var(--accent-2) !important;
    border-color: var(--accent-2) !important;
    font-weight: 600;
}

.pill-tag[aria-pressed="true"]:hover {
    background: var(--bg-soft) !important;
    border-color: var(--accent-2) !important;
    color: var(--accent-2) !important;
}

/* Dismissible close icon inside tags */
.pill-close-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
    margin-left: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.pill-tag:hover .pill-close-icon {
    opacity: 1;
}


/* ==========================================================================
   MOBILE FILTER DRAWER (Bottom Sheet)
   Inspired by Stitch "Galerie Photo - Mobile Interactif" design.
   ========================================================================== */

/* --- Mobile Filter Trigger Button --- */
.mobile-filter-trigger {
    display: none; /* Hidden on desktop */
}

@media (max-width: 48rem) {
    .mobile-filter-trigger {
        display: block;
        margin-bottom: 1rem;
    }

    /* Hide desktop filter card on mobile */
    .stitch-filter-desktop {
        display: none !important;
    }
}

.mobile-filter-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.875rem 1.5rem;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 0.625rem;
    font-family: var(--sans);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-filter-btn:hover {
    background: var(--bg);
    border-color: var(--muted);
}

.mobile-filter-btn:active {
    transform: scale(0.98);
}

.mobile-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    background: var(--accent-2);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 999px;
    line-height: 1;
}


/* --- Mobile Filter Overlay --- */
.mobile-filter-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(20, 17, 12, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Overlay transitions */
.overlay-enter {
    transition: opacity 0.3s ease;
}
.overlay-enter-start {
    opacity: 0;
}
.overlay-enter-end {
    opacity: 1;
}
.overlay-leave {
    transition: opacity 0.3s ease;
}
.overlay-leave-start {
    opacity: 1;
}
.overlay-leave-end {
    opacity: 0;
}


/* --- Mobile Filter Drawer (Bottom Sheet) --- */
.mobile-filter-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: var(--paper);
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: 0 -8px 40px rgba(20, 17, 12, 0.15);
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;

    section {
        padding: 0;
    }
}

/* Drawer transitions */
.drawer-enter {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.drawer-enter-start {
    transform: translateY(100%);
}
.drawer-enter-end {
    transform: translateY(0);
}
.drawer-leave {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.drawer-leave-start {
    transform: translateY(0);
}
.drawer-leave-end {
    transform: translateY(100%);
}


/* --- Drawer Handle --- */
.drawer-handle-bar {
    display: flex;
    justify-content: center;
    padding: 0.75rem;
    cursor: grab;
}

.drawer-handle {
    width: 3rem;
    height: 0.25rem;
    background: var(--line);
    border-radius: 999px;
}


/* --- Drawer Header --- */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--line);
}

.drawer-title {
    font-family: var(--sans);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.drawer-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    background: none;
    color: var(--muted);
    cursor: pointer;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.drawer-close-btn:hover {
    background: var(--bg-soft);
    color: var(--ink);
}


/* --- Drawer Scrollable Content --- */
.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}


/* --- Drawer Filter Section --- */
.drawer-filter-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.drawer-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-section-label {
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 800;
}

.drawer-range-badge {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ink);
    background: var(--bg-soft);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
}

.drawer-slider-body {
    padding: 1rem 0.5rem 0.5rem 0.5rem;
}

.drawer-chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}


/* --- Drawer Footer (sticky actions) --- */
.drawer-footer {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--line);
    background: var(--paper);
    flex-shrink: 0;
}

.drawer-btn-reset,
.drawer-btn-apply {
    flex: 1;
    padding: 1rem;
    border-radius: 0.75rem;
    font-family: var(--sans);
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.drawer-btn-reset {
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
}

.drawer-btn-reset:hover {
    background: var(--bg-soft);
    border-color: var(--muted);
}

.drawer-btn-apply {
    background: var(--ink);
    border: 1px solid var(--ink);
    color: var(--on-dark);
    box-shadow: 0 4px 16px rgba(20, 17, 12, 0.15);
}

.drawer-btn-apply:hover {
    background: var(--ink-2);
}

.drawer-btn-apply:active,
.drawer-btn-reset:active {
    transform: scale(0.98);
}

/* ==========================================================================
   MACY.JS DYNAMIC MASONRY (album gallery)
   ========================================================================== */

/* Macy positions the tiles absolutely: the container must leave grid mode. */
.gallery-grid.macy-active {
    display: block !important;
    position: relative;
    width: 100% !important;
    grid-template-columns: none !important;
    gap: 0 !important;
}

/* Without Macy (CMS edit mode for staff, or no JS) the album grid falls back
   to CSS columns instead of square cells: photos keep their proportions and
   are never cropped. The CMS <template> markers are not rendered, so they do
   not disturb the columns. */
#gallery-grid:not(.macy-active) {
    display: block;
    columns: 3;
    column-gap: 1rem;
}

@media (max-width: 64rem) {
    #gallery-grid:not(.macy-active) {
        columns: 2;
    }
}

@media (max-width: 30rem) {
    #gallery-grid:not(.macy-active) {
        columns: 1;
    }
}

#gallery-grid:not(.macy-active) .tile {
    display: block;
    break-inside: avoid;
    margin-bottom: 1rem;
    aspect-ratio: auto;
}

#gallery-grid:not(.macy-active) .tile img {
    height: auto;
    display: block;
    object-fit: initial;
}

/* Tiles keep their natural proportions instead of a forced aspect-ratio. */
.gallery-grid.macy-active .tile,
.gallery-grid.macy-active .tile.portrait,
.gallery-grid.macy-active .tile.landscape,
.gallery-grid.macy-active .tile.feat {
    aspect-ratio: auto !important;
    height: auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
}

.gallery-grid.macy-active .tile img {
    width: 100%;
    height: auto !important;
    display: block;
    object-fit: initial;
}

/* ==========================================================================
   ACCESSIBILITY HELPERS & BACK TO TOP
   ========================================================================== */

/* Visible to screen readers only. Referenced by several templates but never
   defined before, so those labels were laid out as empty visible boxes. */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* <main> is focused programmatically by the back-to-top button: never draw an
   outline around the whole page for that. */
main:focus {
    outline: none;
}

.scroll-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 60;
    display: grid;
    place-items: center;
    /* WCAG 2.5.8 minimum touch target, in px so a reduced root font-size
       cannot shrink it below the threshold. */
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--ink);
    border-radius: 50%;
    background: var(--ink);
    color: var(--on-dark);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(20, 17, 12, 0.25);
    transition: transform .2s ease, background-color .2s ease;
}

.scroll-top[hidden] {
    display: none;
}

.scroll-top:hover {
    background: var(--ink-2, var(--ink));
    transform: translateY(-2px);
}

.scroll-top:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .scroll-top {
        transition: none;
    }

    .scroll-top:hover {
        transform: none;
    }
}

@media (max-width: 40rem) {
    .scroll-top {
        right: 1rem;
        bottom: 1rem;
    }
}

/* Search correction notice and cross-domain matches (project/templates/search/). */
.search-notice, .search-also { margin: 1rem 0; padding: .75rem 1rem; border-left: 3px solid var(--accent-2); background: var(--paper); color: var(--ink-2); }
.search-notice a, .search-also a { color: var(--accent-2); }

/* Loading indicators: shared spinner (album gallery, global search). */
.gallery-spinner {
    display: inline-block;
    width: 1.75rem;
    height: 1.75rem;
    border: 3px solid var(--line, rgba(0, 0, 0, .15));
    border-top-color: var(--accent-2, #7A3B1D);
    border-radius: 50%;
    animation: gallery-spin .8s linear infinite;
}
@keyframes gallery-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gallery-spinner { animation-duration: 2.4s; } }

/* Global search (header + mobile nav): covers the page until the results load. */
.dap-page-loading {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    background: rgba(255, 252, 244, .6);
}
.dap-page-loading[hidden] { display: none; }
.dap-page-loading .gallery-spinner {
    width: 2.75rem;
    height: 2.75rem;
    box-sizing: border-box;
    background: var(--paper, #fff);
    box-shadow: 0 0 0 .5rem var(--paper, #fff);
}
