/* ==========================================================================
   ACADEMIC MINIMALIST THEME (style.css)
   Clean, Editorial & Modern Layout for Academic Homepages
   ========================================================================== */

/* --- 1. CSS Variables & Theme Setup --- */
:root {
  --primary: #0f172a;          /* Slate dark tone for primary headers */
  --header-blue: #1e3a8a;      /* Academic Deep Navy Blue for Section Headers */
  --accent: #1d4ed8;           /* Subtle blue for links */
  --text-main: #334155;        /* Crisp slate dark body text */
  --text-muted: #64748b;       /* Secondary text & metadata */
  --bg-body: #ffffff;          /* Pure white background */
  --bg-alt: #f8fafc;           /* Very subtle off-white accent background */
  --border-color: #e2e8f0;     /* Delicate borders */
  --radius: 6px;               /* Small crisp border radius */
  --font-heading: 'Merriweather', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: all 0.2s ease-in-out;
}

/* --- 2. Reset & Base Typography --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--primary);
  font-family: var(--font-heading);
  line-height: 1.3;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: var(--transition);
}

a:hover {
  color: var(--primary);
  text-decoration-thickness: 2px;
}

p {
  margin-bottom: 1.2rem;
}

strong {
  color: var(--primary);
}

/* --- 3. Navigation Bar --- */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.95); /* Deep slate primary with transparency */
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
}

.nav-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.1rem 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff; /* White logo */
  text-decoration: none;
}

.nav-logo:hover {
  color: #93c5fd; /* Soft blue hover */
}

.menu-text {
  color: #cbd5e1; /* Muted light gray text */
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
}

.menu-text:hover {
  color: #93c5fd; /* Soft blue hover */
}

.nav-menu {
  display: flex;
  gap: 1.75rem;
}

.nav-link {
  color: #cbd5e1; /* Muted light gray text */
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
}

.nav-link:hover, 
.nav-link.active {
  color: #ffffff; /* Bright white when active/hovered */
  text-decoration: underline;
  text-underline-offset: 5px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #ffffff; /* White hamburger icon */
  cursor: pointer;
}

/* --- 4. Main Container --- */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
}

.main-layout {
  margin-top: 3.5rem;
  margin-bottom: 5rem;
}

/* --- 5. Hero / Header Profile Area --- */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 4rem;       /* Generous space before the first section */
  padding-bottom: 3rem;      /* Room inside the hero border */
  border-bottom: 1px solid var(--border-color);
}

.profile-avatar img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center; /* Focuses on your face/head instead of centering down to your chest */
  border: 1px solid var(--border-color);
  background-color: var(--bg-alt);
}

.profile-hero-content h1 {
  font-size: 2.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.profile-hero-content .profile-title {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.profile-hero-content .profile-affiliation {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-actions {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-top: 1rem;
}

.social-links-inline {
  display: flex;
  gap: 1rem;
  font-size: 1.2rem;
}

.social-links-inline a {
  color: var(--text-muted);
  text-decoration: none;
}

.social-links-inline a:hover {
  color: var(--accent);
}

/* --- 6. Content Sections --- */
.section-block {
  margin-bottom: 4.5rem;    /* Clear separation between major sections */
}

.section-title {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--header-blue); /* Academic Deep Navy Blue */
  margin-bottom: 1.75rem;    /* Clear breathing room below the title line */
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--header-blue); /* Matching blue accent line */
}

.lead {
  font-size: 1.125rem;
  color: var(--primary);
  line-height: 1.7;
}

/* Interest Tags */
.interests-box {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background-color: var(--bg-alt);
  border-left: 3px solid var(--header-blue);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.interests-box h3 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.825rem;
  color: var(--text-main);
}

/* --- 7. Academic Research & Publications List --- */
/* --- Research & Publication Section Spacing --- */
.pub-group {
  margin-bottom: 1rem; /* Adds generous breathing room between paper categories */
}

/* Subheadings ("Job Market Paper", "Working Papers & Projects") */
.pub-group-heading {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color);
}

.pub-item {
  margin-bottom: 2rem;
  padding-bottom: .5rem;
  border-bottom: 1px dashed var(--border-color);
}

.pub-item {
  margin-bottom: 1.75rem;
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.pub-journal {
  display: inline;             /* Keeps it inline with the author/year text */
  font-family: var(--font-heading); /* Uses the serif font for a traditional journal look */
  font-size: 0.95rem;          
  font-style: italic;          /* Academic convention: italicize journal names */
  font-weight: normal;
  color: var(--text-main);     /* Standard text color instead of heavy blue */
  margin-bottom: 0.5rem;
}

/* Optional: add a comma or space separator before the journal if needed */
.pub-authors::after {
  content: " | ";
}

/* --- Collapsible Abstract Styling --- */
/* Remove default marker arrows from <summary> */
.pub-abstract-details summary {
  list-style: none;
}
.pub-abstract-details summary::-webkit-details-marker {
  display: none;
}

/* Tighten space below the author/journal line */
.pub-meta-line {
  margin-bottom: 0.35rem; /* Reduced from default paragraph margin */
}

/* Tighten space above and below the abstract toggle button */
/* Abstract Toggle Button */
.btn-toggle-abstract {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  margin-top: 0.2rem;   /* Brought closer to the author line */
  margin-bottom: 0.3rem; /* Brought closer to the open abstract box */
  user-select: none;
}

.btn-toggle-abstract:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Switch between "Show" and "Hide" text based on open state */
.pub-abstract-details .hide-text {
  display: none;
}

.pub-abstract-details[open] .show-text {
  display: none;
}

.pub-abstract-details[open] .hide-text {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* The Abstract Content */
.pub-abstract {
  background-color: var(--bg-alt);
  border-left: 3px solid var(--header-blue);
  padding: 0.85rem 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--text-main);
}

.pub-abstract p {
  margin-bottom: 0;
}

/* Button & Link Placement */
.pub-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem; /* Prevents crowding elements below */
}


.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* --- 8. Teaching & Timeline --- */
.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.timeline-year {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.timeline-content h4 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.timeline-content .institution {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.timeline-content ul {
  padding-left: 1.2rem;
  font-size: 0.95rem;
}

/* --- 9. CV & Contact Sections --- */
.cv-preview-box {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin-top: 1rem;
}

.cv-preview-box i {
  color: #dc2626;
}

.cv-preview-box div {
  flex-grow: 1;
}

.cv-preview-box h4 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
}

.cv-preview-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.contact-card {
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.contact-card i {
  font-size: 1.2rem;
  color: var(--header-blue);
  margin-bottom: 0.5rem;
}

.contact-card h4 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.contact-card p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* --- 10. Buttons & Actions --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
}

.btn-primary:hover {
  background: var(--header-blue);
  border-color: var(--header-blue);
  color: #ffffff;
}

.btn-outline {
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-alt);
  color: var(--primary);
}

/* --- 11. Footer --- */
.footer {
  text-align: center;
  padding: 3rem 0;
  background-color: var(--primary); /* Deep slate dark background */
  color: #94a3b8;                  /* Muted light gray text */
  font-size: 0.875rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 5rem;
}

.footer p {
  margin-bottom: 0;
  color: #cbd5e1;                  /* Slightly brighter white-gray for copyright text */
}

/* --- 12. Media Queries & Responsiveness --- */
@media (max-width: 680px) {
  .profile-hero {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .profile-meta {
    justify-content: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .nav-toggle {
    display: block; /* Ensures the menu button is visible on mobile */
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #ffffff; /* White hamburger icon */
    cursor: pointer;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95) !important; /* Deep slate primary with transparency */
    flex-direction: column;
    padding: 1.25rem 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  }

  .nav-menu.active {
    display: flex;
  }
}

/* --- Desktop Layout & Fixed Sidebar --- */
.page-container {
  display: flex;
  flex-direction: column; /* Stacks vertically on mobile screens */
  min-height: 100vh;
}

@media (min-width: 900px) {
  .page-container {
    flex-direction: row; /* Side-by-side layout for desktop */
    align-items: flex-start;
    max-width: 1280px;
    margin: 0 auto;
  }

  /* Fixed Left Column (Sidebar Hero) */
  .sidebar-hero {
    width: 340px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;     /* Internal scroll if content is tall */
    padding: 3rem 2rem;
    box-sizing: border-box;
    border-right: 1px solid var(--border-color);
    background-color: var(--bg-body);
    flex-shrink: 0;
    /* Turn sidebar into a flex container */
    display: flex;
    flex-direction: column;
  }

  /* Right Main Content */
  .main-layout.container {
    flex: 1;
    margin-top: 3.5rem;
    margin-bottom: 5rem;
    max-width: 800px;
    padding: 0 40px;
  }
}

.sidebar-hero .profile-hero {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  padding-bottom: 0;
  border-bottom: none;
}

.sidebar-hero .profile-avatar img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-hero .profile-meta {
  justify-content: center;
}

.sidebar-hero .hero-actions {
  justify-content: center;
}

/* --- Mobile or Small Window View --- */
@media (max-width: 899px) {
  .profile-hero {
    margin-top: 2rem; /* Adds breathing room between the navigation bar and your image */
    padding-top: 1rem;
  }
}