/* Common structural styles for FullPlateFriends */

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

/* -- Layout -- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

.page-container {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 72rem;
  padding: 2.5rem 1.5rem;
}

/* -- Cards & Sections -- */
.card {
  background-color: #ffffff;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.card + .card {
  margin-top: 1.5rem;
}

.card-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

/* -- Action tiles -- */
.action-tile {
  display: block;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
}

.action-tile:hover {
  border-color: #5eead4;
  background-color: #f0fdfa;
}

.action-tile h2 {
  font-weight: 600;
}

.action-tile p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #475569;
}

/* -- Info panels -- */
.info-panel {
  background-color: #f8fafc;
  border-radius: 0.5rem;
  padding: 1rem;
}

.info-panel-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

/* -- Typography helpers -- */
.text-muted {
  font-size: 0.875rem;
  color: #475569;
}

.text-faint {
  font-size: 0.75rem;
  color: #64748b;
}

/* -- Section typography -- */
.section-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 600;
  margin-bottom: 1rem;
  display: block;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  color: var(--navy);
  margin-bottom: 1.5rem;
}

.section-title em {
  font-style: italic;
  color: var(--terracotta);
  font-family: var(--font-script);
  font-size: 1.25em;
}

.section-subtitle {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #475569;
}

/* -- Badges -- */
.badge {
  display: inline-block;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-teal {
  background-color: #f0fdfa;
  color: #0f766e;
}

/* -- Buttons -- */
.btn {
  display: inline-block;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  display: inline-block;
  background: var(--terracotta);
  color: #fff;
  padding: 1rem 2.5rem;
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.btn-primary:hover { background: #B85840; transform: translateY(-1px); }

.btn-secondary {
  display: inline-block;
  border: 1.5px solid rgba(255,255,255,0.6);
  color: rgba(255,255,255,0.9);
  padding: 0.9rem 2.2rem;
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  margin-left: 1rem;
  transition: all 0.2s;
}

.btn-secondary:hover { background: rgba(255,255,255,0.1); }

.btn-outline {
  border: 1px solid #cbd5e1;
  color: #334155;
  background-color: transparent;
}

.btn-outline:hover {
  background-color: #f1f5f9;
}

.btn-sm {
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-dark {
  background-color: #0f172a;
  color: #ffffff;
}

.btn-dark:hover {
  background-color: #334155;
}

.btn-cta {
  display: inline-block;
  background: #fff;
  color: var(--terracotta);
  padding: 1.1rem 3rem;
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s;
}

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

/* -- Stat box -- */
.stat-box {
  background-color: #f1f5f9;
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

/* -- Nav -- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  height: 60px;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-logo span { color: var(--gold-light); }

.debug-impersonate {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.75rem;
  padding: 0.2rem 0.5rem;
  border: 1px dashed rgba(255, 200, 80, 0.6);
  border-radius: 4px;
  background: rgba(255, 200, 80, 0.08);
  font-size: 0.72rem;
}
.debug-impersonate-label {
  color: rgba(255, 200, 80, 0.85);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.debug-impersonate-select {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 3px;
  padding: 0.15rem 0.35rem;
  font-size: 0.78rem;
  max-width: 220px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--gold-light); }

.nav-cta {
  background: var(--gold);
  color: #fff !important;
  padding: 0.45rem 1.2rem;
  border-radius: 2px;
  font-weight: 600 !important;
}

.nav-cta:hover { background: var(--gold-light); }

.nav-link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  font-family: inherit;
  padding: 0;
  transition: color 0.2s;
}

.nav-link-btn:hover { color: var(--gold-light); }

/* -- Footer -- */
footer {
  background: var(--navy);
  padding: 3rem 0;
  text-align: center;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: #fff;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.footer-logo span { color: var(--gold-light); }

footer p {
  color: rgba(255,255,255,0.5);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.footer-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin: 1.5rem 0;
  list-style: none;
}

.footer-links a {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}

.footer-links a:hover { color: var(--gold-light); }

/* -- Form fields -- */
form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 0.4rem;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="tel"],
form input[type="url"],
form input[type="date"],
form input[type="datetime-local"],
form select,
form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--tan);
  border-radius: 3px;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--warm-white);
  transition: border-color 0.2s;
  box-sizing: border-box;
}

form input:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: var(--navy);
}

form .errorlist {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
}

form .errorlist li {
  color: var(--terracotta);
  font-size: 0.85rem;
}

/* -- Cards -- */
.card {
  background: #fff;
  padding: 2rem;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* -- Branded lists -- */
.branded-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.branded-list-item {
  border: 1.5px solid var(--tan);
  border-radius: 3px;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.branded-list-empty {
  border: 1.5px dashed var(--tan);
  border-radius: 3px;
  padding: 1.25rem 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
  text-align: center;
}

.branded-link {
  color: var(--navy);
  text-decoration: none;
  transition: color 0.2s;
}

.branded-link:hover { color: var(--terracotta); }

/* Standardized top-of-page back/up link (see partials/_back_link.html). */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover { color: var(--navy); }

.back-link__arrow { font-size: 0.95em; line-height: 1; }

/* -- Badges -- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-active { background: rgba(122,158,126,0.15); color: var(--sage-dark); }
.badge-pending { background: rgba(200,150,62,0.15); color: var(--gold); }
.badge-default { background: rgba(0,0,0,0.05); color: var(--text-mid); }
.badge-recurring { background: rgba(200,150,62,0.12); color: var(--gold); }
.badge-oneoff { background: rgba(0,0,0,0.05); color: var(--text-mid); }

/* -- Tabs (pills) -- */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  background: var(--cream);
  padding: 0.3rem;
  border-radius: 100px;
}

.tab-link {
  padding: 0.55rem 1.4rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-mid);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.tab-link:hover {
  background: rgba(255,255,255,0.7);
  color: var(--navy);
}

.tab-link.active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30,58,95,0.2);
}

/* -- Modals --
   Canonical modal: a fixed, blurred overlay that flex-centers a .modal-content
   panel. The panel scrolls internally (max-height) so the page behind stays
   static; body scroll is locked via body.modal-open while any modal is open.
   Toggle visibility with the .hidden class. A single global controller in
   base.html wires Escape-to-close, backdrop-click-to-close, and the scroll
   lock for every modal that uses these classes. */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem;
}

.modal-overlay.hidden { display: none; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30,58,95,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* Width variants for smaller/larger dialogs. */
.modal-content--sm { max-width: 32rem; }
.modal-content--lg { max-width: 56rem; }

/* Locked while any modal is open so the page behind cannot scroll. */
body.modal-open { overflow: hidden; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-close {
  background: none;
  border: 1.5px solid var(--tan);
  border-radius: 3px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-mid);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.2s;
}

.modal-close:hover { border-color: var(--navy); color: var(--navy); }

/* -- Calendar -- */
.calendar-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-top: 1rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.calendar-month-row {
  position: relative;
  margin-top: 0.5rem;
}

.calendar-month-row-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.calendar-month-row-spans {
  position: absolute;
  top: 1.5rem;
  left: 0;
  right: 0;
  pointer-events: none;
}

.calendar-span-bar {
  position: absolute;
  border-radius: 0.25rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
  box-sizing: border-box;
}

.calendar-span-bar:hover {
  filter: brightness(0.9);
}

/* -- Week view vertical resize handles -- */
.calendar-week-resize {
  height: 10px;
  cursor: ns-resize;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
  background: transparent;
  transition: background 0.15s;
}

.calendar-week-resize::after {
  content: '';
  position: absolute;
  left: 20%;
  right: 20%;
  height: 3px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.15);
  transition: background 0.15s, transform 0.15s;
}

.calendar-week-resize-top {
  top: -4px;
}

.calendar-week-resize-top::after {
  top: 3px;
}

.calendar-week-resize-bottom {
  bottom: -4px;
}

.calendar-week-resize-bottom::after {
  bottom: 3px;
}

.calendar-week-resize:hover {
  background: rgba(0, 0, 0, 0.06);
}

.calendar-week-resize:hover::after {
  background: rgba(0, 0, 0, 0.4);
  transform: scaleX(1.2);
}

.calendar-cell {
  min-height: 120px;
  border: 1.5px solid var(--tan);
  border-radius: 3px;
  padding: 0.5rem;
}

.calendar-cell.out-of-month {
  border-color: rgba(0,0,0,0.06);
  background: var(--cream);
}

.calendar-cell-day {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mid);
}

.calendar-cell.out-of-month .calendar-cell-day { color: var(--text-light); }
.calendar-cell-day.is-today { color: var(--terracotta); font-weight: 700; }

.calendar-event {
  display: block;
  margin-top: 0.25rem;
  padding: 0.2rem 0.4rem;
  border-radius: 2px;
  font-size: 0.7rem;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(200,150,62,0.1);
  color: var(--navy);
  transition: background 0.2s;
}

.calendar-event:hover { background: rgba(200,150,62,0.2); }

.calendar-cell.out-of-month .calendar-event {
  background: rgba(0,0,0,0.04);
  color: var(--text-light);
}

/* -- Event-detail calendar timeline (day / week mode) -- */
.calendar-timeline {
  --hour-px: 56px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0;
  border: 1px solid var(--tan);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}

.calendar-timeline-hours {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--tan);
  background: var(--cream);
}

.calendar-timeline-hour {
  height: var(--hour-px);
  position: relative;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}

.calendar-timeline-hour-label {
  position: absolute;
  top: -0.4rem;
  right: 0.4rem;
  font-size: 0.65rem;
  color: var(--text-mid);
  background: var(--cream);
  padding: 0 0.2rem;
}

.calendar-timeline-grid {
  position: relative;
}

.calendar-timeline-row {
  height: var(--hour-px);
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}

.calendar-timeline-block {
  position: absolute;
  padding: 2px;
  box-sizing: border-box;
  overflow: visible;
}

.calendar-timeline-block:hover .calendar-week-resize::after {
  background: rgba(0, 0, 0, 0.3);
}

.calendar-timeline-block .calendar-block {
  height: 100%;
}

.calendar-block {
  border-left: 4px solid var(--terracotta);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.calendar-block-icon {
  background: none;
  border: none;
  padding: 0.1rem 0.25rem;
  border-radius: 0.2rem;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

.calendar-block-icon:hover {
  background: rgba(0,0,0,0.06);
}

/* -- Week mode -- */
.calendar-week {
  --hour-px: 56px;
  display: grid;
  grid-template-columns: 56px repeat(var(--days, 7), minmax(120px, 1fr));
  gap: 0;
  border: 1px solid var(--tan);
  border-radius: 0.5rem;
  overflow-x: auto;
  background: #fff;
}

.calendar-week .calendar-timeline-hours {
  border-right: 1px solid var(--tan);
}

.calendar-week-day {
  --hour-px: 56px;
  border-right: 1px solid var(--tan);
}

.calendar-week-day:last-child {
  border-right: none;
}

.calendar-week-day-header {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  text-align: center;
  padding: 0.4rem 0.25rem;
  background: var(--cream);
  border-bottom: 1px solid var(--tan);
  height: 2rem;
  box-sizing: border-box;
}

/* -- Horizontal day calendar -- */
.calendar-day-h {
  margin-top: 0.5rem;
  border: 1px solid var(--tan);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
  display: flex;
}

.calendar-day-h-lane-labels {
  flex-shrink: 0;
  width: 100px;
  border-right: 1px solid var(--tan);
  background: var(--cream);
}

.calendar-day-h-lane-labels-header {
  height: 1.8rem;
  border-bottom: 1px solid var(--tan);
}

.calendar-day-h-lane-label {
  height: var(--lane-height);
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-mid);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day-h-scroll {
  flex: 1;
  overflow-x: auto;
}

.calendar-day-h-tick-header {
  position: relative;
  height: 1.8rem;
  border-bottom: 1px solid var(--tan);
  background: var(--cream);
}

.calendar-day-h-tick-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0, 0, 0, 0.06);
}

.calendar-day-h-tick-mark.is-hour {
  background: rgba(0, 0, 0, 0.15);
}

.calendar-day-h-tick-label {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-mid);
  white-space: nowrap;
}

.calendar-day-h-lanes {
  position: relative;
  height: calc(var(--lane-count) * var(--lane-height));
}

.calendar-day-h-gridline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.calendar-day-h-gridline.is-hour {
  background: rgba(0, 0, 0, 0.15);
}

.calendar-day-h-lane-divider {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

.calendar-day-h-block {
  position: absolute;
  border-radius: 0.4rem;
  border: 2px solid;
  color: #fff;
  font-size: 0.72rem;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  user-select: none;
}

.calendar-day-h-block.is-dragging {
  opacity: 0.9;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 10;
  transition: none;
}

.calendar-day-h-block-body {
  flex: 1;
  padding: 0.35rem 0.5rem;
  cursor: grab;
  min-width: 0;
}

.calendar-day-h-block.is-dragging .calendar-day-h-block-body {
  cursor: grabbing;
}

.calendar-day-h-block-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-day-h-block-time {
  font-size: 0.65rem;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-day-h-block-loc {
  font-size: 0.6rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-day-h-block-icons {
  align-self: flex-start;
  padding: 0.2rem 0.35rem;
  cursor: pointer;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.18);
}

.calendar-day-h-block-icons:hover {
  background: rgba(255, 255, 255, 0.32);
}

.calendar-day-h-resize {
  width: 10px;
  cursor: ew-resize;
  background: transparent;
  position: relative;
  z-index: 2;
  transition: background 0.15s;
}

.calendar-day-h-resize::after {
  content: '';
  position: absolute;
  top: 25%;
  bottom: 25%;
  width: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.15s, transform 0.15s;
}

.calendar-day-h-resize-left::after { left: 2px; }
.calendar-day-h-resize-right::after { right: 2px; }

.calendar-day-h-resize:hover {
  background: rgba(255, 255, 255, 0.25);
}

.calendar-day-h-resize:hover::after {
  background: rgba(255, 255, 255, 0.85);
  transform: scaleY(1.2);
}

.calendar-day-h-resize-left { order: -1; }

/* -- Block modal internal tabs -- */
.block-modal-tab {
  background: none;
  border: none;
  padding: 0.5rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mid);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.block-modal-tab.is-active {
  color: var(--navy);
  border-bottom-color: var(--terracotta);
}

.block-modal-tab:hover { color: var(--navy); }

/* -- Collapsible -- */
.collapsible-toggle {
  background: none;
  border: 1.5px solid var(--tan);
  border-radius: 3px;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  font-family: var(--font-body);
}

.collapsible-toggle:hover { border-color: var(--navy); color: var(--navy); }

/* -- Inline link -- */
.inline-link {
  color: var(--terracotta);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.inline-link:hover { color: var(--navy); }

/* -- Action tiles -- */
.action-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

/* -- Mobile nav toggle -- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  transition: transform 0.2s, opacity 0.2s;
}

/* -- Memory feed -- */

.memory-feed {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.memory-post {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.1rem 1.1rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.memory-post-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.memory-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream, #f4ede0);
  color: var(--navy, #1f3a5f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.memory-post-meta { display: flex; flex-direction: column; line-height: 1.2; }
.memory-post-author { font-weight: 600; color: #0f172a; font-size: 0.92rem; }
.memory-post-time { color: #64748b; font-size: 0.78rem; }

.memory-post-body {
  font-size: 0.95rem;
  color: #0f172a;
  white-space: pre-line;
}

.memory-post-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
}
.memory-post-photo {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 100%;
  display: flex;
  justify-content: center;
}
.memory-post-photo img {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  border-radius: 8px;
  display: block;
  background: #f1f5f9;
}
.memory-post-photo:focus-visible img {
  outline: 2px solid var(--navy, #1f3a5f);
  outline-offset: 2px;
}

.memory-orphans {
  margin-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.memory-orphan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 4px;
}
.memory-orphan-tile {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  background: #f1f5f9;
}
.memory-orphan-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* -- Full-screen photo modal (shared by /memories/ and event memories) -- */

.memories-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.memories-modal.hidden { display: none; }
.memories-modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  color: #fff;
}
.memories-modal-top .memories-modal-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
}
.memories-modal-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}
.memories-modal-close:hover { background: rgba(255, 255, 255, 0.1); }
.memories-modal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
  min-height: 0;
}
/* Event-detail variant: no side comments panel yet, so the image fills the row. */
.memories-modal-body.memory-lightbox-body { grid-template-columns: 1fr; }
@media (max-width: 800px) {
  .memories-modal-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
}
.memories-modal-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 0;
}
.memories-modal-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
/* Lightbox slides: only the .is-active one is rendered. Driven from the
   inline lightbox script in _memory.html. */
.memory-lightbox-slide { display: none; }
.memory-lightbox-slide.is-active { display: block; }
.memories-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.memories-modal-nav:hover { background: rgba(0, 0, 0, 0.7); }
.memories-modal-nav[disabled] { opacity: 0.3; cursor: default; }
.memories-modal-nav.prev { left: 1rem; }
.memories-modal-nav.next { right: 1rem; }

/* -- Responsive -- */

/* Tablet */
@media (max-width: 900px) {
  .site-nav { padding: 0 1.5rem; }
  .nav-links { gap: 1rem; }
  #membership-overview > div { grid-template-columns: 1fr !important; }
  .footer-links { flex-wrap: wrap; gap: 1rem 1.5rem; }
  .calendar-cell { min-height: 80px; padding: 0.35rem; }
  .calendar-event { font-size: 0.6rem; padding: 0.15rem 0.3rem; }
  .modal-content { padding: 1.5rem; margin: 1rem; max-width: calc(100vw - 2rem); }
}

/* Mobile */
@media (max-width: 640px) {
  /* Nav hamburger */
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  }
  .site-nav.nav-open .nav-links { display: flex; }
  .nav-links li { padding: 0.6rem 0; }
  .nav-links a, .nav-link-btn { font-size: 0.85rem; }
  .nav-cta { display: inline-block; margin-top: 0.5rem; text-align: center; }
  .site-nav { position: relative; }

  /* Container */
  .container { padding: 0 1rem; }

  /* Cards */
  .card { padding: 1.25rem; }

  /* Footer */
  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  /* Calendar — stack into list view */
  .calendar-header-row { display: none; }
  .calendar-grid {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .calendar-cell {
    min-height: auto;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
  }
  .calendar-cell.out-of-month:not(:has(.calendar-event)) { display: none; }
  .calendar-cell-day { min-width: 2rem; }

  /* Tabs */
  .tab-nav { width: 100%; }
  .tab-link { flex: 1; text-align: center; padding: 0.5rem 0.75rem; font-size: 0.7rem; }

  /* Modal — full screen on mobile */
  .modal-overlay { z-index: 200; padding: 0; }
  .modal-content {
    padding: 1.25rem;
    min-height: 100vh;
    max-height: 100vh;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
  }
  .modal-header { position: sticky; top: 0; background: #fff; padding-bottom: 1rem; z-index: 1; }
  .modal-content form div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Grids in detail pages */
  .branded-list-item > div[style*="grid"] { grid-template-columns: 1fr !important; }

  /* Action tiles */
  .action-tiles { grid-template-columns: 1fr; }

  /* Members grid */
  div[style*="grid-template-columns:1fr 1fr"][style*="gap:1.5rem"] {
    grid-template-columns: 1fr !important;
  }

  /* Buttons — touch-friendly minimum height */
  .btn-primary, .modal-close, .collapsible-toggle { min-height: 44px; }
}
