/* ==========================================================================
   Paolo Frazzetto — site styles on top of the Start Bootstrap "Resume" theme.
   css/styles.css is the untouched theme; everything site-specific lives here.
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL OFL; see assets/fonts) ---------- */
@font-face { font-family: "Muli"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/muli-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Muli"; font-style: italic; font-weight: 400; font-display: swap; src: url("../assets/fonts/muli-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Muli"; font-style: normal; font-weight: 800; font-display: swap; src: url("../assets/fonts/muli-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Muli"; font-style: italic; font-weight: 800; font-display: swap; src: url("../assets/fonts/muli-latin-800-italic.woff2") format("woff2"); }
@font-face { font-family: "Saira Extra Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/saira-extra-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Saira Extra Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/saira-extra-condensed-latin-700-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --pf-teal: #004f59;          /* sidebar, headings accent, venue tags */
  --pf-link: #007585;          /* links: change this one value to recolour every link */
  --pf-link-hover: #004f59;
  --pf-link-line: rgba(0, 117, 133, 0.7);
  --pf-ink: #343a40;           /* headings, titles */
  --pf-text: #495057;          /* running text */
  --pf-muted: #6c757d;         /* dates, venue lines, footer */
  --pf-rule: #e9ecef;
  --pf-tint: rgba(0, 79, 89, 0.06);
  --pf-condensed: "Saira Extra Condensed", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pf-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --bs-link-color: var(--pf-link);
  --bs-link-hover-color: var(--pf-link-hover);
}

body {
  color: var(--pf-text);
}

/* ---------- Links: one look everywhere in the content column ---------- */
main a {
  color: var(--pf-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--pf-link-line);
  transition: color 120ms var(--pf-ease), text-decoration-color 120ms var(--pf-ease);
}

@media (hover: hover) {
  main a:hover {
    color: var(--pf-link-hover);
    text-decoration-color: currentColor;
    transition-duration: 150ms;
  }
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--pf-link);
  outline-offset: 2px;
  border-radius: 2px;
}

#sideNav a:focus-visible,
#sideNav button:focus-visible {
  outline-color: #fff;
  box-shadow: none;
}

.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
}

/* Academicons glyphs sit in a taller box with more padding than the Font Awesome ones */
.icon-tall {
  width: 1.5em;
  height: 1.5em;
}

/* Skip link: visible only when focused from the keyboard */
.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2000;
  padding: 0.6rem 1rem;
  background: #fff;
  color: var(--pf-teal);
  font-weight: 800;
  border-radius: 0.25rem;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Sidebar ---------- */
/* Menu links: dimmer at rest, white for the current page and on hover (no band) */
#sideNav .navbar-nav .nav-item .nav-link {
  color: rgba(255, 255, 255, 0.7);
  transition: color 120ms var(--pf-ease);
}

#sideNav .navbar-nav .nav-item .nav-link:hover,
#sideNav .navbar-nav .nav-item .nav-link.active {
  color: #fff;
}

#sideNav .navbar-brand {
  color: #fff;
}

#sideNav .navbar-toggler {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-color: rgba(255, 255, 255, 0.35);
}

.side-name {
  display: block;
  font-family: var(--pf-condensed);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
}

.contact-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  font-size: 1.25rem;
  text-decoration: none;
  transition: background-color 150ms var(--pf-ease), color 150ms var(--pf-ease), transform 150ms var(--pf-ease);
}

.contact-icons a:active {
  transform: scale(0.94);
}

.side-contacts {
  padding: 0.5rem 0 0;
}

.side-contacts a {
  color: rgba(255, 255, 255, 0.9);
}

@media (hover: hover) {
  .side-contacts a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
  }
}

.contact-note {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

#sideNav .contact-note,
.side-footer {
  color: rgba(255, 255, 255, 0.75);
}

.side-footer {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Contact row inside the page (phones and tablets, where the sidebar is a top bar) */
.inline-contacts {
  margin-top: 1.5rem;
}

.inline-contacts a {
  color: #fff;
  background-color: var(--pf-teal);
}

@media (min-width: 992px) {
  /* One centred stack: photo, name, menu, contacts, note. Copyright sits at the bottom. */
  #sideNav {
    overflow-y: auto;
  }
  #sideNav .navbar-brand {
    padding: 1.5rem 0.5rem 0;
    text-align: center;
    white-space: normal;
  }
  #sideNav .navbar-brand .img-profile {
    margin-bottom: 1.25rem !important;
  }
  #sideNav .navbar-collapse {
    flex-direction: column;
    align-items: center;
  }
  #sideNav .navbar-collapse .navbar-nav {
    margin-top: 1.5rem;
  }
  #sideNav .navbar-collapse .navbar-nav .nav-item .nav-link {
    padding: 0.6rem 1rem;
  }
  /* Icons follow the menu at the same vertical step as one menu link to the next */
  .side-contacts {
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    padding: 0.6rem 0.5rem 0;
  }
  #sideNav .contact-note {
    width: 100%;
    margin-top: 0.6rem;
    padding: 0 1.5rem;
    text-align: center;
    text-wrap: balance;
  }
  .side-footer {
    width: 100%;
    padding: 1.5rem 1rem 1.25rem;
    text-align: center;
  }
  .side-footer .copyright-sep {
    display: none;
  }
  .side-footer .copyright-updated {
    display: block;
  }
}

@media (max-width: 991.98px) {
  #sideNav .navbar-nav .nav-item .nav-link {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
  #sideNav .contact-note {
    margin-bottom: 0.75rem;
  }
  #sideNav .navbar-brand {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    font-family: var(--pf-condensed);
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }
}

/* ---------- Sections and page frame ---------- */
section.resume-section {
  min-height: 0;
  align-items: flex-start;
  padding-top: 4.5rem;
  padding-bottom: 4rem;
}

section.resume-section.resume-section-compact {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

section.resume-section .resume-section-content {
  max-width: 60rem;
}

@media (min-width: 576px) and (max-width: 991.98px) {
  section.resume-section {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .copyright-footer {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (max-width: 767.98px) {
  section.resume-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

h2[id],
h1[id],
section[id] {
  scroll-margin-top: 4.5rem;
}

@media (min-width: 992px) {
  h2[id],
  h1[id],
  section[id] {
    scroll-margin-top: 1.5rem;
  }
}

.subheading {
  overflow-wrap: anywhere;
}

/* Home: bio */
.bio {
  max-width: 50rem;
}

.bio p.lead {
  margin-bottom: 1.25rem;
  line-height: 1.65;
}

.bio p.lead:last-child {
  margin-bottom: 0;
}

/* Sub-pages */
.page-title {
  margin-bottom: 0.75rem;
  font-size: clamp(3rem, 2rem + 4vw, 4.5rem);
}

.page-intro {
  margin-bottom: 0;
}

.jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin: 1.5rem 0 0;
  font-family: var(--pf-condensed);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.jump-label {
  margin-right: 0.5rem;
  font-weight: 500;
  color: var(--pf-muted);
}

.jump a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.5rem;
}

.year-heading {
  margin: 2.75rem 0 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 2.5rem;
  color: var(--pf-teal);
  border-bottom: 2px solid var(--pf-teal);
}

.more-link {
  margin: 1.5rem 0 0;
  font-weight: 800;
}

.more-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  text-decoration: none;
}

.more-link a span {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--pf-link-line);
}

.more-link .icon {
  font-size: 0.85em;
  transition: transform 150ms var(--pf-ease);
}

@media (hover: hover) {
  .more-link a:hover span {
    text-decoration-color: currentColor;
  }
  .more-link a:hover .icon {
    transform: translateX(3px);
  }
}

/* ---------- Dated lists: news, awards, talks, teaching, service ---------- */
.dated-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dated-list li {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--pf-rule);
}

.dated-list li:last-child {
  border-bottom: 0;
}

.dated-date {
  flex: 0 0 6.5rem;
  font-family: var(--pf-condensed);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--pf-teal);
}

.dated-list-labels .dated-date {
  flex-basis: 11rem;
  white-space: normal;
}

.dated-text {
  flex: 1;
  min-width: 0;
}

.dated-text .role {
  margin-right: 0.35rem;
  color: var(--pf-ink);
}

.dated-text .role::after {
  content: " ·";
  font-weight: 400;
  color: var(--pf-muted);
}

@media (max-width: 575.98px) {
  .dated-list li {
    flex-direction: column;
    gap: 0.1rem;
  }
  .dated-date,
  .dated-list-labels .dated-date {
    flex-basis: auto;
  }
}

/* ---------- Publications ---------- */
.pub-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pub {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--pf-rule);
}

.pub:last-child {
  border-bottom: 0;
}

.pub-num {
  flex: 0 0 2.25rem;
  font-family: var(--pf-condensed);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--pf-teal);
}

.pub-main {
  flex: 1;
  min-width: 0;
}

.pub-title {
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--pf-ink);
}

.pub-authors {
  margin-bottom: 0.15rem;
  font-style: italic;
}

.pub-authors strong {
  color: var(--pf-ink);
}

.pub-venue {
  font-size: 0.9rem;
  color: var(--pf-muted);
}

.pub-note {
  white-space: nowrap;
}

.pub-note::before {
  content: "· ";
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.6rem;
  margin-top: 0.4rem;
  font-size: 0.9rem;
}

.pub-link {
  white-space: nowrap;
  color: var(--pf-muted);
}

.pub-link a {
  font-weight: 800;
}

.pub-doi {
  color: var(--pf-muted);
  overflow-wrap: anywhere;
}

.pub-pending {
  font-style: italic;
  color: var(--pf-muted);
}

.pub-tag {
  flex: 0 0 auto;
  min-width: 5.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  color: #fff;
  background-color: var(--pf-teal);
}

@media (max-width: 575.98px) {
  .pub {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem 0.75rem;
  }
  .pub-list-numbered .pub {
    grid-template-columns: 1.9rem minmax(0, 1fr);
  }
  .pub-tag {
    grid-row: 1;
    grid-column: -2 / -1;
    justify-self: start;
    min-width: 0;
    padding: 0.2rem 0.6rem;
  }
  .pub-num {
    grid-row: 2;
    grid-column: 1;
    font-size: 1.6rem;
  }
  .pub-main {
    grid-row: 2;
    grid-column: -2 / -1;
  }
  .pub-links {
    gap: 0 0.75rem;
  }
  .pub-link a,
  .pub-doi a {
    display: inline-block;
    padding: 0.65rem 0.1rem;
  }
}

/* ---------- CV ---------- */
.cv-heading {
  margin: 3.25rem 0 1.5rem;
  padding-bottom: 0.25rem;
  font-size: 2.5rem;
  color: var(--pf-teal);
  border-bottom: 2px solid var(--pf-teal);
}

.page-title + .cv-heading {
  margin-top: 2rem;
}

.cv-subheading {
  margin: 2rem 0 0.5rem;
  font-size: 1.5rem;
}

.cv-entry {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-bottom: 2rem;
}

.cv-entry:last-of-type {
  margin-bottom: 0;
}

.cv-entry-main {
  flex: 1;
  min-width: 0;
}

.cv-entry .subheading {
  margin-bottom: 0.6rem;
}

.cv-entry p {
  margin-bottom: 0.35rem;
}

.cv-entry-dates {
  flex: 0 0 auto;
  padding-top: 0.4rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--pf-teal);
}

@media (max-width: 767.98px) {
  .cv-entry {
    flex-direction: column-reverse;
  }
  .cv-entry-dates {
    padding-top: 0;
  }
}

/* ---------- Notice (top of Home): a ruled, typographic note; no box, no icon ---------- */
.notice {
  display: flex;
  gap: 1.5rem;
  max-width: 50rem;
  margin-bottom: 2.75rem;
  padding: 0.9rem 0 1rem;
  border-top: 2px solid var(--pf-teal);
  border-bottom: 1px solid var(--pf-rule);
}

.notice-label {
  flex: 0 0 6.5rem;
  margin: 0;
  font-family: var(--pf-condensed);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--pf-teal);
}

.notice-label span {
  display: block;
  font-weight: 500;
  color: var(--pf-muted);
}

.notice-text {
  flex: 1;
  min-width: 0;
  margin: 0;
}

@media (max-width: 575.98px) {
  .notice {
    flex-direction: column;
    gap: 0.35rem;
  }
  .notice-label {
    flex-basis: auto;
  }
  .notice-label span {
    display: inline;
  }
  .notice-label span::before {
    content: "· ";
  }
}

/* ---------- Footer ---------- */
.copyright-footer {
  max-width: 75rem;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  font-size: 0.8125rem;
  color: var(--pf-muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
