/* ==========================================================================
   MAMA CHRISTA FOUNDATION — TEAM PAGE STYLESHEET (team.css)
   Theme: Vibrant Warm Orange & Clean White
   ========================================================================== */

/* 1. BRAND COLORS & VARIABLES */
:root {
  --orange: #C74B17;          /* Primary Mama Christa Orange */
  --orange-hover: #A33A0D;    /* Darker Orange for active/hover */
  --orange-light: #FF8F5E;    /* Soft accent orange */
  --tint: #FFF4EE;            /* Light warm orange-white background tint */
  --tint-accent: #FFEFE5;     /* Soft section background gradient */
  --white: #FFFFFF;           /* Clean white card backgrounds */
  --strong: #231815;          /* Deep warm charcoal for headings */
  --ink: #2B2320;             /* Body text color */
  --muted: #665953;           /* Subtitles and supporting text */
  --line: #E8D9CF;            /* Soft warm borders */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-sm: 0 4px 14px rgba(199, 75, 23, 0.08);
  --shadow-md: 0 16px 36px rgba(199, 75, 23, 0.12);
  --shadow-lg: 0 24px 50px rgba(199, 75, 23, 0.16);
}

/* 2. BASE RESET */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Figtree', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background-color: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  padding-top: 80px;
}

h1, h2, h3, h4 {
  font-family: 'Bricolage Grotesque', sans-serif;
  color: var(--strong);
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

.section {
  padding: 3.5rem 5%;
}

/* 3. BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.8rem;
  font-family: 'Figtree', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--white);
  background-color: var(--orange);
  border: 2px solid var(--orange);
  border-radius: 9999px;
  cursor: pointer;
  transition: transform 0.3s var(--ease), background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 14px rgba(199, 75, 23, 0.25);
}

.btn:hover {
  background-color: var(--orange-hover);
  border-color: var(--orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(199, 75, 23, 0.35);
}

.btn-ghost {
  background-color: transparent;
  color: var(--strong);
  border-color: var(--line);
  box-shadow: none;
}

.btn-ghost:hover {
  background-color: var(--tint);
  border-color: var(--orange);
  color: var(--orange);
  box-shadow: none;
}

.btn-sm {
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
}

/* 4. SITE HEADER */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem clamp(1rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: box-shadow 0.3s, padding 0.3s, background 0.3s;
  border-bottom: 1px solid rgba(232, 217, 207, 0.5);
}

.site-header.scrolled {
  box-shadow: 0 6px 24px rgba(199, 75, 23, 0.12);
  padding-block: 0.3rem;
  background: rgba(255, 255, 255, 0.96);
}

.brand img {
  height: 54px;
  width: auto;
  mix-blend-mode: multiply;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  font-weight: 500;
}

.nav a:not(.btn) {
  text-decoration: none;
  position: relative;
  padding: 0.2rem 0;
  color: var(--ink);
  transition: color 0.3s;
}

.nav a.active {
  color: var(--orange);
  font-weight: 700;
}

.nav a:not(.btn):hover {
  color: var(--orange);
}

.nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 100%;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav a.active::after,
.nav a:not(.btn):hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 44px;
  height: 44px;
  cursor: pointer;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s var(--ease);
}

.nav-toggle span:first-child { top: 16px; }
.nav-toggle span:last-child { top: 26px; }

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-5px) rotate(-45deg);
}

/* 5. HERO SECTION */
.page-hero {
  padding: 3.5rem 5% 3rem;
  text-align: center;
  background: linear-gradient(135deg, var(--white) 0%, var(--tint) 100%);
  border-bottom: 1px solid var(--line);
}

.hero-content {
  max-width: 760px;
  margin: 0 auto;
}

.crumbs {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.crumbs a {
  color: var(--orange);
}

.crumbs a:hover {
  text-decoration: underline;
}

.page-hero h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  margin-bottom: 1rem;
}

.page-hero .lead {
  font-size: 1.12rem;
  color: var(--muted);
}

/* 6. FILTER TABS */
.filter-section {
  padding-block: 2rem 1rem;
  background: var(--white);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
}

.tab-btn {
  background: var(--tint);
  border: 1.5px solid var(--line);
  color: var(--strong);
  padding: 0.65rem 1.4rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.tab-btn:hover {
  background: var(--line);
}

.tab-btn.active {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
  box-shadow: 0 4px 14px rgba(199, 75, 23, 0.28);
}

/* 7. TEAM GRID & ADAPTIVE CARDS */
.team-section {
  background: linear-gradient(180deg, var(--white) 0%, var(--tint-accent) 100%);
  padding-bottom: 5rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1240px;
  margin: 0 auto;
}

.team-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  position: relative;
}

.team-card.hidden {
  display: none !important;
}

.team-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: var(--orange);
}

/* Fluid Responsive Image Container */
.member-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4; /* Square & responsive ratio regardless of upload dimensions */
  overflow: hidden;
  background: var(--tint);
}

.member-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Prevents distortion for portrait or landscape uploads */
  object-position: top center;
  display: block;
  transition: transform 0.6s var(--ease);
}

.team-card:hover .member-img-wrap img {
  transform: scale(1.06);
}

.role-badge {
  position: absolute;
  bottom: 0.8rem;
  left: 0.8rem;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--orange);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.role-badge.badge-legacy {
  background: var(--strong);
  color: var(--white);
}

.role-badge.badge-accent {
  background: var(--orange);
  color: var(--white);
}

.member-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.member-info h3 {
  font-size: 1.25rem;
  color: var(--strong);
  margin-bottom: 0.2rem;
}

.member-role {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--orange);
  margin-bottom: 0.8rem;
}

.member-short {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
  flex-grow: 1;
  line-height: 1.5;
}

.member-info .btn {
  align-self: flex-start;
  margin-top: auto;
}

.legacy-card {
  border: 2px solid var(--orange);
  background: linear-gradient(135deg, #FFF9F5 0%, #FFEFE5 100%);
}

/* 8. MODAL DIALOG FOR DETAILED BIO */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(35, 24, 21, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--white);
  border-radius: 28px;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.35s var(--ease);
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  z-index: 310;
  background: var(--tint);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.6rem;
  color: var(--strong);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.3s;
}

.modal-close:hover {
  background: var(--line);
}

.modal-profile-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.8rem;
  padding: 2.2rem 2rem 1.5rem;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
}

.modal-profile-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.modal-header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-header-text h2 {
  font-size: 1.6rem;
  margin-bottom: 0.2rem;
}

.modal-header-text .role {
  color: var(--orange);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.modal-header-text .badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--strong);
  border-radius: 8px;
}

.modal-profile-body {
  padding: 2rem;
}

.modal-profile-body h4 {
  font-size: 1.1rem;
  margin: 1.2rem 0 0.5rem;
  color: var(--strong);
}

.modal-profile-body p {
  font-size: 0.98rem;
  color: var(--ink);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.modal-profile-body ul {
  padding-left: 1.2rem;
  margin-bottom: 1.2rem;
}

.modal-profile-body li {
  margin-bottom: 0.4rem;
  color: var(--muted);
}

/* 9. CALL TO ACTION */
.cta-section {
  background: var(--strong);
  color: var(--white);
  text-align: center;
  padding: 4.5rem 5%;
}

.cta-inner {
  max-width: 680px;
  margin: 0 auto;
}

.cta-section h2 {
  color: var(--white);
  font-size: clamp(2rem, 3.5vw, 2.5rem);
  margin-bottom: 1rem;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.08rem;
  margin-bottom: 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-section .btn-ghost {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}

.cta-section .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--white);
}

/* 10. FOOTER */
.site-footer {
  background: var(--strong);
  color: rgba(255, 255, 255, 0.85);
  padding: 3rem 5%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-footer img {
  height: 48px;
  width: auto;
  border-radius: 8px;
}

.site-footer p {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.7);
}

/* 11. RESPONSIVE MEDIA QUERIES */
@media (max-width: 820px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 1.4rem;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 30px rgba(199, 75, 23, 0.12);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s var(--ease), opacity 0.3s;
  }

  .nav-toggle[aria-expanded="true"] + .nav {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .modal-profile-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
  }

  .modal-profile-img {
    width: 140px;
    margin: 0 auto;
  }

  .modal-header-text .badge {
    align-self: center;
  }
}

@media (max-width: 600px) {
  main {
    padding-top: 72px;
  }

  .section {
    padding: 2.5rem 1.2rem;
  }

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

  .modal-box {
    border-radius: 22px;
  }
}