:root{
  --bg:#ffffff;
  --text:#1a1a1a;
  --muted:#555;
  --border:#e6e6e6;
  --panel:#f6f6fb;

  /* Accent (polished charity purple) */
  --accent:#6b2fbf;

  --radius:14px;
  --max:1120px;
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  line-height:1.55;
  color:var(--text);
  background:var(--bg);
  overflow-x:hidden; /* safety: prevent sideways scroll */
}

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

a{
  color:var(--accent);
  text-decoration-thickness:.08em;
  text-underline-offset:.15em;
}
a:hover{text-decoration-thickness:.14em}

:focus-visible{
  outline:3px solid rgba(107,47,191,.35);
  outline-offset:3px;
  border-radius:10px;
}

.container{
  width:min(var(--max),calc(100% - 2rem));
  margin-inline:auto;
}

/* Screen-reader only */
.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;
}

/* =========================
   Header / Nav
========================= */
.site-header{
  position:sticky;
  top:0;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border);
  z-index:1000;
}

/* subtle brand strip */
.site-header::after{
  content:"";
  display:block;
  height:3px;
  background:linear-gradient(90deg, var(--accent), rgba(107,47,191,.25));
}

.header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:.9rem 0;
}

.brand-wrap{
  display:flex;
  flex-direction:column;
  line-height:1.1;
}

.brand{
  font-weight:900;
  letter-spacing:.2px;
  text-decoration:none;
  color:inherit;
  display:inline-flex;
  align-items:center;
  gap:.6rem;
}

/* optional tiny mark if you ever want it */
.brand::before{
  content:"";
  width:12px;
  height:12px;
  border-radius:999px;
  background:var(--accent);
  display:inline-block;
  box-shadow:0 8px 18px rgba(107,47,191,.25);
}

.brand-sub{
  font-size:.75rem;
  color:var(--muted);
  font-weight:600;
  letter-spacing:.2px;
  margin-top:.2rem;
}

.nav-toggle{
  display:none;
  border:1px solid var(--border);
  background:#fff;
  border-radius:12px;
  padding:.5rem .7rem;
  font-size:1.1rem;
  line-height:1;
}

.nav{
  display:flex;
  gap:.8rem;
  align-items:center;
}

.nav a{
  padding:.45rem .6rem;
  border-radius:10px;
  text-decoration:none;
  color:inherit;
}
.nav a:hover{background:var(--panel)}

.nav .cta{
  background:var(--accent);
  color:#fff;
  padding:.55rem .85rem;
  border-radius:999px;
}
.nav .cta:hover{filter:brightness(.95)}

/* =========================
   Header Social Links
========================= */
.social-header{
  display:flex;
  gap:.6rem;
  align-items:center;
  font-size:.9rem;
}

.social-header a{
  text-decoration:none;
  color:var(--muted);
  padding:.3rem .5rem;
  border-radius:8px;
}

.social-header a:hover{
  background:var(--panel);
  color:var(--accent);
}

/* =========================
   Hero
========================= */
.hero{
  padding:2.4rem 0 1.8rem;
  background:
    radial-gradient(900px 280px at 12% 0%, rgba(107,47,191,.14), transparent),
    radial-gradient(700px 240px at 90% 10%, rgba(107,47,191,.10), transparent);
  border-bottom:1px solid var(--border);
}

.hero-grid{
  display:grid;
  gap:1.4rem;
  grid-template-columns: 1.1fr .9fr;
  align-items:center;
}

.hero h1{
  margin:.2rem 0 .6rem;
  font-size:clamp(2rem,4vw,3rem);
  line-height:1.1;
}

.lead{
  margin:0 0 1rem;
  color:var(--muted);
  max-width:60ch;
}

.hero-actions{
  display:flex;
  gap:.7rem;
  flex-wrap:wrap;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:.7rem 1rem;
  border-radius:999px;
  border:1px solid var(--border);
  text-decoration:none;
  font-weight:700;
  color:inherit;
  background:#fff;
}
.btn:hover{background:var(--panel)}
.btn.primary{
  background:var(--accent);
  color:#fff;
  border-color:transparent;
}
.btn.primary:hover{filter:brightness(.95)}

/* Hero image uses team photo with a deeper overlay */
.hero-image{
  width:100%;
  aspect-ratio:4/3;
  border-radius:calc(var(--radius) + 6px);
  background-image:
    linear-gradient(rgba(25,20,60,.35), rgba(25,20,60,.35)),
    url("/assets/img/team-large.jpg");
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  border:1px solid rgba(0,0,0,.06);
  box-shadow:0 20px 40px rgba(0,0,0,.08);
}

/* =========================
   Impact Strip
========================= */
.impact-strip{
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
  background:#fff;
  padding:1.1rem 0;
}

.impact-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:1rem;
  text-align:center;
}

.impact-grid strong{
  display:block;
  font-size:1.1rem;
}

.impact-grid span{
  display:block;
  font-size:.85rem;
  color:var(--muted);
}

/* =========================
   Sections / Cards
========================= */
.section{padding:2.2rem 0}

.section h2{
  margin:0 0 .4rem;
  font-size:1.7rem;
}

.sub{
  margin:0;
  color:var(--muted);
  max-width:70ch;
}

.cards{
  display:grid;
  gap:1rem;
  margin-top:1rem;
}
.cards.three{grid-template-columns:repeat(3,1fr)}

.card{
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:1rem;
  background:#fff;
  box-shadow:0 8px 22px rgba(0,0,0,.04);
}
.card .meta{
  margin:0 0 .35rem;
  color:var(--muted);
  font-weight:750;
  font-size:.95rem;
}
.card h3{
  margin:0 0 .4rem;
  font-size:1.1rem;
}
.card p{
  margin:0;
  color:var(--muted);
}

/* =========================
   Simple Page Hero
========================= */
.page-hero{
  padding: 2rem 0 1.4rem;
  border-bottom:1px solid var(--border);
  background: radial-gradient(900px 280px at 12% 0%, rgba(107,47,191,.12), transparent);
}

/* Alternate section background */
.section-alt{
  background: var(--panel);
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
}

/* Calendar placeholder */
.calendar-placeholder{
  margin-top: 1rem;
  border:1px dashed rgba(107,47,191,.35);
  border-radius: calc(var(--radius) + 6px);
  padding: 1.2rem;
  background: #fff;
}

/* =========================
   Team cards
========================= */
.team-grid{
  display:grid;
  gap: 1rem;
}

.team-card{
  display:grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  border:1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background:#fff;
  box-shadow:0 8px 22px rgba(0,0,0,.04);
  overflow:hidden;
}

.team-photo{
  background: linear-gradient(135deg, rgba(107,47,191,.18), rgba(44,44,122,.10));
  min-height: 220px;
  position:relative;
}

.team-photo img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.team-photo-fallback{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(26,26,26,.65);
  font-weight:800;
  letter-spacing:.2px;
  pointer-events:none;
}

/* Hide fallback when an image exists */
.team-photo img + .team-photo-fallback{ display:none; }
/* Show fallback only if we add fallback class */
.team-photo--fallback .team-photo-fallback{ display:flex; }

.team-body{
  padding: 1rem 1rem 1.1rem;
}

.team-name{
  margin: 0 0 .25rem;
  font-size: 1.3rem;
}

.team-role{
  margin: 0 0 .7rem;
  color: var(--muted);
  font-weight: 750;
}

.team-bio{
  margin:0;
  color: var(--muted);
  max-width: 90ch;
}

/* =========================
   Memoriam page
========================= */
.memoriam-hero{
  background: radial-gradient(900px 280px at 12% 0%, rgba(107,47,191,.10), transparent);
}

.memoriam-title{
  margin: 0 0 .25rem;
  font-size: 1.6rem;
}

.memoriam-prose{
  margin-top: 1rem;
  max-width: 85ch;
  color: var(--muted);
}

.memoriam-prose p{ margin: 0 0 .9rem; }

.memoriam-emphasis{
  font-weight: 850;
  color: var(--text);
}

.memoriam-signoff{
  font-weight: 800;
  color: var(--text);
  margin-top: .25rem;
}

.memoriam-divider{
  border:0;
  border-top:1px solid var(--border);
  margin: 2rem 0;
}

.memoriam-tribute{
  margin-top: 1.2rem;
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: 1.2rem;
  align-items:start;
}

.memoriam-photo{
  position:relative;
  border-radius: calc(var(--radius) + 6px);
  overflow:hidden;
  border:1px solid rgba(0,0,0,.06);
  background: linear-gradient(135deg, rgba(107,47,191,.16), rgba(44,44,122,.10));
  min-height: 240px;
}

.memoriam-photo img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.memoriam-photo-fallback{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(26,26,26,.65);
  font-weight: 850;
  letter-spacing:.2px;
  pointer-events:none;
}

.memoriam-photo img + .memoriam-photo-fallback{ display:none; }
.memoriam-photo--fallback .memoriam-photo-fallback{ display:flex; }

/* =========================
   Gallery
========================= */
.gallery-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-item{
  display:block;
  border-radius: calc(var(--radius) + 6px);
  overflow:hidden;
  border:1px solid rgba(0,0,0,.06);
  background: var(--panel);
  box-shadow:0 8px 22px rgba(0,0,0,.04);
}

.gallery-item img{
  width:100%;
  height: 260px;
  object-fit: cover;
  display:block;
  transform: scale(1);
  transition: transform .18s ease;
}

.gallery-item:hover img{ transform: scale(1.03); }

.gallery-empty{
  border:1px dashed rgba(107,47,191,.35);
  border-radius: calc(var(--radius) + 6px);
  padding: 1.2rem;
  background: #fff;
}

/* =========================
   Footer
========================= */
.site-footer{
  border-top:1px solid var(--border);
  padding:1.4rem 0;
  color:var(--muted);
  background:#fff;
}

/* =========================
   Downloads
========================= */
.downloads-box{
  border:1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background:#fff;
  box-shadow:0 8px 22px rgba(0,0,0,.04);
  padding:1.2rem;
  max-width: 620px;
}

.downloads-form{
  margin-top: .9rem;
  display:grid;
  gap:.7rem;
}

.downloads-label{
  font-weight:750;
  color: var(--text);
}

.downloads-input{
  padding:.75rem .85rem;
  border-radius:12px;
  border:1px solid var(--border);
  font-size:1rem;
}

.downloads-error{
  margin:.7rem 0 0;
  color:#8a1f1f;
  font-weight:750;
}

.downloads-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  margin-bottom: 1rem;
}

.downloads-list{
  display:grid;
  gap:.7rem;
  margin-top:1rem;
}

.downloads-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:.9rem 1rem;
  border:1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background:#fff;
  text-decoration:none;
  color:inherit;
  box-shadow:0 8px 22px rgba(0,0,0,.04);
}

.downloads-item:hover{
  background: var(--panel);
}

.downloads-name{
  font-weight:800;
}

.downloads-meta{
  color: var(--muted);
  font-weight:700;
  font-size:.9rem;
}


/* =========================
   Lightbox
========================= */
.lightbox{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.92);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:2000;
}

.lightbox.is-open{ display:flex; }

.lightbox-image{
  max-width:90%;
  max-height:85%;
  border-radius:8px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next{
  position:absolute;
  background:none;
  border:none;
  color:#fff;
  font-size:2rem;
  cursor:pointer;
  padding:.5rem 1rem;
}

.lightbox-close{
  top:20px;
  right:30px;
  font-size:2.5rem;
}

.lightbox-prev{
  left:20px;
  top:50%;
  transform:translateY(-50%);
}

.lightbox-next{
  right:20px;
  top:50%;
  transform:translateY(-50%);
}

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover{ opacity:.7; }

/* =========================
   Responsive
========================= */
@media (max-width: 860px){
  .hero{padding:2.0rem 0 1.4rem}
  .hero-grid{grid-template-columns:1fr}
  .cards.three{grid-template-columns:1fr}
  .impact-grid{grid-template-columns:1fr}

  .gallery-grid{ grid-template-columns: 1fr; }
  .gallery-item img{ height: 240px; }

  .team-card{ grid-template-columns: 1fr; }
  .team-photo{ min-height: 240px; }

  .memoriam-tribute{ grid-template-columns: 1fr; }
  .memoriam-photo{ min-height: 260px; }

  /* Hide desktop social links on mobile */
  .social-header{ display:none; }

  /* Burger appears */
  .nav-toggle{ display:inline-flex; }

  /* Nav becomes a dropdown panel */
  .nav{
    display:none;
    position:absolute;
    right:1rem;
    top:72px;
    flex-direction:column;
    align-items:stretch;
    background:#fff;
    border:1px solid var(--border);
    border-radius:16px;
    padding:.5rem;
    width:min(320px, calc(100% - 2rem));
    box-shadow:0 20px 40px rgba(0,0,0,.08);
    gap:.25rem;
  }

  .nav.is-open{ display:flex; }

  .nav a{
    justify-content:center;
    padding:.7rem .9rem;
  }

  .nav .cta{ text-align:center; }
}

/* =========================
   Team photo placeholder
   (SVG initials avatar shown when no photo is available)
========================= */
.team-photo-placeholder {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ede6fa;
}
.team-photo-placeholder svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================
   Team tree image
========================= */
.team-tree-section {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 1.8rem 0;
}

.team-tree-figure {
  margin: 0;
  display: flex;
  justify-content: center;
}

.team-tree-img {
  max-width: 600px;
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
}

@media (max-width: 860px) {
  .team-tree-img {
    max-width: 100%;
    border-radius: 10px;
  }
}
