/* =====================================================================
   SITE-WIDE TYPOGRAPHY  (typography.css)
   One font family and one type scale for every page EXCEPT the
   admission pages (they keep admissions.css: Inter + Fraunces).

   Loaded from menu1.php / menu.php right AFTER Bootstrap, so it wins over
   Bootstrap's system-font reboot and over the page styles in main.css.
   The header mega-menu, the full-page menu, the announcement ticker
   and the footer are left untouched.

   To change the look of the whole site, edit only the variables below.
   ===================================================================== */
:root {
  --site-font-body:  "Google Sans", sans-serif;
  --site-font-heading: "Google Sans", sans-serif;

  /* Text sizes change smoothly with the screen width (no jumps between phone,
     tablet and laptop): each one grows evenly from its phone size at 360px to its
     desktop size at 1280px, and stays at the desktop size above that.
     Line heights on the pages are proportional to the text size, so they follow
     it smoothly too. */
  --site-fs-p: clamp(0.875rem, calc(0.865217rem + 0.0434783vw), 0.9rem);       /* 14px on a 360px phone -> 14.4px from 1280px up - <p> paragraphs */
  --site-fs-li: clamp(0.9125rem, calc(0.897826rem + 0.0652174vw), 0.95rem);      /* 14.6px on a 360px phone -> 15.2px from 1280px up - <li> list items */
  --site-fs-table: clamp(0.9rem, calc(0.880435rem + 0.0869565vw), 0.95rem);   /* 14.4px on a 360px phone -> 15.2px from 1280px up - <td> / <th> table cells */
  --site-fs-body: clamp(0.9125rem, calc(0.897826rem + 0.0652174vw), 0.95rem);    /* 14.6px on a 360px phone -> 15.2px from 1280px up - other text: <dd>, <dt>, <blockquote>, <figcaption> */
  --site-fs-h1: clamp(1.3rem, calc(1.22174rem + 0.347826vw), 1.5rem);      /* 20.8px on a 360px phone -> 24px from 1280px up - page title <h1> (was 25.6px -> 32px) */
  --site-fs-banner: clamp(1.6rem, calc(1.44348rem + 0.695652vw), 2rem);  /* 25.6px on a 360px phone -> 32px from 1280px up - department banner title (unchanged) */
  --site-fs-h2: clamp(1.2rem, calc(1.13152rem + 0.304348vw), 1.375rem);      /* 19.2px on a 360px phone -> 22px from 1280px up (was 22.4px -> 26px) */
  --site-fs-h3: clamp(1.1rem, calc(1.0413rem + 0.26087vw), 1.25rem);      /* 17.6px on a 360px phone -> 20px from 1280px up (was 19.2px -> 20px) */
  --site-fs-h4: clamp(1.05rem, calc(1.02065rem + 0.130435vw), 1.125rem);      /* 16.8px on a 360px phone -> 18px from 1280px up (was 17.6px -> 19.2px) */
  --site-fs-h5: clamp(1rem, calc(0.980435rem + 0.0869565vw), 1.05rem);      /* 16px on a 360px phone -> 16.8px from 1280px up */
  --site-fs-h6: clamp(0.95rem, calc(0.930435rem + 0.0869565vw), 1rem);      /* 15.2px on a 360px phone -> 16px from 1280px up */

  /* Letter spacing: a touch more open on small phones (+0.1px at 360px), easing
     smoothly to the slightly tighter -0.1px used on laptops (1280px and up). */
  letter-spacing: calc(-0.1px + clamp(0px, (1280px - 100vw) * 0.000217391, 0.2px));

  /* Bootstrap reads this for body text */
  --bs-body-font-family: var(--site-font-body);
}

/* `:root:not(#_t)` adds ID-level weight without needing an ID in the HTML,
   so these rules beat page-level selectors (even ones marked !important).
   :where() keeps the long exclusion lists from adding extra weight.        */

/* ---------- 1. Font family: body text ----------
   Sets the page's base font (Bootstrap would otherwise use the system font).
   Google Sans is the only text font on the site: main.css uses it too, and
   only the icon fonts (Font Awesome, Bootstrap Icons) are different. */
:root:not(#_t) body {
  font-family: var(--site-font-body) !important;
}
:root:not(#_t) body :is(button, input, select, textarea, optgroup) {
  font-family: inherit;
}

/* ---------- 2. Font family: headings ---------- */
:root:not(#_t) body
  :is(h1, h2, h3, h4, h5, h6):not(:where(.main-header *, .full-page-overlay *, .ticker *, .site-footer *)),
:root:not(#_t) body
  :is(h1, h2, h3, h4, h5, h6) :where(*):not(:where(
    .main-header *, .full-page-overlay *, .ticker *, .site-footer *,
    i, svg, svg *, .fa, .fas, .far, .fab, .fal, .fad, .fa-solid, .fa-regular, .fa-brands,
    [class^="fa-"], [class*=" fa-"], .bi, [class^="bi-"], [class*=" bi-"]
  )) {
  font-family: var(--site-font-heading) !important;
}

/* ---------- 3. Font sizes (page content only) ----------
   Not resized: side menus (.department-menu, .exam-card-officer) and the
   homepage stats strip (.stats-bar: 100+ Faculty, 3,300+ Students ...),
   which keeps its own compact sizes from menu.php.                      */
:root:not(#_t) body
  :is(p, li, td, th, dd, dt, blockquote, figcaption):not(:where(
    .main-header *, .full-page-overlay *, .ticker *, .site-footer *,
    .department-menu *, .exam-card-officer *, .stats-bar *
  )) {
  font-size: var(--site-fs-body) !important;
}

/* Paragraphs, list items and table cells each have their own variable. */
:root:not(#_t) body
  p:not(:where(
    .main-header *, .full-page-overlay *, .ticker *, .site-footer *,
    .department-menu *, .exam-card-officer *, .stats-bar *
  )) { font-size: var(--site-fs-p) !important; }
:root:not(#_t) body
  li:not(:where(
    .main-header *, .full-page-overlay *, .ticker *, .site-footer *,
    .department-menu *, .exam-card-officer *, .stats-bar *
  )) { font-size: var(--site-fs-li) !important; }
:root:not(#_t) body
  :is(td, th):not(:where(
    .main-header *, .full-page-overlay *, .ticker *, .site-footer *,
    .department-menu *, .exam-card-officer *, .stats-bar *
  )) { font-size: var(--site-fs-table) !important; }

:root:not(#_t) body :is(h1,h2,h3,h4,h5,h6):where(:not(.main-header *, .full-page-overlay *, .ticker *, .site-footer *, .department-menu *, .exam-card-officer *, .stats-bar *)):is(h1) { font-size: var(--site-fs-h1) !important; }
:root:not(#_t) body :is(h1,h2,h3,h4,h5,h6):where(:not(.main-header *, .full-page-overlay *, .ticker *, .site-footer *, .department-menu *, .exam-card-officer *, .stats-bar *)):is(h2) { font-size: var(--site-fs-h2) !important; }
:root:not(#_t) body :is(h1,h2,h3,h4,h5,h6):where(:not(.main-header *, .full-page-overlay *, .ticker *, .site-footer *, .department-menu *, .exam-card-officer *, .stats-bar *)):is(h3) { font-size: var(--site-fs-h3) !important; }
:root:not(#_t) body :is(h1,h2,h3,h4,h5,h6):where(:not(.main-header *, .full-page-overlay *, .ticker *, .site-footer *, .department-menu *, .exam-card-officer *, .stats-bar *)):is(h4) { font-size: var(--site-fs-h4) !important; }
:root:not(#_t) body :is(h1,h2,h3,h4,h5,h6):where(:not(.main-header *, .full-page-overlay *, .ticker *, .site-footer *, .department-menu *, .exam-card-officer *, .stats-bar *)):is(h5) { font-size: var(--site-fs-h5) !important; }
:root:not(#_t) body :is(h1,h2,h3,h4,h5,h6):where(:not(.main-header *, .full-page-overlay *, .ticker *, .site-footer *, .department-menu *, .exam-card-officer *, .stats-bar *)):is(h6) { font-size: var(--site-fs-h6) !important; }

/* Text nested inside a paragraph / list item / cell follows its parent
   (stops inline font-size on <span>, <a>, <strong> etc. from drifting). */
:root:not(#_t) body
  :is(p, li, td, th, dd, dt, blockquote) :is(span, a, strong, b, em, font):not(:where(
    .main-header *, .full-page-overlay *, .ticker *, .site-footer *,
    .department-menu *, .exam-card-officer *, .stats-bar *,
    i, .fa, .fas, .far, .fab, [class^="fa-"], [class*=" fa-"], .bi, [class^="bi-"], [class*=" bi-"], .badge
  )) {
  font-size: inherit !important;
}

/* Banner titles on department pages (<h2> inside .caption-box) keep their own
   size (--site-fs-banner); only the <h1> page titles were made smaller. */
:root:not(#_t) body .caption-box :is(h1, h2) { font-size: var(--site-fs-banner) !important; }

/* Homepage stats strip (100+ Faculty, 3,300+ Students, 15+ MoUs, 14,000+ Alumni):
   numbers and labels both 12px. */
:root:not(#_t) body .stats-bar .stat-text :is(h2, p) { font-size: 12px !important; }

/* Faculty List cards on department pages: compact sizes. */
:root:not(#_t) body .faculty-card h5 { font-size: 13px !important; }
:root:not(#_t) body .faculty-card p,
:root:not(#_t) body .faculty-card p :is(i, b, strong, span, a) { font-size: 12px !important; }
