/* ============================================================
   Morgan Hill Tennis Club — main.css
   Serves all pages via base.html
   ============================================================ */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:   #1a4731;
  --green-mid:    #2d6e4e;
  --green-light:  #8fbda2;
  --green-pale:   #eaf6ef;
  --lime:         #c8e86d;
  --lime-dark:    #9bba3a;
  --text-primary: #111;
  --text-muted:   #555;
  --text-faint:   #888;
  --bg:           #fff;
  --bg-surface:   #f5f5f3;
  --border:       rgba(0,0,0,0.10);
  --border-mid:   rgba(0,0,0,0.18);
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    18px;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-surface);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ── App shell ── */
.app {
  width: 100%;
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Inner content wrapper — centres content on wide screens */
.content-wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Top bar ── */
.topbar {
  background: var(--green-dark);
  /* Fluid horizontal padding — enough breathing room at any width */
  padding: 0 clamp(12px, 4vw, 24px);
  position: sticky;
  top: 0;
  z-index: 50;
  /* Expand vertically rather than clip when content wraps on narrow screens */
  height: auto;
  min-height: 56px;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Allow wrapping on very narrow screens so nothing is cut off */
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 0;
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  /* Prevent the logo from shrinking away on narrow screens */
  flex-shrink: 0;
  min-width: 0;
}
.logo-ball {
  /* Scale the ball down slightly on very small screens */
  width: clamp(28px, 8vw, 34px);
  height: clamp(28px, 8vw, 34px);
  border-radius: 50%;
  background: var(--lime);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(15px, 4.5vw, 18px);
  flex-shrink: 0;
}
.logo-text {
  font-size: clamp(12px, 3.2vw, 13px);
  font-weight: 500; color: #e8f4ed; line-height: 1.25;
  /* Allow text to truncate gracefully rather than overflow */
  min-width: 0;
  overflow: hidden;
}
.logo-text span {
  display: block;
  font-size: clamp(9px, 2.4vw, 10px);
  color: var(--green-light);
  font-weight: 400; letter-spacing: 0.07em; text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-btn {
  background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--lime);
  border-radius: 8px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.menu-btn:hover { background: rgba(255,255,255,0.08); }
.menu-btn i { font-size: 24px; display: block; }

/* When the topbar-nav wraps to a second line (desktop, very narrow window),
   give it the full width and a subtle top border so it reads as a nav band */
@media (max-width: 900px) and (min-width: 768px) {
  .topbar-inner {
    align-items: flex-start;
  }
  .topbar-nav {
    width: 100%;
    padding: 0 0 10px;
    border-top: 0.5px solid rgba(255,255,255,0.12);
    flex-wrap: wrap;
    gap: 12px 20px;
  }
}

/* ── Hero ── */
.hero {
  background: var(--green-dark);
  padding: 22px 20px 32px;
  color: #fff;
}
.hero-eyebrow {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--green-light); margin-bottom: 10px; font-weight: 500;
}
.hero-title {
  font-size: 30px; font-weight: 600; line-height: 1.15;
  color: #fff; margin-bottom: 14px;
}
.hero-title em { color: var(--lime); font-style: normal; }
.hero-sub {
  font-size: 15px; color: #a8cdb8; line-height: 1.65; margin-bottom: 22px;
  max-width: 34ch;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Buttons ── */
.btn-primary {
  background: var(--lime); color: var(--green-dark);
  border: none; border-radius: 22px;
  padding: 11px 22px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover  { background: #d4f07a; }
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  background: transparent; color: var(--lime);
  border: 1.5px solid rgba(200,232,109,0.45); border-radius: 22px;
  padding: 11px 22px; font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: background 0.15s;
}
.btn-ghost:hover { background: rgba(200,232,109,0.08); }

/* ── Sections ── */
.section { padding: 22px 16px; }
.section + .section { padding-top: 0; }
.section-label {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 14px; font-weight: 500;
}

/* ── Alert / pinned notice ── */
.alert-card {
  background: var(--green-pale);
  border-left: 3px solid var(--green-dark);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 13px 15px;
}
.alert-card-title {
  font-size: 15px; font-weight: 600; color: var(--green-dark); margin-bottom: 3px;
}
.alert-card-meta { font-size: 13px; color: var(--green-mid); }

/* ── Horizontal event chips ── */
.upcoming-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.upcoming-scroll::-webkit-scrollbar { display: none; }

.event-chip {
  flex-shrink: 0;
  background: var(--bg);
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  width: 155px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s;
}
.event-chip:hover { border-color: var(--green-mid); }
.event-chip-date {
  font-size: 11px; font-weight: 600; color: var(--green-dark);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 5px;
}
.event-chip-name {
  font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.35;
}
.event-chip-note { font-size: 11px; color: var(--text-faint); margin-top: 5px; }

.event-chip.featured { background: var(--green-dark); border-color: var(--green-dark); }
.event-chip.featured .event-chip-date  { color: var(--lime); }
.event-chip.featured .event-chip-name  { color: #fff; }
.event-chip.featured .event-chip-note  { color: var(--green-light); }

/* ── Quick action grid ── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quick-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 12px 10px 11px;
  cursor: pointer;
  border: 0.5px solid var(--border);
  text-decoration: none;
  display: block;
  transition: border-color 0.15s, background 0.15s;
}
.quick-card:hover { border-color: var(--green-mid); background: #f0f7f3; }
.quick-icon { font-size: 22px; color: var(--green-dark); margin-bottom: 8px; display: block; }
.quick-card-label { font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.35; }
.quick-card-sub   { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

/* ── News list ── */
.news-list {
  display: flex; flex-direction: column;
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.news-item {
  background: var(--bg);
  padding: 14px 15px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  cursor: pointer;
  border-bottom: 0.5px solid var(--border);
  text-decoration: none;
  transition: background 0.12s;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: var(--bg-surface); }

.news-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--lime);
  border: 2px solid var(--green-dark);
  margin-top: 5px; flex-shrink: 0;
}
.news-dot.old { background: var(--border-mid); border-color: var(--border-mid); }
.news-item-title { font-size: 14px; font-weight: 500; color: var(--text-primary); line-height: 1.4; }
.news-item-date  { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.news-item-arrow { margin-left: auto; flex-shrink: 0; color: var(--text-faint); font-size: 16px; align-self: center; }

/* ── Membership CTA banner ── */
.member-banner {
  margin: 0 16px 24px;
  background: var(--green-dark);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.member-banner-text { color: #a8cdb8; font-size: 13px; line-height: 1.5; }
.member-banner-text strong { display: block; font-size: 15px; color: #fff; margin-bottom: 4px; }
.member-btn {
  background: var(--lime); color: var(--green-dark);
  border: none; border-radius: 18px;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  text-decoration: none; display: inline-block;
  transition: background 0.15s;
}
.member-btn:hover { background: #d4f07a; }

/* ── Footer ── */
.footer {
  background: var(--green-dark);
  padding: 28px 20px 20px;
  color: var(--green-light);
  font-size: 13px;
  margin-top: auto;
}
.footer-logo { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.footer-addr { margin-bottom: 16px; line-height: 1.7; }
.footer-links {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 20px;
}
.footer-links a { color: var(--green-light); text-decoration: none; font-size: 13px; transition: color 0.15s; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 0.5px solid rgba(255,255,255,0.12);
  padding-top: 16px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

/* ── Bottom nav ── */
.bottom-nav {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 0.5px solid var(--border-mid);
  display: flex;
  padding: 8px 0 max(12px, env(safe-area-inset-bottom));
  z-index: 50;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  cursor: pointer; padding: 4px 0;
  color: var(--text-faint);
  border: none; background: none;
  font-family: 'Inter', system-ui, sans-serif;
  text-decoration: none;
  transition: color 0.15s;
}
.nav-item.active  { color: var(--green-dark); }
.nav-item:hover   { color: var(--green-mid); }
.nav-item i       { font-size: 22px; }
.nav-item span    { font-size: 10px; font-weight: 500; letter-spacing: 0.02em; }

/* ── Slide-up drawer ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.drawer-panel {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 480px;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  padding: 8px 0 max(24px, env(safe-area-inset-bottom));
  z-index: 201;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.drawer-panel.open { transform: translateX(-50%) translateY(0); }
.drawer-handle {
  width: 38px; height: 4px; border-radius: 2px;
  background: var(--border-mid);
  margin: 10px auto 18px;
}
.drawer-heading {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint); padding: 0 20px 8px; font-weight: 500;
  display: block;
}
.drawer-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px; cursor: pointer;
  color: var(--text-primary); font-size: 15px;
  border: none; background: none; width: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  text-align: left; text-decoration: none;
  transition: background 0.12s;
}
.drawer-item:hover { background: var(--bg-surface); }
.drawer-item i { font-size: 20px; color: var(--green-dark); width: 24px; text-align: center; }
.drawer-sep { height: 0.5px; background: var(--border); margin: 8px 20px; }

/* ── Utility: visually hidden (screen readers only) ── */
.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;
}

/* ── Sections responsive ── */
.section { padding: 28px 20px; }

@media (min-width: 768px) {
  .section { padding: 32px 0; }
  .hero { padding: 48px 20px 56px; }
  .hero-title { font-size: 42px; }
  .hero-sub { font-size: 17px; max-width: 48ch; }

  /* Two-column home layout: main content + sidebar */
  .home-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
  }
  .home-main { min-width: 0; }
  .home-sidebar { min-width: 0; }

  .quick-grid { grid-template-columns: repeat(5, 1fr); }

  .member-banner {
    margin: 0 0 24px;
    border-radius: var(--radius-lg);
  }

  .footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    align-items: start;
  }
  .footer-links { margin-bottom: 0; }
  .footer-bottom { grid-column: 1 / -1; }
}

@media (min-width: 1100px) {
  .hero-title { font-size: 52px; }
}

/* ── Drawer caps to a sensible width on desktop ── */
.drawer-panel {
  max-width: 420px;
}

/* ── Full-width stripe elements with centred inner content ── */
.hero-inner,
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.footer { padding: 36px 20px 24px; }
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.bottom-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  width: 100%;
}

/* On desktop, bottom nav becomes a top-aligned horizontal strip */
@media (min-width: 768px) {
  .bottom-nav {
    display: none; /* hidden: desktop nav lives in the topbar drawer */
  }
  /* Show nav links inline in topbar on large screens */
  .topbar-nav {
    display: flex;
    gap: 28px;
  }
  .topbar-nav a {
    color: var(--green-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
  }
  .topbar-nav a:hover,
  .topbar-nav a.active { color: var(--lime); }
  .menu-btn { display: none; }
}
@media (max-width: 767px) {
  .topbar-nav { display: none; }
}

/* ── Sidebar: event chips stack vertically on desktop ── */
@media (min-width: 768px) {
  .home-sidebar .upcoming-scroll {
    flex-direction: column;
    overflow-x: visible;
  }
  .home-sidebar .event-chip {
    width: 100%;
  }
  .home-sidebar .member-banner {
    margin: 0;
  }
}

/* ══════════════════════════════════════════════════════════════
   PHOTO GALLERY — home feature widget + gallery/album pages
   ══════════════════════════════════════════════════════════════ */

/* ── Spacing helper used in home-grid blocks ── */
.home-block { margin-bottom: 32px; }
.home-block:last-child { margin-bottom: 0; }

/* ── Home page: featured photo widget ── */
.photo-feature-block { display: flex; flex-direction: column; gap: 12px; }

.photo-feature-card {
  display: block;
  text-decoration: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 0.5px solid var(--border-mid);
  transition: border-color 0.15s;
}
.photo-feature-card:hover { border-color: var(--green-mid); }

.photo-feature-img-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-surface);
}
.photo-feature-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.photo-feature-card:hover .photo-feature-img { transform: scale(1.03); }

.photo-feature-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,71,49,0.0);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 14px; font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.photo-feature-card:hover .photo-feature-overlay {
  opacity: 1;
  background: rgba(26,71,49,0.45);
}
.photo-feature-overlay i { font-size: 22px; }

.photo-feature-caption {
  padding: 10px 12px 4px;
  font-size: 14px; color: var(--text-primary); line-height: 1.45;
}
.photo-feature-album-meta {
  padding: 0 12px 12px;
  font-size: 12px; color: var(--text-faint);
  display: flex; align-items: center; gap: 5px;
}
.photo-feature-album-meta i { font-size: 13px; color: var(--green-mid); }

/* ── Thumbnail row below the featured photo ── */
.photo-album-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.photo-album-row::-webkit-scrollbar { display: none; }

.photo-album-thumb {
  flex-shrink: 0;
  width: 76px; height: 76px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  text-decoration: none;
  border: 0.5px solid var(--border-mid);
  transition: border-color 0.15s;
}
.photo-album-thumb:hover { border-color: var(--green-mid); }
.photo-album-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.photo-album-thumb-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(26,71,49,0.72);
  color: #fff;
  font-size: 9px; font-weight: 500;
  text-align: center;
  padding: 3px 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── "See all albums" link ── */
.photo-see-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--green-dark);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.15s;
}
.photo-see-all-link:hover { color: var(--green-mid); }
.photo-see-all-link i { font-size: 16px; }

/* ── Gallery list page ── */
.gallery-page { padding: 28px 20px; }
.gallery-page-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.gallery-page-header { margin-bottom: 24px; }
.gallery-page-title {
  font-size: 26px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 6px;
}
.gallery-page-sub { font-size: 15px; color: var(--text-muted); }

/* Year filter tabs */
.gallery-year-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px;
}
.gallery-year-tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid var(--border-mid);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.gallery-year-tab:hover { border-color: var(--green-mid); color: var(--green-dark); }
.gallery-year-tab.active {
  background: var(--green-dark);
  color: var(--lime);
  border-color: var(--green-dark);
}

/* Album grid */
.gallery-album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
@media (min-width: 640px)  { .gallery-album-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .gallery-album-grid { grid-template-columns: repeat(4, 1fr); } }

.gallery-album-card {
  display: block; text-decoration: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 0.5px solid var(--border-mid);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gallery-album-card:hover {
  border-color: var(--green-mid);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.gallery-album-img-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-surface);
  position: relative;
}
.gallery-album-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.3s ease;
}
.gallery-album-card:hover .gallery-album-img-wrap img { transform: scale(1.04); }
.gallery-album-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 32px;
}
.gallery-album-count {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff; font-size: 11px; font-weight: 500;
  padding: 3px 8px; border-radius: 10px;
  display: flex; align-items: center; gap: 4px;
}
.gallery-album-info { padding: 10px 12px 12px; }
.gallery-album-name { font-size: 14px; font-weight: 500; color: var(--text-primary); line-height: 1.3; }
.gallery-album-date { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.gallery-album-desc { font-size: 12px; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }

/* Gallery pagination */
.gallery-pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 8px 0 24px;
}
.gallery-page-btn {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  color: var(--green-dark);
  border: 1px solid var(--green-dark);
  transition: background 0.15s, color 0.15s;
}
.gallery-page-btn:hover { background: var(--green-dark); color: var(--lime); }
.gallery-page-info { font-size: 13px; color: var(--text-faint); }
.gallery-empty { font-size: 15px; color: var(--text-faint); padding: 32px 0; }

/* ── Album detail page ── */
.album-page { padding: 28px 20px; }
.album-page-inner { max-width: 1100px; margin: 0 auto; }
.album-page-header { margin-bottom: 28px; }

.album-back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--green-dark); text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.15s;
}
.album-back-link:hover { color: var(--green-mid); }

.album-page-title {
  font-size: 26px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 6px;
}
.album-page-meta {
  font-size: 13px; color: var(--text-faint);
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.album-page-meta i { font-size: 14px; color: var(--green-mid); }
.album-page-desc { font-size: 15px; color: var(--text-muted); line-height: 1.6; }

/* Masonry-style photo grid */
.album-photo-grid {
  columns: 2;
  column-gap: 12px;
}
@media (min-width: 640px)  { .album-photo-grid { columns: 3; } }
@media (min-width: 900px)  { .album-photo-grid { columns: 4; } }

.album-photo-item {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 0.5px solid var(--border-mid);
  background: var(--bg-surface);
}
.album-photo-link { display: block; }
.album-photo-img {
  width: 100%; height: auto;
  display: block;
  transition: transform 0.3s ease;
}
.album-photo-item:hover .album-photo-img { transform: scale(1.02); }
.album-photo-caption {
  padding: 8px 10px;
  font-size: 12px; color: var(--text-muted);
  line-height: 1.4;
}

/* ══════════════════════════════════════════════════════════════
   LATEST NEWS — home page featured news section
   ══════════════════════════════════════════════════════════════ */

/* ── Section header row ── */
.lnews-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.lnews-all-link {
  font-size: 12px; font-weight: 500;
  color: var(--green-dark);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  transition: color 0.15s;
}
.lnews-all-link:hover { color: var(--green-mid); }
.lnews-all-link i { font-size: 13px; }

/* ── Hero / featured post card ── */
.lnews-hero-card {
  display: block;
  text-decoration: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 0.5px solid var(--border-mid);
  background: var(--bg);
  margin-bottom: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lnews-hero-card:hover {
  border-color: var(--green-mid);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}

/* Hero image wrapper */
.lnews-hero-img-wrap {
  position: relative;
  /* No fixed aspect-ratio — let the image determine its own height */
  background: var(--green-dark);
}
.lnews-hero-img {
  width: 100%;
  height: auto;        /* natural height, no cropping */
  display: block;
  transition: transform 0.35s ease;
}
.lnews-hero-card:hover .lnews-hero-img { transform: scale(1.02); }

/* Fallback placeholder banner */
.lnews-hero-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  color: rgba(255,255,255,0.25);
  font-size: 48px;
}

/* "Latest" badge overlaid on image */
.lnews-hero-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--lime);
  color: var(--green-dark);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 10px;
}

/* Text body below image */
.lnews-hero-body {
  padding: 16px 18px 18px;
}
.lnews-hero-meta {
  font-size: 12px; color: var(--text-faint);
  display: flex; align-items: center; gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.lnews-hero-meta i { font-size: 13px; color: var(--green-mid); }
.lnews-hero-title {
  font-size: 18px; font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 8px;
}
.lnews-hero-excerpt {
  font-size: 14px; color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.lnews-read-more {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 500;
  color: var(--green-dark);
  border-bottom: 1.5px solid var(--lime);
  padding-bottom: 1px;
  transition: color 0.15s;
}
.lnews-hero-card:hover .lnews-read-more { color: var(--green-mid); }
.lnews-read-more i { font-size: 14px; }

/* ── Secondary posts list ── */
.lnews-list {
  display: flex;
  flex-direction: column;
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.lnews-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
  transition: background 0.12s;
}
.lnews-item:last-child { border-bottom: none; }
.lnews-item:hover { background: var(--bg-surface); }

/* Thumbnail */
.lnews-item-thumb {
  flex-shrink: 0;
  width: 60px; height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
}
.lnews-item-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.lnews-item-thumb-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: rgba(255,255,255,0.35);
  font-size: 22px;
}

.lnews-item-body { flex: 1; min-width: 0; }
.lnews-item-title {
  font-size: 14px; font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lnews-item-meta {
  font-size: 12px; color: var(--text-faint); margin-top: 3px;
}
.lnews-item-arrow {
  flex-shrink: 0;
  font-size: 16px; color: var(--text-faint);
}

.lnews-empty {
  font-size: 14px; color: var(--text-faint); padding: 16px 0;
}

/* ── Desktop: hero title and excerpt scale up ── */
@media (min-width: 768px) {
  .lnews-hero-title   { font-size: 22px; }
  .lnews-hero-excerpt { font-size: 15px; }
  .lnews-item-title   { white-space: normal; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE TABLES
   Usage: wrap any <table> in <div class="table-wrap">
   ══════════════════════════════════════════════════════════════ */

/* Scroll container — prevents table from breaking the page layout on small screens */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border-mid);
  margin-bottom: 24px;
}

/* Base table */
.table-wrap table,
table.mht-table {
  width: 100%;
  min-width: 480px;           /* forces scroll rather than squishing below this width */
  border-collapse: collapse;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
}

/* Header row */
.table-wrap thead,
table.mht-table thead {
  background: var(--green-dark);
  color: #fff;
}
.table-wrap thead th,
table.mht-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: none;
}

/* Alternating body rows */
.table-wrap tbody tr:nth-child(odd),
table.mht-table tbody tr:nth-child(odd) {
  background: var(--bg);
}
.table-wrap tbody tr:nth-child(even),
table.mht-table tbody tr:nth-child(even) {
  background: var(--bg-surface);
}
.table-wrap tbody tr:hover,
table.mht-table tbody tr:hover {
  background: var(--green-pale);
}

/* Body cells */
.table-wrap tbody td,
table.mht-table tbody td {
  padding: 11px 16px;
  border-bottom: 0.5px solid var(--border);
  vertical-align: middle;
  line-height: 1.45;
}
.table-wrap tbody tr:last-child td,
table.mht-table tbody tr:last-child td {
  border-bottom: none;
}

/* Footer row (totals / summaries) */
.table-wrap tfoot td,
.table-wrap tfoot th,
table.mht-table tfoot td,
table.mht-table tfoot th {
  padding: 11px 16px;
  font-weight: 600;
  font-size: 13px;
  color: var(--green-dark);
  border-top: 1.5px solid var(--border-mid);
  background: var(--green-pale);
}

/* ── Column alignment helpers ── */
.col-right  { text-align: right; }
.col-center { text-align: center; }
.col-num    { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Cell badges / status pills ── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-green  { background: var(--green-pale); color: var(--green-dark); }
.badge-lime   { background: var(--lime);       color: var(--green-dark); }
.badge-grey   { background: var(--bg-surface); color: var(--text-muted); border: 0.5px solid var(--border-mid); }
.badge-red    { background: #fdecea;           color: #b91c1c; }
.badge-amber  { background: #fef3c7;           color: #92400e; }

/* ── Sortable column header ── */
.col-sortable {
  cursor: pointer;
  user-select: none;
}
.col-sortable::after {
  content: " ↕";
  opacity: 0.45;
  font-size: 10px;
}
.col-sortable.asc::after  { content: " ↑"; opacity: 1; }
.col-sortable.desc::after { content: " ↓"; opacity: 1; }

/* ── Compact variant ── */
.table-wrap.table-compact tbody td,
.table-wrap.table-compact thead th {
  padding: 7px 12px;
  font-size: 13px;
}

/* ── Borderless variant (no outer border, no row dividers) ── */
.table-wrap.table-borderless {
  border: none;
}
.table-wrap.table-borderless tbody td {
  border-bottom: none;
}
.table-wrap.table-borderless tbody tr:nth-child(even) {
  background: transparent;
}
.table-wrap.table-borderless tbody tr:hover {
  background: var(--green-pale);
}

/* ── Stacked layout on very small screens (< 480px) ──────────
   Add class "table-stack" to .table-wrap to enable stacking.
   Each <td> must carry a data-label attribute matching its
   column header text, e.g.:
     <td data-label="Player">Jane Smith</td>
   ──────────────────────────────────────────────────────────── */
@media (max-width: 479px) {
  .table-wrap.table-stack table {
    min-width: 0;
    display: block;
  }
  .table-wrap.table-stack thead {
    display: none; /* labels come from data-label instead */
  }
  .table-wrap.table-stack tbody,
  .table-wrap.table-stack tbody tr,
  .table-wrap.table-stack tbody td {
    display: block;
    width: 100%;
  }
  .table-wrap.table-stack tbody tr {
    border-bottom: 2px solid var(--border-mid);
    padding: 10px 0;
  }
  .table-wrap.table-stack tbody tr:last-child {
    border-bottom: none;
  }
  .table-wrap.table-stack tbody td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 5px 14px;
    border-bottom: none;
    font-size: 14px;
  }
  .table-wrap.table-stack tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-faint);
    flex-shrink: 0;
  }
  .table-wrap.table-stack tfoot {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════════
   NEWS PAGE — prev / next navigation bar + full post body
   ══════════════════════════════════════════════════════════════ */

.newspage-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 4px;
  margin-bottom: 4px;
  border-bottom: 0.5px solid var(--border);
}
.newspage-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--green-dark);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.newspage-nav-btn:hover {
  background: var(--green-pale);
}
.newspage-nav-btn.disabled {
  pointer-events: none;
  min-width: 60px;  /* keep layout balanced when one side is empty */
}
.newspage-nav-btn i { font-size: 14px; }

/* Full post body — renders linebreaks from the model */
.newspage-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-primary);
  margin-top: 16px;
}
.newspage-body p { margin-bottom: 14px; }
.newspage-body p:last-child { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════════
   COMPACT QUICK-CARD  —  .quick-grid-sm / .quick-card-sm
   Half the height of the standard card; 7 columns on desktop,
   3 on tablet, 2 on mobile. Sub-text is hidden automatically.
   ══════════════════════════════════════════════════════════════ */

.quick-grid-sm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-card-sm {
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  /* ~half the height of .quick-card by tightening vertical padding
     and shrinking the icon — layout stays vertical (icon top, label below) */
  padding: 6px 8px 5px;
  cursor: pointer;
  border: 0.5px solid var(--border);
  text-decoration: none;
  display: block;
  transition: border-color 0.15s, background 0.15s;
}
.quick-card-sm:hover { border-color: var(--green-mid); background: #f0f7f3; }

/* Icon — smaller, less bottom margin */
.quick-card-sm .quick-icon {
  font-size: 16px;
  margin-bottom: 4px;
  display: block;
}

/* Label — tighter text */
.quick-card-sm .quick-card-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
}

/* Hide sub-text entirely in compact cards */
.quick-card-sm .quick-card-sub { display: none; }

/* ── Responsive breakpoints ── */
@media (min-width: 480px) {
  .quick-grid-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .quick-grid-sm { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
}

/* ══════════════════════════════════════════════════════════════
   MEMBER FORMS  —  join.html / add.html shared styles
   ══════════════════════════════════════════════════════════════ */

.mform-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 60px;
}
.mform-wrap h1 {
  font-size: 22px; font-weight: 600;
  color: var(--green-dark); margin-bottom: 6px; text-align: center;
}
.mform-wrap .mform-sub {
  font-size: 14px; color: var(--text-muted);
  text-align: center; margin-bottom: 24px;
}
.mform-wrap .mform-sub a { color: var(--green-dark); }

/* Error / info banners */
.mform-error {
  background: #fdecea; border-left: 3px solid #b91c1c;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px; margin-bottom: 16px;
  font-size: 14px; color: #b91c1c;
}
.mform-info {
  background: var(--green-pale); border-left: 3px solid var(--green-dark);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px; margin-bottom: 16px;
  font-size: 14px; color: var(--green-dark);
}

/* Section card */
.mform-section {
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 20px 20px 16px;
  margin-bottom: 20px;
  background: var(--bg);
}
.mform-section-title {
  font-size: 14px; font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid var(--border);
}

/* Two-column field grid */
.mform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}
.mform-grid.mform-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) {
  .mform-grid, .mform-grid.mform-grid-3 { grid-template-columns: 1fr; }
}

/* Individual field */
.mform-field {}
.mform-field label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text-muted); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.mform-field input[type="text"],
.mform-field input[type="email"],
.mform-field input[type="tel"],
.mform-field select {
  width: 100%; padding: 8px 11px; font-size: 14px;
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
}
.mform-field input:focus,
.mform-field select:focus {
  outline: 2px solid var(--green-mid); border-color: transparent;
}
.mform-field .mform-field-error {
  font-size: 11px; color: #b91c1c; margin-top: 4px;
}

/* Family toggle */
.mform-family-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text-primary);
}
.mform-family-toggle input[type="radio"],
.mform-family-toggle input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer; flex-shrink: 0;
}

/* Family section (hidden until toggled) */
.mform-family-section {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}
.mform-family-section .mform-section-title {
  color: var(--green-mid);
}

/* Disclaimer */
.mform-disclaimer {
  font-size: 13px; color: var(--text-muted);
  line-height: 1.55; margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
}
.mform-agree-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 20px;
}
.mform-agree-row input[type="checkbox"] {
  width: 16px; height: 16px; margin-top: 2px;
  flex-shrink: 0; cursor: pointer;
}
.mform-agree-row label {
  font-size: 13px; font-weight: 500;
  color: var(--text-primary); cursor: pointer; line-height: 1.4;
}

/* Submit */
.mform-submit {
  background: var(--green-dark); color: var(--lime);
  border: none; border-radius: var(--radius-sm);
  padding: 12px 32px; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: 'Inter', system-ui, sans-serif;
  transition: background 0.15s;
}
.mform-submit:hover { background: var(--green-mid); }
.mform-submit:disabled {
  opacity: 0.45; cursor: not-allowed;
  background: var(--green-dark);
}
