/* main.css — Colordle Answers V5 Final */
:root {
  --default-font:   "Roboto", system-ui, sans-serif;
  --heading-font:   "Raleway", sans-serif;
  --nav-font:       "Poppins", sans-serif;
  --bg:             #2F4F4F;
  --bg-dark:        #243d3d;
  --bg-card:        #3a5c5c;
  --bg-card-hover:  #426868;
  --border:         rgba(255,255,255,.12);
  --text:           #ffffff;
  --text-muted:     rgba(255,255,255,.65);
  --text-faint:     rgba(255,255,255,.4);
  --accent:         #ef4444;
  --heading-color:  #ffffff;
  scroll-behavior: smooth;
}

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

/* CRITICAL: prevent horizontal scroll everywhere */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}
body {
  overflow-x: hidden;
  width: 100%;
  color: var(--text);
  background-color: var(--bg);
  font-family: var(--default-font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative; /* needed so fixed children don't escape */
}

/* Every direct section/container clips its own overflow */
section, .header, .footer {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

/* Bootstrap row uses negative margins — keep them inside containers */
.container, .container-fluid {
  padding-left: 16px;
  padding-right: 16px;
}
@media (min-width: 576px) {
  .container, .container-fluid { padding-left: 20px; padding-right: 20px; }
}

img { max-width: 100%; height: auto; display: block; }
a   { color: #fff; text-decoration: none; transition: .3s; }
a:hover { color: rgba(255,255,255,.75); }
h1,h2,h3,h4,h5,h6 { color: var(--heading-color); font-family: var(--heading-font); }
p  { color: var(--text); }
.text-muted    { color: var(--text-muted) !important; }
.text-dark     { color: #fff !important; }
.text-secondary{ color: var(--text-muted) !important; }

/* ── Header / Navbar ── */
.header {
  background: var(--bg-dark);
  padding: 10px 0;
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
  z-index: 997;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  width: 100%;
}
.header .logo img { max-height: 44px; width: auto; }
.header .sitename {
  font-size: clamp(.95rem, 2.5vw, 1.2rem);
  font-weight: 800; color: #fff;
  font-family: var(--heading-font); margin: 0;
}
.navmenu ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 2px; align-items: center;
}
.navmenu ul li a {
  font-family: var(--nav-font); font-size: .88rem; font-weight: 500;
  padding: 6px 14px; border-radius: 6px; color: rgba(255,255,255,.85);
  display: block; transition: .2s; white-space: nowrap;
}
.navmenu ul li a:hover,
.navmenu ul li a.active { color: #fff; background: rgba(255,255,255,.1); }
.mobile-nav-toggle {
  display: none; font-size: 1.4rem;
  cursor: pointer; color: #fff; padding: 4px; line-height: 1;
  background: none; border: none;
}

/* ── Buttons ── */
.btn-get-started {
  display: inline-flex; align-items: center; justify-content: center;
  background: #ffffff; color: #111 !important;
  padding: .65rem 1.5rem; border-radius: 50px;
  font-family: var(--nav-font); font-size: .9rem; font-weight: 700;
  transition: .25s; border: 2px solid #fff; text-decoration: none;
  white-space: nowrap; gap: .4rem; cursor: pointer;
  flex-shrink: 0;
}
.btn-get-started:hover { background: #f0f0f0; border-color: #f0f0f0; color: #111 !important; }
.btn-outline-started {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .65rem 1.5rem; border-radius: 50px;
  border: 2px solid rgba(255,255,255,.55); color: #fff !important;
  font-family: var(--nav-font); font-size: .9rem; font-weight: 600;
  background: transparent; text-decoration: none; transition: .25s;
  white-space: nowrap; gap: .4rem; cursor: pointer; flex-shrink: 0;
}
.btn-outline-started:hover { background: rgba(255,255,255,.15); border-color: #fff; }

/* ── Sections ── */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-dark); }
.section-title { text-align: center; padding-bottom: 32px; }
.section-title h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; color: #fff; margin-bottom: .5rem; }
.section-title p  { color: var(--text-muted); font-size: .95rem; margin: 0; }

/* ─────────────────────────────────────────────
   STICKY IMAGE — Hero section layout
   The left content column can grow (guide opens).
   The right image stays in view using sticky.
   ───────────────────────────────────────────── */

/* Row must use flex-start so sticky child works */
.hero-answer-row {
  align-items: flex-start !important;
}

/* Hero section: allow enough height for sticky + do NOT clip */
.hero-section-main {
  /* no overflow:hidden — that would break sticky */
  padding: 56px 0 48px;
}

/* Image column: sticky on desktop only */
@media (min-width: 992px) {
  .hero-img-col {
    position: sticky;
    top: 70px;          /* just below the fixed header */
    align-self: flex-start;
    z-index: 1;
  }
}

/* ── Content cards ── */
.content-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; color: #fff;
  transition: transform .25s, box-shadow .25s; height: 100%;
}
.content-card:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.content-card h3 { color: #fff; font-size: 1.05rem; margin-bottom: .6rem; }
.content-card p  { color: var(--text-muted); font-size: .88rem; margin: 0; }

/* ── Archive cards ── */
.archive-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; height: 100%;
  transition: transform .25s, box-shadow .25s;
}
.archive-card-link:hover .archive-card { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.archive-card-link { text-decoration: none; color: inherit; display: block; height: 100%; }
/* ── Archive card image ── */
.archive-img-wrap {
  width: 100%; height: 140px;
  overflow: hidden; position: relative;
  background: var(--bg-card);
}
.archive-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .35s ease;
}
.archive-card-link:hover .archive-img { transform: scale(1.04); }
/* Small colour pip in bottom-right corner */
.archive-color-pip {
  position: absolute; bottom: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  display: block; flex-shrink: 0;
}
.archive-card-body { padding: .9rem 1.1rem 1.1rem; }
.archive-card-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: .35rem; gap: 6px; flex-wrap: wrap; }
.archive-date       { font-size: .74rem; color: var(--text-faint); }
.archive-puzzle-num { font-size: .72rem; font-weight: 700; color: var(--accent); background: rgba(239,68,68,.15); padding: 2px 8px; border-radius: 4px; }
.archive-card-title { font-size: .87rem; font-weight: 600; color: #fff; line-height: 1.35; margin-bottom: .45rem; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.archive-color-badge { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-muted); flex-wrap: wrap; min-width: 0; overflow: hidden; }
.archive-color-dot { width: 16px; height: 16px; min-width: 16px; border-radius: 4px; border: 1px solid rgba(255,255,255,.1); flex-shrink: 0; }

/* ── About feature boxes ── */
.about-feature-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px;
  display: flex; gap: 12px; align-items: flex-start;
  height: 100%;
}
.about-icon {
  width: 42px; height: 42px; min-width: 42px; border-radius: 11px;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}
.about-feature-box h5 {
  color: #fff; font-size: .88rem; margin-bottom: 4px; font-weight: 700;
  line-height: 1.3; word-break: break-word;
}
.about-feature-box p {
  color: rgba(255,255,255,.65); font-size: .8rem;
  margin: 0; line-height: 1.5; word-break: break-word; overflow-wrap: break-word;
}

/* ── CTA strip ── */
.cta-card {
  background: linear-gradient(135deg, #243d3d 0%, #1a3030 100%);
  border: 1px solid rgba(255,255,255,.15); color: #fff;
  border-radius: 24px; padding: 3rem 2.5rem;
  box-shadow: 0 12px 40px rgba(0,0,0,.3); text-align: center;
}
.cta-card h2 { color: #fff; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; margin-bottom: .75rem; }
.cta-card p  { color: rgba(255,255,255,.75); max-width: 560px; margin: 0 auto 1.5rem; }

/* ── FAQ ── */
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.faq-q {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 15px 18px; cursor: pointer; font-weight: 600;
  font-size: .91rem; color: #fff; user-select: none; transition: background .2s;
  gap: 12px; line-height: 1.4;
}
.faq-q:hover { background: var(--bg-card-hover); }
.faq-q i { transition: transform .3s; flex-shrink: 0; color: var(--accent); margin-top: 2px; }
.faq-item.open .faq-q i { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 18px 15px; font-size: .88rem; color: var(--text-muted); line-height: 1.7; overflow-wrap: break-word; }
.faq-item.open .faq-a { display: block; }

/* ── Game guide steps ── */
.guide-step {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px;
}
.guide-step-num {
  width: 36px; height: 36px; min-width: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .95rem; flex-shrink: 0;
}
.guide-step h4 { color: #fff; font-size: .92rem; margin-bottom: 3px; }
.guide-step p  { color: var(--text-muted); font-size: .85rem; margin: 0; overflow-wrap: break-word; }

/* ── Inline guide panel ── */
.full-guide-panel {
  display: none; margin-top: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 22px;
  overflow-wrap: break-word; word-break: break-word;
  animation: fadeSlideDown .3s ease;
}
.full-guide-panel.open { display: block; }
@keyframes fadeSlideDown { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }
.full-guide-panel h2, .full-guide-panel h3 { color: #fff; }
.full-guide-panel p, .full-guide-panel li { color: var(--text-muted); }

/* ── Prev/next nav ── */
.pn-link {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; transition: .25s;
  color: #fff; text-decoration: none; overflow-wrap: break-word; min-width: 0;
}
.pn-link:hover { background: var(--bg-card-hover); color: #fff; }

/* ── Article body ── */
.article-body h2 { color: #fff; font-size: 1.2rem; margin: 1.6rem 0 .6rem; padding-top: 1.6rem; border-top: 1px solid var(--border); }
.article-body h2:first-child { border-top: none; padding-top: 0; }
.article-body h3 { color: #fff; font-size: 1.02rem; margin: 1.2rem 0 .5rem; }
.article-body p, .article-body li { color: rgba(255,255,255,.72); line-height: 1.75; overflow-wrap: break-word; }
.article-body ul, .article-body ol { padding-left: 1.4rem; margin-bottom: .8rem; }
.article-body a { color: #7dd3fc; }

/* ── Footer ── */
.footer { background: var(--bg-dark); border-top: 1px solid var(--border); padding: 40px 0 20px; }
.footer-heading { font-family: var(--heading-font); font-size: .93rem; font-weight: 700; color: #fff; margin-bottom: .6rem; }
.footer-links li { margin-bottom: .35rem; }
.footer-links a  { color: var(--text-muted); transition: .2s; font-size: .84rem; }
.footer-links a:hover { color: #fff; }
.footer p { color: var(--text-muted); }

/* ═════════════════════════════════════
   MOBILE NAV — transform-based (no layout shift)
   ═════════════════════════════════════ */
@media (max-width: 1199px) {
  .navmenu ul {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; right: 0;
    /* Width: min of 260px or 75% of viewport — never causes horizontal scroll */
    width: min(260px, 75vw);
    height: 100%;
    background: var(--bg-dark);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 20px rgba(0,0,0,.4);
    padding: 60px 14px 20px;
    gap: 3px;
    z-index: 9999;
    /* Use transform — does NOT affect layout, zero overflow */
    transform: translateX(100%);
    transition: transform .28s ease;
  }
  .navmenu ul.open { transform: translateX(0); }
  .navmenu ul li a { padding: 11px 14px; border-radius: 8px; font-size: .9rem; white-space: normal; }
  .mobile-nav-toggle { display: block; }
}

/* ═════════════════════════════════════
   TABLET (768px – 991px)
   ═════════════════════════════════════ */
@media (max-width: 991px) {
  /* Hero image column: normal flow, no sticky */
  .hero-img-col { position: static; }
  /* Stack hero buttons */
  .hero-btn-row { flex-wrap: wrap; gap: 8px; }
}

/* ═════════════════════════════════════
   MOBILE (≤ 767px)
   ═════════════════════════════════════ */
@media (max-width: 767px) {
  .section { padding: 40px 0; }

  /* Prevent any wide child from breaking layout */
  .container { padding-left: 14px; padding-right: 14px; }
  .row { margin-left: 0; margin-right: 0; }
  .row > [class*="col-"] { padding-left: 10px; padding-right: 10px; }

  /* Hero buttons full width stacked */
  .hero-btn-row { flex-direction: column; gap: 8px; }
  .hero-btn-row a, .hero-btn-row button {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center !important;
  }

  /* About feature boxes — ALWAYS full width on mobile */
  .about-boxes-row > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
  /* Allow text to wrap inside feature boxes */
  .about-feature-box { flex-wrap: nowrap; padding: 14px 14px; gap: 12px; }
  .about-feature-box p { font-size: .82rem; }

  /* Guide steps stacked */
  .guide-step { flex-direction: column; gap: 10px; }

  /* CTA card */
  .cta-card { padding: 2rem 1.25rem; border-radius: 16px; }

  /* FAQ text */
  .faq-q { font-size: .87rem; padding: 13px 14px; }
  .faq-a { padding: 0 14px 13px; }

  /* Full guide panel */
  .full-guide-panel { padding: 14px 16px; }

  /* Archive / pagination */
  .pn-link { padding: 12px 14px; }
}

/* ═════════════════════════════════════
   SMALL PHONES (≤ 400px)
   ═════════════════════════════════════ */
@media (max-width: 400px) {
  .header .sitename { font-size: .9rem; }
  .btn-get-started, .btn-outline-started { font-size: .84rem; padding: .6rem 1.1rem; }
  .about-icon { width: 36px; height: 36px; min-width: 36px; font-size: 1rem; }
  .about-feature-box h5 { font-size: .84rem; }
  .about-feature-box p  { font-size: .78rem; }
  .section-title h2 { font-size: 1.25rem; }
}
