/* ==========================================================================
   responsive.css — mobile responsiveness for the whole GamerShorts website.
   Loaded AFTER style.css so these rules win. Keep all mobile/tablet overrides
   here so future layout edits in style.css stay desktop-first and predictable.
   ========================================================================== */

/* ---- Global safety: never let anything cause horizontal scroll on phones --- */
*, *::before, *::after { box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; }
/* clip (not hidden) on body: 'hidden' turns body into a scroll container and breaks position: sticky */
body { max-width: 100%; overflow-x: clip; }
img, video, canvas, svg, iframe { max-width: 100%; height: auto; }
/* page width is controlled by --max (1450px) in style.css */

/* ---- Mobile navigation (hamburger) --------------------------------------- */
.nav-toggle { display: none; }
.nav-toggle span {
  display: block; width: 22px; height: 2px; border-radius: 2px;
  background: var(--ink, #17121f); transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle span + span { margin-top: 5px; }
header.top.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
header.top.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
header.top.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   TABLET  ≤ 1024px
   ========================================================================== */
@media (max-width: 1024px) {
  .games-grid, .games-grid-page { grid-template-columns: repeat(4, 1fr); }
  .sports-zone-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   SMALL TABLET / LARGE PHONE  ≤ 820px  — nav collapses to hamburger here
   ========================================================================== */
@media (max-width: 820px) {
  header.top { position: relative; }
  .top-inner { gap: 10px; }

  /* show hamburger, turn nav into a dropdown panel */
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center;
    width: 42px; height: 42px; border: 0; border-radius: 12px;
    background: rgba(23, 18, 31, .06); cursor: pointer; flex-shrink: 0;
    order: -1; /* hamburger sits first in the right cluster, beside Log in */
  }
  /* top row stays: logo · hamburger · login; search drops below, bell hidden */
  .notif-wrap { display: none; }
  .main-nav {
    display: flex !important; flex-direction: column; gap: 2px;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 120;
    background: var(--card, #fff); border-top: 1px solid var(--line, #eef0f4);
    box-shadow: 0 18px 40px rgba(23, 18, 31, .14);
    padding: 10px 14px 16px;
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }
  header.top.nav-open .main-nav { transform: none; opacity: 1; pointer-events: auto; }
  .main-nav .nav-link { padding: 12px 10px; border-radius: 10px; font-size: 15px; }
  .main-nav .nav-link.is-active, .main-nav .nav-link:hover { background: rgba(255, 81, 0, .08); }

  /* search drops to its own full-width row under the top bar */
  .search { order: 6; flex: 1 1 100%; min-width: 0; margin-top: 4px; }
  .top-inner { flex-wrap: wrap; }

  .hero-row { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .col-side { position: static; max-height: none; overflow: visible;
              display: flex; flex-direction: row; flex-wrap: wrap; gap: 14px; }
  .side-card { flex: 1 1 260px; }
  .reviews-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-inner { grid-template-columns: 1fr 1fr; gap: 26px; }
  .foot-brand { grid-column: 1 / -1; max-width: none; }

  /* match-score cards: let the grid tracks and inner text shrink to fit */
  .live-match-list, .upcoming-match-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-match-card, .lm-top, .lm-scoreboard, .lm-left-meta, .lm-team, .lm-center { min-width: 0; }
  .lm-league, .lm-team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ==========================================================================
   PHONE  ≤ 560px
   ========================================================================== */
@media (max-width: 560px) {
  .wrap, .page-wrap { padding: 14px 13px; }

  /* compact header */
  .brand-tag { display: none; }
  .brand-name { font-size: 20px; }
  .brand-logo { width: 38px; height: 38px; }
  .login-btn { padding: 8px 14px; font-size: 13px; }

  /* headings scale down */
  .hero-title { font-size: 21px; }
  .page-title, .sports-zone-title { font-size: 22px; }
  .panel-head h2, .live-now-head h2, .section-title { font-size: 18px; }

  /* one-column grids */
  .games-grid, .games-grid-page { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .reviews-grid { grid-template-columns: 1fr; }
  .insights-grid { grid-template-columns: 1fr; }
  .nstrip-grid { grid-template-columns: 1fr; }
  .sports-zone-grid { grid-template-columns: 1fr; gap: 12px; }
  /* minmax(0,1fr) removes the min-content floor so cards shrink to the viewport */
  .live-match-list, .home-sports-grid, .upcoming-match-list { grid-template-columns: minmax(0, 1fr); }
  .live-match-card { min-width: 0; }
  .lm-top, .lm-scoreboard, .lm-left-meta, .lm-team, .lm-center { min-width: 0; }
  .lm-league, .lm-team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* news cards: keep thumbnail + text side by side but smaller */
  .news-card { grid-template-columns: 104px 1fr; gap: 11px; }

  /* side column cards stack full width */
  .col-side { flex-direction: column; }
  .side-card { flex: 1 1 100%; }

  /* footer stacks to a single column */
  .foot-inner { grid-template-columns: 1fr; gap: 22px; }
  .foot-bar { flex-direction: column; gap: 8px; text-align: center; }

  /* sports zone card: shorter, text stays readable over photo */
  .sz-card { min-height: 128px; }
  .sz-info { width: 72%; padding: 14px; }
  .sz-name { font-size: 18px; }

  /* match detail + insight lightbox: use the full screen comfortably */
  .mm-card { width: 100%; border-radius: 16px; }
  .ins-lb-stage { max-width: 94vw; }

  /* home Live/Upcoming toggle wraps cleanly */
  .home-sports-toggle { flex-wrap: wrap; }
}

/* ==========================================================================
   SMALL PHONE  ≤ 400px
   ========================================================================== */
@media (max-width: 400px) {
  .games-grid, .games-grid-page { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 19px; }
  .brand-name { font-size: 18px; }
  .news-card { grid-template-columns: 88px 1fr; gap: 10px; }
  .login-btn { padding: 7px 12px; }
}


/* ==========================================================================
   MOBILE HEADER: login symbol + 3-line menu, both pushed to the right
   ========================================================================== */
.login-ic { display: none; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 820px) {
  .top-right { margin-left: auto; gap: 8px; }
  .login-btn {
    order: 1; display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; padding: 0; border-radius: 12px; flex-shrink: 0;
  }
  .login-btn .login-txt { display: none; }
  .login-btn .login-ic { display: block; }
  .nav-toggle { order: 2; }
}

/* ==========================================================================
   MOBILE MENU: compact panel on the right, text right-aligned (not full width)
   ========================================================================== */
@media (max-width: 820px) {
  .main-nav {
    left: auto; right: 13px; width: max-content; min-width: 170px; max-width: calc(100% - 26px);
    align-items: flex-end; text-align: right;
    margin-top: 6px; padding: 8px 8px 10px;
    border: 1px solid var(--line, #eef0f4); border-radius: 16px;
  }
  .main-nav .nav-link { display: block; width: auto; text-align: right; padding: 10px 18px; }
}

/* Mobile menu: opens right under the 3-line button, links centered in the box */
@media (max-width: 820px) {
  .main-nav { top: 60px; right: 22px; margin-top: 0; align-items: center; text-align: center; }
  .main-nav .nav-link { text-align: center; }
}

/* Hero title: the blurred text-shadow was clipped by the 2-line clamp and showed as dark boxes */
.hero-title { text-shadow: none; }

/* Mobile breaking bar: show the whole headline on up to 2 lines instead of cutting it with "..." */
@media (max-width: 620px) {
  .breaking { height: 64px; padding: 0 12px 0 8px; gap: 10px; }
  .breaking-badge { font-size: 12px; padding: 7px 12px; }
  .breaking-text {
    white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.25; font-size: 14.5px;
  }
}