/* ─── Responsive Breakpoints ─────────────────────────────────────────────────── */
/* This file MUST be imported last in application.css to ensure all             */
/* @media overrides win over base rules regardless of source order.             */

/* ── Tablet / large mobile: ≤ 900px ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-fotd__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-fotd__image-wrap {
    display: none;
  }

  /* Browse: sidebar above content, collapsible via <details> */
  .browse-layout {
    grid-template-columns: 1fr;
  }

  .browse-sidebar {
    position: static;
  }

  .filter-form__categories {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .filter-form__cat-btn {
    width: auto;
  }

  /* Show the collapsible toggle on tablet/mobile */
  .filter-collapsible__toggle {
    display: flex;
  }
}

/* ── Mobile: ≤ 640px — related facts carousel ────────────────────────────────── */
@media (max-width: 640px) {
  .related-facts__grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-padding: 0 var(--space-4);
    gap: var(--space-3);
    padding-bottom: var(--space-3);
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .related-facts__grid::-webkit-scrollbar {
    display: none;
  }
  .related-fact-card {
    flex: 0 0 80vw;
    scroll-snap-align: start;
    max-width: 320px;
  }
  /* Scroll-hint fade on right edge */
  .related-facts {
    position: relative;
  }
  .related-facts::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 48px;
    background: linear-gradient(to right, transparent, var(--cream));
    pointer-events: none;
  }
  /* Swipe hint label */
  .related-facts__heading::after {
    content: "swipe →";
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--ink-muted);
    margin-left: auto;
    letter-spacing: 0.04em;
  }
}

/* ── Mobile: ≤ 600px ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Nav: show hamburger, hide desktop links */
  .site-nav__links {
    display: none;
  }

  .site-nav__mobile-actions {
    display: flex;
  }


  /* Facts grid: single column */
  .facts-grid {
    grid-template-columns: 1fr;
  }

  /* Fact detail: tighter padding */
  .fact-detail {
    padding: var(--space-5) var(--space-4);
    /* space for sticky vote bar */
    padding-bottom: calc(var(--space-4) + 72px);
  }

  /* Typography scaling */
  .fact-detail__summary {
    font-size: 1.05rem;
    line-height: 1.7;
  }

  .fact-detail__body {
    font-size: 1rem;
    line-height: 1.75;
  }

  /* Sticky vote bar */
  .vote-bar-frame {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--white);
    border-top: 1px solid var(--cream-dark);
    box-shadow: 0 -4px 16px rgba(26, 26, 46, 0.1);
  }

  .vote-bar {
    padding: var(--space-3) var(--space-5);
    max-width: var(--container);
    margin-inline: auto;
  }

  /* Share buttons: full-width stacked */
  .share-buttons {
    flex-direction: column;
  }

  .share-btn {
    justify-content: center;
    width: 100%;
    padding: var(--space-3) var(--space-4);
  }

  /* Comment reply indentation: reduce on mobile */
  .comment--reply {
    margin-left: var(--space-3);
  }

  /* Hero */
  .hero-fotd {
    padding: var(--space-8) 0;
  }

  /* Related facts heading layout for swipe hint */
  .related-facts__heading {
    display: flex;
    align-items: center;
    width: 100%;
  }
}
