/* Six-Pack of Care — Oxford Editorial */

/* ─── SELF-HOSTED FONTS ─── */
@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url("fonts/outfit-latin-ext.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;
}
@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url("fonts/outfit-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;
}

/* ─── CUSTOM PROPERTIES ─── */
:root {
    --oxford-blue: #002147;
    --ink: #0f1923;
    --paper: #faf8f5;
    --warm: #f4f1ec;
    --surface: #fff;
    --card: #f4f1ec;
    --text: #2c3e50;
    --muted: #5f6a7d;
    --heading: #002147;
    --gold: #886d35;
    --gold-light: #c9a961;
    --teal: #2a7f8a;
    --border: #e0ddd7;
    --shadow: 0 2px 8px rgba(0, 33, 71, 0.06);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.08);
    --serif: "Lora", Georgia, serif;
    --sans: "Outfit", system-ui, sans-serif;
    --accent-teal: #2a7f8a;
    --accent-blue: #2a7f8a;
    --accent-gradient: linear-gradient(135deg, var(--oxford-blue), #003366);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    color: var(--text);
    background: var(--paper);
    margin: 0;
    padding: 0;
    line-height: 1.8;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: color-mix(in srgb, var(--teal) 20%, transparent);
}

/* ─── LINKS ─── */
a {
    color: var(--teal);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    transition: color 0.2s;
}

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

/* ─── HEADER ─── */
header {
    background: var(--oxford-blue);
    color: white;
    padding: 56px 32px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--gold-light),
        transparent
    );
}

header .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

header img.oxford-logo {
    max-width: 180px;
    margin: 5px;
    height: 90px;
    opacity: 0.92;
    transition: opacity 0.3s;
}

header img.oxford-logo:hover {
    opacity: 1;
}

.lang-toggle {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-family: var(--sans);
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 5px 14px;
    border-radius: 3px;
    transition: all 0.2s;
}

.lang-toggle:hover {
    color: white;
    border-color: var(--gold-light);
    background: rgba(255, 255, 255, 0.08);
}

header h1 {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 12px 0 0 0;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.2s forwards;
}

header p {
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.75);
    margin: 8px 0 0;
    line-height: 1.6;
}

header a {
    color: white;
    text-decoration: none;
}

header .chapter-date {
    margin: 8px auto 0;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--gold-light);
    max-width: 95%;
}

/* ─── TABLES ─── */
main table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.92rem;
    overflow-x: auto;
    display: block;
}

main th {
    text-align: left;
    padding: 0.6rem 1rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--gold);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

main td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.5;
}

main td:first-child {
    font-weight: 500;
    white-space: nowrap;
}

main tr:last-child td {
    border-bottom: none;
}

/* ─── MAIN CONTENT ─── */
main {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 32px;
    font-family: var(--serif);
    font-size: 1.1rem;
}

main article {
    max-width: 900px;
    margin: 0 auto;
}

article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 40px;
}

/* ─── SECTIONS ─── */
section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 36px;
    margin-bottom: 32px;
}

/* ─── TYPOGRAPHY ─── */
h2,
h3,
h4 {
    font-family: var(--serif);
    font-weight: 600;
    color: var(--heading);
    letter-spacing: -0.01em;
}

h1 {
    scroll-margin-top: 24px;
}

h2 {
    font-size: clamp(1.6rem, 3.5vw, 2rem);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gold);
    margin-top: 2.5em;
    margin-bottom: 0.8em;
}

/* h3 is the primary structural heading within chapters */
h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 2.8em;
    margin-bottom: 0.6em;
    padding-top: 1.5em;
    border-top: 1px solid var(--border);
    scroll-margin-top: 24px;
}

/* First heading right after opening prose — no divider needed */
main > p + h3,
main > p + h2,
main > em + h3,
main > .audio-section + h3,
main > .overview-section + h2,
main > .video-embed + h3 {
    border-top: none;
    padding-top: 0;
    margin-top: 2em;
}

h4 {
    font-size: 1.05rem;
    margin-top: 1.8em;
    margin-bottom: 0.4em;
}

p {
    margin: 1em 0;
}

/* Blockquotes — for manifesto and inline quotes */
blockquote {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--muted);
    border-left: 2px solid var(--gold);
    padding: 4px 0 4px 24px;
    margin: 2em 0;
    line-height: 1.7;
}

blockquote p {
    margin: 0.5em 0;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 3em 0;
}

ul {
    padding-left: 1.2em;
    margin: 0.8em 0;
}

ol {
    padding-left: 1.4em;
    margin: 0.8em 0;
}

li {
    margin: 0.5em 0;
    line-height: 1.7;
}

li > ul,
li > ol {
    margin: 0.3em 0;
}

/* ─── EMPHASIS ─── */
strong {
    font-weight: 600;
    color: var(--heading);
}

em {
    font-style: italic;
}

/* ─── LEAD & CALLOUT ─── */
.lead {
    font-size: 1.05rem;
    color: var(--muted);
}

.callout {
    border-left: 3px solid var(--gold);
    background: var(--warm);
    padding: 20px 24px;
    border-radius: 0 4px 4px 0;
    margin: 1.5em 0;
}

/* ─── TEAM PHOTOS ─── */
.team-photos {
    display: flex;
    justify-content: space-around;
    margin-bottom: 24px;
}

.team-photos p {
    text-align: center;
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--heading);
}

.team-photos img {
    width: 200px;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.team-photos img:hover {
    transform: scale(1.02);
}

/* ─── AUDIO PLAYER ─── */
.audio-section {
    clear: both;
    margin: 32px 0;
    padding: 20px 24px;
    background: var(--warm);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.audio-section audio {
    width: 100%;
    display: block;
    outline: none;
}

.audio-label {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0 0 0.5rem;
}

.audio-links {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0.5rem 0 0;
}

/* ─── TRANSCRIPT SPEAKER TURNS ─── */
main p:has(> strong:first-child) {
    border-top: 1px solid var(--border);
    padding-top: 1.4rem;
    margin-top: 1.6rem;
}

/* ─── VIDEO EMBED ─── */
.video-embed {
    position: relative;
    padding-top: 56.25%;
    margin: 32px 0;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ─── OVERVIEW ─── */
.overview-section {
    text-align: center;
    margin: 0 0 40px;
    padding: 0;
    background: transparent;
    border-radius: 4px;
    overflow: hidden;
}

.overview-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.figure-caption {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}

.figure-caption strong {
    color: var(--heading);
}

/* ─── GRID LAYOUTS ─── */
.metrics,
.tools,
.interfaces,
.glossary {
    display: grid;
    gap: 12px;
}

@media (min-width: 720px) {
    .metrics,
    .tools,
    .interfaces,
    .glossary {
        grid-template-columns: 1fr 1fr;
    }
}

/* ─── NEXT ACTION / NAVIGATION ─── */
.next-action {
    background: var(--oxford-blue);
    color: white;
    padding: 48px 24px;
    margin: 0;
    text-align: center;
    border-radius: 0;
    position: relative;
}

.next-action::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--gold-light),
        transparent
    );
}

.next-action-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.next-action h2 {
    font-family: var(--serif);
    font-size: 2em;
    margin: 0 0 16px 0;
    color: white;
    border-bottom: none;
}

.next-action p {
    font-size: 1.1em;
    margin: 0 0 32px 0;
    opacity: 0.85;
}

.next-action-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: white;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 3px;
    font-family: var(--sans);
    font-weight: 500;
    font-size: 0.95em;
    letter-spacing: 0.03em;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.next-action-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: var(--gold-light);
}

.next-action-button .button-text {
    font-family: var(--sans);
}

.next-action-button .button-arrow {
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

.next-action-button:hover .button-arrow {
    transform: translateX(4px);
}

/* Header manifesto button — override for use inside header */
header .next-action-button {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 10px 24px;
    font-size: 0.85em;
    margin-top: 8px;
}

header .next-action-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--gold-light);
}

/* ─── FOOTER ─── */
footer {
    text-align: center;
    padding: 48px 32px;
    background: var(--ink);
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0;
    font-size: 0.85em;
    line-height: 1.8;
}

footer a {
    color: var(--gold-light);
    text-decoration: none;
    text-decoration-thickness: 1px;
}

footer a:hover {
    color: white;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* ─── SKIP LINK ─── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 2000;
    background: var(--oxford-blue);
    color: white;
    padding: 8px 16px;
    border-radius: 0 0 4px 4px;
    font-family: var(--sans);
    font-size: 0.85rem;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
    color: white;
}

/* ─── FOCUS ─── */
:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 3px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 719px) {
    .metrics,
    .tools,
    .interfaces,
    .glossary {
        grid-template-columns: 1fr;
        row-gap: 0;
        column-gap: 0;
    }

    .metrics ul,
    .tools ul,
    .interfaces ul,
    .glossary ul {
        margin: 0;
    }

    header {
        padding: 40px 20px 32px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    main {
        padding: 32px 20px;
    }

    section {
        padding: 24px;
    }

    article {
        padding: 24px;
    }

    .overview-section {
        margin-left: -20px;
        margin-right: -20px;
        border-radius: 0;
        padding: 0;
    }

    .overview-image {
        border-radius: 0;
        border: none;
    }

    .team-photos {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    footer {
        padding: 40px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── PRINT ─── */
@media print {
    header,
    .next-action,
    .skip-link,
    .lang-toggle,
    .audio-section,
    .video-embed,
    footer {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 11pt;
    }

    main {
        max-width: 100%;
        padding: 0;
    }

    a {
        color: inherit;
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #555;
    }

    a[href^="#"]::after,
    a[href^="/"]::after {
        content: "";
    }
}

/* ─── DARK MODE ─── */
@media (prefers-color-scheme: dark) {
    :root {
        --paper: #111820;
        --warm: #161e28;
        --surface: #1c2535;
        --card: #161e28;
        --text: #b8b4ac;
        --muted: #8a96a8;
        --heading: #e8e4dc;
        --border: rgba(255, 255, 255, 0.1);
        --gold: #c9a961;
        --teal: #4bc3d4;
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.4);
        --accent-teal: #4bc3d4;
        --accent-blue: #4bc3d4;
    }

    main th {
        border-bottom-color: rgba(255, 255, 255, 0.15);
    }
    main td {
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }

    main p:has(> strong:first-child) {
        border-top-color: rgba(255, 255, 255, 0.08);
    }

    h3 {
        border-top-color: rgba(255, 255, 255, 0.08);
    }

    hr {
        border-top-color: rgba(255, 255, 255, 0.08);
    }

    .callout {
        background: #1a2636;
    }

    .audio-section {
        background: #1a2636;
    }
}
