/* ============================================================
   Home Workout Crew: base styles
   Warm, friendly palette. Extend by adding new CSS custom
   properties / component blocks rather than editing values
   in place, so future pages can reuse them.
   ============================================================ */

:root {
  --bg: #fbf6ef;
  --surface: #ffffff;
  --surface-muted: #f3ece1;
  --text: #2b2320;
  --text-muted: #6b6055;
  --border: #e7dccb;

  --coral: #f25c4e;
  --coral-dark: #d8402f;
  --teal: #2e8b8b;
  --teal-dark: #216868;
  --amber: #e8a33d;
  --purple: #8f6fd1;
  --green: #5fa777;
  --pink: #e07bab;
  --grey: #9a9187;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(43, 35, 32, 0.08);
  --shadow-hover: 0 6px 20px rgba(43, 35, 32, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #201a16;
    --surface: #2b241f;
    --surface-muted: #352c25;
    --text: #f3ece1;
    --text-muted: #b8ab9c;
    --border: #443a32;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; }

img, svg { max-width: 100%; }

/* ---------- Accessibility helpers ---------- */

.skip-link {
  position: absolute;
  top: -100px;
  left: 10px;
  z-index: 200;
  background: var(--coral);
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 10px;
}

/* Visible keyboard focus ring on every interactive element. Mouse/touch
   clicks don't trigger :focus-visible, so this never shows on a tap. */
a:focus-visible,
button:focus-visible,
.day-card:focus-visible {
  outline: 3px solid var(--coral-dark);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Header / nav ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.brand-emoji { font-size: 1.4rem; }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover { background: var(--surface-muted); color: var(--text); }
.nav-link.is-active { background: var(--coral); color: #fff; }

.join-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  background: var(--teal);
  color: #fff;
  padding: 9px 16px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.join-call-btn:hover { background: var(--teal-dark); transform: translateY(-1px); }

/* ---------- Call banner (prominent, every page) ---------- */

.call-banner {
  background: var(--teal-dark);
  color: #fff;
}

.call-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  text-align: center;
}

.call-banner-text {
  font-weight: 700;
  font-size: 1rem;
}

.call-banner-text .call-banner-sub {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 2px;
}

.call-banner .join-call-btn {
  background: var(--coral);
  font-size: 1rem;
  padding: 11px 22px;
}

.call-banner .join-call-btn:hover { background: var(--coral-dark); }

@media (prefers-reduced-motion: no-preference) {
  .call-banner .join-call-btn {
    animation: call-pulse 2.4s ease-in-out infinite;
  }
}

@keyframes call-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 92, 78, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(242, 92, 78, 0); }
}

/* ---------- Hero ---------- */

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 20px 10px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.hero-sub {
  color: var(--text-muted);
  margin: 0;
  font-size: 1rem;
}

/* ---------- Daily theme legend ---------- */

.theme-legend {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 20px 0;
}

.legend-heading {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.legend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.legend-dot.is-rest-dot {
  background: var(--border);
  border: 1px solid var(--text-muted);
}

.legend-day {
  font-weight: 700;
  color: var(--text);
}

.legend-desc {
  color: var(--text-muted);
}

/* ---------- Calendar ---------- */

.calendar-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 10px;
}

.week-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

.week-block-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.week-number {
  background: var(--coral);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.week-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.week-range {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-left: auto;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

@media (max-width: 900px) {
  .day-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
  .day-grid { grid-template-columns: repeat(2, 1fr); }
}

.day-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.day-card:hover, .day-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.day-card.is-rest {
  cursor: default;
  opacity: 0.75;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.day-card.is-rest:hover { transform: none; box-shadow: none; }

.day-card.is-today {
  border: 2px solid var(--coral);
}

.day-name {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.day-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.category-pill {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
}

.workout-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}

.play-hint {
  margin-top: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.rest-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.day-card.is-off {
  cursor: default;
  background: var(--surface-muted);
  border: 1px dashed var(--amber);
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.day-card.is-off:hover { transform: none; box-shadow: none; }

.off-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
}

.off-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.day-card.is-unscheduled {
  cursor: default;
  background: transparent;
  border-style: dotted;
  opacity: 0.6;
}

.unscheduled-label {
  margin-top: auto;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
}

/* category colors, keyed by activity type */
.cat-dance { background: var(--pink); }
.cat-cardio { background: var(--teal); }
.cat-strength { background: var(--coral-dark); }
.cat-pilates { background: var(--purple); }
.cat-yoga { background: var(--green); }
.cat-mobility { background: var(--amber); }

/* ---------- Guidelines ---------- */

.guidelines-section {
  max-width: 1100px;
  margin: 20px auto 60px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.guidelines-section h2 {
  margin-top: 0;
}

.guidelines-list {
  margin: 0;
  padding-left: 20px;
}

.guidelines-list li {
  margin-bottom: 8px;
  color: var(--text);
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 24px 20px 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 12, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

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

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  position: relative;
  box-shadow: var(--shadow-hover);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--surface-muted);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}

.modal-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 40px 4px 0;
}

.modal-title {
  margin: 0 40px 14px 0;
  font-size: 1.15rem;
}

.video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.embed-fallback {
  padding: 28px 20px;
  background: var(--surface-muted);
  border: 1px dashed var(--amber);
  border-radius: var(--radius-md);
  text-align: center;
}

.embed-fallback p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
}

.modal-note {
  margin: 14px 0 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.yt-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--coral-dark);
  text-decoration: none;
}

.yt-link:hover { text-decoration: underline; }

.yt-link-prominent {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 20px;
  background: var(--coral);
  color: #fff;
  border-radius: var(--radius-sm, 8px);
  font-weight: 700;
  text-decoration: none;
}

.yt-link-prominent:hover { text-decoration: none; filter: brightness(1.05); }

/* ---------- Placeholder / coming soon pages ---------- */

.placeholder-section {
  max-width: 700px;
  margin: 60px auto;
  padding: 40px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.placeholder-section .big-emoji {
  font-size: 2.6rem;
  margin-bottom: 10px;
}

.placeholder-section h1 {
  margin: 0 0 10px;
}

.placeholder-section p {
  color: var(--text-muted);
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  font-weight: 600;
  color: var(--coral-dark);
  text-decoration: none;
}

.join-call-btn.is-large {
  font-size: 1.05rem;
  padding: 14px 26px;
  margin-top: 10px;
}

.call-url {
  display: block;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
}

.future-note {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

/* ---------- Long-form content pages (Safety, Resources) ---------- */

.content-page {
  max-width: 800px;
  margin: 0 auto 60px;
  padding: 30px 20px;
}

.content-page > .page-intro {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin: 0 0 8px;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-top: 20px;
}

.content-card h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.content-card h3 {
  margin: 18px 0 8px;
  font-size: 1rem;
}

.content-card ul {
  margin: 0;
  padding-left: 20px;
}

.content-card li {
  margin-bottom: 7px;
}

.content-card p {
  margin: 0 0 10px;
  color: var(--text);
}

.content-card .citation {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 4px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  height: 30px;
}

.data-table th {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.effort-table td:first-child, .effort-table th:first-child {
  font-weight: 600;
}

/* severity guidance cards, ordered mild to emergency */
.severity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.severity-item {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border-left: 5px solid var(--grey);
  background: var(--surface-muted);
}

.severity-item .severity-label {
  font-weight: 700;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 3px;
}

.severity-item.is-ok { border-left-color: var(--green); }
.severity-item.is-ok .severity-label { color: var(--green); }

.severity-item.is-modify { border-left-color: var(--amber); }
.severity-item.is-modify .severity-label { color: var(--amber); }

.severity-item.is-stop { border-left-color: var(--coral-dark); }
.severity-item.is-stop .severity-label { color: var(--coral-dark); }

.severity-item.is-emergency {
  border-left-color: #b0242f;
  background: rgba(176, 36, 47, 0.08);
}
.severity-item.is-emergency .severity-label { color: #b0242f; }

/* ---------- Survey / resources cards ---------- */

.resource-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.resource-link {
  display: block;
  text-decoration: none;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.resource-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.resource-link .resource-sub {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Responsive: tablet ---------- */

@media (max-width: 768px) {
  .header-inner { padding: 12px 16px; }
  .main-nav { width: 100%; justify-content: center; }
  .hero { padding: 28px 16px 8px; }
  .theme-legend { padding: 8px 16px 0; }
  .calendar-section { padding: 16px 16px 6px; }
  .content-page { padding: 24px 16px; }
  .guidelines-section { margin: 16px auto 44px; padding: 16px; }
  .resource-links { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .modal-box { padding: 18px; }
}

/* ---------- Responsive: mobile ---------- */

@media (max-width: 480px) {
  .brand-name { font-size: 1rem; }
  .nav-link { padding: 8px 10px; font-size: 0.86rem; }
  .join-call-btn { padding: 9px 14px; font-size: 0.86rem; width: 100%; }
  .header-inner .join-call-btn { width: auto; }
  .call-banner-inner { padding: 12px 16px; }
  .call-banner-inner .join-call-btn { width: 100%; }
  .call-banner-text { font-size: 0.92rem; }
  .hero h1 { font-size: 1.5rem; }
  .legend-grid { padding: 12px 14px; gap: 8px 16px; }
  .legend-item { font-size: 0.84rem; }
  .week-block { padding: 14px 12px 16px; }
  .week-range { margin-left: 0; width: 100%; }
  .day-card { min-height: 110px; padding: 8px; }
  .content-card { padding: 16px 16px; }
  .data-table { font-size: 0.82rem; }
  .data-table th, .data-table td { padding: 7px 8px; }
  .resource-links { grid-template-columns: 1fr 1fr; }
  .placeholder-section { padding: 30px 18px; margin: 30px auto; }
  .join-call-btn.is-large { width: 100%; justify-content: center; }
}

@media (max-width: 340px) {
  .resource-links { grid-template-columns: 1fr; }
}
