/* === Global Variables === */
:root {
  --primary-bg: #f8f9fa;
  --primary-text: #1a1a1a;
  --accent-blue: #002b45;
  --accent-light: #005c97;
  --accent-hover: #0072b1;
  --card-bg: #ffffff;
  --card-border: #e0e0e0;
  --transition-fast: 0.25s ease;
  --max-content-width: 1400px; /* Increased from 1200px */
  --font-sans: 'Inter', system-ui, sans-serif; /* Inter for UI elements like navigation */
  --font-serif: 'Merriweather', Georgia, serif; /* Merriweather for headings */
  --font-body: 'Lora', serif; /* Lora for body text */
  --modal-bg: rgba(0, 0, 0, 0.7);
  --modal-content-bg: #fff;
  --dark-primary-bg: #1a1a1a;
  --dark-primary-text: #f1f1f1;
  --dark-card-bg: #2b2b2b;
  --dark-border: #444;
  --two-column-gap: 2rem; /* Added variable for two-column gap */
  --accordion-column-gap: 1.5rem; /* Specific gap for columns of accordions */
}

/* === Base Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body); /* Apply Lora as the primary body font */
  background: var(--primary-bg);
  color: var(--primary-text);
  line-height: 1.65;
  font-size: 16px;
  transition: background 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 70px; /* Space for fixed header */
  min-height: 100vh; /* Ensure body takes full viewport height */
}
body.dark-mode {
  background: var(--dark-primary-bg);
  color: var(--dark-primary-text);
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif); /* Apply Merriweather to headings */
    font-weight: 700;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 0;
}





/* === Typography & Content Lists (Rewritten from Scratch) === */

/* --- 1. Global List Resets --- */
/* Apply a base reset to all unordered and ordered lists.
   This ensures we start with no default browser margins/paddings on the UL/OL containers,
   allowing our specific rules to define indentation precisely. */
.static-content ul,
.static-content ol,
.accordion-content ul,
.accordion-content ol {
    margin-left: 0;         /* Remove default left margin */
    padding-left: 0;        /* Remove default left padding */
    margin-top: 1em;        /* Consistent space above the list block */
    margin-bottom: 1em;     /* Consistent space below the list block */
}

/* --- 2. General List Item (LI) Styling --- */
/* Apply common styles to all list items (LI), regardless of list type or nesting level. */
.static-content li,
.accordion-content li {
    line-height: 1.6;       /* Consistent line height for readability */
    margin-bottom: 0.5em;   /* Space between individual list items */
    /* Specific padding/indentation handled by more precise selectors below */
}


/* --- 3. Styling for TOP-LEVEL Lists (Direct children of .static-content or .accordion-content) --- */

/* 3.1 Top-Level UNORDERED LISTS (Standalone Bullet Points) */
.static-content > ul,
.accordion-content > ul {
    list-style: disc inside; /* Bullet is placed inside the LI's content flow */
    /* This padding-left positions the entire UL block.
       The bullets will start at (parent's 1.5rem padding + 25px) = ~49px from the content edge.
       This value is restored to the previous "rendering well" state for standalone bullets. */
    padding-left: 25px; 
}

/* 3.2 Top-Level ORDERED LISTS (Standalone Numbered Lists) */
.static-content > ol,
.accordion-content > ol {
    list-style-position: outside; /* Crucial: Numbers float outside the text block */
    /* This padding-left positions the *numbers* to align with the main content baseline (1.5rem / 24px). */
    padding-left: 1.5rem; 
}

/* 3.3 List Items within Top-Level ORDERED LISTS (`ol > li`) */
/* This defines how the text content of numbered items aligns relative to their numbers. */
.static-content > ol > li,
.accordion-content > ol > li {
    text-indent: 0; /* Ensures all lines of text align consistently */
    /* This padding-left creates a small gap between the number and the start of the text content.
       Text will start at (parent OL's 1.5rem + LI's 0.8em) = ~37px from content edge. */
    padding-left: 0.8em; 
    list-style-position: outside; /* Explicitly ensure number remains outside */
}


/* --- 4. Styling for NESTED LISTS (UL or OL that is a direct child of an LI) --- */

/* 4.1 Nested List Containers (`li > ul`, `li > ol`) */
/* Crucial: Set padding-left to 0 on the nested list container itself.
   This makes the nested list start exactly at the same horizontal position as its parent LI's text content. */
.static-content li > ul,
.static-content li > ol,
.accordion-content li > ul,
.accordion-content li > ol {
    margin-left: 0;        /* Ensure no inherited left margin */
    padding-left: 0;       /* Align perfectly with parent LI's text start */
    margin-top: 0.5em;     /* Smaller vertical gap above nested list */
    margin-bottom: 0.5em;  /* Smaller vertical gap below nested list */
}

/* 4.2 List Items within NESTED UNORDERED LISTS (`li > ul > li`) */
/* This ensures nested bullets align directly with the text content of the parent numbered item. */
.static-content li > ul > li,
.accordion-content li > ul > li {
    list-style: disc inside; /* Bullet is INSIDE the text flow.
                                 Because the parent UL has padding-left:0, this bullet
                                 will naturally align with the parent LI's text content. */
    /* No additional padding-left or text-indent needed here due to 'inside' and parent UL's padding. */
}

/* 4.3 List Items within NESTED ORDERED LISTS (`li > ol > li`) */
/* This creates a clean hanging indent for nested numbered lists, aligned with parent LI's text. */
.static-content li > ol > li,
.accordion-content li > ol > li {
    list-style-position: outside; /* Number floats outside the text block */
    /* These two properties create the hanging indent effect:
       padding-left pushes the text content right; negative text-indent pulls the number left into that space.
       The values are relative to the parent LI's text starting point. */
    padding-left: 1.5em; /* Space for the number + a small indent for text (e.g., 24px) */
    text-indent: -1.5em; /* Pulls the number back by the same amount */
}


/* --- 5. General Content Spacing within List Items --- */

/* Ensure headings (e.g., h3) within list items have consistent spacing and alignment */
.static-content li h3,
.accordion-content li h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

/* Ensure paragraphs directly within list items don't add extra undesirable indentation */
.static-content li p,
.accordion-content li p {
    margin-left: 0; 
    padding-left: 0;
}


/* --- 6. Final Clean-up --- */

/* Remove bottom margin from the very last list item in any list to prevent excess space. */
.static-content li:last-child,
.accordion-content li:last-child {
    margin-bottom: 0;
}

/* Also remove bottom margin from the very last direct child element within any list item.
   This catches cases where the last item is not an LI, but a paragraph, div, nested list, etc. */
.static-content li > *:last-child,
.accordion-content li > *:last-child {
    margin-bottom: 0;
}







/* === Header & Navigation === */
header {
  background: linear-gradient(to right, var(--accent-blue), var(--accent-light));
  color: white;
  padding: 0; /* Padding will be on header-content */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  width: 100%; /* Span full width */
  position: fixed; /* Fixed position */
  top: 0;
  left: 0;
  z-index: 1000; /* Stay on top */
  display: flex; /* Keep flex to align content inside header */
  justify-content: center; /* Center the inner content */
  align-items: center;
  height: 70px; /* Fixed height for header */
}

.header-content { /* Content inside the header */
  width: 90%; /* Constrain content width */
  max-width: var(--max-content-width); /* Constrain max-width */
  padding: 1rem 0; /* Vertical padding only, horizontal handled by width */
  display: flex;
  justify-content: space-between;
  align-items: center;
}





/* === Header Right Group === */
.header-right-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* === Desktop Navigation === */
nav {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: nowrap;
}
nav a {
  color: white;
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  font-weight: 400;
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  transition: background var(--transition-fast);
}
nav a:hover {
  background: rgba(255, 255, 255, 0.15);
}
nav a:focus-visible {
  outline: 2px dashed #fff;
  outline-offset: 2px;
}

.dropdown {
  position: relative;
}
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  background-color: white;
  color: var(--accent-blue);
  min-width: 200px;
  padding: 0.5rem 0;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  z-index: 1000;
}
.dropdown-content a {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  color: var(--accent-blue);
  text-decoration: none;
  text-transform: uppercase;
  transition: background var(--transition-fast);
}
.dropdown-content a:hover {
  background: #f0f4f8;
}
.dropdown:hover .dropdown-content {
  display: block;
}
.dropdown-toggle {
  color: white;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  text-transform: uppercase;
  border-radius: 5px;
  cursor: default;
  display: inline-block;
  transition: background var(--transition-fast);
}
.dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* === Dark Mode Toggle === */
.dark-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
}

/* === Hamburger Menu Icon === */
.hamburger-menu-icon {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  margin-left: 1rem;
  z-index: 1001;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.hamburger-menu-icon.active {
  transform: rotate(90deg);
}

/* === Mobile Menu Overlay === */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-bg);
  z-index: 2000;
  justify-content: flex-end;
  align-items: flex-start;
  transition: background-color 0.3s ease;
}
.mobile-menu-overlay.active {
  display: flex;
}
.mobile-menu-panel {
  background-color: var(--accent-blue);
  color: white;
  width: 60%;
  height: 100%;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
  padding-top: 70px;
  overflow-y: auto;
}
.mobile-menu-overlay.active .mobile-menu-panel {
  transform: translateX(0);
}

/* === Close Button === */
.mobile-menu-overlay .close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2001;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Mobile Menu Content === */
.mobile-menu-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 300px;
  margin: 1.5rem auto 0;
  padding: 0 1rem;
}
.mobile-menu-content > a {
  color: white;
  text-decoration: none;
  padding: 0.8rem 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  text-transform: uppercase;
  text-align: center;
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.mobile-menu-content > a:last-child {
  border-bottom: none;
}
.mobile-menu-content > a:hover {
  background: rgba(255, 255, 255, 0.1);
}
.mobile-menu-content .dark-toggle {
  padding: 0.8rem 0;
  border-bottom: none;
}

/* === Mobile Dropdown === */
.mobile-dropdown-container {
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.mobile-dropdown-container:last-of-type {
  border-bottom: none;
}
.mobile-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
}
.mobile-dropdown-header a {
  flex-grow: 1;
  text-align: center;
  padding: 0;
  color: white;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  text-transform: uppercase;
}
.mobile-dropdown-header a:hover {
  background: rgba(255, 255, 255, 0.1);
}
.mobile-dropdown-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  padding: 0.5rem;
  margin-left: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.mobile-dropdown-toggle.expanded {
  transform: rotate(180deg);
}
.mobile-dropdown-label {
  flex-grow: 1;
  text-align: center;
  color: white;
  font-family: var(--font-sans);
  font-size: 1rem;
  text-transform: uppercase;
  cursor: default;
}
.mobile-submenu {
  display: none;
  flex-direction: column;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.3rem 0;
  width: 100%;
}
.mobile-submenu.expanded {
  display: flex;
}
.mobile-submenu a {
  font-size: 0.9rem;
  padding: 0.6rem 0;
  text-align: center;
  color: white;
  text-decoration: none;
  font-family: var(--font-sans);
  text-transform: uppercase;
  transition: background 0.2s ease;
}
.mobile-submenu a:hover {
  background: rgba(255, 255, 255, 0.1);
}


/* Default: hide hamburger menu and show desktop nav */
.hamburger-menu-icon {
  display: none;
}

#desktop-nav {
  display: flex;
}
.hamburger-menu-icon {
  display: none;
}

/* Small screen: Hide desktop nav and show hamburger */
@media (max-width: 768px) {
  #desktop-nav {
    display: none;
  }
  .hamburger-menu-icon {
    display: block;
  }
}








/* === Main Layout Wrapper (Primary CSS Grid) === */
.main-layout-wrapper {
  display: grid;
  /* Define three primary columns:
     - col1: 60% of main content width (0.6 * 0.72 = 0.432 total width)
     - col2: 40% of main content width (0.4 * 0.72 = 0.288 total width)
     - col3: 28% for the sidebar
  */
  grid-template-columns: 43.2fr 28.8fr 28fr;
  /* Changed gap to explicitly define row-gap and column-gap */
  gap: 1rem 1.5rem; /* row-gap: 1rem, column-gap: 1.5rem */
  width: 90%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding-top: 1rem; /* Reduced from 2rem */
  margin-bottom: 3rem;
  flex-grow: 1; /* Allow main content to grow and push footer down */


  /* Desktop Grid Areas Definition:
     - 'campus' and 'about' span the first two columns.
     - 'sidebar-col' spans all rows in the third column.
     - 'left-main-col' and 'right-main-col' fill the lower main content area.
  */
  grid-template-areas:
    "campus          campus           sidebar-col"
    "about           about            sidebar-col"
    "left-main-col   right-main-col   sidebar-col";
}

/* NEW: Full-width layout for specific pages (e.g., research.md) */
.main-full-width {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 1.5rem; /* Match .main-layout-wrapper */
  
  width: 90%;
  max-width: var(--max-content-width);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;

  padding-top: 1rem;
  padding-bottom: 0.5rem;
  padding-left: 0;
  padding-right: 0;
  
  box-sizing: border-box;
  flex-grow: 1;
}

/* Ensure all direct children align visually */
.main-full-width > section {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  box-sizing: border-box;
}


/* NEW: Full-width layout for specific pages (e.g., based o n template.md) */


  .main-content-single {
    width: 90%;
    max-width: var(--max-content-width);
    margin: 2rem auto 3rem auto; /* top, horizontal auto, bottom */
    padding: 0; /* Vertical and horizontal padding */
    box-sizing: border-box;
  }

  .content-wrapper-single {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Creates space between the stacked sections */
  }





/* Assign grid areas to direct children of main-layout-wrapper */
#campus-photos-section { grid-area: campus; }
#about-ksom-section { grid-area: about; }
.left-accordion-col-wrapper { grid-area: left-main-col; }
.right-accordion-col-wrapper { grid-area: right-main-col; }
.sidebar-container { grid-area: sidebar-col; } /* New container for all sidebar items */


/* Flexbox for stacking elements within main content columns and sidebar */
.left-accordion-col-wrapper,
.right-accordion-col-wrapper,
.sidebar-container {
    display: flex;
    flex-direction: column;
    gap: 0.3rem; /* Consistent spacing between sections within these flex containers */
    padding: 0; /* Remove internal padding, handled by child elements */
    background: transparent; /* Remove background, handled by child elements */
    box-shadow: none; /* Remove shadow, handled by child elements */
}

/* --- Accordion Item Background Styles --- */

/* Default background for accordion items */
.accordion-item.default-bg {
    background-color: var(--card-bg); /* Use your primary card background color */
}

/* Alternate background for accordion items */
.accordion-item.alt-bg {
    background-color: var(--primary-bg); /* Use a slightly different background, like your primary page background */
    /* You might want a slightly darker/lighter shade for better contrast depending on your theme */
}

/* Common styling for all major content sections (accordion-items, etc.) */
.accordion-item {
    padding: 1.5rem; /* Default padding for all content sections */
    background: var(--card-bg);
    border: 1px solid var(--card-border); /* Add a subtle border */
    border-radius: 8px; /* Slightly rounded corners for a softer look */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); /* Subtle shadow for depth */
    box-sizing: border-box;
    cursor: pointer; /* Default cursor for clickable items */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; /* Smooth transition for hover effects */
    break-inside: avoid-column; /* Still relevant for print/column-flow scenarios if any */
    page-break-inside: avoid;
    text-decoration: none; /* Ensure no underline for accordion items used as links */
    color: inherit; /* Ensure text color is inherited for links */
    /* Removed margin-bottom to ensure 0 gap for accordions */
    margin-bottom: 0rem; /* Adds space below each accordion section */
    background-color: var(--card-bg); /* Use your defined card background for consistency */
}
.main-full-width > .accordion-item:last-child {
    margin-bottom: 0; /* No margin for the last item in a full-width container */
}


/* Specific styling for the very last accordion-item */
/* This now mainly applies to items within flex columns, not the main-full-width */
.accordion-item:last-of-type {
    margin-bottom: 0; /* Ensure no margin after the last item in a sequence */
}






/* === Static Block Sections (Reusable Class) === */
.static-section {
    cursor: default;
    transform: none;
    box-shadow: none;
    padding: 0 !important;
    background: transparent !important;
    margin-bottom: 0rem;
    gap: 0rem;
}

.static-section .accordion-header {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--accent-blue);
    font-weight: 700;
    font-family: var(--font-serif);
    display: block;
    cursor: default;
}


.static-section .accordion-content.static-content {
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 0.5rem;
}





/* === Tables inside static sections (scrollable wrapper included) === */
.static-section .table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Ensure table doesn't force layout overflow */
.static-section table {
  width: max-content; /* allows table to expand only as needed */
  min-width: 100%; /* avoids collapsing on large screens */
  margin: 1.5rem 0;
  border-collapse: collapse;
  background-color: transparent;
  font-size: 1rem;
}

/* Table cells and borders */
.static-section table th,
.static-section table td {
  border: 1px solid var(--border-light);
  padding: 0.75rem 1rem;
  text-align: left;
  white-space: nowrap; /* optional: prevents cell text from breaking to new line */
}

/* Header styling */
.static-section table th {
  background-color: var(--table-header-bg, #f2f2f2);
  font-weight: 600;
  color: var(--accent-dark);
}

/* Zebra striping */
.static-section table tr:nth-child(even) {
  background-color: var(--table-row-alt-bg, #fafafa);
}












/* === Dark Mode: Black Themed Accordions === */

body.dark-mode .static-section,
[data-theme="dark"] .static-section,
body.dark-mode .static-section.default-bg,
[data-theme="dark"] .static-section.default-bg,
body.dark-mode .accordion-item:not(.highlight-card),
[data-theme="dark"] .accordion-item:not(.highlight-card) {
  background-color: var(--dark-card-bg);
  color: var(--dark-primary-text);
  border: 1px solid var(--dark-border);
}

/* Inner content of accordions */
body.dark-mode .static-section .accordion-content,
[data-theme="dark"] .static-section .accordion-content,
body.dark-mode .accordion-item .accordion-content,
[data-theme="dark"] .accordion-item .accordion-content,
body.dark-mode .static-content,
[data-theme="dark"] .static-content {
  background-color: inherit;
  color: var(--dark-primary-text);
}

/* Headers */
body.dark-mode .static-section .accordion-header,
[data-theme="dark"] .static-section .accordion-header,
body.dark-mode .accordion-item .accordion-header,
[data-theme="dark"] .accordion-item .accordion-header {
  color: var(--accent-light);
  background-color: transparent;
}

/* Text elements */
body.dark-mode .static-section h2,
body.dark-mode .static-section h3,
body.dark-mode .static-section p,
body.dark-mode .static-section li,
[data-theme="dark"] .static-section h2,
[data-theme="dark"] .static-section h3,
[data-theme="dark"] .static-section p,
[data-theme="dark"] .static-section li {
  color: var(--dark-primary-text);
}

/* Lists */
body.dark-mode .static-section ul,
body.dark-mode .static-section ol,
[data-theme="dark"] .static-section ul,
[data-theme="dark"] .static-section ol {
  color: var(--dark-secondary-text);
}

/* Snippets for default (black) accordions */
body.dark-mode .accordion-snippet,
[data-theme="dark"] .accordion-snippet {
  background: transparent;
  color: var(--dark-secondary-text);
}
body.dark-mode .snippet-more-indicator,
[data-theme="dark"] .snippet-more-indicator {
  color: var(--accent-light);
}

/* Links */
body.dark-mode .static-section a,
[data-theme="dark"] .static-section a,
body.dark-mode .accordion-item a,
[data-theme="dark"] .accordion-item a {
  color: var(--accent-light);
  text-decoration: none;
}
body.dark-mode .static-section a:hover,
[data-theme="dark"] .static-section a:hover,
body.dark-mode .accordion-item a:hover,
[data-theme="dark"] .accordion-item a:hover {
  text-decoration: underline;
}

/* Tables inside black sections */
body.dark-mode .static-section table th,
[data-theme="dark"] .static-section table th {
  background-color: var(--dark-border);
  color: var(--dark-primary-text);
}
body.dark-mode .static-section table td,
body.dark-mode .static-section table tr:nth-child(even),
[data-theme="dark"] .static-section table td,
[data-theme="dark"] .static-section table tr:nth-child(even) {
  background-color: var(--dark-card-bg);
  color: var(--dark-secondary-text);
  border-color: var(--dark-border);
}






/* === Dark Mode: Blue Themed Accordions (Unified Styling) === */

body.dark-mode .static-blue-section,
[data-theme="dark"] .static-blue-section,
body.dark-mode .accordion-item.highlight-card,
[data-theme="dark"] .accordion-item.highlight-card {
  background-color: #1f3a4e !important;
  border: 1px solid #004066;
  color: var(--dark-primary-text);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Headings, paragraphs, content inside blue themed accordions */
body.dark-mode .static-blue-section .accordion-header,
body.dark-mode .static-blue-section .accordion-content,
body.dark-mode .static-blue-section .static-content,
body.dark-mode .static-blue-section p,
body.dark-mode .static-blue-section h1,
body.dark-mode .static-blue-section h2,
body.dark-mode .static-blue-section h3,
body.dark-mode .static-blue-section li,
body.dark-mode .static-blue-section ul,
body.dark-mode .static-blue-section ol,
[data-theme="dark"] .static-blue-section .accordion-header,
[data-theme="dark"] .static-blue-section .accordion-content,
[data-theme="dark"] .static-blue-section .static-content,
[data-theme="dark"] .static-blue-section p,
[data-theme="dark"] .static-blue-section h1,
[data-theme="dark"] .static-blue-section h2,
[data-theme="dark"] .static-blue-section h3,
[data-theme="dark"] .static-blue-section li,
[data-theme="dark"] .static-blue-section ul,
[data-theme="dark"] .static-blue-section ol {
  background-color: transparent;
  color: var(--dark-primary-text);
}

/* Clickable accordion header color */
body.dark-mode .accordion-item.highlight-card .accordion-header,
[data-theme="dark"] .accordion-item.highlight-card .accordion-header {
  color: #aad4ff;
}

/* Links inside both blue static and highlight cards */
body.dark-mode .static-blue-section a,
body.dark-mode .accordion-item.highlight-card a,
[data-theme="dark"] .static-blue-section a,
[data-theme="dark"] .accordion-item.highlight-card a {
  color: #aad4ff;
  text-decoration: none;
}

body.dark-mode .static-blue-section a:hover,
body.dark-mode .accordion-item.highlight-card a:hover,
[data-theme="dark"] .static-blue-section a:hover,
[data-theme="dark"] .accordion-item.highlight-card a:hover {
  text-decoration: underline;
}

/* Lists inside blue themed sections */
body.dark-mode .static-blue-section ul,
body.dark-mode .static-blue-section ol,
[data-theme="dark"] .static-blue-section ul,
[data-theme="dark"] .static-blue-section ol {
  color: var(--dark-secondary-text);
}










/* Hover effect for accordion items */
.accordion-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px); /* Slight lift on hover */
    text-decoration: none; /* Ensure no underline on hover */
}

/* Overrides for sections that should not have the default card styling */
#campus-photos-section {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: default; /* Not clickable for modal */
    transform: none; /* No transform on hover */
}
#campus-photos-section:hover {
    box-shadow: none !important;
}
.fancy-calendar-button-container {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: flex; /* Ensure button is centered */
    justify-content: center;
    align-items: center;
    margin-top: 0.25rem; /* Reduced from 0.5rem */
    margin-bottom: 0.25rem; /* Reduced from 0.5rem */
    cursor: default;
    transform: none;
}
.fancy-calendar-button-container:hover {
    box-shadow: none !important;
}




.top-image {
  width: 100%; /* Takes full width of its container */
  position: relative; /* For overlay text positioning */
  border-radius: 8px; /* Match slideshow container border-radius */
  overflow: hidden;
}

/* Image specific styling for size and fit */
.top-image img {
  width: 100%;
  height: 350px; /* Default height for larger screens */
  object-fit: cover;
  border-radius: 8px;
}

/* Overlay text for top-image slideshow */
.top-image .overlay-text {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0)); /* Gradient for better text readability */
    color: white;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Align text to the bottom */
}

.top-image .overlay-text .main-title {
    font-family: var(--font-serif);
    font-size: 1.8rem; /* Larger font for main title */
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7); /* Stronger shadow for visibility */
    margin-bottom: 5px; /* Space between lines */
}

.top-image .overlay-text .sub-title {
    font-family: var(--font-body);
    font-size: 0.95rem; /* Smaller font for sub-title */
    line-height: 1.4;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6); /* Subtle shadow for sub-title */
}


/* === Accordion === */
.accordion-header {
  font-family: var(--font-serif); /* Apply Merriweather to accordion headers */
  font-size: 1.3rem; /* Default size for research groups and other headers */
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 0.4rem;
  cursor: inherit; /* Inherit cursor from parent (.accordion-item) */
  display: flex; /* Needed for arrow alignment */
  justify-content: space-between; /* Pushes arrow to the right */
  align-items: center;
}

/* Arrow indicator for collapsible accordions */
/* This rule will only apply to accordions that are *not* direct links AND *not* modal openers.
   This effectively leaves no accordions on index.md with an arrow, and leaves direct links without an arrow (correct).
   If we introduce a a truly collapsible accordion later, it would *not* have these data attributes and would get an arrow.
*/
.accordion-item:not([data-direct-link="true"]):not([data-modal-opener="true"]) .accordion-header::after {
    content: '\25BC'; /* Down arrow */
    font-size: 0.9em;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

/* For accordions that open modals, explicitly remove any arrow */
.accordion-item[data-modal-opener="true"] .accordion-header::after {
    content: none !important;
}

/* Add a subtle hover effect to clickable accordion items */
.accordion-item[data-direct-link="true"]:hover {
    transform: translateY(-3px); /* Lifts the card slightly */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1); /* Increases shadow on hover */
}


/* Larger heading for the "Overview of Research" and "KSoM Publications" */
/* Removed this specific style for research-overview as it's no longer accordion-item */
a[href="/publications"].accordion-item .accordion-header {
    font-size: 1.5rem; /* Larger size for these specific headings */
}

.accordion-snippet {
  font-size: 1rem;
  color: #444;
  font-weight: normal; /* Ensure snippets are not bold */
  cursor: inherit; /* Inherit cursor from parent (.accordion-item) */
}

/* Base style for accordion content (visible by default) */
.accordion-content {
  font-size: 0.975rem;
  line-height: 1.7;
  color: #333;
  padding: 1rem 1.25rem 1.5rem; /* top, left/right, bottom padding */
  box-sizing: border-box;
}

/* Styles for *collapsible* accordion content */
.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  padding: 0 1.25rem; /* match left/right padding even when collapsed */
  box-sizing: border-box;
}
.collapsible-content.expanded {
  max-height: 1000px; /* Large enough to accommodate content */
  padding-bottom: 1.5rem; /* Bottom padding when expanded */
}

/* Paragraph spacing */
.accordion-content p {
  font-weight: normal;
  margin-bottom: 1em;
}
.accordion-content p:last-child {
  margin-bottom: 0;
}

/* Bullet point alignment fix (hanging indent) */
.accordion-content ul {
  list-style-type: disc;
  padding-left: 0;
  margin-top: 0.5em;
  margin-bottom: 1em;
}
.accordion-content li {
  margin-bottom: 0.3em;
  padding-left: 1.5em;
  text-indent: -1.5em;
}
.accordion-content li:last-child {
  margin-bottom: 0;
}







/* Style for the "more" indicator within snippets */
.snippet-more-indicator {
    color: var(--accent-blue); /* Blue color */
    font-weight: 500; /* Slightly bolder than regular text */
    margin-left: 0.5em; /* Space from snippet text */
    white-space: nowrap; /* Keep "more" on one line */
    opacity: 0.9;
    transition: opacity 0.2s ease;
}






/* === Static Blue Section: Styled Like Highlight Card === */

.static-section.static-blue-section .accordion-content.static-content {
    background-color: #e6f7ff; /* Light blue card background */
    border: 1px solid var(--accent-light);
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Inherit header styling like highlight card */
.static-section.static-blue-section .accordion-header {
    color: var(--accent-blue);
    font-weight: 700;
}

/* Table styles (within blue content) */
.static-section.static-blue-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.static-section.static-blue-section table th,
.static-section.static-blue-section table td {
    border: 1px solid var(--accent-light);
    padding: 0.8em 0.5em;
    text-align: center;
}

.static-section.static-blue-section table th {
    background-color: var(--accent-light);
    font-weight: bold;
    vertical-align: top;
}

.static-section.static-blue-section table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.05);
}

.static-section.static-blue-section table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Additional text block styling */
.static-section.static-blue-section .table-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}





/* === Highlight Cards (Reusable) === */
/* Reusable styles for prominent highlight cards across the site */
.accordion-item.highlight-card { /* Target any accordion item with the .highlight-card class */
    background-color: #e6f7ff; /* Consistent very light blue for all highlight cards */
    border: 1px solid var(--accent-light); /* Subtle border using your existing accent light color */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Gentle shadow to make it pop */
    margin-bottom: 0.5rem; /* Adds space below the highlighted card (adjust as needed for specific pages) */
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* Ensure header text is clearly visible on the highlight background */
.accordion-item.highlight-card .accordion-header {
    color: var(--accent-blue); /* Darker blue for light mode text */
    font-weight: 700; /* Make the header bold */
}










/* === Cards & Research Links === */
.research-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.2rem;
}
.research-card {
  display: block;
  padding: 1rem 1.2rem;
  background: #f9f9f9;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  text-decoration: none;
  color: var(--accent-blue);
  font-size: 0.95rem;
  transition: background var(--transition-fast);
  font-weight: normal; /* Ensure the main text of the card is normal weight */
  font-family: var(--font-body); /* Apply Lora to research card text */
}
.research-card:hover {
  background: #edf2f7;
}
.research-card strong {
  font-weight: 700; /* Keep the explicitly strong text bold */
  font-family: var(--font-sans); /* Use Inter for strong text in cards for differentiation */
}

/* Styling for modal research cards - now "camouflaged" like upcoming events */
.modal-research-card {
  display: block;
  padding: 0.8rem 1rem; /* Slightly reduced padding */
  background: none; /* No background */
  border: none; /* No border */
  border-bottom: 1px dashed rgba(0, 0, 0, 0.05); /* Subtle dashed border */
  text-decoration: none;
  color: var(--primary-text); /* Inherit primary text color */
  font-size: 0.95rem;
  transition: box-shadow var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
  border-radius: 0; /* No border-radius */
  box-shadow: none; /* No initial shadow */
}

.modal-research-card:last-child {
    border-bottom: none; /* No border on the last item */
}

.modal-research-card:hover {
  background: rgba(0, 0, 0, 0.02); /* Very subtle background change on hover */
  box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* Subtle shadow on hover */
}



.modal-research-card h3 {
    font-family: var(--font-serif);
    font-size: 1rem; /* Slightly smaller for card titles */
    font-weight: 600;
    color: var(--accent-blue); /* Distinct color for title */
    margin-bottom: 0.5rem; /* Space below title */
}



.modal-research-card p {
    font-size: 0.85rem; /* Smaller font for description */
    line-height: 1.5;
    color: #555; /* Softer color for description */
}




/* === Learn More Buttons & Expand Link === */
.learn-more-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  background-color: var(--accent-blue);
  color: white;
  border-radius: 5px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background var(--transition-fast);
  cursor: pointer;
  font-family: var(--font-sans); /* Apply Inter to buttons */
}
.learn-more-btn:hover {
  background-color: var(--accent-hover);
}

.modal-learn-more-btn { /* New class for buttons inside modals */
  display: inline-block;
  margin-top: 1.5rem; /* Increased margin to separate from cards/text */
  padding: 0.7rem 1.2rem; /* Slightly larger padding for prominence */
  background-color: var(--accent-blue);
  color: white;
  border-radius: 5px;
  text-decoration: none;
  font-size: 0.95rem; /* Slightly larger font */
  font-weight: 600; /* Slightly bolder */
  transition: background var(--transition-fast), transform 0.2s ease;
  cursor: pointer;
  font-family: var(--font-body); /* Using Lora for modal buttons */
  box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* Subtle shadow for depth */
}

.modal-learn-more-btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px); /* Lift effect on hover */
}

.expand-link {
  display: none; /* Removed as per user request */
}

/* Specific style for news/events archive buttons */
.archive-btn-container {
    text-align: right;
    margin-top: 1rem;
}
.archive-btn {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: linear-gradient(45deg, var(--accent-light), var(--accent-blue));
  color: white;
  border-radius: 5px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  font-family: var(--font-sans);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.archive-btn:hover {
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-hover));
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--modal-bg);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  role: dialog;
  aria-labelledby: modal-title;
  /* Add aria-modal to ensure proper accessibility for modal dialogs */
  aria-modal="true"
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: var(--modal-content-bg);
  padding: 2rem;
  border-radius: 10px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  color: var(--primary-text);
  font-family: var(--font-body);
}
.modal-content p + p {
  margin-top: 1em;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* === Calendar === */
/* Styling for the fancy calendar button */
.fancy-calendar-button {
    background: radial-gradient(circle at top left, var(--accent-light) 0%, var(--accent-blue) 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 15px;
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 43, 69, 0.2), 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    outline: none;
}

.fancy-calendar-button:hover {
    background: radial-gradient(circle at bottom right, var(--accent-hover) 0%, var(--accent-blue) 100%);
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 43, 69, 0.5), 0 8px 15px rgba(0,0,0,0.4);
}

.fancy-calendar-button:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 5px 10px rgba(0, 43, 69, 0.2), inset 0 2px 4px (0,0,0,0.3);
}

/* Full calendar for modal */
#full-calendar {
  font-family: var(--font-sans);
  border: none;
  background-color: transparent;
  border-radius: 0;
  overflow: hidden;
  width: 100% !important;
  padding: 0;
  box-shadow: none;
}




/* FullCalendar Toolbar (Header) */
.fc .fc-toolbar {
  background-color: var(--accent-blue);
  color: white;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.fc .fc-toolbar-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  flex-grow: 1;
  text-align: center;
}

/* FullCalendar Buttons */
.fc .fc-button {
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0.4em 0.8em;
  border-radius: 5px;
  font-weight: 500;
  font-size: 0.8em;
  transition: background-color var(--transition-fast), transform 0.1s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: pointer;
  outline: none;
  font-family: var(--font-sans);
}
.fc .fc-button:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.fc .fc-button:active {
  background-color: rgba(255, 255, 255, 0.4);
  transform: translateY(0);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background-color: rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}


/* Day Grid Cells */
.fc-theme-standard td,
.fc-theme-standard th {
  border-color: var(--card-border);
}


.fc-daygrid-day-top {
  padding: 0.35em;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--primary-text);
}
body.dark-mode .fc-daygrid-day-top {
  color: var(--dark-primary-text);
}

/* Days of the week (headers) */
.fc-col-header-cell-cushion {
    font-size: 0.7rem;
    color: #555;
    font-weight: 600;
    padding-top: 0.6em;
    padding-bottom: 0.6em;
}
body.dark-mode .fc-col-header-cell-cushion {
    color: #ccc;
}


/* Events */
.fc-event {
  background-color: var(--accent-light);
  color: white;
  border-radius: 4px;
  padding: 0.2em 0.4em;
  margin-bottom: 3px;
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  white-space: normal;
  font-family: var(--font-sans);
}
body.dark-mode .fc-event {
  background-color: #0072b1;
}

.fc-event-title {
  font-size: 0.75em;
  font-weight: 500;
  white-space: normal;
}

/* Today's highlighting */
.fc-day-today {
  background-color: rgba(0, 92, 151, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(0, 92, 151, 0.2);
}
body.dark-mode .fc-day-today {
  background-color: rgba(0, 114, 177, 0.12);
  border-color: rgba(0, 114, 177, 0.25);
}

/* Day numbers for current month */
.fc-daygrid-day.fc-day-valid {
  color: var(--primary-text);
}
body.dark-mode .fc-daygrid-day.fc-day-valid {
  color: var(--dark-primary-text);
}

/* Day numbers for other months */
.fc-day-other .fc-daygrid-day-top {
  opacity: 0.4;
}

/* General improvements */
.fc-scrollgrid-sync-table {
  border-collapse: separate;
}
.fc-daygrid-day-frame {
  min-height: 40px;
}

/* === Timeline UI === */
.timeline-container {
  max-height: 450px;
  overflow-y: auto;
  padding-right: 2px;
  margin-top: 1rem;
  padding-top: 0.5rem;
}
/* Removed :hover { overflow-y: auto; } since it's now applied above */
.timeline-container::-webkit-scrollbar {
  width: 6px;
}
.timeline-container::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}
body.dark-mode .timeline-container::-webkit-scrollbar-thumb {
  background-color: #666;
}


.timeline {
  position: relative;
  font-family: var(--font-body);
}

/* Re-add the timeline vertical line for general .timeline, but override for #latest-news-section below */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 2px;
  background-color: #ddd;
  z-index: 1;
}

body.dark-mode .timeline::before {
  background-color: #555;
}

/* Base style for timeline items, now functioning as clickable cards */
.timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding-left: 25px;
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
  cursor: pointer; /* Ensure news items are clickable */
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.timeline-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

body.dark-mode .timeline-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* Specific styling for the news cards - retain previous values */
#latest-news-section .timeline-item {
  background-color: #f2ede1;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%),
    linear-gradient(-45deg, rgba(0,0,0,0.05) 0%, transparent 60%);
  padding: 1rem 1.2rem;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  margin-bottom: 0.75rem;
  position: relative;
  transition: all 0.2s ease;
  display: block;
  border-bottom: none;
}

body.dark-mode #latest-news-section .timeline-item {
    background-color: #3a322b;
    background-image:
        linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%),
        linear-gradient(-45deg, rgba(0,0,0,0.1) 0%, transparent 60%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Alternating tilts for cards */
#latest-news-section .timeline-item:nth-child(odd) {
    transform: rotate(0.5deg);
}
#latest-news-section .timeline-item:nth-child(even) {
    transform: rotate(-0.5deg);
}
#latest-news-section .timeline-item:hover {
    transform: scale(1.01) rotate(0deg);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

/* Pin for each timeline item */
#latest-news-section .timeline-item::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background-color: #8b0000;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3), 0 0.5px 1px rgba(0,0,0,0.2);
  z-index: 3;
}
body.dark-mode #latest-news-section .timeline-item::before {
    background-color: #b30000;
}

/* Override removed timeline marker for #latest-news-section */
#latest-news-section .timeline-marker {
  display: none;
}

/* Adjust timeline content for new card layout */
#latest-news-section .timeline-content {
  margin-left: 0;
  padding-left: 0;
}

/* Specific text styling within news cards for readability */
#latest-news-section .timeline-date {
    font-size: 0.7rem;
    color: #888;
    font-family: var(--font-sans);
    margin-bottom: 0.1rem;
}
body.dark-mode #latest-news-section .timeline-date {
    color: #bbb;
}

#latest-news-section .timeline-content .news-title-link {
    color: var(--accent-blue);
    font-weight: 600;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    transition: color var(--transition-fast);
    line-height: 1.3;
    display: block;
    text-decoration: none;
}
/* Remove hover effect from internal link as the whole card has a hover effect now */
#latest-news-section .timeline-content .news-title-link:hover {
  text-decoration: none;
  color: var(--accent-blue);
}

body.dark-mode #latest-news-section .timeline-content .news-title-link {
  color: var(--accent-light);
}
body.dark-mode #latest-news-section .timeline-content .news-title-link:hover {
  color: var(--accent-light);
}


#latest-news-section .timeline-description {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0;
    line-height: 1.4;
    margin-bottom: 0.8rem;
}
body.dark-mode #latest-news-section .timeline-description {
    color: var(--dark-primary-text);
}

/* Ensure archive button within news section is readable on light background */
#latest-news-section .archive-btn {
    background: linear-gradient(45deg, var(--accent-light), var(--accent-blue));
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
body.dark-mode #latest-news-section .archive-btn {
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-hover));
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Remove timeline line for latest news section */
#latest-news-section .timeline::before {
    content: none;
}

/* Space after slideshow in Academic & Research Activities */
#academic-activities-section .slideshow-container {
    margin-bottom: 1.5rem;
}

/* Specific styling for the upcoming events timeline */
#upcoming-events-section .timeline::before {
    content: '';
}

#upcoming-events-section .timeline-marker {
    display: block;
    width: 8px;
    height: 8px;
    background-color: var(--accent-light);
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 0.75rem;
    transform: translateY(-50%);
    z-index: 2;
}
body.dark-mode #upcoming-events-section .timeline-marker {
    background-color: var(--accent-hover);
}

#upcoming-events-section .timeline-item {
    background: none;
    padding: 0 0 0.6rem 25px;
    margin-bottom: 0.6rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    box-shadow: none;
    transform: none;
    cursor: pointer; /* Ensure upcoming event items are clickable */
}
#upcoming-events-section .timeline-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
body.dark-mode #upcoming-events-section .timeline-item {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

#upcoming-events-section .timeline-item::before {
  content: none;
}

#upcoming-events-section .timeline-content {
    margin-left: 0;
}

/* Styling for event titles (now spans) */
.event-title {
    color: var(--accent-blue);
    font-weight: 600;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.3;
    display: block;
    margin-bottom: 0.5rem;
}
body.dark-mode .event-title {
    color: var(--accent-light);
}


/* Apply specific style for event links to remove underline on hover */
#upcoming-events-section .timeline-content .event-link:hover {
    text-decoration: none;
    color: var(--accent-hover);
}

body.dark-mode #upcoming-events-section .timeline-content a {
  color: var(--accent-light);
}
body.dark-mode #upcoming-events-section .timeline-content a:hover {
  color: var(--accent-hover);
}

/* Remove .event-details-btn styles as the button is removed */
.event-details-btn {
    display: none;
}






/* --- Footer styles --- */
footer {
  background: linear-gradient(to right, var(--accent-blue), var(--accent-light));
  color: white;
  padding: 30px 0;
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  width: 90%;
  max-width: var(--max-content-width);
  margin: 0 auto;
}

.footer-column {
  flex: 0 0 220px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}



.footer-column h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: white;
  text-transform: uppercase;
}

.footer-column p {
  margin-bottom: 8px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

footer .footer-column a {
  color: white;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

footer .footer-column a:hover {
  color: var(--accent-hover);
}

.footer-map-container {
  margin-top: 10px;
  width: 100%;
  max-width: 220px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.footer-map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.footer-map-link {
  color: white;
  text-decoration: underline;
  margin-top: 10px;
  display: block;
}
.footer-map-link:hover {
  color: var(--accent-hover);
}

/* --- Footer bottom strip --- */
.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  width: 90%;
  max-width: var(--max-content-width);
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}







/* === Responsive (max-width: 768px) === */
@media (max-width: 768px) {
  body {
    padding-top: 80px;
  }

  .header-content {
    flex-direction: row;
    justify-content: space-between;
    padding: 0 1rem;
    width: 100%;
  }

  nav {
    display: none;
  }

  .hamburger-menu-icon {
    display: block;
  }

  .header-right-group {
    display: contents;
  }

  /* === Main layout (home page) === */
  .main-layout-wrapper {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 95%;
    margin: 1rem auto 1.5rem auto;
    padding-top: 1rem;
    grid-template-areas:
      "campus"
      "about"
      "sidebar-col"
      "left-main-col"
      "right-main-col";
  }

  /* === Layout for content.html pages === */
  .main-content-single {
    width: 95%;
    margin: 1rem auto 2rem auto;
    padding: 0;
    box-sizing: border-box;
  }

  .content-wrapper-single {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .content-wrapper-single > section {
    padding: 0;
    box-sizing: border-box;
  }

  .main-content-single .accordion-item .accordion-header {
    padding: 0.75rem 1rem 0.5rem;
    box-sizing: border-box;
  }

  .main-content-single .accordion-content,
  .main-content-single .accordion-content .static-content,
  .main-content-single .accordion-content .timeline-container,
  .main-content-single .accordion-snippet {
    padding: 0.75rem 1rem 1.25rem;
    box-sizing: border-box;
  }
  
  .accordion-content h3,
  .accordion-content h4,
  .accordion-content .accordion-header {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .accordion-content > :first-child {
    margin-top: 0;
  }

  .accordion-content > :last-child {
    margin-bottom: 0;
  }

  /* === Collapsible accordion spacing === */
  .collapsible-content {
    padding: 0 1rem;
  }

  .collapsible-content.expanded {
    padding-bottom: 1.25rem;
  }

  /* Static accordion consistency */
  .static-section .accordion-content.static-content {
    padding: 1rem;
  }

  /* Sidebar and accordion columns */
  .left-accordion-col-wrapper,
  .right-accordion-col-wrapper,
  .sidebar-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Campus image */
  #campus-photos-section .top-image img {
    height: auto;
    min-height: 200px;
    max-height: 40vh;
  }

  /* Calendar */
  #calendar-section {
    display: flex !important;
    justify-content: center;
    align-items: center;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: default;
    transform: none;
  }

  #calendar-section:hover {
    box-shadow: none !important;
  }

  
  
  
  /* Footer */
  footer {
    padding-left: 0;
    padding-right: 0;
  }

  .footer-container {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    padding: 0 1rem;
  }

  .footer-column {
    min-width: unset;
    text-align: center;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
    margin-bottom: 20px;
  }

  .footer-column:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  body.dark-mode .footer-column {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }

  .footer-logo,
  .footer-map-container,
  .give-now-btn,
  .enews-signup-btn {
    margin-left: auto;
    margin-right: auto;
    display: block;
  }

  .social-icons {
    justify-content: center;
  }

  .footer-bottom {
    width: 100%;
    padding: 1rem;
  }

  @media (max-width: 768px) {
  footer {
    padding-left: 0;
    padding-right: 0;
  }

  .footer-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    padding: 0 1rem;
    align-items: center;
  }

  .footer-column {
    min-width: unset;
    text-align: center;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
    margin-bottom: 20px;

    display: flex;
    flex-direction: column;
    align-items: center; /* centers inner block elements horizontally */
  }

  .footer-column * {
    text-align: center !important; /* force all inner text to center */
  }

  .footer-column:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  body.dark-mode .footer-column {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }

  .footer-logo,
  .footer-map-container,
  .give-now-btn,
  .enews-signup-btn {
    margin-left: auto;
    margin-right: auto;
    display: block;
  }

  .social-icons {
    justify-content: center;
  }

  .footer-bottom {
    width: 100%;
    padding: 1rem;
  }
}









  



  /* FullCalendar toolbar */
  .fc .fc-toolbar {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .fc .fc-toolbar-title {
    font-size: 1.2rem;
  }

  /* Modal */
  .modal-content {
    max-height: 75vh;
    margin-top: 50px;
    width: 95%;
  }

  .modal-overlay {
    align-items: flex-start;
  }
}






  

/* Specific styles for accordion headings on selected pages with compact style */
body.compact-headings-style .accordion-item .accordion-header {
    font-size: 1rem; /* Adjust as needed, e.g., 0.9rem, 0.85em */
    color: #000000; /* Black color */
}

/* Dark mode adjustments for compact headings */
body.dark-mode.compact-headings-style .accordion-item .accordion-header {
    color: #f1f1f1; /* Lighter color for dark mode to maintain readability */
}

/* === MathJax Inline Rendering Fix (Updated) === */
mjx-container[jax="CHTML"][display="false"] {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  line-height: inherit !important;
  max-width: none !important;
  width: auto !important;
}

/* Prevent layout interference inside accordion headers */
.accordion-header {
  display: block !important; /* Prevent grid or flex influence */
  text-align: left;
  width: fit-content;
  max-width: 100%;
}

.accordion-header mjx-container[jax="CHTML"][display="false"] {
  display: inline !important;
  white-space: nowrap !important;
  width: auto !important;
  max-width: none !important;
  margin-right: 0.25rem; /* Optional: spacing between multiple math expressions */
}

/* Display math ($$...$$) */
mjx-container[display="true"] {
  display: block !important;
  margin: 1rem 0 !important;
  padding: 0.5rem 1rem !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  box-sizing: border-box;
  background: var(--card-bg, #f9f9f9); /* Optional */
  border-left: 4px solid var(--accent-blue, #005fa3); /* Optional */
  border-radius: 6px;
}

/* Optional: prevent assistive MML span from taking space */
mjx-container mjx-assistive-mml {
  display: none !important;
}
.card-back mjx-container[jax="CHTML"][display="true"] {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}









/* === General Slideshow Support === */
.mySlides {
  display: none;
}

.slideshow-container {
  position: relative;
  max-width: 100%;
  margin: auto;
  overflow: hidden;
}

.mySlides img {
  width: 100%;
  height: auto;
  display: block;
}






/* === Base People Grid Layout (Used Globally) === */
.people-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 0;
  margin: 0 auto;
  width: 100%;
  max-width: var(--max-content-width);
}

/* === Caption-Aware People Grid for Governing/Executive/Research Councils === */
.people-grid.council-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 0;
  margin: 0 auto;
  width: 100%;
  max-width: var(--max-content-width);
}

/* === Card Container for Caption-Aware Pages === */
.card-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 180px;
  box-sizing: border-box;
}

/* === Flip Card Container === */
.card-flip {
  width: 100%;
  max-width: 180px;
  height: 300px;
  perspective: 1000px;
  position: relative;
  box-sizing: border-box;
}

/* === Flip Logic === */
.card-flip-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
  position: relative;
}

.card-flip:hover .card-flip-inner,
.card-flip.flipped .card-flip-inner {
  transform: rotateY(180deg);
}

/* === Card Faces === */
.card-front,
.card-back {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* === Front Face === */
.card-front {
  transform: rotateY(0deg);
  z-index: 2;
  align-items: center;
  padding: 0;
}

.card-front img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.card-front .name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1f2937;
  padding: 0.75rem 0.5rem;
  text-align: center;
}

/* === Caption Block for Council Pages === */
.card-caption {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #333;
}

.card-caption .position {
  font-weight: 500;
}

.card-caption .status {
  font-style: italic;
  color: #555;
}

/* === Back Face === */
.card-back {
  transform: rotateY(180deg);
  background: #f9fafb;
  color: #1f2937;
  z-index: 1;
  font-size: 0.75rem;
  text-align: left;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
}

/* === Anchored Link on Back === */
.card-back .visit-link {
  font-weight: bold;
  color: #1e3a8a;
  text-decoration: none;
  margin-top: auto;
  padding-top: 0.75rem;
  align-self: flex-start;
}

/* === Hover Background === */
.card-front:hover,
.card-back:hover {
  background-color: #f0f8ff;
}

/* === Role-Based Border Colors === */
.card-flip.faculty .card-front,
.card-flip.faculty .card-back {
  border: 2px solid #1e3a8a;
}
.card-flip.postdoc .card-front,
.card-flip.postdoc .card-back {
  border: 2px solid #0f766e;
}
.card-flip.scholar .card-front,
.card-flip.scholar .card-back {
  border: 2px solid #b45309;
}
.card-flip.student .card-front,
.card-flip.student .card-back {
  border: 2px solid #4b5563;
}
.card-flip.admin .card-front,
.card-flip.admin .card-back {
  border: 2px solid #7c3aed;
}
.card-flip.alumni .card-front,
.card-flip.alumni .card-back {
  border: 2px solid #e11d48;
}

/* === Responsive Adjustments === */
@media (max-width: 992px) {
  .card-flip {
    max-width: 160px;
    height: 260px;
  }

  .card-front img {
    height: 221px;
  }

  .people-grid.council-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 768px) {
  .card-flip {
    max-width: 150px;
    height: 255px; /* increased from 240px */
    margin-left: auto;
    margin-right: auto;
  }

  .card-front img {
    height: 204px;
  }

  .card-front .name {
    font-size: 0.85rem;
    padding: 0.5rem 0.25rem 0 0.25rem;
    line-height: 1.4;
  }

  .card-back {
    font-size: 0.65rem;
    padding: 0.5rem;
    line-height: 1.4;
  }

  .people-grid,
  .people-grid.council-grid {
    padding-left: 12px;
    padding-right: 12px;
    gap: 0.75rem;
    margin-left: 0rem;
    margin-right: 0rem;
  }
}

@media (max-width: 480px) {
  .card-flip {
    max-width: 140px;
    height: 235px; /* increased from 220px */
    margin-left: 0rem;
    margin-right: 0rem;
  }

  .card-front img {
    height: 187px;
  }

  .people-grid,
  .people-grid.council-grid {
    padding-left: 10px;
    padding-right: 10px;
    gap: 0.75rem 0.75rem;
    justify-content: center;
    margin-left: 0rem;
    margin-right: 0rem;
  }
}











.watermark-closed {
  position: relative;
}

.watermark-closed::before {
  content: "Closed";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-size: 2.5rem; /* Slightly larger */
  color: rgba(220, 0, 0, 0.35); /* Stronger red with more opacity */
  font-weight: 600; /* Optional: bold look */
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.05em; /* Optional: subtle spacing */
}







.footer-logo-column {
  align-items: center;
  text-align: center;
}

.footer-logo {
  max-width: 80px;
  height: auto;
  margin-bottom: 15px;
  display: block;
}
.logo-title {
  display: flex;
  align-items: center;
}
.circle-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.logo-title a {
  color: white;
  font-family: var(--font-serif); /* Changed to Merriweather (serif) for title as requested */
  font-size: 1.0rem; /* Slightly reduced font size as requested */
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.3px;
  text-transform: uppercase; /* Make uppercase */
}
.logo-tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.logo-tooltip {
  visibility: hidden;
  opacity: 0;
  width: 320px;
  background-color: #002b45;
  color: #fff;
  text-align: left;
  padding: 1rem;
  border-radius: 8px;
  position: absolute;
  z-index: 10;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 0.3s ease;
  font-size: 0.75rem;
  line-height: 1.3em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  white-space: normal;
}

.logo-tooltip-wrapper:hover .logo-tooltip {
  visibility: visible;
  opacity: 1;
}






.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.button.primary-button {
  display: inline-block;
  background: linear-gradient(to right, #00558d, #0078b8);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  font-family: var(--font-sans, Inter, sans-serif);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 85, 141, 0.2);
  border: none;
  cursor: pointer;
}

.button.primary-button:hover,
.button.primary-button:focus {
  background: linear-gradient(to right, #0078b8, #00558d);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 85, 141, 0.3);
}

/* === Fancy Form Styling for KSoM Application Pages === */

.fancy-form {
  max-width: 640px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  font-weight: 600;
  color: #002b45;
  display: block;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  background-color: white;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #00558d;
  box-shadow: 0 0 0 2px rgba(0, 85, 141, 0.2);
}

.form-hint {
  font-size: 0.85rem;
  color: #444;
  display: block;
  margin-top: 0.2rem;
}

.required {
  color: red;
}

.button.primary-button {
  display: inline-block;
  background-color: #00558d;
  color: white;
  font-weight: 600;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s ease-in-out;
}

.button.primary-button:hover {
  background-color: #003f6c;
}


.review-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.review-column {
  flex: 1;
  min-width: 300px;
}

.review-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  border-left: 5px solid #1e3a8a;
}

.review-card h3 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #002244;
}

.review-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.review-card ul li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: #222;
}

.edit-link {
  font-size: 0.85rem;
  color: #1e3a8a;
  text-decoration: underline;
}

.fancy-heading {
  font-size: 1.6rem;
  color: #003366;
  margin-bottom: 1.25rem;
}

.intro-note {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.6;
}
