/* Colour variables */
:root {
    --primary: #7a1f3d; --on-primary: #f4d58d; --link: #7a1f3d; --accent: #b8860b;
    --panel: #f5f7fa; --bg: #fff; --text: #222; --text-strong: #1f2937; --muted: #6b7280; --note: #4b5563;
    --border: #ddd; --header-note: #e8c8d2; --tab-hover: #f4d58d;
}

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

 body {
     font-family: Arial, Helvetica, sans-serif;
     line-height: 1.6;
     color: var(--text);
     background: var(--bg);
 }

 .container {
     max-width: 1100px;
     margin: auto;
     padding: 0 24px;
 }

 header {
     background: var(--primary);
     color: var(--on-primary);
     padding: 50px 0;
 }

 header h1 {
     font-size: 3rem;
     margin-bottom: 16px;
 }

 header p {
     font-size: 1.2rem;
     max-width: 700px;
 }

 header a {
     color: var(--on-primary);
     text-decoration: none;
     font-size: 0.85rem;
 }

 .cta {
     margin-top: 32px;
 }

 .btn {
     display: inline-block;
     background: var(--accent);
     color: white;
     text-decoration: none;
     padding: 14px 24px;
     border-radius: 4px;
     font-weight: bold;
 }

 section {
     padding: 24px 0 70px;
 }

 section .quote:first-child {
     margin-top: 0;
 }

 h2 {
     margin-bottom: 24px;
     color: var(--text-strong);
 }

 .grid {
     display: grid;
     gap: 24px;
     grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
 }

 .card {
     border: 1px solid var(--border);
     padding: 24px;
     border-radius: 6px;
 }

 .card h3 {
     margin-bottom: 12px;
 }

 .benefits {
     background: var(--panel);
 }

 ul {
     padding-left: 20px;
 }

 li {
     margin-bottom: 12px;
 }

 .quote {
     background: var(--panel);
     border-left: 2px solid var(--accent);
     padding: 24px;
     font-style: bold;
     margin-top: 24px;
 }

 footer {
     background: #1f2937;
     color: white;
     text-align: center;
     padding: 40px 20px;
 }
 .header-links {
     display: flex;
     align-items: center;
     gap: clamp(20px, 3vw, 36px);
 }

 .header-links .icons {
     display: flex;
     align-items: center;
     gap: clamp(20px, 3vw, 36px);
 }

 .header-links .icons a {
     display: inline-flex;
 }

 .header-links .icons a {
     min-width: 44px;
     min-height: 44px;
     justify-content: center;
     align-items: center;
 }

 @media (max-width: 600px) {
     .header-links {
         flex-wrap: wrap;
         gap: 8px 16px;
     }
 }

/* Shared page styles (header tabs, board, video flyout) */
.title-row { display: flex; align-items: baseline; gap: 28px; }
.title-row h3 { font-weight: 400; }
.title-row h3.current { font-weight: 700; }
.title-row h3 a { font: inherit; color: inherit; text-decoration: none; opacity: .7; }
.title-row h3 a:hover, .title-row h3 a:focus-visible { opacity: 1; text-decoration: none; outline: none; }

.title-row .gh-link { margin-left: auto; color: inherit; opacity: .7; display: inline-flex; align-self: center; }
.title-row .gh-link:hover, .title-row .gh-link:focus-visible { opacity: 1; outline: none; }

:root { color-scheme: only light; }

.board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    width: calc(100vw - 48px);
    container-type: inline-size;
    margin: 24px 0 24px calc(50% - 50vw + 24px);
    border: 4px solid #1f2937;
    border-radius: 6px;
}

.square:first-child { border-top-left-radius: 2px; }
.square:nth-child(4) { border-top-right-radius: 2px; }
.square:nth-child(9) { border-bottom-left-radius: 2px; }
.square:last-child { border-bottom-right-radius: 2px; }

.square {
    forced-color-adjust: none;
    aspect-ratio: 1;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 3px 5px;
    font: 1.9cqw/1 sans-serif;
    text-decoration: none;
    transition: transform .15s, filter .15s;
}

.square.first {
    align-items: center;
    justify-content: center;
    font: bold 1.9cqw/1.25 Arial, Helvetica, sans-serif;
    text-align: center;
}

.square.light { background: var(--on-primary); color: var(--primary); }
.square.dark  { background: var(--primary); color: var(--on-primary); }

.square:hover,
.square:focus-visible {
    filter: brightness(1.25);
    transform: scale(1.08);
    z-index: 2;
    outline: none;
}

.flyout {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(92vw, 800px);
    background: #000;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    transform: translate(-50%, -50%) scale(.6);
    opacity: 0;
    visibility: hidden;
    transition: transform .35s ease, opacity .35s ease, visibility 0s .35s;
    z-index: 10;
}

.flyout.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    transition: transform .35s ease, opacity .35s ease;
}

.flyout video {
    width: 100%;
    height: auto;
    max-height: 90vh;
    display: block;
}

.flyout .close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
}

.flyout .fs { right: 56px; font-size: 18px; }

.flyout .close:hover { background: rgba(0, 0, 0, .85); }
@media (orientation: landscape) and (max-height: 500px) {
    header { padding: 12px 0; }
    section { padding: 8px 0 24px; }
    .board { margin: 40px 0 8px calc(50% - 50vw + 24px); width: calc(100vw - 48px); }
}

/* Mobile: 2 columns so square text stays readable; rows size to the squares (no gaps) */
@media (max-width: 600px) {
    .board { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: calc((100vw - 56px) / 2); }
    .square { aspect-ratio: auto; height: 100%; min-height: 0; overflow: hidden; font-size: 4.2cqw; }
    .square.first { font-size: 4.2cqw; }
    /* checkerboard for 2 columns */
    .square:nth-child(4n+1), .square:nth-child(4n+4) { background: var(--primary); color: var(--on-primary); }
    .square:nth-child(4n+2), .square:nth-child(4n+3) { background: var(--on-primary); color: var(--primary); }
}

/* Icons at the bottom of each quote */
.quote-icons { display: flex; gap: 12px; margin-top: 12px; }
.quote h3 .mp4-icon { color: var(--link); opacity: .7; display: inline-flex; vertical-align: middle; margin-left: 8px; cursor: pointer; text-decoration: none; }
.quote h3 .mp4-icon:hover, .quote h3 .mp4-icon:focus-visible { opacity: 1; color: var(--accent); outline: none; text-decoration: none; }
.quote-icons .mp4-icon { color: var(--link); opacity: .7; display: inline-flex; cursor: default; pointer-events: none; }
.quote-icons .icon-link { color: inherit; opacity: .7; display: inline-flex; }
.quote-icons .icon-link:hover, .quote-icons .icon-link:focus-visible { opacity: 1; outline: none; }

/* LinkedIn icon sits just left of the GitHub icon, both pushed to the right */
.title-row .li-link { margin-left: auto; color: inherit; opacity: .7; display: inline-flex; align-self: center; }
.title-row .li-link:hover, .title-row .li-link:focus-visible { opacity: 1; outline: none; }
.title-row .li-link + .gh-link { margin-left: 14px; }

/* Header icons that link to the Sound Bites and Receipes pages: same toned-down look as the LinkedIn icon */
.title-row .page-link { color: inherit; opacity: .7; display: inline-flex; align-self: center; }
.title-row .page-link:hover, .title-row .page-link:focus-visible { opacity: 1; outline: none; }
.title-row .header-note + .page-link { margin-left: 28px; }
.title-row .article-title + .page-link { margin-left: auto; }
.title-row .page-link + .page-link, .title-row .page-link + .li-link { margin-left: 14px; }

/* Header note: left of the icons, vertically centred with them, in a soft rose that reads well on the maroon header */
.title-row .header-note { flex: 1; min-width: 0; align-self: center; margin: 0; color: var(--header-note); font-size: 1.17rem; line-height: 1.4; }
@media (min-width: 601px) { .home .title-row .header-note { font-size: 0.95rem; } }
.title-row .header-note + .li-link { margin-left: 28px; }

/* Short note under a recipe title */
.quote .item-date { color: var(--muted); font-size: 0.85rem; margin: 0 0 4px; }
.quote .item-note { color: var(--note); font-size: 1rem; line-height: 1.4; margin: 0 0 8px; }
@media (min-width: 601px) { .home .quote .item-note { font-size: 0.8rem; } }

/* Line above the recipe list: same font size as the list titles */
.intro { color: var(--text-strong); font-size: 1.17rem; line-height: 1.5; }
@media (min-width: 601px) { .home .intro { font-size: 0.95rem; } }
.intro p + p { margin-top: 8px; }
.intro h3 { color: var(--link); font-size: 1.17rem; margin-top: 16px; }
.intro h3 + p { margin-top: 4px; }
@media (min-width: 601px) { .home .intro h3 { font-size: 0.95rem; } }

/* Site title on the home page */
.site-title { margin: 0; font-family: Arial, Helvetica, sans-serif; font-size: 32px; font-weight: bold; color: var(--on-primary); }

/* Warm link colour inside quote blocks (replaces default blue) */
.quote a { color: var(--link); text-decoration: none; }
.quote a:hover, .quote a:focus-visible { color: var(--accent); text-decoration: underline; }
.quote .quote-icons a { color: inherit; text-decoration: none; }

/* Match the home page quote colours on every page's quote blocks */
.quote h3 { color: var(--link); }
.quote .quote-icons .icon-link:hover, .quote .quote-icons .icon-link:focus-visible { color: var(--accent); }

/* Home icon sits just left of the GitHub icon */
.title-row .home-link + .gh-link { margin-left: 14px; }

.flyout:fullscreen { inset: 0; width: 100%; height: 100%; transform: none; border-radius: 0; box-shadow: none; }
.flyout:fullscreen video { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.flyout:-webkit-full-screen { inset: 0; width: 100%; height: 100%; transform: none; border-radius: 0; box-shadow: none; }
.flyout:-webkit-full-screen video { width: 100%; height: 100%; max-height: none; object-fit: contain; }

/* Home page: smaller text for laptop/tablet screens (100% DPI); phones unchanged */
@media (min-width: 601px) {
    .home .quote { padding: 16px 20px; }
    .home .quote h3 { font-size: 0.95rem; margin: 10px 0 4px; }
    .home .quote p { font-size: 0.8rem; margin: 4px 0 8px; }
    .home .quote h3 .mp4-icon svg { width: 20px; height: 20px; }
}

/* A-Z tabs under the Receipes heading: horizontal, scrolls sideways on narrow screens */
.az-tabs { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; border-bottom: 3px solid var(--panel); scrollbar-width: thin; }
.az-tabs button { flex: 0 0 auto; min-width: 36px; padding: 6px 10px; border: 1px solid var(--border); border-bottom: 0; border-radius: 6px 6px 0 0;
    background: var(--panel); color: var(--link); font: 700 0.95rem Arial, Helvetica, sans-serif; cursor: pointer; }
@media (hover: hover) { .az-tabs button:hover:not(:disabled):not([aria-selected="true"]) { background: var(--tab-hover); } }
.az-tabs button { -webkit-tap-highlight-color: transparent; }
.az-tabs button[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.az-tabs button:disabled { background: var(--bg); color: var(--muted); cursor: default; }
.az-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.az-tabs + .quote { margin-top: 0; }
.quote [hidden] { display: none !important; }
@media (min-width: 601px) { .home .az-tabs button { font-size: 0.85rem; padding: 5px 9px; min-width: 32px; } }

/* GitHub link after the MP4 icon on a quote title */
.quote h3 .icon-link { display: inline-flex; vertical-align: middle; margin-left: 24px; color: var(--link); opacity: .7; text-decoration: none; }
.quote h3 .icon-link:hover, .quote h3 .icon-link:focus-visible { opacity: 1; color: var(--accent); outline: none; }
@media (min-width: 601px) { .home .quote h3 .icon-link svg { width: 20px; height: 20px; } }

.art-panel[hidden] { display: none; }

/* Accordion: Receipes / Articles / Disclaimer (independent; user closes manually) */
.intro.accordion summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.intro.accordion summary::-webkit-details-marker { display: none; }
.intro.accordion summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--link); border-bottom: 2px solid var(--link); transform: rotate(45deg); margin: -4px 0 0 4px; }
.intro.accordion[open] summary::after { transform: rotate(-135deg); margin: 4px 0 0 4px; }
.intro.accordion summary h3 { margin-top: 0; }
.intro.accordion { margin-top: 16px; }
.intro.accordion summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Sound Bite article pages (soundbites/*.html): home icon and title in the header, readable body text in a quote block */
.title-row .home-link { color: var(--on-primary); display: inline-flex; align-self: center; opacity: .85; }
.title-row .home-link:hover, .title-row .home-link:focus-visible { opacity: 1; outline: none; }
.article-title { margin: 0 0 0 14px; font-size: 1.8rem; line-height: 1.25; color: var(--on-primary); }
.article-body { max-width: 820px; }
.article-body p { margin: 0 0 16px; font-size: 1.05rem; line-height: 1.7; color: var(--text-strong); }
.article-body .article-date { color: var(--muted); font-size: 0.85rem; margin-bottom: 20px; }
@media (max-width: 600px) { .article-title { font-size: 1.4rem; } .article-body p { font-size: 1rem; } }

/* Welcome text on the home page: comfortable reading size */
.home .quote.welcome p { font-size: 1.05rem; line-height: 1.7; margin: 0 0 16px; color: #1f2937; }
.home .quote.welcome p:last-child { margin-bottom: 0; }
.home .quote.welcome { max-width: 820px; padding: 24px; }
