/* IPTVInstallator.se — implements references/design.md
   White / near-black / red #e62415 (never green) · Funnel Display + Kanit · zero JS, zero animation */

/* ---------- Self-hosted fonts ---------- */
/* Replaces the render-blocking fonts.googleapis.com stylesheet.
   Funnel Display (headings) + Kanit (body). latin + latin-ext only. */

@font-face {
  font-family: 'Funnel Display';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/funnel-display-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Funnel Display';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/funnel-display-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Funnel Display';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/funnel-display-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Funnel Display';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/funnel-display-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/kanit-300-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/kanit-300-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/kanit-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/kanit-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/kanit-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/kanit-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --surface: #f8f8f8;
  --text: #030303;
  --muted: #6b6b6b;          /* 5.33:1 on white — WCAG AA for normal text */
  --muted-on-dark: #b8b8b8;  /* 9.8:1 on --footer-bg */
  --accent: #e62415;
  --border: #eeeeee;
  --footer-bg: #0d0d0d;
  --ff-heading: "Funnel Display", sans-serif;
  --ff-body: "Kanit", sans-serif;
  --maxw: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  font-family: var(--ff-body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4 {
  font-family: var(--ff-heading);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(42px, 7vw, 96px); }
h2 { font-size: clamp(32px, 4vw, 56px); margin-bottom: 24px; }
h3 { font-size: clamp(22px, 2.5vw, 28px); }

p { max-width: 68ch; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--text);
  padding: 12px 20px; z-index: 100; font-weight: 400;
}
.skip-link:focus { left: 0; }

/* ---------- Pre-header ---------- */
.pre-header {
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}
.pre-header .container {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 40px; gap: 16px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px;
}
.pre-header a { color: var(--text); }

/* ---------- Header / nav ---------- */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 76px; gap: 24px; flex-wrap: wrap;
}
.logo {
  font-family: var(--ff-heading); font-weight: 600; font-size: 24px;
  text-decoration: none; letter-spacing: -0.02em;
}
.logo span { background: var(--accent); padding: 0 6px; }

.nav-toggle { position: absolute; opacity: 0; }
.nav-burger {
  display: none; cursor: pointer; padding: 12px;
  min-width: 48px; min-height: 48px; text-align: center;
  font-size: 24px; line-height: 1; border: 1px solid var(--border);
}
.site-nav ul { display: flex; gap: 28px; list-style: none; align-items: center; }
.site-nav a { text-decoration: none; font-weight: 400; padding: 12px 0; display: inline-block; }
.site-nav a:hover { box-shadow: inset 0 -3px 0 var(--accent); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); }

.btn {
  display: inline-block; background: var(--accent); color: var(--text);
  font-family: var(--ff-body); font-weight: 400; font-size: 16px;
  padding: 13px 28px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--accent); min-height: 48px;
}
.btn:hover { background: var(--text); color: #fff; border-color: var(--text); }
.btn-outline { background: transparent; border: 1px solid var(--text); }
.btn-outline:hover { background: var(--text); color: #fff; }

@media (max-width: 860px) {
  .nav-burger { display: block; }
  .site-nav { display: none; width: 100%; }
  .nav-toggle:checked ~ .site-nav { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: 0; padding-bottom: 16px; }
  .site-nav li { width: 100%; border-top: 1px solid var(--border); }
  .site-nav a { padding: 14px 0; width: 100%; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(60px, 10vw, 130px) 0 clamp(40px, 6vw, 80px); }
.hero h1 { max-width: 14ch; margin-bottom: 28px; }
.hero .lead { font-size: clamp(18px, 2vw, 22px); margin-bottom: 36px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 56px; }

.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px; border-top: 1px solid var(--border); padding-top: 40px;
}
.stat .stat-num {
  font-family: var(--ff-heading); font-weight: 600;
  font-size: clamp(40px, 5vw, 72px); line-height: 1; display: block;
}
.stat .stat-label { color: var(--muted); font-size: 15px; }

/* ---------- Sections ---------- */
.section { padding: clamp(60px, 9vw, 120px) 0; }
.band { background: var(--surface); }
.section-intro { font-size: clamp(19px, 2.2vw, 26px); max-width: 46ch; margin-bottom: 48px; }
.kicker {
  display: inline-block; font-size: 14px; font-weight: 400;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 14px; margin-bottom: 20px; color: var(--muted);
  background: var(--bg);
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 32px;
}
.card h3 { margin-bottom: 12px; }
.card .card-img { border-radius: 8px; margin-bottom: 20px; width: 100%; height: auto; }
.card p { font-size: 16px; color: var(--text); margin-bottom: 16px; }
.card .chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13px; border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 12px; color: var(--muted); white-space: nowrap;
}

/* ---------- List rows (guide index) ---------- */
.row-list { list-style: none; border-top: 1px solid var(--border); }
.row-list li { border-bottom: 1px solid var(--border); }
.row-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding: 28px 0; text-decoration: none; flex-wrap: wrap;
}
.row-list a:hover h3 { box-shadow: inset 0 -4px 0 var(--accent); }
.row-list .row-meta { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* ---------- Quote / statement ---------- */
.statement {
  font-family: var(--ff-heading); font-weight: 500;
  font-size: clamp(24px, 3vw, 40px); line-height: 1.25;
  max-width: 30ch; margin: 0;
}
.statement em { font-style: normal; background: var(--accent); padding: 0 6px; }

/* ---------- Article pages ---------- */
.article-header { padding: clamp(48px, 7vw, 90px) 0 32px; }
.article-header h1 { font-size: clamp(34px, 4.5vw, 64px); max-width: 20ch; margin-bottom: 20px; }
.article-meta { color: var(--muted); font-size: 15px; display: flex; gap: 16px; flex-wrap: wrap; }
.article-meta strong { font-weight: 400; color: var(--text); }

.breadcrumbs { font-size: 14px; color: var(--muted); padding: 20px 0 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--border); }
.breadcrumbs a { color: var(--muted); }

.article-body { padding-bottom: clamp(60px, 8vw, 100px); }
.article-body > * + * { margin-top: 22px; }
.article-body h2 { margin-top: 64px; font-size: clamp(26px, 3vw, 40px); }
.article-body h3 { margin-top: 36px; }
.article-body ul, .article-body ol { padding-left: 24px; max-width: 66ch; }
.article-body li + li { margin-top: 8px; }
.article-body img { border-radius: 8px; }
.article-body table { border-collapse: collapse; width: 100%; font-size: 16px; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.article-body th { background: var(--surface); font-weight: 400; }
.table-wrap { overflow-x: auto; }

.tldr {
  background: var(--surface); border-left: 4px solid var(--accent);
  padding: 24px 28px; border-radius: 0 8px 8px 0;
}
.tldr h2 { margin-top: 0; font-size: 20px; margin-bottom: 8px; }

.toc { border: 1px solid var(--border); border-radius: 8px; padding: 24px 28px; }
.toc h2 { font-size: 20px; margin: 0 0 12px; }
.toc ol { list-style: decimal; padding-left: 20px; font-size: 16px; }
.toc a { text-decoration: none; }
.toc a:hover { box-shadow: inset 0 -2px 0 var(--accent); }

.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer; padding: 20px 0; font-family: var(--ff-heading);
  font-weight: 500; font-size: 19px; list-style: none; position: relative; padding-right: 40px;
}
.faq summary::after { content: "+"; position: absolute; right: 8px; font-size: 24px; color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 0 20px; }

.author-box {
  display: flex; gap: 20px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 8px; padding: 28px; margin-top: 64px;
}
.author-box .author-mark {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 999px;
  background: var(--accent); color: var(--text);
  font-family: var(--ff-heading); font-weight: 600; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.author-box p { font-size: 15px; }
.author-box .author-name { font-weight: 400; font-size: 17px; }

.verified-note { font-size: 14px; color: var(--muted); }

.back-to-top {
  display: inline-block; margin-top: 48px; font-size: 15px;
  text-decoration: none; border: 1px solid var(--text);
  border-radius: 999px; padding: 10px 22px;
}
.back-to-top:hover { background: var(--text); color: #fff; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--surface); }
.cta-band .container { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: #fff; padding: clamp(56px, 8vw, 96px) 0 40px; }
.site-footer a { color: #fff; }
.site-footer a:hover { text-decoration-color: var(--accent); }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; margin-bottom: 56px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }
.footer-brand { font-family: var(--ff-heading); font-weight: 600; font-size: clamp(26px, 3vw, 40px); }
.footer-brand span { background: var(--accent); color: var(--text); padding: 0 6px; }
.site-footer h3 { font-size: 15px; color: var(--muted-on-dark); margin-bottom: 14px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 10px; }
.site-footer p { font-size: 15px; color: #cfcfcf; }
.footer-legal {
  border-top: 1px solid #333; padding-top: 24px;
  font-size: 13px; color: var(--muted-on-dark);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ---------- Related guides ---------- */
.related {
  border-top: 1px solid var(--border); margin-top: 64px; padding-top: 32px;
}
.related h2 { font-size: 20px; margin: 0 0 20px; }
.related ul { list-style: none; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.related li { border: 1px solid var(--border); border-radius: 8px; }
.related a { display: block; padding: 18px 20px; text-decoration: none; font-size: 16px; min-height: 48px; }
.related a:hover { box-shadow: inset 0 -3px 0 var(--accent); }
.related .related-kind { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
