/*
Theme Name: Live Match Update
Theme URI: https://livematchupdate.com
Author: Shujaat Ismaeel
Description: Live football and cricket scoreboard. Real match data from football-data.org and CricAPI, cached on the server and refreshed in the browser.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: livematchupdate
*/

:root{
  --chalk:#F2F5F3; --paper:#FFFFFF; --ink:#14212B; --muted:#52636E; --line:#D3DCD7;
  --pitch:#1E6B4B; --stumps:#A96D08; --live:#D62839; --max:1080px;
}
*{box-sizing:border-box}
body{margin:0;background:var(--chalk);color:var(--ink);font:400 17px/1.55 Barlow,system-ui,-apple-system,"Segoe UI",sans-serif}
a{color:inherit}
:focus-visible{outline:3px solid var(--live);outline-offset:2px}
.wrap{max-width:var(--max);margin:0 auto;padding:0 20px}
.screen-reader-text{position:absolute;left:-9999px}

/* Header */
.site-header{background:var(--ink);color:#fff}
.site-header .wrap{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 28px;min-height:64px}
.brand{display:flex;align-items:center;gap:10px;font:700 28px/1 "Barlow Condensed",sans-serif;text-decoration:none}
.brand::before{content:"";width:10px;height:10px;border-radius:50%;background:var(--live)}
.nav ul{display:flex;gap:20px;list-style:none;margin:0;padding:0}
.nav a{display:inline-block;padding:10px 0;text-decoration:none;font-weight:500}
.nav a:hover{text-decoration:underline}

/* Intro and tabs */
.intro h1{margin:36px 0 6px;font:700 clamp(36px,7vw,60px)/1 "Barlow Condensed",sans-serif}
.intro p{margin:0;max-width:60ch;color:var(--muted)}
.tabs{display:flex;gap:8px;margin:24px 0 8px}
.tabs button{min-height:44px;padding:0 22px;border:2px solid var(--ink);border-radius:4px;background:transparent;color:var(--ink);font:700 20px/1 "Barlow Condensed",sans-serif;cursor:pointer}
.tabs button[aria-selected="true"]{color:#fff;background:var(--ink)}
.tabs button[data-sport="football"][aria-selected="true"]{background:var(--pitch);border-color:var(--pitch)}
.tabs button[data-sport="cricket"][aria-selected="true"]{background:var(--stumps);border-color:var(--stumps)}

/* Groups and cards */
.panel{padding-bottom:48px}
.group{margin-top:28px}
.group h2{margin:0 0 12px;font:700 26px/1.1 "Barlow Condensed",sans-serif}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}
.match{background:var(--paper);border:1px solid var(--line);border-left:6px solid var(--pitch);border-radius:4px;padding:12px 16px 10px}
.match[data-sport="cricket"]{border-left-color:var(--stumps)}
.match__meta{display:flex;justify-content:space-between;gap:12px;margin-bottom:6px;font-size:14px;color:var(--muted)}
.match--live .match__state{color:var(--live);font-weight:600}
.match--live .match__state::before{content:"";display:inline-block;width:8px;height:8px;margin-right:6px;border-radius:50%;background:var(--live);animation:pulse 1.6s ease-in-out infinite}
.team{display:flex;align-items:center;gap:10px;padding:4px 0}
.team__crest{width:28px;height:28px;object-fit:contain;flex:none}
.team__crest--blank{border-radius:50%;background:var(--line)}
.team__name{flex:1;min-width:0;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.team__score{font:700 28px/1 "Barlow Condensed",sans-serif;font-variant-numeric:tabular-nums;text-align:right}
.match[data-sport="cricket"] .team__score{font-size:21px}
.match--finished .team__score{color:var(--muted)}
.lmu-note{padding:14px 16px;background:var(--paper);border:1px solid var(--line);border-radius:4px;color:var(--muted)}

/* Content pages and footer */
.entry{max-width:70ch;padding:32px 0 56px}
.entry h1{font:700 40px/1.1 "Barlow Condensed",sans-serif}
.site-footer{padding:24px 0 40px;border-top:1px solid var(--line);color:var(--muted);font-size:14px}
.site-footer p{margin:4px 0;max-width:80ch}

@keyframes pulse{50%{opacity:.25}}
@media (prefers-reduced-motion:reduce){.match--live .match__state::before{animation:none}}
