/* =============================================================
   TARA INDIA — index.css
   Homepage-specific styles. Loaded only on the front page.
   ============================================================= */


/* ── 1. HERO SLIDER ─────────────────────────────────────────────
   Full-viewport crossfade slideshow with dark overlay.
   Overlay is rgba(0,0,0,0.5) — acceptable on images only,
   never used as a plain page background.
   ---------------------------------------------------------------- */
.hero {
  position: relative;
  width: 100%;
  min-height: 55vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  gap: 2rem;
}

.hero-slides {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-slide.active { opacity: 1; }

.hero-overlay {
  position: absolute;
  inset: 0;
  /* Gradient: nearly transparent at top (faces visible), brand-tinted dark at bottom */
  background: linear-gradient(
    to bottom,
    rgba(10, 30, 80, 0.12) 0%,
    rgba(10, 30, 80, 0.28) 45%,
    rgba(10, 30, 80, 0.55) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-title {
  font-family: 'Semringah', sans-serif;
  font-weight: 400;            /* Semringah is single-weight — bold causes fallback */
  letter-spacing: 3px;
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}


/* ── 2. SECTIONS ────────────────────────────────────────────────
   ---------------------------------------------------------------- */
.section {
  margin: 1rem 0 0;
  padding: 2.5rem 1rem;
  position: relative;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-title  { margin-bottom: .8rem; }

.contained-section { padding: 2rem; }

.what-we-do__content,
.make-a-difference__content { margin-bottom: 1.5rem; }

@media (min-width: 768px) {
  .what-we-do__content,
  .make-a-difference__content { margin-bottom: 2.5rem; }
}


/* ── 3. OUR IMPACT SECTION ──────────────────────────────────────
   Light blue background section with stat cards.
   Uses blue-50 (#E3F0FB) as background — never dark blue.
   ---------------------------------------------------------------- */
.our-impact {
  background: #E3F0FB;
  border-radius: 12px;
  border: 2px dashed #1B6FBF;
}

.our-impact__doodle {
  position: absolute;
  top: 0.4rem;
  right: 0.8rem;
  font-size: 1.6rem;
}

.our-impact__title {
  margin: 0 0 1rem;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.our-impact__content {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  align-items: flex-start;
}

.our-impact__text {
  font-size: 0.98rem;
  line-height: 1.2;
}

.our-impact__link {
  display: inline-block;
  margin-bottom: 1.6rem;
  font-weight: 600;
  text-decoration: underline;
  color: inherit;
}
.our-impact__link span  { margin-left: 0.2rem; }
.our-impact__link:hover { text-decoration: none; }


/* ── 4. BLOG CARD GRID ──────────────────────────────────────────
   Shadow fix: negative margin lets card shadows bleed outside the
   container without causing overflow clipping.
   White card grid inside the blue-50 impact section.
   ---------------------------------------------------------------- */
.cards-grid {
  padding: 12px;
  margin: -12px;
  overflow: visible;
}

.section.latest-posts {
  overflow: visible;
}

/* ── MOBILE: blog cards — horizontal scroll row ────────────────────────
   Keep cards in a single scrollable row on mobile.
   Cards have a fixed width so you can clearly see there are more.
   The “View all” button drops below the scroll area on its own row.
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Restore flex scroll */
  .cards-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 0.75rem !important;
    padding: 12px 4px !important;
    margin: -12px -4px !important;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
  }

  /* Each blog card: fixed width so next card peeks */
  .cards-grid > .card {
    flex: 0 0 72vw !important;
    max-width: 280px !important;
    min-width: 0 !important;
  }

  /* “View all articles” below scroll row */
  .cards-grid > .read-more-wrapper {
    flex: 0 0 100% !important;
    display: flex !important;
    justify-content: center !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    order: 999 !important;
  }
}


/* ── 5. OUR IMPACT STATS GRID ───────────────────────────────────
   ---------------------------------------------------------------- */
.our-impact__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
}

@media (min-width: 768px) {
  .our-impact__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.our-impact-stat {
  min-height: 110px;
  background: #fff;
  border-radius: 10px;
  padding: 0.9rem 0.8rem 1rem;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
}

.our-impact-stat__icon img {
  max-width: 50px;
  max-height: 50px;
  margin-bottom: 0.4rem;
}

.our-impact-stat__icon-number {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.our-impact-stat__number {
  font-size: 2rem;
  font-weight: 500;
  color: #1B6FBF;
  margin-bottom: 0.25rem;
}

.our-impact-stat__label {
  font-size: 0.82rem;
  line-height: 1.4;
}


/* ── MOBILE: consistent margins on What We Do & Make a Difference ──
   Forces identical left/right padding and box-sizing on both sections
   so the card grids are flush at the same horizontal position.
   ------------------------------------------------------------------- */
@media (max-width: 768px) {
  .section.what-we-do,
  .section.make-a-difference {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  .cards-grid-02 {
    box-sizing: border-box !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .card-02,
  .card-03,
  .card-04 {
    box-sizing: border-box !important;
    min-width: 0 !important;
  }
}


/* ── MOBILE: "What We Do" card layout fix ────────────────────────
   Desired layout on mobile (≤ 725px):
     Row 1 — card-02 (Community Outreach) full width with image
     Row 2 — card-03 (Residential) | card-03 (Aftercare) side by side
     Row 3 — card-04 (Capacity Building) full width

   Strategy: bypass grid-template-areas entirely (inline style="grid-area:X"
   conflicts with named areas when other stylesheets override the template).
   Instead, explicitly set grid-column and grid-row with !important on each
   card — this overrides both the inline styles and any other stylesheet rule.
   ------------------------------------------------------------------- */
@media (max-width: 725px) {

  /* Container: 2 equal columns, no named areas */
  .cards-grid-02 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas: none !important;
    grid-auto-columns: 1fr !important;
    grid-auto-rows: auto !important;
    gap: 0.75rem !important;
  }

  /* Row 1 — Community Outreach: spans both columns */
  .cards-grid-02 > article:nth-child(1) {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  /* Row 2 left — Residential Care */
  .cards-grid-02 > article:nth-child(2) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  /* Row 2 right — Aftercare */
  .cards-grid-02 > article:nth-child(3) {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }

  /* Row 3 — Capacity Building: spans both columns */
  .cards-grid-02 > article:nth-child(4) {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
  }

  /* Constrain the image on the full-width top card */
  .cards-grid-02 > article:nth-child(1) .card-image-02 {
    height: 180px !important;
    overflow: hidden !important;
  }

  .cards-grid-02 > article:nth-child(1) .card-image-02 img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}

/* Very small phones: single column stack */
@media (max-width: 320px) {
  .cards-grid-02 {
    grid-template-columns: 1fr !important;
  }

  .cards-grid-02 > article:nth-child(1),
  .cards-grid-02 > article:nth-child(2),
  .cards-grid-02 > article:nth-child(3),
  .cards-grid-02 > article:nth-child(4) {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}


/* ── HERO: accessibility contrast fixes ─────────────────────── */

/* Text block: no opaque background — rely on text-shadow for readability */
.hero-content {
  background: none;
  padding: 2rem 2.5rem;
}

.hero-title {
  text-shadow:
    0 2px 20px rgba(0,0,0,0.70),
    0 1px  5px rgba(0,0,0,0.50);
}

.hero-subtitle {
  text-shadow: 0 1px 10px rgba(0,0,0,0.65);
}

/* Lock primary CTA to accessible orange + enforce white text */
.hero-actions .btn-primary {
  background: #B84918 !important;   /* orange-600 — 4.8:1 vs white */
  border-color: #B84918 !important;
  color: #ffffff !important;
}

/* Secondary CTA — consistent visible border */
.hero-actions .btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.85) !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12);
}

/* ── BLOG SCROLL: visible scrollbar ─────────────────────────────
   Makes the scrollbar clearly visible on mobile so users know
   they can swipe/scroll. TARA blue thumb on a light track.
   scrollbar-width/color = Firefox; ::-webkit-scrollbar = Chrome/Safari/Edge.
   ---------------------------------------------------------------- */
@media (max-width: 768px) {

  /* Ensure the section itself doesn't clip the scrollbar */
  .section.latest-posts {
    overflow: visible !important;
    padding-bottom: 1.5rem !important; /* room for the scrollbar below cards */
  }

  /* Firefox */
  .cards-grid {
    scrollbar-width: auto !important;
    scrollbar-color: #1B6FBF #E3F0FB !important;
  }

  /* Webkit (Chrome, Safari, Edge, Android) */
  .cards-grid::-webkit-scrollbar {
    height: 6px;
    display: block !important;
  }

  .cards-grid::-webkit-scrollbar-track {
    background: #E3F0FB;
    border-radius: 4px;
  }

  .cards-grid::-webkit-scrollbar-thumb {
    background: #1B6FBF;
    border-radius: 4px;
  }

  .cards-grid::-webkit-scrollbar-thumb:hover {
    background: #0D3D7A;
  }
}


/* =============================================================
   HOMEPAGE DESIGN IMPROVEMENTS — Designer feedback May 2026
   ============================================================= */


/* ── 1. "DISCOVER" SUBTITLE — bigger, more readable ──────────── */
.what-we-do__text,
.make-a-difference__text {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #555;
}


/* ── 2. READ MORE LINKS — dark grey, not orange ──────────────── */
.section .link-accent {
  color: #555;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: .03em;
  text-decoration: none;
  transition: color .2s;
}
.section .link-accent:hover {
  color: #0D3D7A;
}


/* ── 3. WHAT WE DO — coloured top bar + uppercase titles ─────── */
.cards-grid-02 > article {
  border-top: 4px solid transparent;
  border-radius: 10px;
  overflow: visible;   /* allow image to bleed slightly outside card */
}
.cards-grid-02 > article:nth-child(1) { border-top-color: var(--ti-teal,   #04A1B2); }
.cards-grid-02 > article:nth-child(2) { border-top-color: var(--ti-blue,   #1B6FBF); }
.cards-grid-02 > article:nth-child(3) { border-top-color: var(--ti-pink,   #E83A8D); }
.cards-grid-02 > article:nth-child(4) { border-top-color: var(--ti-orange, #EC672E); }

/* Card titles — uppercase, coloured, larger */
.card-title-02,
.card-title-03,
.card-title-04 {
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 0.95rem !important;
}
.cards-grid-02 > article:nth-child(1) .card-title-02 { color: var(--ti-teal-800,   #075A64); }
.cards-grid-02 > article:nth-child(2) .card-title-03 { color: var(--ti-blue-800,   #0D3D7A); }
.cards-grid-02 > article:nth-child(3) .card-title-03 { color: var(--ti-pink-800,   #7A1248); }
.cards-grid-02 > article:nth-child(4) .card-title-04 { color: var(--ti-orange-800, #7A2E08); }

/* Card excerpt text — show fully for SEO + readability */
.card-text-02,
.card-text-03,
.card-text-04 {
  font-size: 0.90rem;
  line-height: 1.55;
}

/* Image card (1st card): image bleeds slightly outside card top/sides */
.cards-grid-02 > article:nth-child(1) {
  overflow: visible;
}
.cards-grid-02 > article:nth-child(1) .card-image-02 {
  margin: -10px -10px 10px;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  box-shadow: 0 -4px 18px rgba(0,0,0,0.10);
}


/* ── 4. OUR IMPACT — stat card hover animation ───────────────── */
.our-impact-stat {
  cursor: default;
  transition: transform .25s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow .25s ease;
}
.our-impact-stat:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 10px 28px rgba(27,111,191,0.18);
}
.our-impact-stat .our-impact-stat__icon svg {
  transition: transform .25s ease;
}
.our-impact-stat:hover .our-impact-stat__icon svg {
  transform: scale(1.15) rotate(-5deg);
}

/* Remove arrow from Know More, fix border ────────────────────── */
#btn-know-more {
  /* Remove the inline → arrow via CSS (the arrow is text in PHP) */
}
.our-impact {
  border: 2px solid #1B6FBF;   /* solid, not dashed */
  border-radius: 12px;
}
.our-impact-stat__number {
  font-size: 2.2rem;
  font-weight: 700;
}


/* ── 5. BLOG SECTION — 4-col grid (reverted to 4 cards) ─────── */
.section.latest-posts .cards-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 768px) {
  .section.latest-posts .cards-grid {
    display: flex !important;
  }
}

.section.latest-posts .card-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* View All — light text link, not a full button */
.section.latest-posts .read-more-wrapper {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}
.section.latest-posts .read-more-wrapper .btn-outline {
  background: none;
  border: none;
  color: #888;
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 4px 0;
  font-weight: 500;
  letter-spacing: .02em;
}
.section.latest-posts .read-more-wrapper .btn-outline:hover {
  color: #1B6FBF;
}


/* ── 6. MAKE A DIFFERENCE — 4-col equal grid (distinct from WTD) */
.make-diff-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.make-diff-card {
  border-radius: 14px;
  padding: 26px 18px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.make-diff-card__icon {
  font-size: 2rem;
  line-height: 1;
}
.make-diff-card h3 {
  font-size: 0.90rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0;
  line-height: 1.3;
}
.make-diff-card p {
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.make-diff-card a.make-diff-link {
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid currentColor;
  opacity: .75;
  margin-top: auto;
  transition: opacity .2s;
}
.make-diff-card a.make-diff-link:hover { opacity: 1; }

/* Make a Difference card hover animation */
.make-diff-card {
  transition: transform .25s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow .25s ease;
  cursor: pointer;
}
.make-diff-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}
.make-diff-card__icon {
  transition: transform .25s cubic-bezier(0.34,1.56,0.64,1);
}
.make-diff-card:hover .make-diff-card__icon {
  transform: scale(1.25) rotate(-8deg);
}

/* Colour variants */
.make-diff-card--teal   { background: var(--ti-teal-50,   #E0F5F7); color: var(--ti-teal-800,   #075A64); }
.make-diff-card--blue   { background: var(--ti-blue-50,   #E3F0FB); color: var(--ti-blue-800,   #0D3D7A); }
.make-diff-card--pink   { background: var(--ti-pink-50,   #FDE8F3); color: var(--ti-pink-800,   #7A1248); }
.make-diff-card--orange { background: var(--ti-orange-50, #FEF0E8); color: var(--ti-orange-800, #7A2E08); }

@media (max-width: 768px) {
  .make-diff-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .make-diff-grid { grid-template-columns: 1fr; }
}


/* ── 7. PARTNERS — on-brand blue-50, consistent buttons ──────── */
.our-partners-frame {
  background: var(--ti-blue-50, #E3F0FB) !important;
  border: 2px solid var(--ti-blue, #1B6FBF);
}
.our-partners-frame h2,
.our-partners-frame .our-partners__text {
  color: var(--ti-blue-800, #0D3D7A) !important;
}
.our-partners-logo-item {
  border-color: rgba(27,111,191,0.15) !important;
  box-shadow: 0 1px 4px rgba(27,111,191,0.08) !important;
}
.our-partners-logo-item:hover {
  box-shadow: 0 4px 14px rgba(27,111,191,0.20) !important;
}
.our-partners-frame .btn-outline {
  color: var(--ti-blue, #1B6FBF) !important;
  border-color: var(--ti-blue, #1B6FBF) !important;
}
.our-partners-frame .btn-outline:hover {
  background: var(--ti-blue, #1B6FBF) !important;
  color: #fff !important;
}

