/* Расписание уроков и годовая сетка учебного графика.
   Цвет помечает область предмета, а не отдельный предмет: так таблица остаётся
   спокойной. Значение не передаётся одним цветом — предмет всегда подписан. */

.timetable-block {
  margin-top: 26px;
}

.timetable {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
}

.timetable thead th {
  background: var(--paper);
  font-size: 12px;
  font-weight: 600;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.timetable tbody th {
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  width: 48px;
  min-width: 48px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: center;
}

.timetable td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  vertical-align: top;
  min-width: 132px;
}

.timetable tbody tr:last-child > * {
  border-bottom: 0;
}

.subject-name {
  display: block;
  font-size: 14px;
}

.subject-room {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

/* Приглушённые заливки: тёмный текст сохраняет контраст выше 12:1. */
.subject-lang { background: #f6e1d9; }
.subject-foreign { background: #e4e1f2; }
.subject-exact { background: #d9e6f2; }
.subject-science { background: #dcebdb; }
.subject-social { background: #f7e9c9; }
.subject-faith { background: #efdce9; }
.subject-art { background: #e8ebcf; }
.subject-active { background: #d9e8e6; }
.subject-other { background: #efeae2; }

/* Годовой учебный график */
.year-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 26px 30px;
  margin: 26px 0 0;
}

.year-month h3 {
  font-size: 17px;
  margin: 0 0 10px;
  font-weight: 600;
}

.year-month table {
  border-collapse: collapse;
  width: 100%;
  font: 13px/1 Arial, sans-serif;
}

.year-month th {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  padding: 0 0 7px;
  text-align: center;
}

.year-month td {
  padding: 0;
  text-align: center;
}

.year-day {
  display: block;
  padding: 6px 0;
  border: 1px solid transparent;
}

.year-day-weekend { color: var(--muted); }
.year-day-vacation { background: #d7e9d4; border-color: #b6d3b2; }
.year-day-holiday { background: #f7ddcf; border-color: #e3bfa9; }

.year-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.year-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.year-legend span {
  width: 15px;
  height: 15px;
  border: 1px solid var(--line);
  flex: none;
}

.calendar-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.calendar-download small {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 700px) {
  .timetable td { min-width: 118px; }
  .year-calendar { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px; }
}

/* Контрастные темы читают текст, а не заливку: фон снимается полностью. */
.reading-applied:is([data-reading-theme="white"], [data-reading-theme="black"])
  :where(.timetable td, .year-day, .year-legend span) {
  background: transparent;
  border-color: currentColor;
}

.reading-applied :where(.subject-room) {
  font-size: calc(12px * var(--reading-scale, 1));
  color: inherit;
}

.year-periods {
  border-collapse: collapse;
  width: 100%;
  margin: 18px 0 4px;
  font-size: 15px;
  text-align: left;
}

.year-periods :is(th, td) {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.year-periods thead th {
  background: var(--paper);
  font-size: 12px;
  font-weight: 600;
}

.year-periods tbody th {
  font-weight: 400;
}
