/* ==========================================================================
   Sanjeev Mansotra Foundation — Main Stylesheet
   ========================================================================== */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Colors */
  --color-white: #FFFFFF;
  --color-cream: #FFF5E7;
  --color-footer-cream: #F8F2EB;
  --color-primary-blue: #005598;
  --color-gold: #C18E3D;
  --color-black: #000000;
  --color-gray: #7C7C7C;
  --color-light-gray: #919191;
  --color-dark-blue: #00274D;

  /* Typography — Bespoke Serif for headings, DM Sans for body */
  --font-heading: 'Bespoke Serif', 'Georgia', serif;
  --font-body: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;

  /* Spacing scale */
  --section-padding: 100px 0;
  --container-max: 1280px;
  --container-padding: 0 40px;

  /* Borders */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;

  /* Transitions */
  --transition: 0.3s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-black);
  background-color: var(--color-white);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* --- Typography --- */
h1 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 70px;
  line-height: 1.23;
  letter-spacing: 0;
  color: var(--color-black);
}

h2 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 64px;
  line-height: 1.23;
  letter-spacing: 0;
  color: var(--color-black);
}

h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.3;
}

h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.35;
}

p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-gray);
}

/* --- Layout --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--container-padding);
}

.section {
  padding: var(--section-padding);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-primary-blue);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: #C18E3D;
}

.btn-dark {
  background-color: var(--color-black);
  color: var(--color-white);
}

.btn-dark:hover {
  background-color: #222;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-black);
  border: 2px solid var(--color-black);
}

.btn-outline:hover {
  background-color: var(--color-black);
  color: var(--color-white);
}

.btn-gold {
  background-color: var(--color-gold);
  color: var(--color-white);
}

.btn-gold:hover {
  background-color: #a97a2f;
}

/* --- Tag/Badge --- */
.tag {
  display: inline-block;
  padding: 6px 20px;
  background-color: var(--color-gold);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  /*border-radius: 30px;*/
  letter-spacing: 0.5px;
}

/* ==========================================================================
   SCROLL ANIMATIONS
   ========================================================================== */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--color-white);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.site-header > .container {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 48px;
  align-items: center;
}

.header-top {
  display: contents;
}

.header-logo {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
}

.header-right {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  padding: 14px 0 10px;
}

.main-nav {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  width: 100%;
}

.header-logo img {
  height: 100px;
  width: auto;
}

.header-top {
  padding: 14px 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-black);
}

.header-phone svg {
  width: 16px;
  height: 16px;
}

.header-contact-btn {
  padding: 10px 24px;
  font-size: 14px;
}

/* Navigation */
.main-nav {
  border-top: none;
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 40px;
  padding: 14px 0;
}

.nav-list a {
  font-size: 15px;
  font-weight: 400;
  color: var(--color-black);
  position: relative;
}

.nav-list a:hover {
  color:#C18E3D;
}

.nav-item-dropdown {
  position: relative;
}

.nav-item-dropdown > a {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item-dropdown > a::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: var(--transition);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  min-width: 200px;
  background: var(--color-white);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 100;
  padding: 8px 0;
}

.nav-item-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
}

.dropdown-menu a:hover {
  background-color: var(--color-cream);
}

/* Mobile nav toggle */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.mobile-nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-black);
  transition: var(--transition);
}

.mobile-nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav-close {
  display: none;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    var(--color-white) 0%,
    var(--color-white) 58%,
    var(--color-cream) 58%,
    var(--color-cream) 100%
  );
}

.hero .container {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 580px;
}

.hero-content {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 70px 60px 70px 0;
  position: relative;
  z-index: 2;
}

.hero-content h1 {
  margin-bottom: 24px;
}

.hero-content p {
  font-size: 18px;
  line-height: 1.2;
  max-width: 100%;
  margin-bottom: 44px;
  color: #000000;
}

.hero-content .values-strip-inner {
  margin-top: 80px;
}

.hero-image {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 50vw;
  z-index: 1;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* ==========================================================================
   VALUES STRIP
   ========================================================================== */
.values-strip {
  padding: 50px 0 60px;
  background-color: var(--color-cream);
}

.values-strip-inner {
  display: flex;
  gap: 60px;
}

.value-item {
  display: block;
}

.value-icon {
  width: 55px;
  height: auto;
  margin-bottom: 10px;
}

.value-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.value-label {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 500;
  color: var(--color-primary-blue);
  margin-bottom: 6px;
}

.value-desc {
  font-size: 18px;
  color: var(--color-black);
  line-height: 1.2;
}

/* ==========================================================================
   ABOUT SECTION
   ========================================================================== */
.about {
  background-color: var(--color-cream);
  padding: 80px 0;
}

.about .container {
  display: flex;
  align-items: center;
  gap: 60px;
}

.about-emblem {
  flex: 0 0 40%;
  display: flex;
  justify-content: center;
}

.about-emblem img {
  max-width: 380px;
  width: 100%;
  height: auto;
  opacity: 0.85;
}

.about-content {
  flex: 1;
}

.about-content .tag {
  margin-bottom: 20px;
}

.about-content h2 {
  /* font-size: 48px; */
  margin-bottom: 24px;
}

.about-content p {
  margin-bottom: 16px;
  font-size: 18px;
  line-height: 1.15;
}

.about-content .btn {
  margin-top: 16px;
}

/* ==========================================================================
   PROGRAMS SECTION
   ========================================================================== */
.programs {
  padding: 100px 0;
  background-color: var(--color-white);
}

.programs h2 {
  margin-bottom: 50px;
}

.programs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  align-items: start;
}

/* Each card: a rounded coloured text panel with the photo overlapping its
   lower edge and hanging below it. Default panel is cream; on hover it turns
   blue, text flips to white, and the panel + photo merge into one card. */
.program-card {
  position: relative;
  display: flex;
  flex-direction: column;
  outline: none;
}

/* the coloured text panel */
.program-card-text {
  position: relative;
  z-index: 1;
  padding: 40px 34px 96px;
  background-color: var(--color-cream);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: padding 0.4s ease;
}

.program-card-text::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background-color: var(--color-primary-blue);
  border-radius: var(--radius-lg);
  transition: height 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: -1;
}

.program-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-black);
  margin-bottom: 14px;
  transition: color 0.4s ease;
}

.program-card-text h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  color: var(--color-black);
  margin-bottom: 16px;
  transition: color 0.4s ease;
}

.program-card-text p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-black);
  margin-bottom: 0;
  transition: color 0.4s ease;
}

/* the photo — fits perfectly with no space, sharp edges by default */
.program-card-image {
  position: relative;
  z-index: 2;
  margin: -72px 0 0 0;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: none;
  transition: margin 0.4s ease, box-shadow 0.4s ease, border-radius 0.4s ease;
}

.program-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* ---- Hover / focus state: blue fill bottom-to-top, rounded corners and shadow ---- */
.program-card:hover .program-card-text::before,
.program-card:focus-visible .program-card-text::before {
  height: 100%;
}

.program-card:hover .program-label,
.program-card:focus-visible .program-label,
.program-card:hover .program-card-text h4,
.program-card:focus-visible .program-card-text h4 {
  color: var(--color-white);
}

.program-card:hover .program-card-text p,
.program-card:focus-visible .program-card-text p {
  color: rgba(255, 255, 255, 0.9);
}

.program-card:hover .program-card-image,
.program-card:focus-visible .program-card-image {
  border-radius: var(--radius-lg);
  /*box-shadow: 0 18px 38px rgba(0, 85, 152, 0.28);*/
}

.program-card:hover .program-card-image img,
.program-card:focus-visible .program-card-image img {
  transform: scale(1.05);
}

/* ==========================================================================
   IMPACT PHILOSOPHY
   ========================================================================== */
.impact-philosophy {
  padding: 80px 0 100px;
  background-color: var(--color-white);
}

.impact-philosophy h2 {
  text-align: center;
  margin-bottom: 50px;
}

/* Expanding accordion: the active card grows to fill most of the row and
   reveals its description; the others shrink to slim columns showing only the
   title. Belong is active by default. */
.impact-grid {
  display: flex;
  gap: 24px;
  margin-bottom: 50px;
  height: 460px;
}

.impact-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  outline: none;
  flex: 1 1 0;
  min-width: 0;
  transition: flex-grow 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Active (or hovered / focused) card expands */
.impact-card.is-active {
  flex-grow: 3.4;
}

.impact-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Blue wash — stronger on collapsed cards, lighter at top on the active one */
.impact-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 39, 77, 0.92) 0%, rgba(0, 61, 110, 0.6) 45%, rgba(0, 85, 152, 0.55) 100%);
  transition: opacity 0.5s ease;
  z-index: 1;
}

.impact-card.is-active::before {
  background: linear-gradient(0deg, rgba(0, 39, 77, 0.85) 0%, rgba(0, 55, 100, 0.35) 45%, rgba(0, 85, 152, 0.15) 100%);
}

.impact-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 34px 32px;
  color: var(--color-white);
  z-index: 2;
}

.impact-card-overlay h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 34px;
  margin-bottom: 0;
  white-space: nowrap;
  transition: margin-bottom 0.4s ease;
}

/* Description is hidden until the card is active */
.impact-card-overlay p {
  font-size: 18px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  max-width: 420px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.45s ease, max-height 0.45s ease;
}

.impact-card.is-active .impact-card-overlay h3 {
  margin-bottom: 12px;
}

.impact-card.is-active .impact-card-overlay p {
  opacity: 1;
  max-height: 140px;
  transform: translateY(0);
}

.impact-tagline {
  text-align: center;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 24px;
  color: #000000;
  font-weight: 400;
}

/* ==========================================================================
   LEGACY / FOUNDER SECTION
   ========================================================================== */
.legacy {
  padding: 90px 0 100px;
  background-color: var(--color-white);
}

.legacy .container {
  display: flex;
  align-items: center;
  gap: 70px;
}

.legacy-content {
  flex: 0 0 42%;
}

.legacy-content h2 {
  /* font-size: 52px; */
  margin-bottom: 24px;
  line-height: 1.15;
}

.legacy-content p {
  font-size: 18px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.legacy-content .btn {
  margin-top: 20px;
}

.legacy-image {
  flex: 1;
  position: relative;
}

.legacy-image img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  display: block;
}

/* blue accent rectangle behind the lower-right of the photo */
/* .legacy-image::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 55%;
  height: 60%;
  background-color: var(--color-primary-blue);
  z-index: 1;
} */

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background-color: var(--color-footer-cream);
  color: var(--color-black);
  padding: 70px 0 0;
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.4fr;
  gap: 40px;
  padding-bottom: 50px;
  align-items: start;
}

.footer-brand .footer-logo img {
  height: 180px;
  width: auto;
  margin-bottom: 8px;
}

.footer-social {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}

.footer-social a {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
  font-size: 14px;
  transition: var(--transition);
}

.footer-social a:hover {
  color: var(--color-primary-blue);
  transform: translateY(-2px);
}

.footer-column h4 {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 22px;
  color: var(--color-black);
}

.footer-column ul li {
  margin-bottom: 14px;
}

.footer-column ul li a {
  font-size: 15px;
  color: #333;
}

.footer-column ul li a:hover {
  color: #C18E3D;
}

.footer-cta {
  background-color: var(--color-gold);
  border-radius: var(--radius-md);
  padding: 36px 40px;
  color: var(--color-white);
}

.footer-cta h3 {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--color-white);
  margin-bottom: 12px;
  line-height: 1.25;
}

.footer-cta p {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 24px;
  max-width: 320px;
}

.footer-cta .btn {
  background-color: var(--color-primary-blue);
  color: var(--color-white);
}

.footer-cta .btn:hover {
  background-color: #FFFFFF;
  color: var(--color-black);
}

.footer-bottom {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copyright {
  font-size: 13px;
  color: var(--color-gray);
}

.footer-credit {
  font-size: 13px;
  color: var(--color-gray);
}

.footer-credit a {
  color: var(--color-gray);
  text-decoration: underline;
}

.footer-credit a:hover {
  color: var(--color-primary-blue);
}

/* ==========================================================================
   UTILITY / HELPER
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.placeholder-image {
  background-color: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 14px;
  text-align: center;
}

/* ==========================================================================
   HOME — OUR STORIES (dynamic 3-up cards; image top, cream body, no radius)
   ========================================================================== */
.home-stories {
  padding: 10px 0 100px;
  background-color: var(--color-white);
}

.home-stories h2 {
  margin-bottom: 16px;
}

.home-stories__lead {
  max-width: 100%;
  margin-bottom: 46px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-gray);
}

.home-stories__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  align-items: stretch;
}

.home-story-card {
  display: flex;
  flex-direction: column;
  color: inherit;
}

.home-story-card__image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.home-story-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.home-story-card:hover .home-story-card__image img {
  transform: scale(1.04);
}

.home-story-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--color-cream);
  padding: 28px 28px 30px;
}

.home-story-card__title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
  color: var(--color-black);
  margin-bottom: 16px;
}

.home-story-card__tag {
  align-self: flex-start;
  background-color: var(--color-gold);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  margin-bottom: 22px;
}

.home-story-card__more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-black);
}

.home-story-card__arrow {
  display: inline-flex;
  transition: transform 0.3s ease;
  transform-origin: 50% 50%;
}

.home-story-card:hover .home-story-card__arrow {
  transform: rotate(45deg);
}

@media (max-width: 900px) {
  .home-stories__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}