/* Letrin eru hýst hér (ekki hjá Google) svo IP-tölur gesta fari ekki til þriðja aðila.
   Latin-hlutinn (U+0000–00FF) nær yfir alla íslenska stafi. Leyfi: fonts/OFL.txt */
@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url(/fonts/barlow-400.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 500; font-display: swap; src: url(/fonts/barlow-500.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url(/fonts/barlow-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url(/fonts/barlow-condensed-700.woff2) format('woff2'); }

:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --text: #17191c;
  --muted: #6a6f76;
  --line: #e4e1db;
  --accent: #e2591a;
  --accent-soft: #fdeee5;
  --header: #14181f;
  --header-text: #f4f2ee;
  --win: #17191c;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 2px 8px rgb(0 0 0 / .04);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317;
    --surface: #181c22;
    --surface-2: #1e232a;
    --text: #eceae6;
    --muted: #979ca4;
    --line: #2a3038;
    --accent: #ff7a33;
    --accent-soft: #3a2418;
    --header: #0a0c0f;
    --header-text: #eceae6;
    --win: #ffffff;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 Barlow, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; letter-spacing: .01em; text-transform: uppercase; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Haus */
.site-header { background: var(--header); color: var(--header-text); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 56px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 24px/1 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.sports { display: flex; gap: 4px; margin-left: auto; font-weight: 600; font-size: 15px; }
.sports a, .sports span { padding: 6px 12px; border-radius: 999px; text-decoration: none; }
.sports .active { background: var(--accent); color: #fff; }
.sports .soon { opacity: .4; cursor: default; }

/* Úrslitaborði */
.ticker { background: var(--surface); border-bottom: 1px solid var(--line); }
.ticker-track { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; scrollbar-width: thin; }
.tick { flex: 0 0 auto; min-width: 168px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: 14px; background: var(--surface-2); }
.tick:hover { border-color: var(--accent); }
.tick-league { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tick-row { display: flex; justify-content: space-between; gap: 12px; }
.tick-row b { font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-variant-numeric: tabular-nums; }
.tick-row.won { font-weight: 600; color: var(--win); }
.tick-row:not(.won) { color: var(--muted); }

/* Liðsmerki — JPEG með hvítum bakgrunni, svo þau fá hvítan reit líka í dökku útliti */
.team { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.team-logo { flex: 0 0 auto; width: 20px; height: 20px; object-fit: contain; border-radius: 4px; background: #fff; }
.tick-row { align-items: center; }
.tick .team-logo { width: 18px; height: 18px; }

/* Uppsetning */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; padding-top: 24px; padding-bottom: 40px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h1 { margin: 0; font-size: 28px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 12px; font: 500 14px Barlow, sans-serif; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Fréttir */
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.news-item a { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; }
.news-item a:hover { border-color: var(--accent); }
.news-item a:hover h3 { color: var(--accent); }
.news-item.no-image a { grid-template-columns: 1fr; }
.news-item h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.3; font-weight: 600; }
.news-item p { margin: 0 0 8px; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-item img { width: 132px; height: 88px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.meta { font-size: 13px; color: var(--muted); }
.source { font-weight: 600; color: var(--accent); }
.placeholder { color: var(--muted); padding: 24px 0; }

/* Hliðarstika */
.sidebar { display: grid; gap: 16px; align-content: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 10px; font-size: 18px; color: var(--muted); }
.league-select select { width: 100%; margin-bottom: 14px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 600 16px Barlow, sans-serif; }

.standings { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.standings th { text-align: left; font-weight: 500; font-size: 12px; text-transform: uppercase; color: var(--muted); padding: 0 4px 6px; }
.standings td { padding: 5px 4px; border-top: 1px solid var(--line); }
.standings .num { text-align: right; width: 44px; }
.standings .pos { width: 28px; color: var(--muted); }
.standings .pts { font-weight: 600; }

.games { list-style: none; margin: 0; padding: 0; }
.games li + li { border-top: 1px solid var(--line); }
.games a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; text-decoration: none; font-size: 15px; }
.games .when { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.games .score { font-family: 'Barlow Condensed', sans-serif; font-size: 17px; font-variant-numeric: tabular-nums; text-align: right; }
.games .won { font-weight: 600; }
.games .empty { color: var(--muted); padding: 6px 0; font-size: 15px; }

/* Textasíður (t.d. persónuvernd) */
.prose { max-width: 680px; padding-top: 32px; padding-bottom: 40px; }
.prose h1 { font-size: 36px; margin: 0 0 12px; }
.prose h2 { font-size: 20px; margin: 28px 0 6px; }
.prose p { margin: 0 0 12px; }
.prose .lead { font-size: 18px; color: var(--muted); }
.prose a { color: var(--accent); }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 16px 0 32px; }
.site-footer p { margin: 4px 0; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .sports .soon { display: none; }
  .news-item a { grid-template-columns: minmax(0, 1fr) 92px; gap: 12px; padding: 12px; }
  .news-item img { width: 92px; height: 68px; }
  .news-item h3 { font-size: 17px; }
  .news-item p { display: none; }
}
