/* Site-wide styles layered on top of main.css (shared by all pages) */

:root {
  /* narrower than before */
  --content-max: 960px;
  --section-gap: 2.25rem;
  --card-radius: 14px;
}

/* Body text: Source Serif 4, darker and slightly smaller (theme default is Roboto Light, #3c4858, 16px).
   Headings keep Roboto Slab via .title */
body {
  color: #1f2530;
  font-size: 16px;
}

body,
.font-weight-light {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 400 !important;
}

/* Paragraphs set in h6 (about me, supervision) read like the rest of the body text */
.about h6.text,
.content > h6 {
  font-size: 1rem;
  line-height: 1.5;
}

/* Constrain width + consistent padding */
.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Section rhythm */
.about,
.news,
.publications {
  margin-top: var(--section-gap) !important;
}

h1.title {
  letter-spacing: .2px;
  margin-bottom: 1rem !important;
}

/* Section headings: smaller, a touch bolder, short rose underline */
.about h1.title,
.news h1.title,
.publications h1.title,
.content > h1.title {
  font-size: 1.65rem;
  font-weight: 400;
}

.about h1.title::after,
.news h1.title::after,
.publications h1.title::after,
.content > h1.title::after {
  content: "";
  display: block;
  width: 2.25rem;
  height: 3px;
  margin-top: .4rem;
  border-radius: 2px;
  background: #f2b8b8;
}

/* Hero layout: force side-by-side and vertically aligned */
.hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.hero-left {
  flex: 1 1 520px;
  min-width: 260px;
}

.hero-right {
  flex: 0 0 260px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.hero-contact {
  margin-top: .35rem;
  line-height: 1.6;
}

.hero-contact a {
  color: #b71c1c;
}

.hero-line {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.hero-emoji {
  flex: 0 0 auto;
  width: 1.3em;
  text-align: center;
}

.hero-address {
  margin-top: .35rem;
  font-size: .95rem;
  color: #4b5563;
}

.profile-img {
  width: 200px;
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
}

/* NEWS: compact rows */
.news-list .row {
  margin: 0 !important;
  padding: .3rem .85rem !important;
  align-items: center;
}

/* Date column only as wide as the pill; text takes the rest */
@media (min-width: 576px) {
  .news-list .row > .col-sm-2 {
    flex: 0 0 115px;
    max-width: 115px;
  }

  .news-list .row > .col-sm-10 {
    flex: 1 1 0;
    max-width: none;
  }
}

.news-list .date {
  display: inline-block;
  min-width: 92px;
  text-align: center;
  font-family: "Roboto", sans-serif;
  border-radius: 999px;
  box-shadow: none;
  letter-spacing: .4px;
}

/* NEWS: pastel date pills (bg + same-hue text) */
.news-list .danger-color-dark { background-color: #f9dede !important; color: #a3394a !important; }  /* events: rose */
.news-list .success-color-dark { background-color: #dcefe3 !important; color: #3f7a57 !important; } /* papers: sage */
.news-list .info-color-dark { background-color: #e1e4f6 !important; color: #4f5a9e !important; }    /* positions: periwinkle */
.news-list .warning-color-dark { background-color: #fbe8d3 !important; color: #a5622a !important; } /* media: peach */

/* Theme pads every news link, leaving a double-space gap before it */
.news .text a {
  padding-left: 0;
}

/* NEWS: full-height list, latest 8 shown until expanded */
.news .news-list {
  max-height: none;
  overflow: visible;
}

.news-list:not(.expanded) > .row:nth-child(n+9) {
  display: none !important;
}

.news-toggle {
  margin: .4rem 0 0 .85rem;
  padding: 0;
  border: 0;
  background: none;
  font: 500 .8rem "Roboto", sans-serif;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #b71c1c;
  cursor: pointer;
}

.news-toggle:hover {
  text-decoration: underline;
}

.news-list p {
  margin: 0 !important;
  line-height: 1.45;
}

/* Publications: compact rows */
.publications .pub-row {
  margin: 0 !important;
  padding: .6rem 1rem !important;
  align-items: center;
}

.publications .thumbnail {
  border-radius: 12px;
  max-height: 120px;
  width: 100%;
  object-fit: contain;
}

/* Paper titles in the body serif (Roboto Slab stays for the name and section headings) */
.publications h4.title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.35;
}

.publications h4.title b {
  font-weight: 600;
}

.publications .pub-text .author {
  margin: .15rem 0;
}

.publications .periodical {
  margin-bottom: .3rem !important;
}

/* Publication link buttons: rose, matching the theme red */
.publications .badge.grey {
  background-color: #f9dede !important;
  color: #b71c1c !important;
  font-family: "Roboto", sans-serif;
  font-weight: 500 !important;
  border-radius: 999px;
  box-shadow: none;
  padding: .3em .75em;
  transition: background-color .15s, color .15s;
}

.publications .badge.grey:hover {
  background-color: #b71c1c !important;
  color: #fff !important;
  text-decoration: none;
}

/* Key request: thumbnail further from title */
.pub-thumb {
  padding-right: 1.25rem !important;
}

.pub-text {
  padding-left: .25rem !important;
}

/* Top bar: plain white, hairline border */
#navbar {
  background-color: #fdfdfd !important;
  box-shadow: none !important;
  border-bottom: 1px solid #eee;
}

/* Top bar contents share the page's content column, so the icons line up with the text */
#navbar {
  padding-left: 0;
  padding-right: 0;
}

#navbar > .container-fluid {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1rem !important;
}

#navbar > .container-fluid > .row {
  margin-left: 0 !important;
}

/* Menu links (about, cv, teaching): pills, rose for the current page */
#navbar .nav-link {
  font-size: 1.1rem;
  margin-left: .1rem;
  padding: .2rem .7rem !important;
  border-radius: 999px;
  transition: background-color .15s;
}

#navbar .nav-link:hover {
  background-color: #f3f3f3;
  text-decoration: none;
}

#navbar .navbar-active .nav-link {
  background-color: #f9dede;
}

/* Original brand-colored icons, a bit paler until hovered */
#navbar .contact-icon a {
  opacity: .9;
  transition: opacity .15s;
}

#navbar .contact-icon a:hover {
  opacity: 1;
  text-decoration: none;
}

/* Mobile: stack hero nicely */
@media (max-width: 576px) {
  .hero-right {
    flex: 1 1 100%;
    justify-content: center;
  }

  .profile-img {
    width: 220px;
  }

  .pub-thumb {
    padding-right: 0 !important;
    margin-bottom: .75rem;
  }

  .publications .pub-row {
    padding: .6rem .85rem !important;
  }
}

/* Teaching: course-code badges as rose pills, matching the news dates */
.card .badge.danger-color-dark {
  background-color: #f9dede !important;
  color: #a3394a !important;
  font-family: "Roboto", sans-serif;
  border-radius: 999px;
  box-shadow: none;
  letter-spacing: .4px;
}

/* Standalone pages (teaching, publications): headings sit directly in .content */
.content > h1.title:not(:first-child) {
  margin-top: var(--section-gap);
}

/* Old publications page: rose link buttons like the main list */
.bibliography .badge.info-color-dark {
  background-color: #f9dede !important;
  color: #b71c1c !important;
  font-family: "Roboto", sans-serif;
  font-weight: 500 !important;
  border-radius: 999px;
  box-shadow: none;
  padding: .3em .75em;
}

.bibliography .badge.info-color-dark:hover {
  background-color: #b71c1c !important;
  color: #fff !important;
}

/* Teaching page: compact list like the publications, no boxed cards */
.teaching-page h3 {
  margin-top: 1.75rem !important;
  font-size: 1.25rem;
  color: #6b7280;
}

.teaching-page .card {
  margin-top: .25rem !important;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.teaching-page .card > .p-3 {
  padding: .6rem 0 !important;
}

.teaching-page .card h5 {
  margin-bottom: .1rem;
  font-size: 1.15rem;
  line-height: 1.35;
  font-weight: 600 !important;
}

.teaching-page .card h6.font-italic {
  margin-bottom: .2rem;
  font-size: 1rem;
  font-weight: 700 !important;
}

.teaching-page .list-group-item {
  padding: 0 0 .2rem 0;
  border: 0;
  background: transparent;
  font-size: 1rem;
  line-height: 1.5;
}
