/* ==========================================================
   BLACKJACK GUIDE  —  /casino-games/blackjack
   All classes prefixed  bjg-
   ========================================================== */

:root {
  --bjg-border: rgba(17,24,39,0.10);
  --bjg-shadow: 0 2px 8px rgba(17,24,39,0.04);
  --bjg-shadow-lg: 0 8px 24px rgba(17,24,39,0.10);
  --bjg-surface: #fff;
  --bjg-soft: #F3F6FC;
  --bjg-text: rgba(17,24,39,0.72);
  --bjg-title: #111827;
  --bjg-accent: #055A78;
  --bjg-accent-light: #0AA6D6;
  --bjg-radius: 14px;

  /* Strategy chart cell colors */
  --bjg-hit:    #E8F5E9;  --bjg-hit-t:    #2E7D32;
  --bjg-stand:  #FFF3E0;  --bjg-stand-t:  #E65100;
  --bjg-double: #E3F2FD;  --bjg-double-t: #055A78;
  --bjg-split:  #F3E5F5;  --bjg-split-t:  #6A1B9A;
  --bjg-sur:    #FFEBEE;  --bjg-sur-t:    #C62828;
}

/* ---------- Container ---------- */
.bjg-container { max-width: 1260px; margin: 0 auto; padding: 0 32px; }

/* ==========================================================
   HERO
   ========================================================== */
.bjg-hero { padding: 28px 0 18px; }

.bjg-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(5,90,120,0.08); color: var(--bjg-accent);
  font-weight: 700; font-size: 0.82rem;
  margin-bottom: 10px;
}

.bjg-title {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  font-weight: 900; color: var(--bjg-title);
  margin: 0 0 10px; line-height: 1.25;
}

.bjg-sub {
  color: var(--bjg-text); font-size: 0.95rem;
  line-height: 1.65; max-width: 720px; margin: 0 0 14px;
}

.bjg-hero-stats {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px;
}

.bjg-stat-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--bjg-soft); border: 1px solid var(--bjg-border);
  font-size: 0.82rem; font-weight: 600; color: var(--bjg-title);
}
.bjg-stat-pill i { color: var(--bjg-accent); font-size: 0.78rem; }

/* Category pills */
.bjg-cats { display: flex; gap: 8px; flex-wrap: wrap; }

.bjg-cat-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 0.85rem;
  color: rgba(17,24,39,0.60); border: 1px solid var(--bjg-border);
  background: var(--bjg-surface);
  transition: background .15s, border-color .15s, color .15s;
}
.bjg-cat-pill:hover { background: rgba(5,90,120,0.06); color: var(--bjg-accent); border-color: rgba(5,90,120,0.18); }
.bjg-cat-pill.active { background: rgba(5,90,120,0.08); color: var(--bjg-accent); border-color: rgba(5,90,120,0.25); }

/* ==========================================================
   ANCHOR NAV  (sticky)
   ========================================================== */
.bjg-nav {
  position: sticky; top: 0; z-index: 50;
  padding: 10px 0 6px;
  background: rgba(245,247,251,0.95);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bjg-border);
}

.bjg-nav-pills {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 6px 8px; border-radius: var(--bjg-radius);
  border: 1px solid var(--bjg-border);
  background: rgba(245,247,251,0.90);
  scrollbar-width: none;
}
.bjg-nav-pills::-webkit-scrollbar { display: none; }

.bjg-pill {
  display: inline-flex; align-items: center;
  padding: 7px 13px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 0.84rem;
  color: rgba(17,24,39,0.55); border: 1px solid transparent;
  white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.bjg-pill:hover,
.bjg-pill.active {
  background: rgba(5,90,120,0.08);
  border-color: rgba(5,90,120,0.22);
  color: var(--bjg-accent);
}

/* ==========================================================
   BODY  —  article + sidebar grid
   ========================================================== */
.bjg-body { padding: 18px 0 48px; }

.bjg-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px; align-items: start;
}

/* ---------- Left (article) ---------- */
.bjg-left { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Right (sidebar) ---------- */
.bjg-right { position: relative; }

.bjg-sticky {
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: 14px;
}

.bjg-quick-facts {
  background: var(--bjg-surface); border: 1px solid var(--bjg-border);
  border-radius: var(--bjg-radius); box-shadow: var(--bjg-shadow);
  padding: 18px 20px;
}
.bjg-sidebar-title {
  font-size: 0.92rem; font-weight: 800; color: var(--bjg-title);
  margin-bottom: 10px;
}
.bjg-quick-facts ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.bjg-quick-facts li {
  font-size: 0.88rem; color: var(--bjg-text); line-height: 1.5;
}
.bjg-quick-facts li strong { color: var(--bjg-title); }

.bjg-sidebar-cta {
  display: flex; flex-direction: column; gap: 8px;
}
.bjg-chart-link {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 10px;
  background: var(--bjg-accent); color: #fff;
  font-weight: 700; font-size: 0.85rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(5,90,120,0.18);
  transition: background .2s, box-shadow .2s, transform .2s;
}
.bjg-chart-link:hover {
  background: var(--bjg-accent-light);
  box-shadow: 0 8px 22px rgba(5,90,120,0.25);
  transform: translateY(-2px);
}
.bjg-print-btn-small {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px;
  background: var(--bjg-surface); color: var(--bjg-accent);
  font-weight: 700; font-size: 0.85rem;
  border: 1px solid rgba(5,90,120,0.25); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.bjg-print-btn-small:hover {
  background: rgba(5,90,120,0.06);
  border-color: rgba(5,90,120,0.40);
}

/* ==========================================================
   CONTENT CARDS
   ========================================================== */
.bjg-card {
  background: var(--bjg-surface);
  border: 1px solid var(--bjg-border);
  border-radius: var(--bjg-radius);
  box-shadow: var(--bjg-shadow);
  padding: 24px 26px;
}

.bjg-card h2 {
  margin: 0 0 14px; font-size: 1.2rem; font-weight: 900;
  color: var(--bjg-accent);
  display: flex; align-items: center; gap: 10px;
}
.bjg-card h2 i { font-size: 0.95rem; }

.bjg-card h3 {
  margin: 22px 0 10px; font-size: 1rem; font-weight: 800;
  color: var(--bjg-title);
}

.bjg-card p {
  margin: 0 0 12px; line-height: 1.75;
  color: var(--bjg-text); font-size: 0.95rem;
}

.bjg-card ul, .bjg-card ol {
  margin: 0 0 14px; padding-left: 22px;
  color: var(--bjg-text); font-size: 0.95rem; line-height: 1.75;
}
.bjg-card li { margin-bottom: 6px; }

/* Steps (ordered list for rules) */
.bjg-steps { counter-reset: step; list-style: none; padding-left: 0; }
.bjg-steps li {
  counter-increment: step; position: relative;
  padding-left: 36px; margin-bottom: 12px;
}
.bjg-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(5,90,120,0.10); color: var(--bjg-accent);
  font-weight: 800; font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
}

/* Callout */
.bjg-callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 10px;
  background: rgba(5,90,120,0.05);
  border-left: 3px solid var(--bjg-accent);
  margin: 14px 0;
}
.bjg-callout i { color: var(--bjg-accent); margin-top: 2px; flex-shrink: 0; }
.bjg-callout div { font-size: 0.9rem; line-height: 1.65; color: var(--bjg-text); }
.bjg-callout strong { color: var(--bjg-title); }

/* Card values grid */
.bjg-value-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin: 12px 0;
}
.bjg-value-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--bjg-soft); border: 1px solid var(--bjg-border);
}
.bjg-value-icon {
  font-size: 1.3rem; font-weight: 900; color: var(--bjg-accent);
  min-width: 36px; text-align: center;
}
.bjg-value-label { font-size: 0.88rem; color: var(--bjg-text); font-weight: 600; }
.bjg-value-label strong { color: var(--bjg-title); display: block; font-size: 0.95rem; }

/* ==========================================================
   STRATEGY CHART
   ========================================================== */
.bjg-chart-actions {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
  align-items: center;
}

.bjg-print-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  background: var(--bjg-accent); color: #fff;
  font-weight: 800; font-size: 0.85rem;
  border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(5,90,120,0.18);
  transition: all 0.2s;
  text-decoration: none;
}
.bjg-print-btn:hover {
  background: var(--bjg-accent-light);
  box-shadow: 0 8px 22px rgba(5,90,120,0.25);
  transform: translateY(-2px);
}

/* Color key */
.bjg-chart-key {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px;
}
.bjg-key {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  font-weight: 700; font-size: 0.8rem;
  border: 1px solid transparent;
}
.bjg-key-h  { background: var(--bjg-hit);    color: var(--bjg-hit-t);    border-color: rgba(46,125,50,0.18); }
.bjg-key-s  { background: var(--bjg-stand);  color: var(--bjg-stand-t);  border-color: rgba(230,81,0,0.18); }
.bjg-key-d  { background: var(--bjg-double); color: var(--bjg-double-t); border-color: rgba(5,90,120,0.18); }
.bjg-key-p  { background: var(--bjg-split);  color: var(--bjg-split-t);  border-color: rgba(106,27,154,0.18); }
.bjg-key-r  { background: var(--bjg-sur);    color: var(--bjg-sur-t);    border-color: rgba(198,40,40,0.18); }

/* Chart image */
.bjg-chart-img-wrap {
  margin: 16px auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--bjg-border);
  box-shadow: var(--bjg-shadow);
  max-width: 560px;
}
.bjg-chart-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Table wrapper — horizontal scroll on mobile (kept for fallback) */
.bjg-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 10px 0 22px; border-radius: 10px;
  border: 1px solid var(--bjg-border);
}
.bjg-table-wrap::-webkit-scrollbar { height: 6px; }
.bjg-table-wrap::-webkit-scrollbar-thumb { background: rgba(17,24,39,0.15); border-radius: 3px; }

/* Chart table */
.bjg-chart {
  width: 100%; border-collapse: collapse;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.88rem; min-width: 540px;
}
.bjg-chart th,
.bjg-chart td {
  padding: 10px 6px; text-align: center;
  font-weight: 700; border: 1px solid rgba(17,24,39,0.06);
}
.bjg-chart thead th {
  background: var(--bjg-accent); color: #fff;
  font-weight: 800; font-size: 0.82rem;
  letter-spacing: 0.3px;
}
.bjg-chart thead th:first-child {
  background: #044A64; text-align: left; padding-left: 12px;
}

/* Section header rows (Hard Totals, Soft Totals etc.) */
.bjg-section-header td {
  background: var(--bjg-soft) !important;
  color: var(--bjg-title) !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center !important;
  padding: 8px !important;
}

/* Row label (hand value) */
.bjg-rl {
  background: var(--bjg-soft) !important;
  color: var(--bjg-title) !important;
  font-weight: 800 !important;
  text-align: left !important;
  padding-left: 12px !important;
  white-space: nowrap;
}

/* Cell action colors */
.bjg-h  { background: var(--bjg-hit);    color: var(--bjg-hit-t); }
.bjg-s  { background: var(--bjg-stand);  color: var(--bjg-stand-t); }
.bjg-d  { background: var(--bjg-double); color: var(--bjg-double-t); }
.bjg-ds { background: var(--bjg-double); color: var(--bjg-double-t); opacity: 0.75; }
.bjg-p  { background: var(--bjg-split);  color: var(--bjg-split-t); }
.bjg-pn { background: var(--bjg-split);  color: var(--bjg-split-t); opacity: 0.70; }
.bjg-r  { background: var(--bjg-sur);    color: var(--bjg-sur-t); }
.bjg-n  { background: #F3F4F6; color: #6B7280; }

/* Footnote */
.bjg-chart-note {
  font-size: 0.82rem; color: rgba(17,24,39,0.50);
  margin: 6px 0 0; line-height: 1.55;
}

/* ==========================================================
   GAME GRID
   ========================================================== */
.bjg-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; margin-top: 14px;
}

.bjg-game-card {
  background: var(--bjg-surface); border: 1px solid var(--bjg-border);
  border-radius: var(--bjg-radius); box-shadow: var(--bjg-shadow);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.bjg-game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--bjg-shadow-lg);
}

.bjg-game-img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover;
  border-bottom: 1px solid var(--bjg-border);
}

.bjg-game-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }

.bjg-game-name { font-weight: 800; font-size: 0.95rem; color: var(--bjg-title); margin-bottom: 4px; }
.bjg-game-provider { font-size: 0.82rem; color: rgba(17,24,39,0.50); margin-bottom: 10px; }

.bjg-game-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bjg-game-stat {
  font-size: 0.78rem; padding: 4px 8px; border-radius: 6px;
  background: var(--bjg-soft); border: 1px solid var(--bjg-border);
  color: var(--bjg-text); font-weight: 600;
}
.bjg-game-stat span { color: var(--bjg-accent); font-weight: 700; }

.bjg-game-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 8px; margin-top: auto;
  background: var(--bjg-accent); color: #fff;
  font-weight: 700; font-size: 0.84rem; text-decoration: none;
  transition: background .15s;
}
.bjg-game-cta:hover { background: var(--bjg-accent-light); }

/* ==========================================================
   FAQ ACCORDION
   ========================================================== */
.bjg-faq-list { display: flex; flex-direction: column; gap: 8px; }

.bjg-faq-item {
  border: 1px solid var(--bjg-border); border-radius: 10px;
  overflow: hidden;
}
.bjg-faq-item summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; cursor: pointer;
  font-weight: 700; font-size: 0.92rem; color: var(--bjg-title);
  list-style: none; background: var(--bjg-surface);
  transition: background .15s;
}
.bjg-faq-item summary::-webkit-details-marker { display: none; }
.bjg-faq-item summary:hover { background: var(--bjg-soft); }

.bjg-faq-chevron {
  transition: transform .2s; font-size: 0.75rem; color: rgba(17,24,39,0.40);
}
.bjg-faq-item[open] .bjg-faq-chevron { transform: rotate(180deg); }

.bjg-faq-answer {
  padding: 0 16px 14px; font-size: 0.9rem;
  color: var(--bjg-text); line-height: 1.7;
}

/* ==========================================================
   TIPS LIST
   ========================================================== */
.bjg-tips-list { list-style: none; padding: 0; margin: 0; }
.bjg-tips-list li {
  position: relative; padding: 10px 0 10px 32px;
  border-bottom: 1px solid var(--bjg-border);
  font-size: 0.92rem; color: var(--bjg-text); line-height: 1.65;
}
.bjg-tips-list li:last-child { border-bottom: none; }
.bjg-tips-list li::before {
  content: "\f0eb"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  position: absolute; left: 0; top: 11px;
  color: var(--bjg-accent); font-size: 0.85rem;
}
.bjg-tips-list li strong { color: var(--bjg-title); }

/* ==========================================================
   VARIANTS GRID
   ========================================================== */
.bjg-variant-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px; margin-top: 12px;
}
.bjg-variant-item {
  padding: 14px 16px; border-radius: 10px;
  background: var(--bjg-soft); border: 1px solid var(--bjg-border);
}
.bjg-variant-item h4 {
  margin: 0 0 6px; font-size: 0.92rem; font-weight: 800; color: var(--bjg-title);
}
.bjg-variant-item p {
  margin: 0; font-size: 0.85rem; color: var(--bjg-text); line-height: 1.6;
}

/* ==========================================================
   CONTENT LINKS
   ========================================================== */
.bjg-card a:not(.bjg-game-cta):not(.bjg-print-btn) {
  color: var(--bjg-accent); text-decoration: underline;
  text-underline-offset: 2px;
}
.bjg-card a:not(.bjg-game-cta):not(.bjg-print-btn):hover { color: var(--bjg-accent-light); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 980px) {
  .bjg-shell { grid-template-columns: 1fr; }
  .bjg-right { display: none; }
  .bjg-container { padding: 0 20px; }
}

@media (max-width: 640px) {
  .bjg-container { padding: 0 14px; }
  .bjg-card { padding: 18px 16px; }
  .bjg-title { font-size: 1.5rem; }
  .bjg-value-grid { grid-template-columns: 1fr; }
  .bjg-variant-grid { grid-template-columns: 1fr; }
  .bjg-game-grid { grid-template-columns: 1fr; }
  .bjg-hero-stats { gap: 6px; }
}

/* ==========================================================
   PRINT  —  isolate strategy chart on one page
   ========================================================== */
@page { margin: 10mm; }

@media print {
  /* Force color printing for SVG backgrounds */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* Hide EVERYTHING by default */
  body > * { display: none !important; }

  /* Show only the main content area */
  body > main.bjg-body { display: block !important; }

  /* Inside main, hide sidebar and non-chart cards */
  .bjg-right { display: none !important; }
  .bjg-left > .bjg-card:not(.bjg-chart-section) { display: none !important; }

  /* Hide elements inside the chart section we don't need */
  .bjg-chart-actions { display: none !important; }
  .bjg-callout { display: none !important; }

  /* Reset layout so it doesn't use grid */
  .bjg-body { padding: 0 !important; margin: 0 !important; min-height: 0 !important; }
  .bjg-shell { display: block !important; padding: 0 !important; margin: 0 !important; }
  .bjg-container { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .bjg-left { padding: 0 !important; margin: 0 !important; }

  /* Chart section: no decoration */
  .bjg-chart-section {
    border: none !important; box-shadow: none !important;
    padding: 0 !important; margin: 0 !important;
    page-break-inside: avoid !important;
  }

  /* Chart image: fit within one page */
  .bjg-chart-img-wrap {
    border: none !important; box-shadow: none !important;
    background: none !important; padding: 0 !important;
    max-width: none !important; margin: 0 !important;
  }
  .bjg-chart-img {
    width: auto !important;
    max-width: 100% !important;
    max-height: 85vh !important;
    display: block !important;
  }

  .bjg-chart-section h2 {
    font-size: 14px !important; color: #055A78 !important;
    margin: 0 0 4px !important; padding: 0 !important;
  }
  .bjg-chart-note {
    font-size: 8px !important; margin: 4px 0 0 !important;
  }
}
