/* India Recycles - layout behaviour
   "One section at a time" scroll snapping for the web / desktop version.
   Uses `proximity` (not `mandatory`) so tall sections still scroll freely and
   nothing gets clipped; the browser only nudges each section to the top of the
   screen as you settle. Disabled on touch / small screens where it feels wrong. */

@media (min-width: 1024px) and (pointer: fine) {
  /* No vertical scroll-snapping. Making every section a snap point meant the
     viewport kept getting pulled toward section boundaries mid-scroll, which
     reads as the page fighting you. Anchors still land clear of the navbar via
     scroll-padding-top, and html{scroll-behavior:smooth} keeps jumps smooth. */
  html {
    scroll-padding-top: 84px;          /* height of the fixed navbar */
  }

  /* Homepage hero fills the first screen but stops ~3.25rem short so the stats
     ticker that follows it is visible without scrolling (it reads as part of
     the hero). Only the homepage opts in via this class; sub-page heroes keep
     their natural (compact) height so the next section fits into view. */
  .snap-hero-fill {
    min-height: calc(100vh - 3.25rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

}

/* ── Mobile UX pass ─────────────────────────────────────────────
   Tighter section rhythm, comfortable tap targets, and a sticky
   quick-action bar so Donate is always one tap away on phones. */
@media (max-width: 767px) {
  main section[class*="py-16"] { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
  main section[class*="py-12"] { padding-top: 2.25rem !important; padding-bottom: 2.25rem !important; }
  main section[class*="py-10"] { padding-top: 2rem !important; padding-bottom: 2rem !important; }
}
@media (max-width: 1023px) {
  #mob-menu a { padding-top: 12px !important; padding-bottom: 12px !important; }
  .ir-sticky-cta {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
    display: flex; gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,0.96);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0,0,0,0.08);
  }
  body:has(.ir-sticky-cta) { padding-bottom: 72px; }
}
@media (min-width: 1024px) { .ir-sticky-cta { display: none !important; } }

/* ── Mobile back chip (injected by transitions.js on sub-pages) ──
   Gives an app-like way back from any page: previous page if you came
   from within the site, otherwise straight to the homepage. */
@media (max-width: 1023px) {
  .ir-back {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-right: 6px; flex-shrink: 0;
    border-radius: 9999px; border: 1px solid rgba(0,0,0,0.10);
    background: #f2f7f4; color: #1c5439; cursor: pointer;
  }
  .ir-back:active { background: #e0ede5; }
}
@media (min-width: 1024px) { .ir-back { display: none !important; } }

/* Anchored sections land below the fixed navbar */
section[id] { scroll-margin-top: 96px; }

/* ── Stat numbers must never be clipped on small screens ──
   These values grow over time (live counters) and some are words, not numbers
   ("Weekly"), so a fixed mobile font size eventually overflows its card. Scale
   with the viewport instead, with a floor so it stays readable. */
@media (max-width: 640px) {
  [data-stat] { font-size: clamp(15px, 5.4vw, 28px) !important; }
  /* three-across cards are ~40% narrower, so they need a tighter ramp */
  .grid-cols-3 [data-stat],
  .grid-cols-3 .stat-value { font-size: clamp(13px, 4.4vw, 24px) !important; }
  .grid-cols-3 > * { min-width: 0; }
  /* let long words break rather than spill outside the card */
  [data-stat], .stat-value { overflow-wrap: anywhere; }
  /* three-across labels ("MEDICAL BENEFICIARIES") need to breathe too */
  .grid-cols-3 [data-stat] ~ div { font-size: 10.5px !important; line-height: 1.35; letter-spacing: .01em; }
  .grid-cols-3 [data-stat] ~ div + div { font-size: 10px !important; }
}

/* ── Photo gallery: lightbox + "show all" ─────────────────── */
.ir-lb-tile { cursor: zoom-in; }
.ir-lb-tile:focus-visible { outline: 3px solid #256b49; outline-offset: 3px; }
.ir-more-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 12px; cursor: pointer;
  background: #fff; color: #1c5439; border: 1px solid #c2dccc;
  font-size: 14px; font-weight: 600; transition: background .15s, border-color .15s;
}
.ir-more-btn:hover { background: #f2f7f4; border-color: #93c1a5; }
.ir-more-btn svg { width: 16px; height: 16px; transition: transform .2s ease; }

.ir-lb {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center;
  background: rgba(8, 20, 13, 0.94);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  padding: 16px;
}
.ir-lb.open { display: flex; }
.ir-lb-fig { margin: 0; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ir-lb-img {
  max-width: 92vw; max-height: 78vh; width: auto; height: auto;
  object-fit: contain; border-radius: 10px; background: #0b2418;
}
.ir-lb-cap { color: rgba(255,255,255,0.86); font-size: 13px; text-align: center; max-width: 60ch; line-height: 1.5; }
.ir-lb-close, .ir-lb-nav {
  position: absolute; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.12); color: #fff; border: 0; cursor: pointer;
  border-radius: 9999px; transition: background .15s;
}
.ir-lb-close:hover, .ir-lb-nav:hover { background: rgba(255,255,255,0.26); }
.ir-lb-close { top: 16px; right: 16px; width: 44px; height: 44px; }
.ir-lb-close svg { width: 22px; height: 22px; }
.ir-lb-nav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; }
.ir-lb-nav svg { width: 24px; height: 24px; }
.ir-lb-prev { left: 12px; }
.ir-lb-next { right: 12px; }
.ir-lb-count {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.8); font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
@media (max-width: 640px) {
  .ir-lb-img { max-height: 70vh; }
  .ir-lb-nav { width: 40px; height: 40px; }
  .ir-lb-prev { left: 6px; }
  .ir-lb-next { right: 6px; }
}

/* The Join Us anchor sits on the form itself so a #join link lands on the first
   field, under the fixed navbar, with the whole form in view. */
#join { scroll-margin-top: 100px; }
@media (max-width: 640px) {
  /* Tighten the rhythm just enough that the whole form - through the submit
     button - clears the fixed navbar and the sticky bottom bar on a phone. */
  #join { scroll-margin-top: 92px; }
  #join.space-y-5 > * + * { margin-top: 0.875rem; }
}
@media (max-width: 1023px) {
  /* On the Join page the sticky bar sits right on top of the form's submit button,
     and both of its actions are redundant there - you are already on the form. */
  body:has(#join) .ir-sticky-cta { display: none !important; }
  body:has(#join) { padding-bottom: 0 !important; }
}

/* ── Homepage "Our Model" cards ──
   The photo gets a taller 4:3 frame flush to the card edges (no inner bezel) and
   is shown uncropped; the text sits on its own solid panel that stretches to a
   common height, so copy never reads as part of the picture. */
.model-card-media { aspect-ratio: 4 / 3; background: #f2f7f4; position: relative; }
.model-card-body { background: #ffffff; }
@media (max-width: 640px) {
  .model-card-media { aspect-ratio: 16 / 10; }
}

/* Just the step number floats on the photo in a compact frosted "liquid glass"
   chip; the step title and description sit in the body below. The chip is a
   sibling of the image, so the photo can still zoom on hover behind the glass. */
.model-step {
  position: absolute; top: 12px; left: 12px;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.10));
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.model-step-num {
  font-size: 24px; font-weight: 800; line-height: 1;
  letter-spacing: -0.02em; color: #ffffff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* ── Logo strip: one logo per partner on a single scrollable line ── */
.ir-strip {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.ir-strip::-webkit-scrollbar { display: none; }
.ir-strip-item {
  flex: 0 0 auto;
  width: 150px; height: 96px; padding: 14px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.ir-strip-item:hover { border-color: #93c1a5; box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.ir-strip-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ir-strip-item span { font-size: 12px; font-weight: 600; color: #1c5439; text-align: center; line-height: 1.3; }
.ir-strip-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 38px; height: 38px; border-radius: 9999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: #1c5439; border: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(0,0,0,.10); transition: background .15s, opacity .15s;
}
.ir-strip-nav:hover { background: #f2f7f4; }
.ir-strip-nav[disabled] { opacity: .35; cursor: default; }
.ir-strip-nav svg { width: 19px; height: 19px; }
.ir-strip-prev { left: -6px; }
.ir-strip-next { right: -6px; }
@media (max-width: 640px) {
  .ir-strip-item { width: 124px; height: 84px; }
  .ir-strip-nav { display: none; }   /* swipe instead */
}

/* ── "More" toggle for long card copy ── */
.ir-clamp-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: #1c5439; font-weight: 700; font-size: inherit; text-decoration: underline;
}
.ir-clamp-btn:hover { color: #0b2418; }

/* ── Community Voice: full quote in a panel ── */
.ir-tm-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ir-tm-card:hover { border-color: #93c1a5; box-shadow: 0 8px 22px rgba(0,0,0,.07); }
.ir-tm-card:focus-visible { outline: 3px solid #256b49; outline-offset: 3px; }
.ir-tm-modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(8, 20, 13, 0.86);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.ir-tm-modal.open { display: flex; }
.ir-tm-box {
  position: relative; background: #fff; border-radius: 20px; overflow: hidden;
  width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.ir-tm-media { background: #f2f7f4; }
.ir-tm-media img { width: 100%; max-height: 46vh; object-fit: cover; display: block; }
.ir-tm-body { padding: 24px; }
.ir-tm-stars { margin-bottom: 4px; }
.ir-tm-quote {
  margin: 0 0 18px; font-size: 16px; line-height: 1.7; color: #1a1a1a;
  font-style: italic; white-space: pre-line;
}
.ir-tm-quote::before { content: '\201C'; }
.ir-tm-quote::after  { content: '\201D'; }
.ir-tm-desc { margin: 0 0 18px; font-size: 14px; line-height: 1.65; color: #445; white-space: pre-line; }
.ir-tm-name { font-weight: 700; color: #133a28; font-size: 14px; }
.ir-tm-role { color: #6b7280; font-size: 12px; margin-top: 2px; }
.ir-tm-close {
  position: absolute; top: 12px; right: 12px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border: 0; border-radius: 9999px; background: rgba(255,255,255,.92); color: #133a28;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.ir-tm-close:hover { background: #fff; }
.ir-tm-close svg { width: 20px; height: 20px; }

/* ── "How India Recycles Works" step cards ──
   Illustration-led card: pastel STEP pill top-left, artwork, then centred copy.
   The artwork is an <img>, so each one is replaceable from the admin. */
.step-card {
  background: #fff; border: 1px solid #eef2f0; border-radius: 22px;
  padding: 18px 22px 26px; text-align: center;
  display: flex; flex-direction: column;
  box-shadow: 0 2px 10px rgba(16, 40, 28, .04);
  transition: transform .2s ease, box-shadow .2s ease;
}
.step-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(16, 40, 28, .09); }
@media (prefers-reduced-motion: reduce) { .step-card:hover { transform: none; } }

.step-badge {
  align-self: flex-start; display: inline-block;
  padding: 6px 14px; border-radius: 9999px;
  font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
}
.step-badge--green  { background: #dcfce7; color: #15803d; }
.step-badge--amber  { background: #fef3c7; color: #b45309; }
.step-badge--violet { background: #ede9fe; color: #6d28d9; }
.step-badge--rose   { background: #ffe4e6; color: #be123c; }
.step-badge--blue   { background: #dbeafe; color: #1d4ed8; }

.step-art { padding: 6px 0 2px; }
.step-art img { display: block; width: 100%; max-width: 210px; height: auto; margin: 0 auto; }

.step-title {
  font-family: 'Montserrat', sans-serif; font-weight: 700;
  font-size: 20px; color: #14344a; margin: 6px 0 10px;
}
.step-desc { color: #5b7185; font-size: 14px; line-height: 1.65; margin: 0; }

@media (max-width: 640px) {
  .step-card { padding: 16px 18px 22px; }
  .step-art img { max-width: 168px; }
  .step-title { font-size: 18px; }
}

/* Bigger partner logos on the homepage strip */
.ir-strip-item { width: 208px; height: 130px; padding: 20px; }
@media (max-width: 640px) { .ir-strip-item { width: 170px; height: 112px; padding: 16px; } }

/* ── Section rhythm ──
   Desktop sections were 64px top + 64px bottom, so 128px of empty space between
   every block (160px in places). Tightened to keep the page moving. */
@media (min-width: 1024px) {
  section[class*="lg:py-20"] { padding-top: 3rem   !important; padding-bottom: 3rem   !important; }
  section[class*="lg:py-16"] { padding-top: 2.75rem !important; padding-bottom: 2.75rem !important; }
  section[class*="lg:py-14"] { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
  section[class*="lg:py-12"] { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
  /* page heroes keep their fixed-navbar offset */
  section[class*="pt-[84px]"] { padding-top: 84px !important; }
}
@media (min-width: 641px) and (max-width: 1023px) {
  section[class*="py-12"], section[class*="py-10"], section[class*="py-8"] {
    padding-top: 2.25rem !important; padding-bottom: 2.25rem !important;
  }
  section[class*="pt-[84px]"] { padding-top: 84px !important; }
}

/* ── Reveal on scroll ── */
.ir-reveal { opacity: 0; transform: translateY(26px); }
.ir-reveal-in {
  opacity: 1; transform: none;
  transition: opacity .6s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1);
}
@media (prefers-reduced-motion: reduce) {
  .ir-reveal, .ir-reveal-in { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ── Flash announcement: side tab + popup ──
   A configurable teaser (event / talk / workshop) pinned to the right edge; a
   click opens a popup with the full details. Hidden until the admin enables it. */
.ir-flash-tab {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 65; display: flex; align-items: center; gap: 8px;
  background: #1c5439; color: #fff; cursor: pointer; border: 0;
  padding: 12px 14px; border-radius: 14px 0 0 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22); writing-mode: vertical-rl;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  transition: background .15s, padding .15s;
}
.ir-flash-tab:hover { background: #133a28; padding-right: 18px; }
.ir-flash-tab .ir-flash-dot {
  writing-mode: horizontal-tb; width: 8px; height: 8px; border-radius: 9999px;
  background: #5ca07a; box-shadow: 0 0 0 0 rgba(92,160,122,.7); animation: irFlashPulse 2s infinite;
}
@keyframes irFlashPulse { 0%{box-shadow:0 0 0 0 rgba(92,160,122,.6)} 70%{box-shadow:0 0 0 10px rgba(92,160,122,0)} 100%{box-shadow:0 0 0 0 rgba(92,160,122,0)} }
/* On phones sit the flash tab in the upper-middle of the right edge (~25% higher
   than the old near-bottom spot), well clear of the WhatsApp/Call bubble. The base
   rule's translateY(-50%) centres it on this top offset. */
@media (max-width: 1023px) { .ir-flash-tab { top: 38%; bottom: auto; padding: 10px 12px; } }
@media (prefers-reduced-motion: reduce) { .ir-flash-tab .ir-flash-dot { animation: none; } }

.ir-flash-modal {
  position: fixed; inset: 0; z-index: 210; display: none;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(8,20,13,.86); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.ir-flash-modal.open { display: flex; }
.ir-flash-box {
  position: relative; width: min(480px, 100%); max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.ir-flash-box img { width: 100%; max-height: 46vh; object-fit: cover; display: block; background: #f2f7f4; }
.ir-flash-body { padding: 24px; }
.ir-flash-kind {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
  background: #dcfce7; color: #15803d; padding: 5px 12px; border-radius: 9999px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.ir-flash-title { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 22px; color: #133a28; margin: 0 0 8px; }
.ir-flash-when { font-size: 13px; font-weight: 600; color: #256b49; margin-bottom: 12px; }
.ir-flash-desc { color: #445; font-size: 15px; line-height: 1.65; white-space: pre-line; margin: 0 0 18px; }
.ir-flash-cta {
  display: inline-flex; align-items: center; gap: 8px; background: #1c5439; color: #fff;
  padding: 11px 22px; border-radius: 12px; font-weight: 700; font-size: 14px; text-decoration: none;
}
.ir-flash-cta:hover { background: #133a28; }
.ir-flash-close {
  position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; border: 0; border-radius: 9999px;
  background: rgba(255,255,255,.92); color: #133a28; box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.ir-flash-close svg { width: 20px; height: 20px; }
