/* ==========================================================================
   v7 Broadsheet — Team colour override + simple-shape widget layer
   ========================================================================== */
:root {
  --red: #1e7d3a;
  --red-dark: #135125;
  --gold: #c9a42a;
  --ink: #181613;
}

/* Subtle team-brand wash on the paper body — ~7% primary mixed into the cream */
body { background: color-mix(in oklab, #1e7d3a 6%, #f4efe4) !important; }

/* === Masthead crest (circle shape identifies "club identity") ============= */
.masthead .title-row { display: flex; align-items: center; justify-content: center; gap: 24px; }
.masthead .crest-badge {
  width: 84px; height: 84px; border-radius: 50%;
  background: #fff; padding: 6px; object-fit: contain;
  border: 2px solid var(--rule); flex-shrink: 0;
}
.masthead .crest-badge.crest-init {
  display: grid; place-items: center;
  font-family: 'Playfair Display'; font-weight: 900; font-size: 26px; color: var(--red);
}
@media (max-width: 700px) { .masthead .crest-badge { width: 56px; height: 56px; } }

/* === "Simple-shape" widget labels: every widget gets a shape chip ========== */
/* Small round dot = player/person; square = match; bar = stat; triangle = arrow/direction */
.shape-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Oswald'; font-size: 10px; letter-spacing: .25em; text-transform: uppercase;
  color: var(--red);
}
.shape-chip::before {
  content: ""; width: 10px; height: 10px; display: inline-block;
  background: var(--red);
}
.shape-chip.circle::before { border-radius: 50%; }
.shape-chip.square::before { border-radius: 0; }
.shape-chip.bar::before    { width: 18px; height: 4px; border-radius: 2px; }
.shape-chip.triangle::before { width: 0; height: 0; background: transparent; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid var(--red); }

/* === Opponent crest (tiny circle) — appears in table, fixtures, results === */
.crest-sm {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; padding: 2px; object-fit: contain;
  border: 1px solid var(--rule); flex-shrink: 0;
  vertical-align: middle;
}
.crest-md {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; padding: 3px; object-fit: contain;
  border: 1.5px solid var(--rule); flex-shrink: 0;
}
.crest-lg {
  width: 70px; height: 70px; border-radius: 50%;
  background: #fff; padding: 5px; object-fit: contain;
  border: 2px solid rgba(255,255,255,0.4);
}

/* === Calendar (fixtures page) — two months side by side ================== */
.cal-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 16px 0; }
@media (max-width: 760px) { .cal-wrap { grid-template-columns: 1fr; gap: 20px; } }
.cal-block { min-width: 0; }
.cal-month { font-family: 'Playfair Display'; font-weight: 900; font-size: 22px; text-align: center; margin-bottom: 10px; letter-spacing: -.01em; color: var(--ink); }

/* Force all calendar cells to the exact same size ------------------------- */
.cal-block .cal-strip {
  grid-auto-rows: 78px !important;  /* every row identical */
  gap: 4px !important;
}
.cal-block .cal-strip .c {
  min-height: 0 !important;
  padding: 6px 5px !important;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 2px;
}
.cal-block .cal-strip .c .num { font-size: 14px; font-weight: 700; line-height: 1; }
.cal-block .cal-strip .c .m { font-size: 9px; line-height: 1.15; letter-spacing: .05em; }
.cal-block .cal-strip .c.match::after { inset: 3px auto auto 3px !important; width: 5px !important; height: 5px !important; }
.cal-block .cal-strip .c.match { padding-left: 12px !important; }
.cal-block .cal-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-family: 'Oswald'; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-dim); text-align: center; padding: 0 0 6px; }

/* --- Mobile: swap the 7-col grid for a tidy match-days list --- */
@media (max-width: 760px) {
  .cal-block .cal-header { display: none !important; }
  .cal-block .cal-strip {
    display: flex !important; flex-direction: column !important;
    grid-auto-rows: auto !important; gap: 0 !important;
  }
  .cal-block .cal-strip .c { display: none !important; }  /* hide empty days */
  .cal-block .cal-strip .c.match {
    display: grid !important;
    grid-template-columns: 42px 1fr auto !important;
    align-items: center !important;
    width: 100% !important; padding: 14px 12px !important;
    border: 0 !important; border-bottom: 1px dotted var(--rule) !important;
    background: transparent !important;
    gap: 12px !important;
  }
  .cal-block .cal-strip .c.match::after { display: none !important; }
  .cal-block .cal-strip .c.match .num { font-family: 'Playfair Display'; font-size: 24px !important; font-weight: 900; color: var(--red); text-align: center; line-height: 1; }
  .cal-block .cal-strip .c.match .m { font-family: 'Oswald'; font-size: 13px !important; letter-spacing: .1em; color: var(--ink); text-transform: uppercase; }
  .cal-block .cal-strip .c.match .m:nth-of-type(1) { grid-column: 2; }
  .cal-block .cal-strip .c.match .m:nth-of-type(2) { grid-column: 3; color: var(--ink-dim); font-size: 12px !important; justify-self: end; }
  .cal-month { margin-bottom: 4px !important; text-align: left; padding-left: 12px; }
}

/* === Standings table: logo cell ========================================== */
.tbl-classic td.logo-cell { padding: 4px 4px; width: 30px; }
.tbl-classic td.logo-cell img { width: 22px; height: 22px; border-radius: 50%; background: #fff; padding: 2px; object-fit: contain; border: 1px solid var(--rule); display: block; }

/* === Fixture & result rows — opponent crest on the right of the row ====== */
.fix-row .opp-with-crest, .results-list .r .opp-with-crest {
  display: flex; align-items: center; gap: 10px;
}

/* === Next-engagement hex (home vs away face-off) ========================= */
.next-box .face-off {
  display: flex; align-items: center; justify-content: space-around;
  padding: 14px 0; border-top: 1px solid rgba(255,255,255,0.2); border-bottom: 1px solid rgba(255,255,255,0.2); margin-bottom: 10px;
}
.next-box .face-off .side { text-align: center; font-family: 'Oswald'; font-size: 11px; letter-spacing: .2em; color: rgba(255,255,255,0.7); text-transform: uppercase; }
.next-box .face-off .side img { width: 48px; height: 48px; border-radius: 50%; background: #fff; padding: 3px; object-fit: contain; display: block; margin: 0 auto 6px; }
.next-box .face-off .vs { font-family: 'Playfair Display'; font-style: italic; font-size: 20px; color: var(--gold); }

/* === News cards — real hero images replace the gradient tiles ============ */
.news-card .tile, .news-hero .photo, .lede .photo { background-size: cover !important; background-position: center !important; }
.news-card .tile.has-img, .news-hero .photo.has-img, .lede .photo.has-img { filter: grayscale(0.55) contrast(1.05); }

/* === Player squad card avatars =========================================== */
.player-card .num-block { min-height: 170px !important; position: relative; }
.player-card .num-block .avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: #fff; object-fit: cover; border: 2px solid var(--gold);
  margin-bottom: 10px;
}
.player-card .num-block .avatar.init {
  display: grid; place-items: center;
  font-family: 'Playfair Display'; font-weight: 900; font-size: 22px; color: var(--ink);
}

/* === Injury file mug-shot ================================================ */
.file .photo-col .mug.has-img { background: #fff !important; filter: none !important; padding: 0 !important; overflow: hidden; display: grid; place-items: center; }
.file .photo-col .mug img { width: 100%; height: 100%; object-fit: cover; }

/* === Footer social links ================================================= */
.foot { flex-direction: column; gap: 8px !important; align-items: stretch !important; padding: 20px 40px !important; }
.foot-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-row.sub { font-size: 11px; color: var(--ink-dim); letter-spacing: 0.05em; padding-top: 8px; border-top: 1px dotted var(--rule); }
.foot-social .sl { font-family: 'Oswald'; font-size: 11px; letter-spacing: .2em; color: var(--red); text-decoration: none; padding: 3px 9px; border: 1px solid var(--red); border-radius: 999px; margin-left: 4px; text-transform: uppercase; }
.foot-social .sl:hover { background: var(--red); color: var(--paper); }

/* === "Click to read" affordance on news cards ============================ */
.news-card a, .news-hero .story a { color: inherit; text-decoration: none; display: block; cursor: pointer; }
.news-card:hover h4, .news-hero .story:hover h5 { color: var(--red); text-decoration: underline; }

/* === Full standings table (on fixtures page) ============================= */
.standings-full { margin: 32px 0; }
.standings-full table { width: 100%; border-collapse: collapse; font-family: 'Cormorant Garamond'; font-size: 14px; }
.standings-full th, .standings-full td { padding: 7px 8px; border-bottom: 1px dotted var(--rule); text-align: left; }
.standings-full th { font-family: 'Oswald'; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; font-weight: 500; border-bottom: 2px solid var(--rule); }
.standings-full td.num, .standings-full th.num { text-align: right; font-weight: 700; }
.standings-full tr.self td { background: color-mix(in srgb, var(--red) 8%, transparent); font-weight: 700; }
.standings-full tr.self td:first-child::after { content: " ◆"; color: var(--red); }

/* === Section nav layout (desktop: horizontal, no burger) ================= */
.sec-bar { align-items: center; }
.sec-bar .nav-links { display: contents; }
.sec-bar .nav-links a { white-space: nowrap; color: inherit; }
.sec-bar .nav-burger { display: none; }

/* === Mobile nav: hamburger + vertical drawer ============================= */
@media (max-width: 760px) {
  .sec-bar { position: relative; padding: 10px 12px; gap: 0; flex-wrap: wrap; }
  .sec-bar .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 36px; height: 32px; padding: 6px; background: transparent; border: 0; cursor: pointer;
    order: 1;
  }
  .sec-bar .nav-burger span { display: block; height: 2px; width: 100%; background: var(--paper); transition: transform .2s, opacity .2s; border-radius: 2px; }
  .sec-bar .nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .sec-bar .nav-burger.open span:nth-child(2) { opacity: 0; }
  .sec-bar .nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .sec-bar .nav-links {
    display: none;
    flex-direction: column; align-items: stretch;
    width: 100%; order: 10;
    padding: 10px 0 6px; margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.15);
  }
  .sec-bar.open .nav-links { display: flex; }
  .sec-bar .nav-links a {
    padding: 12px 8px; font-size: 13px; letter-spacing: .25em;
    border-bottom: 1px dotted rgba(255,255,255,0.1);
  }
  .sec-bar .nav-links a:last-child { border-bottom: 0; }
  .sec-bar .nav-links a.active { background: rgba(255,255,255,0.05); border-left: 3px solid var(--gold); padding-left: 12px; }
  .sec-bar .spacer { flex: 1; order: 2; }
  .sec-bar .date { order: 3; font-size: 10px; }
  .sec-bar .lang-toggle { order: 4; margin: 0 0 0 10px; }
}

/* === Language toggle (shown only for bilingual teams) ==================== */
.lang-toggle { display: inline-flex; gap: 4px; margin-right: 12px; }
.lang-toggle button {
  font-family: 'Oswald'; font-size: 10px; letter-spacing: .15em; text-transform: uppercase;
  padding: 3px 9px; border: 1px solid var(--paper2); background: transparent; color: var(--paper2);
  cursor: pointer; border-radius: 3px;
}
.lang-toggle button.active { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.lang-toggle button:hover { color: var(--gold); }

/* === Player-card link hover =============================================== */
.player-card-link:hover .player-card { box-shadow: 0 4px 14px rgba(0,0,0,0.12); transform: translateY(-2px); transition: all .15s; }
.player-card-link:hover .player-card .nm { color: var(--red); }

/* === Long-word break — prevent broadsheet headlines from overflowing === */
h1, h2, h3, h4, h5 { overflow-wrap: break-word; word-wrap: break-word; hyphens: auto; }

/* === Pull-quote: drop the giant inline closing " that overlaps attribution = */
.pull::after { display: none !important; }
.pull { padding-right: 40px; position: relative; }
.pull::before { vertical-align: -12px !important; margin-right: 2px !important; }
.pull .att { margin-top: 12px !important; padding-top: 8px; border-top: 1px dotted var(--rule); }

/* === Return-to-play timeline marks: force full-width distribution ======== */
.file .tl-wrap, .file .tl, .file .marks { width: 100% !important; box-sizing: border-box; }
.file .marks { display: flex !important; justify-content: space-between !important; gap: 6px; flex-wrap: nowrap; }
.file .marks span { flex: 1; text-align: center; white-space: nowrap; }
.file .marks span:first-child { text-align: left; }
.file .marks span:last-child { text-align: right; }

/* === Mobile polish — fix widgets that crowd on small viewports =========== */
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  body { padding: 0 0 20px; box-shadow: none; max-width: 100%; }
  .paper-body { padding: 20px 16px; }
  img, table { max-width: 100%; }
  /* CSS grid blow-out fix: all direct children of grid/flex containers get
     min-width:0 so long content can shrink instead of forcing parent wider */
  .leader-row > *, .fix-two > *, .rows-3 > *,
  .news-hero > *, .squad-intro > *, .cas-grid > *, .vlog-hero > *,
  .protocol > *, .news-grid > *, .cards-grid > *, .archive-grid > *,
  .next-box, .detail-box { min-width: 0 !important; }
  .masthead { padding: 14px 16px 8px; }
  .masthead .kicker { font-size: 10px; letter-spacing: .15em; flex-wrap: wrap; gap: 4px; }
  .masthead .kicker span { white-space: nowrap; }
  .masthead h1 { font-size: clamp(40px, 10vw, 64px); line-height: 0.92; }
  .masthead .tagline { font-size: 13px; flex-direction: column; gap: 4px; align-items: center; text-align: center; }
  .sec-bar { padding: 8px 12px; font-size: 10px; letter-spacing: .2em; gap: 14px; }
  .sec-bar .date { display: none; }
  .lang-toggle { margin-right: 4px; }
  .page-h h2 { font-size: clamp(36px, 8vw, 56px); }

  /* Leader row — stack columns */
  .leader-row { grid-template-columns: 1fr !important; gap: 20px !important; }
  .leader-row > div { border-left: 0 !important; padding-left: 0 !important; }
  .leader-row > div + div { border-top: 2px solid var(--rule); padding-top: 16px; }
  .lede h2 { font-size: clamp(30px, 7vw, 44px); }
  .lede .body { column-count: 1 !important; }

  /* Pull quote */
  .pull { font-size: 22px; padding: 14px 16px; }

  /* Sections 3-col (table | fixtures | scorers) — stack */
  .rows-3 { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* Home editorial + casualty (2-col) — stack */
  main.paper-body > div[style*="1.5fr 1fr"] { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* Fixtures page — stack the 2-col layout */
  .fix-two { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* Mobile fixture row: 2-line stacked card, clean layout */
  .fix-row {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    grid-template-areas: "d t c" "o o o" !important;
    gap: 6px 10px !important;
    padding: 14px 12px !important;
    align-items: center !important;
  }
  .fix-row .d { grid-area: d !important; font-size: 11px; letter-spacing: .15em; }
  .fix-row .d b { font-size: 18px; display: inline !important; margin: 0 0 0 6px !important; line-height: 1 !important; color: var(--ink); }
  .fix-row .time { grid-area: t !important; justify-self: end; font-size: 15px; white-space: nowrap; }
  .fix-row .comp { grid-area: c !important; border-left: 0 !important; padding-left: 0 !important; text-align: right; font-size: 10px; }
  .fix-row .opp {
    grid-area: o !important;
    display: flex !important; align-items: center; gap: 10px;
    font-size: 18px; line-height: 1.2;
    padding-top: 6px; border-top: 1px dotted var(--rule);
  }
  .fix-row .opp > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .fix-row .opp .ha { display: block; font-size: 12px; margin-top: 2px; margin-left: 0; }
  .fix-row .venue { display: none !important; }   /* redundant with .ha subtitle */
  .fix-row.next { padding-left: 12px !important; border-left-width: 3px !important; }

  /* Mobile results row: match the fixture card pattern */
  .results-list .r {
    display: grid !important;
    grid-template-columns: 1fr auto auto !important;
    grid-template-areas: "d s l" "o o o" !important;
    gap: 6px 10px !important;
    padding: 14px 12px !important;
    align-items: center !important;
  }
  .results-list .r .d { grid-area: d; }
  .results-list .r .s { grid-area: s; text-align: right !important; font-size: 20px !important; }
  .results-list .r .L { grid-area: l; padding: 4px 10px !important; font-size: 11px !important; min-width: 28px; text-align: center; }
  .results-list .r .opp {
    grid-area: o;
    display: flex !important; align-items: center; gap: 10px;
    font-size: 18px; padding-top: 6px; border-top: 1px dotted var(--rule);
  }
  .results-list .r .opp .ha { display: inline; font-size: 13px; color: var(--ink-dim); margin-left: 6px; }

  /* Standings full table — keep all 9 cols, squeeze to fit without scroll */
  .standings-full { overflow-x: visible !important; }
  .standings-full table { font-size: 11px; min-width: 0 !important; width: 100%; table-layout: fixed; border-collapse: collapse; }
  .standings-full th, .standings-full td { padding: 6px 2px !important; letter-spacing: 0 !important; }
  /* column order: 1=Pos 2=crest 3=Club 4=P 5=W 6=D 7=L 8=GD 9=Pts */
  .standings-full th:nth-child(1), .standings-full td:nth-child(1) { width: 22px; text-align: center; }
  .standings-full th:nth-child(2), .standings-full td:nth-child(2) { width: 22px; padding: 3px 0 !important; }
  .standings-full th:nth-child(2) img, .standings-full td:nth-child(2) img { width: 18px; height: 18px; }
  .standings-full th:nth-child(3), .standings-full td:nth-child(3) { text-align: left; padding-left: 4px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; }
  .standings-full th:nth-child(4), .standings-full td:nth-child(4),
  .standings-full th:nth-child(5), .standings-full td:nth-child(5),
  .standings-full th:nth-child(6), .standings-full td:nth-child(6),
  .standings-full th:nth-child(7), .standings-full td:nth-child(7) { width: 22px; text-align: center !important; }
  .standings-full th:nth-child(8), .standings-full td:nth-child(8) { width: 28px; text-align: right !important; }
  .standings-full th:nth-child(9), .standings-full td:nth-child(9) { width: 30px; text-align: right !important; font-weight: 700; }
  .standings-full tr.self td:first-child::after { content: '' !important; }  /* drop the ◆ marker on mobile, row tint is enough */

  /* News — single column grid, compress hero */
  .news-hero { grid-template-columns: 1fr !important; gap: 20px !important; }
  .news-hero .body { column-count: 1 !important; }
  .news-hero .hero-lead h2 { font-size: clamp(28px, 7vw, 42px); }
  .news-grid { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* Squad */
  .cards-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .squad-intro { grid-template-columns: 1fr !important; gap: 20px !important; }
  .squad-intro .copy { column-count: 1 !important; }
  .player-card { grid-template-columns: 88px 1fr !important; }
  .player-card .num-block { min-height: 140px !important; padding: 10px !important; }
  .player-card .num-block .avatar { width: 60px; height: 60px; margin-bottom: 6px; }
  .player-card .num-block .n { font-size: 36px !important; }
  .player-card .info { padding: 10px 12px !important; }
  .player-card .info .nm { font-size: 17px; }

  /* Injuries */
  .cas-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
  .cas-lead .body { column-count: 1 !important; }
  .cas-lead h2 { font-size: clamp(28px, 7vw, 42px); }
  .file { grid-template-columns: 1fr !important; }
  .file .photo-col { display: grid; grid-template-columns: 90px 1fr; gap: 14px; align-items: center; padding: 14px !important; }
  .file .photo-col .mug { width: 90px; margin: 0 !important; }
  .protocol { grid-template-columns: 1fr !important; gap: 20px; }

  /* Highlights (ex-vlog) */
  .vlog-hero { grid-template-columns: 1fr !important; gap: 24px !important; }
  .featured h2 { font-size: clamp(28px, 7vw, 42px); }
  .archive-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
  .subscribe-bar { grid-template-columns: 1fr !important; gap: 14px !important; padding: 18px !important; }
  .stats-strip { grid-template-columns: repeat(2, 1fr) !important; }
  .stats-strip .s:nth-child(2) { border-right: 0 !important; }

  /* Footer */
  .foot { padding: 16px !important; font-size: 12px; }
  .foot-row { flex-direction: column; gap: 6px; align-items: flex-start !important; }
  .foot-row.sub { font-size: 10px; }
  .foot-social .sl { font-size: 10px; padding: 2px 7px; }

  /* Next-engagement face-off — keep horizontal but shrink crests */
  .next-box .face-off .side img { width: 40px; height: 40px; }
}

/* === Tablet tweaks ======================================================== */
@media (min-width: 760px) and (max-width: 1024px) {
  .news-grid { grid-template-columns: 1fr 1fr !important; }
  .cards-grid { grid-template-columns: 1fr 1fr !important; }
  .archive-grid { grid-template-columns: 1fr 1fr !important; }
}

/* === Article detail page ================================================= */
.article-page { max-width: 760px; margin: 0 auto; font-family: 'Cormorant Garamond'; }
.article-page .kicker { font-family: 'Oswald'; font-size: 11px; letter-spacing: .3em; color: var(--red); text-transform: uppercase; text-align: center; margin-bottom: 8px; }
.article-page h1 { font-family: 'Playfair Display'; font-weight: 900; font-size: clamp(32px, 4.5vw, 52px); letter-spacing: -0.015em; line-height: 1; margin-bottom: 14px; text-align: center; }
.article-page .meta { font-family: 'Oswald'; font-size: 10px; letter-spacing: .2em; color: var(--ink-dim); text-align: center; text-transform: uppercase; padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 22px; }
.article-page .hero { width: 100%; aspect-ratio: 16/9; object-fit: cover; border: 2px solid var(--rule); margin-bottom: 20px; }
.article-page .summary { font-family: 'Playfair Display'; font-style: italic; font-size: 22px; line-height: 1.3; color: var(--ink-dim); padding: 16px 0; border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
.article-page .body { font-size: 17px; line-height: 1.72; }
.article-page .body p { margin-bottom: 16px; text-align: justify; hyphens: auto; }
.article-page .body p:first-child::first-letter { font-family: 'Playfair Display'; float: left; font-size: 76px; line-height: .82; padding: 6px 10px 0 0; font-weight: 900; color: var(--red); }
.article-page .source { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-dim); font-style: italic; }
