/*
 * veggabella.se — Winzter Casino Sverige (monobrand, static).
 * Base chrome (header/nav/footer/buttons/tokens) carried over from
 * templates/slots-catalog (`sc-` prefix). Homepage's catalog-grid/news-teaser
 * sections were NOT reused as-is — this build is a long-form article layout
 * (lede, spec table, H2 sections, FAQ, disclaimer, CTAs) per the chunked
 * content plan, so the `sc-article-*` / `sc-table` / `sc-faq` / `sc-cta` /
 * `sc-games-grid` / `sc-payments-grid` blocks below are new, built to match
 * the same visual system (tokens, radii, shadows, spacing scale).
 * Mobile-first; css-layout / responsive-design conventions throughout
 * (single <nav>, table→cards §5, no horizontal overflow, click dropdowns).
 */

/* ---------- Tokens ---------- */
:root {
  --color-bg: oklch(97% 0.004 260);
  --color-bg-elevated: rgb(255 255 255);
  --color-border: oklch(89% 0.006 260);

  --color-fg: oklch(20% 0.01 260);
  --color-fg-muted: oklch(45% 0.012 260);

  --color-band-grey: oklch(28% 0.006 260);
  --color-band-navy: rgb(24 27 58);
  --color-band-fg: oklch(97% 0.005 260);

  --color-red: rgb(239 68 68);
  --color-cta: rgb(48 51 107);
  --color-cta-fg: rgb(255 255 255);

  --radius-sm: 0.375rem;
  --radius-md: 0.3125rem;
  --radius-pill: 23px;

  --content-w: 1200px;
  --article-w: 800px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 1000;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid var(--color-cta); outline-offset: 2px; }

.sc-skip-link {
  position: absolute; left: 0.5rem; top: -3rem; z-index: 1100;
  background: var(--color-cta); color: var(--color-cta-fg);
  padding: 0.6rem 1rem; border-radius: var(--radius-sm); transition: top 0.15s ease;
}
.sc-skip-link:focus { top: 0.5rem; }

/* ---------- Shared content widths ---------- */
.sc-nav, .sc-header__row, .sc-section { max-width: var(--content-w); margin-inline: auto; }
.sc-article { max-width: var(--article-w); margin-inline: auto; }

/* ---------- Header ---------- */
.sc-header { position: relative; width: 100%; background: var(--color-bg-elevated); border-bottom: 1px solid var(--color-border); }
.sc-header__bar-top { height: 4px; width: 100%; background: var(--color-red); }
.sc-header__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4); min-height: 4rem; }
.sc-header__logo { font-size: 1.125rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-fg); }

/* Single <nav> in the DOM (css-layout §4) */
.sc-nav { display: none; flex-direction: column; gap: var(--space-1); position: static; width: 100%; padding: 0; max-width: none; margin: 0; }
.sc-nav.is-open { display: flex; padding: var(--space-2) var(--space-4) var(--space-4); }
.sc-nav__link { padding: var(--space-3) var(--space-2); border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 500; color: var(--color-fg-muted); }
.sc-nav__link:hover { color: var(--color-fg); background: var(--color-bg); }
.sc-nav__link.is-current { color: var(--color-cta); font-weight: 700; }

.sc-nav-toggle { display: flex; padding: var(--space-2); color: var(--color-fg); min-height: 44px; min-width: 44px; align-items: center; justify-content: center; }
.sc-nav-toggle svg { width: 1.5rem; height: 1.5rem; }

@media (min-width: 64em) {
  .sc-header__row { padding-inline: var(--space-6); }
  .sc-nav, .sc-nav.is-open { display: flex; flex-direction: row; align-items: center; gap: var(--space-1); width: auto; padding: 0; position: static; }
  .sc-nav__link { padding: var(--space-2) var(--space-4); }
  .sc-nav-toggle { display: none; }
}

/* ---------- Hero / intro band ---------- */
.sc-intro {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(to bottom, color-mix(in oklch, var(--color-band-grey) 78%, transparent) 0%, var(--color-band-grey) 70%),
    url("../img/hero-banner.webp") center/cover no-repeat,
    var(--color-band-grey);
  padding: var(--space-12) var(--space-4);
  text-align: center;
}
.sc-intro > * { position: relative; z-index: 1; }
.sc-intro__eyebrow {
  display: inline-block; margin-bottom: var(--space-3); padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill); background: color-mix(in oklch, var(--color-band-fg) 12%, transparent);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-band-fg);
}
.sc-intro__headline { max-width: 42rem; margin-inline: auto; font-size: clamp(1.5rem, 4vw + 1rem, 2.5rem); font-weight: 800; line-height: 1.2; color: var(--color-band-fg); }
.sc-intro__lede { max-width: 42rem; margin: var(--space-4) auto 0; font-size: 1rem; line-height: 1.6; color: color-mix(in oklch, var(--color-band-fg) 80%, transparent); text-align: left; }
.sc-intro .sc-cta-block { margin-top: var(--space-6); justify-content: center; }

/* ---------- Article body ---------- */
.sc-article { padding: var(--space-12) var(--space-4); }
@media (min-width: 64em) { .sc-article { padding-inline: var(--space-4); } }

.sc-article__section { padding-block: var(--space-8); border-top: 1px solid var(--color-border); }
.sc-article__section:first-child { border-top: 0; padding-top: 0; }
.sc-article__section h2 {
  font-size: clamp(1.25rem, 2vw + 0.9rem, 1.6rem); font-weight: 800; color: var(--color-fg);
  margin-bottom: var(--space-4); scroll-margin-top: 5rem;
}
.sc-article__section h3 { font-size: 1.05rem; font-weight: 700; color: var(--color-fg); margin-bottom: var(--space-2); }
.sc-article__section p { color: var(--color-fg-muted); line-height: 1.65; }
.sc-article__section p + p { margin-top: var(--space-3); }
.sc-article__section ol,
.sc-article__section ul { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-3); }
.sc-article__section ol { counter-reset: sc-step; }
.sc-article__section ol > li {
  display: flex; gap: var(--space-3); align-items: flex-start; color: var(--color-fg-muted); line-height: 1.6;
}
.sc-article__section ol > li::before {
  counter-increment: sc-step; content: counter(sc-step);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--color-band-navy);
  color: var(--color-band-fg); font-size: 0.8rem; font-weight: 700;
}
.sc-article__section ul > li { position: relative; padding-left: var(--space-4); color: var(--color-fg-muted); line-height: 1.6; }
.sc-article__section ul > li::before { content: "•"; position: absolute; left: 0; color: var(--color-cta); font-weight: 700; }
.sc-article__section strong { color: var(--color-fg); }

/* ---------- Tables (css-layout §5: table -> cards) ---------- */
.sc-table-wrap { overflow-x: auto; margin-top: var(--space-3); }
.sc-table { width: 100%; border-collapse: collapse; background: var(--color-bg-elevated); border-radius: var(--radius-md); overflow: hidden; box-shadow: 0 2px 15px 0 rgba(58, 58, 58, 0.1); }
.sc-table caption { text-align: left; padding: var(--space-3) var(--space-4) 0; color: var(--color-fg-muted); font-size: 0.875rem; }
.sc-table th, .sc-table td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); }
.sc-table thead th { background: var(--color-band-navy); color: var(--color-band-fg); font-weight: 700; font-size: 0.9rem; }
.sc-table tbody tr:last-child td { border-bottom: 0; }
.sc-table tbody th { font-weight: 700; color: var(--color-fg); white-space: nowrap; }

@media (max-width: 40em) {
  .sc-table thead { display: none; }
  .sc-table, .sc-table tbody, .sc-table tr, .sc-table td, .sc-table tbody th { display: block; width: 100%; }
  .sc-table tr { margin-bottom: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
  .sc-table tr:last-child { margin-bottom: 0; }
  .sc-table td, .sc-table tbody th { display: flex; justify-content: space-between; gap: var(--space-3); text-align: right; border-bottom: 1px solid var(--color-border); font-weight: 400; white-space: normal; }
  .sc-table td:last-child, .sc-table tbody tr > th:last-child { border-bottom: 0; }
  .sc-table td::before, .sc-table tbody th::before { content: attr(data-label); font-weight: 600; color: var(--color-fg-muted); text-align: left; }
}

/* ---------- Games / providers tile grid (never a carousel) ---------- */
.sc-games-grid, .sc-payments-grid {
  display: grid; gap: var(--space-3); margin-top: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
}
.sc-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-4); border-radius: var(--radius-md); background: var(--color-bg-elevated);
  box-shadow: 0 2px 15px 0 rgba(58, 58, 58, 0.1); text-align: center; min-height: 96px;
}
.sc-tile img { width: 100%; height: 40px; object-fit: contain; }
.sc-tile__label { font-size: 0.8rem; font-weight: 600; color: var(--color-fg); }
.sc-tile--text-only { border: 1px dashed var(--color-border); box-shadow: none; background: var(--color-bg); }

/* Popular-games tile grid (portrait game covers + per-tile CTA) */
.sc-games-grid--popular {
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 40em) {
  .sc-games-grid--popular { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 64em) {
  .sc-games-grid--popular { grid-template-columns: repeat(4, 1fr); }
}
.sc-tile--game { padding: var(--space-2); }
.sc-tile--game img { width: 100%; height: auto; aspect-ratio: 152 / 227; object-fit: cover; border-radius: var(--radius-sm); }
.sc-tile--game .sc-btn { width: 100%; }

/* ---------- CTA buttons ---------- */
.sc-cta-block { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.sc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  border-radius: var(--radius-pill); font-weight: 700; min-height: 44px; padding: 0.75rem 1.75rem;
  transition: opacity 0.2s ease; cursor: pointer;
}
.sc-btn--cta { background: var(--color-cta); color: var(--color-cta-fg); }
.sc-btn--cta:hover { opacity: 0.9; }
.sc-btn--outline { border: 1px solid var(--color-border); color: var(--color-fg); }
.sc-btn--outline:hover { background: var(--color-bg-elevated); }
.sc-btn--sm { padding: 0.55rem 1.25rem; font-size: 0.875rem; }

/* ---------- FAQ ---------- */
.sc-faq { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-3); }
.sc-faq__item { padding: var(--space-4); border-radius: var(--radius-md); background: var(--color-bg-elevated); box-shadow: 0 2px 15px 0 rgba(58, 58, 58, 0.1); }
.sc-faq__item h3 { font-size: 1rem; }
.sc-faq__item p { margin-top: var(--space-2); }

/* ---------- Internal links ---------- */
.sc-related { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }
.sc-related a { color: var(--color-cta); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Disclaimer ---------- */
.sc-disclaimer {
  margin-top: var(--space-8); padding: var(--space-4); border-radius: var(--radius-md);
  background: var(--color-bg-elevated); border: 1px solid var(--color-border);
  font-size: 0.8rem; line-height: 1.6; color: var(--color-fg-muted);
}

/* ---------- Legal / static pages ---------- */
.sc-legal { max-width: var(--article-w); margin-inline: auto; padding: var(--space-12) var(--space-4); }
.sc-legal h1 { font-size: clamp(1.5rem, 3vw + 1rem, 2rem); font-weight: 800; margin-bottom: var(--space-6); }
.sc-legal h2 { font-size: 1.15rem; font-weight: 700; margin: var(--space-8) 0 var(--space-3); }
.sc-legal p { color: var(--color-fg-muted); line-height: 1.65; }
.sc-legal p + p { margin-top: var(--space-3); }
.sc-legal ul { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }
.sc-legal ul li { position: relative; padding-left: var(--space-4); color: var(--color-fg-muted); }
.sc-legal ul li::before { content: "•"; position: absolute; left: 0; color: var(--color-cta); font-weight: 700; }

/* ---------- 404 page ---------- */
.sc-404 { max-width: var(--article-w); margin-inline: auto; padding: var(--space-16) var(--space-4); text-align: center; }
.sc-404__code { font-size: clamp(3rem, 8vw, 5rem); font-weight: 800; color: var(--color-cta); }
.sc-404__title { font-size: 1.5rem; font-weight: 800; margin-top: var(--space-3); }
.sc-404__text { margin-top: var(--space-3); color: var(--color-fg-muted); }
.sc-404__links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); justify-content: center; margin-top: var(--space-8); }
.sc-404__links a { color: var(--color-cta); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Generic sections (reused for legal / 404 shell) ---------- */
.sc-section { padding: var(--space-12) var(--space-4); }
@media (min-width: 64em) { .sc-section { padding-inline: var(--space-6); } }

/* ---------- Footer ---------- */
.sc-footer { border-top: 1px solid var(--color-border); background: var(--color-bg-elevated); padding: var(--space-8) var(--space-4); text-align: center; }
.sc-footer__badge { display: inline-block; margin: 0 auto var(--space-4); padding: var(--space-2) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 500; color: var(--color-fg-muted); }
.sc-footer__nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-1) var(--space-6); margin-bottom: var(--space-4); }
.sc-footer__nav a { font-size: 0.875rem; color: var(--color-fg-muted); padding: var(--space-2) 0; }
.sc-footer__nav a:hover { color: var(--color-fg); }
.sc-footer__copy { font-size: 0.75rem; color: var(--color-fg-muted); }

/* ---------- Redirect modal (injected inline by main.js, styled here too) ---------- */
.go-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: var(--z-modal); }
.go-modal-overlay[hidden] { display: none; }
.go-modal { background: #181818; color: #fff; font: inherit; padding: 1.5rem 2rem; border-radius: .75rem; max-width: 320px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.go-modal__track { margin-top: 1rem; height: 6px; border-radius: 999px; background: rgba(255,255,255,.15); overflow: hidden; }
.go-modal__bar { height: 100%; width: 0%; background: var(--color-cta); }
