/* ── Shared shell styles for vulpe.ca (Phase 0) ── */

@font-face { font-family: 'WarblerVariable'; src: url('/assets/fonts/WarblerVariable[opsz,wght].woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-variation-settings: 'opsz' 12, 'wght' 400; }
@font-face { font-family: 'WarblerVariable'; src: url('/assets/fonts/WarblerVariable-Italic[opsz,wght].woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-variation-settings: 'opsz' 12, 'wght' 400; }

:root {
    --fw: 'WarblerVariable', Georgia, serif;
    --fn: 'noto-sans', sans-serif;
    --c0: #010204;

    /* Type scale: --t-0 = 1rem, --t-n = 1.25^n rem */
    --t-0: 1rem;
    --t-1: 1.25rem;
    --t-2: 1.5625rem;
    --t-3: 1.953125rem;
    --t-4: 2.44140625rem;
    --t-5: 3.0517578125rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { margin: 0; }

/* Layout-neutral: pages lay out their own children (sidebar pages need them as direct body children) */
body > main { display: contents; }

/* ── Shared wordmark base (sizes/animations stay per page) ── */
h1.logo, .logo {
    font-family: var(--fw); font-weight: 400; text-transform: lowercase;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.33 0.33 0.33 0 0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.33 0.33 0.33 0 0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}
h1.logo em, .logo em { font-style: italic; }

/* ============================================================
   SHARED FOOTER — one thin status bar, the same on every page.
   Desktop: one line (about 32px): copyright + meta on the left, land
   acknowledgement after them, theme toggle at the far right. The
   acknowledgement may wrap to two lines when space runs out, never truncated.
   Phones: stacked, left-aligned: copyright + toggle, meta, acknowledgement.
   Type: Noto Sans 10-11px regular, sentence case, no tracking, muted ink.
   ============================================================ */
footer.unified-footer {
    position: relative; z-index: 20; box-sizing: border-box;
    font-family: var(--fn); font-size: 11px; font-weight: 400;
    letter-spacing: normal; text-transform: none; line-height: 1.4;
    color: var(--footer-ink, rgba(0,0,0,0.55));
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    grid-template-areas: "copy meta . ack toggle";
    align-items: center; column-gap: 8px; row-gap: 2px;
    width: 100%; min-height: 32px; padding: 4px 16px; text-align: left;
    border-top: none;
}
footer.unified-footer .copyright { grid-area: copy; margin: 0; font: inherit; color: inherit; white-space: nowrap; }
footer.unified-footer .footer-meta {
    grid-area: meta; margin: 0; font-size: 10px; line-height: 1.4;
    color: var(--footer-ink-quiet, rgba(0,0,0,0.42)); white-space: nowrap;
}
footer.unified-footer .footer-meta::before { content: "\00b7"; margin-right: 8px; }
footer.unified-footer .footer-canada,
footer.unified-footer .footer-powered { display: inline; }
footer.unified-footer .footer-powered::before { content: "\00b7"; margin: 0 8px; }

/* Footer ink follows the theme (the same on every page, whatever is behind it) */
html.theme-dark  { --footer-ink: rgba(255,255,255,0.60); --footer-ink-quiet: rgba(255,255,255,0.42); --footer-ink-faint: rgba(255,255,255,0.32); --footer-line: rgba(255,255,255,0.10); }
html.theme-light { --footer-ink: rgba(0,0,0,0.55); --footer-ink-quiet: rgba(0,0,0,0.42); --footer-ink-faint: rgba(0,0,0,0.32); --footer-line: rgba(0,0,0,0.09); }

/* Theme toggle: small quiet icon button (24px, no border, visible focus ring) */
footer.unified-footer .theme-toggle-btn {
    grid-area: toggle; justify-self: end;
    width: 24px; height: 24px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: none; border-radius: 50%;
    color: var(--footer-ink, inherit); opacity: 0.85; cursor: pointer;
    transition: opacity 0.2s;
}
footer.unified-footer .theme-toggle-btn:hover { opacity: 1; }
footer.unified-footer .theme-toggle-btn:focus-visible { opacity: 1; outline: 2px solid currentColor; outline-offset: 2px; }
footer.unified-footer .theme-toggle-btn svg { width: 14px; height: 14px; fill: currentColor; }
/* The copyright-row wrapper is no longer a box of its own */
footer.unified-footer .copyright-row { display: contents; }

/* Phones (and the narrow sidebar on the About page): stacked and compact */
@media (max-width: 768px) {
    footer.unified-footer {
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas: "copy ack toggle" "meta meta meta";
        padding: 6px 16px 8px;
    }
    footer.unified-footer .copyright { white-space: normal; }
    footer.unified-footer .footer-meta { white-space: normal; }
    footer.unified-footer .footer-meta::before { content: none; }
}
.sidebar-footer footer.unified-footer {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "copy ack toggle" "meta meta meta";
    padding: 6px 0 8px; border-top: 0;
}
.sidebar-footer footer.unified-footer .footer-meta::before { content: none; }
.sidebar-footer footer.unified-footer .footer-meta { white-space: normal; }

/* Footer placement. Every context gets the same bar, full width of its context.
   Home: bottom of the viewport. Set page: end of the content column. */
body > footer.unified-footer { max-width: none; margin: auto 0 0; flex-shrink: 0; }
.main-content > footer.unified-footer { margin-top: auto; flex-shrink: 0; }
/* Gallery film view: along the bottom of the photo column, a subtle fade only where it overlays the photo */
#mainPanel { position: relative; }
#mainPanel > footer.unified-footer {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; width: auto;
    background: linear-gradient(to top, rgba(var(--bg-rgb), 0.55), rgba(var(--bg-rgb), 0));
}
/* Gallery grid view: the footer closes the grid (script moves it in) */
.view-grid > footer.unified-footer {
    position: static; grid-column: 1 / -1; background: none; margin-top: 1em;
}

/* ============================================================
   SHARED SIDEBAR — gallery index & photo-set pages
   Both pages embed _sidebar.twig, so width, padding, brand, list
   typography and the footer area are written here, once.
   Page files only keep their own mobile sheet overrides.
   ============================================================ */
.sidebar {
    width: var(--sidebar-width, 380px); min-width: var(--sidebar-width, 380px); flex-shrink: 0;
    display: flex; flex-direction: column; height: 100%;
    position: relative; z-index: 20; overflow: hidden;
    background: var(--sidebar-glass);
    backdrop-filter: blur(44px); -webkit-backdrop-filter: blur(44px);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    transition: background var(--transition-slow, 0.8s), border-color var(--transition-slow, 0.8s);
    opacity: 0; transform: translateX(-12px);
    animation: sidebarEnter 0.7s cubic-bezier(0.16,1,0.3,1) 0.08s forwards;
}
@keyframes sidebarEnter { to { opacity: 1; transform: translateX(0); } }

/* Brand block */
.sidebar .brand-group {
    flex-shrink: 0; display: flex; flex-direction: column;
    align-items: center; padding: 2.6em 0.8em 0; text-align: center;
}
.sidebar .logo {
    font-family: var(--fw); font-size: clamp(2.4em, 4.5vw, 3.2em);
    font-weight: 400; text-transform: lowercase; line-height: 1.05;
    letter-spacing: -1px; color: var(--logo-color);
    padding: 0 0 0.16em; overflow: visible; /* room so the "p" descender is never clipped */
    transition: color var(--transition-slow, 0.8s);
}
.sidebar .logo a { color: inherit; text-decoration: none; display: inline-block; outline: none; transition: transform 0.3s; }
.sidebar .logo a:hover { transform: scale(1.02); }
.sidebar .logo .letter {
    display: inline-block; opacity: 0; transform: translateY(10px);
    animation: letterIn 0.6s cubic-bezier(0.16,1,0.3,1) forwards;
    padding: 0 0.06em; margin: 0 -0.06em;
}
.sidebar .logo .letter.lv { animation-delay: 0.04s; }
.sidebar .logo .letter.lu { animation-delay: 0.12s; }
.sidebar .logo .letter.ll { animation-delay: 0.20s; }
.sidebar .logo .letter.lp { animation-delay: 0.28s; }
.sidebar .logo .letter.le { animation-delay: 0.36s; }
@keyframes letterIn { to { opacity: 1; transform: translateY(0); } }

@media (min-width: 769px) {
    .sidebar .brand-group { padding: 3em 0.8em 2em; }
    .sidebar .sidebar-nav { padding-top: 0.8em; }
}
.sidebar .nav-divider {
    width: calc(100% - 5em); height: 1px; background: var(--border-color);
    flex-shrink: 0; margin: 0 2.5em; transition: background var(--transition-slow, 0.8s);
}

/* Scrolling list area */
.sidebar .sidebar-nav {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding: 0.4em 0;
    --stagger-base: 0.55s;
}
.sidebar .sidebar-nav::-webkit-scrollbar { display: none; }

/* The list (year headers are used by the gallery page) */
.sidebar .image-list { list-style: none; padding: 0 2.5em 1.5em; margin: 0; }
.sidebar .nav-year-header {
    font-family: var(--fn); font-size: 0.65em; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.18em; color: var(--text-faint);
    margin: 2.5em 0 1em;
}
.sidebar .nav-year-header:first-child { margin-top: 0.5em; }
.sidebar .image-item {
    border-bottom: 1px solid var(--border-color);
    opacity: 0; transform: translateX(-8px);
    animation: itemReveal 0.5s cubic-bezier(0.16,1,0.3,1) forwards;
    transition: border-color var(--transition-slow, 0.8s);
    /* --i is the item's index, set in the script. Every item staggers; past 16 they share one step so the last never waits long. */
    animation-delay: calc(var(--stagger-base) + min(var(--i, 0), 16) * 0.04s);
}
@keyframes itemReveal { to { opacity: 1; transform: translateX(0); } }

.sidebar .image-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.9em 0; font-family: var(--fw); font-size: 0.95em;
    letter-spacing: 0.18em; line-height: 1.2; color: var(--text-muted);
    text-decoration: none; text-transform: uppercase; cursor: pointer; position: relative;
    transition: color var(--transition-fast, 0.2s), transform 0.3s cubic-bezier(0.16,1,0.3,1), letter-spacing 0.3s cubic-bezier(0.16,1,0.3,1);
}
.sidebar .image-link .link-num {
    font-family: var(--fn); font-size: 0.6em; letter-spacing: 0.05em;
    opacity: 0; transform: translateX(-4px);
    transition: opacity 0.2s, transform 0.2s; flex-shrink: 0; margin-right: 0.6em; color: var(--text-faint);
}

/* Titles are always one line with an ellipsis; nothing in the list changes height or moves.
   A truncated title shows in full in the shared floating label (.title-flyout, see _sidebar.twig). */
.sidebar .image-link .link-text-wrapper { flex: 1; min-width: 0; }
.sidebar .image-link .link-text {
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding-right: 0.4em;
}

.title-flyout {
    position: fixed; z-index: 1000; pointer-events: none; white-space: nowrap;
    box-sizing: border-box; padding: 8px 16px; border-radius: var(--r-pill, 999px);
    transform: translateY(-50%);
    background: rgba(var(--bg-rgb), 0.72); color: var(--text-color, inherit);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-color, rgba(128,128,128,0.3));
    box-shadow: 0 8px 28px rgba(0,0,0,0.16);
    opacity: 0; transition: opacity 150ms ease;
}
.title-flyout.show { opacity: 1; }

.sidebar .image-link .link-arrow {
    flex-shrink: 0; font-size: 0.85em; opacity: 0; transform: translateX(-6px);
    transition: opacity 0.2s, transform 0.25s cubic-bezier(0.16,1,0.3,1); color: var(--text-faint);
}
.sidebar .image-link:hover { color: var(--text-color); }
.sidebar .image-link:hover .link-num,
.sidebar .image-link:hover .link-arrow { opacity: 1; transform: translateX(0); }
.sidebar .image-item.active .image-link { color: var(--text-color); font-weight: 600; letter-spacing: 0.20em; }
.sidebar .image-item.active .image-link .link-text {
    background: linear-gradient(90deg,
        var(--text-color) 0%, var(--text-color) 44%,
        var(--shimmer-hi) 50%,
        var(--text-color) 56%, var(--text-color) 100%);
    background-size: 300% 100%;
    background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: shimmer 22s linear infinite;
}
.sidebar .image-item.active .image-link .link-num { opacity: 1; transform: translateX(0); }
.sidebar .image-item.active .image-link .link-arrow { opacity: 0.5; transform: translateX(0); }
@keyframes shimmer { 0% { background-position: 300% 0 } 100% { background-position: -300% 0 } }

/* Footer area inside the sidebar (the shared footer + optional page actions) */
.sidebar .sidebar-footer {
    flex-shrink: 0; padding: 0 2.5em 1.6em;
    display: flex; flex-direction: column; gap: 0.9em;
    background: linear-gradient(to top, rgba(var(--bg-rgb), 0.98) 55%, transparent 100%);
}
.gallery-return-link {
    display: inline-flex; align-items: center; gap: 0.7em;
    padding: 11px 28px; border-radius: var(--r-pill, 35px);
    border: 1px solid var(--border-color);
    font-family: var(--fn); font-size: 0.72em; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    text-decoration: none; color: var(--text-muted);
    background: rgba(var(--bg-rgb), 0.6);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s cubic-bezier(0.16,1,0.3,1);
    align-self: center;
}
.gallery-return-link:hover,
.gallery-return-link:focus {
    color: var(--text-color); border-color: var(--text-muted);
    background: var(--sidebar-glass); transform: scale(1.04); outline: none;
}
.gallery-return-link .arrow { font-size: 1.1em; line-height: 1; }

/* Reduced motion: the floating title label appears without a fade */
@media (prefers-reduced-motion: reduce) {
    .title-flyout { transition: none; }
}

.show-mobile { display: none; }
.hide-mobile { display: inline; }

/* Footer refinements (review round 7, 8): acknowledgement as an icon + dialog, Craft as a mark, flag only on phones */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
footer.unified-footer .craft-mark {
    display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 4px;
    border: 1px solid currentColor; font-family: var(--fn); font-size: 9px; font-weight: 700; line-height: 1; vertical-align: -2px;
}
@media (max-width: 768px) {
    footer.unified-footer .footer-canada-text { display: none; }
}
.sidebar .image-item.flyout-on,
.sidebar .image-item.flyout-prev,
.sidebar li.flyout-prev { border-bottom-color: transparent; }

/* Footer round 8: acknowledgement icon + dialog, legible on hover/focus */
footer.unified-footer { transition: color 0.2s; }
footer.unified-footer .footer-meta { transition: color 0.2s; }
footer.unified-footer:hover,
footer.unified-footer:focus-within { color: var(--footer-ink-hover); }
footer.unified-footer:hover .footer-meta,
footer.unified-footer:focus-within .footer-meta { color: var(--footer-ink-hover); }
html.theme-dark  { --footer-ink-hover: rgba(255,255,255,0.85); }
html.theme-light { --footer-ink-hover: rgba(0,0,0,0.85); }
#mainPanel > footer.unified-footer { transition: color 0.2s, background 0.2s; }
#mainPanel > footer.unified-footer:hover,
#mainPanel > footer.unified-footer:focus-within {
    background: linear-gradient(to top, rgba(var(--bg-rgb), 0.85), rgba(var(--bg-rgb), 0));
}
footer.unified-footer .footer-ack-btn {
    grid-area: ack; justify-self: end;
    width: 24px; height: 24px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: none; border-radius: 50%;
    color: var(--footer-ink, inherit); opacity: 0.85; cursor: pointer; transition: opacity 0.2s;
}
footer.unified-footer .footer-ack-btn:hover { opacity: 1; }
footer.unified-footer .footer-ack-btn:focus-visible { opacity: 1; outline: 2px solid currentColor; outline-offset: 2px; }
footer.unified-footer .footer-ack-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.ack-dialog {
    position: fixed; inset: 0; margin: auto; box-sizing: border-box;
    width: calc(100% - 32px); max-width: 360px; height: fit-content; padding: 28px 28px 24px;
    border: 1px solid var(--footer-line, rgba(128,128,128,0.25)); border-radius: 14px;
    font-family: var(--fn); font-size: 14px; font-weight: 400; line-height: 1.6; text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.ack-dialog p { margin: 0; }
.ack-dialog::backdrop { background: rgba(0,0,0,0.35); }
html.theme-light .ack-dialog { background: rgba(255,255,255,0.82); color: rgba(0,0,0,0.85); }
html.theme-dark  .ack-dialog { background: rgba(24,24,24,0.82); color: rgba(255,255,255,0.88); }
.ack-close {
    position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; padding: 0;
    background: none; border: none; border-radius: 50%; color: inherit; opacity: 0.5;
    font-size: 20px; line-height: 1; cursor: pointer; transition: opacity 0.2s;
}
.ack-close:hover, .ack-close:focus-visible { opacity: 1; }
.ack-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
    .ack-dialog[open] { animation: ackIn 0.2s ease-out; }
    @keyframes ackIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* Room for the close button so it never sits on the text */
.ack-dialog p { padding-right: 28px; }

/* Footer: every item centred on one line (copyright, Made in Canada, the flag, the Craft mark, both icons) */
footer.unified-footer .copyright,
footer.unified-footer .footer-meta,
footer.unified-footer .footer-canada,
footer.unified-footer .footer-powered {
    display: inline-flex; align-items: center; height: 16px; line-height: 16px;
}
footer.unified-footer .footer-meta::before,
footer.unified-footer .footer-powered::before { line-height: 16px; }
footer.unified-footer .craft-mark { vertical-align: middle; }
footer.unified-footer .theme-toggle-btn,
footer.unified-footer #footer-ack-btn { align-self: center; }
