/* Self-hosted fonts (Inter, Fraunces, Newsreader; SIL OFL). Paths match /fonts/*.woff2 */
/* vietnamese */
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 600;
    font-display: optional;
    src: url(/fonts/6NUu8FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0K7iN7iQcIfJD58njt0oc0qv8oRcTnaIM.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 600;
    font-display: optional;
    src: url(/fonts/6NUu8FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0K7iN7iQcIfJD58njt0oc1qv8oRcTnaIM.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 600;
    font-display: optional;
    src: url(/fonts/6NUu8FyLNQOQZAnv9bYEvDiIdE9Ea92uemAk_WBq8U_9v0c2Wa0K7iN7iQcIfJD58njt0oc7qv8oRcTn.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Newsreader (SIL OFL): body text, dates and the home-page quote. Latin subset, variable weight 400–700
   (optical size fixed at the text design, which halves the files), roman and italic. */
@font-face {
    font-family: 'Newsreader';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(/fonts/newsreader-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Newsreader';
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url(/fonts/newsreader-italic-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic-ext */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* greek-ext */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+1F00-1FFF;
}

/* greek */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

/* vietnamese */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic-ext */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* greek-ext */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+1F00-1FFF;
}

/* greek */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

/* vietnamese */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic-ext */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* greek-ext */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+1F00-1FFF;
}

/* greek */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

/* vietnamese */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: optional;
    src: url(/fonts/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ====== Base ====== */
/* Four themes: this base one (Yang-Yang) and one per home-page still ([data-still] blocks below). */
:root {
    color-scheme: light;
    /* Yang-Yang (default) theme: pale green-cream paper with the deep green of his shorts for links, mustard accent from his shirt */
    --bg: #eceedd;
    --ink: #1b2616;
    --muted: #5c6653;
    --rule: #d4d9c0;
    --col: 900px;
    --link: #2f6337;
    --link-hover: #224a28;
    --accent-warm: #c9a22a;
    --tag-checked-border: #b8c9a8;
    --tag-checked-bg: #dfe6d0;
    --callout-bg: #e1e5cf;
    --surface: #f5f6ec;
    --surface-hover: #e3e6d3;
}

/* Per-photo themes: the home-page still sets data-still on <html> (default = the base theme above, for Yang-Yang). */
:root[data-still="balloons"] {
    --bg: #f5e8e4;
    --ink: #2e1a1a;
    --muted: #7a5a57;
    --rule: #e2c9c3;
    --link: #962626;
    --link-hover: #761c1c;
    --accent-warm: #d17a8a;
    --tag-checked-border: #e0b3b8;
    --tag-checked-bg: #f3dcdf;
    --callout-bg: #efdcd6;
    --surface: #fbf3f0;
    --surface-hover: #efdfd9;
}

:root[data-still="perfectdays"] {
    --bg: #f2e7d0;
    --ink: #2a2118;
    --muted: #6f604c;
    --rule: #dfcfae;
    --link: #2f4a7a;
    --link-hover: #213559;
    --accent-warm: #c08a2e;
    --tag-checked-border: #b6c3d9;
    --tag-checked-bg: #dde4ee;
    --callout-bg: #eadcbd;
    --surface: #f8f0de;
    --surface-hover: #eadfc6;
}

:root[data-still="record"] {
    /* darkroom: the only dark theme; the grain lightens the paper here instead of darkening it */
    color-scheme: dark;
    --bg: #131313;
    --ink: #e8e8e8;
    --muted: #a3a3a3;
    --rule: #2d2d2d;
    --link: #cdcdcd;
    --link-hover: #ffffff;
    --accent-warm: #6d6d6d;
    --tag-checked-border: #4a4a4a;
    --tag-checked-bg: #262626;
    --callout-bg: #1e1e1e;
    --surface: #1e1e1e;
    --surface-hover: #282828;
    --tex-blend: screen;
    --tex-invert: 1;
}

/* the paper colour (also covers the overscroll area); fades when the theme changes */
html {
    background-color: var(--bg);
    transition: background-color .22s ease;
    scroll-behavior: smooth;
    /* nothing may widen the page sideways (e.g. a tooltip near the edge on a phone) */
    overflow-x: clip;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    /* transparent: the paper colour is on <html>, and the texture layer sits between it and the content */
    background: transparent;
    line-height: 1.6;
}

/* Paper grain: a fixed, non-interactive noise layer behind the content, multiplied into the paper colour.
   (--tex-blend / --tex-invert let a dark theme lighten instead of darken.) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    /* behind the content, above the paper colour: textures the paper, never the photos */
    z-index: -1;
    pointer-events: none;
    opacity: .15;
    mix-blend-mode: var(--tex-blend, multiply);
    filter: invert(var(--tex-invert, 0));
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-size: 180px 180px;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 0.75rem;
    z-index: 2000;
    padding: 0.3rem 0.5rem;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-decoration: none;
    background: var(--link);
    color: var(--bg);
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.skip-link:hover {
    color: var(--bg);
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 0.5rem;
    outline: 2px solid var(--link-hover);
    outline-offset: 1px;
}

/* Only for keyboard / skip-link focus; a mouse click inside main should not draw a ring */
#main-content:focus-visible {
    outline: 3px solid var(--link);
    outline-offset: 4px;
}

/* Cross-fade the colours when the home-page still switches theme */
@media (prefers-reduced-motion: no-preference) {

    body,
    .content {
        transition:
            background-color 0.22s ease,
            color 0.22s ease,
            border-color 0.22s ease;
    }

    .nav-home {
        transition: color 0.22s ease, text-decoration-color 0.22s ease;
    }
}

/* ====== Layout (no nav; inner pages get a signature that links home, "Nixon Hanna / blog" on posts) ====== */
.site-header {
    width: 100%;
    margin: 0;
    padding: 18px 32px 0;
    display: flex;
    align-items: baseline;
    gap: .55rem;
    font-family: Newsreader, Georgia, "Times New Roman", serif;
}

.nav-home {
    display: inline-block;
    /* 10px above and below: a 44px+ tap target without looking bigger */
    padding: 10px 0;
    font-size: 1.05rem;
    font-variant-caps: all-small-caps;
    letter-spacing: .07em;
    color: var(--muted);
    text-decoration: underline transparent 1px;
    text-underline-offset: .28em;
}

.nav-home:hover,
.nav-home:focus-visible {
    color: var(--ink);
    text-decoration-color: currentColor;
}

/* The signature: the name in the title face */
.nav-sig {
    font-family: Fraunces, Georgia, serif;
    font-weight: 600;
    font-size: 1.1rem;
    font-variant-caps: normal;
    letter-spacing: 0;
    color: var(--ink);
}

.crumb-sep {
    color: var(--muted);
}

.content {
    width: 100%;
    max-width: var(--col);
    margin: 0 auto;
    padding: 56px 24px 40px;
    display: flex;
    flex-direction: column;
    min-height: 60vh;
    font-family: Newsreader, Georgia, "Times New Roman", serif;
    font-size: 1.18rem;
}

.content>* {
    max-width: none;
    width: 100%;
}

/* ====== Typography ====== */
.h1 {
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(1.8rem, 1.6rem + 1.2vw, 2.4rem);
    line-height: 1.2;
    margin: 0 0 1rem;
}

.h2 {
    font-family: Fraunces, Georgia, serif;
    font-size: 1.375rem;
    margin: 2rem 0 .5rem;
}

/* Home h1: the name links to Letterboxd without the usual underline */
.h1-name {
    text-decoration: none;
}

/* Home "Who" / "What": quiet links (Letterboxd, LinkedIn) that look exactly like the plain headings */
.h2-quiet,
.h2-quiet:hover {
    color: inherit;
    text-decoration: none;
}

.last-updated {
    margin-bottom: 0.5rem;
}

/* Home "Most recently…" stays out of the layout until the Worker (or its script) fills it in */
#lately[hidden] {
    display: none;
}

.note+.last-updated {
    margin-top: 2rem;
}

.lead {
    font-size: 1.125rem;
}

/* ====== Rules & footer ====== */
hr {
    border: 0;
    height: 1px;
    background: var(--rule);
    margin: 2rem 0;
}

/* ====== Blog list ====== */
.year {
    margin: 2rem 0 .75rem;
    font-weight: 600;
    color: var(--muted);
}

.post-list {
    display: block;
    --post-row-pad-inline: 0.75rem;
    /* closes the list below its last visible row (a :last-of-type rule missed rows hidden by the filter) */
    border-bottom: 1px solid var(--rule);
}

.post {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: .5rem 1rem;
    padding: .65rem 0;
    border-top: 1px solid var(--rule);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.post:hover {
    background-color: color-mix(in srgb, var(--ink) 3%, transparent);
}

.post-head {
    display: block;
    padding-left: var(--post-row-pad-inline);
}

.post-title {
    color: inherit;
    text-decoration: none;
}

.post-title:hover,
.post-title:active,
.post-title:focus {
    color: inherit;
    text-decoration: underline;
}

.post-date {
    color: var(--muted);
    white-space: nowrap;
    padding-right: var(--post-row-pad-inline);
}

.post-readtime {
    color: var(--muted);
    white-space: nowrap;
    font-size: .9em;
    margin-left: .5rem;
}

.taglist {
    grid-column: 1 / -1;
    list-style: none;
    padding: 0;
    margin: .25rem 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.post .taglist {
    padding-left: var(--post-row-pad-inline);
}

/* On mobile, keep the tags under the title column rather than across the date */
@media (max-width:720px) {
    .taglist {
        grid-column: auto;
    }
}

.taglist li {
    padding: .15rem .5rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    font-size: .8rem;
    color: var(--ink);
    background: var(--surface);
}

.taglist li .tag-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.taglist li .tag-link:hover {
    color: var(--link);
}

/* Custom tag tooltip: faster than native title and fully styleable */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.45rem);
    transform: translate(-50%, 0.2rem);
    opacity: 0;
    pointer-events: none;
    z-index: 25;
    width: max-content;
    max-width: min(34ch, 80vw);
    padding: 0.42rem 0.56rem;
    border-radius: 8px;
    background: var(--ink);
    color: var(--bg);
    border: 1px solid var(--rule);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    transition:
        opacity 0.1s ease,
        transform 0.1s ease;
    transition-delay: 0s;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
    transition-delay: 0.12s;
}

@media (hover: none) {
    [data-tooltip]::after {
        display: none;
    }
}

/* ====== Entry (single post) ====== */
.entry img {
    max-width: 100%;
    height: auto;
}

.entry-head {
    margin-bottom: 1rem;
}

.entry-subtitle {
    margin: -0.35rem 0 1rem;
    color: var(--muted);
    font-size: 1.28rem;
    font-weight: 500;
    line-height: 1.5;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    align-items: center;
    color: var(--muted);
}

.entry-dates {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.entry-date-separator {
    color: var(--muted);
}

.entry-updated {
    color: var(--muted);
    font-size: 0.95em;
}

.entry-meta .taglist {
    flex-basis: 100%;
    margin-top: 0.5rem;
}

.entry-meta .taglist li {
    color: var(--ink);
}

/* Aside-style boxes (cross-post links, blog subscribe, etc.) */
.callout {
    margin: 1.25rem 0;
    padding: 0.75rem 1rem;
    background: var(--callout-bg);
    border-left: 3px solid var(--link);
    border-radius: 4px;
    font-size: 0.95em;
}

.callout p {
    margin: 0;
    color: var(--muted);
}

.callout a {
    color: var(--link);
    font-weight: 500;
}

.post-feedback {
    margin: 1.5rem 0 0;
    color: var(--muted);
    font-size: 0.95em;
}

.callout--notice a {
    font-style: italic;
    text-decoration: none;
}

.callout--notice a:hover {
    text-decoration: underline;
}

/* ====== Click-to-copy text (looks like a link, copies on click) ====== */
.copy-text {
    position: relative;
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--link);
    text-decoration: underline;
    cursor: pointer;
}

.copy-text:hover {
    color: var(--link-hover);
}

.copy-text-done {
    position: absolute;
    left: 50%;
    bottom: calc(100% + .35em);
    transform: translateX(-50%);
    padding: .15em .5em;
    border-radius: 4px;
    background: var(--ink);
    color: var(--bg);
    font-family: Inter, system-ui, sans-serif;
    font-size: .75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.copy-text.is-copied .copy-text-done {
    opacity: 1;
}

/* ====== Links ====== */
a {
    color: var(--link);
}

a:hover {
    color: var(--link-hover);
}

/* ====== Buttons ====== */
a.button {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--link);
    color: var(--bg);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s;
}

a.button:hover {
    background: var(--link-hover);
    color: var(--bg);
}

/* ====== Blockquotes ====== */
blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--accent-warm);
    background: var(--callout-bg);
    border-radius: 4px;
    font-style: italic;
    color: var(--ink);
    line-height: 1.6;
}

blockquote p {
    margin: 0;
}

blockquote p:not(:last-child) {
    margin-bottom: 0.5rem;
}

/* Home epigraph: hover and the quote dissolves into the aside.
   Both paragraphs occupy the same grid cell, so they share a width and wrap the same way.
   Mouse: hover only (a click can't pin it). Keyboard: focus-visible. Touch: tap (focus-within). */
.epigraph-wrap {
    display: grid;
    /* sits directly under the greeting as its subtitle */
    margin: -.4rem 0 1.8rem;
    /* a tiny hand-drawn asterisk for a cursor, hotspot at its centre */
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'><g fill='none' stroke='%232b241d' stroke-width='2.6' stroke-linecap='round'><path d='M10 2.5c.3 4.6-.2 9.6.2 15'/><path d='M3.4 6.2c4.2 2.2 8.6 5 13.3 7.5'/><path d='M16.4 6.4c-4.6 2.3-9 4.8-13 7.4'/></g></svg>") 6 6, default;
}

.epigraph-wrap>* {
    grid-area: 1 / 1;
    margin: 0;
    color: var(--muted);
    font-size: 1.12em;
    line-height: 1.5;
    transition: opacity .3s ease;
}

.epigraph:focus:not(:focus-visible) {
    outline: none;
}

.epigraph-note {
    opacity: 0;
    /* stacked above the quote; let clicks and taps reach the quote so it takes focus */
    pointer-events: none;
}

/* a short delay on the way in, none on the way out */
.epigraph-wrap:hover .epigraph,
.epigraph-wrap:has(.epigraph:focus-visible) .epigraph {
    opacity: 0;
    transition-delay: .4s;
}

.epigraph-wrap:hover .epigraph-note,
.epigraph-wrap:has(.epigraph:focus-visible) .epigraph-note {
    opacity: 1;
    transition-delay: .4s;
}

@media (hover: none) {
    .epigraph-wrap:focus-within .epigraph {
        opacity: 0;
    }

    .epigraph-wrap:focus-within .epigraph-note {
        opacity: 1;
    }
}

/* ====== Tag filter (one tag at a time; the script in blog.astro does the filtering) ====== */
.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1rem 0;
    position: relative;
}

.tag-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.tag-filter input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tag-filter .tag {
    padding: .35rem .75rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--surface);
    font-size: .9rem;
    cursor: pointer;
    user-select: none;
    color: var(--ink);
    -webkit-tap-highlight-color: transparent;
}

.tag-filter .tag:hover {
    background: var(--surface-hover);
}

/* Ensure all buttons use theme colors on iOS */
button {
    color: var(--ink);
    -webkit-tap-highlight-color: transparent;
}

#filters input:checked+label.tag {
    border-color: var(--tag-checked-border);
    background: var(--tag-checked-bg);
}

#filters input:focus-visible+label.tag {
    outline: 2px solid var(--link);
    outline-offset: 2px;
}

/* ====== Responsive ====== */
@media (max-width:980px) {
    .content {
        padding: 44px 20px 32px;
        font-size: 1.15rem;
    }
}

/* Blog header row */
.blog-head {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.blog-empty-feedback {
    margin: 1.25rem 0 0;
    padding: 0.65rem 0.85rem;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
    border: 1px dashed var(--rule);
    border-radius: 6px;
    background: var(--callout-bg);
}

.blog-empty-feedback[hidden] {
    display: none !important;
}

@media (max-width:720px) {
    .site-header {
        padding: 10px 16px 0;
    }
}

/* ====== Home-page still: full column width between "Who" and "What" ====== */
.still {
    width: 100%;
    margin: 1.8rem 0 2.2rem;
}

.still img {
    display: block;
    width: 100%;
    height: auto;
}

/* the still is a button: click to see the next photo (and theme) */
.still-cycle {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    position: relative;
}

/* film credit that follows the cursor: plain small text on a flat block */
.still-film {
    position: absolute;
    left: 0;
    top: 0;
    padding: 1px 5px;
    background: var(--ink);
    color: var(--bg);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .72rem;
    line-height: 1.5;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    /* hides at once when the pointer leaves */
    transition: opacity .15s ease;
}

/* site.js adds .is-on once the pointer has rested on the photo (FILM_DELAY) */
.still-film.is-on {
    opacity: 1;
}

@media (hover: none) {
    .still-film {
        display: none;
    }
}

.still-cycle:focus-visible {
    outline: 3px solid var(--link);
    outline-offset: 4px;
}

/* Home: plain list of links in the "find me on" section */
.link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

/* ====== Home: recent posts, as an ordinary list ====== */
.recent-list {
    margin: .5rem 0 1rem;
    padding-left: 1.4rem;
}

.recent-list li {
    margin: .25rem 0;
}

.recent-date {
    color: var(--muted);
    font-size: .92em;
    white-space: nowrap;
}

/* ====== Footnotes ====== */
/* Footnotes section container - separated from main content */
.footnotes {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
    font-size: 0.95em;
}

.footnotes::before {
    content: "Footnotes";
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Footnotes ordered list */
.footnotes ol {
    list-style: decimal;
    padding-left: 1.5rem;
    margin: 0;
}

/* Individual footnote item */
.footnotes li {
    margin-bottom: 0.875rem;
    padding-left: 0.5rem;
    line-height: 1.65;
    color: var(--ink);
}

.footnotes li:last-child {
    margin-bottom: 0;
}

/* Paragraphs inside footnotes */
.footnotes li p {
    display: inline;
    margin: 0;
}

.footnotes li p:not(:last-child) {
    margin-bottom: 0.5em;
    display: block;
}

/* Archive: title and date on one row (date right-aligned; wraps on narrow viewports) */
.archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.archive-list>li {
    margin: 0 0 1.75rem;
}

.archive-list>li:last-child {
    margin-bottom: 0;
}

.archive-item-top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    column-gap: 1rem;
    row-gap: 0.2rem;
}

.archive-title {
    flex: 1 1 auto;
    min-width: min(100%, 12rem);
    font-weight: 600;
}

.archive-date {
    flex: 0 0 auto;
    margin: 0;
    font-size: 0.88rem;
    font-weight: 400;
    font-style: normal;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.archive-list>li>p {
    margin-top: 0.45rem;
}
/* ====== Footnote links ======
   Astro's markdown (remark-gfm) marks the reference and back-links with data attributes. */
sup:has(> a[data-footnote-ref]) {
    font-size: 0.75em;
    line-height: 0;
    vertical-align: super;
    position: relative;
    top: -0.5em;
}

a[data-footnote-ref] {
    text-decoration: none;
    color: var(--link);
    font-weight: 500;
    padding: 0 0.1em;
    border-radius: 2px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a[data-footnote-ref]:hover {
    color: var(--link-hover);
    background-color: color-mix(in srgb, var(--link) 12%, transparent);
}

.footnotes li a[data-footnote-backref] {
    text-decoration: none;
    color: var(--link);
    margin-left: 0.25em;
    font-size: 0.9em;
}

.footnotes li a[data-footnote-backref]:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* The injected "Footnotes" heading is redundant — .footnotes::before draws the label. */
.footnotes .footnote-label-hidden {
    display: none;
}
