/* Inner pages (about, curriculum, admission, …): photo banner, cards, chips, tabs, course list. */

/* ---------- page banner ---------- */
.page-hero { position: relative; isolation: isolate; overflow: hidden; color: var(--paper); background: var(--maroon-dk); }
/* A real <img> (not a CSS var url, which would resolve against this stylesheet's folder). */
.page-hero-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; filter: brightness(40%); }
.page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(74, 15, 21, .85) 0%, rgba(74, 15, 21, .3) 70%, rgba(74, 15, 21, .1) 100%);
}
.page-hero .container { padding: calc(var(--header-h) + var(--space-12)) 0 var(--space-12); }
.crumbs { font-size: 14px; color: rgba(255, 255, 255, .75); }
.crumbs a { color: var(--gold-lt); }
.page-hero h1 { font-weight: 800; font-size: clamp(40px, 6vw, 72px); line-height: 1.05; margin-top: var(--space-2); }
.page-hero h1 span { color: var(--gold); }
.page-hero p.lead { max-width: 40em; margin-top: var(--space-3); font-size: 18px; color: rgba(255, 255, 255, .85); }

/* ---------- in-page nav ---------- */
.page-nav { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--rule-soft); }
.page-nav ul { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: var(--space-2) 0; overflow-x: auto; }
.page-nav a {
  display: block; white-space: nowrap; padding: 6px 14px; border-radius: var(--radius-full);
  font-family: var(--font-display); font-weight: 500; font-size: 15px; color: var(--maroon); text-decoration: none;
}
.page-nav a:hover { background: var(--highlight); }
.section[id] { scroll-margin-top: 64px; }
.section.alt { background: var(--paper); }

/* ---------- generic cards & chips ---------- */
.card {
  background: var(--paper); border: 1px solid var(--rule-soft); border-left: var(--stroke-accent) solid var(--maroon);
  border-radius: 12px; padding: var(--space-6);
}
.section.alt .card { background: var(--cream); }
.card h3 { font-size: 20px; color: var(--maroon); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px; border-radius: var(--radius-full);
  font-family: var(--font-display); font-weight: 600; font-size: 13px; background: var(--highlight); color: var(--maroon-dk);
}
.chip.generic { background: #e9eef8; color: #1f3a68; }
.chip.specific { background: var(--highlight); color: var(--maroon-dk); }
.chip.plo { background: var(--maroon); color: var(--paper); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* key/value facts */
.facts-table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: 12px; overflow: hidden; }
.facts-table th, .facts-table td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.facts-table th { width: 32%; font-family: var(--font-display); font-weight: 600; color: var(--maroon); background: var(--highlight); }
.facts-table td small { display: block; color: var(--muted); }
@media (max-width: 600px) {
  .facts-table th, .facts-table td { display: block; width: 100%; }
  .facts-table th { border-bottom: 0; padding-bottom: var(--space-1); }
}

/* ---------- PLO ---------- */
.plo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.plo-card { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: start; }
.plo-num {
  width: 64px; height: 64px; border-radius: 16px; background: var(--maroon); color: var(--paper);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; line-height: 1; text-align: center;
}
.plo-num small { display: block; font-size: 11px; font-weight: 600; color: var(--gold-lt); }
.plo-num b { font-size: 26px; }
.plo-card p { margin-top: var(--space-2); }
@media (max-width: 860px) { .plo-grid { grid-template-columns: 1fr; } }

/* YLO by year */
.year-col h3 { display: flex; align-items: center; gap: var(--space-2); }
.ylo-list { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.ylo-list li { background: var(--paper); border-radius: 12px; padding: var(--space-3) var(--space-4); border: 1px solid var(--rule-soft); }
.ylo-list .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-2); }

/* numbered objectives */
.obj-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); counter-reset: o; }
.obj-list li { position: relative; padding: var(--space-3) var(--space-4) var(--space-3) 64px; background: var(--paper); border-radius: 12px; border: 1px solid var(--rule-soft); }
.obj-list li::before {
  counter-increment: o; content: counter(o); position: absolute; left: var(--space-4); top: var(--space-3);
  width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--gold); color: var(--maroon-dk);
  font-family: var(--font-display); font-weight: 700; display: grid; place-items: center;
}

/* icon list */
.icon-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.icon-list li { display: flex; gap: var(--space-3); align-items: baseline; }
.icon-list i { color: var(--maroon); width: 20px; flex: none; text-align: center; }

/* approval timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.timeline li { position: relative; padding-left: 40px; }
.timeline li::before {
  content: ""; position: absolute; left: 8px; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--maroon); box-shadow: 0 0 0 4px var(--highlight);
}
.timeline li.pending::before { background: var(--paper); border: 3px solid var(--gold); }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 26px; bottom: -18px; width: 2px; background: var(--rule-soft); }
.timeline b { display: block; font-family: var(--font-display); font-weight: 600; }
.timeline small { color: var(--muted); }

/* ---------- tabs (study plans) ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius-full); background: var(--paper); border: 1px solid var(--rule-soft); }
.tabs [role="tab"] {
  border: 0; background: transparent; cursor: pointer; padding: 10px 22px; border-radius: var(--radius-full);
  font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--maroon);
}
.tabs [role="tab"][aria-selected="true"] { background: var(--maroon); color: var(--paper); }
.tabs [role="tab"] small { font-weight: 500; opacity: .8; }
.tab-panel { margin-top: var(--space-6); }
.term-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.term-grid .year-head { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }
.term-grid .year-head h3 { font-size: 24px; color: var(--maroon); }
.term-grid .year-head::after { content: ""; flex: 1; height: 2px; background: var(--rule-soft); }
.data-table td.code { white-space: nowrap; font-family: var(--font-display); font-weight: 500; color: var(--muted); font-size: 15px; }
.data-table td .en { display: block; font-size: 14px; color: var(--muted); }
.data-table td.pick { color: var(--maroon-lt); font-style: italic; }
.term-grid > * { min-width: 0; } /* let tables shrink instead of widening the grid */
.table-scroll { overflow-x: auto; }
@media (max-width: 600px) {
  .term-grid .data-table th, .term-grid .data-table td { padding: 6px 8px; font-size: 15px; }
  .data-table td.code { white-space: normal; }
}
.review-note { margin-top: var(--space-2); font-size: 14px; color: var(--maroon); background: var(--highlight); padding: 6px 12px; border-radius: 8px; }
@media (max-width: 860px) { .term-grid { grid-template-columns: 1fr; } }

/* ---------- course list (details/summary) ---------- */
.course-group + .course-group { margin-top: var(--space-8); }
.course-group h3 { font-size: 22px; color: var(--maroon); margin-bottom: var(--space-3); }
.course-group h3 small { font-family: var(--font-text); font-weight: 500; font-size: 15px; color: var(--muted); }
.course { background: var(--paper); border: 1px solid var(--rule-soft); border-radius: 12px; }
.course + .course { margin-top: var(--space-2); }
.course summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 96px 1fr auto auto; gap: var(--space-3);
  align-items: center; padding: var(--space-3) var(--space-4);
}
.course summary::-webkit-details-marker { display: none; }
.course summary .code { font-family: var(--font-display); font-weight: 600; color: var(--maroon); }
.course summary .name b { display: block; font-family: var(--font-display); font-weight: 600; }
.course summary .name small { color: var(--muted); }
.course summary .cr { font-family: var(--font-display); font-weight: 600; color: var(--muted); white-space: nowrap; }
.course summary .chev { color: var(--maroon); transition: transform .2s; }
.course[open] summary .chev { transform: rotate(180deg); }
.course .desc { padding: 0 var(--space-4) var(--space-4) calc(96px + var(--space-3) + var(--space-4)); color: var(--ink); }
.course .desc p + p { margin-top: var(--space-2); color: var(--muted); font-size: 15px; }
@media (max-width: 600px) {
  .course summary { grid-template-columns: 1fr auto; }
  .course summary .code { grid-column: 1 / -1; }
  .course .desc { padding-left: var(--space-4); }
}

/* ---------- admission ---------- */
.dot { width: 10px; height: 10px; border-radius: 50%; background: #3ddc84; display: inline-block; flex: none; }
.open-flag { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-weight: 600; color: var(--gold-lt); }
.open-round {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-6); align-items: center;
  background: var(--maroon-dk); color: var(--paper); border-radius: var(--radius-card); padding: var(--space-6) var(--space-8);
}
.open-round img { width: 96px; height: auto; background: var(--paper); border-radius: 12px; padding: var(--space-2); }
.open-round h2 { font-size: clamp(22px, 2.6vw, 30px); }
.open-round h2 span { color: var(--gold); }
.open-round ul { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.open-round li { background: rgba(255, 255, 255, .1); padding: 4px 12px; border-radius: var(--radius-full); font-size: 15px; }
.open-round li i { color: var(--gold); margin-right: 6px; }
.open-round .actions { display: grid; gap: var(--space-2); }
@media (max-width: 860px) { .open-round { grid-template-columns: 1fr; } }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); counter-reset: s; }
.steps li { position: relative; background: var(--paper); border-radius: 16px; padding: var(--space-6); padding-top: var(--space-12); border: 1px solid var(--rule-soft); }
.steps li::before {
  counter-increment: s; content: counter(s); position: absolute; top: var(--space-4); left: var(--space-6);
  font-family: var(--font-display); font-weight: 800; font-size: 28px; color: var(--gold);
}
.steps b { display: block; font-family: var(--font-display); font-weight: 600; color: var(--maroon); font-size: 18px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* CLS: reserve room for blocks filled from JSON inside the first screen */
#open-round { min-height: 200px; }
@media (max-width: 860px) { #open-round { min-height: 520px; } }
#structure .data-table { height: 270px; } /* table height acts as a minimum: caption + head + 4 rows */
