/*
Theme Name: In Memoriam — Anne MacLean
Description: A single in-memoriam landing page for Anne MacLean (1940–2026), featuring the service livestream and a countdown to the funeral on April 20, 2026 at 10:00 AM ADT.
Version: 1.0.0
Author: Nova Stream
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: annemaclean
*/

:root {
    color-scheme: light;
    --bg: #f4efe6;
    --bg-soft: #eae3d4;
    --ink: #1f1a14;
    --ink-muted: #6b6258;
    --rule: #d9cfbe;
    --accent: #6b5a3e;
    --serif: "Cormorant Garamond", "EB Garamond", Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

.memorial {
    max-width: 780px;
    margin: 0 auto;
    padding: clamp(40px, 6vw, 80px) 24px clamp(48px, 6vw, 80px);
    text-align: center;
}

.hero {
    margin: 0 auto clamp(24px, 3vw, 40px);
    width: clamp(220px, 30vw, 300px);
    aspect-ratio: 460 / 560;
    overflow: hidden;
    border-radius: 6px;
    background: var(--bg-soft);
    box-shadow: 0 1px 2px rgba(31, 26, 20, 0.06), 0 20px 40px -20px rgba(31, 26, 20, 0.22);
    position: relative;
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px rgba(31, 26, 20, 0.05);
    border-radius: inherit;
    pointer-events: none;
}

.name-block { margin: 0 0 clamp(32px, 4vw, 48px); }

.name-block h1 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(2.5rem, 6vw, 4.25rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.name-block .dates {
    margin: 10px 0 0;
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    letter-spacing: 0.14em;
    color: var(--ink-muted);
    font-variant-numeric: oldstyle-nums;
}

.ornament {
    display: block;
    margin: clamp(24px, 3vw, 36px) auto;
    width: 64px;
    height: 1px;
    background: var(--rule);
    position: relative;
}
.ornament::before {
    content: "";
    position: absolute;
    top: -3px; left: 50%;
    width: 7px; height: 7px;
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 50%;
    transform: translateX(-50%);
}

.service { margin: 0 0 clamp(36px, 5vw, 56px); }

.service .when {
    margin: 0;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    color: var(--ink);
    font-style: italic;
    font-weight: 400;
}

.countdown {
    margin: 18px 0 0;
    display: inline-flex;
    gap: clamp(14px, 2.5vw, 24px);
    padding: 14px 22px;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-muted);
}
.countdown[hidden] { display: none; }
.countdown .unit { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.countdown .num {
    font-family: var(--serif);
    font-size: clamp(1.4rem, 2.4vw, 1.75rem);
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink);
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
    min-width: 1.6ch;
}
.countdown .label { font-size: 10px; }

.cta-row {
    margin: 0 0 clamp(36px, 5vw, 56px);
}

.cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 14px 30px;
    background: var(--ink);
    color: var(--bg);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(31, 26, 20, 0.12), 0 18px 36px -16px rgba(31, 26, 20, 0.35);
    transition: transform 180ms ease-out, box-shadow 180ms ease-out, background 180ms ease-out;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.cta:hover,
.cta:focus-visible {
    background: #2d2620;
    transform: translateY(-1px);
    box-shadow: 0 1px 2px rgba(31, 26, 20, 0.14), 0 22px 44px -16px rgba(31, 26, 20, 0.45);
}
.cta:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
.cta-glyph {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    transform: translateY(-1px);
}

.stream { margin: 0; scroll-margin-top: clamp(16px, 3vw, 32px); }
.stream:focus { outline: none; }
.stream:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 8px; }

.stream-heading {
    margin: 0 0 16px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.vimeo-wrap {
    position: relative;
    padding-top: 56.25%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(31, 26, 20, 0.10),
        0 2px 6px -1px rgba(31, 26, 20, 0.14),
        0 28px 56px -14px rgba(31, 26, 20, 0.38);
}
.vimeo-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.footnote {
    margin: clamp(40px, 5vw, 64px) 0 0;
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--ink-muted);
}

.site-credit {
    margin: clamp(32px, 5vw, 56px) auto 0;
    padding: 0 24px clamp(24px, 3vw, 32px);
    font-family: var(--sans);
    font-size: 10px;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
    text-align: center;
    max-width: 520px;
    line-height: 1.5;
    opacity: 0.55;
    transition: opacity 220ms ease-out;
}
.site-credit:hover,
.site-credit:focus-within {
    opacity: 1;
}
.site-credit a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(107, 98, 88, 0.35);
    text-underline-offset: 3px;
    text-decoration-thickness: 0.5px;
    transition: text-decoration-color 180ms ease-out;
}
.site-credit a:hover,
.site-credit a:focus-visible {
    text-decoration-color: currentColor;
}
.site-credit a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Entrance animation */
@media (prefers-reduced-motion: no-preference) {
    .memorial > * {
        opacity: 0;
        transform: translateY(8px);
        animation: rise 700ms ease-out forwards;
    }
    .memorial > :nth-child(1) { animation-delay: 60ms; }
    .memorial > :nth-child(2) { animation-delay: 180ms; }
    .memorial > :nth-child(3) { animation-delay: 300ms; }
    .memorial > :nth-child(4) { animation-delay: 420ms; }
    .memorial > :nth-child(5) { animation-delay: 540ms; }
    .memorial > :nth-child(6) { animation-delay: 660ms; }

    @keyframes rise {
        to { opacity: 1; transform: none; }
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* Desktop: side-by-side so the stream is visible without scrolling */
@media (min-width: 1024px) {
    body {
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        position: relative;
    }

    .memorial {
        max-width: 1200px;
        display: grid;
        grid-template-columns: minmax(260px, 1fr) minmax(0, 1.5fr);
        column-gap: clamp(40px, 4vw, 80px);
        row-gap: clamp(10px, 1.2vh, 20px);
        align-items: center;
        padding-top: clamp(20px, 3vh, 48px);
        padding-bottom: clamp(20px, 3vh, 48px);
        margin-top: auto;
        margin-bottom: auto;
    }

    .memorial > * { margin-bottom: 0; }

    .memorial > .stream {
        grid-column: 2;
        grid-row: 1 / 6;
        align-self: center;
        justify-self: stretch;
        width: 100%;
    }

    .hero { width: clamp(170px, 14vw, 220px); }

    .name-block h1 { font-size: clamp(2.25rem, 4vw, 3.5rem); }
    .name-block .dates { margin-top: 6px; }

    .ornament { margin-top: 0; margin-bottom: 0; }

    .service .when { font-size: clamp(1rem, 1.15vw, 1.15rem); }
    .countdown { padding-top: 10px; padding-bottom: 10px; margin-top: 12px; }
    .countdown .num { font-size: clamp(1.2rem, 1.6vw, 1.5rem); margin-bottom: 4px; }
    .stream-heading { margin-bottom: 10px; }

    .site-credit {
        position: absolute;
        right: clamp(20px, 2vw, 40px);
        bottom: clamp(14px, 2vh, 24px);
        margin: 0;
        padding: 0;
        max-width: 380px;
        text-align: right;
    }
}

@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
    /* Stream is the focal point on desktop — fade it in alongside the hero */
    .memorial > .stream { animation-delay: 120ms; }
}

@media (prefers-reduced-motion: reduce) {
    .cta { transition: none; }
    .cta:hover,
    .cta:focus-visible { transform: none; }
}

@media (max-width: 480px) {
    body { font-size: 17px; }
    .countdown { padding: 12px 16px; gap: 12px; }
    .countdown .num { font-size: 1.3rem; }
    .cta { padding: 14px 24px; font-size: 12px; letter-spacing: 0.2em; }
}

@media print {
    html, body { background: #fff; color: #000; }
    .cta-row, .countdown, .stream, .stream-heading { display: none !important; }
    .memorial { max-width: 100%; padding: 24px; }
    .hero { box-shadow: none; border: 1px solid #bbb; }
    .name-block h1 { font-size: 32pt; }
    .name-block .dates { font-size: 12pt; letter-spacing: 0.14em; }
    .service .when { font-size: 12pt; }
    @page { margin: 18mm; }
}
