/* Shared pinned academic banner and navigation */
@view-transition {
  navigation: auto;
}

:root {
  --profile-header-height: 220px;
  --site-nav-height: 48px;
}

body {
  padding-top: calc(var(--profile-header-height) + var(--site-nav-height));
  color: #333;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

body p,
body li,
body td,
body th,
body label,
body figcaption {
  font-family: Arial, Helvetica, sans-serif !important;
  line-height: 1.45 !important;
}

body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
  font-family: Arial, Helvetica, sans-serif !important;
  line-height: 1.25 !important;
}

body a {
  font-family: Arial, Helvetica, sans-serif !important;
}

.site-profile-header,
.profile-header {
  view-transition-name: profile-banner;
}

#siteNav {
  view-transition-name: profile-navigation;
}

::view-transition-old(profile-banner),
::view-transition-new(profile-banner),
::view-transition-old(profile-navigation),
::view-transition-new(profile-navigation) {
  animation-duration: 180ms;
}

::view-transition-old(profile-banner),
::view-transition-old(profile-navigation) {
  animation-name: none;
}

::view-transition-new(profile-banner),
::view-transition-new(profile-navigation) {
  animation-name: none;
}

.site-profile-header,
.profile-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1040;
  height: var(--profile-header-height);
  padding: 8px 0;
  overflow: visible;
  pointer-events: none;
  color: #f4f1eb;
  background: #2A4249;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.site-profile-container,
.profile-container {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  width: 100%;
  max-width: 1180px;
  height: auto;
  margin: 0 auto;
  padding: 0 20px;
}

.site-profile-photo,
.profile-photo {
  display: block;
  position: relative;
  z-index: 1042;
  width: auto;
  max-width: 180px;
  height: 220px;
  margin: 0;
  object-fit: cover;
  object-position: 82% 62%;
  border: 2px solid var(--golden);
  border-radius: 2px;
}

.site-profile-details h1,
.profile-details h1 {
  margin: 0 0 7px;
  color: var(--golden);
  font-family: Arial, "Noto Sans SC", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.site-profile-title,
.profile-title,
.profile-director {
  margin: 0 0 7px;
  color: var(--golden);
  font-size: 0.9rem;
  font-weight: 700;
}

.site-profile-affiliation,
.profile-affiliation {
  display: block !important;
  margin: 5px 0 8px;
  color: #e6e8e5;
  font-size: 0.95rem;
  line-height: 1.35;
}

.site-profile-bio,
.profile-bio {
  display: block !important;
  max-width: 1060px;
  margin: 6px 0 0;
  color: #f1f0ec;
  font-size: 0.9rem;
  line-height: 1.4;
}

.site-profile-details a,
.profile-details a {
  color: var(--golden);
}

#siteNav {
  position: fixed;
  top: var(--profile-header-height);
  right: 0;
  left: 0;
  z-index: 1039;
  height: var(--site-nav-height);
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #c4b69f;
  background: var(--golden);
}

#siteNav .navbar-nav {
  margin: 0 auto;
}

#siteNav .navbar-collapse,
#siteNav .navbar-nav {
  height: 100%;
}

#siteNav .nav-link {
  padding: 0.9rem 0.75rem;
  color: #2A4249;
  font-family: Arial, "Noto Sans SC", sans-serif;
  font-size: 0.92rem;
  white-space: nowrap;
}

#siteNav .nav-link:hover,
#siteNav .nav-link:focus,
#siteNav .nav-link.active {
  color: #fff;
  background: #2A4249;
}

#siteNav .navbar-toggler {
  margin: 8px 15px;
  color: #2A4249;
  background: #e3d9c8;
  border: 1px solid #b9aa91;
}

@media (min-width: 992px) {
  #siteNav .navbar-collapse {
    flex-basis: auto;
    width: calc(100% - 210px);
    margin-left: 210px;
  }
}

/* Existing content pages follow the compact shared masthead. */
.personal-gallery {
  padding-top: 3rem;
}

.portfolio {
  padding-top: 2.5rem;
}

.masthead:not(.site-profile-header) {
  padding-top: 2rem;
  background: #fff;
}

/* Consistent left-aligned page titles with a subtle rule, matching Home/News. */
.content-section > h2,
.page-section .page-section-heading,
.gallery-intro h1,
.container-sec > .content-box:first-child h2,
.masthead .personal-name h2,
.group-content > h2,
.links-content > h2 {
  display: block;
  width: 100%;
  margin: 0 0 16px !important;
  padding: 0 0 9px;
  border-bottom: 1px solid #c9c9c9;
  color: #222 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 1.55rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-align: left !important;
}

.page-section .page-section-heading {
  border-bottom-width: 1px;
  border-bottom-color: #c9c9c9;
}

.container-sec > .content-box:first-child {
  display: block;
  width: 100%;
  margin: 0 0 16px;
}

.container-sec > .content-box:first-child > .text-content {
  width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
}

.container-sec > .content-box:first-child .page-title {
  display: block;
  width: 100%;
}

@media (max-width: 991.98px) {
  :root {
    --profile-header-height: 200px;
    --site-nav-height: 50px;
  }

  .site-profile-container,
  .profile-container {
    grid-template-columns: 156px minmax(0, 1fr);
    gap: 24px;
    padding: 0 14px;
  }

  .site-profile-photo,
  .profile-photo {
    width: auto;
    max-width: 156px;
    height: 190px;
  }

  .site-profile-details h1,
  .profile-details h1 {
    font-size: 1.35rem;
  }

  .site-profile-bio,
  .profile-bio {
    font-size: 0.78rem;
    line-height: 1.25;
  }

  #siteNav .navbar-nav {
    align-items: stretch;
    height: auto;
    max-height: calc(100vh - var(--profile-header-height) - var(--site-nav-height));
    overflow-y: auto;
    background: var(--golden);
  }

  #siteNav .navbar-collapse {
    width: 100%;
    margin-left: 0;
  }

  #siteNav .nav-link {
    padding: 0.65rem 1rem;
  }
}

@media (max-width: 767.98px) {
  :root {
    --profile-header-height: 232px;
    --site-nav-height: 50px;
  }

  .site-profile-container {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 0 12px;
  }

  .site-profile-photo,
  .profile-photo {
    width: auto;
    max-width: 96px;
    height: 150px;
  }

  .site-profile-details h1,
  .profile-details h1 {
    margin-bottom: 5px;
    font-size: 1.1rem;
  }

  .site-profile-title,
  .profile-title,
  .profile-director {
    margin-bottom: 5px;
    font-size: 0.74rem;
  }

  .site-profile-affiliation,
  .profile-affiliation {
    margin-bottom: 6px;
    font-size: 0.68rem;
    line-height: 1.18;
  }

  .site-profile-bio,
  .profile-bio {
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .content-section > h2,
  .page-section .page-section-heading,
  .gallery-intro h1,
  .container-sec > .content-box:first-child h2,
  .masthead .personal-name h2,
  .group-content > h2,
  .links-content > h2 {
    font-size: 1.35rem !important;
  }
}
