/* TBFF v2 — minimal global CSS. Everything else is Tailwind utilities emitted by js/ui.js.
 * This file only holds what utilities cannot express cleanly:
 *   1. the match-row grid that switches layout by its CONTAINER width (one component, two layouts)
 *   2. focus ring, select / date-input chrome, scrollbar hiding, line clamps
 *   3. UI.disclosure (<details class="ui-disclosure">) marker + chevron
 *   4. .prose-tbff — typography for sanitised article bodies (UI.sanitizeHtml output has no classes) */

html { -webkit-text-size-adjust: 100%; }
body { font-feature-settings: "tnum" 0; text-rendering: optimizeLegibility; }
.tnum, .font-num { font-variant-numeric: tabular-nums; }

/* Focus: one visible ring everywhere (keyboard only) */
:focus { outline: none; }
:focus-visible { outline: 2px solid #842b2c; outline-offset: 2px; border-radius: 6px; }
/* tabs sit on the bar's bottom border inside a .scroll-x row: an inset ring is never clipped */
[role="tab"]:focus-visible { outline-offset: -2px; }

/* Native select with our chevron (white on the solid accent chip: .ui-select--on) */
.ui-select--on { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important; }
.ui-select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234f4845' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

/* Native date input drawn like a UI.select control (calendar glyph tinted, no inner padding) */
.ui-date { color-scheme: light; }
.ui-date::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.ui-date::-webkit-datetime-edit { padding: 0; }

/* UI.disclosure: native <details> without the default marker; the [data-chev] chevron turns when open */
.ui-disclosure > summary { list-style: none; cursor: pointer; }
.ui-disclosure > summary::-webkit-details-marker { display: none; }
.ui-disclosure > summary [data-chev] { transition: transform .15s ease; }
.ui-disclosure[open] > summary [data-chev] { transform: rotate(180deg); }

.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* .scroll-x: one horizontally scrolling line (chips, tab bars, date strips). No scrollbar; while content is hidden on
 * the right the last 24px fade out (ui.js sets [data-more]). The 4px block padding keeps focus rings from being cut.
 * .until-sm: scrolls only below 640px (UI.chips wraps from sm). */
.scroll-x { position: relative; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-block: 4px; margin-block: -4px; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x[data-more] {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}
@media (min-width: 640px) {
  .scroll-x.until-sm { overflow: visible; padding-block: 0; margin-block: 0; }
  .scroll-x.until-sm[data-more] { -webkit-mask-image: none; mask-image: none; }
}

/* UI.filterPanel: on phones the `more` rows fold behind the „ფილტრები“ button */
@media (max-width: 639px) {
  [data-filter-panel]:not([data-open]) .fp-more { display: none; }
}
[data-filter-panel][data-open] .fp-chev { transform: rotate(180deg); }
.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }

/* ---------- UI.matchList row ---------------------------------------------------------
 * DOM order (identical in both layouts):
 *   .mr-st  .mr-h(mark,name)  .mr-hs  .mr-sep  .mr-as  .mr-a(mark,name)  [.mr-ko]  .mr-meta  .mr-x  [.mr-n]
 * Narrow (default / .ml--compact): time | home / away (stacked) | 2 / 1 | ☆
 * Wide  (container >= 660px): status | home → | 2 – 1  or kickoff | ← away | [venue ≥ 860px: the 900px content column of a
 *       team / championship / academy page (898px inside its border) and the full-width matches page] | ☆
 * Below 860px (and in .ml--compact) the venue is written on the second line instead (.mr-nv), so it is never lost.
 * The wide row needs ~660px so Georgian names are not cut; below that the two-line row fits them better. */
.ml { container-type: inline-size; }
.mr {
  display: grid; align-items: center; align-content: center; column-gap: 12px; row-gap: 4px;
  padding: 10px 8px 10px 12px; min-height: 64px;
  grid-template-columns: 52px minmax(0, 1fr) 24px 44px;
  grid-template-areas: "st h hs x" "st a as x";
}
.mr.has-n { grid-template-areas: "st h hs x" "st a as x" "st n n x"; }
.mr-st { grid-area: st; } .mr-h { grid-area: h; } .mr-a { grid-area: a; }
.mr-hs { grid-area: hs; text-align: right; } .mr-as { grid-area: as; text-align: right; }
.mr-sep, .mr-meta, .mr-ko { display: none; }
.mr-x { grid-area: x; justify-self: stretch; align-self: stretch; display: flex; align-items: center; justify-content: flex-end; }
/* solid row: the status column and the star column are set off by hairline dividers (scoreboard look) */
.mr-st { align-self: stretch; border-right: 1px solid #e5e0dc; padding-right: 8px; font-family: "Barlow Condensed", "Noto Sans Georgian", system-ui, sans-serif; font-size: 16px; line-height: 18px; }
.mr-st > span:first-child:not(:last-child) { font-family: "Noto Sans Georgian", system-ui, sans-serif; }
.mr-x:not(:empty) { border-left: 1px solid #e5e0dc; }
.mr-n { grid-area: n; }
.mr:not(.has-n) .mr-n { display: none; }
.mr-h, .mr-a { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* .ml--nox: no star / W-D-L column (UI.matchList follow:false without perspectiveTeam) → the names get that width */
.ml--nox .mr { grid-template-columns: 52px minmax(0, 1fr) 24px; grid-template-areas: "st h hs" "st a as"; padding-right: 16px; }
.ml--nox .mr.has-n { grid-template-areas: "st h hs" "st a as" "st n n"; }
.ml--nox .mr-x { display: none; }
/* two-line row: a long name (e.g. 'ნორჩი დინამო 2016 · 2013') wraps once instead of being cut */
.mr-h > a, .mr-a > a { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; line-height: 20px; }

@container (min-width: 660px) {
  .ml:not(.ml--compact) .mr {
    min-height: 60px; padding: 8px 8px 8px 12px; row-gap: 2px;
    grid-template-columns: 56px minmax(0, 1fr) 28px 12px 28px minmax(0, 1fr) 52px;
    grid-template-areas: "st h hs sep as a x";
  }
  .ml:not(.ml--compact) .mr.has-n { grid-template-areas: "st h hs sep as a x" "st n n n n n x"; }
  .ml:not(.ml--compact) .mr-h { flex-direction: row-reverse; justify-content: flex-start; text-align: right; }
  .ml:not(.ml--compact) .mr-h > a, .ml:not(.ml--compact) .mr-a > a { white-space: nowrap; display: block; line-height: 20px; }
  .ml:not(.ml--compact) .mr-hs { text-align: right; }
  .ml:not(.ml--compact) .mr-as { text-align: left; }
  .ml:not(.ml--compact) .mr-sep { display: block; grid-area: sep; text-align: center; }
  .ml:not(.ml--compact) .mr-n { text-align: center; }
  /* scheduled with a kickoff: the time sits in the score slot (FotMob style), not in the status column */
  .ml:not(.ml--compact) .mr.is-ko .mr-hs, .ml:not(.ml--compact) .mr.is-ko .mr-sep, .ml:not(.ml--compact) .mr.is-ko .mr-as, .ml:not(.ml--compact) .mr-stk { display: none; }
  .ml:not(.ml--compact) .mr-ko { display: block; grid-row: 1; grid-column: hs-start / as-end; text-align: center; white-space: nowrap; }
}
@container (min-width: 860px) {
  .ml:not(.ml--compact) .mr {
    grid-template-columns: 56px minmax(0, 1fr) 28px 12px 28px minmax(0, 1fr) 150px 52px;
    grid-template-areas: "st h hs sep as a meta x";
  }
  .ml:not(.ml--compact) .mr.has-n { grid-template-areas: "st h hs sep as a meta x" "st n n n n n meta x"; }
  .ml:not(.ml--compact) .mr-meta { display: block; grid-area: meta; }
}
/* venue copy on the second line: hidden where the meta column shows the venue (keep these container queries identical) */
@container (min-width: 860px) {
  .ml:not(.ml--compact) .mr-nv { display: none; }
  .ml:not(.ml--compact) .mr.has-nv:not(.has-note) .mr-n { display: none; }
}
/* .ml--nometa (UI.matchList opts.cls): every row has the same venue (venue page) → no meta column, keep the 660px row */
@container (min-width: 860px) {
  .ml.ml--nometa:not(.ml--compact) .mr { grid-template-columns: 56px minmax(0, 1fr) 28px 12px 28px minmax(0, 1fr) 52px; grid-template-areas: "st h hs sep as a x"; }
  .ml.ml--nometa:not(.ml--compact) .mr.has-n { grid-template-areas: "st h hs sep as a x" "st n n n n n x"; }
  .ml.ml--nometa:not(.ml--compact) .mr-meta { display: none; }
}
/* Follow star: always visible (quiet ink-4 outline; a followed team's star is filled accent). */
/* Wide rows move the kickoff time into the score slot: a status cell left with nothing visible drops its divider. */
@container (min-width: 660px) {
  .ml:not(.ml--compact) .mr-st:not(:has(> span:not(.mr-stk):not(.sr-only))) { border-right-color: transparent; }
}
.mr:hover { background: #f7f5f3; }
/* Whole row → match page: .mr-link is stretched over the row UNDER its content (absolutely positioned, so it takes no
 * grid cell). Every other link / button of the row is lifted above it and keeps its own click + focus. */
.mr { position: relative; }
.mr-link { position: absolute; inset: 0; z-index: 0; }
.mr-link:focus-visible { outline-offset: -2px; border-radius: 0; }
.mr a:not(.mr-link), .mr button { position: relative; z-index: 1; }

/* Search input: no native clear button (Esc / the close button do that) */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

/* Horizontal scrollers clip their content only for descendants whose containing block is inside them.
 * Without this, absolutely positioned children (e.g. .sr-only labels in the date strip / chip rows) escape and
 * widen the page on phones. */
.overflow-x-auto, .overflow-auto { position: relative; }

/* ---------- .prose-tbff: article body (UI.sanitizeHtml output) ------------------------------------------------
 * Readable measure, spacing, lists, links, images and the scraped tables. Colours = tw-config tokens. */
.prose-tbff { font-size: 16px; line-height: 28px; color: #1d1a19; overflow-wrap: break-word; }
.prose-tbff > * + * { margin-top: 14px; }
.prose-tbff h2, .prose-tbff h3, .prose-tbff h4 { font-weight: 700; color: #1d1a19; text-wrap: balance; }
.prose-tbff h2 { font-size: 20px; line-height: 28px; margin-top: 32px; }
.prose-tbff h3 { font-size: 18px; line-height: 26px; margin-top: 28px; }
.prose-tbff h4 { font-size: 16px; line-height: 24px; margin-top: 24px; }
.prose-tbff > :first-child { margin-top: 0; }
.prose-tbff strong { font-weight: 700; }
.prose-tbff a { color: #842b2c; font-weight: 600; text-decoration: underline; text-decoration-color: #e3c9c9; text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose-tbff a:hover { color: #6e2324; text-decoration-color: currentColor; }
.prose-tbff ul, .prose-tbff ol { padding-left: 22px; }
.prose-tbff ul { list-style: disc; }
.prose-tbff ol { list-style: decimal; }
.prose-tbff li + li { margin-top: 6px; }
.prose-tbff li::marker { color: #6b6360; }
/* quote: a filled band with a solid ink-3 bar (no accent: the accent is for links / the active state) */
.prose-tbff blockquote { border-left: 3px solid #6b6360; border-radius: 0 10px 10px 0; background: #f3eeeb; padding: 12px 16px; color: #4f4845; font-weight: 500; }
.prose-tbff img { display: block; max-width: 100%; height: auto; margin: 8px auto; border: 1px solid #e5e0dc; border-radius: 10px; background: #ece7e3; }
/* scraped tables: a white card with a bold banded header row (th cells, or the first row when the source has no th) */
.prose-tbff .prose-table { overflow-x: auto; border: 1px solid #e5e0dc; border-radius: 14px; background: #fff; margin-top: 18px; margin-bottom: 18px; }
.prose-tbff table { border-collapse: collapse; min-width: 100%; font-size: 13px; line-height: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.prose-tbff td, .prose-tbff th { padding: 9px 12px; border-bottom: 1px solid #efebe8; vertical-align: top; text-align: left; }
.prose-tbff th { background: #f3eeeb; font-weight: 700; color: #1d1a19; }
.prose-tbff thead th, .prose-tbff thead td { border-bottom: 1px solid #e5e0dc; }
.prose-tbff thead td { background: #f3eeeb; font-weight: 700; }
/* scraped tables usually carry their header as a plain first row of <td> (often bold): band it the same way */
.prose-tbff table:not(:has(th, thead)) > tbody > tr:first-child > td { background: #f3eeeb; font-weight: 700; border-bottom-color: #e5e0dc; }
.prose-tbff tbody tr:hover > td { background: #f7f5f3; }
.prose-tbff tr:last-child > td, .prose-tbff tr:last-child > th { border-bottom: 0; }
.prose-tbff td + td, .prose-tbff th + th, .prose-tbff td + th, .prose-tbff th + td { border-left: 1px solid #efebe8; }
.prose-tbff td.is-num { white-space: nowrap; text-align: center; font-weight: 600; }
.prose-tbff td.is-short, .prose-tbff th.is-short { white-space: nowrap; }
.prose-tbff [data-yt] { margin-top: 18px; margin-bottom: 18px; }
/* the YouTube card's own text keeps UI styles inside the prose block */
.prose-tbff [data-yt] p { margin-top: 0; }
.prose-tbff [data-yt] a { text-decoration: none; overflow-wrap: normal; }
.prose-tbff .phone-mask { display: inline-flex; align-items: center; border-radius: 999px; background: #ece7e3; padding: 0 8px; font-size: 12px; line-height: 22px; font-weight: 600; color: #4f4845; white-space: nowrap; }
