:root{
  --max: 1100px;
  --pad: 1rem;
  --radius: 14px;
  --border: #cfe3db;
  --text: #111;
  --muted: #555;
  --bg: #E6F4EF;
  --bg-alt: #F6FFFB;
  --focus: 2px solid #111;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Accessibility */
.skip-link{
  position: absolute; left: -999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus{
  left: 1rem; top: 1rem;
  width: auto; height: auto;
  padding: .5rem .75rem;
  background: #fff;
  outline: var(--focus);
  border-radius: 10px;
  z-index: 9999;
}

/* =========================
   Header / Nav (Consolidated)
   ========================= */
.site-header{
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 0;
}

.header-left{
  display:flex;
  align-items:center;
  gap: .75rem;
  min-width: 0;
}

.brand{
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: inherit;
}
.brand-logo{ width: 64px; height: 64px; }
.brand-name{ font-weight: 700; }

.header-actions{
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.public-btn{ white-space: nowrap; }

/* Nav wrapper anchors dropdown */
.nav{ position: relative; }

/* --- Buttons look consistent --- */
.public-btn,
.nav-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: .6rem .9rem;
  border-radius: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

/* Hamburger toggle (always shown) */
.nav-toggle{
  border: 1px solid #111;
  background: #111;
  color: #fff;
  gap: .45rem;
}
.nav-toggle::before{
  content: "☰";
  font-size: 1.1rem;
  line-height: 1;
}
.nav-toggle[aria-expanded="true"]::before{
  content: "✕";
}
.nav-toggle:focus-visible{ outline: var(--focus); }

/* Base menu (hidden unless open) */
.nav-menu{
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}

/* Open dropdown menu */
.nav-menu.open{
  display: flex;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-width: 220px;
  z-index: 100;

  /* KEY FIX: keep dropdown compact */
  gap: .25rem;
}

/* Menu links */
.nav-menu a{
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  line-height: 1.2;
}
.nav-menu a:hover{ background: var(--bg-alt); }
.nav-menu a:focus-visible{ outline: var(--focus); }
.nav-menu a[aria-current="page"]{
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

/* Optional divider inside dropdown */
.nav-divider{
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

/* Hanging indent ONLY for the long wrapping label
   (requires <li class="wrap-indent"> on that one item) */
.nav-menu.open .wrap-indent a{
  padding-left: 1.1rem;
  text-indent: -1.1rem;
}

/* Hide Public button on tiny screens */
@media (max-width: 360px){
  .public-btn{ display: none; }
}

/* =================
   Layout sections
   ================= */
.section{ padding: 2.25rem 0; }
.section-alt{
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.lead{ color: var(--muted); font-size: 1.05rem; margin: 0 0 1rem; }

/* Cards */
.cards{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: #fff;
}

/* Lists */
.bullets{ padding-left: 1.1rem; }
.bullets li{ margin: .4rem 0; }

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .6rem .9rem;
  border-radius: 14px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.btn:focus-visible{ outline: var(--focus); outline-offset: 2px; }
.btn-secondary{ background: #fff; color: #111; }
.btn-ghost{ background: transparent; color: #111; border: 1px solid var(--border); }

/* Results: keep toggle button styled even when disabled */
#toggleDetails:disabled {
  opacity: 0.45;          /* or whatever your system uses */
  cursor: not-allowed;
}

/* Footer */
.site-footer{
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

/* Events (compact rows) */
.event-row{
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}
.event-row:last-child{ border-bottom: none; }

.event-topline{
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.event-date{
  font-weight: 600;
  min-width: 70px;
}
.event-title{ font-weight: 600; }
.event-desc{ margin-top: 6px; }
.event-meta{ margin-top: 6px; opacity: 0.85; font-size: 0.95em; }

.event-section-title{
  margin: 0 0 .5rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.event-section-divider{
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

/* Pinned announcement styling */
.card.pinned{
  border-color: #111;
  box-shadow: 0 0 0 2px rgba(17,17,17,.08);
}

.pin-badge{
  display: inline-block;
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 700;
  padding: .2rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  margin-bottom: .5rem;
}

/* Announcement section headings/divider */
.announcement-section-title{
  margin: 0 0 .5rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.announcement-section-divider{
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

/* ================================
   Announcements horizontal carousel
   ================================ */

.announce-carousel{
  position: relative;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .5rem;
  align-items: center;
}

.announce-track{
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.25rem 2.75rem 0.75rem;
  scroll-behavior: smooth;
}

.announce-track:focus-visible{
  outline: var(--focus);
  outline-offset: 2px;
  border-radius: 12px;
}

.announce-track .card{
  flex: 0 0 320px;
  scroll-snap-align: start;
}

/* Mobile: swipe-first behavior */
@media (max-width: 720px){
  .cards{ grid-template-columns: 1fr; }

  .announce-track{
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .announce-track .card{
    flex-basis: 85%;
  }
}

/* Overlay arrow buttons */
.announce-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  padding: 0;
  z-index: 5;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
}
.announce-prev{ left: 0; }
.announce-next{ right: 0; }

/* Hide arrows on small touch screens */
@media (max-width: 620px){
  .announce-btn{ display: none; }
}

/* Screen-reader only helper */
.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;
}

/* =================
   Generic Carousel
   ================= */
.carousel-track{
  display:flex;
  gap: 1rem;
  overflow-x:auto;
  scroll-snap-type: x mandatory;
  padding-bottom: .5rem;
  scroll-behavior: smooth;
}
.carousel-item{
  flex: 0 0 80%;
  scroll-snap-align: start;
  margin: 0;
}
.carousel-item img{
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.carousel-controls{
  display:flex;
  gap:.5rem;
  margin-top:.75rem;
}
@media (min-width: 820px){
  .carousel-item{ flex-basis: 40%; }
}
