/* Reset / base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html,body { height: 100%; }
body {
  font-family: 'Garamond', 'Hoefler Text', 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.55;
  color: #222;
  background: #f8f8f8;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #2c3e50;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
}

/* Restore some outer margins and internal padding */
.container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 32px;
}
/* Content box spacing */
.content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 36px 48px;
}
/* About layout spacing */
.about-container { gap: 40px; }
.portrait-container { margin-top: 4px; }
.portrait-img {
  width: 280px;
  max-width: 100%;
}

.nav-link {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 10px 18px;  /* wider clickable area */
  border-radius: 6px;
  transition: background-color 180ms ease, color 180ms ease;
  letter-spacing: 0.02em;
}
.nav-link:hover { background: rgba(255,255,255,0.05); color: #eaf6ff; }
.nav-link.active { color: #eaf6ff; font-weight: 600; }

/* Page banner */
.page-banner {
  width: 100%;
  max-height: 350px;
  overflow: hidden;
}
.page-banner img {
  width: 100%;
  height: 350px;
  display: block;
  object-fit: cover;
  object-position: center bottom;
}
.podcast-banner img {
  height: 350px;
  object-position: center center;
}

/* Section subheadings (smaller) */
.content h2:not(:first-child) {
  font-size: 1.1rem;
}

/* Hero section */
.hero {
  background: #2c3e50;
  color: #fff;
  text-align: center;
  padding: 60px 20px;
  margin-top: 54px;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0;
}

/* Section banners */
.section-banner {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  border-radius: 6px;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  position: relative;
}
.banner-overlay {
  background: rgba(0,0,0,0.45);
  color: #fff;
  padding: 18px 28px;
  border-radius: 6px;
  text-align: center;
}
.banner-overlay h1 { font-size: 2.2rem; margin: 0; }

/* Content boxes */
.content {
  background: #fff;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 36px;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

/* About section: portrait + text side-by-side */
.about-container {
  display: flex;
  gap: 28px;          /* somewhat larger gap for breathing room */
  align-items: flex-start;
  margin-top: 6px;
}
.portrait-container {
  flex: 0 0 auto;
  text-align: center;
}
.portrait-img {
  width: 280px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  display: block;
  margin-bottom: 10px;
}
.about-text { flex: 1; }
.about-text p {
  margin-bottom: 12px;   /* reduced paragraph spacing */
  text-align: justify;
  font-size: 1.02rem;
}

/* Contact row inside portrait */
.portrait-container .contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  justify-content: center;
  margin-top: 0.45rem;
  font-size: 0.95rem;
}
.portrait-container .contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  padding: 0.12rem 0.42rem;
  border-radius: 6px;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.06);
}
.portrait-container .contact-item img,
.portrait-container .contact-item .icon {
  width: 16px;
  height: auto;
  display: inline-block;
  vertical-align: middle;
}

/* CV section */
.cv-link-box {
  background: #e9f5fb;
  border-left: 4px solid #3498db;
  padding: 14px;
  margin-bottom: 18px;
  border-radius: 4px;
}
.inline-cv-link { color: #247ab7; font-weight: 600; text-decoration: none; }
.inline-cv-link:hover { text-decoration: underline; }
.cv-embed-container {
  height: calc(100vh - 180px);
  min-height: 600px;
  padding: 0;
  margin-top: 18px;
  border: 1px solid #e1e1e1;
  border-radius: 6px;
  background: #fff;
}
.cv-embed {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 6px;
}

/* CV download button */
.cv-download {
  text-align: center;
  margin-top: 16px;
}
.cv-button {
  display: inline-block;
  background: #2c3e50;
  color: #fff;
  padding: 14px 28px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background 180ms ease;
}
.cv-button:hover {
  background: #3498db;
}

/* Publications / teaching / cards */
.publication, .teaching-entry {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px;
  background: #fbfbfb;
  border-left: 4px solid #3498db;
  border-radius: 4px;
}
.pub-number { font-weight: 700; color: #2c3e50; flex-shrink:0; }
.pub-content { flex:1; line-height:1.6; }

/* Card titles (projects / publications / teaching) */
.publication h2, .teaching-entry h2 {
  font-size: 1.2rem;
  margin: 0 0 10px;
}

/* Footer */
footer {
  background: #2c3e50;
  color: #fff;
  text-align: center;
  padding: 20px 16px;
  margin-top: 24px;
  border-radius: 4px;
}
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 12px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  font-size: 0.92rem;
  opacity: 0.9;
  transition: opacity 150ms ease;
}
.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}
.footer-links img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

/* Reduce default large margins for headings */
h2 { margin: 18px 0 14px; }
h3 { margin: 12px 0 10px; }

/* Page title */
.page-title {
  font-size: 2.4rem;
  color: #2c3e50;
  margin: 0 0 20px;
  font-weight: 400;
}

/* Main section headings (Research, Teaching, Projects) */
.content h1 {
  font-size: 1.6rem;
  color: #000;
  margin: 0 0 18px;
  font-weight: 700;
}

/* Utilities */
.small { font-size: 0.92rem; color: #555; }
.center { text-align:center; }

/* Single responsive block (merged) */
@media (max-width: 768px) {
  .hero { padding: 40px 16px; }
  .hero h1 { font-size: 2rem; }
  .container { margin: 12px auto; padding: 16px; }
  .nav-container { gap: 12px; padding: 8px 10px; }
  .nav-link { padding: 8px 12px; font-size: 0.78rem; }
  .section-banner { height: 200px; }
  .banner-overlay h1 { font-size: 1.6rem; padding: 12px 16px; }
  .content { padding: 20px; }
  .about-container { flex-direction: column; align-items: center; gap: 18px; }
  .portrait-img { width: 70vw; max-width: 320px; }
  .page-banner { max-height: 200px; }
  .page-banner img { height: 200px; object-fit: cover; object-position: center bottom; }
  .cv-embed-container { display: none !important; }
  .cv-download { margin-top: 20px; }
  .cv-button { padding: 18px 36px; font-size: 1.1rem; }
  .publication, .teaching-entry { flex-direction: column; }
  footer { padding: 12px 6px; }
}

/* Small screens: keep some margins so things don't touch edges */
@media (max-width: 768px) {
  .container { margin: 18px auto; padding: 16px; }
  .content { padding: 18px; }
  .portrait-img { width: 70vw; max-width: 320px; margin-right: 0; }
  .cv-embed-container { display: none !important; }
  .page-title { font-size: 1.8rem; }
}

/* Hide CV embed on mobile/tablet */
@media (max-width: 1024px) {
  .cv-embed-container { display: none !important; }
}

/* Podcast page styles */
.podcast-header {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 32px;
  margin-top: -180px;
  position: relative;
  z-index: 10;
}
.podcast-cover {
  flex: 0 0 auto;
}
.podcast-cover img {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  object-fit: cover;
  border: 4px solid #fff;
}
.podcast-info {
  flex: 1;
}
.podcast-title {
  font-size: 2rem;
  color: #2c3e50;
  margin: 0 0 8px;
  font-weight: 700;
}
.podcast-tagline {
  font-size: 1.2rem;
  font-style: italic;
  color: #555;
  margin: 0 0 16px;
}
.podcast-description {
  margin: 0 0 20px;
  line-height: 1.7;
}
.podcast-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.podcast-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #2c3e50;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.92rem;
  transition: background 180ms ease;
}
.podcast-link:hover {
  background: #3498db;
}
.podcast-link img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

/* Episode cards */
.episode-card {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: #fbfbfb;
  border-left: 4px solid #d4a017;
  border-radius: 6px;
  margin-bottom: 16px;
}
.episode-cover img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
}
.episode-info {
  flex: 1;
}
.episode-title {
  font-size: 1.1rem;
  color: #2c3e50;
  margin: 0 0 6px;
  font-weight: 600;
}
.episode-meta {
  font-size: 0.88rem;
  color: #777;
  margin: 0 0 10px;
}
.episode-description {
  margin: 0;
  line-height: 1.6;
  color: #444;
}

@media (max-width: 768px) {
  .podcast-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: -80px;
  }
  .podcast-cover img {
    width: 160px;
    height: 160px;
  }
  .podcast-links {
    justify-content: center;
  }
  .episode-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .podcast-banner img {
    height: 200px;
  }
}