﻿/* =========================================
   BASE LAYOUT (Sticky Footer)
========================================= */

html, body {
  height: 100%;
  margin: 0;
}


body {
  display: flex;
  flex-direction: column;
  font-family: var(--font-base);
  color: var(--text-primary);
  background: var(--bg-surface);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================
   SKIP-TO-CONTENT (Accessibility)
========================================= */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary-color);
  color: var(--text-on-dark);
  padding: 10px 20px;
  z-index: 9999;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}

main {
  flex: 1;
}

a {
  text-decoration: none;
  color: inherit;
}

.auth-form a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Links inside main content areas should look like links */
.home-section a,
.nm-content a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.home-section a:hover,
.nm-content a:hover {
  color: var(--link-hover-color);
}

/* =========================================
   HEADER
========================================= */

.site-header {
  background: var(--bg-page);
}

.site-container {
    max-width: 1290px;
    margin: 0 auto;
}

/* ---------- CMU RED TOP BAR ---------- */
.topbar {
  background: var(--primary-color);
  padding: 10px 0;
}

.topbar__inner {
  padding: 0 24px;
}

  .topbar img {
    filter: brightness(0) invert(1);
  }

/* ---------- BLACK BRAND BAR ---------- */
.brandbar {
  background: var(--bg-dark-bar);
  color: var(--text-on-dark);
  padding: 14px 0;
}

.brandbar__inner {
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.brand {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-wrap: nowrap;
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-on-dark);
  margin: 0;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-on-dark);
  opacity: 0.9;
  margin-top: 2px;
}

/* =========================================
   DESKTOP NAVIGATION
========================================= */

.nav {
  display: flex;
  align-items: center;
  margin-left: auto; /* push nav to the right */
}

  .nav > ul {
    list-style: none;
    display: flex;
    gap: 18px;
    padding: 0;
    margin: 0;
    flex-wrap: nowrap;
  }

    .nav > ul > li {
      position: relative;
    }

      .nav > ul > li > a {
        color: var(--text-on-dark);
        font-size: 14px;
        font-weight: 400;
        white-space: nowrap;
        padding: 6px 0;
        border-bottom: 2px solid transparent;
        transition: border-color 0.2s ease;
        text-decoration: none;
      }

        .nav > ul > li > a:hover {
          border-bottom-color: var(--text-on-dark);
          text-decoration: none;
        }

  .nav li.active > a,
  .nav a[aria-current="page"] {
    border-bottom-color: var(--text-on-dark);
  }

  .nav a:visited {
    color: var(--text-on-dark);
  }

  /* Dropdown support (optional) */
  .nav li ul {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-dropdown);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 180px;
    display: none;
    flex-direction: column;
  }

  .nav li:hover > ul {
    display: flex;
  }

  .nav li ul a {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-on-dark);
    display: block;
    text-decoration: none;
  }

    .nav li ul a:hover {
      background: var(--bg-dropdown-hover);
      text-decoration: none;
    }

/* =========================================
   CONTENT WRAPPER + MAIN
========================================= */

/* =========================================
   AUTH NAV (sign in / sign out)
========================================= */

.auth-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.auth-username {
  color: var(--text-on-dark-muted);
  font-size: 17px;
  font-weight: 600;
}

.btn-auth {
  font-size: 15px;
  padding: 6px 16px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-auth-signin {
  background: var(--cmu-red);
  color: var(--text-on-dark);
}

.btn-auth-signin:hover {
  background: var(--cmu-red-hover);
  color: var(--text-on-dark);
  text-decoration: none;
}

.btn-auth-signout {
  background: transparent;
  color: var(--text-on-dark-muted);
  border: 1px solid var(--border-on-dark);
}

.btn-auth-signout:hover {
  background: var(--bg-dark-bar-hover);
  color: var(--text-on-dark);
}

.btn-auth-admin {
  background: transparent;
  color: var(--text-on-dark);
  border: 1px solid var(--cmu-red);
}

.btn-auth-admin:hover {
  background: var(--cmu-red);
  color: var(--text-on-dark);
  text-decoration: none;
}

/* CMU Primary Button — overrides Bootstrap default blue */
.btn-primary {
  background-color: var(--cmu-red);
  border-color: var(--cmu-red);
  color: var(--text-on-dark);
  font-weight: 600;
  padding: 10px 28px;
  border-radius: 4px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--cmu-red-hover);
  border-color: var(--cmu-red-hover);
  color: var(--text-on-dark);
}
.btn-primary:active {
  background-color: var(--cmu-red-active);
  border-color: var(--cmu-red-active);
}

/* =========================================
   MAIN CONTENT
========================================= */

.site-main {
  background: var(--bg-page);
  padding: 0;
  max-width: none;
  margin: 0;
  overflow-x: hidden;          /* prevent scrollbar from hero full-bleed */
  transition: background-color 0.3s ease;
}

.container,
.content-item,
.content-container {
  max-width: none;
  padding: 40px 24px;
}

/* Responsive images — prevent content images from overflowing */
.container img {
  max-width: 100%;
  height: auto;
}

/* =========================================
   HOMEPAGE HERO SLIDER (Centered like sample)
========================================= */

.home-hero {
  padding: 0;
}

/* Full-width hero band */
.home-hero__slider {
  position: relative;
  height: 450px;
  overflow: hidden;
  background-image: url('../images/hero-bg.jpg'); /* default; overridden by CMS inline style if set */
  background-size: cover;
  background-position: center 40%;
}

  /* Overlay — darkens photo so white text stays readable */
  .home-hero__slider::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    pointer-events: none;
  }

/* Create positioning + centering context */
.home-hero__inner {
  position: relative;
  z-index: 1;
  height: 100%;
}

/* Slides fill hero and fade */
.home-hero__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 400ms cubic-bezier(0.25, 1, 0.5, 1),
              visibility 0s 400ms; /* hide after fade-out completes */
}

  .home-hero__slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 400ms cubic-bezier(0.25, 1, 0.5, 1),
                visibility 0s; /* show immediately */
  }

/* Headline */
.home-hero__headline {
  margin: 0;
  margin-left: max(24px, calc((100% - 1290px) / 2 + 24px));
  color: var(--text-on-dark);
  font-weight: bold;
  letter-spacing: normal;
  font-size: clamp(44px, 3vw, 72px);
  line-height: 1.05;
  max-width: 680px;
  text-align: left;
  text-shadow: 0 2px 10px rgba(0,0,0,0.45);
}

.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
  margin-bottom: .5rem;
  font-weight: 500;
  line-height: 1.2;
  font-weight: bold;
}

/* Tighten spacing between hero and content */
.home-hero > .container {
  padding-top: 26px;
}

/* Hero slider breaks out of col-8 to span the full viewport */
@media (min-width: 992px) {
  .home-hero__slider {
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
  }
}

/* =========================================
   HOMEPAGE GRID
========================================= */

.home-grid {
    display: grid;
    /*grid-template-columns: 1fr 380px;*/
    max-width: 100%;
    grid-template-columns: minmax(0, calc(65% - ((80px * 1 )/2)))minmax(0, calc(35% - ((80px * 1 )/2)));
    gap: 80px;
    align-items: stretch;
}

.home-main {
  /*max-width: 740px;*/
}

.home-name {
  margin: 8px 0 6px;
  font-size: 34px;
}

.home-position {
  margin: 0 0 18px;
  font-size: 14px;
  opacity: 0.9;
}

.home-section {
  margin-top: 24px;
  line-height: 1.7;
}

  .home-section p {
    margin: 12px 0;
    line-height: 1.7;
  }

  .home-section h2 {
    margin-top: 22px;
    margin-bottom: 10px;
    font-size: 26px;
  }


/* =========================================
   RIGHT CONTACT CARD
========================================= */

.contact-card {
  background: var(--bg-dark-bar);
  color: var(--text-on-dark);
  padding: 22px;
}

.contact-card__portrait {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 14px;
}

.contact-card__name {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 6px;
}

.contact-card__title {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 4px;
}

.contact-card__divider {
  height: 1px;
  background: rgba(255,255,255,0.2);
  margin: 14px 0;
}

.contact-card__row {
  margin: 10px 0;
}

.contact-card__label {
  font-size: 11px;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-card__value {
  font-size: 13px;
}

.contact-card a {
  color: var(--text-on-dark);
  text-decoration: underline;
}

.contact-card__button {
  display: block;
  margin-top: 16px;
  background: var(--cmu-red);
  color: var(--text-on-dark);
  text-decoration: none;
  text-align: center;
  padding: 10px 12px;
  font-weight: 700;
}


/* =========================================
   SIDEBAR CONTACT PANEL (matches sample)
========================================= */

.sidebar-wrapper {
    display: flex;
    flex-direction: column;
}

.home-sidebar {
  background-color: var(--bg-dark-bar);  
  display: flex;
  flex-direction: column;
}

.contact-panel {
    margin-top: -377px; /* pull sidebar up to overlap the hero band */
    position: relative;
    z-index: 2; /* sit above the hero overlay */
    background: var(--bg-dark-bar);
    color: var(--text-on-dark);
    padding: 22px;
}

/* square photo area */
.contact-panel__photo {
  margin-bottom: 18px;
}

.contact-panel__photo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* big heading */
.contact-panel__heading {
  margin: 0 0 14px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-on-dark);
}

.contact-panel__items {
  margin-top: 6px;
}

.contact-panel__item {
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-panel__icon {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.75;
}

.contact-panel__link {
  color: var(--text-on-dark);
  text-decoration: underline;
}

.contact-panel__text {
  color: var(--text-on-dark);
  line-height: 1.5;
}

/* CV link */
.contact-panel__cv {
  display: block;
  margin-top: 16px;
  color: var(--link-on-dark);
  text-decoration: none;
  font-weight: 700;
}

.contact-panel__cv:hover {
  color: var(--link-on-dark-hover);
  text-decoration: underline;
}

/* Divider bar */
.contact-panel__bar {
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  margin: 16px 0;
}

/* Academic / Social profile links */
.contact-panel__profiles {
  display: flex;
  gap: 16px;
  justify-content: flex-start;
  margin-top: 4px;
  padding: 0 16px;
}

.contact-panel__profile-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-on-dark, #fff);
  font-size: 1.2rem;
  transition: background 0.2s, transform 0.2s;
  text-decoration: none;
}

.contact-panel__profile-link:hover {
  background: rgba(255, 255, 255, 0.3);
  color: var(--text-on-dark, #fff);
  transform: scale(1.1);
  text-decoration: none;
}

/* =========================================
   Blog / News Listing
========================================= */
.field-name-blog-image img,
.field-name-blog-post-image img {
  width: 66vw;
  height: auto;
}


/* =========================================
   FOOTER
========================================= */

.site-footer {
  background: var(--bg-footer);
  color: var(--text-on-dark);
  padding: 16px 0;
  font-size: 14px;
}

.footer__inner {
    padding: 0 24px;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1024px) {
/*  .home-grid {
    grid-template-columns: 1fr;
  }*/
  .contact-panel {
    margin-top: 8px;   /* reset overlap when stacked */
  }
}

@media (max-width: 900px) {
  .nav > ul {
    gap: 16px;
  }
}

/* =========================================
   HAMBURGER BUTTON
========================================= */

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

.nav-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-on-dark);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* X state when open */
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* brand link reset */
a.brand {
  text-decoration: none;
  color: inherit;
}
a.brand:hover {
  text-decoration: none;
  color: inherit;
}

/* Auto-collapse nav when items overflow (JS adds nav--overflow to .brandbar__inner) */
.nav--overflow .nav-hamburger {
  display: flex;
  order: 3;
  margin-left: 12px;
}
.nav--overflow .nav {
  display: none;
  width: 100%;
  order: 4;
}
.nav--overflow .nav.is-open {
  display: block;
}
.nav--overflow .nav > ul {
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
}
.nav--overflow .nav > ul > li > a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-on-dark);
}
.nav--overflow {
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .brandbar__inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  /* Brand takes remaining space, pushing auth + hamburger right */
  .brandbar__inner > .brand {
    flex: 1;
    min-width: 0;
  }

  /* Sign In sits to the left of the hamburger */
  .auth-nav {
    order: 3;
    width: 100%;
  }

  .nav-hamburger {
    display: flex;
    order: 3;
    margin-left: 12px;
  }

  .nav {
    display: none;
    width: 100%;
    order: 4;
  }

  .nav.is-open {
    display: block;
  }

  .nav > ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }

  .nav > ul > li > a {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-on-dark);
  }

  /* When the menu IS open, slide auth-nav below the menu links */
  .nav.is-open ~ .auth-nav {
    order: 5;
    width: 100%;
    padding: 8px 0;
  }

  .home-hero__slider {
    height: 220px;
  }

  .home-hero__headline {
    max-width: 92%;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .contact-panel__photo img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
  }
}


/* Responsive table wrapper — enables horizontal scroll on narrow viewports */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.media-table {
   width: 100%;
   border-collapse: collapse;
   margin: 20px 0;
   font-family: sans-serif;
   font-size: 0.9rem;
   min-width: 520px; /* ensure columns don't collapse */
 }

.media-table thead tr {
  border-bottom: 2px solid var(--border-medium);
  text-align: left;
  font-weight: bold;
}

.media-table th, .media-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-light);
}

.media-table tbody tr:hover {
  background-color: var(--table-row-hover);
}

/* =========================================
   PAGE HERO HEADER (Paper / APModel / Teaching)
========================================= */

.nm-hero,
.content-item > header,
.content-container > .section-header {
  background: var(--bg-surface);
  border-bottom: 3px solid var(--cmu-red);
  padding: 28px 0 24px;
  margin-bottom: 28px;
}

.nm-hero h1,
.content-item > header h1,
.content-container > .section-header .section-header__title {
  font-size: 30px;
  font-weight: 700;
  margin: 0;
  padding-left: 16px;
  border-left: 4px solid var(--cmu-red);
  line-height: 1.2;
  color: var(--text-primary);
}

/* Section-header title icons — CMU red */
.content-container > .section-header .section-header__title i {
  color: var(--cmu-red);
  margin-right: 8px;
}

/* Item count below section-header title */
.content-container > .section-header .section-header__count {
  padding-left: 16px;
  margin-top: 4px;
}

/* =========================================
   PAGE CONTENT BODY (Markdown)
========================================= */

.nm-content {
  max-width: 900px;
  margin-bottom: 32px;
  line-height: 1.65;
  color: var(--text-primary);
}

.nm-content p {
  margin: 0 0 1em;
}

.nm-content h2 {
  font-size: 24px;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.nm-content h3 {
  font-size: 20px;
  margin-top: 1.25em;
  margin-bottom: 0.4em;
}

/* =========================================
   AUTH GATE CARD (Members Only)
========================================= */

.auth-card {
  max-width: 520px;
  margin: 32px auto;
}

.auth-card .card-body {
  padding: 2.5rem 2rem;
}

.auth-card__icon {
  font-size: 2.5rem;
}

.auth-card .btn-cmu {
  background-color: var(--cmu-red);
  border-color: var(--cmu-red);
  color: var(--text-on-dark);
}

.auth-card .btn-cmu:hover {
  background-color: var(--cmu-red-hover);
  border-color: var(--cmu-red-hover);
  color: var(--text-on-dark);
}

/* =========================================
   PAPER / FILE TABLE
========================================= */

.table-responsive {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.paper-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9rem;
  min-width: 520px; /* ensure columns don't collapse */
}

.paper-table thead tr {
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border-medium);
  text-align: left;
}

.paper-table th {
  padding: 12px 15px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.paper-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-light);
}

.paper-table tbody tr:hover {
  background-color: var(--table-row-hover);
}

.paper-table tbody tr:last-child td {
  border-bottom: none;
}

.paper-table th:last-child,
.paper-table td:last-child {
  text-align: center;
}

.btn-download {
  color: var(--link-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: color 0.2s ease;
}

.btn-download:hover {
  color: var(--link-hover-color);
}

/* =========================================
   ENHANCED FILE CARDS — Toolbar
========================================= */

.file-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.file-search {
  flex: 1;
  min-width: 180px;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 12px center;
  outline: none;
  transition: border-color 0.15s ease;
}
.file-search:focus { border-color: var(--cmu-red); }

.file-filter-btn {
  padding: 7px 14px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--card-bg);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.file-filter-btn:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}
.file-filter-btn.active {
  background: var(--cmu-red);
  color: var(--text-on-dark);
  border-color: var(--cmu-red);
}

.file-sort-select {
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--card-bg);
  cursor: pointer;
  outline: none;
}
.file-sort-select:focus { border-color: var(--cmu-red); }

.file-stats {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* =========================================
   ENHANCED FILE CARDS — Card Grid
========================================= */

.file-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.file-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  background: var(--card-bg);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.file-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.file-card__icon {
  font-size: 30px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
  margin-top: 2px;
}
.file-card__icon.pdf     { color: var(--accent-red); }
.file-card__icon.word    { color: var(--icon-word); }
.file-card__icon.zip     { color: var(--icon-zip); }
.file-card__icon.excel   { color: var(--icon-excel); }
.file-card__icon.data    { color: var(--icon-data); }
.file-card__icon.generic { color: var(--text-muted); }

.file-card__body {
  flex: 1;
  min-width: 0;
}

.file-card__name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
  word-break: break-word;
  line-height: 1.3;
}

.file-card__meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  align-items: center;
}
.file-card__meta i { font-size: 11px; }

.file-card__download {
  flex-shrink: 0;
  align-self: center;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--accent-red);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.15s ease;
  font-size: 14px;
}
.file-card__download:hover {
  background: var(--cmu-red);
  color: var(--text-on-dark);
  border-color: var(--cmu-red);
}

/* Dark-mode card hover */
html[data-theme="dark"] .file-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Mobile: single column, smaller cards */
@media (max-width: 768px) {
  .file-toolbar {
    gap: 8px;
  }
  .file-filter-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .file-cards {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   FILE LOADING SPINNER
========================================= */

.file-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.file-spinner__wheel {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: file-spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes file-spin {
  to { transform: rotate(360deg); }
}

.file-error {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
}

/* =========================================
   APEEP AUTH GATE — Register / Sign-In Card
========================================= */

.access-box {
  max-width: 460px;
  margin: 30px auto;
  border: 2px solid var(--cmu-red);
  border-radius: 8px;
  padding: 28px 32px;
  background: var(--access-box-bg);
  text-align: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.access-box__title {
  font-family: var(--font-base, 'Open Sans', Arial, Helvetica, sans-serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.access-box__row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 12px 0;
  font-size: 16px;
}

.access-box__row span {
  color: var(--text-secondary);
}

.access-box__row a {
  font-weight: 600;
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.access-box__row a:hover {
  color: var(--link-hover-color);
}

/* =========================================
   LOGIN / REGISTER FORM LINKS
========================================= */

.auth-form a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.auth-form a:hover {
  color: var(--link-hover-color);
}

/* =========================================
   RESPONSIVE TABLE → CARD LAYOUT (mobile)
========================================= */

@media (max-width: 768px) {
  /* Remove the min-width so it doesn't force horizontal scroll */
  .paper-table {
    min-width: 0;
  }

  .paper-table thead {
    display: none;               /* hide column headers */
  }

  .paper-table,
  .paper-table tbody,
  .paper-table tr,
  .paper-table td {
    display: block;
    width: 100%;
  }

  .paper-table tr {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
  }

  .paper-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: none;
    font-size: 0.85rem;
  }

  /* Label from data-label attribute */
  .paper-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    margin-right: 12px;
  }

  /* File name row — full width, larger text */
  .paper-table td:first-child {
    font-weight: 600;
    font-size: 0.95rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
    word-break: break-all;
  }

  /* Download cell — no label needed, just show icon */
  .paper-table td:last-child::before {
    content: attr(data-label);
  }

  .paper-table td:last-child {
    text-align: right;
  }
}

/* =========================================
   ACCESSIBILITY — Focus Styles
========================================= */

/* Visible focus ring for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 2px;
}

/* Nav links — white focus ring on dark background */
.nav a:focus-visible,
.brandbar a:focus-visible,
.btn-auth:focus-visible,
.contact-panel a:focus-visible,
.site-footer a:focus-visible {
  outline-color: var(--text-on-dark);
}

/* =========================================
   RESPONSIVE — Tablet Hero Text
========================================= */

@media (max-width: 900px) {
  .home-hero__headline {
    font-size: clamp(22px, 4vw, 36px);
    max-width: 90%;
  }
}

@media (max-width: 768px) {
  .home-hero__headline {
    font-size: clamp(20px, 4.5vw, 30px);
    max-width: 92%;
  }

  .theme-toggle {
    order: 2;
  }
}

/* =========================================
   THEME TOGGLE BUTTON
========================================= */

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-on-dark);
  border-radius: 4px;
  cursor: pointer;
  padding: 4px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-dark);
  transition: background 0.2s ease;
  width: 32px;
  height: 28px;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-dark-bar-hover);
}

/* Hide all icons by default; show only the active one */
.theme-icon { display: none; }

[data-theme-setting="light"] .theme-icon--light { display: block; }
[data-theme-setting="dark"] .theme-icon--dark { display: block; }
[data-theme-setting="auto"] .theme-icon--auto { display: block; }

/* =========================================
   BOOTSTRAP DARK-MODE OVERRIDES
   Bootstrap components have hardcoded white
   backgrounds that break dark mode.
========================================= */

html[data-theme="dark"] .list-group-item {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}

html[data-theme="dark"] .card {
  background-color: var(--card-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
}

html[data-theme="dark"] .alert {
  color: var(--text-primary);
}

html[data-theme="dark"] .alert-danger {
  background-color: var(--alert-danger-bg);
  color: var(--alert-danger-text);
  border-color: var(--alert-danger-border);
}

html[data-theme="dark"] .form-control {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}

html[data-theme="dark"] .btn-outline-secondary {
  color: var(--text-secondary);
  border-color: var(--border-color);
}

html[data-theme="dark"] .btn-outline-secondary:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* =========================================
   BADGES (Status, Type, Category)
========================================= */

.badge-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-active {
    background: var(--badge-active);
    color: var(--text-on-dark);
}

.badge-completed {
    background: var(--badge-completed);
    color: var(--text-on-dark);
}

.badge-planned {
    background: var(--badge-planned);
    color: var(--badge-text-on-light);
}

.badge-current {
    background: var(--badge-current);
    color: var(--text-on-dark);
}

.badge-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--secondary-color);
    color: var(--text-on-dark);
}

.badge-type--journal { background: var(--badge-type-journal); }
.badge-type--conference { background: var(--badge-type-conference); color: var(--badge-text-on-light); }
.badge-type--book { background: var(--badge-type-book); }
.badge-type--working { background: var(--badge-type-working); }
.badge-type--chapter { background: var(--badge-type-chapter); }
.badge-type--preprint { background: var(--badge-type-preprint); }
.badge-type--thesis { background: var(--badge-type-thesis); }

/* Publication summary card — Scholars-style */
.pub-card { padding: 16px 0; border-top: 1px solid var(--border-light); }
.pub-card:first-child { border-top: none; }
.pub-card__type {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cmu-red);
    margin-bottom: 6px;
}
.pub-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 6px 0;
}
.pub-card__title a { color: var(--text-primary); text-decoration: none; }
.pub-card__title a:hover { text-decoration: underline; }
.pub-card__meta, .pub-card__citation, .pub-card__authors, .pub-card__doi {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 2px 0;
}
.pub-card__authors i { color: var(--text-muted); margin-right: 6px; }
.pub-card__abstract {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-top: 8px;
    line-height: 1.45;
}
.pub-card__footer {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    font-size: 0.85rem;
}
.pub-card__citations {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-secondary);
}
.pub-card__footer .oa-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.8rem;
}
.pub-card__footer .more-link { color: var(--cmu-red); text-decoration: none; margin-left: auto; }
.pub-card__footer .more-link:hover { text-decoration: underline; }

/* Publication list controls (search + sort + count) */
.pub-list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.pub-list-controls__search { flex: 0 1 260px; }
.pub-list-controls__sort { flex: 0 0 auto; }
.pub-list-controls__count { color: var(--text-secondary); font-size: 0.875rem; margin-left: auto; }

/* Back-to-list link on publication detail pages */
.publication-detail__back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.publication-detail__back-link:hover { color: var(--cmu-red); text-decoration: underline; }
.publication-detail__back-link i { font-size: 0.8em; }

.badge-category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* =========================================
   PUBLICATION STYLES
========================================= */

.publication-detail {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 0;
}

.publication-detail__header {
    margin-bottom: 24px;
}

.publication-detail__title {
    font-size: 1.75rem;
    margin-bottom: 12px;
}

.publication-detail__meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.publication-detail__authors {
    font-weight: 600;
    margin-bottom: 4px;
}

.publication-detail__journal {
    font-style: italic;
}

.publication-detail__doi {
    margin-top: 8px;
}

.publication-detail__doi a {
    color: var(--link-color);
    word-break: break-all;
}

.publication-detail__abstract {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-surface);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.publication-detail__abstract h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.publication-detail__actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Publication summary (citation format) */
.publication-summary {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.6;
}

.publication-summary:last-child {
    border-bottom: none;
}

.publication-summary__citation {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.publication-summary__title {
    font-weight: 600;
}

.publication-summary__journal {
    font-style: italic;
}

.publication-summary__links {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 4px;
    font-size: 0.85rem;
}

.publication-summary__doi {
    color: var(--link-color);
    text-decoration: none;
}

.publication-summary__doi:hover {
    text-decoration: underline;
}

.publication-summary__pdf {
    color: var(--accent-red);
    text-decoration: none;
    font-weight: 600;
}

.publication-summary__pdf:hover {
    text-decoration: underline;
}

/* =========================================
   COURSE STYLES
========================================= */

.course-detail {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 0;
}

.course-detail__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.course-detail__number {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.course-detail__title {
    font-size: 1.75rem;
    margin-bottom: 4px;
}

.course-detail__semester {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.course-detail__description {
    margin-top: 24px;
    line-height: 1.7;
}

.course-detail__syllabus {
    margin-top: 20px;
}

/* Course summary — card-style tile inside the semester grid */
.course-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    gap: 12px;
}

.course-summary:hover {
    border-color: var(--cmu-red, var(--primary-color));
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.course-summary__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.course-summary__number {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: block;
}

.course-summary__title {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.35;
    color: var(--text-primary);
    text-decoration: none;
}

.course-summary__title:hover {
    color: var(--cmu-red, var(--primary-color));
    text-decoration: underline;
}

.course-summary__semester {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Semester grouping (legacy — kept for back-compat) */
.semester-group {
    margin-bottom: 32px;
}

.semester-group__heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 12px;
}

/* Lead-in paragraph above a section list (e.g. Courses intro) */
.section-intro {
    max-width: 860px;
    margin: 4px 0 24px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.65;
}

.section-intro p {
    margin: 0 0 12px 0;
}

.section-intro p:last-child {
    margin-bottom: 0;
}

/* Semester groups on the Teaching page */
.course-group {
    margin-bottom: 36px;
}

.course-group__heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 10px 0;
    margin: 0 0 16px 0;
    border-bottom: 2px solid var(--border-color);
}

.course-group__heading i {
    color: var(--cmu-red, var(--primary-color));
}

.course-group__heading-sub {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
}

.course-group__count {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

/* Current-teaching group — more prominent */
.course-group--current .course-group__heading {
    border-bottom-color: var(--cmu-red, var(--primary-color));
    border-bottom-width: 3px;
    color: var(--cmu-red, var(--primary-color));
    font-size: 1.3rem;
}

.course-group--current .course-summary {
    border-color: color-mix(in srgb, var(--cmu-red, var(--primary-color)) 35%, var(--border-color));
    background: color-mix(in srgb, var(--cmu-red, var(--primary-color)) 3%, var(--bg-card));
}

/* Academic-year grouping — wraps semester groups */
.course-academic-year {
    margin-bottom: 40px;
}

.course-academic-year__heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    padding: 10px 0 8px;
    border-bottom: 3px solid var(--cmu-red, var(--primary-color));
}

.course-academic-year .course-group {
    margin-bottom: 24px;
}

.course-academic-year .course-group__heading {
    font-size: 1rem;
    border-bottom-width: 1px;
    border-bottom-style: dashed;
    padding: 6px 0;
    margin-bottom: 12px;
}

/* =========================================
   LAB MEMBER GRID
========================================= */

.lab-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.lab-member-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.lab-member-card:hover {
    box-shadow: var(--shadow-md);
}

.lab-member-card__photo {
    width: 100%;
    height: 240px;
    object-fit: cover;
    object-position: top;
}

.lab-member-card__body {
    padding: 16px;
}

.lab-member-card__name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.lab-member-card__role {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.lab-member-card__bio {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.lab-member-card__links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.lab-member-card__links a {
    color: var(--text-secondary);
    font-size: 16px;
    transition: color 0.2s ease;
}

.lab-member-card__links a:hover {
    color: var(--link-color);
}

/* Lab member list → 3-column grid (matches QA card layout) */
.list-group:has(.lab-member-summary) {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: none;
}

.list-group:has(.lab-member-summary) > .list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
}

@media (max-width: 768px) {
    .list-group:has(.lab-member-summary) {
        grid-template-columns: 1fr;
    }
}

/* Lab member summary (compact) */
.lab-member-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: none;
}

.lab-member-summary__photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.lab-member-summary__name {
    font-weight: 600;
    font-size: 0.9rem;
}

.lab-member-summary__role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =========================================
   RESEARCH PROJECT STYLES
========================================= */

.project-detail {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 0;
}

.project-detail__header {
    margin-bottom: 24px;
}

.project-detail__title {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.project-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.project-detail__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.project-detail__description {
    line-height: 1.7;
    margin-bottom: 24px;
}

.project-detail__collaborators {
    margin-top: 20px;
}

.project-detail__collaborators h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

/* Project summary card */
.project-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    transition: box-shadow 0.2s ease;
}

.project-summary:hover {
    box-shadow: var(--shadow-md);
}

.project-summary__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.project-summary__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.project-summary__dates {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =========================================
   AWARD STYLES
========================================= */

.award-detail {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 0;
}

.award-detail__header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.award-detail__year {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-red);
    flex-shrink: 0;
    min-width: 80px;
}

.award-detail__info {
    flex: 1;
}

.award-detail__title {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.award-detail__body {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.award-detail__description {
    margin-top: 16px;
    line-height: 1.7;
}

/* Award timeline */
.award-timeline {
    position: relative;
    padding-left: 20px;
}

.award-timeline::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.award-timeline__item {
    position: relative;
    padding: 16px 0 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.award-timeline__item::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 22px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid var(--bg-page);
}

.award-timeline__year {
    font-weight: 700;
    color: var(--accent-red);
    font-size: 0.9rem;
}

.award-timeline__title {
    font-weight: 600;
    font-size: 1rem;
    margin-top: 2px;
}

.award-timeline__body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* =========================================
   EVENT STYLES
========================================= */

.event-detail {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 0;
}

.event-detail__header {
    margin-bottom: 24px;
}

.event-detail__title {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.event-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.event-detail__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-detail__meta-item i,
.project-detail__meta-item i,
.project-summary__meta i,
.project-summary__dates i {
    margin-right: 4px;
}

.event-detail__description {
    margin-top: 24px;
    line-height: 1.7;
}

.event-detail__links {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Event timeline */
.event-timeline__item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.event-timeline__date {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
}

.event-timeline__month {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.event-timeline__day {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-red);
    line-height: 1;
}

.event-timeline__content {
    flex: 1;
}

.event-timeline__title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.event-timeline__venue {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =========================================
   NEWS STYLES
========================================= */

.news-detail {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 0;
}

.news-detail__header {
    margin-bottom: 24px;
}

.news-detail__title {
    font-size: 2rem;
    margin-bottom: 8px;
}

.news-detail__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.news-detail__featured-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.news-detail__body {
    line-height: 1.7;
    font-size: 1rem;
}

/* Link styling inside rendered rich-text bodies — covers every content type
   whose detail/card view renders WYSIWYG or Markdown content via @Html.Raw. */
.news-detail__body a,
.blog-detail__body a,
.course-detail__description a,
.event-detail__description a,
.lab-member-card__bio a,
.home-section a,
.project-detail__description a,
.award-detail__description a {
    color: var(--link-color);
    text-decoration: underline;
}

.news-detail__body a:hover,
.blog-detail__body a:hover,
.course-detail__description a:hover,
.event-detail__description a:hover,
.lab-member-card__bio a:hover,
.home-section a:hover,
.project-detail__description a:hover,
.award-detail__description a:hover {
    color: var(--link-hover-color);
}

/* News list → 2-column grid (matches QA card layout) */
.list-group:has(.news-card) {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    border: none;
}

.list-group:has(.news-card) > .list-group-item {
    border: none;
    padding: 0;
    background: transparent;
}

@media (max-width: 768px) {
    .list-group:has(.news-card) {
        grid-template-columns: 1fr;
    }
}

/* News cards */
.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.news-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.news-card__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card__body {
    padding: 16px 20px;
}

.news-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.news-card__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.news-card__summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* =========================================
   BLOG POST STYLES
========================================= */

.blog-detail {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 0;
}

.blog-detail__title {
    font-size: 2.25rem;
    margin-bottom: 12px;
    line-height: 1.2;
}

.blog-detail__meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.blog-detail__body {
    line-height: 1.8;
    font-size: 1.05rem;
}

.blog-detail__body h2 { margin-top: 2rem; font-size: 1.5rem; }
.blog-detail__body h3 { margin-top: 1.5rem; font-size: 1.25rem; }

.blog-detail__body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1rem 0;
}

.blog-detail__body blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 12px 20px;
    margin: 1.5rem 0;
    background: var(--bg-surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.blog-detail__body pre {
    background: var(--bg-surface);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.9rem;
}

/* Blog summary card */
.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    transition: box-shadow 0.2s ease;
}

.blog-card:hover {
    box-shadow: var(--shadow-md);
}

.blog-card__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.blog-card__meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.blog-card__excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* =========================================
   GATED CONTENT
========================================= */

.gated-content {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-surface);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    margin: 20px 0;
}

.gated-content__icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.gated-content__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.gated-content__message {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* =========================================
   CONTENT CONTAINER (list pages)
========================================= */

.content-container {
    padding: 40px 24px;
}

/* =========================================
   SECTION LISTING PAGES
========================================= */

.section-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.section-header__title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.section-header__title i {
    color: var(--accent-red);
    margin-right: 8px;
}

.section-header__count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.section-list--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.section-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.section-empty__icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.3;
}

@media (max-width: 768px) {
    .section-list--grid {
        grid-template-columns: 1fr;
    }

    .section-header__title {
        font-size: 1.5rem;
    }

    .lab-members-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .news-detail__title,
    .blog-detail__title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .event-timeline__item {
        flex-direction: column;
        gap: 8px;
    }

    .event-timeline__date {
        width: auto;
        text-align: left;
        display: flex;
        gap: 8px;
        align-items: baseline;
    }

    .award-detail__header {
        flex-direction: column;
        gap: 8px;
    }
}

/* =========================================
   ERROR PAGES
========================================= */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 3rem 1.5rem;
    text-align: center;
}
.error-page__visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 10rem;
    margin-bottom: 1.5rem;
}
.error-page__code-bg {
    font-size: clamp(6rem, 15vw, 12rem);
    font-weight: 800;
    line-height: 1;
    color: var(--accent-red, #C41230);
    opacity: 0.08;
    position: absolute;
    user-select: none;
    pointer-events: none;
}
html[data-theme="dark"] .error-page__code-bg {
    opacity: 0.12;
}
.error-page__icon {
    position: relative;
    font-size: 4.5rem;
    color: var(--accent-red, #C41230);
}
.error-page__content {
    max-width: 500px;
    margin-bottom: 2rem;
}
.error-page__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary, #222);
    margin-bottom: 0.75rem;
}
.error-page__message {
    font-size: 1.05rem;
    color: var(--text-muted, #666);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}
.error-page__suggestion {
    font-size: 0.9rem;
    color: var(--text-secondary, #555);
    line-height: 1.5;
    margin-bottom: 0;
}
.error-page__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}
.error-page__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius, 8px);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.error-page__btn:focus-visible {
    outline: 2px solid var(--focus-ring-color, #C41230);
    outline-offset: 2px;
}
.error-page__btn--primary {
    background-color: var(--primary-color, #C41230);
    color: #fff;
    border: 1px solid transparent;
}
.error-page__btn--primary:hover {
    background-color: var(--cmu-red-hover, #a50f28);
    color: #fff;
}
.error-page__btn--secondary {
    background-color: var(--card-bg, #fff);
    color: var(--text-secondary, #555);
    border: 1px solid var(--border-color, #ddd);
}
.error-page__btn--secondary:hover {
    background-color: var(--bg-surface, #f8f8f8);
    color: var(--text-primary, #222);
    border-color: var(--text-muted, #999);
}

