/* Class schedule page: weekly timetable and events calendar (builds on public.css tokens). */
.sch-card { margin-top: 16px; }
.sch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.sch-bar h2 { flex: 1 1 auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sch-help { margin: 10px 0 0; }
.empty { padding: 28px 12px; text-align: center; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; }

/* weekly grid (wide screens) */
.week-grid { display: grid; gap: 0; position: relative; }
.week-head { font-weight: 600; font-size: 14px; text-align: center; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.week-axis { position: relative; font-size: 12px; color: var(--muted); }
.week-axis span { position: absolute; right: 8px; transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.week-col { position: relative; border-left: 1px solid var(--line); }
.week-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.slot { position: absolute; border-radius: 8px; padding: 5px 7px; overflow: hidden; cursor: pointer; font-size: 12.5px; line-height: 1.25;
  background: color-mix(in srgb, var(--k) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--k) 45%, transparent);
  border-left: 4px solid var(--k); color: var(--ink); text-align: left; font-family: inherit; margin: 0 2px; }
.slot:hover, .slot:focus-visible, .slot.on { background: color-mix(in srgb, var(--k) 28%, var(--surface)); z-index: 2; }
.slot b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot small { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.slot .subj { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* agenda (phones) */
.week-list { display: none; }
.week-list h3 { font-size: 15px; margin: 14px 0 6px; }
.week-list h3:first-child { margin-top: 0; }
.agenda-item { display: grid; grid-template-columns: 4px 1fr; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.agenda-item + .agenda-item { margin-top: 8px; }
.agenda-item .bar { border-radius: 4px; background: var(--k); }
.agenda-item b { display: block; }
.agenda-item .meta { color: var(--ink-2); font-size: 14px; }
@media (max-width: 760px) { .week-grid { display: none; } .week-list { display: block; } }

/* tooltip */
.tip { position: fixed; z-index: 60; max-width: 300px; background: var(--surface); color: var(--ink); border: 1px solid var(--ring); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); padding: 10px 12px; font-size: 14px; pointer-events: none; }
.tip b { display: block; margin-bottom: 2px; }
.tip .row { color: var(--ink-2); }
.tip .row + .row { margin-top: 2px; }

/* month calendar */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-nav h3 { flex: 1; text-align: center; font-size: 17px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal .dow { font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: center; padding: 6px 2px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 92px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; border-top: 0; border-left: 0; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.out { background: var(--surface-2); color: var(--muted); }
.cal .day.today .n { background: var(--brand); color: var(--brand-ink); border-radius: 999px; }
.cal .day.sel { outline: 2px solid var(--focus); outline-offset: -2px; }
.cal .n { font-size: 12px; font-weight: 600; width: 22px; height: 22px; display: grid; place-items: center; }
.chip-ev { font-size: 11.5px; line-height: 1.25; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-radius: 4px; padding: 2px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-ev { font-size: 11px; color: var(--ink-2); }
/* GLP celebrations and events: green, bold; national days and Qatar holidays: grey background, muted text */
.chip-ev.glp { background: var(--e-glp-bg); font-weight: 600; }
.chip-ev.quiet { background: var(--e-quiet-bg); color: var(--muted); }
.ev-list li.glp .what b { color: var(--e-glp); }
.ev-list li.quiet { background: var(--e-quiet-bg); border-radius: 6px; padding-left: 6px; padding-right: 6px; }
.ev-list li.quiet .what b { font-weight: 500; color: var(--ink-2); }
.ev-list li.quiet .when, .ev-list li.quiet .what span { color: var(--muted); }
.ev-list li + li.quiet, .ev-list li.quiet + li { border-top-color: transparent; }
.cal-day .ev-quiet { color: var(--muted); }
/* the place of a GLP celebration / event and its map buttons */
.ev-place { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.ev-place .ev-loc { color: var(--ink); font-size: 14px; white-space: normal !important; }
.ev-place .ev-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-place .btn { text-decoration: none; }
@media print { .ev-nav { display: none !important; } }
.dots { display: none; gap: 3px; flex-wrap: wrap; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cal-day { margin-top: 10px; }
.cal-day:empty { display: none; }
.cal-day .card-in { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.pub .list-h { font-size: 15px; margin: 22px 0 8px; }   /* .pub: stronger than ".pub h3 { margin: 0 }" (public.css) */
.ev-list { list-style: none; margin: 0; padding: 0; }
.ev-list li { display: grid; grid-template-columns: 4px minmax(110px, 160px) 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.ev-list li:first-child { border-top: 0; }
.ev-list .bar { border-radius: 4px; background: var(--c); }
.ev-list .when { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; white-space: pre-line; }
.ev-list .what b { display: block; font-weight: 600; }
.ev-list .what span { color: var(--ink-2); font-size: 14px; white-space: pre-line; }
.ev-list li.past { opacity: .6; }
@media (max-width: 640px) {
  .cal .day { min-height: 54px; }
  .chip-ev, .more-ev { display: none; }
  .dots { display: flex; }
  .ev-list li { grid-template-columns: 4px 1fr; }
  .ev-list .bar { grid-row: span 2; }
  .ev-list .when { grid-column: 2; }
  .ev-list .what { grid-column: 2; }
}
.print-head { display: none; }
.print-all { float: right; margin-top: -44px; }
@media (max-width: 640px) { .print-all { float: none; margin: 10px 0 0; } }

@media print {
  @page { margin: 12mm; }
  /* always light colours on paper, whatever the screen theme */
  :root, :root[data-theme="dark"] {
    --page: #fff; --surface: #fff; --surface-2: #f2f4f7; --ink: #111; --ink-2: #333; --muted: #555; --line: #ccd3db; --ring: #b8c1cc;
    --brand: #0d5eaf; --brand-ink: #fff; --brand-soft: #e3eefa; --k-early: #c2410c; --k-primary: #0d5eaf; --k-levels: #0f766e; --k-adult: #7e22ce;
    --e-national: #8d97a5; --e-glp: #15803d; --e-holiday: #a7aeb8; --e-quiet-bg: #f1f3f6; --e-glp-bg: #e3f4e8; color-scheme: light;
  }
  body.pub { background: #fff; font-size: 11pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pub-top, .pub-foot, .print-btn, .cal-nav, .cal, .cal-day, .tip, .pub-main > p.hint, .sch-top .lead, .teg-preview-banner, .teg-theme-toggle { display: none !important; }
  .pub-main { max-width: none; padding: 0; }
  .print-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid var(--brand); padding-bottom: 8px; margin-bottom: 12px; }
  .print-head img { width: 64px; height: 64px; object-fit: contain; }
  .print-head b { display: block; font-size: 13pt; }
  .print-head span { color: var(--ink-2); }
  .sch-top h1 { font-size: 18pt; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .sch-card { margin-top: 10px; }
  body[data-print="week"] #events, body[data-print="events"] #week-card { display: none !important; }
  body[data-print="events"] .sch-top h1 { display: none; }
  body[data-print="all"] #events { break-before: page; }
  .week-grid { display: grid !important; }
  .week-list { display: none !important; }
  .slot { break-inside: avoid; }
  .list-h { margin-top: 6px; }
  .ev-list li { break-inside: avoid; grid-template-columns: 4px 150px 1fr; }
  .ev-list li.past { opacity: 1; }
  .ev-list .bar { grid-row: auto; }
}

/* volunteer activities of an event (Contribute) */
.help-ev { display: inline-block; margin-top: 6px; }
.ev-list .what .help-ev { display: table; }

/* a signed-in guardian: only their learners' classes */
.sch-mine { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--info-bg, #eef4ff); font-size: 15px; }
.sch-mine a { font-weight: 600; white-space: nowrap; }
@media print { .sch-mine { display: none !important; } }

/* a signed-in guardian: only their learners' classes */
.sch-mine { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--info-bg, #eef4ff); font-size: 15px; }
.sch-mine a { font-weight: 600; white-space: nowrap; }
@media print { .sch-mine { display: none !important; } }

/* "Public" volunteer activities */
.vol-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.vol-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--ring); border-radius: 10px; }
.vol-list li .hint { grid-column: 1; font-size: 14px; }
.vol-list li .btn { grid-column: 2; grid-row: 1 / span 2; }
@media (max-width: 560px) { .vol-list li { grid-template-columns: 1fr; } .vol-list li .btn { grid-column: 1; grid-row: auto; justify-self: start; } }
@media print { #volunteer { display: none !important; } }
/* volunteers needed: marker on the calendar day (opens Contribute for the event) */
.help-mark { align-self: flex-start; margin-top: auto; font-size: 12px; font-weight: 700; line-height: 1; padding: 3px 7px; border-radius: 999px;
  background: #d03b3b; color: #fff; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.help-mark:hover { filter: brightness(1.08); }
.cal .day.needs-help { box-shadow: inset 0 0 0 2px color-mix(in srgb, #d03b3b 45%, transparent); }
.help-legend { font-weight: 600; }
@media (max-width: 760px) { .help-mark { font-size: 11px; padding: 2px 5px; } }
@media print { .help-mark, .help-legend { display: none !important; } }
/* the event's flyer (migration 032): a button next to the place and Volunteer, the picture in a viewer */
.ev-flyer { display: inline-block; margin: 6px 6px 0 0; }
.ev-list .what .ev-flyer { display: table; }
.ev-flyer-dlg { max-width: min(92vw, 900px); max-height: 92vh; padding: 12px; border: 1px solid var(--line, #d8dee6); border-radius: 12px; }
.ev-flyer-dlg::backdrop { background: rgba(15, 23, 42, .6); }
.ev-flyer-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ev-flyer-h b { flex: 1; }
.ev-flyer-dlg img { display: block; max-width: 100%; max-height: calc(92vh - 80px); margin: 0 auto; object-fit: contain; }
@media print { .ev-flyer { display: none !important; } }

/* one menu entry opens this page: a jump to the events part */
.sch-jump { display: inline-block; margin-left: 6px; font-weight: 600; white-space: nowrap; }
#events { scroll-margin-top: 12px; }
