/* PhotoHost — Plan 36 design axis: shared tokens.
   Loaded ONLY when a non-classic design is active (see layout.html), so
   classic pages never download or match anything in this file. Designs
   (P3) consume these tokens; color stays owned by the theme/atmosphere
   variables (--bg / --text / --accent etc.) which designs must read,
   never redefine. */

body[class*="design-"] {
    /* Typography — display face is wired per design in P3; until then
       both resolve to the active theme's font stack. */
    --d-font-display: var(--font);
    --d-font-text: var(--font);
    --d-track-caps: 0.14em;      /* tracked-out small-caps labels */
    --d-leading-tight: 1.15;     /* display headings */
    --d-leading-text: 1.6;

    /* Type scale (minor third-ish, fluid at the top end) */
    --d-text-sm: 0.875rem;
    --d-text-base: 1rem;
    --d-text-lg: 1.25rem;
    --d-text-xl: clamp(1.5rem, 3vw, 2rem);
    --d-text-display: clamp(2.25rem, 6vw, 4rem);

    /* Spacing rhythm */
    --d-gutter: clamp(1rem, 2.5vw, 2rem);
    --d-section: clamp(3rem, 8vh, 6rem);
    --d-measure: 64ch;

    /* Motion */
    --d-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --d-dur-fast: 200ms;
    --d-dur-slow: 400ms;
}

@media (prefers-reduced-motion: reduce) {
    body[class*="design-"] {
        --d-dur-fast: 0ms;
        --d-dur-slow: 0ms;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   P2 — Gallery cover & entry screen (shared by all non-classic designs;
   each design tunes scrim/typography in its own file). Cover text is always
   light over the photo + scrim, independent of theme/atmosphere.
   ──────────────────────────────────────────────────────────────────────── */
body[class*="design-"] .gallery-cover,
body[class*="design-"] .design-hero {
    position: relative;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}

/* The portfolio hero centers its text block; gallery covers sit low. */
body[class*="design-"] .design-hero {
    align-items: center;
}
body[class*="design-"] .design-hero .gallery-cover-text {
    padding-bottom: 0;
}

/* P4.5: route back to the portfolio from the cover itself — the only
   navigation a design album page shows before scrolling. Sits above the
   scrim; safe-area aware for notched phones. */
body[class*="design-"] .gallery-cover-back {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 1.1rem);
    left: calc(env(safe-area-inset-left, 0px) + 1.25rem);
    z-index: 2;
    color: #fff;
    text-decoration: none;
    font-size: var(--d-text-sm);
    letter-spacing: var(--d-track-caps);
    text-transform: uppercase;
    opacity: 0.85;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
    transition: opacity var(--d-dur-fast) var(--d-ease);
}

body[class*="design-"] .gallery-cover-back:hover,
body[class*="design-"] .gallery-cover-back:focus-visible {
    opacity: 1;
}

body[class*="design-"] .gallery-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body[class*="design-"] .gallery-cover-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.08) 45%, rgba(0, 0, 0, 0.18));
}

body[class*="design-"] .gallery-cover-text {
    position: relative;
    width: 100%;
    text-align: center;
    padding: 0 var(--d-gutter)
        calc(env(safe-area-inset-bottom, 0px) + clamp(3rem, 10vh, 6rem));
    color: #fff;
}

body[class*="design-"] .gallery-cover-kicker {
    display: block;
    font-size: var(--d-text-sm);
    letter-spacing: var(--d-track-caps);
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 0.75rem;
}

body[class*="design-"] .gallery-cover-title {
    font-family: var(--d-font-display);
    font-size: var(--d-text-display);
    font-weight: 600;
    line-height: var(--d-leading-tight);
    margin: 0;
    color: #fff;
    text-wrap: balance;
}

body[class*="design-"] .gallery-cover-sub {
    display: block;
    font-size: var(--d-text-lg);
    opacity: 0.85;
    margin-top: 0.5rem;
}

body[class*="design-"] .gallery-cover-enter {
    margin-top: 1.75rem;
    padding: 0.65rem 1.6rem;
    font-size: var(--d-text-sm);
    letter-spacing: var(--d-track-caps);
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--d-dur-fast) var(--d-ease),
        border-color var(--d-dur-fast) var(--d-ease);
}

body[class*="design-"] .gallery-cover-enter:hover,
body[class*="design-"] .gallery-cover-enter:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    border-color: #fff;
}

/* The header re-homes as a sticky minimal toolbar: actions stay reachable
   while scrolling; title/client live on the cover instead. */
body[class*="design-"] .gallery-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg-card);
    background: color-mix(in srgb, var(--bg-card) 82%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

body[class*="design-"] .gallery-header .gallery-title,
body[class*="design-"] .gallery-header .gallery-client {
    display: none;
}

/* ─────────────────────────────────────────────────────────────────────────
   P4 — Public portfolio surfaces. When an entry screen precedes the
   classic container, the header's duplicate title/nav hide (the hero owns
   them); pages without an entry screen keep their header untouched.
   ──────────────────────────────────────────────────────────────────────── */
body[class*="design-"] .design-hero + .public-container .public-header h1,
body[class*="design-"] .design-hero + .public-container .public-header .public-nav,
body[class*="design-"] .gallery-cover + .public-container .public-header h1 {
    display: none;
}

/* P4.5: on design album pages the visitor only ever sees the header in its
   scrolled state (the cover owns the first screen), and public-base.css
   collapses .back-link there — which left no way back to the portfolio.
   Keep it visible; with the h1 hidden it is the header's main content. */
body[class*="design-"] .gallery-cover + .public-container .public-header.scrolled .back-link {
    max-height: 2rem;
    opacity: 1;
    margin-bottom: 0;
}

body[class*="design-"] .design-hero-nav {
    display: flex;
    justify-content: center;
    gap: 1.75rem;
    margin-top: 1.1rem;
}

body[class*="design-"] .design-hero-nav a {
    color: #fff;
    text-decoration: none;
    font-size: var(--d-text-sm);
    letter-spacing: var(--d-track-caps);
    text-transform: uppercase;
    opacity: 0.85;
    transition: opacity var(--d-dur-fast) var(--d-ease);
}

body[class*="design-"] .design-hero-nav a:hover,
body[class*="design-"] .design-hero-nav a:focus-visible {
    opacity: 1;
}

/* Display face on public headings across all design pages (the journal's
   "light touch" typography inherit from the plan). */
body[class*="design-"] .public-header h1,
body[class*="design-"] .portfolio-info h2,
body[class*="design-"] .journal-card-title,
body[class*="design-"] .journal-post-headline h1,
body[class*="design-"] .home-featured-post h2 {
    font-family: var(--d-font-display);
}

body[class*="design-"] .site-footer {
    padding: 2.5rem 1rem 3rem;
}

/* ─────────────────────────────────────────────────────────────────────────
   P5 — Motion. Everything here is reachable only on non-classic designs
   (body scope) and design.js adds the classes only when the visitor does
   not prefer reduced motion.
   ──────────────────────────────────────────────────────────────────────── */

/* Scroll-reveal: design.js marks initial tiles reveal-pending, flips them
   to revealed as they enter the viewport, then removes both classes. */
body[class*="design-"] .reveal-pending {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--d-dur-slow) var(--d-ease),
        transform var(--d-dur-slow) var(--d-ease);
}

body[class*="design-"] .reveal-pending.revealed {
    opacity: 1;
    transform: none;
}

/* Showcase hero crossfade + blur-up: showcase.js layers this img over the
   base hero — first the thumb (blurred placeholder), then the loaded
   preview — and removes it once the base src is swapped underneath. */
body[class*="design-"] .showcase-fade-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity var(--d-dur-fast) var(--d-ease),
        filter var(--d-dur-slow) var(--d-ease),
        transform var(--d-dur-slow) var(--d-ease);
}

body[class*="design-"] .showcase-fade-img.visible {
    opacity: 1;
}

body[class*="design-"] .showcase-fade-img.blur {
    filter: blur(18px);
    transform: scale(1.04);
}

/* Filmstrip: replace classic's scale(1.1) active state (it shifts layout)
   with an accent ring; calmer inactive/hover opacities. */
body[class*="design-"] .filmstrip-thumb {
    opacity: 0.65;
    transition: opacity var(--d-dur-fast) var(--d-ease),
        box-shadow var(--d-dur-fast) var(--d-ease);
}

body[class*="design-"] .filmstrip-thumb:hover {
    opacity: 0.9;
}

body[class*="design-"] .filmstrip-thumb.active {
    opacity: 1;
    transform: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 4px 14px rgba(0, 0, 0, 0.3);
}
