/* ============================================================
   Brett Simison Photography — main.css
   Typography: Outfit (headings/UI) + Plus Jakarta Sans (body/captions)
   Palette: stark black & white with warm mid-tone accents
   ============================================================ */

/* --- Self-hosted variable fonts --------------------------- */
@font-face {
    font-family: 'Outfit';
    src: url('/css/Outfit-VariableFont_wght.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('/css/PlusJakartaSans-VariableFont_wght.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('/css/PlusJakartaSans-Italic-VariableFont_wght.woff2') format('woff2');
    font-weight: 200 800;
    font-style: italic;
    font-display: swap;
}

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --black:      #0d0d0d;
    --white:      #f8f7f4;
    --warm-gray:  #9a9590;
    --rule:       #e0ddd8;
    --accent:     #c8a96e;

    --font-body:  'Plus Jakarta Sans', system-ui, sans-serif;
    --font-ui:    'Outfit', system-ui, sans-serif;

    --header-h:   64px;
    --max-w:      1400px;
    --gap:        22px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    background: var(--white);
    color: var(--black);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

/* --- Header ----------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--rule);
    overflow: visible; /* let dropdown escape */
}

/* Inner row: real layout anchor for dropdown + mobile nav */
.site-header__inner {
    position: relative;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 2rem;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-logo img {
    height: 32px;
    width: auto;
}

/* --- Nav -------------------------------------------------- */

/* Top-level list only — horizontal flex */
.site-nav > ul {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* All nav links */
.site-nav a {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.4rem 0.75rem;
    transition: color 0.15s;
    white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--warm-gray); }

/* --- Dropdown --------------------------------------------- */
.has-dropdown { position: relative; }

/* Hidden by default; JS adds .is-open to reveal */
.has-dropdown > .dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    background: var(--white);
    border: 1px solid var(--rule);
    min-width: 210px;
    padding: 0.5rem 0;
    z-index: 300;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.has-dropdown.is-open > .dropdown { display: block; }

/* Dropdown items: explicitly block, not flex */
.has-dropdown .dropdown li { display: block; }

.has-dropdown .dropdown li a {
    display: block;
    padding: 0.5rem 1.25rem;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
}

.has-dropdown .dropdown li a:hover { background: var(--rule); }

/* --- Mobile toggle button --------------------------------- */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--black);
    transition: transform 0.2s, opacity 0.2s;
}

/* --- Slideshow -------------------------------------------- */
/*
 * Full-frame slideshow: images are displayed at their native
 * aspect ratio — never cropped. The container constrains width
 * and max-height only; portrait-heavy images are capped at 85vh.
 * Caption and nav controls sit BELOW the image frame.
 *
 * Recommended image export specs:
 *   Landscape 3:2  — 1400 × 933 px  (ideal for most photos)
 *   Landscape 16:9 — 1400 × 788 px  (wider, cinematic feel)
 *   Square    1:1  — 1400 × 1400 px (constrained by max-height)
 *   Portrait  2:3  — 933  × 1400 px (constrained by max-height)
 *
 *   All slides in a set should share the same aspect ratio
 *   so the layout doesn't shift height between slides.
 *   Export as JPEG, quality 85–90, sRGB profile.
 */

/* Outer wrapper: centers the frame, adds page margins */
.slideshow-wrap {
    max-width: var(--max-w);
    margin: 2rem auto 0;
    padding: 0 2rem;
}

/* The image stage: natural height, no fixed dimensions */
.slideshow {
    position: relative;
    width: 100%;
    background: transparent; /* placeholder while image loads */

    overflow: hidden;
}

/* Slides stack via absolute positioning;
   the ACTIVE slide drives the container height via its img */
.slideshow__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.7s ease;
    pointer-events: none;
}

/* Active slide is on top and visible; its image sets the height */
.slideshow__slide.is-active {
    position: relative; /* re-enters flow so container gets the height */
    opacity: 1;
    pointer-events: auto;
}

/* Image: full width, natural height, capped so portrait shots
   don't push the page too long on small screens */
.slideshow__slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;   /* show full frame, no crop */
    object-position: center top;
}

/* Optional link wrapper on the image */
.slideshow__img-link {
    display: block;
}

/* Caption row: below the image, no overlay */
.slideshow__caption {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.6rem 0 0;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--warm-gray);
    line-height: 1.4;
    flex-wrap: wrap;
}

.slideshow__caption-text {

}

.slideshow__more {
    font-family: var(--font-ui);
    font-style: normal;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--warm-gray);
    white-space: nowrap;
    transition: color 0.15s;
}

.slideshow__more:hover { color: var(--black); }

/* Controls: dots + arrows below the caption */
.slideshow__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 0 1.5rem;
}

.slideshow__btn {
    background: none;
    border: 1px solid var(--warm-gray);
    color: var(--black);
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}

.slideshow__btn:hover {
    border-color: var(--black);
}

.slideshow__dots { display: flex; gap: 0.5rem; align-items: center; }

.slideshow__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rule);
    border: 1px solid var(--warm-gray);
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}

.slideshow__dot.is-active {
    background: var(--black);
    border-color: var(--black);
}

/* --- Home gallery cards ----------------------------------- */
.home-galleries {
    padding: 4rem 2rem;
    max-width: var(--max-w);
    margin: 0 auto;
}

.home-galleries__inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.home-gallery-card { display: block; overflow: hidden; }

.home-gallery-card__img {
    overflow: hidden;
    aspect-ratio: 3/2;
    background: var(--rule);
}

.home-gallery-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.home-gallery-card:hover .home-gallery-card__img img { transform: scale(1.03); }

.home-gallery-card__title {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.15rem;
    margin-top: 0.75rem;
}

.home-gallery-card__desc {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--warm-gray);
    margin-top: 0.25rem;
    letter-spacing: 0.03em;
}

/* --- Gallery header --------------------------------------- */
.gallery-header {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
    border-bottom: 1px solid var(--rule);
}

.gallery-header__title {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    letter-spacing: -0.01em;
}

.gallery-header__desc {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--warm-gray);
    margin-top: 0.5rem;
    letter-spacing: 0.01em;
}

/* --- Masonry gallery ------------------------------------- */
.masonry {
    columns: 3;
    column-gap: var(--gap);
    padding: var(--gap);
    max-width: var(--max-w);
    margin: 0 auto;
}

@media (max-width: 900px)  { .masonry { columns: 2; } }
@media (max-width: 540px)  { .masonry { columns: 1; } }

.masonry__item {
    break-inside: avoid;
    margin-bottom: var(--gap);
    overflow: hidden;
}

.masonry__link { display: block; cursor: zoom-in; position: relative; }

.masonry__item img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.2s;
}

.masonry__item:hover img { opacity: 0.88; }

.masonry__caption {
    font-family: var(--font-body);
    font-style: normal;
    font-size: 0.8rem;
    color: var(--warm-gray);
    padding: 0.35rem 0.25rem 0;
    line-height: 1.4;
}

.masonry__title {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    margin: 0.4rem 0.25rem 0.1rem;
    color: var(--black);
}

/* --- Media badge (▶ / ♪) on masonry thumbnails ----------- */
.masonry__badge {
    position: absolute;
    bottom: 0.8rem;
    right: 0.8rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    pointer-events: none;
    transition: transform 0.15s;
}

.masonry__badge--video {
    background: rgba(0,0,0,0.6);
    color: white;
    padding-left: 2px;  /* ← optical correction for ▶ glyph */
    padding-bottom: 6px;
}

.masonry__badge--audio {
    background: rgba(0,0,0,0.55);
    color: white;
    font-size: 1rem;
}

.masonry__item:hover .masonry__badge {
    transform: scale(1.12);
}

/* --- Unified media overlay -------------------------------- */
/*
 * Replaces the old .lightbox; handles image, video, and audio.
 * JS shows/hides the correct inner panel based on item type.
 */
.media-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,10,0.96);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-overlay[hidden] { display: none; }

/* Overlay navigation buttons */
.overlay__close,
.overlay__prev,
.overlay__next {
    position: absolute;
    background: none;
    border: none;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 1rem;
    transition: color 0.15s;
    z-index: 10;
}

.overlay__close:hover,
.overlay__prev:hover,
.overlay__next:hover { color: white; }

.overlay__close { top: 1rem;  right: 1rem; font-size: 2rem; }
.overlay__prev  { left: 1rem; top: 50%; transform: translateY(-50%); }
.overlay__next  { right: 1rem; top: 50%; transform: translateY(-50%); }

/* Each panel is hidden until JS activates it */
.overlay__panel[hidden] { display: none; }

/* Shared figure layout */
.overlay__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

/* Shared caption */
.overlay__caption {
    color: rgba(255,255,255,0.65);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    margin-top: 0.75rem;
    text-align: center;
    max-width: 60ch;
}

/* --- Image panel ------------------------------------------ */
.overlay__img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    display: block;
}

/* --- Video panel ------------------------------------------ */
.overlay__figure--video {
    width: 90vw;
    max-width: 1100px;
}

.overlay__video {
    width: 100%;
    max-height: 78vh;
    background: #000;
    display: block;
    outline: none;
}

/* --- Audio panel ------------------------------------------ */
.overlay__figure--audio {
    width: min(480px, 90vw);
}

.overlay__audio-art {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.overlay__audio {
    width: 100%;
    margin-top: 1rem;
    accent-color: var(--accent);
}

/* --- Footer ---------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--rule);
    margin-top: 4rem;
    padding: 2rem;
}

.site-footer__inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-footer__copy {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--warm-gray);
    letter-spacing: 0.05em;
}

.site-footer__social { display: flex; gap: 1.5rem; }

.site-footer__social a {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--warm-gray);
    transition: color 0.15s;
}

.site-footer__social a:hover { color: var(--black); }

/* --- Utility --------------------------------------------- */
.not-found {
    padding: 6rem 2rem;
    text-align: center;
    font-family: var(--font-ui);
}

.not-found a {
    display: inline-block;
    margin-top: 1rem;
    border-bottom: 1px solid var(--black);
}

/* --- Mobile ≤768px --------------------------------------- */
@media (max-width: 768px) {

    .nav-toggle { display: flex; }

    /* Mobile nav panel — anchored to .site-header__inner */
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0rem;
        right: 0rem;
        background: var(--white);
        border-top: 1px solid var(--rule);
        border-bottom: 1px solid var(--rule);
        padding: 1rem 2rem 1.5rem;
        z-index: 99;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    .site-nav.is-open { display: block; }

    /* Stack top-level items vertically */
    .site-nav > ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .site-nav > ul > li { width: 100%; }

    .site-nav > ul > li > a {
        display: block;
        padding: 0.6rem 0;
    }

    /* Dropdown: flat inline list on mobile, always shown */
    .has-dropdown > .dropdown {
        display: block;
        position: static;
        border: none;
        border-left: 2px solid var(--rule);
        padding: 0.25rem 0 0.5rem 1rem;
        margin: 0 0 0.5rem 0.5rem;
        box-shadow: none;
        min-width: unset;
    }

    .home-galleries__inner { grid-template-columns: 1fr; }

    /* Slideshow: tighten margins on mobile */
    .slideshow-wrap { padding: 0 1rem; margin-top: 1rem; }
    .slideshow__slide img { max-height: 70vw; } /* cap portrait shots on small screens */
}



/* --- Prose pages (About, Contact, etc.) ------------------- */

.page-content {
    padding: 4rem 2rem;
}

.page-content__inner {
    max-width: 740px;
    margin: 0 auto;
}

/* Clearfix so floated images don't escape the prose container */
.page-content__inner::after {
    content: '';
    display: table;
    clear: both;
}

.page-title {
    font-family: var(--font-ui);
    font-weight: 300;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
    color: var(--black);
}

/* Prose typography */
.page-content__inner p {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--black);
    margin-bottom: 1.25rem;
}

.page-content__inner h2 {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 2.5rem 0 1rem;
    color: var(--warm-gray);
}

.page-content__inner a {
    border-bottom: 1px solid var(--rule);
    transition: border-color 0.15s, color 0.15s;
}

.page-content__inner a:hover {
    border-color: var(--black);
    color: var(--black);
}

/* --- Inline image utilities for prose pages --------------- */
/*
 * Usage:
 *   <img src="..." alt="..." class="img-right">
 *   <p>Text wraps around the image...</p>
 *
 *   Or with caption:
 *   <figure class="img-right">
 *       <img src="..." alt="...">
 *       <figcaption>Caption text</figcaption>
 *   </figure>
 *
 * Available classes: img-left  img-right  img-center  img-full
 */

/* Shared base */
.img-left,
.img-right,
.img-center,
.img-full {
    display: block;
    margin-bottom: 1.5rem;
}

.img-left img,
.img-right img,
.img-center img,
.img-full img,
.img-left,   /* when applied directly to <img> */
.img-right,
.img-center {
    max-width: 100%;
    height: auto;
}

/* Float left — text wraps right */
.img-left {
    float: left;
    margin-right: 2rem;
    margin-bottom: 1rem;
    max-width: 42%;
}

/* Float right — text wraps left */
.img-right {
    float: right;
    margin-left: 2rem;
    margin-bottom: 1rem;
    max-width: 42%;
}

/* Centered block, no float */
.img-center {
    margin-left: auto;
    margin-right: auto;
    max-width: 80%;
}

/* Full prose width */
.img-full {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Figcaption inside any of the above */
.img-left figcaption,
.img-right figcaption,
.img-center figcaption,
.img-full figcaption {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--warm-gray);
    margin-top: 0.4rem;
    line-height: 1.4;
}

/* Collapse floats to full width on narrow screens */
@media (max-width: 600px) {
    .img-left,
    .img-right {
        float: none;
        max-width: 100%;
        margin-right: 0;
        margin-left: 0;
    }
}

/* --- Contact page ----------------------------------------- */
.contact-info {
    margin-top: 1rem;
}

.contact-info__item {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rule);
    font-family: var(--font-body);
    font-size: 1rem;
}

.contact-info__label {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--warm-gray);
    min-width: 80px;
    flex-shrink: 0;
}

/* --- Plyr player theming ---------------------------------- */
/*
 * Plyr exposes its entire UI through CSS custom properties.
 * These overrides match the site palette without touching
 * Plyr's own stylesheet. Loaded after plyr.min.css in footer.php.
 *
 * Full variable reference:
 * https://github.com/sampotts/plyr#css-custom-properties
 */
:root {
    /* Brand colour used for progress bar fill, range thumb, focus rings */
    --plyr-color-main:              var(--accent);        /* warm gold */

    /* Control bar */
    --plyr-control-background:      rgba(10,10,10,0.75);
    --plyr-control-color:           rgba(255,255,255,0.85);
    --plyr-control-color-pressed:   #fff;

    /* Range inputs (volume, scrub) */
    --plyr-range-fill-background:   var(--accent);
    --plyr-range-thumb-background:  var(--accent);
    --plyr-range-thumb-height:      14px;
    --plyr-range-thumb-width:       14px;

    /* Captions */
    --plyr-captions-background:     rgba(0,0,0,0.72);
    --plyr-captions-text-color:     #fff;
    --plyr-font-family:             var(--font-ui);
    --plyr-font-size-base:          14px;
    --plyr-font-size-captions-base: 15px;

    /* Tooltip */
    --plyr-tooltip-background:      var(--black);
    --plyr-tooltip-color:           #fff;
    --plyr-tooltip-radius:          2px;

    /* Video poster / background */
    --plyr-video-background:        #000;

    /* Audio player background */
    --plyr-audio-controls-background:  var(--white);
    --plyr-audio-control-color:        var(--black);
    --plyr-audio-control-color-hover:  var(--accent);
    --plyr-audio-progress-buffered-background: var(--rule);
}

/* Tighten Plyr inside our overlay so it fills the panel */
.overlay__figure--video .plyr {
    width: 100%;
    border-radius: 0;
}

.overlay__figure--video .plyr__video-wrapper {
    background: #000;
}

/* Audio Plyr sits below the album art */
.overlay__figure--audio .plyr {
    width: 100%;
    margin-top: 0.5rem;
    border-radius: 2px;
}

.overlay__caption { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.overlay__caption-title { font-family: var(--font-ui); font-weight: 500; font-size: 0.9rem; color: rgba(255,255,255,0.9); }
.overlay__caption-text  { font-family: var(--font-ui); font-size: 0.8rem; color: rgba(255,255,255,0.6); }

.site-footer__privacy {
    margin-left: 1rem;
    border-bottom: none;
    color: var(--warm-gray);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    transition: color 0.15s;
}

.site-footer__privacy:hover { color: var(--black); }
