/* =========================================================
   Hassanamisco Nipmuc Tribe — site stylesheet
   Palette: river teal / cedar / moss / birch parchment
   Display: Fraunces  |  Body: Source Sans 3  |  Utility: IBM Plex Mono
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Source+Sans+3:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink: #1F2E29;
  --parchment: #F1EFE3;
  --parchment-dim: #E7E3D2;
  --river: #2B5F6B;
  --river-deep: #1D454F;
  --cedar: #9A3E2D;
  --moss: #5C7A4E;
  --line: #D3CDB6;
  --paper-shadow: rgba(31, 46, 41, 0.10);

  --display: 'Fraunces', serif;
  --body: 'Source Sans 3', sans-serif;
  --mono: 'IBM Plex Mono', monospace;

  --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--river-deep); }
a:hover { color: var(--cedar); }

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Skip link / focus ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--parchment);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

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

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--ink);
  color: var(--parchment);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(241,239,227,0.15);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--parchment);
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.brand-text {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.15;
}
.brand-text small {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #B9C7C0;
  font-weight: 400;
}

nav.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

nav.primary-nav a {
  color: #D8DFD9;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 8px 12px;
  border-radius: 3px;
  white-space: nowrap;
}

nav.primary-nav a:hover,
nav.primary-nav a[aria-current="page"] {
  background: rgba(241,239,227,0.10);
  color: #fff;
}
nav.primary-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--cedar);
}

/* ---------- Dropdown nav items ---------- */
.nav-item { position: relative; }

.nav-item > button {
  color: #D8DFD9;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 3px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav-item > button:hover,
.nav-item.open > button {
  background: rgba(241,239,227,0.10);
  color: #fff;
}
.nav-item.has-current > button {
  box-shadow: inset 0 -2px 0 var(--cedar);
  color: #fff;
}
.nav-item .caret {
  font-size: 0.6rem;
  transition: transform 0.15s ease;
}
.nav-item.open .caret { transform: rotate(180deg); }

.nav-item .dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(31,46,41,0.18);
  min-width: 210px;
  padding: 8px;
  z-index: 60;
}
.nav-item.open .dropdown { display: block; }

.nav-item .dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: normal;
}
.nav-item .dropdown a:hover,
.nav-item .dropdown a[aria-current="page"] {
  background: var(--parchment);
  color: var(--cedar);
  box-shadow: none;
}

.nav-toggle {
  display: none;
}

@media (max-width: 900px) {
  nav.primary-nav {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    padding-top: 8px;
  }
  nav.primary-nav.open { display: flex; }
  .site-header .wrap { flex-wrap: wrap; }
  .nav-item { width: 100%; }
  .nav-item > button { width: 100%; justify-content: space-between; }
  .nav-item .dropdown {
    display: none;
    position: static;
    box-shadow: none;
    border: none;
    background: rgba(241,239,227,0.06);
    margin-top: 4px;
    padding: 4px;
  }
  .nav-item.open .dropdown { display: block; }
  .nav-item .dropdown a { color: #D8DFD9; }
  .nav-item .dropdown a:hover,
  .nav-item .dropdown a[aria-current="page"] { background: rgba(241,239,227,0.1); color: #fff; }
  .nav-toggle {
    display: inline-flex;
    background: none;
    border: 1px solid rgba(241,239,227,0.3);
    color: var(--parchment);
    font-family: var(--body);
    font-size: 0.85rem;
    padding: 7px 12px;
    border-radius: 3px;
  }
}

/* ---------- Braid / current divider (signature element) ---------- */
.braid {
  height: 26px;
  width: 100%;
  display: block;
  color: var(--river);
}
.braid.cedar { color: var(--cedar); }
.braid.moss { color: var(--moss); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--river-deep) 0%, var(--river) 100%);
  color: var(--parchment);
  padding: 76px 0 64px;
  position: relative;
  overflow: hidden;
}

.hero .wrap { position: relative; z-index: 2; }

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: #AFCBC9;
  margin: 0 0 18px;
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(241,239,227,0.14);
}

/* On light backgrounds (section heads on parchment/dim/white cards), the pale
   hero eyebrow color has poor contrast — use a darker, legible tone instead. */
.section-head .eyebrow,
.band-parchment .eyebrow,
.band-dim .eyebrow,
.band-cedar-tint .eyebrow,
.band-moss-tint .eyebrow {
  color: var(--river-deep);
  font-weight: 600;
  background: rgba(43,95,107,0.10);
}
.band-cedar-tint .eyebrow { background: rgba(154,62,45,0.12); color: #7A2F1F; }
.band-moss-tint .eyebrow { background: rgba(92,122,78,0.14); color: #3E5233; }
.band-river .eyebrow,
.band-ink .eyebrow,
.hero .eyebrow {
  color: #AFCBC9;
  font-weight: 400;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1.06;
  margin: 0 0 20px;
  max-width: 16ch;
}

.hero .lede {
  font-size: 1.15rem;
  max-width: 58ch;
  color: #E4EAE2;
  margin: 0 0 30px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 3px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-cedar {
  background: var(--cedar);
  color: #FBF3EC;
  border-color: var(--cedar);
}
.btn-cedar:hover { background: #832F21; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--parchment);
  border-color: rgba(241,239,227,0.55);
}
.btn-outline:hover { background: rgba(241,239,227,0.10); color: #fff; }

.btn-ink {
  background: var(--ink);
  color: var(--parchment);
  border-color: var(--ink);
}
.btn-ink:hover { background: #34483F; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
section.tight { padding: 36px 0; }

.section-head {
  margin-bottom: 30px;
}
.section-head .eyebrow { margin-bottom: 10px; }

h2.section-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 8px;
  color: var(--river-deep);
}

h3.sub-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0 0 10px;
  color: var(--ink);
}

.deck {
  font-size: 1.05rem;
  color: #3A473F;
  max-width: 62ch;
}

.on-dark { color: var(--parchment); }
.on-dark.section-title,
h2.section-title.on-dark { color: var(--parchment); }
.on-dark.sub-title,
h3.sub-title.on-dark { color: var(--parchment); }

/* alternating band backgrounds */
.band-parchment { background: var(--parchment); }
.band-dim { background: var(--parchment-dim); }
.band-ink { background: var(--ink); color: var(--parchment); }
.band-river { background: var(--river-deep); color: var(--parchment); }
.band-cedar-tint { background: #F3E6DF; }
.band-moss-tint { background: #E9EDE0; }

/* ---------- Event-type color accents ---------- */
.accent-river { border-top: 4px solid var(--river); }
.accent-cedar { border-top: 4px solid var(--cedar); }
.accent-moss { border-top: 4px solid var(--moss); }
.accent-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.accent-dot.river { background: var(--river); }
.accent-dot.cedar { background: var(--cedar); }
.accent-dot.moss { background: var(--moss); }

/* ---------- Cards / grids ---------- */
.grid {
  display: grid;
  gap: 24px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 1px 2px var(--paper-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card h3 { margin-top: 0; }

.card:has(a):hover,
.carousel .card:hover {
  border-color: var(--river);
  box-shadow: 0 4px 14px rgba(43,95,107,0.16);
}

.card-quiet {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  border-left: 3px solid var(--river);
  padding-left: 20px;
}

.figure {
  border: 1px solid var(--line);
  background: #EDE9DA;
  border-radius: 4px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #71695A;
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 20px;
}

/* ---------- Timeline (river-path motif, for History page — order genuinely matters here) ---------- */
.timeline {
  position: relative;
  padding-left: 44px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='140' viewBox='0 0 40 140'%3E%3Cpath d='M20,0 C32,23 32,47 20,70 C8,93 8,117 20,140' fill='none' stroke='%232B5F6B' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-size: 40px 140px;
}
.timeline-item { position: relative; padding-bottom: 34px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cedar);
  border: 2px solid var(--parchment);
  box-shadow: 0 0 0 4px rgba(154,62,45,0.15), 0 0 0 8px rgba(154,62,45,0.07);
  z-index: 2;
}
.timeline-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--river-deep);
  font-weight: 500;
  margin-bottom: 4px;
  display: block;
}
@media (max-width: 600px) {
  .timeline { padding-left: 36px; }
  .timeline::before { width: 32px; background-size: 32px 120px; }
  .timeline-item::before { left: -20px; }
}

/* ---------- Notice / callout ---------- */
.notice {
  background: #FBF6EC;
  border: 1px solid #E7D9B8;
  border-left: 4px solid var(--cedar);
  padding: 18px 22px;
  border-radius: 2px;
  font-size: 0.95rem;
}
.notice strong { color: var(--cedar); }

.editor-note {
  background: #EFF3EA;
  border: 1px dashed var(--moss);
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: #45543A;
  border-radius: 2px;
}

/* ---------- Document block (Executive Order etc) ---------- */
.document {
  background: #fff;
  border: 1px solid var(--line);
  padding: 34px;
  font-size: 0.96rem;
  line-height: 1.7;
  max-height: 480px;
  overflow-y: auto;
  border-radius: 4px;
}
.document p { margin: 0 0 14px; }
.document h4 {
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--river-deep);
  margin: 20px 0 8px;
}
details.doc-toggle summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--river-deep);
  padding: 14px 0;
  font-family: var(--body);
}

/* ---------- Donation tiers ---------- */
.tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.tier {
  border: 1.5px solid var(--river);
  color: var(--river-deep);
  background: #fff;
  font-family: var(--mono);
  font-weight: 500;
  padding: 14px 0;
  width: 96px;
  text-align: center;
  border-radius: 3px;
  cursor: pointer;
}
.tier:hover, .tier.active { background: var(--river); color: #fff; }

/* ---------- Forms ---------- */
form.stack { display: grid; gap: 16px; max-width: 560px; }
label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 6px; }
input, textarea, select {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }

/* ---------- Photo gallery (masonry, for Past Events) ---------- */
.photo-gallery {
  column-count: 3;
  column-gap: 12px;
}
.photo-gallery img {
  width: 100%;
  display: block;
  margin: 0 0 12px;
  border-radius: 4px;
  border: 1px solid var(--line);
  break-inside: avoid;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.photo-gallery img:hover {
  transform: scale(1.015);
  box-shadow: 0 6px 18px rgba(31,46,41,0.18);
  border-color: var(--river);
}
@media (max-width: 800px) {
  .photo-gallery { column-count: 2; }
}
@media (max-width: 520px) {
  .photo-gallery { column-count: 1; }
}
.gallery-section .section-title {
  display: inline-block;
  padding-bottom: 10px;
  background-image: linear-gradient(90deg, var(--river) 0%, rgba(43,95,107,0) 70%);
  background-repeat: no-repeat;
  background-position: bottom left;
  background-size: 100% 2px;
}
.gallery-divider {
  height: 20px;
  width: 100%;
  max-width: 220px;
  margin: 30px auto;
  color: var(--river);
  opacity: 0.5;
}
.gallery-section + .gallery-section {
  margin-top: 20px;
}

/* ---------- Carousel (horizontal scroll, for Events Calendar) ---------- */
.carousel-wrap {
  position: relative;
}
.carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--river) var(--parchment-dim);
}
.carousel .card {
  flex: 0 0 260px;
  scroll-snap-align: start;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(31,46,41,0.18);
  z-index: 5;
  font-size: 1.1rem;
  color: var(--river-deep);
}
.carousel-btn:hover { background: var(--river); color: #fff; }
.carousel-btn.prev { left: -8px; }
.carousel-btn.next { right: -8px; }
@media (max-width: 700px) {
  .carousel-btn { display: none; }
  .carousel .card { flex-basis: 78vw; }
}

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--ink);
  color: #C9D2CC;
  padding: 48px 0 28px;
  font-size: 0.9rem;
}
footer.site-footer a { color: #E7ECE5; text-decoration: none; }
footer.site-footer a:hover { color: var(--cedar); }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 30px;
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-grid h5 {
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #8FA69C;
  margin: 0 0 12px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(201,210,204,0.15);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
  color: #8FA69C;
}

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.small { font-size: 0.85rem; color: #56645B; }
.on-dark.small,
.on-dark .small { color: #C7D3CC; }
.list-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list-check li { padding-left: 26px; position: relative; }
.list-check li::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 8px; height: 8px;
  background: var(--moss);
  border-radius: 50%;
}
