/* =========================================================
   CasinoSchweiz.guide — Main Stylesheet v2
   Fix: sidebar overflow on desktop, horizontal scroll on mobile
   ========================================================= */

/* ---------- CSS Custom Properties ---------- */
:root {
  --gold:        #c9a84c;
  --gold-light:  #e8c97a;
  --dark:        #0f1117;
  --dark2:       #181c27;
  --dark3:       #1e2333;
  --card:        #232840;
  --text:        #e8eaf0;
  --text-muted:  #9ba3bc;
  --accent:      #3a7bd5;
  --accent2:     #00c9a7;
  --red:         #e05555;
  --border:      #2d3350;
  --radius:      10px;
  --content-max: 1140px;
  --sidebar-w:   280px;
  --page-pad:    20px;
}

/* ---------- Hard reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--dark);
  color: var(--text);
  line-height: 1.75;
  font-size: 17px;
  overflow-x: hidden;
  max-width: 100vw;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Site Header ---------- */
.site-header {
  background: #171c33;
  border-bottom: 2px solid var(--gold);
  padding: 14px 0 0;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 100%;
}

.header-inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-logo img {
  height: 48px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

.breadcrumb {
  font-size: 0.76rem;
  color: var(--text-muted);
  padding: 9px var(--page-pad) 11px;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--gold); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, #111525 0%, #1a2040 50%, #0f1320 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px var(--page-pad) 40px;
  text-align: center;
  width: 100%;
}

.hero-badge {
  display: inline-block;
  background: var(--gold);
  color: #000;
  font-size: 0.72rem;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  color: #fff;
  max-width: 820px;
  margin: 0 auto 16px;
  line-height: 1.3;
}
.hero h1 em { color: var(--gold); font-style: normal; }

.hero-sub {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 620px;
  margin: 0 auto 24px;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.dot-green {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent2);
  display: inline-block;
  flex-shrink: 0;
}

/* ---------- Author Bar ---------- */
.author-bar {
  background: var(--dark3);
  border-bottom: 1px solid var(--border);
  padding: 12px var(--page-pad);
  width: 100%;
}
.author-bar-inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}
.author-info { display: flex; flex-direction: column; gap: 2px; }
.author-name { font-size: 0.92rem; font-weight: bold; color: #fff; }
.author-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.author-meta span { display: flex; align-items: center; gap: 4px; }

/* ==========================================================
   PAGE LAYOUT — CORE FIX
   minmax(0,1fr) is critical: without the 0 minimum, the article
   cell ignores its boundaries and can overflow the grid.
   ========================================================== */
.page-wrap {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px var(--page-pad) 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--sidebar-w));
  gap: 28px;
  align-items: start;
}

article {
  min-width: 0;
  width: 100%;
}

/* ---------- Article Typography ---------- */
article h2 {
  font-size: clamp(1.2rem, 2.8vw, 1.5rem);
  color: #fff;
  margin: 44px 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: break-word;
}
article h3 {
  font-size: clamp(0.97rem, 2.2vw, 1.15rem);
  color: var(--gold-light);
  margin: 26px 0 10px;
  line-height: 1.4;
  overflow-wrap: break-word;
}
article h4 {
  font-size: 0.84rem;
  color: var(--text);
  font-weight: bold;
  margin: 16px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
article p {
  margin-bottom: 16px;
  overflow-wrap: break-word;
  word-break: break-word;
}
article ul, article ol { margin: 10px 0 16px 20px; }
article li { margin-bottom: 6px; overflow-wrap: break-word; }
article strong { color: #fff; }

/* ---------- Alert Boxes ---------- */
.alert-box {
  background: rgba(58,123,213,0.1);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 16px;
  margin: 20px 0;
  font-size: 0.91rem;
  overflow-wrap: break-word;
}
.alert-box.gold  { background: rgba(201,168,76,.1);  border-color: var(--gold);    }
.alert-box.green { background: rgba(0,201,167,.1);   border-color: var(--accent2); }
.alert-box.red   { background: rgba(224,85,85,.1);   border-color: var(--red);     }
.alert-label {
  font-size: 0.7rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 6px;
}
.alert-box.gold  .alert-label { color: var(--gold);    }
.alert-box.green .alert-label { color: var(--accent2); }
.alert-box.red   .alert-label { color: var(--red);     }

/* ---------- Casino Cards ---------- */
.casino-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  /* top margin makes space for the absolutely-positioned badge */
  margin-top: 18px;
  margin-bottom: 22px;
  position: relative;
  transition: border-color 0.2s;
  /* overflow must be visible so the badge isn't clipped */
  overflow: visible;
  min-width: 0;
}
.casino-card:hover    { border-color: var(--gold); }
.casino-card.top-pick { border-color: var(--gold); }

.top-badge {
  position: absolute;
  /* sits on top of the card border, centred vertically on it */
  top: -13px;
  left: 18px;
  background: var(--gold);
  color: #000;
  font-size: 0.68rem;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
  /* ensure it renders above siblings */
  z-index: 1;
}

.casino-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  min-width: 0;
}
.casino-name {
  font-size: clamp(1rem, 2.5vw, 1.22rem);
  color: #fff;
  font-weight: bold;
  overflow-wrap: break-word;
  min-width: 0;
  flex: 1;
}
.casino-rating {
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  text-align: center;
  min-width: 60px;
  flex-shrink: 0;
}
.rating-num   { font-size: 1.3rem; font-weight: bold; color: var(--gold); line-height: 1; }
.rating-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }

.casino-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag {
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 0.71rem;
  color: var(--text-muted);
}
.tag.highlight { border-color: var(--gold); color: var(--gold); }

.bonus-box {
  background: var(--dark3);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.bonus-amount { font-size: clamp(0.88rem,1.8vw,1.05rem); color: var(--gold); font-weight: bold; overflow-wrap: break-word; }
.bonus-detail { font-size: 0.79rem; color: var(--text-muted); overflow-wrap: break-word; }

.casino-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.86rem;
  min-width: 0;
}
.pros-list, .cons-list { list-style: none; margin: 0; padding: 0; }
.pros-list li, .cons-list li { padding-left: 20px; position: relative; margin-bottom: 5px; overflow-wrap: break-word; }
.pros-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent2); font-weight: bold; }
.cons-list li::before { content: "✗"; position: absolute; left: 0; color: var(--red); font-weight: bold; }

.casino-meta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.79rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
  min-width: 0;
}
.casino-meta-row span { overflow-wrap: break-word; min-width: 0; }
.casino-meta-row span strong { color: var(--text); }

.ideal-for {
  background: rgba(0,201,167,.08);
  border: 1px solid rgba(0,201,167,.25);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.79rem;
  color: var(--accent2);
  margin-top: 10px;
  display: inline-block;
  overflow-wrap: break-word;
}
.cta-btn {
  display: inline-block;
  margin-top: 12px;
  background: linear-gradient(135deg,#c9a84c,#e8c97a);
  color: #000;
  font-weight: bold;
  font-size: 0.84rem;
  padding: 9px 22px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.cta-btn:hover { opacity: 0.9; text-decoration: none; }

/* ---------- Tables ---------- */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  min-width: 500px;
}
thead th {
  background: var(--dark3);
  color: var(--gold);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 10px 12px;
  text-align: left;
  font-weight: bold;
  border-bottom: 2px solid var(--gold);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.03); }
tbody td { padding: 10px 12px; vertical-align: middle; overflow-wrap: break-word; }
tbody tr.highlight-row td { background: rgba(201,168,76,.07); }
.td-gold  { color: var(--gold);      font-weight: bold; }
.td-green { color: var(--accent2);   font-weight: bold; }
.td-muted { color: var(--text-muted); font-size: 0.79rem; }
.badge-mga { background: rgba(58,123,213,.2);  color: #7abaff;       font-size: 0.69rem; padding: 2px 6px; border-radius: 4px; }
.badge-cur { background: rgba(0,201,167,.15);  color: var(--accent2); font-size: 0.69rem; padding: 2px 6px; border-radius: 4px; }

/* ---------- Bonus Grid ---------- */
.bonus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
  gap: 12px;
  margin: 16px 0;
  min-width: 0;
}
.bonus-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}
.bonus-tile-icon { font-size: 1.7rem; margin-bottom: 8px; }
.bonus-tile h4   { color: var(--gold-light); font-size: 0.85rem; margin-bottom: 6px; text-transform: none; letter-spacing: 0; }
.bonus-tile p    { font-size: 0.77rem; color: var(--text-muted); margin: 0; }

/* ---------- Quick Top List ---------- */
.top-list-quick {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0 26px;
  min-width: 0;
}
.top-list-quick-header {
  background: var(--dark3);
  padding: 10px 16px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  font-weight: bold;
}
.quick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  flex-wrap: wrap;
  min-width: 0;
}
.quick-item:last-child  { border-bottom: none; }
.quick-rank             { font-weight: bold; color: var(--text-muted); width: 18px; flex-shrink: 0; }
.quick-rank.gold-rank   { color: var(--gold); }
.quick-name             { flex: 1; color: #fff; font-weight: bold; min-width: 80px; }
.quick-bonus            { color: var(--gold); font-size: 0.79rem; }
.quick-tag              { font-size: 0.69rem; color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; white-space: nowrap; }

/* ---------- Licence Tiers ---------- */
.lic-tier {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.69rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tier1 { background: rgba(0,201,167,.15);  color: var(--accent2); }
.tier2 { background: rgba(58,123,213,.15); color: #7abaff; }
.tier3 { background: rgba(224,85,85,.12);  color: #e08888; }

/* ---------- Steps ---------- */
.steps { margin: 16px 0; }
.step-item { display: flex; gap: 12px; margin-bottom: 14px; align-items: flex-start; }
.step-num {
  background: var(--gold);
  color: #000;
  font-weight: bold;
  font-size: 0.8rem;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 3px;
}
.step-content { min-width: 0; }
.step-content h4 { color: #fff; margin-bottom: 3px; font-size: 0.91rem; text-transform: none; letter-spacing: 0; }
.step-content p  { font-size: 0.84rem; color: var(--text-muted); margin: 0; }

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  min-width: 0;
}
.faq-q {
  padding: 14px 16px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  user-select: none;
  gap: 10px;
}
.faq-icon {
  font-size: 1.1rem;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform 0.25s ease;
  line-height: 1;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-a {
  display: none;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  overflow-wrap: break-word;
}
.faq-item.open .faq-a { display: block; }

/* ---------- Utility ---------- */
.check-list { list-style: none; margin: 0 0 14px; padding: 0; }
.check-list li { padding: 4px 0 4px 22px; position: relative; font-size: 0.9rem; overflow-wrap: break-word; }
.check-list li::before { content: '✓'; position: absolute; left: 0; color: var(--accent2); font-weight: bold; }

.warn-list { list-style: none; margin: 0 0 14px; padding: 0; }
.warn-list li { padding: 4px 0 4px 22px; position: relative; font-size: 0.9rem; }
.warn-list li::before { content: '⚠'; position: absolute; left: 0; color: var(--gold); }

.section-intro {
  font-size: 0.98rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  border-left: 3px solid var(--gold);
  padding-left: 13px;
  overflow-wrap: break-word;
}
.divider { border: none; border-top: 1px solid var(--border); margin: 30px 0; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 76px;
  min-width: 0;
  overflow: hidden;
}
.sidebar-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  overflow: hidden;
  min-width: 0;
}
.sidebar-box h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 11px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
.sidebar-toc { list-style: none; margin: 0; padding: 0; }
.sidebar-toc li { margin-bottom: 5px; font-size: 0.8rem; }
.sidebar-toc a { color: var(--text-muted); }
.sidebar-toc a:hover { color: var(--gold); text-decoration: none; }
.toc-active { color: var(--gold) !important; font-weight: bold; }

.sidebar-casino {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  gap: 8px;
  min-width: 0;
}
.sidebar-casino:last-child { border-bottom: none; }
.sidebar-casino-name  { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-casino-bonus { color: var(--gold); font-size: 0.72rem; white-space: nowrap; flex-shrink: 0; }

.resp-warning {
  background: rgba(224,85,85,.08);
  border: 1px solid rgba(224,85,85,.3);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.76rem;
  color: #e0a0a0;
  line-height: 1.55;
}

/* ---------- Footer ---------- */
footer {
  background: var(--dark2);
  border-top: 2px solid var(--border);
  padding: 26px 20px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.7;
  width: 100%;
}
footer p { max-width: 800px; margin: 0 auto 8px; }
footer strong { color: var(--text); }

/* ==========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================== */

/* Shrink sidebar when viewport gets tight */
@media (max-width: 1060px) {
  :root {
    --sidebar-w: 230px;
    --page-pad:  16px;
  }
}

/* Collapse to single column at 900px */
@media (max-width: 900px) {
  .page-wrap {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px var(--page-pad) 48px;
  }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    overflow: visible;
  }
  .sidebar .sidebar-box { margin-bottom: 0; }
  .sidebar .resp-warning { grid-column: 1 / -1; }
}

/* Mobile */
@media (max-width: 640px) {
  :root { --page-pad: 14px; }
  body { font-size: 15px; }
  .site-logo img { height: 36px; }
  .hero { padding: 28px var(--page-pad) 26px; }
  .hero-meta { gap: 8px; font-size: 0.71rem; }
  .author-bar { padding: 10px var(--page-pad); }
  .author-avatar { width: 40px; height: 40px; }
  .author-meta { gap: 8px; font-size: 0.72rem; }
  .casino-pros-cons { grid-template-columns: 1fr; }
  .quick-item  { flex-wrap: wrap; gap: 4px; padding: 10px 14px; }
  .quick-bonus { width: 100%; padding-left: 28px; }
  .quick-tag   { display: none; }
  .bonus-box   { flex-direction: column; align-items: flex-start; gap: 5px; }
  .sidebar     { grid-template-columns: 1fr; }
  article h2   { margin-top: 30px; }
  .casino-card { padding: 16px; margin-top: 18px; }
}

/* Very small */
@media (max-width: 380px) {
  body { font-size: 14px; }
  .hero h1 { font-size: 1.25rem; }
  .cta-btn { display: block; text-align: center; }
  .casino-meta-row { flex-direction: column; gap: 4px; }
}
