/* Calendar page — sunrise heatmap + sticky detail panel.
   Extends dashboard-sunrise.css. */

/* ── Header ── */
.sunrise-cal-header { margin-bottom: 24px; }
.sunrise-cal-title {
  font-family: 'Fraunces', 'Lora', serif;
  font-size: 40px; font-weight: 500;
  color: #3D2419; letter-spacing: -0.025em;
  margin: 6px 0 0; line-height: 1.1;
}
.sunrise-cal-em {
  font-style: italic;
  background: linear-gradient(135deg, #E08D6F 0%, #F4A261 50%, #E9B384 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.sunrise-cal-sub {
  font-size: 14px; color: #5C3A2E; line-height: 1.55;
  margin-top: 8px; max-width: 560px;
}

/* ── Two-column layout ── */
.sunrise-cal-grid-wrap {
  display: grid; grid-template-columns: 1fr 360px;
  gap: 20px; align-items: start;
}

/* ── Month nav ── */
.sunrise-cal-monthnav {
  display: flex; align-items: center; justify-content: space-between;
  background: white; border-radius: 16px; padding: 12px 18px;
  box-shadow: 0 4px 14px rgba(92,58,46,0.06), 0 1px 3px rgba(92,58,46,0.04);
  border: 1px solid rgba(224,141,111,0.18);
  margin-bottom: 16px;
}
.sunrise-cal-monthnav-left { display: flex; align-items: center; gap: 14px; }
.sunrise-cal-arrow {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(92,58,46,0.12); background: transparent;
  cursor: pointer; color: #5C3A2E; font-size: 14px;
}
.sunrise-cal-arrow:hover { background: #FFFAF4; }
.sunrise-cal-monthlabel {
  font-family: 'Fraunces', 'Lora', serif;
  font-size: 20px; font-weight: 500;
  color: #3D2419; letter-spacing: -0.01em;
}
.sunrise-cal-rangepills { display: flex; gap: 6px; }
.sunrise-cal-rangepill {
  font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(92,58,46,0.12); background: transparent;
  color: #5C3A2E; cursor: pointer;
}
.sunrise-cal-rangepill.is-active {
  border: none; background: #FFEFE2; color: #3D2419;
}
.sunrise-cal-rangepill.is-muted {
  border: none; background: transparent; color: #8C5E4D;
}

/* ── DOW header ── */
.sunrise-cal-dowrow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; padding: 0 4px; margin-bottom: 8px;
}
.sunrise-cal-dow {
  font-size: 11px; font-weight: 600; color: #A87A65;
  letter-spacing: 0.08em; text-transform: uppercase; text-align: center;
}

/* ── Cell grid ── */
.sunrise-cal-cells {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  background: white; border-radius: 16px; padding: 14px;
  border: 1px solid rgba(224,141,111,0.18);
  box-shadow: 0 4px 14px rgba(92,58,46,0.06), 0 1px 3px rgba(92,58,46,0.04);
}

/* ── Cell ── */
.sunrise-cal-cell {
  aspect-ratio: 1; border-radius: 10px;
  font-family: inherit; padding: 8px 10px;
  display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid rgba(0,0,0,0.05);
  cursor: pointer; transition: transform 0.1s ease;
}
.sunrise-cal-cell:hover { transform: scale(1.03); }
.sunrise-cal-cell.is-selected {
  border: 2.5px solid #3D2419 !important;
  padding: 7px 9px;
  box-shadow: 0 4px 12px rgba(61,36,25,0.15);
}
.sunrise-cal-cell--spill {
  background: transparent; border: none;
  color: rgba(168,122,101,0.35); cursor: default;
  font-size: 12px; font-weight: 500;
  align-items: flex-end; justify-content: flex-start;
  padding: 8px 10px;
}
.sunrise-cal-cell--spill:hover { transform: none; }
.sunrise-cal-cell--empty {
  background: #FFFAF4;
  border: 1px dashed rgba(168,122,101,0.4);
}
.sunrise-cal-cell--empty:hover { background: #FFF5EC; }
.sunrise-cal-cell--filled {
  border: 1px solid rgba(0,0,0,0.05);
}

.sunrise-cal-cell-top {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}
.sunrise-cal-cell-num {
  font-size: 13px; font-weight: 600; color: #5C3A2E;
}
.sunrise-cal-cell-num.is-muted { color: #8C5E4D; }
.sunrise-cal-cell-num.is-on-color {
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 2px rgba(61,36,25,0.15);
  margin-left: auto;
}
.sunrise-cal-cell-plus {
  font-size: 14px; color: rgba(168,122,101,0.5); font-weight: 300;
}
.sunrise-cal-cell-bottom {
  display: flex; flex-direction: column; gap: 4px;
}
.sunrise-cal-cell-label {
  font-size: 9px; font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.sunrise-cal-cell-dots { display: flex; gap: 2.5px; }
.sunrise-cal-cell-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(255,255,255,0.3);
}
.sunrise-cal-cell-dot.is-on { background: rgba(255,255,255,0.95); }

/* ── Legend ── */
.sunrise-cal-legend {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-top: 16px;
  padding: 14px 18px; background: rgba(255,255,255,0.6);
  border-radius: 14px; border: 1px solid rgba(224,141,111,0.12);
}
.sunrise-cal-legend-group { display: flex; align-items: center; gap: 10px; }
.sunrise-cal-legend-label {
  font-size: 11px; font-weight: 600; color: #8C5E4D;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.sunrise-cal-legend-swatches { display: flex; gap: 4px; }
.sunrise-cal-swatch { width: 22px; height: 22px; border-radius: 6px; }
.sunrise-cal-legend-note { font-size: 11px; color: #8C5E4D; }
.sunrise-cal-legend-dots { display: flex; gap: 3px; }
.sunrise-cal-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(168,122,101,0.25);
}
.sunrise-cal-dot.is-on { background: #5D8651; }
.sunrise-cal-empty-swatch {
  width: 22px; height: 22px; border-radius: 6px;
  background: #FFFAF4; border: 1px dashed rgba(168,122,101,0.4);
}

/* ── Detail panel ── */
.sunrise-cal-detail {
  background: white; border-radius: 20px; padding: 24px;
  box-shadow: 0 4px 14px rgba(92,58,46,0.06), 0 1px 3px rgba(92,58,46,0.04);
  border: 1px solid rgba(224,141,111,0.18);
  position: sticky; top: 20px;
}
.sunrise-cal-detail-title {
  font-family: 'Fraunces', 'Lora', serif;
  font-size: 26px; font-weight: 500;
  color: #3D2419; letter-spacing: -0.02em;
  margin: 4px 0 0;
}

.sunrise-cal-detail-empty {
  background: #FFFAF4; border-radius: 12px; padding: 18px;
  margin-top: 18px; text-align: center;
  border: 1px dashed rgba(168,122,101,0.4);
}
.sunrise-cal-detail-empty-copy {
  font-size: 14px; color: #5C3A2E; line-height: 1.5; margin-bottom: 14px;
}
.sunrise-cal-detail-empty .sunrise-cta-primary {
  font-size: 13px; padding: 10px 22px;
}

.sunrise-cal-detail-mood {
  display: flex; align-items: center; gap: 14px;
  margin-top: 18px; padding: 14px 16px; border-radius: 12px;
}
.sunrise-cal-detail-moodicon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: white;
}
.sunrise-cal-detail-moodlabel {
  font-size: 11px; font-weight: 600; color: #8C5E4D;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.sunrise-cal-detail-moodvalue {
  font-family: 'Fraunces', 'Lora', serif;
  font-size: 22px; font-weight: 500; color: #3D2419;
  line-height: 1.1; margin-top: 2px;
}

.sunrise-cal-detail-section { margin-top: 20px; }
.sunrise-cal-detail-section--bordered {
  padding-top: 18px; border-top: 1px solid rgba(92,58,46,0.08);
}
.sunrise-cal-detail-eyebrow {
  font-size: 11px; font-weight: 600; color: #8C5E4D;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px;
}

.sunrise-cal-detail-dims { display: flex; flex-direction: column; gap: 6px; }
.sunrise-cal-detail-dim {
  display: grid; grid-template-columns: 90px 1fr 50px;
  gap: 10px; align-items: center;
}
.sunrise-cal-detail-dim-name { font-size: 12px; color: #5C3A2E; font-weight: 500; }
.sunrise-cal-detail-dim-bar {
  height: 6px; background: rgba(168,122,101,0.1);
  border-radius: 3px; overflow: hidden;
}
.sunrise-cal-detail-dim-fill { height: 100%; border-radius: 3px; }
.sunrise-cal-detail-dim-label { font-size: 11px; color: #8C5E4D; text-align: right; }

.sunrise-cal-detail-routine { display: flex; flex-direction: column; gap: 6px; }
.sunrise-cal-detail-routine-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  background: #FFFAF4; opacity: 0.65;
}
.sunrise-cal-detail-routine-row.is-done {
  background: #F4FAEC; opacity: 1;
}
.sunrise-cal-detail-routine-glyph {
  width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.sunrise-cal-detail-routine-name { flex: 1; font-size: 12px; color: #5C3A2E; }
.sunrise-cal-detail-routine-check {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid rgba(168,122,101,0.3);
  color: white; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sunrise-cal-detail-routine-check.is-done {
  background: #5D8651; border: none;
}

.sunrise-cal-detail-actions {
  display: flex; gap: 8px; margin-top: 18px;
}
.sunrise-cal-detail-actions .sunrise-cta-primary,
.sunrise-cal-detail-actions .sunrise-cta-secondary {
  flex: 1; font-size: 13px; padding: 10px 16px;
  text-align: center;
}

/* Tablet — stack detail panel below calendar */
@media (max-width: 1024px) {
  .sunrise-cal-grid-wrap { grid-template-columns: 1fr; }
  .sunrise-cal-detail { position: static; }
}

/* Mobile */
@media (max-width: 768px) {
  .sunrise-cal-title { font-size: 30px; }
  .sunrise-cal-monthnav { padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .sunrise-cal-monthlabel { font-size: 18px; }
  .sunrise-cal-rangepills { flex-wrap: wrap; }
  .sunrise-cal-cells { padding: 10px; gap: 4px; }
  .sunrise-cal-cell { padding: 6px; }
  .sunrise-cal-cell.is-selected { padding: 5px; }
  .sunrise-cal-cell-num { font-size: 12px; }
  .sunrise-cal-legend { flex-direction: column; gap: 10px; padding: 12px 14px; }
  .sunrise-cal-detail { padding: 18px; }
  .sunrise-cal-detail-title { font-size: 22px; }
}

/* Small phones */
@media (max-width: 480px) {
  .sunrise-cal-title { font-size: 26px; }
  .sunrise-cal-sub { font-size: 13px; }
  .sunrise-cal-monthnav { padding: 8px 12px; }
  .sunrise-cal-monthlabel { font-size: 16px; }
  .sunrise-cal-rangepill { padding: 6px 10px; font-size: 11px; }
  .sunrise-cal-cells { padding: 8px; gap: 3px; }
  .sunrise-cal-cell { padding: 4px; border-radius: 8px; }
  .sunrise-cal-cell.is-selected { padding: 3px; }
  .sunrise-cal-cell-num { font-size: 11px; }
  .sunrise-cal-cell-label { font-size: 8px; }
  .sunrise-cal-dow { font-size: 10px; }
  .sunrise-cal-dowrow { gap: 3px; padding: 0; }
  .sunrise-cal-detail { padding: 14px; border-radius: 16px; }
  .sunrise-cal-detail-title { font-size: 20px; }
  .sunrise-cal-detail-dim { grid-template-columns: 70px 1fr 40px; gap: 6px; }
  .sunrise-cal-detail-dim-name { font-size: 11px; }
}
