/* NAAC Self Study Report - nc_py
   Values taken from the live site's own stylesheet rather than eyeballed:
   1140px boxed container, Montserrat, #E22328 headings on #232323 text,
   #F7F7F7 panels, #ddd hairlines, 3px radius, 50px search control. */

:root {
  --red: #e22328;          /* headings, links, active nav */
  --red-dark: #b81b20;
  --red-button: #fb0501;   /* the site's primary: the search submit */
  --ink: #232323;
  --ink-soft: #4a4a4a;
  --ink-faint: #777777;
  --paper: #ffffff;
  --surface: #ffffff;
  --panel: #f7f7f7;
  --line: #dddddd;
  --line-soft: #e8e8e8;
  --accent-wash: #fdf1f1;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 10px 30px rgba(0, 0, 0, .07);
  --radius: 3px;
  --sans: "Montserrat", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --shell: 1140px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --red: #ff6b6f;
    --red-dark: #e8484d;
    --red-button: #e8484d;
    --ink: #ececec;
    --ink-soft: #b6b6b6;
    --ink-faint: #8d8d8d;
    --paper: #151515;
    --surface: #1d1d1d;
    --panel: #242424;
    --line: #353535;
    --line-soft: #2b2b2b;
    --accent-wash: #2b1a1b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --red: #ff6b6f;
  --red-dark: #e8484d;
  --red-button: #e8484d;
  --ink: #ececec;
  --ink-soft: #b6b6b6;
  --ink-faint: #8d8d8d;
  --paper: #151515;
  --surface: #1d1d1d;
  --panel: #242424;
  --line: #353535;
  --line-soft: #2b2b2b;
  --accent-wash: #2b1a1b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; }
a { color: var(--red); }
code { font-family: var(--mono); font-size: .9em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 20;
  background: var(--surface); color: var(--ink); padding: .6rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- masthead: three columns, 17.807 / 60.6 / 20.925 ---------- */

.masthead { background: var(--surface); }
.masthead-inner {
  max-width: var(--shell); margin: 0 auto; padding: 10px 10px 0;
  display: grid; align-items: center; gap: 10px;
  grid-template-columns: 17.807% 60.6% 20.925%;
}
.brand { display: block; min-width: 0; }
.brand img { display: block; width: 100%; height: auto; }
.brand-title { text-align: center; min-width: 0; }
.brand-title h4 {
  margin: .5rem 0 0; color: var(--red);
  font-size: 1.5rem; font-weight: 700; line-height: 1.2;
}
.brand-title h5 {
  margin: .35rem 0 1rem; color: var(--ink);
  font-size: 1.25rem; font-weight: 600; line-height: 1.2;
}
.brand-rank { min-width: 0; }
.brand-rank img { display: block; width: 100%; height: auto; }

/* ---------- search bar ---------- */

.searchbar { background: var(--surface); padding: 1.2rem 10px 1.4rem; }
.search {
  max-width: 790px; margin: 0 auto; display: flex;
  border-radius: var(--radius); overflow: hidden;
}
.search input {
  flex: 1; min-width: 0; min-height: 50px; padding: 0 16.6px;
  font: inherit; font-size: .95rem; font-weight: 400;
  border: 0; background: var(--panel); color: var(--ink);
}
.search input::placeholder { color: #9b9b9b; }
.search input:focus { outline: 2px solid var(--red); outline-offset: -2px; }
.search button {
  flex: none; min-width: 50px; border: 0; background: var(--red-button);
  cursor: pointer; display: grid; place-items: center;
}
.search button:hover { background: var(--red-dark); }
.search button svg { width: 18px; height: 18px; fill: #fff; }

.utility-links {
  max-width: 790px; margin: .5rem auto 0; display: flex; gap: 1.1rem;
  justify-content: flex-end; font-size: .8rem;
}
.utility-links a { color: var(--ink-faint); text-decoration: none; }
.utility-links a:hover { color: var(--red); text-decoration: underline; }

.nav-toggle { display: none; }

/* ---------- shell ---------- */

.shell {
  max-width: var(--shell); margin: 0 auto; padding: 0 10px 3rem;
  display: grid; gap: 2rem; grid-template-columns: 31% minmax(0, 1fr);
  align-items: start;
}

/* The menu is the site's eleven sections, flat. Sub-pages of the open section
   are listed in the main area, so repeating them here would say it twice. */
/* The live site fixes this panel's height and always shows its scrollbar
   (#leftmenusidebar { height: 70vh; overflow: scroll }), so the menu is a
   constant size whatever the page beside it is doing. 'scroll' rather than
   'auto': the track is there even when the list happens to fit. */
.sidebar {
  background: var(--panel); padding: 20px 0 0;
  position: sticky; top: 1rem;
  height: 70vh; overflow-y: scroll;
  scrollbar-width: thin; scrollbar-color: #c2c2c2 var(--panel);
}
.sidebar::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-track { background: var(--panel); }
.sidebar::-webkit-scrollbar-thumb {
  background: #c2c2c2; border: 3px solid var(--panel); border-radius: 999px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: #a5a5a5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar { scrollbar-color: #4a4a4a var(--panel); }
  :root:not([data-theme="light"]) .sidebar::-webkit-scrollbar-thumb { background: #4a4a4a; }
}

.crit-list { list-style: none; margin: 0; padding: 0; }
.crit-link {
  display: block; padding: .75rem 1rem; color: var(--ink); text-decoration: none;
  font-size: 1rem; font-weight: 600; line-height: 1.4;
  border-bottom: 1px solid var(--line);
}
.crit-link:hover { color: var(--red); background: var(--surface); }
.crit.is-active > .crit-link { color: var(--red); background: var(--surface); }

/* The site gives the content area a floor of 67vh, so a short page does not
   leave the fixed-height menu hanging past the end of the content. */
.main { min-width: 0; padding-top: 1.5rem; min-height: 67vh; }

/* ---------- headings and page chrome ---------- */

.hero { margin-bottom: 2rem; }
.eyebrow {
  margin: 0 0 .3rem; font-size: .78rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
}
.hero h1 { margin: 0 0 .6rem; color: var(--red); font-size: 1.5rem; font-weight: 700; line-height: 1.25; }
.lede { margin: 0; color: var(--ink-soft); max-width: 68ch; }

.stat-row { display: flex; flex-wrap: wrap; gap: 2.25rem; margin: 1.5rem 0 0; }
.stat dt { font-size: .76rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
.stat dd { margin: .1rem 0 0; font-size: 1.5rem; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }

.section-head {
  margin: 2rem 0 .9rem; font-size: 1rem; font-weight: 700; color: var(--ink);
  padding-bottom: .5rem; border-bottom: 1px solid var(--line);
}
.section-head:first-child { margin-top: 0; }

.crumbs { font-size: .84rem; color: var(--ink-faint); margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--red); text-decoration: underline; }
.crumb-sep { color: var(--line); }

.page-head { margin-bottom: 1.5rem; }
.page-code { margin: 0 0 .25rem; font-size: .86rem; font-weight: 700; color: var(--ink-faint); }
.page-head h1 { margin: 0; color: var(--red); font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
.page-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin: .5rem 0 0; font-size: .84rem; color: var(--ink-faint); }

/* ---------- cards and lists ---------- */

.card-grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.card a {
  display: grid; gap: .25rem; height: 100%; padding: 1.1rem;
  background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--red); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
}
.card a:hover { background: var(--panel); }
.card-index { font-size: .74rem; font-weight: 700; color: var(--ink-faint); }
.card-label { font-size: .82rem; font-weight: 700; color: var(--red); }
.card-name { font-size: 1rem; font-weight: 600; line-height: 1.35; }
.card-meta { margin-top: .3rem; font-size: .8rem; color: var(--ink-faint); }

.plain-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.plain-list li + li { border-top: 1px solid var(--line); }
.plain-list a {
  display: flex; flex-wrap: wrap; gap: .2rem 1rem; align-items: baseline; justify-content: space-between;
  padding: .7rem 1rem; text-decoration: none; color: var(--ink); font-weight: 500;
}
.plain-list a:hover { background: var(--panel); color: var(--red); }
.plain-title { line-height: 1.45; }
.plain-meta { font-size: .8rem; font-weight: 400; color: var(--ink-faint); white-space: nowrap; }

/* ---------- documents ---------- */

.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list > li + li { margin-top: .35rem; }
.doc {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline;
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); background: var(--surface);
}
a.doc:hover { border-color: var(--red); background: var(--panel); }
.doc-type {
  flex: none; font-size: .64rem; font-weight: 700; line-height: 1.6; letter-spacing: .06em;
  padding: .1rem .4rem; background: var(--red); color: #fff; border-radius: 2px;
}
.doc-type.is-page { background: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .doc-type { color: #1a1a1a; }
  :root:not([data-theme="light"]) .doc-type.is-page { background: var(--ink-soft); }
}
.doc-label { flex: 1; min-width: 12ch; line-height: 1.5; font-size: .95rem; font-weight: 500; }
.doc-size { flex: none; font-size: .78rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.doc-flag {
  flex: none; font-size: .68rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-faint); border: 1px solid var(--line); border-radius: 2px; padding: .05rem .35rem;
}
.doc.is-missing { opacity: .5; }
.doc.is-missing .doc-type { background: var(--ink-faint); }
.doc-parent { display: inline-block; margin: .2rem 0 0 .8rem; font-size: .78rem; color: var(--ink-faint); }

.chip-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; gap: .4rem; align-items: baseline;
  padding: .5rem 1rem; background: var(--red); color: #fff; border-radius: var(--radius);
  text-decoration: none; font-size: .9rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
a.chip:hover { background: var(--red-dark); }
.chip-size { font-size: .74rem; font-weight: 400; color: rgba(255, 255, 255, .82); }
.chip.is-missing {
  background: var(--panel); color: var(--ink-faint); border: 1px solid var(--line);
  text-decoration: line-through;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip { color: #1a1a1a; }
  :root:not([data-theme="light"]) .chip-size { color: rgba(0, 0, 0, .6); }
}

.empty {
  padding: 1.1rem; border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--ink-faint); background: var(--surface);
}

/* ---------- content blocks ---------- */

.content > * + * { margin-top: 1rem; }

.block-heading {
  margin: 1.8rem 0 .2rem; color: var(--red);
  font-size: 1.25rem; font-weight: 700; line-height: 1.3;
}
.content > .block-heading:first-child { margin-top: 0; }
.block-heading.is-h1 { font-size: 1.6rem; }
.block-heading.is-h2 { font-size: 1.4rem; }
.block-heading.is-h3 { font-size: 1.25rem; }
.block-heading.is-h4 { font-size: 1.15rem; }
.block-heading.is-h5 { font-size: 1.05rem; }
.block-heading.is-h6 { font-size: .95rem; }

.prose { color: var(--ink); }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.prose li { margin-bottom: .3rem; }
.prose a { overflow-wrap: anywhere; }
.prose img { height: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 0 0 1rem; }
.prose th, .prose td { padding: .45rem .6rem; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--panel); }

.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gallery.cols-1 { grid-template-columns: minmax(0, 1fr); }
.gallery.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.gallery.cols-6, .gallery.cols-7, .gallery.cols-8 {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  border: 1px solid var(--line); background: var(--panel);
}
.gallery a:hover img { border-color: var(--red); }
.gallery figcaption {
  margin-top: .4rem; font-size: .84rem; line-height: 1.4; color: var(--ink);
  text-align: center; font-weight: 600;
}
.gallery-missing {
  display: grid; place-items: center; aspect-ratio: 4 / 3;
  border: 1px dashed var(--line); color: var(--ink-faint); font-size: .78rem;
}

.video iframe, .video video {
  width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line);
  background: #000; display: block;
}

.draft-note {
  margin: .5rem 0 0; display: inline-block; padding: .2rem .6rem;
  background: #fdf0dc; color: #7a4a10; font-size: .78rem; border-radius: var(--radius);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .draft-note { background: #33240f; color: #e0b375; }
}

.edit-link { margin-top: 1.5rem; font-size: .86rem; }

/* ---------- pager ---------- */

.pager { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.pager a {
  flex: 1 1 240px; display: grid; gap: .1rem; padding: .75rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); font-size: .9rem; font-weight: 500; line-height: 1.4;
}
.pager a:hover { border-color: var(--red); color: var(--red); }
.pager a span { font-size: .7rem; font-weight: 400; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
.pager-next { text-align: right; }

/* ---------- outline ---------- */

.outline { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.outline li { display: flex; gap: .75rem; align-items: baseline; padding: .35rem 1rem; border-top: 1px solid var(--line-soft); }
.outline li:first-child { border-top: 0; }
.outline a { text-decoration: none; color: var(--ink); font-size: .9rem; }
.outline a:hover { color: var(--red); text-decoration: underline; }
.outline-count {
  margin-left: auto; flex: none; font-size: .74rem; color: var(--ink-faint);
  background: var(--panel); padding: .05rem .45rem; border-radius: 2px;
  font-variant-numeric: tabular-nums;
}
.outline .lvl-1 { padding-left: 1rem; font-weight: 700; background: var(--panel); }
.outline .lvl-2 { padding-left: 2rem; font-weight: 600; }
.outline .lvl-3 { padding-left: 3.25rem; }
.outline .lvl-4 { padding-left: 4.5rem; color: var(--ink-soft); }
.outline .lvl-5 { padding-left: 5.75rem; color: var(--ink-soft); }

/* ---------- footer ---------- */

.footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 1rem; }
.footer-inner { max-width: var(--shell); margin: 0 auto; padding: 1.4rem 10px; text-align: center; }
.footer-inner p { margin: 0; font-size: .85rem; color: var(--ink-soft); }

/* ---------- the site's own breakpoints: 1024 and 767 ---------- */

@media (max-width: 1024px) {
  :root { --shell: 1024px; }
}

@media (max-width: 767px) {
  :root { --shell: 767px; }
  .masthead-inner { grid-template-columns: 40% 50%; justify-content: space-between; }
  .brand-title { grid-column: 1 / -1; order: 3; }
  .brand-title h4 { font-size: 18px; }
  .brand-title h5 { font-size: 16px; }

  .shell { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .sidebar { display: none; }
  .sidebar.is-open { display: block; }
  .nav-toggle {
    display: block; width: calc(100% - 20px); margin: .5rem 10px 0;
    padding: .7rem 1rem; font: inherit; font-size: .95rem; font-weight: 600;
    cursor: pointer; background: var(--red); color: #fff; border: 0;
    border-radius: var(--radius); text-align: left;
  }
  .nav-toggle[aria-expanded="true"] { background: var(--red-dark); }
  .utility-links { justify-content: center; }
  .main { padding-top: 1rem; }
  .gallery.cols-3, .gallery.cols-4, .gallery.cols-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-row { gap: 1.25rem; }
}
