@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Jost:wght@300;400;500;600;700&display=swap');

:root {
  --sidebar-width: 230px;

  /* Brand palette — inspired by The Willows community branding */
  --color-navy: #042b48;
  --color-navy-deep: #06203a;
  --color-navy-soft: #0c3757;
  --color-copper: #b45b37;
  --color-copper-dark: #a35233;
  --color-mustard: #ba873d;
  --color-bg-light: #ecf5fe;
  --color-bg-grey: #f3f4f4;
  --color-divider: #e0e0e0;

  --color-link: var(--color-navy);
  --color-link-hover: var(--color-copper);

  --color-sidebar-bg: var(--color-navy);
  --color-sidebar-link: #cdd8e1;
  --color-sidebar-link-hover: #ffffff;
  --color-sidebar-divider: rgba(255, 255, 255, 0.1);
  --color-sidebar-hover-bg: rgba(180, 91, 55, 0.22);
  --color-sidebar-submenu-bg: var(--color-navy-deep);

  --color-text: #333333;

  --font-heading: "Playfair Display", Georgia, serif;
  --font-nav: "Jost", Arial, Helvetica, sans-serif;
  --font-body: "Jost", Arial, Helvetica, sans-serif;
}

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

html, body {
  min-height: 100%;
}

body {
  display: flex;
  font-family: var(--font-body);
  color: var(--color-text);
}

/* ─── Sidebar ─────────────────────────────────────────────── */

#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--color-sidebar-bg);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-sidebar-divider);
  min-height: 100vh;
}

#sidebar .logo-wrap {
  padding: 22px 20px 16px;
  border-bottom: 2px solid var(--color-copper);
  background: var(--color-navy-deep);
}

#sidebar .logo-wrap img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ─── Navigation ──────────────────────────────────────────── */

nav {
  flex: 1;
}

nav ul {
  list-style: none;
}

/* Top-level items — plain link (no children) */
nav > ul > li > a {
  display: block;
  padding: 11px 16px 11px 13px;
  border-left: 3px solid transparent;
  font-family: var(--font-nav);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-sidebar-link);
  text-decoration: none;
  border-bottom: 1px solid var(--color-sidebar-divider);
}

nav > ul > li > a:hover {
  color: var(--color-sidebar-link-hover);
  background: var(--color-sidebar-hover-bg);
}

/* Parent items that use <details> for accordion */
nav > ul > li > details {
  border-bottom: 1px solid var(--color-sidebar-divider);
}

nav > ul > li > details > summary {
  display: block;
  padding: 11px 16px 11px 13px;
  border-left: 3px solid transparent;
  font-family: var(--font-nav);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-sidebar-link);
  cursor: pointer;
  list-style: none;
  user-select: none;
  position: relative;
}

nav > ul > li > details > summary::-webkit-details-marker {
  display: none;
}

nav > ul > li > details > summary::after {
  content: "›";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.15s ease;
  font-size: 16px;
  color: rgba(205, 216, 225, 0.45);
}

nav > ul > li > details[open] > summary::after {
  transform: translateY(-50%) rotate(90deg);
  color: var(--color-mustard);
}

nav > ul > li > details[open] > summary {
  border-left-color: var(--color-copper);
  color: var(--color-sidebar-link-hover);
}

nav > ul > li > details > summary:hover {
  color: var(--color-sidebar-link-hover);
  background: var(--color-sidebar-hover-bg);
}

/* Sub-links */
nav > ul > li > details > ul {
  background: var(--color-sidebar-submenu-bg);
}

nav > ul > li > details > ul > li > a {
  display: block;
  padding: 9px 16px 9px 28px;
  font-family: var(--font-nav);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--color-sidebar-link);
  text-decoration: none;
  border-top: 1px solid var(--color-sidebar-divider);
}

nav > ul > li > details > ul > li > a:hover {
  color: var(--color-sidebar-link-hover);
  background: var(--color-sidebar-hover-bg);
}

/* ─── Main content area ───────────────────────────────────── */

#main {
  flex: 1;
  min-width: 0;
  position: relative;
  min-height: 100vh;
}

/* Inner pages: light grey background */
#main.content-bg {
  background: var(--color-bg-grey);
}

/* ─── Homepage hero ────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-image: url(../photos/background.jpg);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(4, 43, 72, 0.55) 0%, rgba(4, 43, 72, 0.35) 45%, rgba(4, 43, 72, 0.7) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 0 24px;
  color: #ffffff;
}

.hero-eyebrow {
  font-family: var(--font-nav);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--color-mustard);
}

.hero-eyebrow::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  background: var(--color-mustard);
  margin: 14px auto 0;
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 46px;
  letter-spacing: 0.5px;
  line-height: 1.2;
  margin: 18px 0 16px;
}

.hero-content p {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
}

@media (max-width: 760px) {
  .hero-content h1 {
    font-size: 32px;
  }
}

/* ─── Homepage preface sections ───────────────────────────── */

.preface-section {
  background: var(--color-bg-grey);
  padding: 60px 5%;
}

.preface-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .preface-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .preface-grid {
    grid-template-columns: 1fr;
  }
}

.preface-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  padding: 30px 28px;
  border-top: 3px solid var(--color-copper);
}

.preface-card .eyebrow {
  font-family: var(--font-nav);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--color-copper);
  margin-bottom: 10px;
}

.preface-card h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 22px;
  color: var(--color-navy);
  margin-bottom: 10px;
}

.preface-card p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 22px;
  flex: 1;
}

/* ─── CTA buttons ──────────────────────────────────────────── */

.cta-btn {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: var(--font-nav);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--color-navy);
  color: var(--color-navy);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}

.cta-btn::after {
  content: "\2192";
  transition: transform 0.2s ease;
}

.cta-btn:hover {
  background: var(--color-navy);
  color: #ffffff;
}

.cta-btn:hover::after {
  transform: translateX(4px);
}

.cta-btn.cta-btn--copper {
  border-color: var(--color-copper);
  color: var(--color-copper);
}

.cta-btn.cta-btn--copper:hover {
  background: var(--color-copper);
  color: #ffffff;
}

.cta-btn.cta-btn--light {
  border-color: rgba(255, 255, 255, 0.55);
  color: #ffffff;
}

.cta-btn.cta-btn--light:hover {
  background: #ffffff;
  color: var(--color-navy);
}

/* ─── Gallery teaser (homepage) ───────────────────────────── */

.gallery-teaser {
  background: var(--color-navy);
  padding: 60px 5% 70px;
}

.gallery-teaser__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 32px;
}

.gallery-teaser .eyebrow {
  font-family: var(--font-nav);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--color-mustard);
  margin-bottom: 10px;
}

.gallery-teaser h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 30px;
  color: #ffffff;
  margin: 0;
}

.gallery-slider-wrap {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-slider {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.gallery-slider::-webkit-scrollbar {
  display: none;
}

.gallery-slider__item {
  flex: 0 0 auto;
  display: block;
  width: 320px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  scroll-snap-align: start;
}

.gallery-slider__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-slider__item:hover img {
  transform: scale(1.05);
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(6, 32, 58, 0.75);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  z-index: 2;
}

.slider-arrow:hover {
  background: var(--color-copper);
  border-color: var(--color-copper);
}

.slider-arrow--prev {
  left: 8px;
}

.slider-arrow--next {
  right: 8px;
}

@media (max-width: 900px) {
  .gallery-slider__item {
    width: 260px;
  }
}

@media (max-width: 600px) {
  .gallery-teaser h2 {
    font-size: 24px;
  }

  .gallery-slider__item {
    width: 220px;
  }

  .slider-arrow {
    display: none;
  }
}

/* ─── Site footer (homepage) ──────────────────────────────── */

.site-footer {
  text-align: center;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #999999;
  padding: 22px;
  background: var(--color-bg-grey);
  border-top: 1px solid var(--color-divider);
}

/* ─── Content box (inner pages) ───────────────────────────── */

.content-box {
  background: #ffffff;
  padding: 32px 36px;
  margin: 36px;
  max-width: 860px;
  font-size: 14px;
  line-height: 1.7;
}

.content-box.wide {
  max-width: 1100px;
}

.content-box h1 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: 0.5px;
  color: var(--color-navy);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-copper);
}

.content-box h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 18px;
  color: var(--color-copper);
  margin: 20px 0 8px;
}

.content-box p {
  margin-bottom: 12px;
}

.content-box a {
  color: var(--color-link);
}

.content-box a:hover {
  color: var(--color-link-hover);
}

/* ─── Photo gallery ────────────────────────────────────────── */

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.photo-gallery__item {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
}

.photo-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-gallery__item:hover img {
  transform: scale(1.05);
}

.photo-gallery__item::after {
  content: "\2922";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 43, 72, 0.6);
  color: #ffffff;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.photo-gallery__item:hover::after {
  opacity: 1;
}

@media (max-width: 600px) {
  .photo-gallery {
    grid-template-columns: 1fr;
  }
}

/* ─── Board members ────────────────────────────────────────── */

.board-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 24px;
}

.board-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--color-divider);
}

.board-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.board-card__photo {
  flex: 0 0 160px;
  width: 160px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
  border-radius: 4px;
}

.board-card__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
  color: var(--color-navy);
  margin: 0 0 2px;
}

.board-card__role {
  font-family: var(--font-nav);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-copper);
  margin: 0 0 10px;
}

.board-card__bio p:last-child {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .board-card {
    flex-direction: column;
  }

  .board-card__photo {
    width: 140px;
  }
}

/* ─── Lightbox ─────────────────────────────────────────────── */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(4, 18, 31, 0.92);
  align-items: center;
  justify-content: center;
}

.lightbox.is-open {
  display: flex;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 86vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(6, 32, 58, 0.75);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: var(--color-copper);
  border-color: var(--color-copper);
}

.lightbox__close {
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

.lightbox__nav--prev {
  left: 18px;
}

.lightbox__nav--next {
  right: 18px;
}

.lightbox__counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-nav);
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 600px) {
  .lightbox__nav {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .lightbox__close {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
}

/* ─── Collapsible panels (<details>/<summary>) ────────────── */

.panel {
  border: 1px solid var(--color-divider);
  margin-bottom: 8px;
}

.panel > summary {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: var(--color-bg-light);
  list-style: none;
  user-select: none;
}

.panel > summary::-webkit-details-marker {
  display: none;
}

.panel > summary:hover {
  background: #e4ecf4;
}

.panel-content {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
}

.panel-content ul {
  list-style: disc;
  padding-left: 20px;
}

.panel-content li {
  margin-bottom: 4px;
}

.panel-content a {
  color: var(--color-link);
}

/* ─── Unit holder table ───────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
}

.uh-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.uh-table .col-unit {
  width: 7%;
}

.uh-table .col-name {
  width: 33%;
}

.uh-table .col-board {
  width: 13%;
}

.uh-table .col-email {
  width: 47%;
}

.uh-table th,
.uh-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-divider);
  overflow-wrap: break-word;
}

.uh-table th {
  background: var(--color-bg-light);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.uh-table tbody tr:nth-child(even) td {
  background: #f7f9fb;
}

.uh-table tr:hover td {
  background: #eef3f8;
}

.uh-table a {
  color: var(--color-link);
}

/* Card layout on small screens — table rows become stacked cards */
@media (max-width: 760px) {
  .table-scroll {
    overflow-x: visible;
  }

  .uh-table {
    min-width: 0;
  }

  .uh-table thead {
    display: none;
  }

  .uh-table,
  .uh-table tbody,
  .uh-table tr,
  .uh-table td {
    display: block;
    width: 100%;
  }

  .uh-table tr {
    background: #ffffff;
    border: 1px solid var(--color-divider);
    border-left: 3px solid var(--color-copper);
    padding: 14px 16px;
    margin-bottom: 10px;
  }

  .uh-table tbody tr:nth-child(even) td,
  .uh-table tr:hover td {
    background: transparent;
  }

  .uh-table td {
    border-bottom: none;
    padding: 3px 0;
    overflow-wrap: break-word;
  }

  /* Unit number — navy badge */
  .uh-table tbody tr td:nth-child(1) {
    display: inline-block;
    font-family: var(--font-nav);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffffff;
    background: var(--color-navy);
    padding: 3px 10px;
    margin-bottom: 8px;
  }

  .uh-table td:nth-child(1)::before {
    content: "Unit ";
  }

  /* Name */
  .uh-table td:nth-child(2) {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
    color: var(--color-navy);
  }

  /* Board member — copper badge, hidden when empty */
  .uh-table td:nth-child(3) {
    margin-top: 6px;
  }

  .uh-table td:nth-child(3):empty {
    display: none;
  }

  .uh-table td:nth-child(3):not(:empty) {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffffff;
    background: var(--color-copper);
    padding: 2px 8px;
  }

  .uh-table td:nth-child(3):not(:empty)::before {
    content: "Board Member \2014 ";
  }

  /* Email */
  .uh-table td:nth-child(4) {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.6;
  }
}

/* ─── Copyright footer (inner pages) ──────────────────────── */

.copyright {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

#main.content-bg .copyright {
  color: #999;
}

/* ─── Mobile hamburger ────────────────────────────────────── */

#nav-toggle {
  display: none;
}

.hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: var(--color-navy);
  border: 1px solid var(--color-navy);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #ffffff;
}

@media (max-width: 760px) {
  .hamburger {
    display: block;
  }

  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
  }

  #nav-toggle:checked ~ #sidebar {
    transform: translateX(0);
  }

  #main {
    min-height: 100vh;
  }

  .content-box {
    margin: 52px 12px 12px;
    padding: 20px;
  }

  .preface-section {
    padding: 40px 16px;
  }

  .copyright {
    position: static;
    display: block;
    text-align: center;
    padding: 12px;
    color: #999;
  }
}

/* ─── Forms (login / password reset) ─────────────────────── */

.login-box {
  max-width: 420px;
}

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 18px;
}

.login-box label {
  font-family: var(--font-nav);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-navy);
  margin-top: 12px;
  margin-bottom: 6px;
}

.login-box input[type="email"],
.login-box input[type="password"] {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--color-divider);
  background: #ffffff;
  color: var(--color-text);
}

.login-box input:focus {
  outline: none;
  border-color: var(--color-copper);
}

.login-box button.cta-btn {
  margin-top: 18px;
  align-self: flex-start;
  font-family: var(--font-nav);
  cursor: pointer;
}

.form-footnote {
  margin-top: 14px;
  font-size: 13px;
}

.form-footnote a {
  color: var(--color-link);
}

.form-footnote a:hover {
  color: var(--color-link-hover);
}

.is-hidden {
  display: none !important;
}

/* ─── Form status messages ────────────────────────────────── */

.form-message {
  display: none;
  font-size: 13px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid transparent;
}

.form-message.is-visible {
  display: block;
}

.form-message--error {
  background: #fdecea;
  border-left-color: #c0392b;
  color: #962d22;
}

.form-message--success {
  background: var(--color-bg-light);
  border-left-color: var(--color-copper);
  color: var(--color-navy);
}

/* ─── Log Out nav link (injected by js/auth.js guardPage) ─── */

nav > ul > li > a.logout-link {
  border-top: 2px solid var(--color-copper);
}

nav > ul > li > a.logout-link:hover {
  color: var(--color-mustard);
}
