/* CharityRock Foundation — design system */
:root {
  --green: #1b7a3a;
  --green-dark: #145c2c;
  --green-deeper: #0f4521;
  --green-soft: #e8f5ec;
  --green-mid: #2d9a4f;
  --lilac: #c084c8;
  --lilac-soft: #f3e8f5;
  --ink: #142018;
  --muted: #4a5c50;
  --line: #d5e3da;
  --surface: #ffffff;
  --bg: #f6faf7;
  --dark: #0f1a13;
  --footer: #122018;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(20, 32, 24, 0.08);
  --shadow-sm: 0 4px 14px rgba(20, 32, 24, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --max: 1120px;
  --header-h: 72px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Accessibility: skip link + focus */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  background: var(--white);
  color: var(--green-dark);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

:focus-visible {
  outline: 3px solid var(--green-mid);
  outline-offset: 2px;
}

main:focus {
  outline: none;
}

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

a {
  color: var(--green);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

a:hover {
  color: var(--green-dark);
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

p {
  margin: 0 0 1rem;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--green);
  color: var(--white);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  font-weight: 700;
}

.brand:hover {
  color: var(--white);
  opacity: 0.95;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand-text span {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.9;
  font-style: italic;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
  border-bottom-color: rgba(255, 255, 255, 0.85);
}

.nav-links .nav-cta {
  background: var(--white);
  color: var(--green) !important;
  border-bottom: none !important;
  padding: 0.55rem 1rem !important;
  border-radius: 999px;
  font-weight: 700;
}

.nav-links .nav-cta:hover {
  background: var(--green-soft);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--white);
  cursor: pointer;
  padding: 0.4rem;
}

.menu-toggle svg {
  width: 28px;
  height: 28px;
}

.mobile-menu {
  display: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.75rem 0 1rem;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  color: var(--white);
  padding: 0.7rem 0;
  font-weight: 500;
}

.mobile-menu a.mobile-cta {
  display: inline-flex;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  background: var(--white);
  color: var(--green) !important;
  font-weight: 700;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
}

/* Hero */
.hero {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255, 255, 255, 0.12), transparent 45%),
    linear-gradient(135deg, var(--green) 0%, var(--green-dark) 55%, var(--green-deeper) 100%);
  color: var(--white);
  padding: 4.5rem 0 4rem;
  text-align: center;
}

.hero-compact {
  padding: 3rem 0;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  max-width: 18ch;
  margin-inline: auto;
  margin-bottom: 1rem;
}

.hero .lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  opacity: 0.95;
  margin-bottom: 0.5rem;
}

.hero .sub {
  max-width: 42rem;
  margin: 0 auto 1.75rem;
  opacity: 0.9;
  font-size: 1.05rem;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--green-soft);
  color: var(--green-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.65);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

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

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

.btn-outline {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}

.btn-outline:hover {
  background: var(--green-soft);
  color: var(--green-dark);
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--surface);
}

.section-green {
  background: var(--green);
  color: var(--white);
}

.section-green h2,
.section-green h3,
.section-green p {
  color: var(--white);
}

.section-dark {
  background: var(--footer);
  color: var(--white);
}

.section-dark h2,
.section-dark p {
  color: var(--white);
}

.section-head {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 2.5rem;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.section-head p {
  color: var(--muted);
}

.section-green .section-head p {
  color: rgba(255, 255, 255, 0.88);
}

/* Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

.card-icon svg {
  width: 28px;
  height: 28px;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--muted);
  margin-bottom: 0;
  font-size: 0.98rem;
}

.card .meta {
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 700;
  font-size: 0.92rem;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.stat-label {
  opacity: 0.9;
  font-size: 0.95rem;
}

/* Values / story */
.story-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.story-panel {
  background: linear-gradient(160deg, var(--green-soft), #fff 60%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.story-panel .motto {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--green-dark);
  margin: 1rem 0 0.25rem;
}

.story-panel .slogan {
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.02em;
}

.person-card {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--white);
  background: linear-gradient(135deg, var(--green-mid), var(--green-dark));
}

.avatar-img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  object-fit: cover;
  border: 3px solid var(--green-soft);
  box-shadow: var(--shadow-sm);
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff !important;
  transition: background 0.2s ease, transform 0.2s ease;
}

.social-btn:hover {
  background: var(--green);
  transform: translateY(-2px);
  color: #fff !important;
}

.social-btn.social-wa {
  background: rgba(37, 211, 102, 0.25);
}

.social-btn.social-wa:hover {
  background: #25d366;
}

.donate-card h3 {
  margin-bottom: 0.75rem;
}

.donate-dl {
  margin: 1rem 0;
}

.donate-dl > div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

.donate-dl dt {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.donate-dl dd {
  margin: 0;
}

.small-note {
  font-size: 0.9rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0;
}

.person-card h3 {
  margin-bottom: 0.25rem;
}

.person-card .role {
  color: var(--green);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
}

.person-card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

/* Lists */
.check-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.check-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.55rem;
  color: var(--muted);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

/* Forms */
.form-card,
.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid #c5d4cb;
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 122, 58, 0.18);
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  pointer-events: none !important;
}

.btn-block {
  width: 100%;
  margin-top: 0.5rem;
}

.errorlist {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
  color: #b42318;
  font-size: 0.85rem;
}

/* Alerts */
.messages {
  width: min(100% - 2rem, var(--max));
  margin: 1rem auto 0;
}

.alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.alert-success {
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid #b7dfc4;
  box-shadow: var(--shadow-sm);
}

.alert-error {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
}

.messages {
  position: relative;
  z-index: 50;
}

/* Contact layout */
.contact-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.75rem;
  align-items: start;
}

.contact-item {
  display: flex;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.contact-item .icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.contact-item .icon svg {
  width: 22px;
  height: 22px;
}

.contact-item strong {
  display: block;
  margin-bottom: 0.15rem;
}

.contact-item p {
  margin: 0;
  color: var(--muted);
}

/* Footer */
.site-footer {
  background: var(--footer);
  color: rgba(255, 255, 255, 0.88);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.site-footer h3,
.site-footer h4 {
  color: var(--white);
  margin-bottom: 0.9rem;
}

.site-footer p,
.site-footer li {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin-bottom: 0.45rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.8);
}

.site-footer a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
}

.slogan-bar {
  background: var(--green-dark);
  color: var(--white);
  text-align: center;
  padding: 0.65rem 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

/* Project detail */
.prose {
  max-width: 48rem;
}

.prose h2 {
  margin-top: 1.5rem;
}

.tag {
  display: inline-block;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

/* Involved paths */
.involve-card {
  border-top: 4px solid var(--green);
}

/* Project cards with cover images */
.project-card {
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.project-card .project-cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--green-soft);
}

.project-card .project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.project-card:hover .project-cover img {
  transform: scale(1.04);
}

.project-card .project-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.project-card .tag {
  margin-bottom: 0.35rem;
}

/* Gallery */
.album-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.album-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.album-chip:hover {
  border-color: var(--green);
  color: var(--green);
}

.album-chip.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--green-soft);
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.05);
}

.gallery-item:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.55rem 0.75rem;
  background: linear-gradient(transparent, rgba(15, 26, 19, 0.78));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
}

.gallery-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.project-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 14, 10, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 3.5rem;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-figure img[hidden] {
  display: none;
}

.lightbox-figure {
  margin: 0;
  max-width: min(1000px, 100%);
  max-height: 90vh;
  text-align: center;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  margin: 0 auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.lightbox-figure figcaption {
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.85rem;
  font-size: 0.95rem;
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  font-size: 2.2rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--muted); }

/* Responsive */
@media (max-width: 900px) {
  .grid-3,
  .grid-4,
  .stats,
  .footer-grid,
  .story-grid,
  .contact-grid,
  .form-grid,
  .gallery-grid,
  .gallery-preview-grid,
  .project-photo-grid {
    grid-template-columns: 1fr;
  }

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

  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    padding: 3.25rem 0 3rem;
  }

  .lightbox {
    padding: 3rem 0.75rem;
  }
}

@media (min-width: 700px) and (max-width: 900px) {
  .grid-2,
  .stats,
  .gallery-grid,
  .gallery-preview-grid,
  .project-photo-grid {
    grid-template-columns: 1fr 1fr;
  }
}
