/* ==========================================================================
   Cotati Chamber of Commerce: Home page + shared header/footer
   Layout concept: cream page, blue as the anchor color, hexagon shapes
   (from Cotati's hexagon street plan and the logo) as the recurring motif.
   ========================================================================== */

:root {
  /* Brand color (pulled from the current cotati.org) */
  --blue: #0070a0;        /* primary, logo blue */
  --blue-deep: #0b3b55;   /* dark sections, footer */
  --green: #70c898;       /* logo green, accents */
  --coral: #ff6f61;       /* calls to action */
  --coral-deep: #e9554a;  /* CTA hover */
  --cream: #f4f4e8;       /* page background (current header color) */
  --paper: #ffffff;
  --ink: #17262f;         /* body text, slight blue bias */
  --muted: #546570;
  --line: #dcdccb;

  /* Type */
  --font-display: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem);
  --step-4: clamp(2.3rem, 1.6rem + 3vw, 3.75rem);

  --wrap: 1200px;
  --radius: 10px;
  /* Regular flat-top hexagon — box must use aspect-ratio: var(--hex-ratio) */
  --hex: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  /* Unitless width/height (2÷√3). Slash form inside a custom property breaks aspect-ratio. */
  --hex-ratio: 1.15470053838;
  --hex-tall: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  color-scheme: light;
}

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

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
  color: var(--blue-deep);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.eyebrow {
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 0.9em;
  height: 0.8em;
  background: var(--green);
  clip-path: var(--hex);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.85em 1.4em;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: background-color .2s, color .2s, border-color .2s;
  cursor: pointer;
}
.btn--coral { background: var(--coral); color: #fff; }
.btn--coral:hover { background: var(--coral-deep); }
.btn--outline { border-color: var(--blue); color: var(--blue); background: transparent; }
.btn--outline:hover { background: var(--blue); color: #fff; }
.btn--light { background: #fff; color: var(--blue-deep); }
.btn--light:hover { background: var(--green); }

.section { padding-block: clamp(56px, 7vw, 96px); }
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 36px;
}
.section__head h2 { font-size: var(--step-3); margin-top: 10px; }
.link-arrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}
.link-arrow::after { content: " \2192"; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Utility bar ---------- */
.utility {
  background: var(--blue-deep);
  color: #d7e6ee;
  font-size: var(--step--1);
}
.utility .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-block: 8px;
}
.utility a { color: #fff; text-decoration: none; }
.utility a:hover { text-decoration: underline; }
.utility__social { display: flex; gap: 18px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--cream);
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 14px;
}
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 58px; width: auto; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
.nav__item { position: relative; }
.nav__link {
  display: block;
  padding: 10px 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--blue-deep);
  text-decoration: none;
  border-radius: 6px;
}
.nav__link:hover, .nav__item:focus-within > .nav__link { color: var(--blue); background: rgba(0,112,160,.07); }
.nav__sub {
  list-style: none;
  margin: 0;
  padding: 8px;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(11,59,85,.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.nav__item:hover > .nav__sub,
.nav__item:focus-within > .nav__sub { opacity: 1; visibility: visible; transform: none; }
.nav__sub a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}
.nav__sub a:hover { background: var(--cream); color: var(--blue); }

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--blue-deep);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--blue-deep);
  cursor: pointer;
}

@media (max-width: 1000px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 12px max(20px, env(safe-area-inset-right, 0px)) 24px max(20px, env(safe-area-inset-left, 0px));
    gap: 16px;
  }
  .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; }
  .nav__sub {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: transparent;
    padding: 0 0 6px 14px;
  }
  .nav .btn { align-self: flex-start; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 6vw, 80px) clamp(48px, 6vw, 88px); overflow: hidden; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}
.hero__copy { min-width: 0; }
.hero h1 {
  font-size: var(--step-4);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 16px;
}
.hero h1 em { font-style: normal; color: var(--blue); }
.hero__lede {
  font-size: var(--step-1);
  color: var(--muted);
  max-width: 34ch;
  margin: 20px 0 30px;
}

.search {
  display: flex;
  background: #fff;
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(11,59,85,.10);
  max-width: 520px;
}
.search label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  padding: 0 18px;
  color: var(--ink);
}
.search input:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 3px var(--green), 0 8px 24px rgba(11,59,85,.10); }
.hero__hint { font-size: var(--step--1); color: var(--muted); margin-top: 12px; }

.hero__art { position: relative; aspect-ratio: 1.05 / 1; max-width: 100%; }
.hex-photo {
  position: absolute;
  aspect-ratio: var(--hex-ratio);
  clip-path: var(--hex);
  background: var(--blue);
  overflow: hidden;
}
.hex-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.hex-photo--main {
  width: min(82%, 32rem);
  height: auto;
  right: 2%;
  top: 8%;
}
.hex-photo--small {
  width: 34%;
  left: 0;
  bottom: 2%;
  z-index: 2;
}
.hex-photo--accent { background: var(--coral); }
.hex-photo--empty {
  background: linear-gradient(135deg, #0070a0 0%, #4d9cbf 55%, #9bd3b4 100%);
}
.hex-ring {
  position: absolute;
  width: 26%;
  aspect-ratio: var(--hex-ratio);
  top: 0;
  right: 4%;
  background: var(--green);
  clip-path: var(--hex);
  z-index: 2;
}
.hex-ring::after {
  content: "";
  position: absolute;
  /* Keep inner hex regular: inset proportional to width (~7%) */
  inset: 7%;
  background: var(--cream);
  clip-path: var(--hex);
}

/* ---------- Action tiles ---------- */
.actions { margin-top: -8px; }
.actions__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.action {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px 28px 26px;
  background: var(--coral);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  overflow: hidden;
  transition: transform .2s, background-color .2s;
}
.action:nth-child(2) { background: var(--blue); }
.action:nth-child(3) { background: var(--blue-deep); }
.action:hover { transform: translateY(-3px); }
.action h3 { color: #fff; font-size: var(--step-1); font-weight: 700; }
.action p { margin: 0; opacity: .9; font-size: 0.98rem; max-width: 30ch; }
.action__go { margin-top: 10px; font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; }
.action__go::after { content: " \2192"; }
.action::before {
  content: "";
  position: absolute;
  width: 140px;
  aspect-ratio: var(--hex-ratio);
  right: -40px;
  bottom: -40px;
  background: rgba(255,255,255,.12);
  clip-path: var(--hex);
}

/* ---------- Events ---------- */
.events__layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  align-items: start;
}
.feature-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.feature-card__img { aspect-ratio: 16 / 9; background: var(--blue) center / cover no-repeat; }
.feature-card__body { padding: 26px 28px 30px; display: grid; gap: 10px; }
.feature-card h3 { font-size: var(--step-2); }
.feature-card p { margin: 0; color: var(--muted); }
.feature-card:hover h3 { color: var(--blue); }
.tag {
  justify-self: start;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue-deep);
  background: rgba(112,200,152,.3);
  padding: 4px 10px;
  border-radius: 999px;
}

.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; min-width: 0; }
.event {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 18px;
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 20px 16px 16px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s;
}
.event:hover { box-shadow: 0 8px 22px rgba(11,59,85,.12); }
.event:hover h4 { color: var(--blue); }
.date-hex {
  width: 76px;
  aspect-ratio: var(--hex-ratio);
  clip-path: var(--hex);
  background: var(--blue);
  color: #fff;
  display: grid;
  place-content: center;
  text-align: center;
  font-family: var(--font-display);
  line-height: 1;
}
.event:nth-child(2n) .date-hex { background: var(--coral); }
.date-hex__m { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.date-hex__d { font-size: 1.6rem; font-weight: 800; margin-top: 2px; }
.event h4 { font-size: 1.12rem; margin-bottom: 4px; }
.event p { margin: 0; color: var(--muted); font-size: .95rem; }
.event__meta { font-size: .85rem; color: var(--blue); font-weight: 600; margin-bottom: 2px; }

/* ---------- Stats ---------- */
.stats {
  background: var(--blue);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.stats::before {
  /* hex grid texture, a nod to the hexagon street plan */
  content: "";
  position: absolute;
  inset: 0;
  opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 66 0 50V17L28 1l28 16v33L28 66zm0 31V66m0-65V0' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E");
}
.stats .wrap { position: relative; }
.stats .eyebrow { color: #cfeedd; }
.stats h2 { color: #fff; font-size: var(--step-3); margin-top: 10px; max-width: 18ch; }
.stats__grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.stat {
  border-top: 3px solid var(--green);
  padding-top: 18px;
}
.stat__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 1.8rem + 2.4vw, 3.6rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__label { margin-top: 10px; color: #dcecf3; font-size: 1rem; max-width: 22ch; }

/* ---------- Testimonial ---------- */
.quote .wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.quote__mark {
  width: clamp(90px, 12vw, 150px);
  aspect-ratio: var(--hex-ratio);
  clip-path: var(--hex);
  background: var(--green);
  display: grid;
  place-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 6vw, 5rem);
  color: var(--blue-deep);
  line-height: 1;
  padding-top: .25em;
}
blockquote { margin: 0; min-width: 0; }
blockquote p {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-3);
  line-height: 1.25;
  color: var(--blue-deep);
  margin: 0 0 18px;
  text-wrap: balance;
}
blockquote footer { color: var(--muted); }
blockquote cite { font-style: normal; font-weight: 700; color: var(--ink); }

/* ---------- News ---------- */
.news { background: #fff; }
.news__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.news-card { text-decoration: none; color: inherit; display: grid; gap: 12px; align-content: start; min-width: 0; }
.news-card__img {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--blue) center / cover no-repeat;
  transition: transform .25s;
}
.news-card:hover .news-card__img { transform: scale(1.02); }
.news-card h3 { font-size: 1.1rem; line-height: 1.3; }
.news-card:hover h3 { color: var(--blue); }
.news-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.news-card time { font-size: .82rem; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Newsletter ---------- */
.signup { padding-block: clamp(48px, 6vw, 80px); }
.signup__box {
  background: var(--blue-deep);
  color: #fff;
  border-radius: 16px;
  padding: clamp(28px, 5vw, 56px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 48px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.signup__box::after {
  content: "";
  position: absolute;
  width: 260px;
  aspect-ratio: var(--hex-ratio);
  right: -70px;
  top: -80px;
  background: var(--coral);
  opacity: .9;
  clip-path: var(--hex);
}
.signup h2 { color: #fff; font-size: var(--step-3); }
.signup p { color: #cfe0ea; margin: 12px 0 0; }
.signup form { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.signup input {
  flex: 1 1 220px;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  padding: 0.95em 1.3em;
  font: inherit;
}
.signup__fine { flex-basis: 100%; font-size: .8rem; color: #a9c4d3; margin: 4px 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero__art { max-width: 560px; width: 100%; margin-inline: auto; }
  .events__layout { grid-template-columns: 1fr; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 32px 18px; }
  .news__grid { grid-template-columns: repeat(2, 1fr); }
  .signup__box { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .actions__grid { grid-template-columns: 1fr; }
  .utility__addr { display: none; }
  .quote .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .news__grid { grid-template-columns: 1fr; }
  .search { flex-wrap: wrap; border-radius: 16px; }
  .search input { padding: 12px 14px; }
  .search .btn { width: 100%; justify-content: center; }
  .logo img { height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
