/* ═══════════════════════════════════════════════════════════════ */
/*  mobile.css — Unified responsive overrides for narrow screens    */
/*  Loaded globally on every page so all layouts stack on mobile    */
/*  Added in v1.0.21                                                 */
/* ═══════════════════════════════════════════════════════════════ */

/* ─────────────────── Tablet portrait & smaller (≤ 900px) ─────────────────── */
@media (max-width: 900px) {

  /* (v21 header stacking removed — replaced by v23 hamburger below) */

  /* FOOTER: 3 cols → 1 col stacked, dotted divider becomes horizontal */
  .site-footer {
    grid-template-columns: 1fr !important;
    gap: 1.2rem !important;
    padding: 1.4rem 1.2rem 1rem !important;
  }
  .foot-col + .foot-col {
    border-left: none !important;
    padding-left: 0 !important;
    padding-top: 1rem !important;
    border-top: 2px dashed rgba(107, 98, 86, 0.25) !important;
  }
  .news-form {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  .news-form input,
  .news-form button {
    width: 100% !important;
  }

  /* HERO TITLES: smaller font on tablet */
  .writing-hero__title,
  .about-hero__title,
  .travels-hero__title,
  .practice-hero__title,
  .reading-hero__title,
  .hello-hero__title,
  h1 {
    font-size: clamp(2.4rem, 8vw, 4rem) !important;
    line-height: 1.1 !important;
  }

  /* HERO SECTIONS: shrink padding */
  .writing-hero,
  .about-hero,
  .travels-hero,
  .practice-hero,
  .reading-hero,
  .hello-hero {
    padding: 2rem 1.2rem !important;
  }

  /* GRIDS: collapse multi-column to single column */
  .essay-grid,
  .theme-grid,
  .series-grid,
  .pillar-grid,
  .planned-grid,
  .chapters-band,
  .currents-grid,
  .read-grid,
  .stays-grid,
  .films-grid,
  .voices-grid,
  .cafes-grid,
  .postcard-grid {
    grid-template-columns: 1fr !important;
    gap: 1.2rem !important;
  }

  /* CARDS: remove rotation/tilt on mobile (cleaner reading) */
  .essay-card,
  .pillar,
  .series,
  .planned,
  .read-item,
  .postcard,
  .theme-card,
  .current {
    transform: rotate(0deg) !important;
    margin-bottom: 0 !important;
  }

  /* TAG FILTER BAR: wrap to multiple rows */
  .tag-bar__list {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    justify-content: center !important;
  }
  .tag {
    font-size: 0.85rem !important;
    padding: 0.35rem 0.8rem !important;
  }

  /* INTRO PARAGRAPH: smaller, tighter */
  .writing-intro,
  .about-intro,
  .travels-intro,
  .practice-intro,
  .reading-intro,
  .hello-intro {
    padding: 1rem 1.2rem !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }

  /* SECTION HEADERS */
  .writing-section__title,
  .travels-section__title {
    font-size: 1.6rem !important;
  }
  .writing-section,
  .travels-section,
  .chapters-band,
  .practice-section,
  .reading-section,
  .hello-section {
    padding: 1.5rem 1.2rem !important;
  }

  /* IMAGES inside cards — sane max heights */
  .essay-card__cover img,
  .pillar__cover img,
  .series__img,
  .chapter-photo img,
  .read-item__img {
    max-height: 240px !important;
    width: 100% !important;
    object-fit: cover !important;
  }

  /* INDIA MAP on Travels: scale down */
  .india-map,
  .india-map img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* PAPER STACK decoration on Writing/About: hide on mobile (was overflowing) */
  .paper-stack {
    display: none !important;
  }

  /* FLOATING ELEMENTS on About hero */
  .float-sun {
    width: 100px !important;
    height: 100px !important;
  }
  .float-cloud {
    max-width: 200px !important;
  }

  /* CHAPTER PHOTOS on About: full width, no tilt */
  .chapter-photo {
    width: 100% !important;
    max-width: 100% !important;
    transform: rotate(0deg) !important;
    margin: 1rem auto !important;
  }

  /* PRACTICE pinboard: rotation off */
  .card {
    transform: rotate(0deg) !important;
  }
}


/* ─────────────────── Mobile portrait (≤ 600px) — tighter ─────────────────── */
@media (max-width: 600px) {

  body {
    font-size: 15px !important;
  }

  .site-header {
    padding: 0.8rem 0.8rem !important;
  }

  .topnav a {
    font-size: 0.88rem !important;
  }

  /* Hero titles tighter still */
  .writing-hero__title,
  .about-hero__title,
  .travels-hero__title,
  h1 {
    font-size: clamp(2rem, 8.5vw, 3rem) !important;
  }

  /* Footer note text smaller */
  .foot-col--note {
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
  }

  /* Tag bar — even more compact */
  .tag {
    font-size: 0.8rem !important;
    padding: 0.3rem 0.7rem !important;
  }

  /* Theme cards: stacked */
  .theme-card {
    padding: 1rem !important;
  }

  /* HELLO postcards — full width */
  .postcard {
    max-width: 100% !important;
    margin: 0 0 1rem !important;
  }
}


/* ─────────────────── Reduced motion — disable animations ─────────────────── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}



/* ═══════════════════════════════════════════════════════════════ */
/*  v1.0.22 — Mobile coverage for containers missed in v21          */
/* ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {

  /* About page bits */
  .closing-band,
  .stats-band {
    padding: 1.5rem 1.2rem !important;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
  }
  .stat__num {
    font-size: 2.2rem !important;
  }

  /* Now page bits */
  .letter-band,
  .photo-band,
  .currents-band,
  .exits {
    padding: 1.5rem 1.2rem !important;
  }
  .exits {
    flex-direction: column !important;
    gap: 0.8rem !important;
    text-align: center !important;
  }
  .exits a {
    display: inline-block !important;
  }

  /* Newsletter band on Writing page */
  .news-band {
    padding: 1.5rem 1.2rem !important;
  }
  .news-band h2 {
    font-size: 1.4rem !important;
    line-height: 1.3 !important;
  }

  /* Practice subpage detail hero + side-stack */
  .detail-hero {
    padding: 2rem 1.2rem !important;
    text-align: center !important;
  }
  .detail-hero__title {
    font-size: clamp(2rem, 7vw, 3.4rem) !important;
  }
  .side-stack {
    margin-top: 1.5rem !important;
  }
  .side-box {
    margin: 0 0 1rem 0 !important;
    width: 100% !important;
  }

  /* Practice and Reading grid containers (single column on mobile) */
  .practice-grid,
  .reading-grid {
    grid-template-columns: 1fr !important;
    gap: 1.2rem !important;
  }

  /* Hello page postcards grid (older selector was singular) */
  .postcards-grid {
    grid-template-columns: 1fr !important;
    gap: 1.2rem !important;
  }

  /* Now page bird and grass — keep the decoration but constrain width */
  .perched-bird,
  .grass-divider {
    max-width: 100% !important;
    overflow: hidden !important;
  }
  .perched-bird svg {
    max-width: 100% !important;
    height: auto !important;
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  .news-band h2 {
    font-size: 1.2rem !important;
  }
  .detail-hero__title {
    font-size: clamp(1.8rem, 7vw, 2.6rem) !important;
  }
}


/* ═══════════════════════════════════════════════════════════════ */
/*  v1.0.23 — Hamburger menu for mobile (replaces v21 stacked menu) */
/* ═══════════════════════════════════════════════════════════════ */

/* Hide hamburger on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  z-index: 200;
  position: relative;
}
.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink, #2B2620);
  transition: transform 0.25s ease, opacity 0.25s ease;
  border-radius: 1px;
}

/* Mobile: show hamburger, hide menu by default, slide down when open */
@media (max-width: 900px) {

  .site-header {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    text-align: left !important;
    padding: 0.8rem 1rem !important;
    gap: 0.6rem !important;
  }

  .nav-toggle {
    display: flex !important;
  }

  /* Hide the main nav by default on mobile */
  .topnav {
    display: none !important;
    width: 100% !important;
    order: 3 !important;
  }
  .topnav ul {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 0.8rem 0 !important;
    border-top: 1px dashed rgba(107, 98, 86, 0.3) !important;
    margin-top: 0.6rem !important;
  }
  .topnav li {
    list-style: none !important;
  }
  .topnav li a {
    display: block !important;
    padding: 0.7rem 0.5rem !important;
    font-size: 1rem !important;
    text-align: center !important;
    border-bottom: 1px dashed rgba(107, 98, 86, 0.15) !important;
    text-decoration: none !important;
  }
  .topnav li:last-child a {
    border-bottom: none !important;
  }

  /* When .nav-open class is on header, reveal the menu */
  .site-header.nav-open .topnav {
    display: block !important;
    animation: navFadeIn 0.2s ease both;
  }

  /* Stamp on mobile: smaller, on the right beside hamburger */
  .stamp {
    font-size: 0.78rem !important;
    padding: 0.25rem 0.6rem !important;
    order: 2 !important;
  }

  /* Logo on mobile: smaller, on the left */
  .logo { order: 1 !important; }
  .logo img { max-height: 42px !important; width: auto !important; }

  /* Hamburger to "X" animation when open */
  .site-header.nav-open .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .site-header.nav-open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }
  .site-header.nav-open .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@keyframes navFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
