/* =========================================================
   Town of Unadilla, NY — Site Stylesheet
   A calm, high-contrast civic design system.
   ========================================================= */

/* ---- Design tokens ---- */
:root{
  --navy: #143a5c;
  --navy-dark: #0b243c;
  --navy-mid: #1e4d78;
  --blue-link: #175a92;
  --blue-link-visited: #4a3b7a;
  --gold: #b5842a;
  --gold-light: #e7c77a;
  --gold-text: #8a5f1a; /* darker gold — meets 4.5:1 text contrast on light backgrounds; --gold itself is for borders/backgrounds only */
  --cream: #f8f5ee;
  --cream-deep: #efe8d8;
  --white: #ffffff;
  --text: #202733;
  --text-soft: #47505c;
  --border: #ddd6c4;
  --border-soft: #e7e2d3;
  --success-bg: #eaf5ec;
  --success-text: #1f5c31;
  --focus: #b5842a;

  --font-head: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(11,36,60,0.08), 0 1px 2px rgba(11,36,60,0.06);
  --shadow-md: 0 6px 20px rgba(11,36,60,0.12);
  --container: 1180px;
}

/* ---- Reset ---- */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
body{
  margin: 0;
  font-family: var(--font-body);
  font-size: 112.5%; /* ~18px base for readability */
  line-height: 1.65;
  color: var(--text);
  background: var(--cream);
}
img{ max-width: 100%; display: block; }
h1,h2,h3,h4{
  font-family: var(--font-head);
  color: var(--navy-dark);
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 700;
}
h1{ font-size: 2.5rem; }
h2{ font-size: 1.9rem; }
h3{ font-size: 1.35rem; }
h4{ font-size: 1.1rem; }
p{ margin: 0 0 1.1em; font-size: 1.05rem; }
ul, ol{ padding-left: 1.4em; }
a{ color: var(--blue-link); text-decoration-thickness: 2px; text-underline-offset: 2px; }
/* :where() keeps this at zero specificity so any component class (buttons, nav,
   cards, footer links, etc.) always wins the cascade — visited-state purple is
   only ever meant for plain in-content links, never for UI controls. */
a:where(:visited){ color: var(--blue-link-visited); }
a:hover{ color: var(--navy-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 3px;
}
button{ font-family: inherit; }

.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;
}

.skip-link{
  position: absolute;
  left: 1rem; top: -4rem;
  background: var(--navy-dark);
  color: #fff;
  padding: 0.75em 1.25em;
  border-radius: 0 0 8px 8px;
  z-index: 1000;
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus{ top: 0; color: #fff; }

.container{
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Top utility bar ---- */
.top-bar{
  background: var(--navy-dark);
  color: #dce6ef;
  font-size: 0.92rem;
}
.top-bar__inner{
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0.5rem 1.5rem;
  justify-content: flex-end;
}
.top-bar__contact{
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin: 0;
  padding: 0;
}
.top-bar__contact li{ display: flex; align-items: center; gap: 0.4em; }
.top-bar a{ color: #eaf0f6; text-decoration: none; }
.top-bar a:hover, .top-bar a:focus-visible{ color: var(--gold-light); text-decoration: underline; }
.top-bar svg{ width: 16px; height: 16px; flex: none; opacity: 0.85; }

/* ---- Header / nav ---- */
.site-header{
  background: var(--white);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header__inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 1.5rem;
  flex-wrap: wrap;
}
.brand{
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--navy-dark);
}
.brand img{ width: 58px; height: 58px; }
.brand__title{
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--navy-dark);
  line-height: 1.2;
}
.brand__tagline{
  display: block;
  font-size: 0.85rem;
  color: var(--text-soft);
  font-style: italic;
}

.nav-toggle{
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
}
.nav-toggle svg{ width: 22px; height: 22px; }

.primary-nav ul{
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
}
.primary-nav a{
  display: block;
  padding: 0.65rem 0.9rem;
  color: var(--navy-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.97rem;
  /* Round only the top corners so the bottom "current page" border stays a crisp straight line. */
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 3px solid transparent;
}
.primary-nav a:hover{
  background: var(--cream-deep);
  color: var(--navy-dark);
}
.primary-nav a[aria-current="page"]{
  border-bottom-color: var(--gold);
  color: var(--navy-dark);
}
.primary-nav a.nav-cta{
  background: var(--navy);
  color: #fff;
  margin-left: 0.35rem;
}
.primary-nav a.nav-cta:hover{ background: var(--navy-dark); }

@media (max-width: 900px){
  .nav-toggle{ display: inline-flex; }
  .primary-nav{
    display: none;
    width: 100%;
    order: 3;
    border-top: 1px solid var(--border-soft);
    margin-top: 0.75rem;
    padding-top: 0.5rem;
  }
  .primary-nav.is-open{ display: block; }
  .primary-nav ul{ flex-direction: column; gap: 0.1rem; }
  .primary-nav a{ padding: 0.85rem 0.5rem; border-bottom: 1px solid var(--border-soft); border-radius: 0; }
  .primary-nav a.nav-cta{ margin-left: 0; text-align: center; margin-top: 0.5rem; border-radius: var(--radius); }
  .top-bar__inner{ justify-content: center; text-align: center; }
}

/* ---- Hero (home) ---- */
.hero{
  position: relative;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  overflow: hidden;
}
.hero__inner{
  position: relative;
  z-index: 2;
  padding: 4.5rem 1.5rem 6rem;
  max-width: 760px;
}
.hero__eyebrow{
  display: inline-block;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.35);
  color: var(--gold-light);
  padding: 0.35em 0.9em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.hero h1{
  color: #fff;
  font-size: 2.9rem;
  margin-bottom: 0.5rem;
}
.hero p.lead{
  font-size: 1.2rem;
  color: #dde7f0;
  max-width: 620px;
}
.hero__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.8rem;
}
.hero__scape{
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  line-height: 0;
  color: var(--navy-dark);
  opacity: 0.9;
}
.hero__scape svg{ width: 100%; height: auto; display: block; }
/* margin-bottom:-1px overlaps the next section by a hair to kill the sub-pixel
   seam that can otherwise show as a thin line under the wave on some screens. */
.hero-divider{ display:block; width:100%; line-height:0; font-size:0; margin-bottom:-1px; }
.hero-divider svg{ width:100%; height: 48px; display:block; vertical-align:top; }

/* ---- Page hero (interior pages) ---- */
.page-hero{
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: #fff;
  padding: 2.6rem 0 3.2rem;
}
.breadcrumb{
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: #cddaea;
}
.breadcrumb a{ color: #cddaea; }
.breadcrumb a:hover{ color: #fff; }
.breadcrumb li:not(:last-child)::after{ content: "\2192"; margin-left: 0.4rem; color: #7f9ab5; }
.page-hero h1{ color: #fff; margin-bottom: 0.4rem; font-size: 2.4rem; }
.page-hero .lead{ color: #dbe6f0; max-width: 680px; font-size: 1.1rem; margin: 0; }

/* ---- Buttons ---- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.75em 1.4em;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 48px;
}
.btn svg{ width: 20px; height: 20px; flex: none; }
/* #14171a rather than --navy-dark: on the gold background, navy-dark's contrast
   ratio was only ~4.7:1 — technically AA but too close to the line. This keeps
   the same gold button color with a safer ~6.3:1 margin. */
.btn-primary{ background: var(--gold); color: #14171a; }
.btn-primary:hover{ background: var(--gold-light); color: #14171a; }
.btn-outline{ background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.btn-outline:hover{ background: rgba(255,255,255,0.12); color: #fff; }
.btn-navy{ background: var(--navy); color: #fff; }
.btn-navy:hover{ background: var(--navy-dark); color: #fff; }
.btn-block{ width: 100%; justify-content: center; }

/* ---- Layout helpers ---- */
main{ display: block; }
.section{ padding: 3.4rem 0; }
.section--tight{ padding: 2.2rem 0; }
.section--alt{ background: var(--white); }
.section-head{ max-width: 700px; margin-bottom: 2rem; }
.section-head p{ color: var(--text-soft); font-size: 1.08rem; }
.eyebrow{
  display: block;
  color: var(--gold-text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
}

.page-layout{
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 860px){
  .page-layout{ grid-template-columns: 1fr; }
}

/* ---- Cards ---- */
.card{
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
}
.card h3{ margin-bottom: 0.5rem; }

.grid{
  display: grid;
  gap: 1.5rem;
}
.grid--3{ grid-template-columns: repeat(3, 1fr); }
.grid--4{ grid-template-columns: repeat(4, 1fr); }
.grid--2{ grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px){
  .grid--3, .grid--4{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px){
  .grid--2, .grid--3, .grid--4{ grid-template-columns: 1fr; }
}

/* Quick links */
.quick-link{
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.quick-link:hover, .quick-link:focus-visible{
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
  color: var(--text);
}
.quick-link__icon{
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream-deep);
  color: var(--navy);
  border-radius: 10px;
}
.quick-link__icon svg{ width: 24px; height: 24px; }
.quick-link h3{ margin: 0; font-size: 1.1rem; }
.quick-link p{ margin: 0; color: var(--text-soft); font-size: 0.96rem; }
.quick-link__arrow{ margin-top: auto; font-weight: 700; color: var(--navy); }

/* Notice / alert callouts */
.notice{
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
}
.notice svg{ width: 22px; height: 22px; flex: none; color: var(--gold); margin-top: 0.15em; }
.notice h3{ font-size: 1.02rem; margin-bottom: 0.25rem; }
.notice p{ margin: 0; color: var(--text-soft); font-size: 0.98rem; }
.notice time{ display: block; font-size: 0.85rem; color: var(--text-soft); margin-top: 0.4rem; }
.notice--success{ border-left-color: #2f8f4e; }
.notice--success svg{ color: #2f8f4e; }

/* Info card (contact / hours) */
.info-card{
  background: var(--cream-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.info-card h3{ display:flex; align-items:center; gap:0.5em; font-size: 1.1rem; }
.info-card h3 svg{ width: 22px; height: 22px; color: var(--navy); flex: none; }
.info-list{ list-style: none; margin: 0; padding: 0; }
.info-list li{
  display: flex;
  gap: 0.7em;
  padding: 0.55em 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.98rem;
}
.info-list li:last-child{ border-bottom: none; }
.info-list svg{ width: 19px; height: 19px; flex: none; color: var(--navy); margin-top: 0.15em; }
.info-list strong{ display:block; color: var(--navy-dark); }

/* Staff / board member card */
.staff-card{
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.staff-card__avatar{
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 0.9rem;
}
.staff-card h3{ margin-bottom: 0.15rem; font-size: 1.12rem; }
.staff-card .role{ color: var(--gold-text); font-weight: 700; font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.7rem; display:block; }
.staff-card ul{ list-style:none; margin:0; padding:0; font-size: 0.95rem; }
.staff-card li{ display:flex; gap:0.5em; align-items:center; margin-bottom: 0.35em; }
.staff-card svg{ width:16px; height:16px; color: var(--navy); flex: none; }

/* Tables */
.table-wrap{ overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius); }
table{ width: 100%; border-collapse: collapse; background: var(--white); font-size: 0.98rem; }
caption{ text-align:left; font-weight:700; padding: 0.8rem 1rem 0; color: var(--navy-dark); }
th, td{ text-align: left; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border-soft); }
thead th{ background: var(--cream-deep); color: var(--navy-dark); font-family: var(--font-head); }
tbody tr:last-child td{ border-bottom: none; }

/* Document list */
.doc-list{ list-style:none; margin:0; padding:0; }
.doc-list li{
  display:flex; align-items:center; gap:0.9rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--white);
  margin-bottom: 0.7rem;
}
.doc-list svg{ width: 22px; height:22px; color: var(--navy); flex:none; }
.doc-list a{ font-weight: 600; }
.doc-list .doc-meta{ margin-left:auto; color: var(--text-soft); font-size: 0.88rem; white-space: nowrap; }

/* Map / location */
.map-frame{
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.map-frame iframe{ width: 100%; height: 320px; border: 0; display:block; }

/* Forms */
.form-grid{ display:grid; gap: 1.2rem; grid-template-columns: 1fr 1fr; }
.form-grid .full{ grid-column: 1 / -1; }
@media (max-width: 640px){ .form-grid{ grid-template-columns: 1fr; } }
.field label{ display:block; font-weight:700; margin-bottom: 0.4rem; color: var(--navy-dark); }
.field .hint{ font-size: 0.85rem; color: var(--text-soft); margin-bottom: 0.4rem; display:block; }
.field input, .field textarea, .field select{
  width: 100%;
  padding: 0.75em 0.9em;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: var(--white);
  color: var(--text);
}
.field textarea{ min-height: 140px; resize: vertical; }
.required-star{ color: #b3261e; }

/* Callout / CTA band */
.cta-band{
  background: var(--navy-dark);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.cta-band h2{ color: #fff; margin-bottom: 0.3rem; }
.cta-band p{ color: #cddaea; margin: 0; }

/* Footer */
.site-footer{
  background: var(--navy-dark);
  color: #cfdae6;
  margin-top: 3rem;
}
.footer__grid{
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.2rem;
  padding: 3.2rem 1.5rem 2.4rem;
}
@media (max-width: 860px){
  .footer__grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px){
  .footer__grid{ grid-template-columns: 1fr; }
}
.footer__logo{ width: 52px; height: 52px; margin-bottom: 1rem; filter: brightness(1.15); }
.footer__about{ color: #b8c6d6; font-size: 0.95rem; }
.footer__heading{ color: #fff; font-size: 1.05rem; margin-bottom: 1rem; font-family: var(--font-head); }
.footer__links{ list-style:none; margin:0; padding:0; }
.footer__links li{ margin-bottom: 0.6rem; }
.footer__links a{ color: #cfdae6; text-decoration: none; font-size: 0.96rem; }
.footer__links a:hover, .footer__links a:focus-visible{ color: var(--gold-light); text-decoration: underline; }
.footer__address{ font-style: normal; color: #b8c6d6; margin-bottom: 0.8rem; font-size: 0.95rem; line-height: 1.6; }
.footer__hours{ color: #b8c6d6; font-size: 0.9rem; margin-top: 0.8rem; }
.footer__bottom{ border-top: 1px solid rgba(255,255,255,0.12); }
.footer__bottom-inner{
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  font-size: 0.86rem;
  color: #9fb0c2;
}
.footer__bottom a{ color: #9fb0c2; }
.footer__bottom a:hover{ color: #fff; }

/* Utility */
.text-center{ text-align:center; }
.mt-0{ margin-top:0; }
.mb-0{ margin-bottom:0; }
.stack{ display:flex; flex-direction:column; gap: 1rem; }
