/* Family Activities (pilot, beta only): served only where FAMILY_PILOT=1
   (lib/familyPilot.js). The panel, cards, tiles and actions are the shared
   module styles; this file only adds what every module defines for itself:
   showing its panel, its banner, and its colours. */
body[data-mode="family"] main > [data-mode-panel="family"] { display: block; }
body[data-mode="family"] { --banner-ink: #22382a; --banner-photo: url("/module-banners/family.webp"); --banner-position: 62%; }

/* Warm terracotta, from the banner's late-afternoon light, on the shared cream page. */
body[data-mode="family"] {
  --panel-bg: #f6f3eb; --panel-card: #fff; --panel-text: #2b2119; --panel-muted: #6b5c50;
  --panel-accent: #9c4a35; --panel-border: #eadbd2; --panel-chip: #f5e7e0;
  --panel-chip-on: #6e3527; --panel-chip-on-text: #fff; --panel-stat: #f6ebe5;
  background: var(--panel-bg);
}
[data-theme="dark"] body[data-mode="family"] {
  --panel-bg: #15110e; --panel-card: #211a15; --panel-text: #f3e9e2; --panel-muted: #bba99c;
  --panel-accent: #f0a58f; --panel-border: #3a2d25; --panel-chip: #2b211b;
  --panel-chip-on: #f0a58f; --panel-chip-on-text: #15110e; --panel-stat: #1d1612;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-mode="family"] {
    --panel-bg: #15110e; --panel-card: #211a15; --panel-text: #f3e9e2; --panel-muted: #bba99c;
    --panel-accent: #f0a58f; --panel-border: #3a2d25; --panel-chip: #2b211b;
    --panel-chip-on: #f0a58f; --panel-chip-on-text: #15110e; --panel-stat: #1d1612;
  }
}

/* A long-running program's card is taller (More dates); others shouldn't stretch to match. */
#family-list { align-items: start; }
#family-mode .family-more ul { margin-top: .25rem; }
#family-list > .pnl-empty { grid-column: 1 / -1; }
/* The Events heading with its show-or-hide button: one row across the list, never a card's place (Nov 28). */
#family-list > .family-events-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: .6rem; }
#family-list > .family-events-head .local-section { margin: 0; }
#family-list > .family-events-head .family-routine { min-height: 44px; white-space: normal; text-align: left; max-width: 100%; }
/* The next page of events, under the cards it follows. */
#family-list > .family-more-events { grid-column: 1 / -1; justify-self: start; min-height: 44px; }
#family-list .family-more-total { color: var(--panel-muted); font-weight: 400; }
/* Nothing nearby: where Family coverage is, one tap away (like the Florida warm-weather note). */
.family-coverage p { margin: .4rem 0 0; }
.family-coverage .pnl-chips { margin-top: .6rem; justify-content: center; }
#family-mode .pnl-status { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
/* The holiday season's highlight (Nov 1 – Jan 7), above the events, and the
   tag on each holiday card beside its age label. */
#family-list > .family-holiday-hero { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .6rem 1rem; border-left: 4px solid var(--panel-accent); }
.family-holiday-hero .family-holiday-copy { flex: 1 1 14rem; min-width: 0; }
.family-holiday-hero p { margin: .25rem 0 0; color: var(--panel-muted); }
.family-holiday-hero .pnl-chip { min-height: 44px; }
/* Your plan (the listings tapped Interested): a bar above the search's list,
   to see or share it, and the plan itself, headed like the holiday highlight. */
#family-mode .family-plan-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: 0 0 .75rem; padding: .6rem .9rem;
  border: 1px solid var(--panel-border); border-left: 4px solid var(--panel-accent); border-radius: 12px; background: var(--panel-card); color: var(--panel-text); }
#family-mode .family-plan-bar[hidden] { display: none; }
.family-plan-bar .family-plan-label { flex: 1 1 8rem; }
/* On a phone, what's in your plan on its own line, its two buttons together below. */
@media (max-width: 520px) { .family-plan-bar .family-plan-label { flex-basis: 100%; } }
.family-plan-bar .pnl-chip, .family-plan-head .pnl-chip { min-height: 44px; }
.family-plan-status { flex: 1 1 100%; color: var(--panel-muted); font-size: .85rem; overflow-wrap: anywhere; }
.family-plan-status:empty { display: none; }
#family-list > .family-plan-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .6rem 1rem; border-left: 4px solid var(--panel-accent); }
.family-plan-head .family-plan-copy { flex: 1 1 14rem; min-width: 0; }
.family-plan-head p { margin: .25rem 0 0; color: var(--panel-muted); }
.family-plan-head .family-plan-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.family-kicker-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.family-holiday-tag { padding: .05rem .5rem; border-radius: 999px; background: var(--panel-chip); color: var(--panel-accent);
  font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
/* What a listing costs, beside its age label: Free stands out; a price or
   "Tickets required" reads plainly; "No fee listed" (a library program) and
   "Cost not listed" stay quiet. */
.family-cost-tag { padding: .05rem .5rem; border-radius: 999px; border: 1px solid var(--panel-border); background: var(--panel-card);
  color: var(--panel-text); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.family-cost-tag[data-cost="free"] { background: var(--panel-chip-on); border-color: var(--panel-chip-on); color: var(--panel-chip-on-text); }
.family-cost-tag:is([data-cost="library"], [data-cost="none"]) { color: var(--panel-muted); font-weight: 600; }

/* Home's "Coming up" row for a family event. */
.home-feed-item:has([data-act="family"]) { --activity-tone: var(--tone-family); }

/* A dated listing's plan actions, in the card's link row: Add to calendar
   (Google Calendar, or a calendar file for Apple and Outlook) and Interested,
   with how many are (from the server's threshold up). Styled as the row's
   links are. */
/* The calendar choices open as a small menu under "Add to calendar", over
   what's below it, so the link row never moves (the owner, Nov 24: the first
   version stacked them inside the row). */
#family-list .local-actions .family-calendar { position: relative; display: inline-flex; }
#family-list .local-actions .family-calendar > summary,
#family-list .local-actions .family-interest {
  color: var(--panel-accent); font: inherit; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center;
  cursor: pointer; background: none; border: 0; padding: 0; list-style: none;
}
#family-list .local-actions .family-calendar > summary::-webkit-details-marker { display: none; }
#family-list .local-actions .family-calendar > summary::after { content: " ▾"; font-size: .8em; }
#family-list .local-actions .family-calendar[open] > summary::after { content: " ▴"; }
#family-list .local-actions .family-calendar-links {
  position: absolute; top: calc(100% - 4px); left: 0; z-index: 5; display: flex; flex-direction: column; min-width: 12rem; max-width: calc(100vw - 32px);
  padding: 6px; background: var(--panel-card); border: 1px solid var(--panel-border); border-radius: 10px; box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
}
#family-list .local-actions .family-calendar-links a { min-height: 44px; padding: 0 10px; border-radius: 8px; white-space: nowrap; }
#family-list .local-actions .family-calendar-links a:hover { background: var(--panel-chip); text-decoration: none; }
#family-list .local-actions .family-interest:hover,
#family-list .local-actions .family-calendar > summary:hover { text-decoration: underline; }
#family-list .local-actions .family-interest:disabled { opacity: .6; cursor: progress; }
#family-list .local-actions .family-interest-count { color: var(--panel-muted); font-size: .85rem; display: inline-flex; align-items: center; }
#family-list .local-actions .family-interest-count:empty { display: none; }

/* Add your event (lib/familySubmissions.js): an organizer's own event, sent
   for review. The same panel fields as the search card above it. */
#family-mode .family-add-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
#family-mode .family-add-cta .family-add-copy { flex: 1 1 14rem; min-width: 0; }
#family-mode .family-add-cta p, #family-mode .family-add-done p { margin: .25rem 0 0; color: var(--panel-muted); }
#family-mode .family-add-cta .pnl-chip, #family-mode .family-add-actions .pnl-chip, #family-mode .family-add-done .pnl-chip { min-height: 44px; }
#family-mode .family-add h2 { margin: 0 0 4px; }
#family-mode .family-add-lead { margin: 0 0 14px; color: var(--panel-muted); }
#family-mode .family-add .pnl-row { align-items: flex-start; }
#family-mode .family-add-wide { flex: 1 1 100%; }
#family-mode .family-add-wide .pnl-input { width: 100%; box-sizing: border-box; }
#family-mode .family-add textarea.pnl-input {
  font: inherit; font-size: 16px; color: var(--panel-text); background: var(--panel-chip); border: 1px solid var(--panel-border);
  border-radius: 10px; padding: 8px 10px; min-height: 88px; resize: vertical;
}
#family-mode .family-add small { color: var(--panel-muted); font-size: .85rem; }
#family-mode .family-add .pnl-input[aria-invalid="true"] { border-color: var(--red); }
#family-mode .family-add-consent { display: flex; gap: 10px; align-items: flex-start; flex: 1 1 100%; line-height: 1.4; }
#family-mode .family-add-consent input { width: 22px; height: 22px; margin: 0; flex: none; }
#family-mode .family-add-consent:has(input[aria-invalid="true"]) { color: var(--red); }
#family-mode .family-add-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#family-mode .family-add-error { margin: 12px 0 0; color: var(--red); font-weight: 600; }
#family-mode .family-add-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
#family-mode .family-add-send { background: var(--panel-chip-on); color: var(--panel-chip-on-text); border-color: var(--panel-chip-on); font-weight: 700; }
#family-mode .family-add-send:disabled { opacity: .6; cursor: progress; }
#family-mode .family-add-fine { margin: 12px 0 0; font-size: .85rem; color: var(--panel-muted); }
@media (max-width: 640px) {
  #family-mode .family-add .pnl-row { grid-template-columns: 1fr 1fr; }
  #family-mode .family-add-wide, #family-mode .family-add-consent { grid-column: 1 / -1; }
}
/* The page's own label rule (small, bold, uppercase) is for field names only. */
#family-mode .family-add small, #family-mode .family-add-consent {
  text-transform: none; letter-spacing: normal; font-weight: 400; margin: 0;
}
#family-mode .family-add-consent { font-size: .95rem; color: var(--panel-text); }
#family-mode .family-add-fine a { color: var(--panel-accent); }
@media (max-width: 640px) {
  #family-mode .family-add-date { grid-column: 1 / -1; }
}

/* Top picks (Nov 25): the search's best events above the full list, the way
   Clock Out PLAY Weekly leads with its picks. Three across on a wide screen;
   on a phone, a row to swipe, so the list still starts on the first screen. */
#family-list > .family-top { grid-column: 1 / -1; display: grid; gap: 8px; min-width: 0; }
#family-mode .family-top .local-section { margin: 0; }
#family-mode .family-top-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#family-mode .family-top-card { margin: 0; padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#family-mode .family-top-card h4 { margin: 0; font: 600 1.05rem/1.25 var(--font-display); color: var(--panel-text); }
#family-mode .family-top-when { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .78rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--panel-accent); }
#family-mode .family-top-card .where { margin: 0; }
#family-mode .family-top-card .family-description { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#family-mode .family-top-card .local-actions { margin-top: auto; }
@media (max-width: 719px) {
  #family-mode .family-top-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding: 2px 2px 8px; -webkit-overflow-scrolling: touch; }
  #family-mode .family-top-card { flex: 0 0 80%; scroll-snap-align: start; }
}
#family-mode .family-top { margin-top: 4px; }
/* More filters (Nov 25): the less-used filters, folded the way Pickleball, Simulators and Ski fold theirs. */
#family-mode .family-filters { margin: 12px 0; }
#family-mode .family-filters > summary { padding: 10px 0; min-height: 44px; box-sizing: border-box; cursor: pointer; }
/* On a phone a card's description stops at three lines; the organizer's page has the rest. */
@media (max-width: 719px) {
  #family-list .family-description { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}

/* The fold button wraps on a narrow phone instead of widening the page. */
#family-mode .family-routine { white-space: normal; max-width: 100%; text-align: left; min-height: 44px; margin-bottom: .6rem; }
/* Home's invitation to organizers (lib/familyPilot.js). */
.home-add-event { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 1.5rem 0 0; padding: .9rem 1.1rem; border: 1.5px solid var(--border); border-radius: 14px; background: var(--card); }
.home-add-event div { display: grid; gap: 2px; min-width: 0; }
.home-add-event span { color: var(--muted); font-size: .95rem; }
.home-add-event a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 1.1rem; border: 1.5px solid var(--border); border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
