/* ==========================================================================
   Utländskacasinos.se, Designtokens och globala stilar
   ==========================================================================
   Källa: research/DESIGN_TOKENS.md, research/components/artikeltypografi.spec.md,
   research/BEHAVIORS.md. Denna fil definierar grunden: variabler, reset,
   bastypografi, artikeltypografi (rubriker/brödtext/listor/tabeller) samt
   sidcontainern. Header, footer, hero och kortkomponenter byggs i separata
   filer och återanvänder variablerna nedan.

   CSS-VARIABLER (fullständig lista):

   -- Kärnfärger (varumärke) --
   --navy               #0d1b2a  Primär mörk: rubriker, header/footer-bakgrund, tabellbakgrund
   --navy-deep          #021826  Gradient-start (about-hero)
   --navy-light         #1a2d42  Gradient-slut (about-hero/founder-sektion)
   --red                #c8102e  Brand-accent: CTA, länkar, list-bullets, tabellheader
   --red-hover          #a00d24  Röd hover/mörkare (brödtextlänkar)
   --red-hover-alt      #af1a29  Röd hover, alternativ nyans
   --red-light          #ff4d6a  Röd gradient-slut / ljusare hover
   --red-light-alt      #ff2a4d  Röd gradient-slut / hover på tabellänkar
   --red-disclaimer     #f13754  Länkar i footer-disclaimer
   --green              #28a745  Rank-badge, gradient-start
   --green-dark         #20863a  Rank-badge, gradient-slut
   --green-check        #059669  Bock-ikon i feature-listor
   --green-cta-front    #4fee64  3D CTA-knapp, front
   --green-cta-edge     #17c94c  3D CTA-knapp, kant
   --red-warning        #dc3545  Varningstriangel i pros/cons-listor
   --purple-info        #6f42c1  Info-box "Varför vi rekommenderar"
   --white              #ffffff  Kortbakgrund, text på mörk botten

   -- Neutrala/bakgrund --
   --bg-page                #f0f0f0  Sidbakgrund (body)
   --bg-card-gradient-start #f8f9fa  Subtil kortgradient, start
   --bg-card-gradient-end   #f1f3f4  Subtil kortgradient, slut
   --border-light           #e5e7eb  Kort-ramar (hero, about-sektioner)
   --border-light-alt       #e0e0e0  Kort-ramar (topplista)
   --text-gray-dark         #374151  Hero-introtext
   --text-gray-mid          #4b5563  Tooltip-brödtext, datumtext
   --text-gray-light        #6b7280  Kicker-text, stat-etiketter
   --text-gray-features     #444444  Feature-listor, why-box-text
   --text-gray-li           #333333  Vanliga listpunkter
   --text-gray-meta         #666666  Meta-info i topplistan
   --list-color             #1a1a2e  ul/ol-containerns basfärg (artikeltypografi.spec.md)

   -- Temats bas-variabler (GeneratePress-arv, dokumenterat för fullständighet) --
   --contrast       #222222  Global body-textfärg (bas, utanför artikelyta)
   --contrast-2     #575760
   --contrast-3     #b2b2be
   --base           #f0f0f0  (alias till --bg-page)
   --base-2         #f7f8f9
   --base-3         #ffffff
   --accent-legacy  #1e73be  Temats standardlänkfärg, överskrivs alltid av --red i praktiken

   -- Typografi --
   --font-base     Systemstack: body, nav, brödtext, knappar, samtliga rubriker h1-h6
   --font-display  "Sora" (400/700/800) + sans-serif-fallback. ENDAST display-etiketter
                   och kortrubriker (originalet deklarerade Sora men laddade den aldrig,
                   detta bygge implementerar designavsikten på riktigt)

   -- Spacing / radie / skugga / container --
   --container-max-width        1200px  Sidcontainer och header/footer inre bredd
   --container-padding          40px    Sidcontainer padding (≤768px: 17px)
   --container-padding-mobile   17px
   --header-footer-padding-x    20px    Header/footer inre container, horisontell padding
   --radius-lg    16px  Stora kort, sidcontainer
   --radius-md    12px  Mindre kort/knappar
   --radius-sm    8px   Tabell, knappar
   --radius-xs    6px   Knappar, badges
   --radius-round 50%   Avatar, rank-badge, cirkulära element
   --shadow-card             standardkort: 0 4px 6px + 0 10px 28px + 0 0 0 1px
   --shadow-card-hover        kort vid hover (lyft 1px, förstärkt skugga)
   --shadow-hero              hero-kort: 0 4px 20px rgba(0,0,0,0.08)
   --shadow-casino-item        topplista-post
   --shadow-casino-item-hover  topplista-post vid hover
   --shadow-mobile-nav         mobilmeny-overlay-panel
   --transition-fast   0.15s ease  (CTA-tryck)
   --transition-base   0.2s ease   (färg/skugga)
   --transition-slow   0.3s ease   (footer-länkar, tooltips)
   --transition-menu   0.4s ease   (mobilmeny max-height/padding)

   Brytpunkter (dokumentation - CSS-variabler kan inte användas i @media-villkor,
   så dessa är hårdkodade litteralt i reglerna nedan/i framtida komponentfiler):
   1440px desktop-referens · 1200px containertak · 1100px footer-grid 4→2 kol ·
   991px hamburgermeny · 900px kortgrid 3→2 kol · 768px HUVUDBRYTPUNKT mobil/desktop ·
   560px kortgrid 2→1 kol · 480px finjustering
   ========================================================================== */

:root {
  /* Kärnfärger */
  --navy: #0d1b2a;
  --navy-deep: #021826;
  --navy-light: #1a2d42;
  --red: #c8102e;
  --red-hover: #a00d24;
  --red-hover-alt: #af1a29;
  --red-light: #ff4d6a;
  --red-light-alt: #ff2a4d;
  --red-disclaimer: #f13754;
  --green: #28a745;
  --green-dark: #20863a;
  --green-check: #059669;
  --green-cta-front: #4fee64;
  --green-cta-edge: #17c94c;
  --red-warning: #dc3545;
  --purple-info: #6f42c1;
  --white: #ffffff;

  /* Neutrala/bakgrund */
  --bg-page: #f0f0f0;
  --bg-card-gradient-start: #f8f9fa;
  --bg-card-gradient-end: #f1f3f4;
  --border-light: #e5e7eb;
  --border-light-alt: #e0e0e0;
  --text-gray-dark: #374151;
  --text-gray-mid: #4b5563;
  --text-gray-light: #6b7280;
  --text-gray-features: #444444;
  --text-gray-li: #333333;
  --text-gray-meta: #666666;
  --list-color: #1a1a2e;

  /* Temats bas-variabler (arv, dokumenterat) */
  --contrast: #222222;
  --contrast-2: #575760;
  --contrast-3: #b2b2be;
  --base: #f0f0f0;
  --base-2: #f7f8f9;
  --base-3: #ffffff;
  --accent-legacy: #1e73be;

  /* Typografi */
  --font-base: -apple-system, system-ui, "system-ui", "Segoe UI", Helvetica, Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-display: "Sora", -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Spacing / radie / container */
  --container-max-width: 1200px;
  --container-padding: 40px;
  --container-padding-mobile: 17px;
  --header-footer-padding-x: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-round: 50%;

  /* Skuggor */
  --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 28px rgba(0, 0, 0, 0.09), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 12px rgba(0, 0, 0, 0.1), 0 20px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --shadow-hero: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-casino-item: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-casino-item-hover: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-mobile-nav: 0 4px 20px rgba(0, 0, 0, 0.3);

  /* Övergångar */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  --transition-menu: 0.4s ease;
}

/* ==========================================================================
   Sora (400/700/800, latin), självhostad, font-display: swap.
   Endast för display-etiketter/kortrubriker (se --font-display ovan).
   ========================================================================== */
@font-face {
  font-family: "Sora";
  src: url("/fonts/sora-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sora";
  src: url("/fonts/sora-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sora";
  src: url("/fonts/sora-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure {
  margin: 0;
  padding: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* ==========================================================================
   Bastypografi
   ========================================================================== */
body {
  font-family: var(--font-base);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--contrast);
  background: var(--bg-page);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-base);
  color: var(--navy);
}

/* ==========================================================================
   Sidcontainer
   ========================================================================== */
.page-container {
  max-width: var(--container-max-width);
  margin: 20px auto;
  padding: var(--container-padding);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

@media (max-width: 768px) {
  .page-container {
    padding: var(--container-padding-mobile);
    margin: 0;
  }
}

/* ==========================================================================
   Tillgänglighetsverktyg
   ========================================================================== */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  border-radius: 0 0 var(--radius-xs) 0;
}

.skip-to-content:focus {
  left: 8px;
  top: 8px;
  border-radius: var(--radius-xs);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Artikeltypografi (research/components/artikeltypografi.spec.md)
   Gäller inuti .article-content: rubriker, brödtext, länkar, listor, tabeller.
   ========================================================================== */
.article-content {
  color: var(--navy);
}

.article-content p {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--navy);
  margin: 0 0 20px;
}

.article-content h2 {
  font-size: 35px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--navy);
  margin: 48px 0 18px;
}

.article-content h3 {
  font-size: 29px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--navy);
  margin: 34px 0 14px;
}

.article-content h4 {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--navy);
  margin: 28px 0 12px;
}

/* Länkar i brödtext */
.article-content a {
  color: var(--red);
  text-decoration: underline;
  transition: color var(--transition-base);
}

.article-content a:hover {
  color: var(--red-hover);
}

/* Listor */
.article-content ul,
.article-content ol {
  list-style: none;
  margin: 20px 25px 25px 25px;
  padding: 0;
  color: var(--list-color);
}

.article-content li {
  position: relative;
  margin-bottom: 10px;
  padding-left: 28px;
  line-height: 1.7;
  font-size: 16px;
  color: var(--text-gray-li);
}

.article-content li strong {
  color: var(--navy);
  font-weight: 600;
}

.article-content li code {
  background-color: #f1f1f1;
  color: var(--red);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-size: 0.9em;
}

.article-content li a {
  color: var(--red);
  text-decoration: underline;
}

.article-content li a:hover {
  color: var(--red-hover);
}

/* Oordnad lista: rund bullet, nästlade nivåer ihåliga/mindre */
.article-content ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  background-color: var(--red);
  border-radius: 50%;
}

.article-content ul ul > li::before {
  width: 6px;
  height: 6px;
  background: transparent;
  border: 2px solid var(--red);
}

.article-content ul ul ul > li::before {
  width: 6px;
  height: 6px;
  border: none;
  border-radius: 0;
  background-color: rgba(200, 16, 46, 0.5);
}

/* Ordnad lista: CSS-räknare istället för nativ numrering */
.article-content ol {
  counter-reset: article-counter;
}

.article-content ol > li {
  counter-increment: article-counter;
}

.article-content ol > li::before {
  content: counter(article-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--red);
  font-weight: 600;
  font-size: 16px;
}

.article-content ol ol {
  counter-reset: article-counter-alpha;
}

.article-content ol ol > li {
  counter-increment: article-counter-alpha;
}

.article-content ol ol > li::before {
  content: counter(article-counter-alpha, lower-alpha) ".";
}

.article-content ol ol ol {
  counter-reset: article-counter-roman;
}

.article-content ol ol ol > li {
  counter-increment: article-counter-roman;
}

.article-content ol ol ol > li::before {
  content: counter(article-counter-roman, lower-roman) ".";
}

/* Tabeller: mörk stil enligt sajtens identitet (röd thead, marinblå kropp),
   med luftig padding, rundade hörn och diskret caption. */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 30px 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hero);
}

.article-content table {
  width: 100%;
  min-width: 600px;
  border-collapse: separate;
  border-spacing: 0;
  background-color: transparent;
}

/* Caption behålls i markupen för skärmläsare men visas inte visuellt. */
.article-content caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.article-content thead {
  background-color: var(--red);
}

.article-content thead th {
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
  padding: 16px 18px;
  white-space: nowrap;
  text-align: left;
}

/* Rundade hörn direkt på cellerna: fungerar även när captionen ligger ovanför
   och när .table-wrapper blir scrollcontainer på mobil. */
.article-content thead th:first-child {
  border-top-left-radius: var(--radius-md);
}

.article-content thead th:last-child {
  border-top-right-radius: var(--radius-md);
}

.article-content tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius-md);
}

.article-content tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius-md);
}

.article-content tbody tr {
  background-color: var(--navy);
}

.article-content tbody tr:nth-child(even) {
  background-color: #14263c;
}

.article-content tbody tr:hover {
  background-color: #1c3151;
  transition: background-color var(--transition-base);
}

.article-content tbody tr:last-child td {
  border-bottom: none;
}

.article-content tbody td {
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.article-content tbody td a {
  color: var(--red-light);
  text-decoration: none;
}

.article-content tbody td a:hover {
  color: var(--white);
  text-decoration: underline;
}

.article-content tfoot {
  background-color: rgba(255, 255, 255, 0.05);
}

.article-content tfoot td {
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  border-bottom: none;
}

/* ==========================================================================
   Responsivt (artikeltypografi.spec.md: endast listor/tabeller skalar,
   H2-H4 har ingen uppmätt brytpunktsregel i källan)
   ========================================================================== */
@media (max-width: 768px) {
  .article-content ul,
  .article-content ol {
    margin: 16px 0 25px 0;
  }

  .article-content li {
    font-size: 15px;
  }

  .article-content thead th {
    font-size: 14px;
    padding: 12px 14px;
  }

  .article-content tbody td {
    font-size: 14px;
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .article-content li {
    font-size: 14px;
    line-height: 1.6;
  }

  .article-content thead th {
    font-size: 13px;
    padding: 10px 12px;
  }

  .article-content tbody td {
    font-size: 13px;
    padding: 10px 12px;
  }
}
