/* ============================================================
   THE FAMILY GREEN BOOK — Stylesheet
   Aesthetic: Vintage editorial, warm sepia + emerald green
   ============================================================ */

:root {
  /* Logo greens */
  --green-deep:    #1a4a2e;
  --green-mid:     #2d6e4e;
  --green-light:   #4a9e72;
  --green-glow:    #6fcf97;
  /* Logo golds */
  --gold:          #c9a227;
  --gold-light:    #e8c547;
  --gold-dark:     #a07d10;
  /* T-shirt sand — replaces cream throughout */
  --sand:          #d4c5a0;
  --sand-light:    #e8dfc8;
  --sand-dark:     #b8a882;
  /* Keep amber for accents */
  --amber:         #c8883a;
  --amber-light:   #e8b56a;
  /* Legacy aliases so existing rules keep working */
  --cream:         var(--sand-light);
  --cream-dark:    var(--sand);
  --sepia:         #7a5c30;
  --sepia-dark:    #4e3510;
  --ink:           #1c1209;
  --pin-glow:      rgba(201, 162, 39, 0.45);

  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'Karla', sans-serif;
  --font-accent:   'IM Fell English', Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

/* PAPER TEXTURE */
.paper-overlay {
  position: fixed; inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.6;
}

/* ===================== HEADER ===================== */
.site-header {
  background: var(--green-deep);
  color: var(--cream);
  text-align: center;
  padding: 2rem 1rem 0;
  position: relative;
  border-bottom: 4px solid var(--amber);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.site-header::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 20px,
    rgba(255,255,255,0.015) 20px,
    rgba(255,255,255,0.015) 21px
  );
  pointer-events: none;
}

.header-ornament {
  color: var(--amber);
  letter-spacing: 1rem;
  font-size: 0.7rem;
  opacity: 0.8;
}

.header-inner { padding: 0.75rem 0 1rem; }

.header-year {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.4rem;
  color: var(--amber-light);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--cream);
  text-shadow: 2px 4px 12px rgba(0,0,0,0.5);
}
.site-title em {
  color: var(--gold-light);
  font-style: italic;
  display: block;
}

.site-subtitle {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--cream-dark);
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  margin-top: 0.5rem;
  opacity: 0.85;
}

/* NAV */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-btn {
  background: none;
  border: none;
  color: var(--cream-dark);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
  padding: 0.85rem 2rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.nav-btn:last-child { border-right: none; }
.nav-btn:hover { color: var(--gold-light); background: rgba(255,255,255,0.04); }
.nav-btn.active {
  color: var(--gold-light);
  background: rgba(201,162,39,0.1);
}
.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--gold);
}

/* ===================== MAIN ===================== */
.site-main { min-height: calc(100vh - 200px); }

.view { display: none; }
.view.active { display: block; }

/* ===================== MAP VIEW ===================== */
.map-container {
  padding: 2rem 1rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--sepia);
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  margin-bottom: 1rem;
  font-family: var(--font-body);
}
.legend-dot {
  width: 10px; height: 10px;
  background: var(--green-light);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--pin-glow);
  animation: legendPulse 2s ease-in-out infinite;
}
@keyframes legendPulse {
  0%, 100% { box-shadow: 0 0 8px var(--pin-glow); }
  50% { box-shadow: 0 0 18px var(--green-glow), 0 0 30px var(--pin-glow); }
}

.map-wrapper {
  position: relative;
  background: linear-gradient(160deg, #cdd9c7 0%, #bfcfba 50%, #afc3b0 100%);
  border-radius: 8px;
  border: 2px solid var(--green-mid);
  box-shadow:
    0 8px 40px rgba(0,0,0,0.15),
    inset 0 0 80px rgba(26,74,46,0.08);
  overflow: visible;
  min-height: 400px;
}

#us-map-container {
  width: 100%;
  position: relative;
}
#us-map-container svg {
  width: 100%;
  height: auto;
  display: block;
}

/* State paths */
.state-path {
  fill: #c5dbc8;
  stroke: var(--green-deep);
  stroke-width: 0.5;
  transition: fill 0.2s ease;
  cursor: default;
}
.state-path:hover { fill: #b0ceb5; }
.state-path.has-members { fill: #a8d4b2; }
.state-path.has-members:hover { fill: #90c89e; }

/* STATE LABELS */
.state-label {
  font-family: var(--font-body);
  font-size: 7px;
  fill: var(--green-deep);
  opacity: 0.65;
  pointer-events: none;
  text-anchor: middle;
  font-weight: 500;
}

/* MAP PINS */
#map-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  cursor: pointer;
  pointer-events: all;
  z-index: 10;
}

.pin-body {
  width: 28px; height: 28px;
  background: var(--green-deep);
  border: 2.5px solid var(--green-glow);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3), 0 0 12px var(--pin-glow);
  position: relative;
}

.pin-inner {
  position: absolute;
  inset: 3px;
  background: var(--green-mid);
  border-radius: 50%;
}

.map-pin:hover .pin-body {
  transform: rotate(-45deg) scale(1.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 24px var(--green-glow);
}

.pin-ripple {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 44px; height: 44px;
  border-radius: 50% 50% 50% 0;
  border: 2px solid var(--green-glow);
  opacity: 0;
  animation: pinRipple 2.5s ease-out infinite;
}
.pin-ripple:nth-child(2) { animation-delay: 0.8s; }
.pin-ripple:nth-child(3) { animation-delay: 1.6s; }

@keyframes pinRipple {
  0%   { transform: translate(-50%, -50%) rotate(45deg) scale(0.5); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) rotate(45deg) scale(2.2); opacity: 0; }
}

/* Drop-in animation */
@keyframes pinDrop {
  0%   { transform: translate(-50%, -200%); opacity: 0; }
  60%  { transform: translate(-50%, -90%); }
  80%  { transform: translate(-50%, -105%); }
  100% { transform: translate(-50%, -100%); opacity: 1; }
}
.map-pin.drop-in { animation: pinDrop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* Multiple pins at same location */
.pin-cluster .pin-body { background: var(--amber); border-color: var(--amber-light); }
.pin-cluster-count {
  position: absolute;
  top: -8px; right: -8px;
  width: 18px; height: 18px;
  background: var(--amber);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(45deg);
  border: 1.5px solid white;
}

.map-count-bar {
  text-align: center;
  padding: 0.75rem;
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--sepia);
  font-size: 0.95rem;
}

/* ===================== DIRECTORY VIEW ===================== */
.directory-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--green-deep);
  margin-bottom: 0.25rem;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px; height: 3px;
  background: var(--amber);
  margin-top: 0.5rem;
}

.directory-search-row { margin: 1.5rem 0; }
.directory-search {
  width: 100%;
  max-width: 420px;
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--cream-dark);
  border-radius: 4px;
  background: white;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.directory-search:focus { border-color: var(--green-mid); }

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.member-card {
  background: white;
  border: 1px solid var(--cream-dark);
  border-radius: 6px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border-left: 4px solid var(--green-mid);
}
.member-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
  border-left-color: var(--amber);
}

.card-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--cream-dark);
}
.card-initials {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--green-deep);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.05rem;
}

.card-body { flex: 1; min-width: 0; }
.card-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-deep);
}
.card-location {
  font-size: 0.8rem;
  color: var(--sepia);
  letter-spacing: 0.04rem;
  margin-top: 0.15rem;
  display: flex; align-items: center; gap: 0.3rem;
}
.card-location::before {
  content: '📍';
  font-size: 0.7rem;
}
.card-bio {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.4rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===================== MODAL ===================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 20, 14, 0.75);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: var(--cream);
  border-radius: 8px;
  padding: 2.5rem 2rem;
  max-width: 560px;
  width: 100%;
  position: relative;
  border-top: 5px solid var(--green-deep);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  transform: scale(0.96);
  transition: transform 0.3s ease;
}
.modal-backdrop.open .modal-card { transform: scale(1); }

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none; border: none;
  font-size: 1.5rem;
  color: var(--sepia);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--ink); }

.modal-header { margin-bottom: 1.75rem; border-bottom: 1px solid var(--cream-dark); padding-bottom: 1.25rem; }
.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--green-deep);
  line-height: 1.2;
}
.modal-header h2 em { color: var(--amber); font-style: italic; }
.modal-header p { color: var(--sepia); font-size: 0.9rem; margin-top: 0.4rem; font-family: var(--font-accent); font-style: italic; }

.modal-step { display: none; }
.modal-step.active { display: block; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.field-group { display: flex; flex-direction: column; gap: 0.35rem; }
.field-group.full { grid-column: 1 / -1; }

.field-label {
  font-size: 0.72rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  color: var(--sepia-dark);
  font-weight: 600;
}

.field-input {
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--cream-dark);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  background: white;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.field-input:focus { border-color: var(--green-mid); }

.field-textarea {
  resize: vertical;
  min-height: 80px;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--sepia);
  margin-top: 0.4rem;
  font-family: var(--font-accent);
  font-style: italic;
}

.btn-primary {
  width: 100%;
  padding: 0.9rem;
  background: var(--green-deep);
  color: var(--cream);
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}
.btn-primary:hover {
  background: var(--green-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26,74,46,0.3);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-message {
  margin-top: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  font-size: 0.85rem;
  display: none;
}
.auth-message.success { background: #d4edda; color: #155724; display: block; }
.auth-message.error   { background: #f8d7da; color: #721c24; display: block; }
.auth-message.info    { background: #d1ecf1; color: #0c5460; display: block; }

/* ===================== PROFILE POPUP ===================== */
.profile-popup {
  position: fixed;
  z-index: 400;
  background: var(--green-deep);
  color: var(--cream);
  border-radius: 8px;
  padding: 1.5rem 1.25rem 1.25rem;
  width: 260px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border: 2px solid var(--green-mid);
  opacity: 0;
  transform: scale(0.9) translateY(8px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.profile-popup.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

.popup-close {
  position: absolute;
  top: 0.5rem; right: 0.75rem;
  background: none; border: none;
  color: var(--green-light);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}
.popup-close:hover { color: var(--cream); }

.popup-photo-ring {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 3px solid var(--green-glow);
  margin: 0 auto 1rem;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 20px var(--pin-glow);
}
#popup-photo { width: 100%; height: 100%; object-fit: cover; display: none; }
.popup-initials {
  width: 100%; height: 100%;
  background: var(--green-mid);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cream);
}

.popup-body { text-align: center; }
.popup-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green-glow);
}
.popup-location {
  font-size: 0.78rem;
  color: var(--amber-light);
  letter-spacing: 0.06rem;
  margin-top: 0.2rem;
}
.popup-bio {
  font-size: 0.82rem;
  color: var(--cream-dark);
  margin-top: 0.5rem;
  line-height: 1.5;
  font-family: var(--font-accent);
  font-style: italic;
}
.popup-phone {
  font-size: 0.78rem;
  color: var(--amber-light);
  margin-top: 0.4rem;
}

/* ===================== EMPTY STATE ===================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  grid-column: 1 / -1;
}
.empty-state p {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--sepia);
  font-size: 1.1rem;
}

/* ===================== LOADING SHIMMER ===================== */
.shimmer {
  background: linear-gradient(90deg, var(--cream-dark) 25%, #e8ddd0 50%, var(--cream-dark) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .field-group.full { grid-column: auto; }
  .site-nav { flex-wrap: wrap; }
  .nav-btn { flex: 1; min-width: 100px; }
  .profile-popup { width: 220px; }
  .modal-card { padding: 1.75rem 1.25rem; }
}

/* ===================== DECORATIVE FOOTER RULE ===================== */
.site-main::after {
  content: '✦  Our Roots Run Deep  ✦';
  display: block;
  text-align: center;
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--sepia);
  font-size: 0.85rem;
  padding: 2rem;
  opacity: 0.6;
}

/* ===================== MODAL STATUS ===================== */
.modal-status {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: var(--font-accent);
  font-style: italic;
}
.modal-status.loading {
  background: var(--cream-dark);
  color: var(--sepia);
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
}
.modal-status.loading::before {
  content: '';
  width: 12px; height: 12px;
  border: 2px solid var(--sepia);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.modal-status.success {
  background: #d4edda;
  color: #155724;
  display: block !important;
}
.modal-status.info {
  background: #d1ecf1;
  color: #0c5460;
  display: block !important;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===================== DIRECTORY PROFILE MODAL ===================== */
.dp-card {
  max-width: 420px;
  text-align: center;
  padding-top: 3rem;
}

.dp-avatar-ring {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 4px solid var(--green-mid);
  margin: 0 auto 1.25rem;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 20px rgba(26,74,46,0.2);
}
.dp-avatar-ring img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.dp-initials {
  width: 100%; height: 100%;
  background: var(--green-deep);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--cream);
}

.dp-body { padding: 0 0.5rem; }

.dp-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--green-deep);
  margin-bottom: 0.25rem;
}
.dp-location {
  font-size: 0.85rem;
  color: var(--amber);
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 1rem;
}
.dp-bio {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--sepia-dark);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--cream-dark);
  border-radius: 4px;
  border-left: 3px solid var(--green-mid);
}
.dp-bio:empty { display: none; }
.dp-contact {
  font-size: 0.85rem;
  color: var(--sepia);
  margin-top: 0.25rem;
}
.dp-contact:empty { display: none; }

/* Website link in profile card */
.dp-contact a {
  color: var(--green-mid);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--green-light);
  transition: color 0.2s;
}
.dp-contact a:hover { color: var(--green-deep); }

/* ===================== HEADER LOGO ===================== */
.header-logo {
  width: clamp(120px, 22vw, 200px);
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

/* ===================== GATEWAY SCREEN ===================== */
#gateway-screen {
  position: fixed;
  inset: 0;
  background: var(--green-deep);
  background-image:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 30px,
      rgba(255,255,255,0.012) 30px,
      rgba(255,255,255,0.012) 31px
    );
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 3rem 1.5rem 2rem;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#gateway-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.03);
}

.gateway-inner {
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.gateway-logo {
  width: clamp(180px, 50vw, 320px);
  height: auto;
  display: block;
  margin: 0 auto 2rem;
  filter: drop-shadow(0 6px 24px rgba(0,0,0,0.6));
  animation: logoSettle 1s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes logoSettle {
  0%   { opacity: 0; transform: translateY(-18px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.gateway-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 auto 1.5rem;
  color: var(--gold);
  font-size: 0.65rem;
  letter-spacing: 0.25rem;
  text-transform: uppercase;
  opacity: 0.7;
}
.gateway-divider::before,
.gateway-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gold);
  opacity: 0.35;
}

.gateway-heading {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  color: var(--sand-light);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.gateway-heading em {
  color: var(--gold-light);
  font-style: italic;
}

.gateway-subhead {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--sand-dark);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.gateway-card {
  background: rgba(232,223,200,0.08);
  border: 1px solid rgba(201,162,39,0.25);
  border-radius: 8px;
  padding: 1.75rem 1.5rem;
  backdrop-filter: blur(4px);
}

.gateway-card .field-label {
  color: var(--sand);
  text-align: left;
  display: block;
  margin-bottom: 0.5rem;
}

.gateway-card .field-input {
  background: rgba(255,255,255,0.08);
  border-color: rgba(201,162,39,0.3);
  color: var(--sand-light);
  margin-bottom: 0.75rem;
}
.gateway-card .field-input::placeholder { color: rgba(232,223,200,0.4); }
.gateway-card .field-input:focus { border-color: var(--gold); }

.gateway-card .btn-primary {
  background: var(--gold-dark);
  color: var(--sand-light);
  font-size: 1rem;
  letter-spacing: 0.08rem;
}
.gateway-card .btn-primary:hover {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 4px 20px rgba(201,162,39,0.4);
}

.gateway-otp { display: none; }
.gateway-otp.active { display: block; }

.gateway-hint {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--sand-dark);
  font-size: 0.82rem;
  margin-top: 0.75rem;
  opacity: 0.75;
}

.gateway-footer {
  margin-top: 1.75rem;
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--gold);
  font-size: 0.8rem;
  opacity: 0.6;
  letter-spacing: 0.05rem;
}

/* ===================== BODY SITE (hidden until gate passes) ===================== */
#site-body {
  transition: opacity 0.5s ease;
}
#site-body.locked {
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

/* ===================== NAV LOGOUT BUTTON ===================== */
.nav-btn--donate {
  background: var(--gold-dark);
  color: var(--green-deep);
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.15s;
}
.nav-btn--donate:hover {
  background: var(--gold);
  transform: translateY(-1px);
  color: var(--green-deep);
}
.nav-btn--logout {
  margin-left: auto;
  background: transparent;
  color: var(--sand-dark);
  border: 1px solid var(--sand-dark);
  font-size: 0.72rem;
  padding: 0.3rem 0.9rem;
  opacity: 0.75;
  transition: opacity 0.2s, color 0.2s;
}
.nav-btn--logout:hover {
  opacity: 1;
  color: var(--gold-light);
  border-color: var(--gold-light);
  background: transparent;
}

/* ===================== DONATE MODAL ===================== */
.donate-card {
  max-width: 480px;
  padding: 2rem 2rem 1.5rem;
}
.donate-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.donate-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}
.donate-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--green-deep);
  margin-bottom: 0.5rem;
}
.donate-header p {
  font-size: 0.88rem;
  color: var(--sepia);
  line-height: 1.6;
  font-family: var(--font-accent);
  font-style: italic;
}
.donate-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}
.donate-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1.5px solid var(--cream-dark);
  background: var(--cream);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
}
.donate-option:hover {
  border-color: var(--green-mid);
  box-shadow: 0 4px 14px rgba(26,74,46,0.12);
  transform: translateY(-1px);
}
.donate-option-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}
.donate-logo-paypal  { background: #003087; }
.donate-logo-venmo   { background: #3D95CE; }
.donate-logo-cashapp { background: #00C244; }
.donate-logo-zelle   { background: #6D1ED4; }
.donate-option-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.donate-option-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}
.donate-option-handle {
  font-size: 0.82rem;
  color: var(--sepia);
  font-family: var(--font-body);
}
.donate-option-arrow {
  color: var(--green-mid);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.donate-option--zelle {
  /* Not a link so no hover navigation — just copy */
}
.donate-copy-btn {
  background: var(--green-deep);
  color: var(--cream);
  border: none;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.donate-copy-btn:hover { background: var(--green-mid); }
.donate-footer {
  text-align: center;
  font-size: 0.82rem;
  color: var(--sepia);
  font-family: var(--font-accent);
  font-style: italic;
}

/* ===================== MEMORIAL SECTION ===================== */
.memorial-container {
  display: flex;
  min-height: calc(100vh - 160px);
  gap: 0;
}

/* ── Sidebar ── */
.memorial-sidebar {
  width: 220px;
  min-width: 180px;
  background: var(--green-deep);
  border-right: 1px solid rgba(201,162,39,0.25);
  padding: 1.5rem 1rem;
  flex-shrink: 0;
}
.memorial-sidebar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
  letter-spacing: 0.03em;
}
.memorial-sidebar-sub {
  font-size: 0.72rem;
  color: rgba(201,162,39,0.6);
  font-style: italic;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}
.memorial-name-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.memorial-name-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.3;
}
.memorial-name-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--gold-light);
  border-left-color: rgba(201,162,39,0.4);
}
.memorial-name-btn.active {
  background: rgba(201,162,39,0.15);
  color: var(--gold);
  border-left-color: var(--gold);
}
.memorial-name-years {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: rgba(201,162,39,0.55);
  margin-top: 0.1rem;
}

/* ── Main panel ── */
.memorial-main {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

/* Welcome state */
.memorial-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  opacity: 0.6;
}
.memorial-welcome-icon {
  font-size: 3rem;
  color: var(--gold);
  margin-bottom: 1rem;
}
.memorial-welcome h2 {
  font-family: var(--font-display);
  color: var(--sand-light);
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}
.memorial-welcome p {
  color: var(--sand-dark);
  font-size: 0.9rem;
  max-width: 320px;
}

/* ── Person header ── */
.memorial-person-name {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--gold);
  margin-bottom: 0.2rem;
  line-height: 1.1;
}
.memorial-person-dates {
  font-family: var(--font-body);
  color: var(--sand-dark);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.08em;
}

/* ── Top row: gallery + description ── */
.memorial-top-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 2.5rem;
  align-items: flex-start;
}

/* Gallery */
.memorial-gallery {
  flex-shrink: 0;
  width: clamp(180px, 32%, 280px);
}
.mem-gallery-frame {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid var(--gold-dark);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  background: rgba(0,0,0,0.3);
}
.mem-gallery-frame img {
  width: 100%;
  display: block;
  max-height: 480px;
  object-fit: contain;
  object-position: center top;
  background: rgba(0,0,0,0.15);
}
.mem-gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: var(--gold-light);
  border: none;
  font-size: 1.8rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  transition: background 0.2s;
  line-height: 1;
}
.mem-gallery-btn:hover { background: rgba(0,0,0,0.75); }
.mem-gallery-prev { left: 0; border-radius: 0 4px 4px 0; }
.mem-gallery-next { right: 0; border-radius: 4px 0 0 4px; }
.mem-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 0 4px;
  background: rgba(0,0,0,0.3);
}
.mem-gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sand-dark);
  cursor: pointer;
  transition: background 0.2s;
}
.mem-gallery-dot.active { background: var(--gold); }

/* Description */
.memorial-description {
  flex: 1;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.75;
  min-height: 180px;
  background: white;
  border: 1px solid rgba(0,0,0,0.1);
  border-top: 3px solid var(--gold-dark);
  border-radius: 0 0 6px 6px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.memorial-description p { margin-bottom: 1rem; }
.memorial-description p:last-child { margin-bottom: 0; }
.memorial-description p:empty { min-height: 2rem; }
/* Placeholder style when description is the default text */
.memorial-description p em {
  color: var(--sepia);
  font-style: italic;
}

/* ── Memory entries ── */
.memorial-entries-section {
  border-top: 1px solid rgba(201,162,39,0.25);
  padding-top: 2rem;
}
.memorial-entries-heading {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 1.25rem;
}
.mem-entry {
  background: white;
  border: 1px solid rgba(0,0,0,0.1);
  border-left: 4px solid var(--gold-dark);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.mem-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.mem-entry-author {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--green-deep);
  font-weight: 700;
}
.mem-entry-date {
  font-size: 0.72rem;
  color: var(--sepia);
}
.mem-entry-body {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.7;
}
.mem-expand-btn {
  background: none;
  border: none;
  color: var(--green-mid);
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 0.25rem 0;
  margin-top: 0.35rem;
  letter-spacing: 0.03em;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.mem-expand-btn:hover { opacity: 1; color: var(--green-deep); }

.mem-loading, .mem-empty {
  color: var(--sand-dark);
  font-style: italic;
  font-size: 0.9rem;
}

/* Pagination */
.mem-pages {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 1rem 0 2rem;
}
.mem-page-btn {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(201,162,39,0.25);
  color: var(--sand-light);
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mem-page-btn:hover { background: rgba(201,162,39,0.15); color: var(--gold-light); }
.mem-page-btn.active { background: var(--gold-dark); color: var(--ink); border-color: var(--gold); }

/* ── Submit section ── */
.mem-submit-section {
  border-top: 1px solid rgba(201,162,39,0.15);
  padding-top: 1.75rem;
}
.mem-submit-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--sand-light);
  margin-bottom: 0.75rem;
}
.mem-submit-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.mem-rec-btn {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(201,162,39,0.35);
  color: var(--sand-light);
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mem-rec-btn:hover { background: rgba(201,162,39,0.18); color: var(--gold-light); }
.mem-rec-btn--clear { border-color: rgba(200,80,80,0.4); color: #e8a0a0; }
.mem-rec-btn--clear:hover { background: rgba(200,80,80,0.15); color: #ffb0b0; }
.mem-rec-status {
  font-size: 0.8rem;
  color: var(--gold-light);
  font-style: italic;
}
.mem-voice-hint {
  font-size: 0.75rem;
  color: var(--sand-dark);
  margin-bottom: 0.5rem;
  line-height: 1.6;
  font-style: italic;
}
.mem-voice-hint strong { color: var(--sand-light); font-style: normal; }
.mem-voice-keyword {
  display: inline-block;
  background: rgba(201,162,39,0.15);
  color: var(--gold);
  border: 1px solid rgba(201,162,39,0.3);
  border-radius: 3px;
  padding: 0 5px;
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.mem-entry-textarea {
  min-height: 120px;
  resize: vertical;
  margin-bottom: 0.75rem;
}
.mem-submit-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Requests Page ── */
.req-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.req-header {
  text-align: center;
  margin-bottom: 2rem;
}
.req-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--sand-light);
  margin-bottom: 0.4rem;
}
.req-subtitle {
  color: rgba(232,223,200,0.7);
  font-size: 0.95rem;
  line-height: 1.6;
}
.req-card {
  background: white;
  border-radius: 10px;
  border-top: 4px solid var(--gold-dark);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  padding: 2rem;
}
.req-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sepia-dark);
  margin-bottom: 0.5rem;
}
.req-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--sepia);
  font-size: 0.75rem;
}

/* Type grid */
.req-type-group { margin-bottom: 1.25rem; }
.req-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}
.req-type-option { cursor: pointer; }
.req-type-option input { display: none; }
.req-type-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.5rem;
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  background: var(--sand-light);
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
.req-type-option input:checked + .req-type-tile {
  border-color: var(--gold-dark);
  background: rgba(201,162,39,0.1);
}
.req-type-icon { font-size: 1.4rem; line-height: 1; }
.req-type-name { font-size: 0.78rem; font-weight: 600; color: var(--sepia-dark); line-height: 1.2; }

/* Hint bar */
.req-hint {
  background: rgba(201,162,39,0.1);
  border-left: 3px solid var(--gold-dark);
  border-radius: 0 6px 6px 0;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--sepia-dark);
  font-style: italic;
}

/* Fields */
.req-fields { display: flex; flex-direction: column; gap: 1rem; }
.req-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.req-field { display: flex; flex-direction: column; }
.req-input {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  background: #fafaf8;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.req-input:focus {
  outline: none;
  border-color: var(--gold-dark);
  background: white;
}
.req-textarea {
  min-height: 130px;
  resize: vertical;
}

/* Photo upload */
.req-upload-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border: 2px dashed rgba(0,0,0,0.18);
  border-radius: 6px;
  cursor: pointer;
  color: var(--sepia);
  font-size: 0.88rem;
  transition: border-color 0.15s;
  background: #fafaf8;
}
.req-upload-label:hover { border-color: var(--gold-dark); }
.req-upload-icon { font-size: 1.1rem; }

/* Actions */
.req-actions { margin-top: 1.5rem; }
.req-submit-btn { width: 100%; font-size: 1rem; padding: 0.75rem; }
.req-msg {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  text-align: center;
  min-height: 1.2em;
}
.req-msg.success { color: var(--green-mid); }
.req-msg.error   { color: #c0392b; }

@media (max-width: 540px) {
  .req-type-grid { grid-template-columns: repeat(2, 1fr); }
  .req-field-row { grid-template-columns: 1fr; }
  .req-card { padding: 1.25rem; }
}

/* ── PWA Install Banner ── */
.pwa-install-banner {
  position: fixed;
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 420px;
  background: var(--green-deep);
  border: 1px solid rgba(201,162,39,0.4);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  z-index: 9999;
  transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pwa-install-banner.pwa-banner--visible {
  bottom: 1.25rem;
}
.pwa-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}
.pwa-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.pwa-banner-text strong {
  color: var(--gold-light);
  font-family: var(--font-display);
  font-size: 0.95rem;
}
.pwa-banner-text span {
  color: rgba(232,223,200,0.75);
  font-size: 0.75rem;
}
.pwa-banner-btn {
  background: var(--gold);
  color: var(--green-deep);
  border: none;
  border-radius: 20px;
  padding: 0.4rem 1.1rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  flex-shrink: 0;
  font-family: var(--font-body);
  letter-spacing: 0.03em;
  transition: background 0.2s;
}
.pwa-banner-btn:hover { background: var(--gold-light); }
.pwa-banner-dismiss {
  background: none;
  border: none;
  color: rgba(232,223,200,0.5);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.25rem;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.2s;
}
.pwa-banner-dismiss:hover { color: var(--sand-light); }

/* iOS instruction tooltip */
.pwa-ios-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--sand-light);
  font-size: 0.82rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  pointer-events: none;
}
.pwa-ios-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink);
}
.pwa-ios-tip--visible { display: block; }
.pwa-share-icon {
  display: inline-block;
  background: rgba(201,162,39,0.2);
  border-radius: 3px;
  padding: 0 4px;
  color: var(--gold-light);
}

/* ── Responsive ── */
@media (max-width: 680px) {
  .memorial-container { flex-direction: column; }
  .memorial-sidebar { width: 100%; border-right: none; border-bottom: 1px solid rgba(201,162,39,0.2); }
  .memorial-name-list { flex-direction: row; flex-wrap: wrap; }
  .memorial-main { padding: 1.25rem; }
  .memorial-top-row { flex-direction: column; }
  .memorial-gallery { width: 100%; max-width: 260px; }
}

/* ============================================================
   GATHER — Real-time family activity board
   ============================================================ */

.gather-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.gather-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.gather-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--forest);
  margin: 0 0 0.4rem;
}

.gather-subtitle {
  font-family: var(--font-body);
  color: #7a5c30;
  font-size: 0.95rem;
  margin: 0;
}

/* ── Composer ─────────────────────────────────── */
.gather-compose {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8dfc8;
  border-top: 4px solid var(--gold);
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.gather-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.gtag-btn {
  background: #f5f0e8;
  border: 1.5px solid #e0d5c0;
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-family: var(--font-body);
  color: #5a4020;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gtag-btn:hover {
  background: #ede5d4;
  border-color: var(--gold);
}

.gtag-btn.active {
  background: #2d5a27 !important;
  border-color: #2d5a27 !important;
  color: #ffffff !important;
  font-weight: 600;
}

.gather-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.gather-textarea {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: #1c1209;
  background: #faf8f4;
  border: 1.5px solid #d4c9b0;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  resize: none;
  transition: border-color 0.2s;
  line-height: 1.5;
}

.gather-textarea:focus {
  outline: none;
  border-color: var(--forest);
  background: #fff;
}

.gather-post-btn {
  background: #2d5a27 !important;
  color: #ffffff !important;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  align-self: flex-end;
}

.gather-post-btn:hover { background: #1a4a2e !important; }
.gather-post-btn:disabled { background: #9ab5a0 !important; cursor: not-allowed; }

.gather-compose-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: #9a8060;
}

.gather-post-msg {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  min-height: 1.2em;
}
.gather-post-msg.error { color: #c0392b; }
.gather-post-msg.success { color: #1a4a2e; }

/* ── Filter bar ───────────────────────────────── */
.gather-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.gather-filter-label {
  font-size: 0.8rem;
  color: #9a8060;
  font-family: var(--font-body);
  white-space: nowrap;
}

.gather-filters {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.gfilt-btn {
  background: #f5f0e8;
  border: 1.5px solid #e0d5c0;
  border-radius: 20px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  color: #5a4020;
}

.gfilt-btn:hover { border-color: var(--gold); }
.gfilt-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

/* ── Feed ─────────────────────────────────────── */
.gather-feed {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gather-empty {
  text-align: center;
  color: #9a8060;
  font-style: italic;
  font-family: var(--font-body);
  padding: 2.5rem 1rem;
  background: #faf8f4;
  border-radius: 10px;
  border: 1px dashed #d4c9b0;
}

.gather-post {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e8dfc8;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  animation: postSlideIn 0.25s ease;
}

@keyframes postSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gather-post-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.gather-post-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-body);
  flex-shrink: 0;
}

.gather-post-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: #1c1209;
}

.gather-post-tag-pill {
  background: #f0ebe0;
  border: 1px solid #d4c9b0;
  border-radius: 12px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  color: #7a5c30;
}

.gather-post-time {
  margin-left: auto;
  font-size: 0.75rem;
  color: #b0987a;
  white-space: nowrap;
}

.gather-post-body {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: #2c1f0e;
  line-height: 1.55;
  white-space: pre-wrap;
}

.gather-post-mine .gather-post-avatar {
  background: var(--gold);
}

@media (max-width: 480px) {
  .gather-title { font-size: 1.6rem; }
  .gather-post-btn { padding: 0.6rem 0.9rem; font-size: 0.85rem; }
}
