/* 3초 여행 — Redesign Responsive (v3 / unified axis)
 *
 *  Mobile-first base lives in layout/components.  This file only owns
 *  the per-tier overrides of --app-content-max and --app-side-padding
 *  plus grid column counts.  Because the topbar, main, page-scroll and
 *  bottom-tab-nav all read --app-content-max, they share the same
 *  center axis at every breakpoint — no left-shift, no axis drift.
 */

/* Global safety — guarantee no horizontal scroll, sensible box model. */
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
html { overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }

/* ===== SMALL MOBILE (≤ 374px) ===== */
@media (max-width: 374px) {
  :root {
    --app-content-max: 100%;
    --app-side-padding: 12px;
    --topbar-h: 48px;
  }
  .roadmap-grid { grid-template-columns: 1fr; gap: 10px; }
  .my-grid { grid-template-columns: repeat(2, 1fr); }
  .dest-quick { grid-template-columns: repeat(2, 1fr); }
  .choice-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .bottom-tab-nav { grid-template-columns: 1fr 1fr 72px 1fr 1fr; }
  .tab-button { font-size: 10.5px; }
  .tab-fab-button { width: 56px; height: 56px; margin-top: -18px; }
}

/* ===== MOBILE (375–767px) ===== */
@media (min-width: 375px) and (max-width: 767px) {
  :root {
    --app-content-max: 100%;        /* fill the phone viewport */
    --app-side-padding: 16px;
  }
  .roadmap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 마이 메뉴 — 자주 쓰는 칸은 크게 */
  .my-grid .my-tile[data-my-nav="saved"] { grid-column: span 2; }
  .my-grid .my-tile[data-my-nav="feedback"] { grid-column: span 3; flex-direction: row; justify-content: center; padding: 12px; }
}

/* ===== TABLET (768–1023px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --app-content-max: 720px;
    --app-side-padding: 24px;
    --topbar-h: 60px;
  }
  .roadmap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .my-grid { grid-template-columns: repeat(4, 1fr); }
  .dest-quick { grid-template-columns: repeat(6, 1fr); }
  .hero-card { min-height: 260px; padding: 28px; }
  .hero-title { font-size: 36px; }
}

/* ===== LAPTOP (1024–1279px) ===== */
@media (min-width: 1024px) and (max-width: 1279px) {
  :root {
    --app-content-max: 960px;
    --app-side-padding: 28px;
    --topbar-h: 68px;
  }
  .roadmap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .my-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== DESKTOP (≥ 1280px) ===== */
@media (min-width: 1280px) {
  :root {
    --app-content-max: 1120px;
    --app-side-padding: 32px;
    --topbar-h: 74px;
  }
  .roadmap-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .my-grid { grid-template-columns: repeat(6, 1fr); }
  .hero-card { min-height: 320px; padding: 40px; }
  .hero-title { font-size: 44px; }
}

/* ===== 일정 도구: 넓은 화면에서는 두 칸 ===== */
@media (min-width: 768px) {
  .trip-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .trip-tools .tool-card { margin: 0; }
  .trip-tools { margin: 12px 0; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== DARK MODE OPT-IN (set via Settings sheet) ===== */
@media (prefers-color-scheme: dark) {
  :root.allow-dark {
    --c-bg:           #111418;
    --c-surface:      #1A1E24;
    --c-surface-2:    #22272E;
    --c-border:       #2E343C;
    --c-divider:      #262B32;
    --c-text:         #EEF2F6;
    --c-text-soft:    #A9B1BB;
    --c-text-mute:    #7A828C;
  }
}
