/* ═══════════════════════════════════════════════════
   LOOPS – Rituals Page Additions
   Extends base.css. Only new components live here —
   everything else is inherited from the shared framework.
═══════════════════════════════════════════════════ */

/* ── HERO: TODAY'S RITUALS MINI-LIST (replaces week-strip in the app mockup) ── */
.ritual-mini-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 14px;
}
.ritual-mini {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r);
  border: 1.5px solid var(--border); background: var(--off);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.rm-icon { font-size: 18px; flex-shrink: 0; }
.rm-body { flex: 1; min-width: 0; }
.rm-title { font-size: 13px; font-weight: 700; color: var(--black); }
.rm-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.rm-status {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  background: var(--accent-light); color: var(--accent-dark);
}
.rm-status--next { background: var(--black); color: var(--white); }

.ritual-mini.is-next {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateX(2px);
}
.ritual-mini.is-next .rm-title { color: var(--accent-dim); }

/* ── STEP 3: STATE-OF-MIND SLIDER (replaces streak counter) ── */
.state-demo { margin-top: 18px; }
.state-track {
  display: flex; align-items: center; gap: 10px;
  position: relative; padding: 0 4px;
}
.state-track::before {
  content: ''; position: absolute; left: 4px; right: 4px; top: 50%;
  height: 2px; background: var(--border); transform: translateY(-50%); z-index: 0;
}
.state-point {
  position: relative; z-index: 1;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--border);
}
.state-point--active {
  width: 16px; height: 16px;
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-glow);
}
.state-labels {
  display: flex; justify-content: space-between;
  margin-top: 8px; font-size: 10px; font-weight: 600; color: var(--muted);
  letter-spacing: 0.02em;
}
.state-labels span:last-child { color: var(--accent-dark); }
.state-summary { font-size: 13px; font-weight: 600; color: var(--black); margin-top: 14px; }
.state-summary strong { color: var(--accent-dim); }

/* ── RITUAL EXPLORER (interactive tabbed time-of-day widget) ── */
.ritual-explorer {
  margin-top: 44px;
  border: 1.5px solid var(--border); border-radius: var(--r-xl);
  background: var(--white);
  box-shadow: 0 8px 32px rgba(0,0,0,0.05);
  overflow: hidden;
}

.re-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--off);
  border-bottom: 1px solid var(--border);
}
.re-tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 12px; background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  border-right: 1px solid var(--border);
  transition: background 0.2s ease;
}
.re-tab:last-child { border-right: none; }
.re-tab:hover { background: var(--off2); }
.re-tab-icon { font-size: 20px; }
.re-tab-text { font-size: 14px; font-weight: 700; color: var(--mid); display: flex; flex-direction: column; gap: 2px; }
.re-tab-text em {
  font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted);
}
.re-tab.is-active { background: var(--white); }
.re-tab.is-active .re-tab-text { color: var(--black); }
.re-tab.is-active { box-shadow: inset 0 -3px 0 var(--accent); }

/* Decorative sun-arc that tracks the active tab */
.re-arc {
  position: relative; height: 46px; margin: 18px 28px 0;
  color: var(--border);
}
.re-arc svg { width: 100%; height: 100%; display: block; }
.re-sun {
  position: absolute; top: 65%; left: 8%;
  transform: translate(-50%, -50%);
  font-size: 18px; line-height: 1;
  transition: left 0.45s cubic-bezier(0.4, 0, 0.2, 1), top 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.re-arc--morning .re-sun { left: 8%;  top: 78%; }
.re-arc--day .re-sun      { left: 50%; top: 8%;  }
.re-arc--evening .re-sun  { left: 92%; top: 78%; }

.re-panels { padding: 8px 28px 28px; }
.re-panel { display: none; }
.re-panel.is-active { display: block; animation: refade 0.35s ease; }
@keyframes refade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.re-panel-head { margin-bottom: 18px; }
.re-panel-head h3 { font-size: 18px; margin-bottom: 6px; }
.re-panel-head p { font-size: 14px; color: var(--mid); line-height: 1.6; }

.flow-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.flow-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--r-lg);
  border: 1.5px solid var(--border); background: var(--off);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.flow-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.flow-thumb {
  width: 40px; height: 40px; border-radius: var(--r);
  background: var(--white); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.flow-body { flex: 1; min-width: 0; }
.flow-title {
  font-size: 13px; font-weight: 700; color: var(--black); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.flow-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.flow-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 100px; flex-shrink: 0;
  background: var(--accent); color: var(--white);
}
.flow-badge--muted { background: var(--off2); color: var(--muted); }

/* ── IMAGE PLACEHOLDER ── */
.img-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: 100%; aspect-ratio: 4 / 5;
  border-radius: var(--r-xl);
  border: 1.5px dashed var(--border);
  background: repeating-linear-gradient(135deg, var(--off), var(--off) 10px, var(--off2) 10px, var(--off2) 20px);
  color: var(--muted); text-align: center;
}
.img-placeholder-icon { font-size: 34px; opacity: 0.6; }
.img-placeholder-label { font-size: 14px; font-weight: 700; color: var(--mid); }
.img-placeholder-dims { font-size: 12px; color: var(--muted); }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 960px) {
  .flow-card-grid { grid-template-columns: 1fr; }
  .re-tab-text { font-size: 13px; }
}
@media (max-width: 640px) {
  .re-tabs { grid-template-columns: 1fr; }
  .re-tab { flex-direction: row; justify-content: center; border-right: none; border-bottom: 1px solid var(--border); }
  .re-tab:last-child { border-bottom: none; }
  .re-tab.is-active { box-shadow: inset 3px 0 0 var(--accent); }
  .re-arc { display: none; }
  .img-placeholder { aspect-ratio: 4 / 3; }
}
