/* V4: simplified navigation, visual dropdowns and project taxonomy */
:root {
  --land: #667a68;
  --buildings: #b48652;
}

/* ---------- Primary navigation ---------- */
.site-nav {
  gap: 30px;
}

.site-nav > a,
.nav-trigger {
  font-size: 14px;
}

.nav-group {
  position: relative;
}

.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.nav-trigger svg {
  width: 12px;
  height: 12px;
  transition: transform .18s ease;
}

.nav-group:hover .nav-trigger svg,
.nav-group:focus-within .nav-trigger svg {
  transform: rotate(180deg);
}

.nav-panel {
  position: absolute;
  top: calc(100% + 22px);
  left: 50%;
  z-index: 40;
  width: 620px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 22px 55px rgba(53, 21, 28, .16);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -7px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.nav-panel::before {
  content: "";
  position: absolute;
  top: -24px;
  left: 0;
  right: 0;
  height: 24px;
}

.nav-group:hover .nav-panel,
.nav-group:focus-within .nav-panel {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.nav-panel-support {
  left: auto;
  right: -80px;
  width: 500px;
  transform: translateY(-7px);
}

.nav-group:hover .nav-panel-support,
.nav-group:focus-within .nav-panel-support {
  transform: translateY(0);
}

.nav-panel-label {
  display: block;
  margin-bottom: 6px;
  color: var(--burgundy);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 10px;
  font-weight: 600;
}

.nav-panel-intro {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.nav-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.nav-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 13px;
  align-items: center;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  text-decoration: none;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.nav-card:hover,
.nav-card:focus-visible {
  background: var(--white);
  border-color: rgba(116, 42, 58, .34);
  transform: translateY(-2px);
}

.nav-card strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-family: "Libre Caslon Display", Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.05;
}

.nav-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.nav-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.nav-card-links a {
  color: var(--burgundy);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Icon system ---------- */
.icon-wrap {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--soft-burgundy);
  color: var(--burgundy);
}

.icon-wrap svg,
.work-icon svg,
.type-icon svg,
.support-icon svg,
.category-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-projects { background: rgba(102, 122, 104, .14); color: var(--land); }
.icon-education { background: rgba(106, 180, 224, .20); color: var(--deep-burgundy); }
.icon-donate { background: rgba(116, 42, 58, .12); color: var(--burgundy); }
.icon-volunteer { background: rgba(106, 180, 224, .22); color: var(--deep-burgundy); }

.work-icon,
.support-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 28px;
  border-radius: 50%;
}

.work-icon svg,
.support-icon svg {
  width: 32px;
  height: 32px;
}

.rural-icon { background: rgba(102, 122, 104, .16); color: var(--land); }
.urban-icon { background: rgba(180, 134, 82, .17); color: #765128; }
.donate-icon { background: rgba(255,255,255,.14); color: var(--white); }
.volunteer-icon { background: rgba(88, 31, 43,.11); color: var(--deep-burgundy); }

/* ---------- Project taxonomy ---------- */
.work-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 34px;
}

.work-legend.large {
  margin-bottom: 22px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 26px;
}

.type-item {
  min-height: 165px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.type-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 25px;
  border-radius: 50%;
}

.type-item strong {
  display: block;
  margin-bottom: 5px;
  font-family: "Libre Caslon Display", Georgia, serif;
  font-size: 22px;
  font-weight: 400;
}

.type-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.type-restoration .type-icon { background: var(--burgundy); color: var(--white); }
.type-conservation .type-icon { background: var(--baby-blue); color: var(--deep-burgundy); }
.type-land .type-icon { background: var(--land); color: var(--white); }
.type-buildings .type-icon { background: var(--buildings); color: #2f1a14; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}

.tag-restoration {
  background: var(--burgundy);
  color: var(--white);
}

.tag-conservation {
  background: var(--baby-blue);
  color: var(--deep-burgundy);
}

.tag-land {
  background: var(--land);
  color: var(--white);
}

.tag-buildings {
  background: var(--buildings);
  color: #2f1a14;
}

.legend-note {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.work-split,
.support-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.work-column,
.support-option {
  position: relative;
  min-height: 390px;
  padding: 38px;
  border: 1px solid var(--line);
  text-decoration: none;
}

.work-column {
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.work-column h3,
.support-option h3,
.project-card h3 {
  margin: 0 0 16px;
  font-family: "Libre Caslon Display", Georgia, serif;
  font-size: clamp(38px, 4vw, 56px);
  font-weight: 400;
  line-height: 1.02;
}

.work-column p:not(.section-kicker),
.support-option p:not(.section-kicker) {
  max-width: 560px;
  margin-top: 0;
  font-size: 17px;
}

.work-column .arrow,
.support-option .arrow {
  margin-top: auto;
  padding-top: 40px;
  font-size: 30px;
}

.work-column:first-child {
  border-top: 8px solid var(--land);
}

.work-column:last-child {
  border-top: 8px solid var(--buildings);
}

.support-option {
  display: flex;
  flex-direction: column;
}

.donate-option {
  background: var(--burgundy);
  color: var(--white);
}

.donate-option .section-kicker,
.donate-option p {
  color: rgba(255,255,255,.84);
}

.volunteer-option {
  background: var(--baby-blue);
  color: var(--deep-burgundy);
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 50px;
}

.category-heading {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 80px;
  align-items: end;
}

.category-title {
  display: flex;
  gap: 20px;
  align-items: center;
}

.category-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.category-icon.rural-icon,
.category-icon.urban-icon { margin-bottom: 0; }

.category-heading h2 {
  margin: 0;
  font-size: clamp(48px, 6vw, 76px);
}

.category-heading > p {
  margin: 0;
  font-size: 18px;
}

.work-category {
  border-top: 1px solid var(--line);
}

.rural-category {
  background: rgba(102, 122, 104, .08);
}

.urban-category {
  background: rgba(180, 134, 82, .09);
}

.project-card {
  min-height: 390px;
  padding: 34px;
  border: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-card-top {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.project-card h3 {
  font-size: 38px;
}

.project-card p {
  color: var(--muted);
}

.education-heading-icon {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 26px;
  border-radius: 50%;
  background: rgba(88, 31, 43,.12);
  color: var(--deep-burgundy);
}

.education-heading-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-detail + .support-detail {
  border-top: 1px solid var(--line);
}

.support-section-heading {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.support-section-heading .support-icon {
  width: 58px;
  height: 58px;
  margin: 0;
  flex: 0 0 auto;
}

.volunteer-detail {
  background: var(--pale-blue);
}

@media (max-width: 980px) {
  .site-nav { gap: 18px; }
  .nav-panel { width: 560px; }
}

@media (max-width: 820px) {
  .nav-group,
  .nav-trigger {
    width: 100%;
  }

  .nav-trigger {
    justify-content: space-between;
    padding: 12px 0;
  }

  .nav-trigger svg { display: none; }

  .nav-panel,
  .nav-panel-support {
    position: static;
    width: 100%;
    padding: 0 0 12px 14px;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-panel::before,
  .nav-panel-intro,
  .nav-panel-label {
    display: none;
  }

  .nav-panel-grid {
    grid-template-columns: 1fr;
  }

  .nav-card {
    min-height: 68px;
    padding: 10px 0;
    border: 0;
    grid-template-columns: 38px 1fr;
  }

  .nav-card:hover,
  .nav-card:focus-visible {
    background: transparent;
    transform: none;
  }

  .nav-card .icon-wrap {
    width: 36px;
    height: 36px;
  }

  .nav-card .icon-wrap svg {
    width: 20px;
    height: 20px;
  }

  .nav-card-links {
    margin: 4px 0 0 48px;
    padding: 8px 0 0;
  }

  .work-split,
  .support-options,
  .project-list,
  .category-heading,
  .type-grid {
    grid-template-columns: 1fr;
  }

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

  .work-column,
  .support-option,
  .project-card {
    min-height: 300px;
  }

  .category-heading {
    gap: 24px;
  }
}

@media (max-width: 520px) {
  .type-grid { grid-template-columns: 1fr; }
  .category-title { align-items: flex-start; }
}
