@import url("variables.css");

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3, h4, .display-font {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}
a { color: var(--ink); text-decoration: none; }
.icon svg { width: 100%; height: 100%; display: block; }

/* ---------- Form controls (editorial, no glow) ---------- */
.form-control, .form-select {
  border-radius: 0;
  border-color: var(--line);
  box-shadow: none !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--ink);
  box-shadow: none !important;
}
.form-control:hover, .form-select:hover {
  box-shadow: none !important;
}
.form-check-input { box-shadow: none !important; }
.form-check-input:focus { border-color: var(--ink); box-shadow: none !important; }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.btn:focus, .btn:active, .btn-check:focus + .btn {
  box-shadow: none !important;
}

/* ---------- Utility ---------- */
.text-accent { color: var(--sunrise-600); }
.bg-paper-off { background: var(--paper-off); }
.section { padding: 96px 0; }
.section-sm { padding: 56px 0; }
.eyebrow {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sunrise-600);
  display: inline-block;
  margin-bottom: 14px;
}
.hr-line { border: none; border-top: 1px solid var(--line); margin: 0; }
.btn {
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 12px 26px;
}
.btn-accent {
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
}
.btn-accent:hover { background: var(--sunrise-600); border-color: var(--sunrise-600); color: #fff; }
.btn-outline-editorial {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
}
.btn-outline-editorial:hover { background: var(--ink); color: #fff; }
.btn-outline-editorial-light {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.6);
  color: #fff;
}
.btn-outline-editorial-light:hover { background: #fff; color: var(--ink); }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--ink);
  color: rgba(255,255,255,0.75);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
}
.topbar .container { display: flex; justify-content: space-between; padding: 7px 0; flex-wrap: wrap; gap: 8px; }
.topbar a { color: rgba(255,255,255,0.75); }
.topbar a:hover { color: #fff; }

/* ---------- Navbar ---------- */
.navbar-editorial {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.navbar-editorial .navbar-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.navbar-editorial .brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
}
.navbar-editorial .nav-link {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 8px 16px !important;
}
.navbar-editorial .nav-link:hover,
.navbar-editorial .nav-link.active { color: var(--sunrise-600); }
.navbar-editorial .dropdown-menu {
  border-radius: 0;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  margin-top: 8px;
}
.navbar-editorial .dropdown-item {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 18px;
}
.navbar-editorial .dropdown-item:hover,
.navbar-editorial .dropdown-item:focus { background: var(--paper-off); color: var(--sunrise-600); }
.navbar-editorial .dropdown-item.active { background: var(--ink); color: #fff; }

/* ---------- Hero (home) ---------- */
.hero-editorial {
  background: var(--ink);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-editorial .hero-media {
  aspect-ratio: 3/4;
  background: linear-gradient(160deg, #2b2b2b, #0d0d0d);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.25);
  position: relative;
}
.hero-editorial .hero-media .icon { width: 130px; height: 130px; }
.hero-editorial .hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-editorial .hero-media .carousel,
.hero-editorial .hero-media .carousel-inner,
.hero-editorial .hero-media .carousel-item { height: 100%; }
.hero-editorial .hero-media .carousel-item img { height: 100%; }
.hero-editorial .hero-media .placeholder-label {
  position: absolute; bottom: 20px; left: 20px;
  font-size: 0.78rem;
  background: rgba(255,255,255,0.1);
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.25);
}
.hero-editorial h1 {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.05;
  margin-bottom: 22px;
}
.hero-editorial .lead { color: rgba(255,255,255,0.7); font-size: 1.05rem; max-width: 480px; }
.hero-stats { display: flex; gap: 40px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-family: var(--font-display); font-size: 1.6rem; }
.hero-stats span { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.55); }

/* ---------- Load-in animation (runs once on page load, never hides content) ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-editorial .eyebrow,
.hero-editorial h1,
.hero-editorial .lead,
.hero-editorial .hero-actions,
.hero-editorial .hero-stats,
.hero-editorial .hero-visual {
  animation: fadeInUp 0.7s ease both;
}
.hero-editorial .eyebrow { animation-delay: 0.05s; }
.hero-editorial h1 { animation-delay: 0.12s; }
.hero-editorial .lead { animation-delay: 0.2s; }
.hero-editorial .hero-actions { animation-delay: 0.28s; }
.hero-editorial .hero-stats { animation-delay: 0.36s; }
.hero-editorial .hero-visual { animation-delay: 0.15s; }

.founder-strip { background: var(--paper-off); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.founder-photo { aspect-ratio: 4/3; overflow: hidden; border: 1px solid var(--line); }
.founder-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.founder-photo:hover img { transform: scale(1.05); }

/* ---------- Scroll-in slide animation ----------
   IMPORTANT: elements are visible by default. JS opts individual elements
   into the hidden "pending" state right before observing them, and
   guarantees a reveal via IntersectionObserver OR a timeout fallback —
   so nothing can ever get stuck invisible if JS is slow/blocked. */
.reveal-slide { transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-slide.reveal-pending { opacity: 0; transform: translateY(28px); }
.reveal-slide.reveal-in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal-slide, .reveal-slide.reveal-pending { opacity: 1 !important; transform: none !important; transition: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-editorial .eyebrow, .hero-editorial h1, .hero-editorial .lead,
  .hero-editorial .hero-actions, .hero-editorial .hero-stats, .hero-editorial .hero-visual,
  .project-editorial .p-media img, .news-card .n-media img, .pillar-photo img {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Section headings ---------- */
.section-head { max-width: 680px; margin-bottom: 50px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.9rem, 3vw, 2.6rem); margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 1rem; }

/* ---------- Media placeholder blocks (reused across pages) ---------- */
.media-block {
  background: var(--paper-off);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: #c9c5bc;
  aspect-ratio: 4/5;
}
.media-block .icon { width: 90px; height: 90px; }
.media-block.has-photo { padding: 0; }
.media-block.has-photo img { width: 100%; height: 100%; object-fit: cover; }

.video-frame { max-width: 860px; margin: 0 auto; aspect-ratio: 16/9; background: #0d0d0d; }
.video-frame video { width: 100%; height: 100%; object-fit: cover; }
.media-block.wide { aspect-ratio: 16/10; }
.media-block.square { aspect-ratio: 1/1; }

/* ---------- Pillars ---------- */
.pillar-editorial {
  border: 1px solid var(--line);
  padding: 34px 30px;
  height: 100%;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.pillar-editorial:hover { border-color: var(--ink); transform: translateY(-4px); }
.pillar-photo { aspect-ratio: 16/10; margin: -34px -30px 22px; overflow: hidden; }
.pillar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.pillar-editorial:hover .pillar-photo img { transform: scale(1.08); }
.pillar-editorial .num { font-family: var(--font-display); font-size: 0.85rem; color: var(--muted); margin-bottom: 18px; display: block; }
.pillar-editorial h3 { font-size: 1.25rem; margin-bottom: 12px; }
.pillar-editorial p { color: var(--muted); font-size: 0.92rem; margin-bottom: 18px; }
.pillar-editorial a { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--ink); padding-bottom: 3px; }

/* ---------- Form sections (multi-part forms) ---------- */
.form-section {
  border: 1px solid var(--line);
  background: #fff;
  padding: 24px;
  margin-bottom: 24px;
}
.form-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sunrise-600);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Project cards ---------- */
.project-editorial {
  border: 1px solid var(--line);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.project-editorial .p-media {
  aspect-ratio: 16/10;
  background: var(--paper-off);
  display: flex; align-items: center; justify-content: center;
  color: rgba(13,13,13,0.15);
  position: relative;
  border-bottom: 1px solid var(--line);
}
.project-editorial .p-media .icon { width: 54px; height: 54px; }
.project-editorial .p-media.has-photo { padding: 0; overflow: hidden; position: relative; }
.project-editorial .p-media-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}
.project-editorial:hover .p-media-bg { transform: scale(1.08); }
.project-editorial { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.project-editorial:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.project-editorial .p-tag {
  position: absolute; top: 12px; left: 12px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--ink); color: #fff; padding: 4px 10px;
}
.project-editorial .p-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.project-editorial h3 { font-size: 1.05rem; }
.project-editorial p.desc { color: var(--muted); font-size: 0.88rem; flex: 1; }

.progress-track { height: 6px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; background: var(--sunrise-600); }
.progress-fill.disaster { background: var(--ocean-700); }
.progress-fill.community { background: var(--leaf-600); }
.progress-meta { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); }
.progress-meta strong { color: var(--ink); }

/* ---------- Stats strip ---------- */
.stats-strip-editorial { background: var(--paper-off); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-strip-editorial .stat strong { display: block; font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); }
.stats-strip-editorial .stat span { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

/* ---------- Quote block ---------- */
.quote-block { border-left: 3px solid var(--ink); padding-left: 26px; }
.quote-block p { font-family: var(--font-display); font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.4; margin-bottom: 18px; }
.quote-block .attribution { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- News cards ---------- */
.news-card { border: 1px solid var(--line); height: 100%; }
.news-card .n-media { aspect-ratio: 16/10; background: var(--paper-off); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: rgba(13,13,13,0.15); }
.news-card .n-media .icon { width: 40px; height: 40px; }
.news-card .n-media.has-photo { padding: 0; overflow: hidden; }
.news-card .n-media.has-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.news-card { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.news-card:hover .n-media.has-photo img { transform: scale(1.08); }
.news-card .n-body { padding: 22px; }
.news-card .n-date { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 8px; }
.news-card h3 { font-size: 1.02rem; margin-bottom: 10px; }
.news-card p { font-size: 0.88rem; color: var(--muted); }

/* ---------- Timeline (profile page) ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 34px; }
.timeline-item::before {
  content: ""; position: absolute; left: -34px; top: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--sunrise-600); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--sunrise-600);
}
.timeline-item .year { font-family: var(--font-display); font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.timeline-item h4 { font-size: 1.02rem; margin-bottom: 6px; }
.timeline-item p { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* ---------- Ambassador / partner strip ---------- */
.partner-tile {
  border: 1px solid var(--line);
  padding: 26px 18px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-soft);
  height: 100%;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Involved cards ---------- */
.involved-bg {
  position: relative;
  background-size: cover;
  background-position: center;
}
.involved-bg::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,13,13,0.88), rgba(13,13,13,0.94));
}
.involved-bg .container { position: relative; z-index: 1; }
.involved-editorial { border: 1px solid rgba(255,255,255,0.18); padding: 32px 28px; height: 100%; background: rgba(0,0,0,0.2); }
.involved-editorial h3 { color: #fff; margin-bottom: 10px; }
.involved-editorial p { color: rgba(255,255,255,0.62); font-size: 0.9rem; margin-bottom: 20px; }

/* ---------- Footer ---------- */
.footer-editorial { background: var(--ink); color: rgba(255,255,255,0.6); padding-top: 60px; }
.footer-editorial h4 { color: #fff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 18px; }
.footer-editorial ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 0.88rem; }
.footer-editorial ul a { color: rgba(255,255,255,0.65); }
.footer-editorial ul a:hover { color: #fff; }
.footer-editorial .brand { color: #fff; font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 14px; display: block; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 20px 0; font-size: 0.78rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.admin-discreet-link { color: rgba(255,255,255,0.55); opacity: 0.75; }
.admin-discreet-link:hover { opacity: 1; color: #fff; }

/* ---------- Donate modal (bootstrap modal overrides) ---------- */
.amount-grid .amount-option {
  border: 1px solid var(--line);
  text-align: center;
  padding: 12px 0;
  font-weight: 700;
  cursor: pointer;
}
.amount-grid .amount-option.active { border-color: var(--ink); background: var(--ink); color: #fff; }

/* ---------- Filter pills (projects page) ---------- */
.filter-pills .btn { border-radius: 999px; padding: 8px 20px; }

/* ---------- Page banner (sub-pages) ---------- */
.page-banner { background: var(--paper-off); border-bottom: 1px solid var(--line); padding: 54px 0; }
.page-banner .eyebrow { margin-bottom: 10px; }
.page-banner h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page-banner.has-image {
  position: relative;
  background-size: cover;
  background-position: center;
  border-bottom: none;
  padding: 90px 0;
}
.page-banner.has-image::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,13,13,0.65), rgba(13,13,13,0.8));
}
.page-banner.has-image .container { position: relative; z-index: 1; }
.page-banner.has-image h1 { color: #fff; }
.page-banner.has-image .breadcrumb-editorial,
.page-banner.has-image .breadcrumb-editorial a { color: rgba(255,255,255,0.7); }
.page-banner.has-image .breadcrumb-editorial a:hover { color: #fff; }
.breadcrumb-editorial { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.breadcrumb-editorial a { color: var(--muted); }
.breadcrumb-editorial a:hover { color: var(--ink); }
