/* Custom styles for navigation alignment */
.greedy-nav .visible-links {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  width: 100%;
}

.greedy-nav .visible-links li:first-child {
  margin-right: auto !important;
  font-weight: 400 !important;
}

.greedy-nav .visible-links li {
  display: inline-block !important;
}

.masthead__brand-icons {
  display: flex !important;
  align-items: center;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 0.2rem;
}

.masthead__brand-icons a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0 0.1rem !important;
  padding: 0 !important;
  border: 1px solid rgba(18, 58, 122, 0.18);
  border-radius: 999px;
  background: #fff;
}

.masthead__brand-icons a::before {
  display: none !important;
}

.masthead__brand-icons a:hover {
  background: rgba(18, 58, 122, 0.06);
  border-color: rgba(18, 58, 122, 0.35);
  transform: translateY(-1px);
}

.masthead__brand-icons i {
  font-size: 1rem;
}

.masthead__menu-item--lg {
  font-weight: 400 !important;
}

.greedy-nav .visible-links li:first-child a {
  font-weight: 400 !important;
}

.greedy-nav .visible-links li:first-child a span {
  font-weight: 700 !important;
}

.greedy-nav .visible-links a,
.greedy-nav .visible-links a:visited,
.greedy-nav .visible-links a:hover,
.greedy-nav .visible-links a:focus,
.greedy-nav .visible-links li a,
.greedy-nav .visible-links li a:visited,
.greedy-nav .visible-links li a:hover,
.greedy-nav .visible-links li a:focus,
.greedy-nav .visible-links .masthead__menu-item--active a,
.greedy-nav .visible-links .active a,
.masthead .greedy-nav a,
.masthead .greedy-nav a:visited,
.masthead .greedy-nav a:hover,
.masthead .greedy-nav a:focus,
.masthead__menu-item a,
.masthead__menu-item a:visited,
.masthead__menu-item a:hover,
.masthead__menu-item a:focus {
  color: #123a7a !important;
}

.greedy-nav .visible-links a::before {
  background: #123a7a !important;
}

/* Hide hamburger menu button - always show navigation */
.greedy-nav button {
  display: none !important;
}

/* Prevent navigation items from being hidden */
.greedy-nav .hidden-links {
  display: none !important;
}

/* Force all navigation items to stay visible */
.greedy-nav .visible-links li {
  visibility: visible !important;
}

/* Make avatar rectangular instead of circular */
.author__avatar img {
  border-radius: 8px !important;
}

.sidebar .author__avatar img {
  border-radius: 8px !important;
}

div.author__avatar img {
  border-radius: 8px !important;
}

/* Remove extra bottom spacing on custom section wrappers */
.page__content > .home-intro,
.page__content > .news-list {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.page__content > .home-intro p:last-child,
.page__content > .news-list p:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Remove extra space after scrollable div */
div[style*="overflow-y: auto"] {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Increase bio text size and improve alignment */
.author__bio {
  font-size: 1.16em !important;
  margin-top: 0.5em !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.author__name,
.author__bio,
.sidebar strong {
  color: #123a7a !important;
}

.author__content {
  margin-top: 0.5em !important;
  padding-left: 0 !important;
}

/* Ensure avatar and content are properly aligned */
.author__avatar {
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.sidebar > div {
  position: relative;
  padding: 1.1rem 1rem 1rem;
  border: 1px solid rgba(18, 58, 122, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18, 58, 122, 0.04), rgba(255, 255, 255, 0.92));
  box-shadow: 0 16px 36px -28px rgba(18, 58, 122, 0.35);
}

.sidebar > div::before {
  display: none;
}

@include breakpoint($large) {
  .author__content {
    padding-left: 0 !important;
  }
}

@include breakpoint($large) {
  .sidebar > div {
    padding: 1.25rem 1.05rem 1.1rem;
  }
}

.sidebar p,
.sidebar li,
.author__urls a {
  font-size: 0.88rem !important;
}

.author__mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: inherit;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.author__avatar {
  margin-top: 0.5rem !important;
}

.author__avatar img,
.sidebar .author__avatar img,
div.author__avatar img {
  max-width: 210px !important;
  border: 1px solid rgba(18, 58, 122, 0.14) !important;
  box-shadow: 0 12px 28px -24px rgba(18, 58, 122, 0.45);
}

.author__urls {
  margin-top: 0.85rem !important;
}

.author__urls li {
  margin-bottom: 0.35rem !important;
}

.author__urls a,
.author__mono,
.author__desktop {
  color: #31445f !important;
}

.author__urls a:hover {
  color: #123a7a !important;
}

/* Ensure news section renders with proper spacing */
.page__content p {
  margin-bottom: 1em;
}

/* Dark blue titles across the site */
h1,
h2,
h3,
h4,
h5,
h6,
.page__title,
.archive__item-title {
  color: #123a7a !important;
}

/* Short underline below the homepage title */
.home-title-bar {
  width: 72px;
  height: 4px;
  margin: 0.15rem 0 1.7rem;
  border-radius: 999px;
  background-color: #123a7a;
}

.page__content > .home-title-bar:first-child {
  margin-bottom: 1.35rem !important;
}

.page__content > .home-title-bar + p {
  margin-top: 0 !important;
}

/* Typography closer to the reference site */
body {
  font-family: "Lora", Georgia, serif !important;
  font-size: 16px;
  line-height: 1.65;
}

h1,
h2,
h3,
h4,
h5,
h6,
.page__title,
.archive__item-title {
  font-family: "Lora", Georgia, serif !important;
}

.archive .page__title,
.page .page__title {
  font-size: 1.48rem;
  line-height: 1.35;
  margin-bottom: 0;
  font-weight: 500;
}

.archive .page__title {
  font-size: 2.9rem;
  line-height: 1.05;
  font-weight: 700;
  color: #123a7a !important;
}

.home-hero {
  margin-bottom: 1.25rem;
}

.home-hero__name {
  margin: 0;
  font-size: 2.9rem;
  line-height: 1.05;
  color: #123a7a;
  font-weight: 400;
}

.home-hero__name span {
  font-weight: 700;
}

.home-hero__subtitle {
  margin: 0.45rem 0 0;
  font-size: 1.08rem;
  color: #123a7a;
  opacity: 0.82;
}

.page__content p,
.page__content li {
  font-size: 1rem;
  line-height: 1.7;
}

.page__content code {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #123a7a;
  background: transparent;
  box-shadow: none;
  font-size: 0.92em;
  white-space: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.page__content a > code,
.page__content figcaption > code,
.page__content li > code,
.page__content p > code,
.page__content td > code {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.page__content a > code::before,
.page__content a > code::after,
.page__content figcaption > code::before,
.page__content figcaption > code::after,
.page__content li > code::before,
.page__content li > code::after,
.page__content p > code::before,
.page__content p > code::after,
.page__content td > code::before,
.page__content td > code::after {
  content: none !important;
}

.page__content a {
  text-decoration: none !important;
}

.page__content a:hover {
  text-decoration: none !important;
}

.page__section-title {
  margin-top: 2rem;
  margin-bottom: 0;
}

.news-list {
  margin-top: 0.75rem;
}

.news-item {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  column-gap: 0.75rem;
  margin: 0 0 0.8rem;
  align-items: start;
}

.news-item strong {
  color: #123a7a;
  font-weight: 700;
}

.news-item span {
  min-width: 0;
  font-size: 1rem;
  line-height: 1.7;
}

@media (max-width: 700px) {
  .news-item {
    grid-template-columns: 1fr;
    row-gap: 0.15rem;
  }
}

.publications__intro {
  margin-bottom: 2rem;
  color: #4b4b4b;
}

.publications__year {
  margin: 2.6rem 0 1.1rem;
  color: #123a7a;
  font-size: 1.75rem;
  font-weight: 700;
}

.publications__year::after {
  content: "";
  display: block;
  width: 88px;
  height: 5px;
  margin-top: 0.5rem;
  border-radius: 999px;
  background: #123a7a;
}

.publication-entry {
  margin: 0 0 1rem 2.2rem;
  padding-bottom: 0;
}

.publication-entry__title {
  margin: 0 0 0.2rem;
  font-size: 1.2rem;
  line-height: 1.35;
  font-weight: 600;
  color: #123a7a;
}

.publication-entry__authors,
.publication-entry__venue {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
}

.publication-entry__authors strong {
  color: #123a7a;
  font-weight: 700;
}

.publication-entry__venue {
  color: #5c5c5c;
}

.publication-entry__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.publication-entry__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-width: 4.8rem;
  padding: 0.32rem 0.78rem;
  border: 1px solid rgba(18, 58, 122, 0.2);
  border-radius: 999px;
  color: #123a7a !important;
  background: #fff;
  font-size: 0.88rem;
  text-decoration: none !important;
}

.publication-entry__button i {
  font-size: 0.82rem;
}

.publication-entry__button-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
  line-height: 1;
}

.publication-entry__divider {
  height: 1px;
  margin: 0.15rem 0 1.35rem 2.2rem;
  background: linear-gradient(90deg, rgba(150, 150, 150, 0.4), rgba(150, 150, 150, 0.12));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

@media (max-width: 700px) {
  .publication-entry {
    margin-left: 0.8rem;
  }

  .publication-entry__divider {
    margin-left: 0.8rem;
  }
}

html[data-theme="dark"] .greedy-nav .visible-links a,
html[data-theme="dark"] .greedy-nav .visible-links a:visited,
html[data-theme="dark"] .greedy-nav .visible-links a:hover,
html[data-theme="dark"] .greedy-nav .visible-links a:focus,
html[data-theme="dark"] .masthead__menu-item a,
html[data-theme="dark"] .masthead__menu-item a:visited,
html[data-theme="dark"] .masthead__menu-item a:hover,
html[data-theme="dark"] .masthead__menu-item a:focus,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .page__title,
html[data-theme="dark"] .archive__item-title,
html[data-theme="dark"] .home-hero__name,
html[data-theme="dark"] .home-hero__subtitle,
html[data-theme="dark"] .author__name,
html[data-theme="dark"] .sidebar strong,
html[data-theme="dark"] .publication-entry__title,
html[data-theme="dark"] .publications__year,
html[data-theme="dark"] .publication-entry__authors strong {
  color: #b8ffb8 !important;
}

html[data-theme="dark"] .greedy-nav .visible-links a::before,
html[data-theme="dark"] .home-title-bar,
html[data-theme="dark"] .publications__year::after {
  background: #b8ffb8 !important;
}

html[data-theme="dark"] .masthead__brand-icons a,
html[data-theme="dark"] .publication-entry__button,
html[data-theme="dark"] .sidebar > div {
  border-color: rgba(184, 255, 184, 0.22) !important;
}

html[data-theme="dark"] .publication-entry__button,
html[data-theme="dark"] .publication-entry__button span,
html[data-theme="dark"] .publication-entry__button i,
html[data-theme="dark"] .author__urls a:hover {
  color: #b8ffb8 !important;
}

html[data-theme="dark"] .publication-entry__button,
html[data-theme="dark"] .masthead__brand-icons a,
html[data-theme="dark"] .sidebar > div {
  background: rgba(184, 255, 184, 0.05) !important;
}

html[data-theme="dark"] .author__urls a,
html[data-theme="dark"] .author__mono,
html[data-theme="dark"] .author__desktop,
html[data-theme="dark"] .publication-entry__venue,
html[data-theme="dark"] .publications__intro {
  color: #d7e7d7 !important;
}

html[data-theme="dark"] .news-item strong,
html[data-theme="dark"] .page__content code {
  color: #b8ffb8 !important;
}

html[data-theme="dark"] .page__content code {
  background: transparent !important;
}

@media (min-width: 925px) {
  .page.page--home {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
  }
}

@media (min-width: 925px) {
  .page,
  .archive {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
  }
}

.home-intro {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
  align-items: start;
  flex-wrap: nowrap;
}

.page__content > .home-intro {
  display: flex !important;
}

.home-intro__text {
  flex: 1 1 0;
  min-width: 0;
}

.home-intro__text p:first-child {
  margin-top: 0;
}

.home-intro__photo {
  align-self: start;
  flex: 0 0 185px;
  width: 185px;
  margin-left: 0;
}

.home-intro__photo img {
  display: block;
  width: 100%;
  max-width: 170px;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(18, 58, 122, 0.14);
  box-shadow: 0 10px 24px -22px rgba(18, 58, 122, 0.35);
}

@media (max-width: 699px) {
  .home-intro {
    flex-direction: column;
    gap: 1rem;
  }

  .home-intro__photo img {
    margin: 0 auto;
  }
}
