/* ==========================================================================
   Lesson Calendar — reskinned to match the TEKS & ELPS Explorer
   (eslparatodos.com): cream page, deep teal ink, coral action accent,
   Playfair Display headings, Source Sans 3 body.
   Layout is identical to the original styles.css; only tokens, fonts and
   a few hardcoded tints changed. Dot/chip classes carry an lc- prefix so
   they can coexist with the Explorer's own .dot/.chips styles.
   ========================================================================== */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* --------------------------------------------------------------- calendar */

.calendar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}

.cal-title {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cal-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* prev / next pair -------------------------------------------------------- */

.nav-pair {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  overflow: hidden;
}

.nav-divider {
  width: 1px;
  background: var(--border);
}

.nav-btn,
.menu-btn {
  appearance: none;
  background: var(--card-bg);
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.nav-btn {
  width: 40px;
  height: 38px;
  display: grid;
  place-items: center;
}

.nav-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-btn {
  height: 38px;
  min-width: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 1;
  color: var(--muted);
}

.nav-btn:hover,
.menu-btn:hover { background: var(--chip-bg); color: var(--navy); }

.nav-btn:disabled {
  color: #C3D2D2;
  cursor: default;
}

.nav-btn:disabled:hover { background: var(--card-bg); }

.nav-btn:focus-visible,
.menu-btn:focus-visible,
.menu button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: -2px;
}

/* ••• dropdown ------------------------------------------------------------ */

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 180px;
  padding: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(4, 78, 79, 0.16);
}

.menu[hidden] { display: none; }

.menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.menu button:hover { background: var(--chip-bg); }

/* weekday header row ------------------------------------------------------ */

.weekdays,
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.weekdays span {
  padding: 12px 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.weekdays span:nth-child(7n) { border-right: 0; }

/* day grid ---------------------------------------------------------------- */

.row { display: contents; }

.day {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: var(--cell-min-h);
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.day:nth-child(7n) { border-right: 0; }
.grid .row:last-child .day { border-bottom: 0; }

.day:hover { background: #FDFAF0; }

.day:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: -2px;
}

/* date number plus optional nine-weeks brackets */
.num-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.mark {
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.day.is-adjacent .mark { color: var(--adjacent-text); }

/* the number, in its own circle-sized box so no state changes cell metrics */
.day-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* adjacent month */
.day.is-adjacent { background: var(--adjacent-bg); }
.day.is-adjacent:hover { background: #E7EBE7; }

/* dates outside the displayed range (before Aug 2026 / after May 2027) */
.day:disabled { cursor: default; }
.day:disabled:hover { background: var(--adjacent-bg); }
.day.is-adjacent .day-num { color: var(--adjacent-text); }

/* today: coral number, no fill */
.day.is-today .day-num {
  color: var(--purple);
  font-weight: 700;
}

/* selected: white number in a filled teal circle (wins over today) */
.day.is-selected .day-num {
  background: var(--navy);
  color: #FFFFFF;
  font-weight: 600;
}

/* nine-weeks marker dates always show the filled teal circle */
.day.has-mark .day-num {
  background: var(--navy);
  color: #FFFFFF;
  font-weight: 600;
}

/* district calendar days: tinted cell backgrounds (these rules come after
   the hover/adjacent rules on purpose, so the tint always shows) */
.day.ev-blue   { background: var(--ev-blue-bg); }
.day.ev-yellow { background: var(--ev-yellow-bg); }
.day.ev-purple { background: var(--ev-purple-bg); }
.day.ev-red    { background: var(--ev-red-bg); }
.day.ev-green  { background: var(--ev-green-bg); }

/* content dots — the row is always present so cell height never shifts */
.lc-dots {
  display: flex;
  gap: 4px;
  height: 6px;
  min-height: 6px;
}

.lc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-light);
}

.day.is-selected .lc-dot { background: var(--navy); }

/* ----------------------------------------------------------- detail panel */

.detail {
  margin-top: 20px;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.detail-date {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 19px;
  font-weight: 700;
}

.detail-weekday {
  color: var(--muted);
  font-size: 14px;
}

.event-badge {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.mark-badge {
  padding: 2px 10px;
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
}

.event-badge.ev-blue   { background: var(--ev-blue);   color: #FFFFFF; }
.event-badge.ev-yellow { background: var(--ev-yellow); color: #1a2a2a; }
.event-badge.ev-purple { background: var(--ev-purple); color: #FFFFFF; }
.event-badge.ev-red    { background: var(--ev-red);    color: #FFFFFF; }
.event-badge.ev-green  { background: var(--ev-green);  color: #1a2a2a; }

.entry { padding: 20px 0 4px; }
.entry + .entry { border-top: 1px solid var(--border); }

.entry-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}

/* two columns on desktop: TEKS next to the slide-deck button, the longer
   fields full width below */
.entry-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "teks deck"
    "lo lo"
    "lang lang"
    "criteria criteria"
    "dol dol";
  gap: 18px 24px;
  align-items: start;
}

.field { min-width: 0; }

.field-teks     { grid-area: teks; }
.field-deck     { grid-area: deck; }
.field-lo       { grid-area: lo; }
.field-lang     { grid-area: lang; }
.field-criteria { grid-area: criteria; }
.field-dol      { grid-area: dol; }

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* inline svg icons */
.f-icon, .check-icon, .btn-icon { display: inline-flex; flex: none; }

.f-icon svg, .check-icon svg, .btn-icon svg, .empty-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.f-icon {
  width: 15px;
  height: 15px;
  color: var(--muted-light);
}

.lc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lc-chip {
  padding: 4px 8px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--navy);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
}

.criteria {
  margin: 0;
  padding: 0;
  list-style: none;
}

.criteria li {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.criteria li:last-child { margin-bottom: 0; }

.check-icon {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  color: var(--navy);
}

/* the DOL prompt reads as a callout */
.field-dol .dol {
  margin: 0;
  padding: 12px 16px;
  background: #FDF3E4;
  border-left: 3px solid var(--purple);
  border-radius: 4px 10px 10px 4px;
}

/* the slide deck is the main student action — make it a real button */
.deck-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--purple);
  border-radius: 10px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.deck-btn:hover { background: #D14B38; }

.deck-btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 40px 0 24px;
  color: var(--muted);
}

.empty p { margin: 0; }

.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--chip-bg);
  color: var(--muted-light);
}

.empty-icon svg {
  width: 22px;
  height: 22px;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 720px) {
  :root { --cell-min-h: 72px; }

  .page { padding: 16px 12px 40px; }
  .cal-header { padding: 14px 16px; }
  .cal-title { font-size: 18px; }
  .day { padding: 8px 6px; align-items: center; }
  .detail { padding: 18px; }

  .entry-fields {
    grid-template-columns: 1fr;
    grid-template-areas: "teks" "lo" "lang" "criteria" "dol" "deck";
  }
}

@media print {
  body { background: #fff; }
  .cal-controls { display: none; }
  .calendar, .detail { border-color: #ccc; }
}

/* ------------------------------------------------------------------ footer */

/* base footer styles live in site.css; the calendar page adds spacing */
footer { margin-top: 32px; }

/* ---------------------------------------------------------------- A/B days */

.day { position: relative; }

.ab-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* shared A / B / ACP tints — used by the cell badge and the detail chip */
.ab-a   { background: var(--chip-bg); color: var(--navy); }
.ab-b   { background: #FDEDE9; color: #C24A38; }
.ab-acp { background: #FDF1DC; color: #8A6A2E; }

.ab-chip {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .ab-badge {
    bottom: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    font-size: 9px;
  }
}

/* Lesson dots are turned off — the A/B badge already marks school days.
   The dot machinery in calendar.js still runs, so deleting this one rule
   brings the dots back (e.g., for spring, when lessons may lag badges). */
.lc-dots { display: none; }

/* -------------------------------------------------- IPC lesson fields */

/* learning / language objective paragraphs */
.objective { margin: 0; }

/* bundled standards: same chip, quieter */
.lc-chip-bundled {
  background: #FFFFFF;
  border-style: dashed;
  color: var(--muted-light);
}

/* extra per-day resource links under the deck button */
.entry-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
}

.entry-link {
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.entry-link:hover { border-bottom-color: var(--navy); }

/* TEKS tooltip — standard text pulled live from the Standards page */
.lc-chip { cursor: help; }

#tekTip {
  display: none;
  position: fixed;
  z-index: 99;
  max-width: 340px;
  background: var(--navy);
  color: #FFF8EC;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(4, 78, 79, 0.3);
}

#tekTip strong { color: #F4E4C1; }
