/* ==========================================================================
   Football Mania — holoduke.nl
   Design: "The Results Page". Printed football results as the organising idea:
   paper ground, ink type, hairline rules, numbered sections, tabular figures,
   and the fixture row used as a real layout element rather than decoration.
   Brand lime #93ff00 is taken from the app's own logo-icon.svg.

   Served under a strict CSP: no inline <style>, no inline <script>.
   Everything lives here and in assets/site.js.
   ========================================================================== */

:root {
  --paper:     #f2f1ec;
  --paper-2:   #e8e7e0;
  --card:      #fbfaf7;
  --ink:       #101217;
  --ink-2:     #3c4250;
  --ink-3:     #737a88;
  --rule:      rgba(16,18,23,.13);
  --rule-soft: rgba(16,18,23,.07);
  --lime:      #93ff00;
  --lime-ink:  #4a7f00;

  --sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1180px;
  --gut:  clamp(20px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.035em; line-height: 1.04; }
p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 99;
             background: var(--ink); color: var(--paper); padding: .8rem 1.2rem; font-weight: 700; }
.skip-link:focus { left: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px;
      clip-path: inset(50%); overflow: hidden; white-space: nowrap; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--ink); background: var(--paper); position: sticky; top: 0; z-index: 40; }
.masthead .wrap { display: flex; align-items: center; gap: 1.5rem; height: 62px; }
.logo { display: flex; align-items: center; gap: .55rem; }
.logo img { width: 30px; height: 30px; }
.logo b { font-weight: 800; font-size: 1.02rem; letter-spacing: -.035em; }
.menu { margin-left: auto; display: flex; gap: 1.8rem; align-items: center; }
.menu a { font-size: .83rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
          color: var(--ink-2); padding-block: .3rem; border-bottom: 2px solid transparent; }
.menu a:hover { color: var(--ink); }
.menu a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--ink);
            padding: .4rem .7rem; font: inherit; font-size: .78rem; font-weight: 700;
            letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .menu { position: absolute; inset: 62px 0 auto 0; flex-direction: column; gap: 0;
          background: var(--paper); border-bottom: 1px solid var(--ink); padding: 0 var(--gut) .6rem; }
  .menu[hidden] { display: none; }
  .menu a { width: 100%; padding: .85rem 0; border-bottom: 1px solid var(--rule-soft); }
  .menu a[aria-current="page"] { border-bottom-color: var(--rule-soft); }
}

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--ink); }
.hero .wrap { padding-block: clamp(2.6rem, 6vw, 4.6rem); }
.hero-top { margin-bottom: clamp(2rem, 4vw, 3rem); display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(2rem, 5vw, 4rem); align-items: end; }
@media (max-width: 920px) { .hero-top { grid-template-columns: 1fr; align-items: start; } }
.dateline { font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
            color: var(--ink-3); display: flex; align-items: center; gap: .6rem; margin-bottom: 1.6rem;
            padding-bottom: .7rem; border-bottom: 1px solid var(--rule); }
.dateline .dot { width: 6px; height: 6px; background: var(--lime); border: 1px solid var(--lime-ink); }
h1 { font-size: clamp(2.6rem, 7.2vw, 5.2rem); }
h1 em { font-style: normal; display: block; color: var(--ink-3); }
.standfirst { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--ink-2); max-width: 46ch; margin-top: 1.4rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.8rem; }
.act { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--ink);
       padding: .62rem 1.1rem; font-size: .85rem; font-weight: 700; letter-spacing: .03em;
       text-transform: uppercase; transition: background .12s linear, color .12s linear; }
.act:hover { background: var(--ink); color: var(--paper); }
.act-fill { background: var(--ink); color: var(--paper); }
.act-fill:hover { background: var(--lime); color: var(--ink); border-color: var(--lime); }

/* ---------- fixture board (core motif) ---------- */
.board { display: block; border: 1px solid var(--ink); background: var(--card); color: inherit; }
.board:hover { border-color: var(--lime-ink); }
.board-head { display: flex; justify-content: space-between; align-items: baseline;
              padding: .55rem .85rem; background: var(--ink); color: var(--paper);
              font-family: var(--mono); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; }
.board-head .live { color: var(--lime); }
.fx { display: grid; grid-template-columns: 2.6rem 1.15rem 1fr auto; gap: .55rem; align-items: center;
      padding: .62rem .85rem; border-bottom: 1px solid var(--rule-soft); }
.fx:last-child { border-bottom: 0; }
.fx .min { font-family: var(--mono); font-size: .74rem; color: var(--lime-ink); font-weight: 700; }
.fx .min.ft { color: var(--ink-3); }
.fx .teams { font-size: .92rem; font-weight: 600; letter-spacing: -.01em; }
.fx .teams small { display: block; font-size: .68rem; font-weight: 500; letter-spacing: .09em;
                   text-transform: uppercase; color: var(--ink-3); margin-bottom: .1rem; }
.fx .score { font-family: var(--mono); font-size: .98rem; font-weight: 700; white-space: nowrap; }
.fx .flag { width: 18px; height: 13px; object-fit: cover; border: 1px solid var(--rule); background: var(--paper-2); }
.fx .flag-none { width: 18px; height: 13px; border: 1px solid var(--rule); background: var(--paper-2); }

/* ---------- numbered sections ---------- */
section { border-bottom: 1px solid var(--ink); }
section > .wrap { padding-block: clamp(2.8rem, 6vw, 4.6rem); }
.shead { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.2rem; margin-bottom: 2.4rem; }
@media (max-width: 640px) { .shead { grid-template-columns: 1fr; gap: .4rem; } }
.snum { font-family: var(--mono); font-size: .8rem; font-weight: 700; color: var(--ink-3);
        padding-top: .45rem; letter-spacing: .1em; }
.shead h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
.shead p { color: var(--ink-2); max-width: 58ch; margin-top: .8rem; margin-bottom: 0; }

/* ---------- product entries ---------- */
.entry { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 1.2rem;
         padding-block: 1.9rem; border-top: 1px solid var(--rule); align-items: start; }
.entry:last-of-type { border-bottom: 1px solid var(--rule); }
@media (max-width: 760px) { .entry { grid-template-columns: 1fr; gap: .7rem; } }
.entry-k { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em;
           text-transform: uppercase; color: var(--ink-3); padding-top: .4rem; }
.entry h3 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); margin-bottom: .5rem; }
.entry p { color: var(--ink-2); max-width: 60ch; font-size: .98rem; }
.entry .go { align-self: center; font-size: .82rem; font-weight: 700; letter-spacing: .05em;
             text-transform: uppercase; white-space: nowrap; border-bottom: 2px solid var(--lime); padding-bottom: .15rem; }
.entry:hover .go { border-bottom-color: var(--ink); }

/* ---------- tables ---------- */
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { text-align: left; padding: .72rem .9rem; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.kv thead th { border-bottom: 1px solid var(--ink); font-family: var(--mono); font-size: .68rem;
               letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.kv td:first-child { white-space: nowrap; }
.kv code { font-family: var(--mono); font-size: .85rem; }
.kv tbody tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; border: 1px solid var(--ink); background: var(--card); }

/* ---------- figures ---------- */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); margin: 0; }
@media (max-width: 680px) { .figures { grid-template-columns: repeat(2, 1fr); } }
.figures div { padding: 1.2rem 0 0; border-right: 1px solid var(--rule); }
.figures div:last-child { border-right: 0; }
@media (max-width: 680px) { .figures div:nth-child(2n) { border-right: 0; } }
.figures dd { margin: 0; font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; letter-spacing: -.045em; }
.figures dt { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
              text-transform: uppercase; color: var(--ink-3); margin-top: .25rem; }

/* ---------- inverted block ---------- */
.invert { background: var(--ink); color: var(--paper); }
.invert h2, .invert h3 { color: var(--paper); }
.invert p { color: #a8b0c0; }
.invert .snum, .invert .entry-k { color: #6f7889; }
.invert .act { border-color: var(--paper); color: var(--paper); }
.invert .act:hover { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.invert .shead p { color: #a8b0c0; }
.invert pre { background: #080a0e; border-color: #262c38; color: #d4e9b7; }
.invert .scroll-x { background: #171a21; border-color: #2a313e; }
.invert .kv th, .invert .kv td { border-bottom-color: #242a35; color: var(--paper); }
.invert .kv thead th { color: #818a9a; border-bottom-color: #3a424f; }
.invert .kv code, .invert :not(pre) > code { background: #080a0e; border-color: #2a313e; color: #d4e9b7; }
.invert .entry { border-top-color: #262c38; }
.invert .entry:last-of-type { border-bottom-color: #262c38; }

/* ---------- code ---------- */
pre { font-family: var(--mono); font-size: .84rem; line-height: 1.65;
      background: var(--card); border: 1px solid var(--ink);
      padding: 1rem 1.1rem; overflow-x: auto; margin: 0 0 1rem; }
:not(pre) > code { font-family: var(--mono); font-size: .88em;
                   background: var(--paper-2); padding: .1em .36em; border: 1px solid var(--rule); }

/* ---------- season log ---------- */
.log { margin: 0; padding: 0; list-style: none; }
.log li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.4rem;
          padding-block: 1.6rem; border-top: 1px solid var(--rule); }
.log li:last-child { border-bottom: 1px solid var(--rule); }
@media (max-width: 680px) { .log li { grid-template-columns: 1fr; gap: .4rem; } }
.log .yr { font-family: var(--mono); font-size: .82rem; font-weight: 700; letter-spacing: .08em; padding-top: .25rem; }
.log li.now .yr { color: var(--lime-ink); }
.log h3 { font-size: 1.14rem; margin-bottom: .4rem; }
.log p { color: var(--ink-2); font-size: .97rem; }

/* ---------- q&a ---------- */
.qa { border-top: 1px solid var(--ink); }
.qa details { border-bottom: 1px solid var(--rule); }
.qa summary { cursor: pointer; list-style: none; padding: 1.1rem 0; font-weight: 700;
              font-size: 1.04rem; letter-spacing: -.015em;
              display: flex; gap: 1rem; justify-content: space-between; align-items: center; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; font-family: var(--mono); font-weight: 400; font-size: 1.3rem; color: var(--ink-3); }
.qa details[open] summary::after { content: "\2013"; }
.qa details > p { color: var(--ink-2); max-width: 74ch; padding-bottom: 1.2rem; margin: 0; font-size: .98rem; }

/* ---------- prose ---------- */
.prose { max-width: 66ch; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 2.6rem 0 .9rem; }
.prose h3 { font-size: 1.15rem; margin: 2rem 0 .6rem; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.1rem; }
.prose li { margin-bottom: .55rem; }
.prose strong { color: var(--ink); }
.prose .pull { font-size: clamp(1.3rem, 2.6vw, 1.75rem); font-weight: 700; letter-spacing: -.03em;
               line-height: 1.25; color: var(--ink); margin: 2rem 0; padding-left: 1.2rem;
               border-left: 4px solid var(--lime); }

/* ---------- shots / frame ---------- */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); gap: .9rem; }
.shots img { border: 1px solid var(--ink); }
.frame { border: 1px solid var(--ink); background: var(--card); }
.frame-bar { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
             color: var(--ink-3); padding: .45rem .8rem; border-bottom: 1px solid var(--rule); }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: #9aa2b1; }
.foot .wrap { padding-block: 3rem 2rem; }
.foot-cols { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 820px) { .foot-cols { grid-template-columns: 1fr 1fr; } }
.foot h4 { font-family: var(--mono); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase;
           color: #6f7889; margin: 0 0 .9rem; font-weight: 700; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: .5rem; font-size: .93rem; }
.foot a:hover { color: var(--lime); }
.foot .logo b { color: var(--paper); }
.foot-end { margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid #262c38;
            display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .85rem; }

/* ==========================================================================
   Mobile refinements.
   The ragged wrapping of the action buttons was the main complaint: on a
   narrow screen flex-wrap left one button alone on a second row at a
   different width. Below 620px they become a single full-width stack with
   44px touch targets, and everything else is tightened to match.
   ========================================================================== */
@media (max-width: 620px) {
  body { font-size: 16px; }

  /* buttons: one per row, identical width, real touch targets */
  .actions { flex-direction: column; align-items: stretch; gap: .5rem; margin-top: 1.5rem; }
  .actions .act { width: 100%; justify-content: center; min-height: 48px; padding: .8rem 1rem; }

  /* copy buttons inside content keep their natural width but stay tappable */
  .entry .act, .invert .entry .act { min-height: 44px; display: inline-flex; align-items: center; }

  h1 { font-size: clamp(2.1rem, 10.5vw, 2.9rem); letter-spacing: -.03em; }
  .standfirst { font-size: 1.02rem; margin-top: 1.1rem; }
  .hero .wrap { padding-block: 2.2rem; }
  section > .wrap { padding-block: 2.4rem; }

  /* fixture rows: tighter gutter, smaller minute column, no clipped score */
  .fx { grid-template-columns: 2.1rem 1.05rem 1fr auto; gap: .4rem; padding: .6rem .65rem; }
  .fx .teams { font-size: .88rem; }
  .fx .teams small { font-size: .64rem; }
  .fx .score { font-size: .92rem; }
  .board-head { padding: .5rem .65rem; font-size: .66rem; }

  /* product entries: the arrow sat orphaned on its own line */
  .entry { padding-block: 1.4rem; gap: .5rem; }
  .entry .go { align-self: start; margin-top: .2rem; }
  .entry-k { padding-top: 0; }

  /* figures: equal height cells, no half-empty last row */
  .figures div { padding: 1rem .2rem 0; }
  .figures dd { font-size: 1.6rem; }
  .figures dt { font-size: .62rem; letter-spacing: .09em; }

  /* season log + headings */
  .log li { padding-block: 1.2rem; }
  .shead { margin-bottom: 1.6rem; }

  /* bigger tap area on the accordions */
  .qa summary { padding: 1.15rem 0; min-height: 48px; }

  /* code and tables must never push the page sideways */
  pre { font-size: .78rem; padding: .85rem .9rem; }
  .kv th, .kv td { padding: .65rem .7rem; font-size: .92rem; }

  .foot-cols { grid-template-columns: 1fr; gap: 1.6rem; }
  .foot-end { flex-direction: column; gap: .5rem; }
}

/* Long URLs and tokens should wrap rather than widen the page. */
code, pre code { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; word-break: break-word; }

/* Menu button and nav links: 44px minimum target on touch devices. */
@media (pointer: coarse) {
  .menu-btn { min-height: 44px; }
  .menu a { min-height: 44px; display: flex; align-items: center; }
  .act { min-height: 44px; }
}

/* ---------- language switcher ---------- */
.langs { margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid #262c38; }
.lang-list { display: flex; flex-wrap: wrap; gap: .35rem .9rem; }
.lang-list a { font-size: .86rem; color: #9aa2b1; padding: .2rem 0; }
.lang-list a:hover { color: var(--lime); }
.lang-list a[aria-current="true"] { color: var(--paper); font-weight: 700; }
@media (pointer: coarse) { .lang-list a { min-height: 36px; display: flex; align-items: center; } }

/* RTL: the fixture board and section numbering read right-to-left too. */
[dir="rtl"] .fx { direction: rtl; }
[dir="rtl"] .shead, [dir="rtl"] .entry, [dir="rtl"] .log li { direction: rtl; }
[dir="rtl"] pre, [dir="rtl"] code { direction: ltr; text-align: left; }
[dir="rtl"] .prose .pull { border-left: 0; border-right: 4px solid var(--lime); padding-left: 0; padding-right: 1.2rem; }
