/* ===========================================================
   Ontario Casino Index — civic theme
   Canada red (#dc2626) + white, serif/sans pairing.
   Distinct from generic affiliate templates: civic banner,
   trefoil-style accents, slab section rules, no gradients.
   =========================================================== */

:root {
  --red: #dc2626;
  --red-dark: #b01c1c;
  --red-ink: #7f1414;
  --ink: #14181f;
  --slate: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --paper: #ffffff;
  --paper-2: #f8fafc;
  --paper-3: #f1f3f6;
  --green: #15803d;
  --green-bg: #dcfce7;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --maxw: 1120px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.06);
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper-2);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.18; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); letter-spacing: -.5px; margin: 0 0 .4em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 1.6em 0 .5em; letter-spacing: -.3px; }
h3 { font-size: 1.28rem; margin: 1.4em 0 .4em; }
h4 { font-size: 1.06rem; margin: 1.2em 0 .3em; }
p { margin: 0 0 1.05em; }
a { color: var(--red-dark); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--red-ink); }
strong { font-weight: 700; }
small { font-size: .82rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; }

/* ---------- Top civic bar ---------- */
.civicbar {
  background: var(--ink);
  color: #e6eaf0;
  font-size: .8rem;
  letter-spacing: .02em;
}
.civicbar .wrap { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding-top: 7px; padding-bottom: 7px; }
.civicbar a { color: #fca5a5; text-decoration: none; }
.civicbar a:hover { color: #fff; text-decoration: underline; }
.civicbar .dot { opacity: .4; }

/* ---------- Header ---------- */
header.site {
  background: var(--paper);
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}
header.site .wrap { display: flex; align-items: center; gap: 18px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-family: var(--font-head); }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand b { font-size: 1.18rem; font-weight: 700; letter-spacing: -.4px; display: block; line-height: 1.05; }
.brand span { font-size: .72rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-family: var(--font-body); }
nav.main { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
nav.main a {
  color: var(--slate);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 7px;
}
nav.main a:hover { background: var(--paper-3); color: var(--ink); }
nav.main a.cta { background: var(--red); color: #fff; }
nav.main a.cta:hover { background: var(--red-dark); }
.navtoggle { display: none; margin-left: auto; background: var(--paper-3); border: 1px solid var(--line); border-radius: 7px; padding: 8px 11px; font-size: 1.1rem; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 14% 0%, rgba(220,38,38,.07), transparent 42%),
    var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 46px 0 40px;
}
.hero .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--danger-bg); color: var(--red-ink);
  font-size: .76rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 16px;
}
.hero p.lead { font-size: 1.18rem; color: var(--slate); max-width: 660px; }
.hero .herobtns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red); color: #fff; text-decoration: none;
  font-weight: 700; font-size: .98rem; padding: 12px 22px; border-radius: 8px;
  border: 1px solid var(--red-dark); cursor: pointer;
}
.btn:hover { background: var(--red-dark); color: #fff; }
.btn.ghost { background: #fff; color: var(--red-dark); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--paper-3); }
.btn.sm { padding: 8px 15px; font-size: .86rem; }

/* ---------- Section helpers ---------- */
section { padding: 8px 0; }
.section-pad { padding: 34px 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; font-weight: 700; color: var(--red-dark); margin: 0 0 6px; font-family: var(--font-body); }
.lead { font-size: 1.1rem; color: var(--slate); }
.center { text-align: center; }

/* ---------- Cards & grid ---------- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }

/* ---------- Operator ranking cards ---------- */
.oplist { display: grid; gap: 16px; counter-reset: rank; }
.opcard {
  background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--red);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 64px 1fr auto; gap: 18px; padding: 18px 20px; align-items: center;
}
.opcard .rankno {
  font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; color: var(--red);
  width: 54px; height: 54px; display: grid; place-items: center;
  background: var(--danger-bg); border-radius: 12px;
}
.opcard .opbody h3 { margin: 0 0 4px; font-size: 1.25rem; }
.opcard .opbody h3 a { text-decoration: none; color: var(--ink); }
.opcard .opbody h3 a:hover { color: var(--red-dark); }
.opcard .opmeta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .86rem; color: var(--slate); margin-top: 6px; }
.opcard .opmeta b { color: var(--ink); }
.opcard .opright { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.rating { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; color: var(--ink); line-height: 1; }
.rating small { display: block; font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-body); }
.stars { color: #e0a800; letter-spacing: 1px; font-size: .95rem; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; }
.badge.legal { background: var(--green-bg); color: var(--green); }
.badge.gov { background: #dbeafe; color: #1d4ed8; }
.badge.grey { background: var(--danger-bg); color: var(--danger); }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.neutral { background: var(--paper-3); color: var(--slate); }

/* ---------- Tables ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--paper); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 640px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { background: var(--ink); color: #fff; font-weight: 600; font-size: .82rem; letter-spacing: .03em; text-transform: uppercase; position: sticky; top: 0; }
table.data tbody tr:nth-child(even) { background: var(--paper-2); }
table.data tbody tr:hover { background: #fff7f7; }
table.data td b { color: var(--ink); }
.sortable th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable th[data-sort]:hover { background: var(--red-dark); }
.sortable th[data-sort]::after { content: " \2195"; opacity: .45; font-size: .8em; }
.sortable th.asc::after { content: " \2191"; opacity: 1; }
.sortable th.desc::after { content: " \2193"; opacity: 1; }

/* ---------- Tool ---------- */
.tool { background: var(--paper); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.tool .toolhead { background: var(--ink); color: #fff; padding: 16px 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tool .toolhead h3 { color: #fff; margin: 0; font-size: 1.15rem; }
.tabs { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.tab { background: rgba(255,255,255,.1); color: #e6eaf0; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; padding: 7px 14px; font-size: .85rem; font-weight: 600; cursor: pointer; font-family: var(--font-body); }
.tab:hover { background: rgba(255,255,255,.2); }
.tab.active { background: var(--red); color: #fff; border-color: var(--red); }
.toolpanel { padding: 22px; }
.toolpanel[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .9rem; }
.searchrow { display: flex; gap: 10px; flex-wrap: wrap; }
.searchrow input[type=text] { flex: 1; min-width: 220px; }
input[type=text], select {
  font-family: var(--font-body); font-size: 1rem; padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
input[type=text]:focus, select:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.filters .field { margin-bottom: 0; min-width: 170px; }
.hint { font-size: .82rem; color: var(--muted); }
datalist { color: var(--ink); }

/* license-checker result */
.result { margin-top: 18px; border-radius: 12px; padding: 18px 20px; border: 1px solid var(--line); }
.result.ok { background: var(--green-bg); border-color: #86efac; }
.result.gov { background: #dbeafe; border-color: #93c5fd; }
.result.bad { background: var(--danger-bg); border-color: #fca5a5; }
.result h4 { margin: 0 0 8px; font-size: 1.15rem; display: flex; align-items: center; gap: 9px; }
.result dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 8px 0 0; font-size: .9rem; }
.result dt { font-weight: 700; color: var(--ink); }
.result dd { margin: 0; color: var(--slate); }
.result .verdict-icon { font-size: 1.4rem; }

/* ---------- Pros / cons ---------- */
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.proscons ul { list-style: none; margin: 0; padding: 0; }
.proscons li { padding: 6px 0 6px 26px; position: relative; font-size: .95rem; border-bottom: 1px dashed var(--line); }
.proscons li:last-child { border-bottom: 0; }
.pros li::before { content: "\2713"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.cons li::before { content: "\2715"; position: absolute; left: 0; color: var(--danger); font-weight: 700; }
.proscons .card.pros { border-top: 4px solid var(--green); }
.proscons .card.cons { border-top: 4px solid var(--danger); }
.proscons h3 { margin-top: 0; }

/* ---------- Callouts ---------- */
.callout { border-radius: var(--radius); padding: 16px 18px; margin: 20px 0; border: 1px solid var(--line); background: var(--paper-2); font-size: .96rem; }
.callout.legal { background: var(--green-bg); border-color: #86efac; }
.callout.warn { background: var(--amber-bg); border-color: #fcd34d; }
.callout.danger { background: var(--danger-bg); border-color: #fca5a5; }
.callout.rg { background: #eef2ff; border-color: #c7d2fe; }
.callout strong:first-child { display: block; margin-bottom: 4px; }

/* ---------- Verdict box (reviews) ---------- */
.verdictbox { background: var(--ink); color: #f1f5f9; border-radius: 14px; padding: 24px 26px; margin: 26px 0; }
.verdictbox h2 { color: #fff; margin-top: 0; }
.verdictbox .scorewrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.verdictbox .bigscore { font-family: var(--font-head); font-size: 2.6rem; font-weight: 700; color: #fff; background: var(--red); border-radius: 12px; padding: 8px 18px; line-height: 1; }
.verdictbox p { color: #cbd5e1; }
.verdictbox a { color: #fca5a5; }

/* spec table inside reviews */
.spectable { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .94rem; }
.spectable th, .spectable td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.spectable th { width: 38%; background: var(--paper-2); font-weight: 700; color: var(--ink); }

/* ---------- Breadcrumb ---------- */
.crumb { font-size: .82rem; color: var(--muted); padding: 14px 0 0; }
.crumb a { color: var(--slate); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb span { margin: 0 6px; opacity: .5; }

/* ---------- FAQ ---------- */
.faq details { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; background: var(--paper); box-shadow: var(--shadow); }
.faq summary { cursor: pointer; padding: 15px 18px; font-weight: 700; font-family: var(--font-head); font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--red); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details > div { padding: 0 18px 16px; color: var(--slate); }

/* ---------- TOC ---------- */
.toc { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 20px 0; }
.toc strong { display: block; margin-bottom: 8px; font-family: var(--font-head); }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.toc li { margin: 3px 0; }
.toc a { color: var(--red-dark); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---------- Article body ---------- */
.article ul, .article ol { margin: 0 0 1.1em; padding-left: 22px; }
.article li { margin: 5px 0; }
.article h2 { scroll-margin-top: 90px; }
.article h3 { scroll-margin-top: 90px; }
.article blockquote { border-left: 4px solid var(--red); margin: 18px 0; padding: 4px 18px; color: var(--slate); font-style: italic; background: var(--paper-2); border-radius: 0 8px 8px 0; }

.byline { display: flex; align-items: center; gap: 12px; font-size: .88rem; color: var(--muted); margin: 6px 0 18px; }
.byline .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; }
.byline a { color: var(--red-dark); }

/* ---------- Stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat b { display: block; font-family: var(--font-head); font-size: 1.7rem; color: var(--red-dark); }
.stat span { font-size: .82rem; color: var(--slate); }

/* ---------- Related links ---------- */
.related { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.related a { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.related a:hover { border-color: var(--red); }
.related a b { color: var(--red-dark); display: block; font-family: var(--font-head); }
.related a span { font-size: .85rem; color: var(--muted); }

/* ---------- Footer ---------- */
footer.site { background: var(--ink); color: #cbd5e1; margin-top: 50px; padding: 40px 0 26px; font-size: .9rem; }
footer.site a { color: #e2e8f0; text-decoration: none; }
footer.site a:hover { color: #fff; text-decoration: underline; }
footer.site .fgrid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 28px; }
footer.site h4 { color: #fff; font-size: .95rem; margin: 0 0 12px; font-family: var(--font-body); text-transform: uppercase; letter-spacing: .06em; }
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { margin: 6px 0; }
footer.site .fbrand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
footer.site .fbrand svg { width: 34px; height: 34px; }
footer.site .fbrand b { color: #fff; font-family: var(--font-head); font-size: 1.1rem; }
.rgfooter { background: var(--red-ink); color: #fff; text-align: center; padding: 12px 0; font-size: .86rem; font-weight: 600; }
.rgfooter a { color: #fff; text-decoration: underline; }
.copyright { border-top: 1px solid rgba(255,255,255,.12); margin-top: 26px; padding-top: 18px; color: #94a3b8; font-size: .82rem; }

/* ---------- Misc ---------- */
.tag { display: inline-block; background: var(--paper-3); color: var(--slate); font-size: .76rem; padding: 3px 9px; border-radius: 6px; margin: 2px; }
.muted { color: var(--muted); }
.hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.updated { font-size: .82rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .g4, .g3, .g2, .stats, .related { grid-template-columns: 1fr 1fr; }
  footer.site .fgrid { grid-template-columns: 1fr 1fr; }
  .proscons { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
  nav.main { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 3px solid var(--red); flex-direction: column; padding: 10px 22px 16px; box-shadow: var(--shadow); }
  nav.main.open { display: flex; }
  nav.main a { padding: 11px 8px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .navtoggle { display: block; }
  .opcard { grid-template-columns: 48px 1fr; }
  .opcard .opright { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; border-top: 1px dashed var(--line); padding-top: 12px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .g4, .g3, .g2, .stats, .related { grid-template-columns: 1fr; }
  footer.site .fgrid { grid-template-columns: 1fr; }
  .hero { padding: 32px 0 28px; }
}

/* ---------- Mobile-only additions (≤ 480px) ---------- */
/* Prevent any child element from causing horizontal scroll */
body { overflow-x: hidden; }
/* Long URLs / codes / operator names don't bust layout */
body { overflow-wrap: anywhere; }

@media (max-width: 480px) {
  /* Hero heading already uses clamp(); give it a firm floor on tiny screens */
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.3rem; }

  /* Spec table in reviews: wrap + scroll, don't crush */
  .spectable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .spectable { min-width: 380px; }

  /* Tool tabs: stack vertically */
  .tabs { flex-direction: column; margin-left: 0; width: 100%; }
  .tab { text-align: center; }

  /* Filter row: single column */
  .filters { flex-direction: column; }
  .filters .field { min-width: 0; width: 100%; }

  /* Search row: stack input + button */
  .searchrow { flex-direction: column; }
  .searchrow input[type=text] { min-width: 0; width: 100%; }

  /* Operator card: full-width CTA */
  .opcard { grid-template-columns: 44px 1fr; gap: 12px; padding: 14px; }
  .opcard .opright { gap: 6px; }
  .opcard .opright .btn { width: 100%; justify-content: center; }

  /* Stat strip: 2 columns not 4 */
  .stats { grid-template-columns: 1fr 1fr; }

  /* Related links: single column */
  .related { grid-template-columns: 1fr; }

  /* Verdict box score: stack */
  .verdictbox .scorewrap { flex-direction: column; gap: 10px; }
}
