/*************************************
 BioGreen Website Styles (Unified)
*************************************/
:root { 
  --bg: #F3F0EB; 
  --panel: #F7F4EE; /* Changed: lighter, less yellow */
  --ink: #0a0d0b; 
  --muted: #5b6b62; 
  --accent: #16a34a; 
  --accent-2: #0e7c3a; 
  --ring: rgba(22,163,74,.25); 
  --max: 1400px; 
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--accent-2);
  text-decoration: none;
  transition: opacity 0.2s ease;
} 
a:hover {
  opacity: .9;
}
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px;
  width: 100%;
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243,240,235,0.92); /* Changed: matches page bg with transparency */
  border-bottom: 1px solid rgba(0,0,0,0.1);
  backdrop-filter: blur(6px);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}
.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.menu a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--ink);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.menu a.active,
.menu a:focus-visible { /* Changed: :focus-visible for better accessibility */
  border-color: var(--ring);
  box-shadow: 0 0 0 4px var(--ring);
  outline: none;
}
.menu a:hover {
  background: rgba(241,245,242,0.7);
}

.brand a {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.brand a:hover {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.brand img {
  height: 44px;
  width: auto;
  display: block;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
}
.dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.dropdown-toggle:hover {
  background: rgba(241,245,242,0.7);
}
.dropdown-toggle::after {
  content: "▼";
  font-size: 10px;
  transition: transform 0.2s;
  margin-left: 4px;
}
.dropdown.open .dropdown-toggle::after {
  transform: rotate(180deg);
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  display: none;
  z-index: 100;
  margin-top: 4px;
  backdrop-filter: blur(4px);
}
.dropdown.open .dropdown-menu {
  display: block;
}
.dropdown-menu a {
  display: block;
  padding: 8px 16px;
  border-radius: 0;
  border: none;
  white-space: nowrap;
}
.dropdown-menu a:hover {
  background: rgba(241,245,242,0.7);
}

/* Mobile burger */
.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
}
.menu-toggle:focus-visible { /* Changed: :focus-visible */
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (max-width: 860px) {
  .brand img {
    height: 44px;
  }
  .menu-toggle {
    display: inline-block;
  }
  .menu {
    position: absolute;
    top: 100%;
    right: 16px;
    left: 16px;
    flex-direction: column;
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 12px;
    display: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    backdrop-filter: blur(4px);
  }
  .menu.open {
    display: flex;
  }
  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    display: none;
    padding-left: 12px;
    background: transparent;
    backdrop-filter: none;
  }
  .dropdown.open .dropdown-menu {
    display: block;
  }
  .dropdown-toggle::after {
    margin-left: auto;
  }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 2px solid var(--accent);
  transition: all .2s ease;
  cursor: pointer;
  text-align: center;
  font-size: 16px;
}
.btn:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  opacity: 1;
}
.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn.secondary:hover {
  background: var(--accent);
  color: #fff;
}

/* Hero banners */
.hero {
  position: relative;
  min-height: 66vh;
  display: flex;
  align-items: center;
  color: #fff;
  background: 
    linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.45) 60%, rgba(0,0,0,.30)),
    var(--hero-img, url('images/hero_home.jpg')) center 45% / cover no-repeat;
}
.hero .container {
  z-index: 1;
  text-align: left;
  padding: 80px 24px;
  position: relative;
}
.hero h1,
.hero p,
.hero .kicker {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.hero h1 {
  font-size: clamp(32px, 5vw, 60px);
  font-weight: 800;
  margin: 0 0 12px;
}
.hero p {
  max-width: 800px;
  margin: 0 0 20px;
  font-size: clamp(16px, 2vw, 18px);
}
.hero .actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.hero.small {
  min-height: 38vh;
  background: 
    linear-gradient(180deg, rgba(0,0,0,.50), rgba(0,0,0,.35)),
    var(--hero-img, url('images/banner_generic.jpg')) center / cover no-repeat;
}

/* Sections */
.section {
  padding: 40px 0;
  border-top: 1px solid rgba(0,0,0,0.1);
}
.section:first-of-type {
  border-top: none;
}
.section h2 {
  font-size: clamp(22px, 3vw, 32px);
  margin: 0 0 16px;
}
.partners-page .section {
  padding: 24px 0;
}
.kicker {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .15em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 600;
}
.lead {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.6;
}

/* Cards & grids */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.card.media {
  padding: 0;
  overflow: hidden;              /* clip image to radius */
}

.card.media .content {
  padding: 16px 20px;
}

.card.media img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  margin: 0;
  border-radius: 0;
}

.news-card {
  display: flex;
  flex-direction: column;
}

.news-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  margin: 0 0 12px;
  border-radius: 12px;
}

/* Clickable cards should not look like links */
.partners-grid a.card,
a.news-card {
  text-decoration: none;
  color: inherit;
}

.partners-grid a.card:hover,
a.news-card:hover {
  opacity: 1; /* override global a:hover dim */
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 380px);
  gap: 24px;
  justify-content: center;
}

.partners-grid .card.media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  padding: 16px;
  background: #fff;
}

/* Card media should be flush + clipped by the card */
.card {
  background: var(--panel);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 16px;
  padding: 20px;                 /* default text card padding */
  transition: transform .2s ease, box-shadow .2s ease;
}


.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}
.card p.lead {
  margin: 6px 0 0;
  line-height: 1.55;
}

/* Team Cards (FIXED: No longer conflicts with .card) */
.team-card {
  background: #e9f8ee;
  border: 1px solid #b7e1c1;
  border-radius: 16px;
  text-align: center;
  transition: all .25s ease;
  text-decoration: none;
  color: inherit;
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.team-card:hover {
  background: #d4f0db;
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}
.team-card img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: block;
  border: 3px solid #fff;
  transition: transform .2s ease;
}
.team-card:hover img {
  transform: scale(1.03);
}
.team-card h3 {
  margin: 8px 0 4px;
  font-weight: 700;
  color: var(--ink);
}
.team-card p.lead {
  font-size: 16px;
  color: var(--muted);
  margin: 4px 0;
  flex-grow: 1;
}

/* Legacy team selectors (compatibility) */
#lead img,
#leads img,
#members img,
#alumni img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: block;
  border: 2px solid rgba(0,0,0,0.1);
}
#lead .lead,
#leads .lead,
#members .lead,
#alumni .lead {
  line-height: 1.3;
  margin: 4px 0;
  font-size: 17px;
}

.members-cta {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
}
.members-divider {
  width: 70%;
  border: 0;
  border-top: 2px solid #16a34a;
}
.btn-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* Footer */
.footer {
  border-top: 1px solid rgba(0,0,0,0.1);
  background: rgba(243,240,235,0.98); /* Changed: matches header */
  padding: 40px 0 24px;
}
.footer .cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}
.footer small {
  color: var(--muted);
  display: block;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.1);
}

/* Newsletter Form (FIXED: Scoped styling) */
#newsletter form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
#newsletter input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 16px;
  transition: border-color 0.2s ease;
  background: white;
}
#newsletter input[type="email"]:focus-visible { /* Changed: :focus-visible */
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
#newsletter .btn {
  flex-shrink: 0;
}

/* DO NOT use global form styling - it breaks other forms! */
/* form { ... } */

/* Logos */
.logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
}
.logo-row img {
  height: 54px;
  background: #f6f8f7;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  padding: 8px;
  object-fit: contain;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0;
}
.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  text-align: left;
}
.table th {
  background: rgba(249,250,251,0.7);
  font-weight: 600;
}
.table tr:last-child td {
  border-bottom: none;
}
@media (max-width: 600px) {
  .table {
    font-size: 14px;
  }
  .table th,
  .table td {
    padding: 8px;
  }
}

/* Past Team Toggle (Cohorts) */
details.cohort {
  margin-top: 16px;
}

details.cohort summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  border-radius: 14px;
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, #e9f8ee, #f3f0eb);
  font-weight: 700;
  color: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.25s ease;
  outline: none;
}

/* Remove default arrow */
details.cohort summary::-webkit-details-marker {
  display: none;
}

/* Hover */
details.cohort summary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
}

/* Arrow indicator */
details.cohort summary::after {
  content: "▸";
  font-size: 18px;
  transition: transform 0.25s ease;
}

/* Open state */
details.cohort[open] summary {
  background: linear-gradient(135deg, #d4f0db, #f3f0eb);
}

details.cohort[open] summary::after {
  transform: rotate(90deg);
}

details.cohort .cohort-body {
  margin-top: 16px;
  animation: fadeSlideIn 0.35s ease;
  padding: 0 4px;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Alternating feature rows (Vision/Mission/Values) */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 22px;
  align-items: center;
  margin-top: 26px;
}

.feature-row.reverse {
  direction: rtl;
}

.feature-row.reverse > * {
  direction: ltr;
}

.feature-media {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.06);
}

.feature-media img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  display: block;
}

.feature-text h2 {
  margin-top: 0;
}

/* Mobile */
@media (max-width: 860px) {
  .feature-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .feature-media img {
    height: 260px;
  }
  .feature-row.reverse {
    direction: ltr;
  }
}

/* Side decorative leaves (desktop only) */
.side-decor {
  position: fixed;
  top: 120px;
  bottom: 80px;
  opacity: .12;
  z-index: 0;
  pointer-events: none;
}
.side-decor.left {
  left: 8px;
}
.side-decor.right {
  right: 8px;
}
.side-decor img {
  height: 70vh;
  object-fit: contain;
  max-height: 100%;
}
@media (max-width: 1024px) {
  .side-decor {
    display: none;
  }
}

/* Scroll-in animations (subtle) */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.show {
  opacity: 1;
  transform: none;
}

/* Responsive tweaks */
@media (max-width: 700px) {
  .menu {
    gap: 6px;
  }
  .menu a {
    padding: 8px 10px;
  }
  .container {
    padding: 16px;
  }
  .section {
    padding: 24px 0;
  }
  .hero .container {
    padding: 40px 16px;
  }
}

/* Optional legacy gallery */
.gallery-grid {
  columns: 320px;
  column-gap: 14px;
}
.gallery-grid img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  margin: 0 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
}

/* No news message */
.no-news {
  text-align: center;
  padding: 40px 0;
  color: var(--muted);
}

/* Utility classes */
.text-center {
  text-align: center;
}
/* Utility classes */
.btn-center{
  display:flex;
  justify-content:center;
  align-items:center;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
