/* =====================================================================
   Geoff Dale Photography — public styles
   Direction: dark / minimal / photo-first (matching original).
   Logo is a letter-spaced light serif; nav is horizontal serif;
   hero images are centered with a soft film-frame vignette.
   ===================================================================== */

:root {
    --bg:          #0B0B0B;
    --bg-soft:     #151515;
    --bg-panel:    #1A1A1A;
    --ink:         #EDE4D3;
    --ink-soft:    #B8AE9A;
    --ink-muted:   #6E6557;
    --accent:      #C9A66B;           /* subtle warm gold */
    --rule:        rgba(237, 228, 211, 0.12);

    --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --font-body:    'Cormorant Garamond', Georgia, serif;
    --font-nav:     'Cormorant Garamond', Georgia, serif;

    --max-w: 1280px;
    --gutter: clamp(16px, 3vw, 40px);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--ink);
    letter-spacing: 0.02em;
    margin: 0 0 0.6em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.15; }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

img { max-width: 100%; height: auto; display: block; }

/* ---------- Header / Nav ------------------------------------------- */
.site-header {
    background: var(--bg);
    position: relative;      /* not sticky — we want the film-frame hero to feel immersive */
    z-index: 50;
}

.site-header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 36px var(--gutter) 24px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 32px;
}

/* Spaced-letter wordmark, like the original */
.brand {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.5rem, 2.4vw, 1.9rem);
    letter-spacing: 0.35em;
    color: var(--ink);
    text-transform: none;
    padding-right: 0.35em; /* offsets trailing letter-spacing */
}
.brand:hover { color: var(--ink); }
.brand small {
    display: block;
    font-family: var(--font-body);
    font-style: italic;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
    color: var(--ink-muted);
    margin-top: 2px;
    font-weight: 400;
}

/* Top-level nav — horizontal serif, roomy spacing */
nav.primary {
    justify-self: end;
}
nav.primary ul {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    gap: 36px;
    align-items: center;
}
nav.primary li { position: relative; }
nav.primary > ul > li > a,
nav.primary > ul > li > span {
    font-family: var(--font-nav);
    font-weight: 400;
    font-size: 1.1rem;
    color: var(--ink);
    padding: 6px 2px;
    border-bottom: 1px solid transparent;
    transition: border-color 180ms, color 180ms;
    letter-spacing: 0.02em;
}
nav.primary > ul > li > a:hover,
nav.primary > ul > li.has-children:hover > a {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Sub-menu */
nav.primary li.has-children > ul {
    position: absolute;
    top: 100%;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    background: var(--bg-soft);
    border: 1px solid var(--rule);
    padding: 10px 0;
    min-width: 220px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
nav.primary li.has-children:hover > ul,
nav.primary li.has-children:focus-within > ul {
    display: flex;
}
nav.primary li.has-children > ul a {
    display: block;
    padding: 10px 22px;
    font-family: var(--font-nav);
    font-size: 1rem;
    color: var(--ink);
    white-space: nowrap;
}
nav.primary li.has-children > ul a:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--rule);
    padding: 8px 14px;
    cursor: pointer;
    color: var(--ink);
    font-family: var(--font-nav);
    font-size: 0.95rem;
    letter-spacing: 0.1em;
}

@media (max-width: 820px) {
    .site-header-inner { grid-template-columns: auto auto; padding-top: 20px; }
    .brand { font-size: 1.4rem; letter-spacing: 0.28em; }
    .nav-toggle { display: inline-block; justify-self: end; }
    nav.primary {
        grid-column: 1 / -1;
        display: none;
    }
    nav.primary.open { display: block; margin-top: 16px; }
    nav.primary ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border-top: 1px solid var(--rule);
    }
    nav.primary > ul > li > a {
        display: block;
        padding: 14px 4px;
        border-bottom: 1px solid var(--rule);
    }
    nav.primary li.has-children > ul {
        position: static;
        display: flex;
        border: none;
        padding: 0 0 10px 18px;
        box-shadow: none;
        background: transparent;
    }
}

/* ---------- Layout -------------------------------------------------- */
main { min-height: 60vh; }

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section { padding: 60px 0; }

/* Page header (title + optional intro), centered */
.page-header { text-align: center; }
.page-header h1 { margin-bottom: 0.4em; }
.page-header .lead { margin: 0 auto; }

/* Subtle deco rule kept, now for dark theme */
.deco-rule {
    height: 1px;
    background: linear-gradient(to right,
        transparent 0%,
        var(--accent) 30%,
        var(--accent) 70%,
        transparent 100%);
    opacity: 0.5;
    margin: 40px auto;
    max-width: 200px;
}

/* ---------- Hero (film-frame) --------------------------------------- */
.hero {
    position: relative;
    display: grid;
    place-items: center;
    padding: 24px var(--gutter) 80px;
    background: var(--bg);
    color: var(--ink);
    text-align: center;
    overflow: hidden;
}

/* The hero image sits on a dark field with a soft vignette so it
   feels like you're looking through a film gate. */
.hero-bg {
    position: relative;
    width: 100%;
    max-width: 1100px;
    aspect-ratio: 3 / 2;
    background-size: cover;
    background-position: center;
    box-shadow:
        inset 0 0 120px 40px rgba(0, 0, 0, 0.85),
        inset 0 0 220px 60px rgba(0, 0, 0, 0.65),
        0 40px 80px rgba(0, 0, 0, 0.6);
    filter: contrast(1.02);
    border-radius: 2px;
    overflow: hidden;
}
/* Video hero fills the frame the same way a cover background would */
.hero-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}
/* soft edge bleed */
.hero-bg::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.85) 95%);
    pointer-events: none;
    border-radius: inherit;
    z-index: 1;
}
.hero-overlay { display: none; }       /* not needed with the vignette */

/* Text overlay — absolute inside the image frame when image present */
.hero.has-image .hero-inner {
    position: absolute;
    bottom: 40px;
    left: 0; right: 0;
    padding: 0 var(--gutter);
    z-index: 2;
}

/* Fallback: no hero image yet — flow the title normally */
.hero.no-image {
    padding: 80px var(--gutter) 100px;
    overflow: visible;
}
.hero.no-image .hero-inner {
    position: static;
    text-align: center;
    max-width: 900px;
}
.hero-inner h1 {
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    letter-spacing: 0.04em;
    margin: 0;
}
.hero-inner p.tagline {
    font-family: var(--font-body);
    font-style: italic;
    letter-spacing: 0.06em;
    font-size: clamp(0.9rem, 1.3vw, 1.05rem);
    color: var(--ink-soft);
    margin-top: 10px;
}

/* ---------- Gallery ------------------------------------------------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.gallery figure {
    margin: 0;
    position: relative;
    overflow: hidden;
    background: var(--bg-soft);
    aspect-ratio: 4 / 3;
    border: 1px solid var(--rule);
}
.gallery figure img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 800ms ease, filter 800ms ease;
    filter: contrast(1.02);
}
.gallery figure:hover img {
    transform: scale(1.03);
}
.gallery figcaption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 14px 16px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.75));
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.06em;
    opacity: 0;
    transition: opacity 300ms;
}
.gallery figure:hover figcaption { opacity: 1; }

/* ---------- Photo gallery (masonry, preserves aspect ratios) ------- */
.photo-gallery {
    column-width: 320px;
    column-gap: 18px;
}
.photo-gallery figure {
    margin: 0 0 18px;
    break-inside: avoid;
    position: relative;
    overflow: hidden;
    background: var(--bg-soft);
    border: 1px solid var(--rule);
    cursor: zoom-in;
    display: block;
}
.photo-gallery figure img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 600ms ease, filter 600ms ease;
    filter: contrast(1.02);
}
.photo-gallery figure:hover img { transform: scale(1.02); }
.photo-gallery figcaption {
    padding: 10px 14px 12px;
    color: var(--ink-soft);
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-align: center;
}

/* ---------- Lightbox ------------------------------------------------ */
.lightbox {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.94);
    display: grid;
    place-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
    user-select: none;
}
.lightbox .lb-caption {
    position: absolute;
    bottom: 24px;
    left: 0; right: 0;
    text-align: center;
    color: var(--ink-soft);
    font-family: var(--font-display);
    font-style: italic;
    letter-spacing: 0.04em;
    padding: 0 20px;
    pointer-events: none;
}
.lightbox .lb-close,
.lightbox .lb-nav {
    position: absolute;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--rule);
    color: var(--ink);
    font-family: var(--font-display);
    cursor: pointer;
    transition: background 180ms, color 180ms;
    line-height: 1;
}
.lightbox .lb-close {
    top: 20px; right: 20px;
    width: 42px; height: 42px;
    font-size: 1.6rem;
    border-radius: 2px;
}
.lightbox .lb-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 48px; height: 64px;
    font-size: 2rem;
    border-radius: 2px;
}
.lightbox .lb-prev { left: 20px; }
.lightbox .lb-next { right: 20px; }
.lightbox .lb-close:hover,
.lightbox .lb-nav:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent);
}

/* ---------- Hero + text blocks ------------------------------------- */
.blocks { max-width: 760px; margin: 0 auto; }
.blocks .block-heading {
    font-family: var(--font-display);
    margin-top: 1.2em;
}
.blocks .block-text p {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--ink-soft);
}
.blocks .block-image { margin: 2em 0; }
.blocks .block-image img { border: 1px solid var(--rule); }
.blocks .block-image figcaption {
    text-align: center;
    color: var(--ink-muted);
    font-style: italic;
    padding-top: 8px;
    font-size: 0.95rem;
}

/* ---------- Video --------------------------------------------------- */
.video-wrap {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-soft);
    border: 1px solid var(--rule);
}
.video-wrap iframe {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* ---------- Footer -------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--rule);
    padding: 40px var(--gutter);
    margin-top: 80px;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    color: var(--ink-muted);
}
.site-footer a { color: var(--ink-muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Utility ------------------------------------------------- */
.loading {
    padding: 60px 0;
    text-align: center;
    font-family: var(--font-body);
    font-style: italic;
    letter-spacing: 0.05em;
    font-size: 1rem;
    color: var(--ink-muted);
}
.error {
    padding: 40px 0;
    text-align: center;
    color: #CF7A6C;
    font-family: var(--font-display);
    font-style: italic;
}
.lead {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--ink-soft);
    font-size: 1.2rem;
    max-width: 60ch;
}
