/* ==========================================================================
   1. CORE LAYOUT & SERIF TYPOGRAPHY
   ========================================================================== */
/* Import a professional serif font pairing from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400&family=Source+Serif+Pro:wght@400;700&display=swap');

body {
  background-color: #f1f3f5;
  font-family: 'Source Serif Pro', serif; /* Use Source Serif Pro for body text */
}

/* Apply the Lora font to all headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Lora', serif;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] body {
  background-color: #121212;
}

/* ==========================================================================
   2. CENTERED PANE & HEADER
   ========================================================================== */
.page-container {
  max-width: 900px;
  margin: 4rem auto;
  padding: 2rem 3rem;
  background-color: var(--bs-body-bg);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

/* ==========================================================================
   ELEGANT NAVIGATION & PAGE-SPECIFIC STYLES
   ========================================================================== */

header nav {
  display: flex;
  gap: 0.5rem; /* Reduced gap for a tighter button group look */
}

header nav a {
  font-family: 'Source Serif Pro', serif;
  font-weight: 700;
  font-size: 0.9em;
  color: var(--bs-secondary-color);
  text-decoration: none;
  
  /* These properties create the button shape */
  padding: 0.5em 1em;
  border-radius: 16px; /* Creates a soft, pill-like shape */
  border: 2px solid transparent; /* Remove the old underline */
  
  /* This animates the background and color change smoothly */
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

header nav a:hover, header nav a.active {
  /* On hover, change the background to the theme's subtle gray */
  background-color: var(--bs-tertiary-bg);
  /* Make the text color darker for emphasis */
  color: var(--bs-body-color);
}

header nav a:hover, header nav a.active {
  color: var(--bs-body-color);
  border-bottom-color: var(--accent-color, var(--bs-primary));
}

main h3 {
  border-bottom: 1px solid var(--bs-border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

/* --- ABOUT PAGE --- */
.about-container-new { display: grid; grid-template-columns: 1fr 3fr; align-items: start; gap: 2rem; }
.about-image-new img { width: 100%; border-radius: 5px; }
.about-text-new p {
  text-align: left; /* Change this from 'justify' to 'left' */
  margin-bottom: 1.25rem;
}
.about-text-new .greeting { text-align: left; font-size: 1.2em; font-family: 'Lora', serif; }

@media (max-width: 768px) {
  .page-container { margin: 1rem; padding: 1rem 1.5rem; }
  header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .about-container-new { grid-template-columns: 1fr; }
}

/* --- RESEARCH & TEACHING PAGES --- */
/* ==========================================================================
   NEW RESEARCH & TEACHING PAGE STYLES
   ========================================================================== */

/* Normal font sizes for headings */
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; margin-bottom: 0.25rem; }

/* Main container for each paper entry */
.paper-entry-new {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}

.paper-title-new {
  margin-bottom: 1rem;
}

/* The new two-column grid layout */
.paper-grid {
  display: grid;
  grid-template-columns: 3fr 1fr; /* 3 parts for details, 1 part for actions */
  gap: 1.5rem;
}

/* Right column for tags and buttons */
.paper-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Aligns items to the right */
  text-align: right;
}

.paper-tag-new {
  font-size: 0.8em;
  font-weight: 600;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}

/* Container for the vertically stacked buttons */
.paper-links-new {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column; /* Stacks the buttons vertically */
  align-items: flex-end;   /* Right-aligns the buttons */
  gap: 0.5rem;
}

.paper-authors-new {
  font-size: 0.95em;
  color: var(--bs-secondary-color);
  margin-bottom: 1rem;
}

/* Styles for the expandable abstract (mostly unchanged) */
.abstract-toggle { display: inline-block; font-weight: 600; font-size: 0.9em; cursor: pointer; color: var(--bs-body-color); }
.abstract-toggle .arrow { display: inline-block; margin-right: 8px; transition: transform 0.2s ease-in-out; }
.abstract-toggle .arrow.expanded { transform: rotate(90deg); }
.abstract-content { display: none; font-size: 0.95em; padding-left: 1rem; margin-top: 1rem; border-left: 2px solid var(--bs-border-color); }

/* --- Your teaching styles can remain as they are --- */

.teaching-institution { color: var(--bs-secondary-color); font-weight: 600; margin-top: -0.5rem; }
.teaching-entry { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.course-title-new { font-weight: normal; } /* Toned-down as requested */
.course-meta-new { display: flex; align-items: center; gap: 1rem; white-space: nowrap; color: var(--bs-secondary-color); }
.teaching-evals-link-new { margin-top: 2rem; }

.about-links-new {
  margin-top: 2rem;
  display: flex;
  gap: 0.5rem;
}


/* Override theme's button capitalization */
.btn {
  font-family: 'Source Serif Pro', serif; /* Use the main body font for consistency */
  font-style: normal; /* The key stylistic change */
  font-weight: 600; /* A readable semi-bold weight */
  letter-spacing: 0.5px; /* Adds a bit of breathing room */
  text-transform: none !important; /* Keeps the de-capitalization */
  transition: all 0.2s ease-in-out;
}

/* More dynamic color for outline buttons */
.btn-outline-primary {
  transition: all 0.2s ease-in-out;
}

.btn-outline-primary:hover {
  color: white; /* Ensures text is readable on the filled background */
}

.gateway-link {
  display: inline-block;
  font-weight: 700;
  color: var(--bs-body-color);
  text-decoration: none;
  border-bottom: 2px solid var(--bs-border-color);
  padding-bottom: 3px;
  transition: all 0.05s ease-in-out;
}

.gateway-link:hover {
  color: var(--accent-color, var(--bs-primary));
  border-bottom-color: var(--accent-color, var(--bs-primary));
  padding-left: 5px; /* This creates the subtle slide effect */
}

/* Fade-in animation for the main content pane on page load */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-container {
  animation: fadeIn 0.2s ease-out;
}

/* This rule adds the transition ONLY to the teaching entries */
.teaching-entry {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* This rule applies the "lift" effect ONLY to the teaching entries on hover */
.teaching-entry:hover {
  transform: translateY(-3px); /* Lifts the item slightly */
  box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}

/* ==========================================================================
   MINIMALIST ICON LINKS (for About Page)
   ========================================================================== */

.about-links-new {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap; /* Allows links to wrap on small screens */
  gap: 1.5rem; /* Increases space between links */
}

.icon-link {
  display: inline-flex; /* Aligns icon and text on the same line */
  align-items: center;
  gap: 0.5rem; /* Space between icon and text */
  color: var(--bs-secondary-color);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.icon-link i {
  font-size: 1.2rem; /* Makes the icon a bit larger */
}

/* Underline effect for the text part of the link */
.icon-link span {
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-bottom-color 0.2s ease-in-out;
}

.icon-link:hover {
  color: var(--accent-color, var(--bs-primary)); /* Link turns blue on hover */
}

.icon-link:hover span {
  border-bottom-color: var(--accent-color, var(--bs-primary)); /* Underline appears on hover */
}


