/* ═══════════════════════════════════════════════════════════
   responsive.css — ChatXB Shared Responsive System v37
   Breakpoints: 480px (xs), 640px (sm), 768px (md), 1024px (lg)
   ═══════════════════════════════════════════════════════════ */

/* ─── 0. Base Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; max-width: 100%; }
body { min-width: 320px; overflow-x: hidden; max-width: 100%; }
img, svg, video, canvas { max-width: 100%; height: auto; }

/* ─── 1. Hamburger Menu Button ─────────────────────────────── */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: none; border: none;
  cursor: pointer; padding: 8px;
  border-radius: 8px;
  color: var(--text, #fff);
  transition: background 0.2s;
  flex-shrink: 0;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.08); }
.hamburger-btn svg { width: 22px; height: 22px; stroke: currentColor; transition: all 0.25s ease; }
.hamburger-btn .icon-close { display: none; }
.hamburger-btn .icon-open  { display: block; }
.nav-open .hamburger-btn .icon-close { display: block; }
.nav-open .hamburger-btn .icon-open  { display: none; }

/* ─── 2. Page Navbar — Desktop ─────────────────────────────── */
.page-navbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: nowrap; }
.page-nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.page-nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ─── 3. Mobile Nav Overlay ────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger-btn { display: flex; }
  .page-nav-links {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg, #0b0e14); z-index: 9999;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 0; padding: 60px 24px 32px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none; opacity: 0; overflow-y: auto;
  }
  .nav-open .page-nav-links { transform: translateX(0); opacity: 1; pointer-events: auto; }
  .page-nav-links a {
    width: 100%; max-width: 360px; padding: 16px 20px;
    font-size: 18px; border-radius: 12px; text-align: center;
    border-bottom: 1px solid var(--line, #232a35);
  }
  .page-nav-links a:last-child { border-bottom: none; }
  .page-nav-actions { display: none; }
  .page-navbar { padding: 12px 16px !important; }
  .header-inner { flex-direction: row !important; align-items: center !important; gap: 8px !important; }
}

/* ─── 4. Page Container ────────────────────────────────────── */
@media (max-width: 1024px) { .page-container { margin: 30px auto; padding: 28px; } }
@media (max-width: 768px)  { .page-container { margin: 12px; padding: 20px 18px; border-radius: 10px; } }
@media (max-width: 480px)  { .page-container { margin: 8px; padding: 16px 14px; border-radius: 8px; } }

/* ─── 5. Fluid Typography ─────────────────────────────────── */
.page-header h1  { font-size: clamp(26px, 6vw, 46px); line-height: 1.15; }
.page-header p   { font-size: clamp(13px, 2vw, 15px); }
article h2       { font-size: clamp(20px, 4vw, 26px); }
article h3       { font-size: clamp(16px, 3vw, 20px); }
article p, article li { font-size: clamp(14px, 2.5vw, 16px); }

/* ─── 6. Hero Sections ──────────────────────────────────────── */
@media (max-width: 768px) {
  [class$="-hero"], .hero-section { padding: 28px 16px 16px !important; }
  [class$="-hero"] h1, .hero-section h1 { font-size: clamp(22px, 7vw, 34px) !important; }
  [class$="-hero"] p,  .hero-section p  { font-size: 14px !important; }
}

/* ─── 7. Card Grids → Mobile Stack ─────────────────────────── */
@media (max-width: 768px) {
  .cards-grid, .stories-grid, .comm-grid, .quiz-grid,
  .features-grid, .blog-grid, .status-grid, .how-to-grid,
  .games-grid, .icebreaker-list, .lang-grid, .location-grid,
  .slang-grid, .topic-grid {
    grid-template-columns: 1fr !important; gap: 14px !important;
  }
  .featured-post { grid-template-columns: 1fr !important; }
  .featured-post .blog-img { height: 180px !important; border-right: none !important; border-bottom: 1px solid var(--line) !important; }
}

/* ─── 8. Comparison Table → Scroll on Mobile ────────────────── */
.matrix-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.comparison-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
.comparison-table-wrap table { min-width: 540px; }
@media (max-width: 640px) {
  .matrix-table { font-size: 12px; }
  .matrix-table th, .matrix-table td { padding: 10px 8px !important; white-space: nowrap; }
  .matrix-card { border-radius: 10px; padding: 16px 12px; }
}

/* ─── 9. Accordion / Details ───────────────────────────────── */
details { border: 1px solid var(--line, #232a35); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
details[open] { background: var(--panel, #1e293b); }
details summary {
  cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 15px;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  user-select: none; color: var(--text, #fff); transition: color 0.2s;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--gold, #f59e0b); flex-shrink: 0; margin-left: 12px; }
details[open] summary::after { content: "−"; }
details summary:hover { color: var(--gold, #f59e0b); }
.faq-answer, details > div, details > p { padding: 4px 18px 16px; font-size: 14px; line-height: 1.7; color: var(--text-dim, #94a3b8); }
@media (max-width: 480px) {
  details summary { padding: 12px 14px; font-size: 14px; }
  .faq-answer, details > div, details > p { padding: 4px 14px 14px; font-size: 13px; }
}

/* ─── 10. Forms ─────────────────────────────────────────────── */
.contact-grid, .form-grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .contact-grid, .form-grid-2col { grid-template-columns: 1fr; gap: 14px; } }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-dim, #94a3b8); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; background: var(--surface, #131822); border: 1px solid var(--line, #232a35);
  border-radius: 8px; color: var(--text, #fff); font-size: 14px; padding: 12px 14px; min-height: 44px; transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--teal, #14b8a6); }

/* ─── 11. CTA Buttons ───────────────────────────────────────── */
@media (max-width: 480px) {
  .btn-gold, .btn-primary, .btn-cta { width: 100%; font-size: 14px; padding: 14px 20px; }
  .vs-cta-box, .cta-box { padding: 28px 16px !important; margin: 0 0 40px !important; }
}

/* ─── 12. Error Pages ───────────────────────────────────────── */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; text-align: center; padding: 40px 24px; }
.error-code { font-size: clamp(80px, 20vw, 160px); font-weight: 900; line-height: 1; }
.error-msg  { font-size: clamp(18px, 4vw, 28px); }

/* ─── 13. Spin / Canvas ─────────────────────────────────────── */
.spin-canvas-wrap canvas, canvas.spin-wheel { max-width: 100%; height: auto !important; display: block; margin: 0 auto; }

/* ─── 14. Tag / Badge Pills ─────────────────────────────────── */
.tag-group, .badges-wrap, .pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.competitor-selector-wrap, .pill-selector-wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0 8px; }
@media (max-width: 480px) {
  .comp-pill, .pill-btn { font-size: 13px !important; padding: 8px 14px !important; }
}

/* ─── 15. Footer Responsive ─────────────────────────────────── */
@media (max-width: 768px) { .global-footer { padding: 40px 16px 24px; } .footer-container { grid-template-columns: repeat(2,1fr) !important; gap: 24px !important; } }
@media (max-width: 480px) { .footer-container { grid-template-columns: 1fr !important; gap: 20px !important; } .footer-bottom { flex-direction: column !important; gap: 12px !important; text-align: center !important; } }

/* ─── 16. Touch Targets ─────────────────────────────────────── */
@media (max-width: 768px) {
  a, button, [role="button"], details summary { min-height: 44px; }
  input[type="checkbox"], input[type="radio"] { min-height: unset; width: 18px; height: 18px; }
}

/* ─── 17. Print ─────────────────────────────────────────────── */
@media print {
  .hamburger-btn, .page-nav-links, .global-footer, .cookie-consent-banner, .back-to-top-btn { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .page-container { background: #fff !important; border: none !important; box-shadow: none !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
}

/* ─── 18. site-header + main-nav (alternate nav pattern) ───── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

@media (max-width: 768px) {
  .site-header .header-inner {
    flex-direction: row !important;
    align-items: center !important;
  }

  .site-header .main-nav {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg, #0b0e14);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 60px 24px 32px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
    opacity: 0;
    overflow-y: auto;
    display: flex;
  }

  .nav-open .site-header .main-nav {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-header .main-nav a {
    width: 100%;
    max-width: 360px;
    padding: 16px 20px;
    font-size: 18px;
    border-radius: 12px;
    text-align: center;
    border-bottom: 1px solid var(--line, #232a35);
  }

  .site-header .main-nav a:last-child { border-bottom: none; }
  .site-header .header-actions { display: none; }
}
