/* ==========================================================================
   campstatus.css — the camp status strip at the top of the front page
   (index_campstatus.inc.php)

   Always loaded, like stats.css, because the markup is emitted whether or not
   the modern layer is on. Every token carries a literal fallback.
   ========================================================================== */

/* 24px under every free-standing block, which is what a card (mb-4) leaves.
   One rhythm down the page. */
.cs-status {
  margin: 0 16px 24px;
  padding: 16px 16px 6px;
  border-radius: 20px;
  background: var(--cs-surface, #fff);
  box-shadow: 0 1px 2px rgba(16, 16, 30, 0.04), 0 8px 24px -6px rgba(16, 16, 30, 0.08),
    0 0 0 1px var(--cs-line, rgba(15, 15, 25, 0.07));
}

.cs-status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.cs-status-camp {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cs-faint, #9a9aa5);
  line-height: 1.3;
}
.cs-status-day {
  margin-top: 2px;
  font-size: 21px;
  font-weight: 660;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--cs-ink, #0b0b10);
}
.cs-status-date {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--cs-muted, #6b6b76);
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}

/* ---------- Day ticks ---------- */

.cs-status-track {
  display: flex;
  gap: 4px;
  margin: 14px 0 4px;
}
.cs-status-tick {
  flex: 1 1 0;
  height: 4px;
  border-radius: 999px;
  background: var(--cs-surface-3, #eeeef2);
}
.cs-status-tick.is-done { background: var(--cs-line-strong, rgba(15, 15, 25, 0.22)); }
.cs-status-tick.is-today { background: var(--cs-highlight, #da4453); }

/* ---------- Now / next ---------- */

.cs-status-list { margin-top: 12px; }

.cs-status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--cs-line, rgba(15, 15, 25, 0.07));
  color: inherit !important;
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
}
.cs-status-when {
  flex: 0 0 52px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cs-faint, #9a9aa5);
}
.cs-status-item.is-live .cs-status-when { color: #15803d; }
.cs-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: cs-status-pulse 2.4s ease-out infinite;
}
@keyframes cs-status-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
}

.cs-status-what { flex: 1 1 auto; min-width: 0; }
.cs-status-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: var(--cs-ink, #0b0b10);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-status-meta {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--cs-muted, #6b6b76);
  font-variant-numeric: tabular-nums;
}

.cs-status-go {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-right: 1.75px solid var(--cs-faint, #9a9aa5);
  border-top: 1.75px solid var(--cs-faint, #9a9aa5);
  transform: rotate(45deg);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.cs-status-item:hover .cs-status-go { transform: rotate(45deg) translate(2px, -2px); }

/* ---------- Dark theme ---------- */

body.theme-dark .cs-status {
  background: #1c1f24;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
body.theme-dark .cs-status-day,
body.theme-dark .cs-status-title { color: #f4f5f7; }
body.theme-dark .cs-status-tick { background: #2b2f36; }
body.theme-dark .cs-status-tick.is-done { background: rgba(255, 255, 255, 0.28); }
body.theme-dark .cs-status-item { border-top-color: rgba(255, 255, 255, 0.08); }
body.theme-dark .cs-status-item.is-live .cs-status-when { color: #4ade80; }

@media (prefers-reduced-motion: reduce) {
  .cs-status-dot { animation: none; }
  .cs-status-go { transition: none; }
}

/* ==========================================================================
   Countdown (functions_countdown.php)

   Replaces the Tick flip-clock: four tiles, tabular numerals, and the start
   time spelled out underneath so the number has something to mean.
   ========================================================================== */

/* index.php calls countdown() outside any card as well as inside one, so the
   gutter lives here and is dropped again when it sits in a card. */
.cs-countdown { margin: 2px 16px 24px; }
.card-style .cs-countdown { margin-left: 0; margin-right: 0; margin-bottom: 2px; }

.cs-countdown-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cs-countdown-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 4px 11px;
  border-radius: 14px;
  background: var(--cs-surface-2, #f6f6f8);
  box-shadow: 0 0 0 1px var(--cs-line, rgba(15, 15, 25, 0.07)) inset;
}

.cs-countdown-value {
  font-size: clamp(24px, 8vw, 32px);
  font-weight: 680;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--cs-ink, #0b0b10);
}
/* Days is the number people actually read; the rest support it */
.cs-countdown-tile:first-child .cs-countdown-value { color: var(--cs-highlight, #da4453); }

.cs-countdown-label {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cs-faint, #9a9aa5);
}

.cs-countdown-when {
  margin-top: 12px;
  /* The countdown sits outside a card, so its own left edge is the card edge,
     not the card's text edge. Every other line of text on the page starts 15px
     further in; this one matches it. Inside a card that offset is already
     there, so it is removed again below. */
  padding-left: 15px;
  font-size: 13.5px;
  color: var(--cs-muted, #6b6b76);
}
.card-style .cs-countdown-when { padding-left: 0; }

body.theme-dark .cs-countdown-tile {
  background: #23262c;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07) inset;
}
body.theme-dark .cs-countdown-value { color: #f4f5f7; }
body.theme-dark .cs-countdown-tile:first-child .cs-countdown-value { color: #ff6b7d; }
