/* ── Self-hosted fonts ──────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-Variable-Italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ── Brand tokens ──────────────────────────────────────────── */
:root {
  --ur-navy:   #001E5F;
  --ur-gold:   #FFD82B;
  --ur-light:  #E8E8E8;
  --ur-butter: #FFF3B1;
  --ur-sky:    #B7D3FF;
  --ur-text:   #222222;
  --ur-link:   #005EB8;
  --max-width: 980px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', Aptos, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ur-text);
  background: #fff;
}

a { color: var(--ur-link); text-decoration: underline; }
a:hover { color: var(--ur-navy); }

/* ── FIXED HEADER ──────────────────────────────────────────── */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
}

/* ── MASTHEAD ───────────────────────────────────────────────── */
.masthead {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 8px 20px;
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.masthead-inner .ur-logo {
  height: 44px;
  width: auto;
}

/* ── NAMEPLATE ──────────────────────────────────────────────── */
.nameplate {
  background: var(--ur-navy);
  border-bottom: 4px solid var(--ur-gold);
  padding: 8px 20px;
}

.nameplate-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.nameplate-inner .school-name {
  display: block;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1px;
}

.nameplate-inner .school-name:hover { color: rgba(255,255,255,0.8); }

.nameplate-inner .dept-name {
  display: block;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.nameplate-inner .dept-name:hover { color: rgba(255,255,255,0.8); }

.nameplate-inner .site-title {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
}

/* ── NAV BAR ────────────────────────────────────────────────── */
nav {
  background: var(--ur-navy);
  position: relative;
  z-index: 100;
}

nav > ul {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  list-style: none;
  display: flex;
  gap: 0;
}

nav > ul > li > a {
  display: block;
  padding: 12px 18px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

nav > ul > li > a:hover,
nav > ul > li > a.active {
  border-bottom-color: var(--ur-gold);
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* Targets the nested <ul> */
.has-dropdown .dropdown {
  width: max-content;       /* Forces the menu to be as wide as the longest item */
  min-width: 100%;          /* Ensures it's at least as wide as the 'Documents' link */
  display: none;            /* Usually hidden by default until hover */
  position: absolute;       /* Positions it relative to the parent li */
  z-index: 1000;
}

/* Targets the links inside the dropdown */
.has-dropdown .dropdown li a {
  white-space: nowrap;      /* Crucial: prevents the text from jumping to a new line */
  display: block;           /* Ensures the link fills the width of the li */
  padding: 10px 15px;       /* Adds a bit of breathing room on the sides */
}

/* Optional: Ensure the parent is the reference point */
.has-dropdown {
  position: relative;
}

/* ── DROPDOWN ───────────────────────────────────────────────── */
nav > ul > li {
  position: relative;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #fff;
  border-top: 3px solid var(--ur-gold);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  list-style: none;
  z-index: 200;
}

nav > ul > li:hover .dropdown {
  display: block;
}

.dropdown li a {
  display: block;
  padding: 10px 18px;
  color: var(--ur-navy);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 400;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}

.dropdown li a:hover {
  background: var(--ur-light);
  border-left-color: var(--ur-gold);
}

.has-dropdown > a::after {
  content: " ▾";
  font-size: 0.72rem;
  opacity: 0.75;
}

/* ── MAIN CONTENT ───────────────────────────────────────────── */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.intro {
  background: var(--ur-light);
  border-left: 5px solid var(--ur-navy);
  padding: 18px 22px;
  margin-bottom: 28px;
  font-size: 1.02rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ur-navy);
  margin: 0 0 24px;
}

h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ur-navy);
  border-left: 5px solid var(--ur-gold);
  padding-left: 12px;
  margin: 40px 0 16px;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ur-navy);
  margin: 24px 0 8px;
}

p { margin-bottom: 1em; }

ul.content-list {
  padding-left: 1.4em;
  margin-bottom: 1em;
}

ul.content-list li { margin-bottom: 0.35em; }

/* ── Two-column layout ──────────────────────────────────────── */
.general-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0 36px;
  align-items: start;
}

.general-main { min-width: 0; }

.general-sidebar {
  position: sticky;
  top: 220px;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.general-sidebar::-webkit-scrollbar { display: none; }

.general-sidebar h3 { margin-top: 0; }

@media (max-width: 680px) {
  .general-layout {
    grid-template-columns: 1fr;
  }
  .general-sidebar {
    position: static;
  }
}

/* ── Calendar ───────────────────────────────────────────────── */
.lab-calendar-wrap {
  display: inline-block;
  margin: 12px 0 0;
  font-size: 0.88rem;
}

/* Semester title */
.lab-calendar-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ur-navy);
  text-align: center;
  width: 224px;
  margin-left: 48px;
  margin-bottom: 8px;
}

/* Header row wrapper: A/B spacer + day labels */
.lab-calendar-header-wrap {
  display: flex;
  align-items: flex-end;
  margin-bottom: 2px;
}

.ab-header {
  width: 48px;
  flex-shrink: 0;
}

/* Day labels above the grid */
.lab-calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 32px);
  margin-left: 0;
  margin-bottom: 2px;
}

.lab-calendar-header span {
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--ur-navy);
  padding: 2px 0;
}

.lab-calendar-header span.weekend-head {
  color: var(--ur-text);
  opacity: 0.5;
}

/* A/B column */
.lab-calendar-ab {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.ab-cell {
  width: 48px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ur-navy);
}

/* Body: grid + month labels side by side */
.lab-calendar-body {
  display: flex;
  align-items: flex-start;
  gap: 2px;
}

.lab-calendar-grid {
  display: flex;
  flex-direction: column;
}

.lab-calendar-row {
  display: grid;
  grid-template-columns: repeat(7, 32px);
}

.cal-cell {
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  border: 1px solid #ddd;
  color: var(--ur-text);
  background: #fff;
}

.cal-cell.weekend {
  background: var(--ur-light);
}

.cal-cell.mb-top    { border-top:    3px solid var(--ur-navy); }
.cal-cell.mb-bottom { border-bottom: 3px solid var(--ur-navy); }
.cal-cell.mb-left   { border-left:   3px solid var(--ur-navy); }
.cal-cell.mb-right  { border-right:  3px solid var(--ur-navy); }

.cal-cell.holiday {
  background: var(--ur-butter);
  color: var(--ur-navy);
}

.cal-cell.finals {
  background: var(--ur-sky);
  color: var(--ur-navy);
}

.cal-cell.out-of-range {
  background: transparent;
  color: var(--ur-text);
  opacity: 0.15;
}

.cal-cell.break {
  background: var(--ur-butter);
  font-style: italic;
  color: var(--ur-navy);
}

/* Month labels to the right, rotated 90° */
.lab-calendar-months {
  display: flex;
  flex-direction: column;
}

.month-label {
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ur-navy);
  white-space: nowrap;
  padding: 0 4px;
}

.lab-calendar-wrap .calendar-pdf-link {
  font-size: 0.82rem;
  margin-top: 6px;
}

/* ── Manual lists ───────────────────────────────────────────── */
.manual-course { margin-bottom: 30px; }

.manual-course ul {
  list-style: none;
  padding: 0;
}

.manual-course ul li {
  padding: 6px 0;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.manual-course ul li .exp-name {
  min-width: 130px;
  font-weight: 600;
  color: var(--ur-navy);
}

.manual-course ul li a { font-size: 0.88rem; white-space: nowrap; }

/* ── FAQ ────────────────────────────────────────────────────── */
details.faq-item { border-bottom: 1px solid #ddd; }

details.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 4px;
  font-weight: 600;
  color: var(--ur-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

details.faq-item summary::before { content: "►"; font-size: 0.7rem; }
details.faq-item[open] summary::before { content: "▼"; }

details.faq-item .faq-body { padding: 6px 24px 14px; }

/* ── LAB LIST ───────────────────────────────────────────────── */
.lab-list { margin-top: 8px; }

.lab-entry {
  border-top: 1px solid #ddd;
  padding: 16px 0 12px;
}

.lab-entry h3 { margin-top: 0; }

/* ── Lab / calendar hover interaction ───────────────────────── */
.ab-cell.ab-highlight {
  font-size: 1rem;
  color: var(--ur-link);
  cursor: default;
  transition: font-size 0.15s ease;
}

.lab-entry.lab-highlight .lab-entry-title {
  font-size: 1.3rem;
  color: var(--ur-link);
  transition: font-size 0.15s ease;
}

.lab-description {
  font-size: 0.93rem;
  color: #444;
  margin: 4px 0 8px;
}

.lab-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.lab-doc-link {
  display: inline-block;
  padding: 4px 12px;
  background: var(--ur-navy);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
  transition: background 0.12s;
}

.lab-doc-link:hover {
  background: var(--ur-link);
  color: #fff;
}

.lab-doc-setup {
  background: var(--ur-gold);
  color: var(--ur-navy);
}

.lab-doc-setup:hover {
  background: #e6c200;
  color: var(--ur-navy);
}

.lab-doc-placeholder {
  font-size: 0.88rem;
  color: #888;
  font-style: italic;
}

.course-custom-text {
  margin: 16px 0 8px;
}

/* ── FOOTER ─────────────────────────────────────────────────── */
footer {
  background: var(--ur-navy);
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  padding: 28px 20px 24px;
  text-align: center;
}

footer img.footer-logo {
  height: 36px;
  width: auto;
  display: block;
  margin: 0 auto 16px;
  opacity: 0.9;
}

footer a { color: var(--ur-gold); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer p + p { margin-top: 6px; }
