/* District calendar pages (/calendars/...), generated by
   content-engine/districts/build.mjs. Builds on blog.css; only what the
   calendar pages add lives here. */

.cal-figure > a {
  display: block;
}

.article .cal-figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--kf-line);
  border-radius: var(--kf-radius-card);
  background: var(--kf-surface);
}

.cal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.article .cal-links a.button-quiet {
  color: var(--kf-ink);
}

/* The converter callout: the most prominent link on the page after the
   district's own calendar. */
.cal-tool {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: var(--kf-space-three);
  background: var(--kf-manilaTint);
  border: 1px solid var(--kf-line);
  border-radius: var(--kf-radius-card);
}

.cal-tool > div {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-tool strong {
  font-size: var(--kf-font-size-body);
  font-weight: 800;
  color: var(--kf-ink);
}

.cal-tool span {
  font-size: var(--kf-font-size-small);
  font-weight: 600;
  line-height: 1.5;
  color: var(--kf-slate);
}

.article .cal-tool a.button,
.cal-hub .cal-tool a.button {
  color: var(--kf-surface);
}

.article #add .file-row + .file-row {
  margin-top: -4px;
}

.kind-staff {
  background: var(--kf-cloud);
  color: var(--kf-slate);
  border: 1px solid var(--kf-line);
}

.article td .kind {
  margin-left: 6px;
  font-size: 12px;
  padding: 2px 8px;
}

.cal-cites {
  background: var(--kf-cloud);
  border: 1px solid var(--kf-line);
  border-radius: var(--kf-radius-card);
  padding: 15px 18px;
}

.cal-cites summary {
  font-weight: 700;
  color: var(--kf-ink);
  cursor: pointer;
}

.article .cal-cites ul {
  margin-top: 12px;
}

.article .cal-cites li {
  font-size: var(--kf-font-size-small);
  line-height: 1.5;
}

/* Hub: sections of district cards by state. */
.cal-hub {
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding-bottom: 60px;
}

.cal-hub section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cal-hub h2 {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 800;
  color: var(--kf-ink);
}

.cal-hub .promo h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--kf-ink);
}

.cal-hub .promo p {
  margin: 0;
  line-height: 1.6;
  color: var(--kf-ink);
}

.cal-hub a.card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: var(--kf-space-three);
  border: 1px solid var(--kf-line);
  border-radius: var(--kf-radius-card);
  text-decoration: none;
}

/* Short dates never break across lines. */
.article #holidays td:nth-child(2),
.article #early-release td:first-child,
.article #notes td:first-child,
.article #grading td:nth-child(2),
.article #grading td:nth-child(4),
.article #observances td:first-child {
  white-space: nowrap;
}

/* A day or half day that depends on something (snow days used, a school's
   choice): the condition sits under its name in the table. */
.article td .cal-cond {
  display: block;
  margin-top: 2px;
  font-size: var(--kf-font-size-small);
  font-weight: 600;
  color: var(--kf-slate);
}

/* A three-column table with short cells fits a phone: no inner scroll, the
   last column wraps. */
.article table.cal-fit {
  min-width: 0;
}

/* A page published from part of the district's calendar: what is out, what
   is still to come, and when the page will be updated. */
.cal-pending {
  margin: var(--kf-space-three) 0 0;
  padding: var(--kf-space-three);
  background: var(--kf-skyTint);
  border: 1px solid var(--kf-skyEdge);
  border-left: 4px solid var(--kf-blue);
  border-radius: var(--kf-radius-card);
}

.cal-pending strong {
  display: block;
  color: var(--kf-ink);
  font-size: 1.05rem;
}

.cal-pending p {
  margin: 6px 0 0;
  line-height: 1.55;
  color: var(--kf-ink);
}

.cal-pending span {
  font-weight: 700;
}

/* ---- One page per district, every level (owner, 2026-10-03) ----
   A district with separate calendars by school level: the levels at a
   glance (summary, chart, tables), then each level's own sections. */

.cal-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Comparison tables: a row heading per line, one column per level. */
.article table.cal-compare tbody th {
  background: var(--kf-cloud);
  color: var(--kf-ink);
  font-size: 15px;
  font-weight: 800;
  vertical-align: top;
  border-bottom: 1px solid var(--kf-line);
  padding: 11px 14px;
}

.article table.cal-compare tr:last-child th {
  border-bottom: 0;
}

.article table.cal-compare td:first-child {
  font-weight: 600;
  color: var(--kf-slate);
}

.article table.cal-diff tbody th {
  white-space: nowrap;
}

.article table.cal-compare th .cal-cond {
  display: block;
  margin-top: 2px;
  font-size: var(--kf-font-size-small);
  font-weight: 600;
  color: var(--kf-slate);
}

.cal-st {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.cal-st-off {
  background: var(--kf-errorLight);
  color: var(--kf-member-coral-text);
}

.cal-st-early {
  background: var(--kf-manilaTint);
  color: var(--kf-manilaWord);
}

.cal-st-remote {
  background: var(--kf-skyTint);
  color: var(--kf-member-sky-text);
}

.cal-st-school {
  padding-left: 0;
  font-weight: 700;
  color: var(--kf-steel);
}

/* The chart: one bar per level across the school year. */
.cal-tl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--kf-space-three);
  background: var(--kf-surface);
  border: 1px solid var(--kf-line);
  border-radius: var(--kf-radius-card);
}

.cal-tl figcaption {
  font-size: var(--kf-font-size-small);
  font-weight: 600;
  line-height: 1.5;
  color: var(--kf-slate);
}

.cal-tl-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-tl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.cal-tl-name {
  flex: 0 0 100%;
  font-size: var(--kf-font-size-small);
  font-weight: 800;
  color: var(--kf-ink);
}

.cal-tl-track,
.cal-tl-axis {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.cal-tl-track {
  height: 30px;
  background: var(--kf-cloud);
  border-radius: 6px;
}

.cal-tl-track > span {
  position: absolute;
  top: 0;
  bottom: 0;
}

.cal-tl-grid {
  width: 1px;
  background: var(--kf-line);
}

.cal-tl-year {
  top: 3px !important;
  bottom: 3px !important;
  background: var(--kf-skyTint);
  border: 1px solid var(--kf-skyEdge);
  border-radius: 4px;
}

.cal-tl-all,
.cal-tl-only,
.cal-tl-er {
  width: max(var(--cal-tl-day), 3px);
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--kf-surface);
}

.cal-tl-all {
  background: var(--kf-member-slate-deep);
}

.cal-tl-only {
  background: var(--kf-error);
}

.cal-tl-er {
  top: 50% !important;
  background: var(--kf-ink);
}

.cal-tl-axisrow .cal-tl-name {
  display: none;
}

.cal-tl-axis {
  height: 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--kf-steel);
}

.cal-tl-axis > span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.cal-tl-long {
  display: none;
}

.cal-tl-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article .cal-tl-key li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--kf-font-size-small);
  font-weight: 700;
  line-height: 1.4;
  color: var(--kf-slate);
}

.cal-tl-sw {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.cal-tl-sw-year {
  background: var(--kf-skyTint);
  border: 1px solid var(--kf-skyEdge);
}

.cal-tl-sw-all {
  background: var(--kf-member-slate-deep);
}

.cal-tl-sw-only {
  background: var(--kf-error);
}

.cal-tl-sw-er {
  height: 7px;
  margin-top: 7px;
  background: var(--kf-ink);
}

@media (min-width: 600px) {
  .cal-tl-name {
    flex: 0 0 104px;
  }

  .cal-tl-axisrow .cal-tl-name {
    display: block;
  }

  .cal-tl-long {
    display: inline;
  }

  .cal-tl-short {
    display: none;
  }
}

/* Each level: a heading band with links to its sections. */
.cal-level {
  padding-top: var(--kf-space-three);
  border-top: 3px solid var(--kf-skyEdge);
}

.article .cal-level > section {
  gap: 14px;
}

.cal-level-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-level-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article .cal-level-nav a {
  padding: 5px 12px;
  border: 1px solid var(--kf-skyEdge);
  border-radius: 999px;
  background: var(--kf-skyTint);
  font-size: var(--kf-font-size-small);
  font-weight: 700;
  color: var(--kf-ink);
  text-decoration: none;
}

.article .cal-level h3 {
  font-size: 23px;
}

.article .cal-level h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--kf-ink);
}

.article .cal-sec-add .file-row + .file-row {
  margin-top: -4px;
}

.article .cal-sec-holidays td:nth-child(2),
.article .cal-sec-early td:first-child,
.article .cal-sec-notes td:first-child,
.article .cal-sec-grading td:nth-child(2),
.article .cal-sec-grading td:nth-child(4),
.article .cal-sec-observances td:first-child {
  white-space: nowrap;
}

/* On a phone the comparison tables become a grid: each row's heading spans
   the width, the levels sit side by side under it, so nothing scrolls. */
@media (max-width: 599px) {
  .article table.cal-compare,
  .article table.cal-compare thead,
  .article table.cal-compare tbody {
    display: block;
    min-width: 0;
  }

  .article table.cal-compare tr {
    display: grid;
    grid-template-columns: repeat(var(--cal-n, 2), minmax(0, 1fr));
  }

  .article table.cal-compare thead th:first-child {
    display: none;
  }

  .article table.cal-compare th,
  .article table.cal-compare td {
    padding: 8px 10px;
    font-size: 14px;
    overflow-wrap: break-word;
  }

  .article table.cal-compare tbody th {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .article table.cal-compare tr:last-child td {
    border-bottom: 0;
  }

  .article table.cal-compare tr:not(:last-child) td {
    border-bottom: 1px solid var(--kf-line);
  }

  .article table.cal-diff tbody th .cal-cond {
    display: inline;
    margin-left: 6px;
  }
}
