/* ── 1. Design Tokens ──────────────────────────────────────── */
:root {
  /* Foundation */
  --color_bg: #1d1b1e; /* dark sections: nav, hero, footer */
  --color_surface: #ffffff;
  --color_surface2: #f1f3f5;
  --color_border: #e3e7ee;

  /* Brand */
  --color_primary: #2563eb;
  --color_primary_dark: #1d40d8;
  --color_primary_active: #1e5aaf;
  --color_accent: #16b8a0;
  --color_accent_dark: #0f7168;
  --color_gold: #f7b80b;

  /* Text */
  --text_primary: #1d172a;
  --text_secondary: #475588;
  --text_muted: #647480;
  --text_disabled: #cbd5e1;
  --text_link: #2563eb;
  --text_on_dark: #ffffff;

  /* Status */
  --color_success: #16a34a;
  --color_warning: #f59e0b;
  --color_danger: #dc2626;
  --color_info: #1ea4d9;

  /* Tints (light bg for badges / alerts) */
  --tint_success: #dcfce7;
  --tint_warning: #fef3c7;
  --tint_danger: #fee2e2;
  --tint_info: #e0f2fe;
  --tint_primary: #dbeafe;
  --tint_accent: #ccfbf1;

  /* Typography */
  --font_heading: "Poppins", system-ui, sans-serif;
  --font_body: "Inter", system-ui, sans-serif;

  /* Fluid type scale (mobile → desktop clamp) */
  --text_h1: clamp(1.75rem, 3vw + 0.5rem, 2.75rem); /* 28 → 44px */
  --text_h2: clamp(1.375rem, 2vw + 0.25rem, 2rem); /* 22 → 32px */
  --text_h3: clamp(1.0625rem, 1.25vw + 0.25rem, 1.375rem); /* 17 → 22px */
  --text_h4: clamp(1rem, 1vw + 0.25rem, 1.25rem); /* 16 → 20px */
  --text_body_lg: 1.125rem; /* 18px */
  --text_body: 1rem; /* 16px */
  --text_sm: 0.875rem; /* 14px */
  --text_caption: 0.75rem; /* 12px */

  /* Line heights (from spec: size/line-height) */
  --lh_h1: 1.046; /* 68/65  */
  --lh_h2: 1.111; /* 50/45  */
  --lh_h3: 1.25; /* 40/32  */
  --lh_h4: 1.333; /* 32/24  */
  --lh_body: 1.65;
  --lh_lg: 1.556; /* 28/18  */

  /* Font weights */
  --fw_regular: 400;
  --fw_medium: 500;
  --fw_semibold: 600;
  --fw_bold: 700;

  /* Spacing — 8px scale */
  --sp_1: 0.25rem; /*  4px */
  --sp_2: 0.5rem; /*  8px */
  --sp_3: 0.75rem; /* 12px */
  --sp_4: 1rem; /* 16px */
  --sp_5: 1.5rem; /* 24px */
  --sp_6: 2rem; /* 32px */
  --sp_7: 3rem; /* 48px */
  --sp_8: 4rem; /* 64px */

  /* Border radius (from spec) */
  --radius_sm: 8px;
  --radius_md: 12px;
  --radius_lg: 16px;
  --radius_xl: 24px;
  --radius_full: 9999px;

  /* Shadows */
  --shadow_card:
    0 1px 3px rgba(29, 23, 42, 0.06), 0 4px 16px rgba(29, 23, 42, 0.08);
  --shadow_hover:
    0 4px 8px rgba(29, 23, 42, 0.08), 0 12px 32px rgba(29, 23, 42, 0.13);
  --shadow_btn: 0 1px 2px rgba(37, 99, 235, 0.2);
  --shadow_input: 0 0 0 3px rgba(37, 99, 235, 0.15);

  /* Layout */
  --container_max: 1200px;
  --container_pad: var(--sp_5); /* 24px desktop gutter  */
  --container_pad_mob: var(--sp_4); /* 16px mobile padding  */

  /* Transitions */
  --t_fast: 150ms ease;
  --t_base: 250ms ease;
  --t_slow: 350ms ease;
}

/* ── 2. Base Reset ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  tab-size: 4;
}

body {
  font-family: var(--font_body);
  font-size: var(--text_body);
  font-weight: var(--fw_regular);
  line-height: var(--lh_body);
  color: var(--text_primary);
  background-color: var(--color_surface2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--text_link);
  text-decoration: none;
  transition: color var(--t_fast);
}
a:hover {
  color: var(--color_primary_dark);
}

ul,
ol {
  list-style: none;
}

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

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ── 3. Typography ─────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font_heading);
  font-weight: var(--fw_semibold);
  color: var(--text_primary);
  text-wrap: balance;
}

h1 {
  font-size: var(--text_h1);
  line-height: var(--lh_h1);
  letter-spacing: -0.025em;
}
h2 {
  font-size: var(--text_h2);
  line-height: var(--lh_h2);
  letter-spacing: -0.02em;
}
h3 {
  font-size: var(--text_h3);
  line-height: var(--lh_h3);
  letter-spacing: -0.015em;
  font-weight: var(--fw_medium);
}
h4 {
  font-size: var(--text_h4);
  line-height: var(--lh_h4);
  font-weight: var(--fw_medium);
}
h5 {
  font-size: var(--text_body_lg);
  font-weight: var(--fw_medium);
}
h6 {
  font-size: var(--text_body);
  font-weight: var(--fw_medium);
}

p {
  color: var(--text_secondary);
  line-height: var(--lh_body);
}
p + p {
  margin-top: var(--sp_3);
}

/* Text colour utilities */
.text_primary {
  color: var(--text_primary) !important;
}
.text_secondary {
  color: var(--text_secondary) !important;
}
.text_muted {
  color: var(--text_muted) !important;
}
.text_accent {
  color: var(--color_accent) !important;
}
.text_gold {
  color: var(--color_gold) !important;
}
.text_success {
  color: var(--color_success) !important;
}
.text_warning {
  color: var(--color_warning) !important;
}
.text_danger {
  color: var(--color_danger) !important;
}
.text_on_dark {
  color: var(--text_on_dark) !important;
}

/* Text size utilities */
.text_h1 {
  font-size: var(--text_h1);
}
.text_h2 {
  font-size: var(--text_h2);
}
.text_h3 {
  font-size: var(--text_h3);
}
.text_h4 {
  font-size: var(--text_h4);
}
.text_body_lg {
  font-size: var(--text_body_lg);
}
.text_sm {
  font-size: var(--text_sm);
}
.text_caption {
  font-size: var(--text_caption);
}

/* Weight utilities */
.fw_regular {
  font-weight: var(--fw_regular);
}
.fw_medium {
  font-weight: var(--fw_medium);
}
.fw_semibold {
  font-weight: var(--fw_semibold);
}
.fw_bold {
  font-weight: var(--fw_bold);
}

/* Alignment */
.text_center {
  text-align: center;
}
.text_left {
  text-align: left;
}
.text_right {
  text-align: right;
}

/* ── 4. Layout ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container_max);
  margin-inline: auto;
  padding-inline: var(--container_pad_mob);
}
@media (min-width: 1024px) {
  .container {
    padding-inline: var(--container_pad);
  }
}

/* Section vertical rhythm */
.section {
  padding-block: var(--sp_7);
}
@media (min-width: 1024px) {
  .section {
    padding-block: var(--sp_8);
  }
}

/* ── 5. Grid ───────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: var(--sp_5);
}

@media (min-width: 1024px) {
  .grid_2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid_3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid_4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Named content grids — 1 col → 2 col (640px) → 3 col (1024px) */
.casino_grid,
.guides_grid {
  display: grid;
  gap: var(--sp_5);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .casino_grid,
  .guides_grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .casino_grid,
  .guides_grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Flex utilities */
.flex {
  display: flex;
}
.flex_col {
  flex-direction: column;
}
.flex_wrap {
  flex-wrap: wrap;
}
.items_center {
  align-items: center;
}
.items_start {
  align-items: flex-start;
}
.justify_between {
  justify-content: space-between;
}
.justify_center {
  justify-content: center;
}
.justify_end {
  justify-content: flex-end;
}

.gap_1 {
  gap: var(--sp_1);
}
.gap_2 {
  gap: var(--sp_2);
}
.gap_3 {
  gap: var(--sp_3);
}
.gap_4 {
  gap: var(--sp_4);
}
.gap_5 {
  gap: var(--sp_5);
}
.gap_6 {
  gap: var(--sp_6);
}

/* ── 6. Card ───────────────────────────────────────────────── */
.card {
  background: var(--color_surface);
  border: 1px solid var(--color_border);
  border-radius: var(--radius_lg);
  box-shadow: var(--shadow_card);
  transition:
    box-shadow var(--t_base),
    transform var(--t_base);
}
.card:hover {
  box-shadow: var(--shadow_hover);
  transform: translateY(-2px);
}

.card_body {
  padding: var(--sp_5);
}
.card_body_lg {
  padding: var(--sp_6);
}

/* ── 7. Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp_2);
  padding: 0.6875rem 1.5rem;
  font-family: var(--font_body);
  font-size: var(--text_body);
  font-weight: var(--fw_medium);
  line-height: 1;
  border-radius: var(--radius_sm);
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--t_fast),
    border-color var(--t_fast),
    color var(--t_fast),
    box-shadow var(--t_fast),
    transform var(--t_fast);
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  background: #9443bb; /* per spec — 50% opacity primary */
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary */
.btn_primary {
  background: var(--color_primary);
  color: #fff;
  box-shadow: var(--shadow_btn);
}
.btn_primary:hover {
  background: var(--color_primary_dark);
  color: #fff;
}
.btn_primary:active {
  background: var(--color_primary_active);
}

/* Secondary */
.btn_secondary {
  background: var(--color_surface2);
  color: var(--text_primary);
  border-color: var(--color_border);
}
.btn_secondary:hover {
  background: var(--color_border);
  color: var(--text_primary);
}
.btn_secondary:active {
  background: #d1d5db;
}

/* Ghost */
.btn_ghost {
  background: transparent;
  color: var(--color_primary);
  border-color: var(--color_primary);
}
.btn_ghost:hover {
  background: #dbeafe;
  color: var(--color_primary);
}
.btn_ghost:active {
  background: #bfdbfe;
}

/* Accent */
.btn_accent {
  background: var(--color_accent);
  color: #fff;
}
.btn_accent:hover {
  background: var(--color_accent_dark);
  color: #fff;
}

/* Dark (use on --color_bg sections) */
.btn_dark {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
}
.btn_dark:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Sizes */
.btn_sm {
  padding: 0.4375rem 1rem;
  font-size: var(--text_sm);
  border-radius: 6px;
}
.btn_lg {
  padding: 0.875rem 2rem;
}
.btn_full {
  width: 100%;
}

/* ── 8. Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp_1);
  padding: 0.25rem 0.625rem;
  font-family: var(--font_body);
  font-size: var(--text_caption);
  font-weight: var(--fw_semibold);
  line-height: 1;
  border-radius: var(--radius_full);
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge_gold {
  background: var(--tint_warning);
  color: #92400e;
}
.badge_accent {
  background: var(--tint_accent);
  color: #065f46;
}
.badge_primary {
  background: var(--tint_primary);
  color: #1e40af;
}
.badge_success {
  background: var(--tint_success);
  color: var(--color_success);
}
.badge_warning {
  background: var(--tint_warning);
  color: #92400e;
}
.badge_danger {
  background: var(--tint_danger);
  color: var(--color_danger);
}
.badge_info {
  background: var(--tint_info);
  color: #0369a1;
}

/* ── 9. Input ──────────────────────────────────────────────── */
.input {
  display: block;
  width: 100%;
  padding: 0.6875rem 1rem;
  font-family: var(--font_body);
  font-size: var(--text_body);
  color: var(--text_primary);
  background: var(--color_surface);
  border: 1px solid var(--color_border);
  border-radius: var(--radius_sm);
  outline: none;
  transition:
    border-color var(--t_fast),
    box-shadow var(--t_fast);
}
.input::placeholder {
  color: var(--text_muted);
}
.input:hover {
  border-color: #cbd5e1;
}
.input:focus {
  border-color: var(--color_primary);
  box-shadow: var(--shadow_input);
}
.input:disabled {
  background: var(--color_surface2);
  color: var(--text_disabled);
  cursor: not-allowed;
}

/* ── 10. Chip / Tag ────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp_1);
  padding: 0.3125rem 0.75rem;
  font-size: var(--text_sm);
  font-weight: var(--fw_medium);
  color: #1e4daf;
  background: var(--color_surface);
  border: 1px solid #9f98fe;
  border-radius: var(--radius_full);
  cursor: default;
  transition: background var(--t_fast);
}
.chip:hover {
  background: var(--tint_primary);
}

/* ── 11. Star Rating ───────────────────────────────────────── */
.stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.star_filled {
  color: var(--color_gold);
}
.star_empty {
  color: var(--color_border);
}

/* ── 12. Tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--color_border);
}
.tab {
  padding: var(--sp_3) var(--sp_4);
  font-size: var(--text_body);
  font-weight: var(--fw_medium);
  color: var(--text_muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition:
    color var(--t_fast),
    border-color var(--t_fast);
}
.tab:hover {
  color: var(--text_secondary);
}
.tab.is_active {
  color: var(--text_primary);
  border-bottom-color: var(--color_primary);
}
.tab:disabled {
  color: var(--text_disabled);
  cursor: not-allowed;
}

/* ── 13. Table ─────────────────────────────────────────────── */
.table_wrapper {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text_sm);
}
.table th {
  padding: var(--sp_3) var(--sp_4);
  text-align: left;
  font-weight: var(--fw_semibold);
  color: var(--text_muted);
  font-size: var(--text_caption);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--color_border);
}
.table td {
  padding: var(--sp_3) var(--sp_4);
  color: var(--text_secondary);
  border-bottom: 1px solid var(--color_border);
  background: var(--color_surface);
}
.table tr:hover td {
  background: var(--color_surface2);
}
.table tr:last-child td {
  border-bottom: none;
}

/* ── 14. Divider / Accent Line ─────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--color_border);
  margin-block: var(--sp_5);
}

.accent_bar {
  display: inline-block;
  width: 40px;
  height: 3px;
  background: var(--color_accent);
  border-radius: var(--radius_full);
  margin-bottom: var(--sp_3);
}

/* ── 15. Background utilities ──────────────────────────────── */
.bg_surface {
  background-color: var(--color_surface);
}
.bg_surface2 {
  background-color: var(--color_surface2);
}
.bg_dark {
  background-color: var(--color_bg);
}
.bg_primary {
  background-color: var(--color_primary);
}
.bg_accent {
  background-color: var(--color_accent);
}

/* ── 16. Spacing utilities ─────────────────────────────────── */
.mt_1 {
  margin-top: var(--sp_1);
}
.mt_2 {
  margin-top: var(--sp_2);
}
.mt_3 {
  margin-top: var(--sp_3);
}
.mt_4 {
  margin-top: var(--sp_4);
}
.mt_5 {
  margin-top: var(--sp_5);
}
.mt_6 {
  margin-top: var(--sp_6);
}
.mt_7 {
  margin-top: var(--sp_7);
}
.mt_8 {
  margin-top: var(--sp_8);
}

.mb_1 {
  margin-bottom: var(--sp_1);
}
.mb_2 {
  margin-bottom: var(--sp_2);
}
.mb_3 {
  margin-bottom: var(--sp_3);
}
.mb_4 {
  margin-bottom: var(--sp_4);
}
.mb_5 {
  margin-bottom: var(--sp_5);
}
.mb_6 {
  margin-bottom: var(--sp_6);
}
.mb_7 {
  margin-bottom: var(--sp_7);
}
.mb_8 {
  margin-bottom: var(--sp_8);
}

.py_5 {
  padding-block: var(--sp_5);
}
.py_6 {
  padding-block: var(--sp_6);
}
.py_7 {
  padding-block: var(--sp_7);
}
.py_8 {
  padding-block: var(--sp_8);
}
.px_4 {
  padding-inline: var(--sp_4);
}
.px_5 {
  padding-inline: var(--sp_5);
}

/* ── 17. Display / misc utilities ──────────────────────────── */
.hidden {
  display: none !important;
}
.block {
  display: block;
}
.inline_flex {
  display: inline-flex;
}
.w_full {
  width: 100%;
}
.max_w_prose {
  max-width: 65ch;
}
.overflow_hidden {
  overflow: hidden;
}
.relative {
  position: relative;
}

.rounded_sm {
  border-radius: var(--radius_sm);
}
.rounded_md {
  border-radius: var(--radius_md);
}
.rounded_lg {
  border-radius: var(--radius_lg);
}
.rounded_xl {
  border-radius: var(--radius_xl);
}
.rounded_full {
  border-radius: var(--radius_full);
}

/* ── 18. Accessibility ─────────────────────────────────────── */
.sr_only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

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

/* ── 19. Static page content section ───────────────────────── */
.page_content_section {
  padding-block: var(--sp_7);
  background: var(--color_surface);
}

.page_content_section .review_content {
  max-width: 800px;
}

/* ── 20. Review Content (rich text from DB / CMS) ──────────── */
.review_content h2 {
  font-size: var(--text_h3);
  font-weight: var(--fw_medium);
  color: var(--text_primary);
  padding-bottom: var(--sp_2);
  border-bottom: 2px solid var(--color_surface2);
  scroll-margin-top: 88px;
}

.review_content h3 {
  font-size: var(--text_body_lg);
  font-weight: var(--fw_medium);
  color: var(--text_primary);
}

.review_content h4 {
  font-size: var(--text_body);
  font-weight: var(--fw_medium);
  color: var(--text_primary);
}

.review_content p {
  color: var(--text_secondary);
  line-height: 1.75;
  margin-bottom: var(--sp_3);
}

.review_content ul,
.review_content ol {
  list-style: disc;
  padding-left: var(--sp_5);
  margin-bottom: var(--sp_3);
  display: flex;
  flex-direction: column;
  gap: var(--sp_2);
}

.review_content li {
  color: var(--text_secondary);
  font-size: var(--text_body);
  line-height: 1.6;
}

.review_content a {
  color: var(--color_primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.review_content a:hover {
  color: var(--color_primary_dark);
}

/* ── 20. Date Component ────────────────────────────────────── */
.date_component {
  display: inline-flex;
  align-items: center;
  gap: var(--sp_2);
  padding: var(--sp_2) var(--sp_3);
  background: var(--color_surface2);
  border: 1px solid var(--color_border);
  border-radius: var(--radius_sm);
}

.date_component i {
  color: var(--color_accent);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.date_component_label {
  font-size: var(--text_sm);
  font-weight: var(--fw_medium);
  color: var(--text_primary);
  line-height: 1;
}

.date_component_time {
  font-size: var(--text_sm);
  font-weight: var(--fw_medium);
  color: var(--text_primary);
  line-height: 1;
}

/* ── 21. Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}
