/* ==========================================================================
   Salafi Prayer Times — day card
   Depends on tokens.css. A calm card: next-prayer hero over a strict
   two-column grid of tabular clocks. The column labels are said ONCE in a
   header strip; rows carry only numbers. Type is a deliberate scale —
   large text tracks tighter, small caps track wider — and every space is
   a multiple of 4px.
   ========================================================================== */

.spt-day {
  container: spt-day / inline-size;
  margin: 1.5rem auto;
  max-width: 30rem;
  padding: clamp(1.25rem, 4cqi, 1.5rem);
}

/* ----- Header: eyebrow + date --------------------------------------------- */
.spt-day-header {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.spt-day-header .spt-day-date {
  color: var(--spt-muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

/* ----- Hero: the next prayer ---------------------------------------------- */
.spt-day-next {
  align-items: center;
  background: var(--spt-accent-well);
  border-radius: var(--spt-r-sm);
  display: grid;
  gap: 0.25rem 0.875rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-bottom: 1rem;
  padding: 1rem 1.125rem;
}

.spt-day-next-icon {
  align-items: center;
  background: var(--spt-card);
  border-radius: var(--spt-r-xs);
  color: var(--spt-accent);
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.75rem;
  justify-content: center;
  width: 2.75rem;
}

.spt-day-next-icon svg {
  font-size: 1.375rem;
}

.spt-day-next-copy {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.spt-day-next-name {
  color: var(--spt-text);
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.015em;   /* large text tracks tighter */
  line-height: 1;
  white-space: nowrap;
}

.spt-day-next-time {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
  text-align: right;
}

.spt-day-next-value {
  color: var(--spt-accent);
  font-size: 2.125rem;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

/* ----- The column labels, said once --------------------------------------- */
.spt-day-cols {
  column-gap: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem 4.5rem;
  padding: 0.25rem 0.25rem 0.5rem;
}

.spt-day-col {
  color: var(--spt-muted);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;     /* small caps track wider */
  line-height: 1;
  text-align: right;
  text-transform: uppercase;
}

/* ----- The rows: numbers only ---------------------------------------------- */
.spt-day-list {
  display: flex;
  flex-direction: column;
}

.spt-day-row {
  align-items: center;
  border-radius: var(--spt-r-xs);
  border-top: 1px solid var(--spt-line);
  column-gap: 1rem;
  display: grid;
  grid-template-areas:
    "name begin jamaa"
    "note note note";
  grid-template-columns: minmax(0, 1fr) 4.5rem 4.5rem;
  padding: 0.75rem 0.25rem;
  row-gap: 0;
}

.spt-day-list .spt-day-row:first-child {
  border-top-color: transparent;
}

.spt-day-row.is-next {
  background: var(--spt-accent-well);
  border-top-color: transparent;
  padding-left: 0.625rem;
  padding-right: 0.625rem;
  margin-left: -0.375rem;
  margin-right: -0.375rem;
}

.spt-day-row.is-next + .spt-day-row {
  border-top-color: transparent;
}

.spt-day-name {
  align-items: center;
  display: flex;
  gap: 0.625rem;
  grid-area: name;
  min-width: 0;
}

.spt-day-icon {
  align-items: center;
  background: var(--spt-well);
  border-radius: var(--spt-r-xs);
  color: var(--spt-muted);
  display: inline-flex;
  flex: 0 0 auto;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.spt-day-icon svg {
  font-size: 1rem;
}

.spt-day-row.is-next .spt-day-icon {
  background: var(--spt-card);
  color: var(--spt-accent);
}

.spt-day-prayer {
  color: var(--spt-text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  min-width: 0;
  white-space: nowrap;
}

.spt-day-row.is-next .spt-day-prayer {
  font-weight: 750;
}

.spt-day-time {
  color: var(--spt-text);
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.spt-day-time.is-begin {
  color: var(--spt-muted);
  grid-area: begin;
}

.spt-day-time.is-jamaa {
  font-weight: 700;
  grid-area: jamaa;
}

.spt-day-row.is-next .spt-day-time {
  color: var(--spt-accent);
}

/* A non-clock value (the "Combining" note) gets its own full-width line so
   the time columns above never lose their alignment. */
.spt-day-note {
  color: var(--spt-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  grid-area: note;
  line-height: 1.4;
  margin: 0.375rem 0 0;
  overflow-wrap: break-word;
  text-align: right;
}

/* ----- Hadith footer -------------------------------------------------------- */
.spt-day-hadith {
  border-top: 1px solid var(--spt-line);
  color: var(--spt-muted);
  font-size: 0.8125rem;
  line-height: 1.55;
  margin-top: 0;
  padding-top: 0.875rem;      /* one row's rhythm, not double */
}

.spt-day-hadith p {
  margin: 0;
}

.spt-day-hadith strong {
  color: var(--spt-text);
  font-weight: 600;
}

/* ----- Narrow container (sidebar column / phone) ---------------------------- */
@container spt-day (max-width: 22rem) {
  .spt-day-cols,
  .spt-day-row {
    column-gap: 0.625rem;
    grid-template-columns: minmax(0, 1fr) 3.75rem 3.75rem;
  }

  .spt-day-next-name {
    font-size: 1.375rem;
  }

  .spt-day-next-value {
    font-size: 1.75rem;
  }

  .spt-day-time {
    font-size: 1rem;
  }

  .spt-day[data-spt-format="ampm"] .spt-day-cols,
  .spt-day[data-spt-format="ampm"] .spt-day-row {
    column-gap: 0.5rem;
    grid-template-columns: minmax(0, 1fr) 5.25rem 5.25rem;
  }
}
