/* GD SEPAC static site styles */
:root {
  --brand: #1f1f1f;
  --brand-dark: #000000;
  --brand-light: #ededed;
  --accent: #6b6b6b;
  --ink: #1a1a1a;
  --muted: #666666;
  --line: #e2e2e2;
  --bg: #ffffff;
  --soft: #f6f6f6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.05);
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Respect the visitor's "Reduce Motion" OS setting. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .quicklink-grid a:hover { transform: none; }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}

a { color: #1a1a1a; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: #bbb; }
a:hover { text-decoration-color: #1a1a1a; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px;
  max-width: var(--maxw); margin: 0 auto; padding: 14px 20px;
}
.brand-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; }
.brand-mark img { width: 46px; height: 46px; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.15rem; }
.brand-text small { color: var(--muted); font-size: .8rem; }

/* Nav */
.nav { position: relative; order: 3; flex: 1 0 100%; }
.nav-list {
  display: flex; flex-wrap: wrap; gap: 2px; list-style: none; margin: 0; padding: 0;
}
.nav-list a {
  display: block; padding: 8px 12px; border-radius: 8px;
  text-decoration: none; color: var(--ink); font-size: .94rem; font-weight: 500;
}
.nav-list a:hover { background: var(--brand-light); color: var(--brand-dark); }
.nav-list a[aria-current="page"] { background: var(--brand); color: #fff; }
.nav-toggle { display: none; }

/* Hero */
.hero {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  color: var(--ink); text-align: center;
}
.hero-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 48px 20px 52px;
  display: flex; align-items: center; justify-content: center; gap: 32px; flex-wrap: wrap;
}
.hero .hero-titles { text-align: left; }
.hero .hero-logo { width: 190px; height: 190px; object-fit: contain; display: block; flex: none; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: .8rem; color: var(--muted); margin: 0 0 8px; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); margin: 0; letter-spacing: .5px; color: var(--ink); }
.hero .tagline { font-size: 1.15rem; color: var(--muted); margin: 10px 0 0; }

.page-head { background: var(--soft); border-bottom: 1px solid var(--line); }
.page-head h1 { max-width: var(--maxw); margin: 0 auto; padding: 36px 20px; font-size: clamp(1.8rem, 4vw, 2.4rem); }

main { padding: 36px 0 56px; }

/* Cards & sections */
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; margin: 0 0 22px; box-shadow: var(--shadow);
}
.card h2, .intro h2 { margin-top: 0; color: var(--brand-dark); }
.intro { margin-top: 18px; margin-bottom: 26px; }
.intro h2 { color: var(--brand-dark); }
/* Regulation block quote (e.g. the 603 CMR citation on About Us) */
.reg-quote { margin: 16px 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--line); }
.reg-quote p { margin: 0; font-size: .92rem; color: var(--muted); }
.reg-cite { margin-top: 10px !important; font-size: .85rem; }
/* Cap prose line length for readability (~70 characters) */
.card p, .intro p, .article p, .article li, .defs dd { max-width: 70ch; }
.muted { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block; background: var(--brand); color: #fff !important;
  padding: 11px 20px; border-radius: 999px; text-decoration: none; font-weight: 600;
}
.btn:hover { background: var(--brand-dark); color: #fff !important; }
.btn-outline { background: transparent; color: var(--brand-dark) !important; border: 2px solid var(--brand); }
.btn-outline:hover { background: var(--brand-light); color: var(--brand-dark) !important; }

.contact-cta { background: var(--soft); border-color: var(--line); }

/* People lists */
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.people li { padding: 10px 14px; background: var(--soft); border-radius: 8px; }
.people .role { display: block; font-weight: 700; color: var(--brand-dark); }

/* Definition lists (meetings) */
.defs { margin: 0; }
.defs dt { font-weight: 700; color: var(--brand-dark); margin-top: 14px; }
.defs dd { margin: 4px 0 0; }
.upcoming { background: var(--soft); }

/* Events (Meetings & Events page) */
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.event { display: flex; gap: 18px; align-items: flex-start; }
.event-media { flex: 0 0 200px; width: 200px; margin: 0; }
.event-media img { width: 100%; height: auto; display: block; border-radius: var(--radius); }
.event-body { flex: 1; }
.event-title { margin: 0 0 4px; color: var(--brand-dark); }
.event-meta { margin: 0 0 8px; color: var(--muted); font-size: .92rem; }

/* Quick links (home) */
.quicklinks h2 { color: var(--brand-dark); }
.quicklink-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.quicklink-grid a {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); box-shadow: var(--shadow); transition: transform .12s ease;
}
.quicklink-grid a:hover { transform: translateY(-2px); border-color: var(--brand); }
.quicklink-grid strong { color: var(--brand-dark); font-size: 1.05rem; }
.quicklink-grid span { color: var(--muted); font-size: .92rem; }

/* Resource groups (directory pages) */
.resource-group {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 26px; margin: 0 0 20px; box-shadow: var(--shadow);
}
.resource-group h2 { margin: 0 0 14px; color: var(--brand-dark); border-bottom: 2px solid var(--brand-light); padding-bottom: 8px; }
.link-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.link-list li { break-inside: avoid; margin: 0 0 8px; }

/* Footer */
.site-footer { background: var(--ink); color: #cdd6da; margin-top: 30px; }
.footer-inner { padding: 28px 20px; text-align: center; }
.site-footer a { color: #9fd6cf; }
.site-footer .copyright { font-size: .85rem; color: #8b969c; margin-bottom: 0; }

/* Responsive */
@media (max-width: 860px) {
  .link-list { columns: 1; }
  /* Brand + menu button on row 1; the search wraps full-width onto row 2.
     Extra specificity (.site-header …) so these win over the base search rules,
     which appear later in the file. */
  .site-header { flex-wrap: wrap; }
  .site-header .nav { order: 2; flex: 0 0 auto; }
  .site-header .site-search { order: 3; flex: 1 0 100%; margin-left: 0; }
  .site-header .search-input { width: 100%; }
  .site-header .search-results { left: 0; right: 0; width: auto; max-width: none; }
  /* With JS: show the toggle button and collapse the menu. */
  .js .nav-toggle {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0; cursor: pointer;
    border: 1px solid var(--line); border-radius: 8px; background: var(--brand-light);
  }
  .nav-toggle span { display: block; height: 3px; width: 22px; background: var(--brand-dark); border-radius: 2px; }
  .js .nav-list {
    display: none; position: absolute; right: 0; top: 52px; z-index: 50;
    flex-direction: column; min-width: 240px; background: #fff; padding: 8px;
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .js .nav-list.open { display: flex; }
  .event { flex-direction: column; }
  .event-media { flex-basis: auto; width: 100%; }
}

@media (max-width: 600px) {
  .hero-inner { flex-direction: column; gap: 20px; }
  .hero .hero-titles { text-align: center; }
}

/* Site search (in the header, top-right; shown only when JS is available) */
.site-search { display: none; position: relative; order: 2; margin-left: auto; }
.js .site-search { display: block; }
.search-form { margin: 0; }
.search-input {
  width: 240px; max-width: 100%; padding: 8px 14px; font-size: .95rem;
  color: var(--ink); background: var(--soft);
  border: 1px solid var(--line); border-radius: 999px;
}
.search-input:focus { outline: 2px solid var(--brand); outline-offset: 1px; background: #fff; }
.search-results {
  position: absolute; z-index: 60; right: 0; top: calc(100% + 8px);
  width: 360px; max-width: 86vw;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); max-height: 70vh; overflow-y: auto;
}
.search-results ul { list-style: none; margin: 0; padding: 6px; }
.search-results a {
  display: block; padding: 8px 10px; border-radius: 6px;
  text-decoration: none; color: var(--ink);
}
.search-results a:hover, .search-results a:focus { background: var(--brand-light); outline: none; }
.search-results .result-label { display: block; font-weight: 600; color: var(--brand-dark); }
.search-results .result-context { display: block; font-size: .82rem; color: var(--muted); }
.search-results .no-results { margin: 0; padding: 12px 10px; color: var(--muted); }

/* Highlight a search target on arrival */
:target { scroll-margin-top: 16px; }
.search-hit { background: #fde68a; border-radius: 4px; box-shadow: 0 0 0 4px #fde68a; }
@media (prefers-reduced-motion: no-preference) {
  .search-hit { animation: search-flash 2.2s ease-out forwards; }
  @keyframes search-flash {
    from { background: #fde68a; box-shadow: 0 0 0 4px #fde68a; }
    to { background: transparent; box-shadow: 0 0 0 4px transparent; }
  }
}
