/* The kit's components (issue 119, first slice). Only tokens (kit/tokens.css) for color and type;
   tests/kit-lint.test.mjs fails on a raw color or font-size here. Layout of a page (which card goes
   where) belongs to the page's own stylesheet. */

/* ---- Card: three surfaces ---------------------------------------------------------------- */
.k-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--k-pad);
  border: var(--k-border-width) solid var(--k-border);
  border-radius: var(--k-radius-card);
  background: var(--k-surface);
  color: var(--k-text);
}
.k-card--hero {
  border-color: transparent;
  background: var(--k-hero);
  color: var(--k-on-primary);
}
.k-card--art {
  isolation: isolate;
  overflow: hidden;
  border-color: transparent;
  background-color: var(--k-primary);
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--k-on-primary);
}
.k-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.k-card--art::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--k-scrim);
}

/* ---- Card header ------------------------------------------------------------------------- */
.k-hd {
  display: flex;
  align-items: center;
  gap: var(--k-space-2);
  min-height: 28px;
  margin: 0 0 var(--k-space-3);
}
.k-hd > .k-ic {
  width: 20px;
  height: 20px;
  color: var(--k-link);
}
.k-hd h2 {
  margin: 0;
  font-family: var(--k-font-ui);
  font-size: var(--k-fs-md);
  font-weight: var(--k-fw-semibold);
  line-height: var(--k-lh-snug);
}
.k-card--hero .k-hd > .k-ic,
.k-card--art .k-hd > .k-ic {
  color: var(--k-lit);
}
.k-aside {
  display: inline-flex;
  align-items: center;
  gap: var(--k-space-1);
  min-height: var(--k-touch);
  margin: -8px 0 -8px auto;
  color: var(--k-link);
  font-size: var(--k-fs-note);
  font-weight: var(--k-fw-semibold);
  text-decoration: none;
}
.k-aside .k-ic {
  width: 16px;
  height: 16px;
  color: inherit;
}
.k-card--hero .k-aside {
  color: var(--k-lit);
}
.k-card--art .k-aside {
  color: var(--k-on-primary);
}

/* ---- Common pieces ----------------------------------------------------------------------- */
.k-ic {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.k-he {
  font-family: var(--k-font-prayer);
  direction: rtl;
  unicode-bidi: isolate;
}
.k-info {
  display: block;
  font-family: var(--k-font-ui);
  font-size: var(--k-fs-sm);
  font-weight: var(--k-fw-regular);
  line-height: var(--k-lh-body);
  color: var(--k-text-quiet);
}
.k-card--hero .k-info,
.k-card--art .k-info {
  color: var(--k-on-primary-label);
}
.k-card a:focus-visible,
.k-card button:focus-visible {
  outline: 2px solid var(--k-focus);
  outline-offset: 2px;
}
.k-card--hero a:focus-visible,
.k-card--hero button:focus-visible,
.k-card--art a:focus-visible {
  outline-color: var(--k-lit);
}

/* ---- Buttons ----------------------------------------------------------------------------- */
.k-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--k-space-2);
  min-height: var(--k-touch);
  padding: 0 var(--k-space-5);
  border: var(--k-border-width) solid transparent;
  border-radius: var(--k-radius-pill);
  font-family: var(--k-font-ui);
  font-size: var(--k-fs-body);
  font-weight: var(--k-fw-semibold);
  line-height: var(--k-lh-tight);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.k-btn .k-ic {
  width: 18px;
  height: 18px;
}
.k-btn--lit {
  background: var(--k-lit);
  color: var(--k-night);
}
.k-btn--ghost {
  border-color: var(--k-on-primary-line);
  color: var(--k-on-primary);
}
.k-btn--action {
  background: var(--k-action);
  color: var(--k-on-action);
}

/* ---- Times: a name and a time ------------------------------------------------------------- */
.k-times {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.k-time {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  border-top: var(--k-border-width) solid var(--k-border);
  font-size: var(--k-fs-row);
}
.k-time time {
  font-weight: var(--k-fw-semibold);
  font-variant-numeric: tabular-nums lining-nums;
}
.k-time.is-next time {
  color: var(--k-link);
}

/* ---- Week strip -------------------------------------------------------------------------- */
.k-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  margin: 0 0 var(--k-space-4);
  padding: 0;
  list-style: none;
  text-align: center;
}
.k-week li {
  min-height: 58px;
  padding: 6px 0 7px;
  border: var(--k-border-width) solid transparent;
  border-radius: var(--k-space-2);
  font-size: var(--k-fs-xs);
  line-height: var(--k-lh-snug);
  color: var(--k-on-primary-label);
}
.k-week b {
  display: block;
  margin-top: 2px;
  font-size: var(--k-fs-md);
  font-weight: var(--k-fw-semibold);
  color: var(--k-on-primary);
}
.k-week .k-ic {
  display: block;
  width: 15px;
  height: 15px;
  margin: 2px auto 0;
  color: var(--k-lit);
}
.k-week .k-d1 {
  display: none;
}
.k-week .is-rest {
  background: var(--k-lit-fill-soft);
}
.k-week .is-today {
  border-color: var(--k-on-primary);
}

/* ---- List row: an icon, a title, a note, an arrow ------------------------------------------- */
.k-row {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--k-space-4);
  min-height: 64px;
  padding: 10px 14px;
  border-radius: var(--k-radius-in);
  background: var(--k-surface-alt);
  color: inherit;
  text-decoration: none;
}
.k-row:hover {
  outline: var(--k-border-width) solid var(--k-link);
}
.k-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--k-primary);
  color: var(--k-lit);
}
.k-badge .k-ic {
  width: 20px;
  height: 20px;
}
.k-row-text {
  min-width: 0;
}
.k-row b {
  display: block;
  font-size: var(--k-fs-md);
  font-weight: var(--k-fw-semibold);
  line-height: var(--k-lh-body);
}
.k-row .k-go {
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--k-text-quiet);
}

/* ---- Cover tile: a book ------------------------------------------------------------------- */
.k-book {
  display: block;
  min-height: var(--k-touch);
  color: inherit;
  text-decoration: none;
}
.k-cover {
  position: relative;
  display: block;
  container-type: inline-size;
  aspect-ratio: 640 / 920;
  overflow: hidden;
  border-radius: var(--k-radius-tile);
  background: var(--k-primary);
  box-shadow: var(--k-cover-shadow);
  transition: transform var(--k-ease);
}
.k-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.k-book:hover .k-cover {
  transform: translateY(-3px);
}
.k-cover-title {
  position: absolute;
  inset-inline: 0;
  display: grid;
  place-items: center;
  font-family: var(--k-font-prayer);
  font-size: var(--k-fs-cover);
  font-weight: var(--k-fw-semibold);
  line-height: var(--k-lh-prayer);
  text-align: center;
  color: var(--k-cover-ink);
}
.k-cover-title .k-he {
  display: block;
}
.k-cover-title--top {
  top: 0;
  padding: 8cqw 8cqw 16cqw;
  background: var(--k-cover-fade);
}
.k-cover-title--center,
.k-cover-title--center-dark {
  inset-block: 0;
  padding: 0 22cqw;
}
.k-cover-title--center-dark {
  color: var(--k-primary);
}
.k-cap {
  display: block;
  padding: 10px 2px 0;
  font-family: var(--k-font-ui);
  font-size: var(--k-fs-body);
  font-weight: var(--k-fw-semibold);
  line-height: var(--k-lh-body);
}
.k-cap .k-info {
  font-weight: var(--k-fw-regular);
}

/* ---- Prayer tile: a short prayer ---------------------------------------------------------- */
.k-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  height: 100%;
  min-height: 84px;
  padding: 10px var(--k-space-4);
  border: var(--k-border-width) solid var(--k-border);
  border-radius: var(--k-radius-in);
  background: var(--k-page);
  color: inherit;
  text-decoration: none;
}
.k-chip .k-he {
  font-size: var(--k-fs-3xl);
  line-height: var(--k-lh-prayer);
  text-align: right;
}
.k-chip b {
  font-size: var(--k-fs-body);
  font-weight: var(--k-fw-semibold);
}
.k-chip--primary {
  border-color: var(--k-primary);
  background: var(--k-primary);
  color: var(--k-on-primary);
}
.k-chip--primary .k-info {
  color: var(--k-on-primary-label);
}
.k-chip--more {
  align-items: center;
  flex-direction: row;
  justify-content: center;
  gap: var(--k-space-2);
  border-style: dashed;
  border-color: var(--k-link);
  color: var(--k-link);
  font-size: var(--k-fs-body);
  font-weight: var(--k-fw-semibold);
}
.k-chip--more .k-ic {
  width: 18px;
  height: 18px;
}

/* ---- Countdown ---------------------------------------------------------------------------- */
.k-count {
  margin: auto 0 0;
  font-family: var(--k-font-ui);
  font-size: var(--k-fs-numeral-lg);
  font-weight: var(--k-fw-bold);
  line-height: var(--k-lh-tight);
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums;
}
.k-count-big {
  display: block;
  min-height: 1em;
}
.k-count--words .k-count-big {
  font-size: var(--k-fs-display);
  letter-spacing: -0.01em;
}
.k-count small {
  display: block;
  margin-top: 6px;
  font-size: var(--k-fs-md);
  font-weight: var(--k-fw-medium);
  line-height: var(--k-lh-body);
  letter-spacing: 0;
}

/* ---- Day graphic -------------------------------------------------------------------------- */
.k-dg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.k-dg--narrow {
  display: none;
}
.k-dg-arc {
  fill: none;
  stroke: var(--k-ivory);
  stroke-width: 2.2;
}
.k-dg-done {
  fill: var(--k-lit-fill);
  stroke: none;
}
.k-dg-base {
  stroke: var(--k-on-primary-line);
  stroke-width: 1.5;
}
.k-dg-twilight {
  stroke: var(--k-lit);
  stroke-width: 5;
  stroke-linecap: round;
  opacity: 0.85;
}
.k-dg-noon {
  stroke: var(--k-on-primary-line);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.k-dg-tick {
  stroke: var(--k-on-primary-line);
  stroke-width: 1.2;
}
.k-dg-tick.is-next {
  stroke: var(--k-lit);
  stroke-width: 2.4;
}
.k-dg-name {
  fill: var(--k-on-primary-label);
  font-family: var(--k-font-ui);
  font-size: var(--k-fs-body);
}
.k-dg-time {
  fill: var(--k-on-primary);
  font-family: var(--k-font-ui);
  font-size: var(--k-fs-md);
  font-weight: var(--k-fw-semibold);
  font-variant-numeric: tabular-nums;
}
.k-dg-name.is-next,
.k-dg-time.is-next {
  fill: var(--k-lit);
}
.k-dg-sun circle {
  fill: var(--k-lit);
  stroke: var(--k-ivory);
  stroke-width: 2;
}
.k-dg-sun line {
  stroke: var(--k-lit);
  stroke-width: 1.5;
  stroke-dasharray: 2 3;
}
.k-dg-now {
  fill: var(--k-on-primary);
  font-family: var(--k-font-ui);
  font-size: var(--k-fs-body);
  font-weight: var(--k-fw-semibold);
}
.k-dg.is-ghost .k-dg-arc {
  stroke-dasharray: 5 6;
  opacity: 0.55;
}

@media (max-width: 700px) {
  .k-dg--wide {
    display: none;
  }
  .k-dg--narrow {
    display: block;
  }
}
@media (prefers-reduced-motion: reduce) {
  .k-cover {
    transition: none;
  }
}

/* ---- Basis: the "i" beside a time, and the note it opens ---------------------------------- */
.k-time-at {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.k-i {
  display: inline-grid;
  place-items: center;
  width: var(--k-touch);
  height: var(--k-touch);
  margin: -12px -12px -12px -4px;
  color: var(--k-text-quiet);
  border-radius: 50%;
}
.k-i .k-ic {
  width: 16px;
  height: 16px;
}
.k-card--hero .k-i,
.k-card--art .k-i {
  color: var(--k-on-primary-label);
}
.k-basis-pop {
  position: fixed;
  z-index: 20;
  width: min(280px, calc(100vw - 24px));
  padding: var(--k-space-3) var(--k-space-4);
  border: var(--k-border-width) solid var(--k-border);
  border-radius: var(--k-radius-in);
  background: var(--k-surface);
  color: var(--k-text);
  font-family: var(--k-font-ui);
  font-size: var(--k-fs-body);
  line-height: var(--k-lh-body);
  box-shadow: var(--k-cover-shadow);
}
.k-basis-pop p {
  margin: 0 0 var(--k-space-2);
}
.k-basis-pop .k-basis-change {
  min-height: var(--k-touch);
  padding: 0;
  color: var(--k-link);
  font-weight: var(--k-fw-semibold);
  text-decoration: underline;
}
[data-basis] {
  cursor: help;
}
.k-dg text {
  stroke: none;
}
