/* Academic Calendar page. The hero banner comes from about.css (same as the other inner pages).
   Every class here starts with ac- so no other page is touched. */

.ac { padding-block: var(--section); background: linear-gradient(180deg, var(--base) 0%, var(--flame-tint) 100%); }
.ac__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.ac__year { margin: 0; font-family: var(--display); font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3.4rem); font-weight: 290; line-height: 1.08; letter-spacing: -0.025em; color: var(--maroon); }

/* a tab for each month */
.ac-tabs__bar { display: flex; gap: 0.5rem; margin-bottom: clamp(1.25rem, 1rem + 1.5vw, 2rem); padding-bottom: 0.5rem; overflow-x: auto; scrollbar-width: none; }
.ac-tabs__bar::-webkit-scrollbar { display: none; }
.ac-tab { appearance: none; flex: 1 0 4.75rem; display: grid; justify-items: center; gap: 0.1rem; padding: 0.75rem 0.75rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.7); font: inherit; color: var(--text); cursor: pointer; transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.3s; }
.ac-tab span { font-family: var(--display); font-size: 1.25rem; font-weight: 400; line-height: 1.1; }
.ac-tab small { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.1em; color: var(--amber); }
.ac-tab:hover { border-color: var(--flame); transform: translateY(-2px); }
.ac-tab:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.ac-tab[aria-selected="true"] { border-color: var(--maroon); background: var(--maroon); color: var(--base); transform: translateY(-3px); box-shadow: 0 1rem 2rem -1.25rem rgba(12, 74, 143, 0.7); }
.ac-tab[aria-selected="true"] small { color: var(--flame); }

/* the open month: the grid of days at the left, the list of what is on at the right */
.ac-panel { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.25rem, 1rem + 2.5vw, 3rem); align-items: start; animation: ac-in 0.45s ease both; }
.ac-panel[hidden] { display: none; }
.ac-tabs:not(.is-ready) .ac-tabs__bar { display: none; }
.ac-tabs:not(.is-ready) .ac-panel + .ac-panel { margin-top: 2.5rem; }
@keyframes ac-in { from { opacity: 0; transform: translateY(0.6rem); } to { opacity: 1; transform: none; } }
.ac-cal { padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); border-radius: calc(var(--r-lg) * 1.25); background: #fff; border-top: 5px solid var(--flame); box-shadow: 0 1.25rem 3rem -2rem rgba(12, 74, 143, 0.45); }
.ac-cal__title { margin: 0 0 1rem; font-family: var(--display); font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem); font-weight: 300; font-style: italic; color: var(--maroon); }
.ac-grid { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.3rem; }
.ac-grid__wd { padding-bottom: 0.4rem; text-align: center; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.ac-day { display: grid; place-items: center; aspect-ratio: 1; border-radius: 0.6rem; background: var(--base); font-size: 0.9375rem; color: var(--ink); }
.ac-day--blank { background: none; }
.ac-day--holiday { background: #DDEFFC; color: var(--red); font-weight: 600; }
.ac-day--event { position: relative; background: #fff1cd; font-weight: 600; }
.ac-day--event::after { content: ""; position: absolute; bottom: 0.3rem; left: 50%; width: 0.3rem; height: 0.3rem; margin-left: -0.15rem; border-radius: 50%; background: var(--amber); }
.ac-key { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1.1rem 0 0; font-size: 0.8125rem; color: var(--text); }
.ac-key span { display: inline-flex; align-items: center; gap: 0.45rem; }
.ac-key span::before { content: ""; width: 0.85rem; height: 0.85rem; border-radius: 0.25rem; }
.ac-key__holiday::before { background: #DDEFFC; border: 1px solid var(--red); }
.ac-key__event::before { background: #fff1cd; border: 1px solid var(--amber); }

.ac-list__items { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.ac-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 0.7rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--flame); border-radius: var(--r-lg); background: #fff; }
.ac-item--holiday { border-left-color: var(--red); background: #F3F9FE; }
.ac-item__date { display: grid; justify-items: center; min-width: 3rem; line-height: 1.1; }
.ac-item__date b { font-family: var(--display); font-size: 1.6rem; font-weight: 400; color: var(--maroon); }
.ac-item__date small { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); }
.ac-item__text { display: grid; gap: 0.15rem; font-size: 1.0625rem; line-height: 1.4; color: var(--ink); }
.ac-item__tag { padding: 0.2rem 0.7rem; border-radius: 999px; background: var(--red); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; }
.ac-list__empty { margin: 0; padding: 1.25rem; border-radius: var(--r-lg); background: #fff; color: var(--text); }
.ac-total { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.25rem 0 0; padding: 0.9rem 1.1rem; border-radius: var(--r-lg); background: var(--band); font-size: 0.9375rem; color: var(--on-dark); }
.ac-total b { font-family: var(--mono); font-weight: 600; color: var(--flame); }

/* the model daily programme on a dark band */
.ac-routine { padding-block: var(--section); background: var(--band); color: var(--on-dark); }
.ac-routine__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 1rem + 3vw, 4rem); align-items: start; }
.ac-routine__title { margin: 0; font-family: var(--display); font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3.4rem); font-weight: 290; line-height: 1.08; letter-spacing: -0.025em; color: var(--base); }
.ac-routine__list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-dark); }
.ac-routine__list li { display: grid; grid-template-columns: minmax(9rem, 5fr) minmax(0, 7fr); gap: 1rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line-dark); }
.ac-routine__time { font-family: var(--mono); font-size: 0.875rem; letter-spacing: 0.06em; color: var(--flame); }
.ac-routine__text { font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem); color: var(--base); }

@media (max-width: 900px) {
  .ac-panel, .ac-routine__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .ac-item { grid-template-columns: auto minmax(0, 1fr); }
  .ac-item__tag { grid-column: 2; justify-self: start; }
  .ac-routine__list li { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
}
@media (prefers-reduced-motion: reduce) { .ac-panel { animation: none; } .ac-tab { transition: none; } }

/* the day grid stays in view while the list of events scrolls (on wide screens) */
@media (min-width: 901px) {
  .ac-col { align-self: stretch; }
  .ac-cal { position: sticky; top: calc(var(--header-c, 72px) + 1.25rem); }
}

/* the days that have something on them can be touched */
button.ac-day { appearance: none; border: 0; font: inherit; font-size: 0.9375rem; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s; }
button.ac-day:hover { transform: translateY(-2px); box-shadow: 0 0.5rem 1rem -0.6rem rgba(12, 74, 143, 0.6); }
button.ac-day:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
button.ac-day.is-picked { background: var(--maroon); color: var(--base); box-shadow: 0 0.75rem 1.25rem -0.75rem rgba(12, 74, 143, 0.8); transform: translateY(-2px); }
button.ac-day--event.is-picked::after { background: var(--flame); }
.ac-pick { margin-top: 1rem; min-height: 4.75rem; }
.ac-pick__hint { margin: 0; padding: 0.9rem 1rem; border: 1px dashed var(--line); border-radius: var(--r-lg); font-size: 0.875rem; color: var(--muted); }
.ac-pick__card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1rem; padding: 0.8rem 1rem; border-left: 4px solid var(--flame); border-radius: var(--r-lg); background: var(--maroon); color: var(--base); animation: ac-in 0.3s ease both; }
.ac-pick__card--holiday { border-left-color: var(--red); }
.ac-pick__date { display: grid; justify-items: center; min-width: 2.75rem; line-height: 1.1; }
.ac-pick__date b { font-family: var(--display); font-size: 1.75rem; font-weight: 400; color: var(--flame); }
.ac-pick__date small { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-dark-muted); }
.ac-pick__text { display: grid; gap: 0.2rem; font-size: 1rem; line-height: 1.4; }
.ac-item.is-picked { border-color: var(--maroon); box-shadow: 0 0 0 2px var(--flame); }
/* the bubble over a touched day */
.ac-tip { position: absolute; z-index: 5; width: max-content; max-width: min(17rem, 100%); display: grid; gap: 0.2rem; padding: 0.65rem 0.9rem; border-radius: 0.75rem; background: var(--maroon); color: var(--base); font-size: 0.875rem; line-height: 1.35; text-align: left; box-shadow: 0 1rem 2rem -0.75rem rgba(8, 47, 99, 0.8); pointer-events: none; animation: ac-tip-in 0.18s ease both; }
.ac-tip[hidden] { display: none; }
.ac-tip b { font-family: var(--mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--flame); }
.ac-tip--holiday b { color: #A9D8F8; }
.ac-tip::after { content: ""; position: absolute; left: var(--arrow, 50%); bottom: -6px; width: 12px; height: 12px; margin-left: -6px; background: var(--maroon); transform: rotate(45deg); }
.ac-tip.is-below::after { bottom: auto; top: -6px; }
@keyframes ac-tip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ac-pick__card { display: none; }
@media (prefers-reduced-motion: reduce) { .ac-tip { animation: none; } }