/* ==========================================================================
   Orario scolastico
   Usa i token di style.css: funziona con entrambi i temi.
   Ogni materia porta il suo colore in --c (tinta tenue sullo sfondo).
   ========================================================================== */

.orario .or-head .lead a { color: var(--ink); text-decoration-color: var(--ink-4); text-underline-offset: 3px; }
.orario .or-head .lead a:hover { text-decoration-color: var(--ink-2); }

/* --- Adesso / Prossima ora --- */
.or-now {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px;
  margin: 32px 0 28px; padding: 20px 22px;
  background: var(--raised);
}
.or-now-col + .or-now-col { border-left: 1px solid var(--stroke); padding-left: 24px; }
.or-now-k { font-size: 13px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.or-now-v {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px; font-family: var(--font-display); font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2;
}
.or-now-v.muted { color: var(--ink-2); }
.or-now-v a { color: inherit; text-decoration: none; }
.or-now-v a:hover { text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 4px; }
.or-now-m { margin-top: 4px; font-size: 14.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.or-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.or-bar { margin-top: 12px; height: 4px; border-radius: 4px; background: var(--fill-3); overflow: hidden; }
.or-bar i { display: block; height: 100%; background: var(--c); border-radius: inherit; transition: width 0.6s var(--ease); }
@media (max-width: 560px) {
  .or-now { grid-template-columns: 1fr; gap: 16px; }
  .or-now-col + .or-now-col { border-left: 0; padding-left: 0; border-top: 1px solid var(--stroke); padding-top: 16px; }
  .or-now-v { font-size: 21px; }
}

/* --- Griglia settimanale (griglia CSS: righe alte uguali, spazi uguali) --- */
.or-grid-wrap { border-radius: 24px; overflow: hidden; }
.or-grid {
  --gap: 6px;
  display: grid;
  grid-template-columns: 64px repeat(var(--days), minmax(0, 1fr));
  grid-template-rows: auto repeat(var(--hours), 64px);
  gap: var(--gap);
  padding: 10px;
}
.or-corner { grid-column: 1; grid-row: 1; }
.or-gh {
  grid-row: 1; padding: 2px 10px 6px; align-self: end;
  font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.or-gh.today { color: var(--ink); }
.or-gh.today::after {
  content: "oggi"; margin-left: 6px; padding: 2px 7px; border-radius: 999px;
  background: var(--solid); color: var(--on-solid);
  font-size: 10.5px; font-weight: 650; letter-spacing: 0.02em; text-transform: none; vertical-align: 1px;
}
.or-short { display: none; }
.or-time { grid-column: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 4px; font-variant-numeric: tabular-nums; }
.or-time b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.or-time span { display: block; font-size: 12px; color: var(--ink-3); }
/* colonna di oggi: un velo leggero sotto le caselle */
.or-col { border-radius: 16px; pointer-events: none; }
.or-col.today { background: rgba(var(--ink-rgb), 0.04); box-shadow: inset 0 0 0 0.5px var(--card-edge, var(--stroke)); margin: -3px; }
.or-cell {
  position: relative; z-index: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 2px;
  padding: 10px 12px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 28%, transparent), color-mix(in srgb, var(--c) 9%, transparent));
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--c) 35%, transparent), inset 3px 0 0 var(--c);
}
.or-name { font-size: 14.5px; font-weight: 600; line-height: 1.25; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.or-name a { color: inherit; text-decoration: none; }
.or-name a:hover { text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 3px; }
.or-room { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.or-time-btn { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }

@media (max-width: 900px) {
  .or-long { display: none; }
  .or-short { display: inline; }
  .or-grid { --gap: 5px; grid-template-columns: 52px repeat(var(--days), minmax(0, 1fr)); padding: 8px; }
  .or-name { font-size: 13.5px; }
  .or-cell { padding: 8px 9px; }
}

/* --- Elenco del giorno (schermi stretti) --- */
.or-days { display: none; }
.or-seg { display: flex; width: 100%; }
.or-seg button { flex: 1; }
.or-seg button.today:not(.active) { color: var(--ink); }
.or-list { list-style: none; padding: 0; margin: 14px 0 0; max-width: none; display: grid; gap: 8px; }
.or-list li {
  margin: 0; display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r);
  background: var(--fill-2);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  box-shadow: inset 3px 0 0 var(--c);
}
.or-li-t { font-variant-numeric: tabular-nums; }
.or-li-t b { display: block; font-size: 15px; color: var(--ink); font-weight: 600; }
.or-li-t span { display: block; font-size: 12.5px; color: var(--ink-3); }
.or-li-n { font-weight: 600; color: var(--ink); line-height: 1.3; }
.or-li-n a { color: inherit; text-decoration: none; }
.or-li-n small { display: block; font-size: 13px; font-weight: 400; color: var(--ink-3); margin-top: 2px; }

@media (max-width: 699px) {
  .or-grid-wrap { display: none; }
  .or-days { display: block; }
}

.or-note { margin-top: 20px; font-size: 13.5px; color: var(--ink-3); }

/* --- Comparsa --- */
.orario .or-in { animation: orIn 0.5s var(--ease) both; }
.orario .or-in:nth-child(2) { animation-delay: 0.05s; }
.orario .or-in:nth-child(3) { animation-delay: 0.1s; }
.orario .or-in:nth-child(4) { animation-delay: 0.15s; }
@keyframes orIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .orario .or-in { animation: none; }
  .or-bar i { transition: none; }
}
.or-edit-cell.or-free { justify-content: center; }
