/* ============================================================
   Guides (/guides/{slug})

   Only the article shell and the section components live here. Anything an article shares with the
   rest of the app — the jersey, the player label, the .fdr difficulty chip, the breadcrumb — is
   drawn by the component's own rules in redesign.css, so a guide looks like the app rather than
   like a blog bolted onto it, and a change to a shared component reaches this page for free.

   Every colour is a token: the dark theme is a token swap in redesign.css, and a raw hex here would
   survive it and be unreadable on one of the two themes.
   ============================================================ */

.guide { max-width: 760px; margin: 0 auto; }

/* The 760px cap is on the header as well as on the body it heads: on the index the article shell
   does not wrap it, so without one the headline spans the full 1360px page while every entry under
   it stops at 760. */
.guide-head { max-width: 760px; margin: 0 auto 24px; padding: 8px 0 20px;
  border-bottom: 1px solid var(--border); }
.guide-head h1 { font-size: 34px; line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 12px; }
.guide-standfirst { font-size: 17px; line-height: 1.55; color: var(--text-2); margin: 0 0 14px; }
.guide-byline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-3); margin: 0; }

.article-body { display: flex; flex-direction: column; gap: 28px; }
.article-section { margin: 0; }
.article-section h2 { font-size: 22px; line-height: 1.25; margin: 0 0 12px; }
.article-section h3 { font-size: 16px; line-height: 1.35; margin: 0 0 6px; }
.article-prose { font-size: 16px; line-height: 1.65; color: var(--text); margin: 0; }
.article-prose a { color: var(--green-deep); font-weight: 600; }

/* ---- tables ----
   The wrapper is what keeps the page itself from scrolling sideways at 375px. An article is the
   most-linked surface on the site and cannot afford a horizontal scrollbar on the body, and both
   the planner and the players work shipped page-widening bugs from unconstrained table content.

   The layered backgrounds are the scroll affordance: an edge shade that sits under the content and
   a surface-coloured cover that scrolls with it (background-attachment: local), so the shade shows
   exactly while there is more table in that direction and vanishes — covered — when there is not.
   A table that fits leaves no shade at all, so the cardified phone layouts pay nothing for this. */
.article-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background:
    linear-gradient(to right, var(--surface) 40%, transparent) left / 56px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 40%, transparent) right / 56px 100% no-repeat local,
    linear-gradient(to right, var(--border-strong), transparent) left / 14px 100% no-repeat scroll,
    linear-gradient(to left, var(--border-strong), transparent) right / 14px 100% no-repeat scroll,
    var(--surface); }
.article-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.article-table caption { text-align: left; font-size: 22px; font-weight: 700; line-height: 1.25;
  color: var(--text); padding: 16px 16px 10px; }
.article-table th, .article-table td { padding: 10px 14px; text-align: left; white-space: nowrap; }
.article-table thead th { font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border); }
.article-table tbody tr + tr th, .article-table tbody tr + tr td { border-top: 1px solid var(--border-2); }
.article-table tbody th { font-weight: 600; color: var(--text); }
.article-table__player { min-width: 160px; }
.article-table__why { white-space: normal; min-width: 240px; color: var(--text-2); }
.article-table__team { white-space: nowrap; }
/* inline-block: the site-wide .kit default is display:block, which would stack the jersey on its
   own line above the club name — the two properties beside it only mean anything inline. */
.article-table__team .kit { display: inline-block; vertical-align: middle; margin-right: 6px; }
/* The difficulty chip rides in its club's own cell, after the name. */
.article-fixtures .fdr { vertical-align: middle; margin-left: 7px; }
.article-player { color: inherit; text-decoration: none; }
.article-player:hover { color: var(--green-deep); text-decoration: underline; text-underline-offset: 2px; }

/* ---- recommendations ----
   Published guides already carry these cells and labels. Stack every recommendation at all
   widths so its reason gets a full line beneath the stats, including inside the 760px guide. */
.article-players, .article-players caption, .article-players tbody { display: block; width: 100%; }
.article-players thead { position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); }
.article-players tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px; padding: 16px; border-top: 1px solid var(--border); }
.article-players th[scope="row"], .article-players td { display: block; min-width: 0;
  padding: 0; white-space: normal; overflow-wrap: anywhere; }
.article-players tbody tr + tr th, .article-players tbody tr + tr td { border-top: none; }
.article-players th[scope="row"] { grid-column: 1 / -1; font-size: 16px; }
.article-players .player-label { max-width: 100%; }
.article-players td[data-label]::before { content: attr(data-label); display: block;
  margin-bottom: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-3); }
.article-players td.article-table__why { grid-column: 1 / -1; padding-top: 4px;
  font-size: 14px; line-height: 1.6; }

/* ---- fixture run board ----
   A multi-round fixture section pivoted to one row per club, one column per round. Cells reuse the
   .fdr1–5 colour tokens from redesign.css but not the .fdr chip itself: these are text pills sized
   by their opponent code, not the 28px square a lone difficulty number sits in. */
.article-ticker__cell { white-space: nowrap; }
/* The club column holds still while the rounds scroll under it — twenty rows into a run board a
   reader no longer knows whose row they are on without it. The opaque background is what makes
   sticky work at all here; the cell is otherwise transparent and the rounds would slide through
   the club names. */
.article-ticker th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.article-ticker__match { display: inline-flex; align-items: center; justify-content: center;
  min-width: 68px; padding: 3px 9px; border-radius: 7px; font-family: var(--mono);
  font-size: 12px; font-weight: 700; background: var(--surface-2); }
.article-ticker__match + .article-ticker__match { margin-left: 4px; }
.article-ticker__blank { color: var(--text-3); }

/* ---- stat callouts ----
   Flex rather than an auto-fit grid: when only two tiles fit a row, the odd one out stretches to
   the full width instead of sitting alone at half of it looking like a rendering accident. */
.article-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.article-stat { flex: 1 1 150px; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
.article-stat__label { font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3); }
.article-stat__value { font-family: var(--mono); font-size: 22px; font-weight: 800; color: var(--text); }
.article-stat__note { font-size: 12.5px; color: var(--text-3); }

/* ---- FAQ and links ---- */
.article-faq__item + .article-faq__item { margin-top: 18px; }
.article-faq p { font-size: 15.5px; line-height: 1.6; color: var(--text-2); margin: 0; }
.article-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.article-links a { color: var(--green-deep); font-weight: 600; text-decoration: none; }
.article-links a:hover { text-decoration: underline; text-underline-offset: 2px; }
.article-links span { display: block; font-size: 13px; color: var(--text-3); }

/* ---- the index (/guides, /guides/gameweek/{n}) ----
   One column of entries rather than a card grid: every one of these is a headline and a sentence,
   and a grid would set the sentence in a column too narrow to read at 375px. */
.guide-index { list-style: none; margin: 0 auto; padding: 0; max-width: 760px;
  display: flex; flex-direction: column; }
.guide-index li { padding: 20px 0; border-top: 1px solid var(--border); }
.guide-index li:first-child { border-top: none; padding-top: 0; }
.guide-index__title { display: block; font-size: 20px; font-weight: 700; line-height: 1.3;
  color: var(--text); text-decoration: none; }
.guide-index__title:hover { color: var(--green-deep); text-decoration: underline;
  text-underline-offset: 2px; }
.guide-index__standfirst { font-size: 15px; line-height: 1.55; color: var(--text-2); margin: 6px 0 0;
  /* A long headline or an unbroken slug must wrap rather than widen the page. */
  overflow-wrap: anywhere; }
.guide-index__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-3); margin: 8px 0 0; }
/* Underlined rather than merely bold: the site's base rule is `a { color: inherit; text-decoration:
   none }`, so a link in muted meta text beside a date is otherwise indistinguishable from it. */
.guide-index__meta a { color: var(--text-3); font-weight: 600; text-decoration: underline;
  text-underline-offset: 2px; }
.guide-index__meta a:hover { color: var(--green-deep); }

.guide-index__empty { max-width: 760px; margin: 0 auto; font-size: 15px; color: var(--text-3); }

.guide-pager { max-width: 760px; margin: 24px auto 0; padding-top: 20px;
  border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap; font-size: 14px; }
.guide-pager a { color: var(--green-deep); font-weight: 600; text-decoration: none; }
.guide-pager a:hover { text-decoration: underline; text-underline-offset: 2px; }
.guide-pager__count { color: var(--text-3); }

@media (max-width: 640px) {
  .guide-head h1 { font-size: 27px; }
  .guide-standfirst { font-size: 15.5px; }
  .article-table caption { font-size: 19px; }
  .guide-index__title { font-size: 18px; }

  .article-players tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }

  /* ---- phone fixture cards ----
     A row becomes a card and each labelled cell a line. The run board stays out of this:
     a pivot has nothing to restack into. */
  .article-fixtures, .article-fixtures tbody, .article-fixtures tr,
  .article-fixtures th[scope="row"], .article-fixtures td { display: block; width: 100%; }
  .article-fixtures caption { display: block; width: 100%; }
  .article-fixtures thead { position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); }
  .article-fixtures tr { padding: 11px 16px 13px; }
  .article-fixtures tbody tr { border-top: 1px solid var(--border); }
  .article-fixtures tbody tr + tr th, .article-fixtures tbody tr + tr td { border-top: none; }
  .article-fixtures td[data-label]::before {
    content: attr(data-label); font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: var(--text-3); text-align: left; }

  /* ---- the fixture card: a kick-off line, then one line per club with its own chip — the
     flat table's away column truncated mid-name at 375px and the difficulty never made the
     screen at all. Each side keeps its chip because the chip lives in the club's cell rather
     than in a trailing column. */
  .article-fixtures__kickoff { min-width: 0; padding: 0 0 5px; font-size: 12px; font-weight: 600;
    color: var(--text-3); }
  .article-fixtures td.article-table__team { display: flex; align-items: center; gap: 8px;
    padding: 4px 0; }
  .article-fixtures td.article-table__team::before { flex: none; width: 42px; }
  .article-fixtures td.article-table__team .kit { margin-right: 0; }
  .article-fixtures td.article-table__team .fdr { margin-left: auto; }

  /* ---- phone run board: tighter pills, so two full rounds and the edge of a third fit ----
     The board keeps its sideways scroll — a pivot has nothing to restack into — but the sticky
     club column above and the partially visible third round are what say so. */
  .article-ticker th[scope="row"] { max-width: 138px; overflow: hidden; text-overflow: ellipsis; }
  .article-ticker__match { min-width: 56px; padding: 3px 7px; font-size: 11.5px; }
}
