/* Tunniplaan — staatiline HTML */
:root {
  --color-border: #d4d4d4;
  --color-border-strong: #999;
  --color-bg: #ffffff;
  --color-bg-alt: #f7f7f5;
  --color-bg-header: #f0efe9;
  --color-text: #222;
  --color-text-muted: #666;
  --color-break: #e8e4d4;
  --color-accent: #5a7a9a;
  --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.4;
  padding: 1rem;
}
.container { max-width: 1400px; margin: 0 auto; }
header.page-header {
  border-bottom: 2px solid var(--color-text);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
header.page-header h1 { font-size: 1.4rem; margin: 0; font-weight: 600; }
header.page-header .back-link {
  font-size: 0.9rem;
  color: var(--color-accent);
  text-decoration: none;
}
header.page-header .back-link:hover { text-decoration: underline; }
.print-btn {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: 0.3rem 0.7rem;
  font-family: inherit; font-size: 0.85rem;
  cursor: pointer; border-radius: 3px;
  color: var(--color-text);
}
.print-btn:hover { background: #ececec; }

.nav-group {
  margin-bottom: 0.5rem; padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border);
}
.nav-group h2 {
  font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--color-text-muted);
  margin: 0 0 0.3rem 0; font-weight: 600;
}
.nav-list { display: flex; flex-wrap: wrap; gap: 0.1rem 0.3rem; }
.nav-list a {
  background: transparent;
  padding: 0.15rem 0.45rem;
  font-size: 0.88rem;
  color: var(--color-accent);
  border-radius: 2px; white-space: nowrap;
  text-decoration: none;
}
.nav-list a:hover { background: var(--color-bg-alt); text-decoration: underline; }

.timetable-section { margin-top: 1.2rem; }
.timetable-title { font-size: 1.2rem; font-weight: 600; margin: 0 0 0.2rem 0; }
.timetable-subtitle { font-size: 0.85rem; color: var(--color-text-muted); margin: 0 0 0.6rem 0; }

table.timetable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.75rem;
}
table.timetable th, table.timetable td {
  border: 1px solid var(--color-border);
  padding: 0.2rem;
  vertical-align: top;
  text-align: center;
}
table.timetable thead th {
  background: var(--color-bg-header);
  font-weight: 500; font-size: 0.7rem;
  padding: 0.3rem 0.2rem;
}
table.timetable thead tr.long-times th { font-weight: 600; }
table.timetable thead tr.short-times th {
  font-weight: 400;
  color: var(--color-text-muted);
  border-top: 1px dashed var(--color-border);
}
table.timetable td.day-cell, table.timetable th.day-cell {
  background: var(--color-bg-header);
  font-weight: 600; width: 80px;
  text-align: left; padding-left: 0.4rem;
  vertical-align: middle;
}
.day-short { font-size: 1.1rem; display: inline-block; margin-right: 0.4rem; }
.day-long { font-size: 0.72rem; color: var(--color-text-muted); }

.lesson {
  padding: 0.3rem 0.25rem;
  border-radius: 2px;
  min-height: 48px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  font-size: 0.72rem;
  background: #f5f5f5;
  color: #222;
}
.lesson.text-light { color: #fff; }
.lesson.text-light .meta-line { color: rgba(255,255,255,0.85); }
.lesson .subject { font-weight: 600; font-size: 0.88rem; line-height: 1.15; }
.lesson .meta-line { color: rgba(0,0,0,0.65); font-size: 0.7rem; margin-top: 0.1rem; line-height: 1.2; }
.lesson a { color: inherit; text-decoration: none; }
.lesson a:hover { text-decoration: underline; }
td.has-lesson { padding: 1px; }

td.break-cell, th.break-cell {
  background: var(--color-break);
  color: var(--color-text-muted);
  font-size: 0.75rem; font-style: italic;
  vertical-align: middle;
}

.empty-state {
  text-align: center; padding: 2.5rem 1rem;
  color: var(--color-text-muted);
}

@media print {
  .nav-group, .print-hide, .print-btn { display: none !important; }
  header.page-header .back-link { display: none; }
  body { padding: 0; font-size: 10px; }
  table.timetable { font-size: 0.65rem; }
  .timetable-section { page-break-inside: avoid; }
}
@media (max-width: 768px) {
  body { padding: 0.5rem; font-size: 13px; }
  table.timetable { font-size: 0.65rem; }
  header.page-header h1 { font-size: 1.1rem; }
}

/* Asendused */
.subst-box {
  border-left: 4px solid #c0392b;
  background: #fdf3f2;
  padding: 0.6rem 0.8rem;
  margin: 0 0 1rem 0;
  font-size: 0.85rem;
}
.subst-box h3 { margin: 0 0 0.4rem 0; font-size: 0.95rem; color: #c0392b; }
.subst-box ul { margin: 0; padding-left: 1.1rem; }
.subst-box li { margin-bottom: 0.2rem; }
.subst-date { color: var(--color-text-muted); font-weight: 400; }

table.timetable td.has-lesson { position: relative; }
.subst-mark {
  position: absolute; top: 1px; right: 2px;
  font-weight: 700; font-size: 0.8rem; line-height: 1;
  color: #c0392b;
}
td.subst-change, td.subst-absent { box-shadow: inset 0 -3px 0 #c0392b; }
td.subst-remove { box-shadow: inset 0 -3px 0 #7f8c8d; }
td.subst-add { box-shadow: inset 0 -3px 0 #27ae60; }
td.subst-event { box-shadow: inset 0 -3px 0 #8e44ad; }

@media print {
  .subst-box { border-left-color: #000; background: #f0f0f0; }
  .subst-mark { color: #000; }
}
