/* ==========================================================================
   Parishrama Marketing — Responsive layer
   Breakpoints: 1280 / 1080 / 1024 / 900 / 768 / 620 / 480 / 380
   Load AFTER style.css.
   ========================================================================== */

/* ------------------- BOOK: SINGLE-LEAF MODE THRESHOLD ------------------- */
/* Mirrors the 760px breakpoint that book.js uses to switch between the
   two-page spread and single-leaf reading. Narrowing the stage to exactly one
   page width means the leaf parked on the other half is clipped away rather
   than bleeding in at the screen edge. */
@media (max-width: 759px) {
  .book-viewport { width: var(--pw); }
}

/* ------------------------------- 1280px -------------------------------- */
@media (max-width: 1280px) {
  :root { --container: 1140px; }

  .footer-main {
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(140px, 1fr));
    gap: 34px;
  }
}

/* ------------------------------- 1080px -------------------------------- */
@media (max-width: 1080px) {
  .book-layout {
    grid-template-columns: 1fr;
    gap: 46px;
  }
  .book-info { text-align: center; }
  .book-info .eyebrow { justify-content: center; }
  .book-actions,
  .book-meta { justify-content: center; }
  .book-highlights { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .book-viewport { --pw: clamp(230px, 30vw, 300px); }

  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .hero-stats { gap: 24px; }

  .featured-post { grid-template-columns: 1fr; }
  .featured-post .blog-media { min-height: 280px; aspect-ratio: 16 / 9; }
}

/* ---------------- 1024px — collapse nav into a drawer ------------------ */
@media (max-width: 1024px) {
  .nav-toggle { display: block; order: 3; }
  .header-cta { display: none; }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 995;
    width: min(340px, 86vw);
    height: 100vh;
    height: 100dvh;
    padding: calc(var(--header-h) + 22px) 26px 34px;
    background: var(--grad-navy);
    box-shadow: -18px 0 60px rgba(8, 17, 31, .4);
    transform: translateX(102%);
    transition: transform .55s var(--ease);
    overflow-y: auto;
    display: block;
  }
  .nav::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: var(--grad-gold);
  }
  .nav.is-open { transform: none; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .nav-link {
    padding: 15px 16px;
    font-size: .98rem;
    color: rgba(255, 255, 255, .84);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--r-xs);
  }
  .nav-link::after { display: none; }
  .nav-link:hover,
  .nav-link[aria-current="page"] {
    color: var(--gold-300);
    background: rgba(255, 255, 255, .05);
  }
  .is-stuck .nav-link { color: rgba(255, 255, 255, .84); }
  .is-stuck .nav-link:hover,
  .is-stuck .nav-link[aria-current="page"] { color: var(--gold-300); }

  /* Staggered entrance for drawer items */
  .nav.is-open .nav-list li {
    animation: nav-item-in .5s var(--ease-out) backwards;
  }
  .nav.is-open .nav-list li:nth-child(1) { animation-delay: .1s; }
  .nav.is-open .nav-list li:nth-child(2) { animation-delay: .16s; }
  .nav.is-open .nav-list li:nth-child(3) { animation-delay: .22s; }
  .nav.is-open .nav-list li:nth-child(4) { animation-delay: .28s; }
  .nav.is-open .nav-list li:nth-child(5) { animation-delay: .34s; }
  .nav.is-open .nav-list li:nth-child(6) { animation-delay: .4s; }

  .nav-drawer-cta {
    display: block;
    margin-top: 26px;
  }
  .nav-drawer-foot {
    display: block;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: .84rem;
    color: rgba(255, 255, 255, .55);
  }
  .nav-drawer-foot a { color: var(--gold-300); display: block; margin-bottom: 8px; }
  .nav-drawer-foot .socials { margin-top: 16px; }

  .contact-layout { grid-template-columns: 1fr; }
}

@keyframes nav-item-in {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: none; }
}

/* Desktop: drawer-only extras stay hidden */
@media (min-width: 1025px) {
  .nav-drawer-cta,
  .nav-drawer-foot { display: none; }
}

/* -------------------------------- 900px -------------------------------- */
@media (max-width: 900px) {
  :root { --header-h: 74px; }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero-content {
    order: 2;
    padding: clamp(26px, 6vw, 42px) var(--gutter) clamp(30px, 6vw, 46px);
    text-align: center;
    align-items: center;
  }
  .hero-content .eyebrow { justify-content: center; }
  .hero-lead { max-width: 56ch; }
  .hero-actions,
  .hero-stats { justify-content: center; }
  .hero-stats { text-align: center; }
  .hero-media {
    order: 1;
    height: min(58vh, 440px);
    padding-top: var(--header-h);
  }
  .hero-media img { object-position: 67% center; }
  .hero-media::after {
    background:
      linear-gradient(0deg, var(--cream) 0%, rgba(253, 250, 244, .35) 22%, transparent 55%),
      linear-gradient(180deg, rgba(12, 29, 56, .5), transparent 45%);
  }
  .hero-badge { right: auto; left: 50%; transform: translateX(-50%); bottom: 12px; }
  .hero-scroll { display: none; }

  /* The banner hero stays banner-only at every width — the <h1> remains
     screen-reader-only and nothing else is added over or under the artwork. */
  .hero.hero--banner { padding-top: var(--header-h); }

  .section-banner { margin-bottom: clamp(12px, 3.5vw, 22px); }

  .split { gap: 22px; }
  .split-media { order: 2; }
  .split-media .frame img,
  .split-media .frame--wide img { aspect-ratio: 3 / 4; max-height: 46vh; object-position: top center; }
  .split-media::before,
  .split--reverse .split-media::before { inset: 16px -16px -16px 16px; }
  .media-tag { left: 12px; bottom: 12px; border-radius: var(--r-sm); }

  .timeline { padding-left: 0; }
  .timeline::before { left: 9px; transform: none; }
  .tl-item,
  .tl-item:nth-child(even),
  .tl-item:nth-child(odd) {
    width: 100%;
    margin-left: 0;
    padding-left: 38px;
    padding-right: 0;
    text-align: left;
  }
  .tl-item:nth-child(odd)::before,
  .tl-item:nth-child(even)::before { left: 2px; right: auto; }

  .footer-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 28px;
  }
  .footer-brand { grid-column: 1 / -1; }
}

/* -------------------------------- 768px -------------------------------- */
@media (max-width: 768px) {
  body { line-height: 1.66; }

  .section { padding-block: clamp(18px, 5vw, 28px); }
  .section--tight { padding-block: clamp(14px, 3.4vw, 22px); }
  .section-head { margin-bottom: clamp(10px, 2.6vw, 16px); }

  .page-hero {
    min-height: auto;
    padding: calc(var(--header-h) + 22px) 0 26px;
  }
  .page-hero .lead { margin-top: 8px; }
  .breadcrumb { margin-top: 10px; }

  .card-grid,
  .card-grid--3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

  .why-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

  .book-viewport { --pw: clamp(224px, 62vw, 300px); }
  .book-hint { display: none; }
  .book-layout { gap: 26px; }

  .form-grid { grid-template-columns: 1fr; }

  .cta-band::before,
  .cta-band::after { display: none; }

  .map-frame iframe { height: 240px; }

  .flourish { display: none; }
}

/* -------------------------------- 620px -------------------------------- */
@media (max-width: 620px) {
  :root { --header-h: 64px; }
  .brand-logo { width: 34px; }
  .brand-sub { font-size: .5rem; letter-spacing: .14em; }

  .section { padding-block: clamp(14px, 5vw, 22px); }
  .section-head { margin-bottom: 14px; }

  .card-grid,
  .card-grid--3 { grid-template-columns: 1fr; gap: 14px; }

  .why-grid { grid-template-columns: 1fr; }
  .mv-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .product-media { aspect-ratio: 3 / 4; }

  /* Hero carousel: the banner is only ~120px tall here, so drop the arrows
     (swipe still works) and shrink the dots. */
  .hero-slider-nav { display: none; }
  .hero-slider-dots {
    right: 8px;
    bottom: 7px;
    padding: 5px 9px;
    background: rgba(253, 250, 244, .75);
  }
  .hero-slider-dots button { width: 6px; height: 6px; }
  .hero-slider-dots button.is-active { width: 17px; }

  .book-viewport { --pw: min(68vw, 260px); }
  .book-controls { gap: 8px; }
  .book-counter { min-width: 90px; font-size: .62rem; letter-spacing: .12em; }
  .book-nav { width: 42px; height: 42px; }
  .book-highlights { grid-template-columns: 1fr; }
  .book-layout { gap: 18px; }

  .hero-stats { gap: 18px 26px; }
  .hero-stat { min-width: 96px; }

  .footer-main { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom nav { justify-content: center; flex-wrap: wrap; }

  .toast-stack { right: 12px; left: 12px; bottom: 12px; max-width: none; }
  .scroll-top { right: 14px; bottom: 14px; width: 44px; height: 44px; }

  .form-foot { flex-direction: column; align-items: stretch; }
  .form-foot .btn { width: 100%; }
}

/* -------------------------------- 480px -------------------------------- */
@media (max-width: 480px) {
  :root { --gutter: 16px; }

  .btn { padding: 13px 24px; font-size: .78rem; }
  .btn-lg { padding: 15px 28px; font-size: .82rem; }

  .hero-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .hero-media { height: min(46vh, 340px); }

  .book-viewport { --pw: min(72vw, 240px); --ph: calc(var(--pw) * 1.4); }
  .page { padding: 18px 18px 38px; }
  .page-quote { font-size: .92rem; }

  .cta-actions { flex-direction: column; }
  .cta-actions .btn { width: 100%; }
  .cta-contacts { flex-direction: column; gap: 14px; }

  .book-actions { flex-direction: column; }
  .book-actions .btn { width: 100%; }

  .filter-tab { padding: 9px 17px; font-size: .68rem; }

  .quote-card::before { font-size: 4.4rem; right: 14px; }

  .stat-strip { grid-template-columns: 1fr; }
}

/* -------------------------------- 380px -------------------------------- */
@media (max-width: 380px) {
  .book-viewport { --pw: min(84vw, 250px); }
  .page-quote { font-size: .86rem; line-height: 1.58; }
  .brand-name { font-size: .96rem; }
  .modal-card { padding: 26px 20px; }
}

/* ------------------------- SHORT VIEWPORT HEIGHTS ----------------------- */
@media (max-height: 680px) and (min-width: 901px) {
  /* Split hero only. The banner hero must keep its header clearance at every
     viewport height — .hero--banner is a single class, so an unscoped
     `.hero { padding-block: 0 }` here would win on source order and slide the
     banner's top edge under the fixed header. */
  .hero:not(.hero--banner) { min-height: auto; padding-block: 0; }
  .hero-content { padding-top: calc(var(--header-h) + 44px); padding-bottom: 54px; }
}

/* ----------------------- COARSE POINTER (TOUCH) ------------------------ */
@media (hover: none) {
  .product-card:hover,
  .blog-card:hover,
  .why-card:hover,
  .tl-card:hover,
  .quote-card:hover,
  .stat-card:hover,
  .hover-lift:hover { transform: none; }

  .product-card:hover .product-media img,
  .blog-card:hover .blog-media img,
  .split-media:hover .frame img,
  .hover-zoom:hover img { transform: none; }

  .btn:hover { transform: none; }
  .shine:hover::after { animation: none; }
}

/* ----------------------------- PRINT ----------------------------------- */
@media print {
  .site-header,
  .nav,
  .nav-backdrop,
  .scroll-top,
  .toast-stack,
  .modal,
  .book-controls,
  .cta-band,
  .hero-scroll { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }
  .section { padding-block: 18pt; }
  .book-section,
  .promise,
  .page-hero { background: #fff !important; color: #000 !important; }
  .book-section h2, .promise h2, .page-hero h1 { color: #000 !important; }
  a { color: #000; text-decoration: underline; }
  .product-card, .blog-card, .why-card { break-inside: avoid; box-shadow: none; }
}

/* -------------------------- Floating contact widget -------------------------- */
@media (max-width: 768px) {
  .float-contact {
    top: auto;
    bottom: 110px;
    right: 14px;
    transform: none;
    gap: 10px;
    animation-name: floatContactInMobile;
  }
  @keyframes floatContactInMobile {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  .float-btn { width: 52px; height: 52px; }
  .float-btn svg { width: 22px; height: 22px; }
  .float-btn::after { display: none; }
}
