/* ─── CSS VARIABLES ─────────────────────────────────── */
:root {
  --nav-height: 60px;     /* overwritten by JS after layout */
  --photo-overlap: 70px;  /* how far the profile photo overlaps the banner */
}

/* ─── BASE ──────────────────────────────────────────── */
body {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.1rem;
}

a {
  color: #0096AB;
}
a:hover {
  color: #007a8a;
}

/* ─── NAVBAR — ALWAYS VISIBLE ───────────────────────── */
/* Override Quarto's headroom.js hide-on-scroll behaviour */
#quarto-header.headroom {
  transform: none !important;
  top: 0 !important;
  position: fixed !important;
  width: 100%;
  z-index: 1000;
}

.navbar {
  background-color: #ffffff !important;
  border-bottom: 1px solid #e0e0e0;
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
  min-height: unset !important;
}
.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 12rem !important;
  padding-right: 12rem !important;
}
.navbar-nav .nav-link {
  color: #333333 !important;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.85rem !important;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #0096AB !important;
}
.navbar-brand {
  font-weight: 700;
  color: #212121 !important;
}

/* ─── BANNER — TRULY FULL-WIDTH ──────────────────────── */
/* JS moves .site-banner to a direct child of <body> so no
   parent constraint can narrow it. */
.site-banner {
  width: 100%;
  line-height: 0;
}

.banner-img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center;
}

/* ─── TWO-COLUMN WRAPPER ─────────────────────────────── */
/* Centred block with breathing room on the sides.
   Pulled up by --photo-overlap so the profile photo
   visually overlaps the bottom of the banner. */
.two-col-wrapper {
  display: flex;
  align-items: flex-start;
  max-width: 1400px;
  margin: calc(-1 * var(--photo-overlap)) auto 0;
  padding: 0 12rem;
  box-sizing: border-box;
  overflow: visible; /* allow photo to show above wrapper top */
}

/* ─── LEFT COLUMN — PROFILE SIDEBAR ─────────────────── */
/* padding-top: 0 → photo starts flush with wrapper top
   (which is --photo-overlap pixels INSIDE the banner).
   z-index: 10 → photo paints above the banner image.      */
.profile-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: var(--nav-height);
  align-self: flex-start;
  overflow: visible;
  z-index: 10;
  border-right: 1px solid #e0e0e0;
  padding: 0 1.5rem 2rem 0;
  box-sizing: border-box;
}

/* Square profile photo with white border — overlaps banner */
.profile-photo-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  border: 4px solid #ffffff;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
  margin-bottom: 0.9rem;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.profile-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #212121;
  margin-bottom: 0.25rem;
  line-height: 1.2;
  border: none !important;
  padding-bottom: 0 !important;
}

.profile-title-label {
  font-size: 1rem;
  font-weight: 600;
  color: #0096AB;
  margin-bottom: 0.25rem;
}

.profile-affiliation {
  font-size: 0.95rem;
  color: #666666;
  line-height: 1.5;
  margin-bottom: 0;
}

.profile-affiliation-short {
  display: none;
}

.profile-divider {
  border: none;
  border-top: 3px solid #0096AB;
  margin: 0.8rem 0;
  width: 36px;
  opacity: 1;
}

.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.social-icons a {
  color: #555555;
  font-size: 1.15rem;
  text-decoration: none;
  transition: color 0.2s;
  line-height: 1;
}

.social-icons a:hover {
  color: #0096AB;
}

/* ─── RIGHT COLUMN — PAGE CONTENT ───────────────────── */
/* Override Quarto's internal page-columns grid so content
   fills its flex item naturally.
   padding-top compensates for the wrapper being pulled up
   by --photo-overlap, so text starts at the banner bottom. */
.two-col-wrapper #quarto-content {
  display: block !important;
  flex: 1;
  min-width: 0;
}

.two-col-wrapper #quarto-document-content {
  display: block !important;
  max-width: none !important;
  padding: calc(var(--photo-overlap) + 1rem) 1rem 2rem 2rem;
}

/* ─── HOMEPAGE — hide auto-generated "Home" title ────── */
body:has(.home-content) #title-block-header,
body:has(.home-content) .quarto-title-block {
  display: none;
}

.home-content {
  color: #444444;
  line-height: 1.75;
}

/* ─── PAGE PHOTO ─────────────────────────────────────── */
.page-photo {
  margin-top: 2.5rem;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.page-photo img {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  object-position: center;
}

.page-photo--about img {
  max-height: 640px;
}

/* Profile photo link — no underline or color shift */
.profile-photo-wrapper a {
  display: block;
  line-height: 0;
}

/* CV badge in social icons row */
.cv-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 700;
  color: #555555 !important;
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0.08rem 0.25rem;
  text-decoration: none !important;
  line-height: 1;
  transition: color 0.2s;
}

.cv-badge:hover {
  color: #0096AB !important;
}

/* ─── PUBLICATIONS ──────────────────────────────────── */
.csl-entry {
  padding: 1.25rem 0;
  border-bottom: 1px solid #e0e0e0;
  overflow-wrap: break-word;
}
.csl-entry:first-child {
  border-top: 1px solid #e0e0e0;
}

/* ─── CONTACT PAGE ──────────────────────────────────── */
.contact-info {
  margin-bottom: 2rem;
}
.contact-info p {
  font-size: 1rem;
  margin-bottom: 0.6rem;
  color: #444444;
}
.contact-info i {
  color: #0096AB;
  width: 1.5rem;
  margin-right: 0.3rem;
}
.contact-form .form-group {
  margin-bottom: 1.2rem;
}
.contact-form label {
  font-weight: 600;
  color: #333333;
  margin-bottom: 0.3rem;
  display: block;
}
.contact-form .form-control {
  border: 1px solid #cccccc;
  border-radius: 4px;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  width: 100%;
  max-width: 560px;
  font-family: 'Open Sans', sans-serif;
  box-sizing: border-box;
}
.contact-form .form-control:focus {
  border-color: #0096AB;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 150, 171, 0.15);
}
.contact-form textarea.form-control {
  resize: vertical;
}
.btn-primary {
  background-color: #0096AB !important;
  border-color: #0096AB !important;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
}
.btn-primary:hover {
  background-color: #007a8a !important;
  border-color: #007a8a !important;
}

/* ─── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 860px) {
  /* Navbar: reset the 12rem desktop padding so brand + hamburger are visible */
  .navbar-container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .navbar-brand {
    font-size: 0.85rem;
  }

  .navbar-container {
    position: relative;
  }

  .navbar-brand-container {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    height: 44px;
    z-index: 2;
  }

  .two-col-wrapper {
    flex-direction: column;
    margin-top: calc(-1 * var(--photo-overlap));
    padding: 0 1rem;
  }

  /* Sidebar: two flex children centred on the page, same height */
  .profile-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 1rem;
  }

  /* Left: photo at top, name pinned to bottom */
  .profile-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
    width: 135px;
  }

  .profile-photo-wrapper {
    width: 135px;
    margin-bottom: 0.4rem;
  }

  .profile-name {
    font-size: 0.85rem;
    margin-top: auto;
    margin-bottom: 0;
    line-height: 1.3;
    white-space: nowrap;
  }

  /* Right: pushed down so text starts below the banner */
  .profile-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-top: var(--photo-overlap);
  }

  .profile-title-label {
    font-size: 0.9rem;
    margin: 0 0 0.1rem;
  }

  .profile-affiliation { display: none; }

  .profile-affiliation-short {
    display: block;
    font-size: 0.82rem;
    color: #666666;
    margin: 0 0 0.4rem;
    line-height: 1.5;
  }

  .social-icons {
    margin-top: auto;
  }

  .profile-divider { display: none; }

  .two-col-wrapper #quarto-document-content {
    padding: 1rem 0;
  }

  .banner-img { height: 130px; }

  /* Prevent any wide element from causing horizontal scroll */
  body {
    overflow-x: hidden;
  }

  /* Justify body text like Word's Ctrl+J */
  .two-col-wrapper #quarto-document-content p {
    text-align: justify;
  }
}
