/* Williamstown Business Association: one stylesheet.
   Colours and type come from 02_Brand_Guide.md. Navy and paper carry the page;
   one logo colour at a time. */

@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/public-sans-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #17293F;
  --brass: #9A6F1F;
  --brass-dark: #7E5A17;
  --brass-tint: #F5EBD6;
  --paper: #EEF0EC;
  --card: #FFFFFF;
  --slate: #5A6875;
  --line: #D3D8D2;
  --rust: #93331F;
  --teal: #47766E;
  --mustard: #D29101;
  --cornice: #BF743B;
  --slate-blue: #255362;
  --green: #1E450C;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;
  --wrap: 1120px;
  --gutter: 20px;
  --radius: 10px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}
@media (min-width: 700px) { body { font-size: 17px; } }

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

a { color: var(--slate-blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--slate-blue); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { color: var(--navy); font-weight: 800; line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 2.75rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.85rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: 68ch; }
.lead { font-size: 1.12em; }
.muted { color: var(--slate); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Skip link */
.skip {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  background: var(--card); color: var(--navy); padding: 12px 16px; border-radius: 8px;
  font-weight: 700; text-decoration: none; border: 2px solid var(--navy);
}
.skip:focus { top: 12px; }

/* Buttons. Text is at least 18.7px bold (WCAG large text) on every screen,
   so white on brass passes AA. Don't make button text smaller. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.55em 1.25em;
  border-radius: 8px; border: 2px solid transparent;
  font: 700 1.17rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--brass); color: #fff; }
.btn-primary:hover { background: var(--brass-dark); }
.btn-secondary { background: var(--card); color: var(--slate-blue); border-color: var(--slate-blue); }
.btn-secondary:hover { background: #E6EEF0; }
.btn[disabled] { opacity: 0.7; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.5em 0 0; }

/* The logo's gold rule and star, used as a divider */
.star-rule {
  display: flex; align-items: center; gap: 14px; margin: 0 auto; max-width: 420px;
  color: var(--mustard);
}
.star-rule::before, .star-rule::after { content: ""; flex: 1; height: 3px; border-radius: 2px; background: var(--mustard); }
.star-rule span { font-size: 1.3rem; line-height: 1; }

/* Header */
.site-header-slot { min-height: 67px; background: var(--navy); }
@media (min-width: 960px) { .site-header-slot { min-height: 79px; } }
.site-header { background: var(--navy); color: #fff; border-bottom: 3px solid var(--brass); position: relative; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
@media (min-width: 960px) { .header-inner { min-height: 76px; } }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 800; line-height: 1.15; min-height: 44px; }
.brand-mark { background: var(--card); border-radius: 8px; padding: 4px 6px; flex: none; }
.brand-mark img { width: 58px; height: 40px; object-fit: contain; }
.brand-name { font-size: 0.98rem; max-width: 14em; }
@media (min-width: 960px) { .brand-name { font-size: 1.05rem; max-width: none; } .brand-mark img { width: 64px; height: 44px; } }

.menu-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 44px;
  padding: 0 14px; background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.55);
  border-radius: 8px; font: 700 1rem var(--sans); cursor: pointer;
}
.menu-btn:focus-visible, .site-header a:focus-visible, .site-footer a:focus-visible { outline-color: var(--mustard); }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; } .menu-icon::after { top: 6px; }
.menu-btn[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-icon::before { top: 0; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-icon::after { top: 0; transform: rotate(-45deg); }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a:not(.btn) { color: #fff; text-decoration: none; font-weight: 600; display: flex; align-items: center; min-height: 48px; }
.site-nav a:not(.btn):hover { text-decoration: underline; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--mustard); text-decoration-thickness: 3px; text-underline-offset: 8px; }

@media (max-width: 959px) {
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 50; background: var(--navy); border-bottom: 3px solid var(--brass); padding: 8px var(--gutter) 20px; }
  .site-nav.is-open { display: block; }
  .site-nav li { border-bottom: 1px solid rgba(255,255,255,0.15); }
  .nav-join { margin-top: 16px; width: 100%; }
}
@media (min-width: 960px) {
  .menu-btn { display: none; }
  .site-nav { display: flex; align-items: center; gap: 28px; }
  .site-nav ul { display: flex; gap: 24px; }
}

/* Sections */
main { display: block; }
.section { padding: 48px 0; }
@media (min-width: 700px) { .section { padding: 64px 0; } }
.section-card { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.page-head { padding-top: 40px; padding-bottom: 8px; }
@media (min-width: 700px) { .page-head { padding-top: 56px; } }
.page-body { padding-top: 8px; padding-bottom: 56px; }

/* Home hero */
.hero { padding: 32px 0 40px; }
.hero-grid { display: grid; gap: 28px; align-items: center; }
.hero-logo { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; max-width: 300px; margin: 0 auto; width: 100%; }
.hero-logo img { width: 100%; }
.display { font-family: var(--serif); font-weight: 700; font-size: clamp(2.2rem, 1.5rem + 3.2vw, 3.6rem); line-height: 1.08; letter-spacing: -0.015em; margin-bottom: 0.4em; }
@media (min-width: 860px) {
  .hero { padding: 64px 0 72px; }
  .hero-grid { grid-template-columns: 360px 1fr; gap: 64px; }
  .hero-logo { max-width: none; padding: 22px; }
}

/* Lists with the logo star */
.stars { list-style: none; padding: 0; display: grid; gap: 14px 40px; }
@media (min-width: 760px) { .stars { grid-template-columns: 1fr 1fr; } }
.stars li { position: relative; padding-left: 30px; }
.stars li::before { content: "\2605"; position: absolute; left: 0; top: 0; color: var(--mustard); font-size: 1.1em; }

/* Events */
.ev-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.ev-card { display: grid; grid-template-columns: 76px 1fr; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
@media (min-width: 700px) { .ev-card { grid-template-columns: 92px 1fr; gap: 24px; padding: 20px 24px; } }
.ev-date { background: var(--navy); color: #fff; border-radius: 8px; text-align: center; padding: 8px 4px 10px; align-self: start; line-height: 1.1; }
.ev-mon { display: block; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass-tint); }
.ev-day { display: block; font-family: var(--serif); font-size: 2rem; font-weight: 700; margin: 2px 0; }
.ev-wd { display: block; font-size: 0.82rem; }
.ev-body h3 { margin: 0 0 4px; font-size: 1.2rem; }
.ev-body h3 a { color: var(--navy); }
.ev-body p { margin: 0 0 4px; }
.ev-desc { color: var(--slate); }
.ev-cat { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 700; color: var(--navy); margin: 0 0 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--slate); }
.dot-meeting { background: var(--navy); }
.dot-networking { background: var(--teal); }
.dot-fundraiser { background: var(--cornice); }
.dot-community { background: var(--green); }
.dot-other { background: var(--slate); }
.badge-cancelled { display: inline-block; background: var(--rust); color: #fff; font-size: 0.82rem; font-weight: 700; border-radius: 6px; padding: 2px 8px; margin-left: 6px; vertical-align: 2px; }
.ev-card.is-cancelled h3 a { text-decoration: line-through; text-decoration-thickness: 2px; }
.past { margin-top: 32px; }
.past summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--slate-blue); list-style: none; }
.past summary::-webkit-details-marker { display: none; }
.past summary::before { content: "\25B8"; display: inline-block; transition: transform 0.15s ease; }
.past[open] summary::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .past summary::before { transition: none; } }
.past .ev-list { margin-top: 12px; }
.past .ev-card { opacity: 0.88; }
.notice { margin-bottom: 24px; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--slate-blue); border-radius: var(--radius); padding: 18px 20px; }
.notice p:last-child { margin-bottom: 0; }
.banner { border-radius: var(--radius); padding: 14px 18px; margin: 0 0 20px; font-weight: 700; }
.banner p { margin: 0; }
.banner-cancelled { background: var(--rust); color: #fff; }
.banner-past { background: var(--brass-tint); color: var(--navy); border: 1px solid #E3D3B0; font-weight: 600; }
.banner-past a { color: var(--navy); font-weight: 700; }
.next-event { min-height: 8rem; margin-bottom: 16px; }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 20px 0 0; margin: 0; font-size: 0.95rem; color: var(--slate); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--slate); }
.event-page { padding-top: 20px; padding-bottom: 56px; }
.ev-facts { display: grid; gap: 12px; margin: 0 0 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; max-width: 68ch; }
.ev-facts div { display: grid; gap: 2px; }
@media (min-width: 700px) { .ev-facts div { grid-template-columns: 6em 1fr; gap: 12px; } }
.ev-facts dt { font-weight: 700; }
.ev-facts dd { margin: 0; }
.ev-description { margin-top: 28px; }
.flyer { margin: 28px 0 0; max-width: 480px; }
@media (min-width: 900px) {
  .event-grid.has-flyer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
  .event-grid.has-flyer .flyer { margin-top: 0; }
}
.flyer img { border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.flyer figcaption { color: var(--slate); font-size: 0.92rem; margin-top: 8px; }
.ev-next { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 68ch; }

/* Willy */
.willy-strip { background: var(--brass-tint); border-top: 1px solid #E3D3B0; border-bottom: 1px solid #E3D3B0; padding: 44px 0; }
.willy-grid { display: grid; gap: 24px; align-items: center; }
@media (min-width: 760px) { .willy-grid { grid-template-columns: 180px 1fr; gap: 40px; } }
.willy-token { width: 150px; height: 150px; border-radius: 50%; overflow: hidden; border: 4px solid var(--navy); background: var(--card); }
@media (min-width: 760px) { .willy-token { width: 180px; height: 180px; } }
.willy-token img { width: 100%; height: 100%; object-fit: cover; }
.willy-line { font-family: var(--serif); font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); line-height: 1.4; margin: 0.6em 0; }
.tilt { transition: transform 0.25s ease; }
.tilt:hover { transform: rotate(-2deg); }
@media (prefers-reduced-motion: reduce) { .tilt, .tilt:hover { transition: none; transform: none; } }

.figure-willy { margin: 0 0 20px; max-width: 280px; }
.figure-willy img { border-radius: var(--radius); border: 1px solid var(--line); }
.figure-willy figcaption { color: var(--slate); font-size: 0.92rem; margin-top: 8px; }
@media (min-width: 860px) {
  .with-figure { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start; }
  .with-figure .figure-willy { margin: 0; }
}

.pull {
  font-family: var(--serif); font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.75rem); line-height: 1.4;
  margin: 32px 0; padding: 0 0 0 20px; border-left: 4px solid var(--mustard); max-width: 40ch;
}
blockquote.approved { margin: 0 0 1.4em; padding: 18px 22px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: var(--radius); font-family: var(--serif); font-size: 1.08em; line-height: 1.6; max-width: 68ch; }
blockquote.approved p { margin: 0; }

/* Board */
.board { display: grid; gap: 0; margin: 0 0 1em; max-width: 640px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.board div { display: grid; grid-template-columns: 1fr; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.board div:last-child { border-bottom: 0; }
@media (min-width: 600px) { .board div { grid-template-columns: 15em 1fr; gap: 16px; } }
.board dt { color: var(--slate); }
.board dd { margin: 0; font-weight: 700; }

/* History */
.sources { font-size: 0.95rem; }
.sources li { margin-bottom: 6px; }

/* Photo bands: hidden until images.json lists a photo for them */
.photo-band { margin: 0; }
.photo-band[hidden] { display: none; }
.photo-band img { width: 100%; border-radius: var(--radius); }
.photo-band figcaption { color: var(--slate); font-size: 0.92rem; margin-top: 8px; }

/* Join */
.tiers { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 12px; }
@media (min-width: 700px) { .tiers { grid-template-columns: repeat(3, 1fr); } }
.tier { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tier.is-suggested { border-color: var(--brass); background: var(--brass-tint); }
.tier-size { display: block; font-weight: 700; }
.tier-price { display: block; font-family: var(--serif); font-size: 2.2rem; font-weight: 700; line-height: 1.15; }
.tier-per { color: var(--slate); }
.tier.is-suggested .tier-per { color: var(--navy); }

/* Forms */
.form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; max-width: 720px; }
@media (min-width: 700px) { .form { padding: 32px; } }
.form fieldset { border: 0; padding: 0; margin: 0 0 28px; }
.form legend { font-size: 1.25rem; font-weight: 800; padding: 0; margin-bottom: 12px; }
.field { margin-bottom: 18px; }
.field > label, .field .label { display: block; font-weight: 700; margin-bottom: 6px; }
.req { font-weight: 400; color: var(--slate); font-size: 0.9em; margin-left: 4px; }
.hint { display: block; color: var(--slate); font-size: 0.92rem; margin: -2px 0 6px; font-weight: 400; }
.form input[type="text"], .form input[type="email"], .form input[type="tel"], .form input[type="url"], .form input[type="number"], .form textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font: 400 max(16px, 1rem) var(--sans);
  color: var(--navy); background: #fff; border: 1px solid var(--slate); border-radius: 8px;
}
.form textarea { min-height: 150px; resize: vertical; }
.form input:focus-visible, .form textarea:focus-visible { outline: 3px solid var(--slate-blue); outline-offset: 1px; }
.form [aria-invalid="true"] { border: 2px solid var(--rust); }
.err { color: var(--rust); font-weight: 700; font-size: 0.95rem; margin: 6px 0 0; }
.err:empty { display: none; }
.checks { display: grid; gap: 4px; }
@media (min-width: 600px) { .checks { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 400; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--slate-blue); margin: 0; }
.tier-note { margin: 8px 0 0; font-weight: 600; }
.tier-note:empty { display: none; }
.form-error { background: #FBEDEA; border: 1px solid var(--rust); color: var(--rust); border-radius: 8px; padding: 12px 14px; font-weight: 700; margin: 0 0 16px; }
.form-error[hidden] { display: none; }
.privacy { color: var(--slate); font-size: 0.95rem; margin: 12px 0 0; }
.thanks { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--green); border-radius: var(--radius); padding: 22px 24px; max-width: 720px; }
.thanks p { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--green); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Contact */
.contact-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 300px; gap: 48px; align-items: start; } }
.contact-aside h2 { font-size: 1.2rem; margin-top: 0; }
.contact-aside address { font-style: normal; margin-bottom: 1em; }
.contact-aside a { display: inline-flex; align-items: center; min-height: 44px; }
.fb-link[hidden] { display: none; }

/* Footer */
.site-footer { background: var(--navy); color: #DCE2E8; margin-top: 0; }
.footer-grid { display: grid; gap: 28px; padding-top: 44px; padding-bottom: 28px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.2fr 1fr 1.2fr; gap: 40px; } }
.site-footer a { color: #fff; }
.site-footer address { font-style: normal; }
.footer-name { color: #fff; font-weight: 800; margin-bottom: 0.4em; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-tag { font-family: var(--serif); font-size: 1.35rem; color: #fff; line-height: 1.3; }
.footer-star { color: var(--mustard); margin-right: 8px; }
.footer-base { border-top: 1px solid rgba(255,255,255,0.18); padding-top: 16px; padding-bottom: 24px; font-size: 0.9rem; }
.footer-base p { margin: 0; }
.site-footer .contact-line a { display: inline-flex; align-items: center; min-height: 44px; }

/* 404 */
.lost { padding-top: 64px; padding-bottom: 80px; }
