/* ==========================================================================
   Prayer Times — Day widget  ([prayer_times] / .prayer-times-widget)
   Depends on prayer-times-tokens.css for the palette + .ptcsv-widget shell.
   A compact, app-style card: a "Next prayer" hero over a strict two-column
   time grid. Responds to its container, so it sits happily in a sidebar
   column or full width.
   ========================================================================== */

.prayer-times-widget {
  container: ptcsv-day / inline-size;
  margin: 1.5rem auto;
  max-width: 30rem;
  padding: clamp(1.15rem, 4vw, 1.6rem);
}

/* ----- Header ------------------------------------------------------------ */
.ptcsv-header {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.ptcsv-header time {
  color: var(--pt-muted);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: right;
}

/* ----- Hero: the next prayer --------------------------------------------- */
.ptcsv-next {
  align-items: center;
  background: var(--pt-hero);            /* subtle lift, no boxed border */
  border-radius: var(--pt-radius-sm);
  display: grid;
  gap: 0.85rem 1.1rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-bottom: 1.3rem;
  padding: clamp(1rem, 4.5vw, 1.45rem);
}

.ptcsv-next-icon {
  align-items: center;
  background: var(--pt-accent-soft);
  border-radius: var(--pt-radius-xs);
  color: var(--pt-accent);
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.85rem;
  justify-content: center;
  width: 2.85rem;
}

.ptcsv-next-icon i {
  font-size: 1.4rem;
  line-height: 1;
}

.ptcsv-next-copy {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  min-width: 0;
}

.ptcsv-next-name {
  color: var(--pt-text);
  font-size: clamp(1.5rem, 8cqi, 2rem);
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;                   /* never split "Maghrib" */
}

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

.ptcsv-next-value {
  color: var(--pt-accent-ink);
  font-family: var(--pt-font-num);
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1;
}

.ptcsv-next-value.is-clock {
  font-size: clamp(1.95rem, 11cqi, 2.7rem);
  white-space: nowrap;
}

.ptcsv-next-value.is-status {
  font-size: clamp(1rem, 5cqi, 1.35rem);
  line-height: 1.2;
  overflow-wrap: break-word;
  white-space: normal;
}

/* ----- The list: strict two-column time grid ----------------------------- */
.ptw-list {
  display: flex;
  flex-direction: column;
}

.ptw-row {
  align-items: center;
  border-radius: var(--pt-radius-xs);
  column-gap: 0.9rem;
  display: grid;
  grid-template-areas:
    "name begin jamaa"
    "note note note";
  grid-template-columns: minmax(0, 1fr) 5.5rem 5.5rem;
  padding: 0.72rem 0.7rem;
  row-gap: 0;
}

.ptw-row + .ptw-row {
  border-top: 1px solid var(--pt-border);
}

.ptw-row.next-prayer {
  background: var(--pt-accent-soft);
  border-top-color: transparent;
}

.ptw-row.next-prayer + .ptw-row {
  border-top-color: transparent;
}

.ptw-name {
  align-items: center;
  display: flex;
  gap: 0.7rem;
  grid-area: name;
  min-width: 0;
}

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

.ptw-icon i {
  font-size: 1.05rem;
}

.ptw-row.next-prayer .ptw-icon {
  background: var(--pt-accent-soft);
  color: var(--pt-accent);
}

.ptw-prayer {
  color: var(--pt-text);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.1;
  min-width: 0;
  white-space: nowrap;                   /* keep prayer names intact */
}

.ptw-row.next-prayer .ptw-prayer {
  color: var(--pt-accent-ink);
}

.ptw-slot {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  text-align: right;
}

.ptw-slot-begin {
  grid-area: begin;
}

.ptw-slot-jamaa {
  grid-area: jamaa;
}

.ptw-slot-label {
  color: var(--pt-faint);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.ptw-time {
  color: var(--pt-text);
  font-family: var(--pt-font-num);
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1;
}

.ptw-time.is-clock {
  font-size: 1.15rem;
  white-space: nowrap;                   /* digits stay on one line */
}

.ptw-time.is-status {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: break-word;             /* wrap between words, not mid-word */
  white-space: normal;
}

.ptw-slot-jamaa .ptw-time.is-clock {
  color: var(--pt-accent-ink);
}

/* A non-clock value (e.g. a "Combining Maghrib & Isha" note) drops to its own
   full-width line so the time columns above never lose their alignment. */
.ptw-note {
  color: var(--pt-muted);
  font-size: 0.82rem;
  font-weight: 600;
  grid-area: note;
  line-height: 1.3;
  margin: 0.45rem 0 0;
  overflow-wrap: break-word;
  text-align: right;
}

/* ----- Hadith footer ----------------------------------------------------- */
.prayer-hadith {
  border-top: 1px solid var(--pt-border);
  color: var(--pt-muted);
  font-size: 0.84rem;
  line-height: 1.55;
  margin-top: 1.2rem;
  padding-top: 1.1rem;
}

.prayer-hadith p {
  margin: 0;
}

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

/* ----- Narrow container (sidebar column / phone) ------------------------- */
@container ptcsv-day (max-width: 26rem) {
  .ptcsv-header time {
    text-align: left;
  }

  .ptcsv-next {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ptcsv-next-time {
    align-items: flex-start;
    grid-column: 1 / -1;
    padding-left: calc(2.85rem + 1.1rem);
    text-align: left;
  }

  .ptw-row {
    align-items: start;
    column-gap: 1rem;
    grid-template-areas:
      "name name"
      "begin jamaa"
      "note note";
    grid-template-columns: 1fr 1fr;
    row-gap: 0.6rem;
  }

  .ptw-slot {
    align-items: flex-start;
    text-align: left;
  }

  .ptw-note {
    margin-top: 0;
    text-align: left;
  }
}
