/* =========================================================================
   Site stylesheet for lw-g38.github.io
   Design tokens taken from the live al-folio theme (alshedivat.github.io/al-folio).
   Light: theme #b509ac / bg #ffffff / text #000000
   Dark:  theme #2698ba / bg #1c1c1d / text #e8e8e8
   ========================================================================= */

:root {
  --global-bg-color: #ffffff;
  --global-code-bg-color: rgba(181, 9, 172, 0.05);
  --global-text-color: #000000;
  --global-text-color-light: #828282;
  --global-theme-color: #b509ac;
  --global-hover-text-color: #ffffff;
  --global-footer-bg-color: #1c1c1d;
  --global-footer-text-color: #e8e8e8;
  --global-footer-link-color: #ffffff;
  --global-divider-color: rgba(0, 0, 0, 0.1);
  --global-card-bg-color: #ffffff;
  --global-back-to-top-bg-color: rgba(0, 0, 0, 0.4);
  --global-back-to-top-text-color: #ffffff;
  --global-navbar-bg-color: rgba(255, 255, 255, 0.95);
  --global-shadow-color: rgba(0, 0, 0, 0.12);
  --global-year-watermark: rgba(0, 0, 0, 0.07);
  --global-tip-block: #42b983;
  --global-tip-block-bg: #e2f5ec;
  --global-tip-block-text: #215d42;
  --global-danger-block: #cc0000;
  --global-danger-block-bg: #ffe0e0;
  --global-danger-block-text: #660000;
  --global-focus-ring: rgba(181, 9, 172, 0.2);

  --content-max-width: 930px;
  --navbar-height: 43px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --global-bg-color: #1c1c1d;
  --global-code-bg-color: #2c3237;
  --global-text-color: #e8e8e8;
  --global-text-color-light: #828282;
  --global-theme-color: #2698ba;
  --global-hover-text-color: #ffffff;
  --global-footer-bg-color: #e8e8e8;
  --global-footer-text-color: #1c1c1d;
  --global-footer-link-color: #000000;
  --global-divider-color: #424246;
  --global-card-bg-color: #212529;
  --global-back-to-top-bg-color: rgba(255, 255, 255, 0.5);
  --global-back-to-top-text-color: #000000;
  --global-navbar-bg-color: rgba(28, 28, 29, 0.95);
  --global-shadow-color: rgba(0, 0, 0, 0.6);
  --global-year-watermark: rgba(232, 232, 232, 0.08);
  --global-tip-block: #42b983;
  --global-tip-block-bg: #215d42;
  --global-tip-block-text: #beffe2;
  --global-danger-block: #cc0000;
  --global-danger-block-bg: #660000;
  --global-danger-block-text: #ffb9b9;
  --global-focus-ring: rgba(38, 152, 186, 0.3);
  color-scheme: dark;
}

/* -------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
}

body {
  margin: 0;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--global-text-color);
  background-color: var(--global-bg-color);
  -webkit-font-smoothing: antialiased;
  padding-top: var(--navbar-height);
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--global-theme-color);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--global-theme-color);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

hr {
  border: 0;
  border-top: 1px solid var(--global-divider-color);
  margin: 2rem 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 300;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

h1 { font-size: 40px; }
h2 { font-size: 32px; }
h3 { font-size: 28px; }
h4 { font-size: 24px; }
h5 { font-size: 20px; }
h6 { font-size: 16px; }

p { margin: 0 0 1rem; }

.font-weight-bold { font-weight: 700; }
.text-muted-light { color: var(--global-text-color-light); }

.highlight {
  background-color: #ffffd0;
  color: #000000;
  padding: 0 2px;
}

/* -------------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 15px;
}

main {
  display: block;
  min-height: 60vh;
  padding-bottom: 3rem;
}

.post { padding-top: 2rem; }

/* Banner image sitting between the navbar and the page title. Kept inside the
   930px column and at the source file's own 3.5:1 ratio, so it scales down
   proportionally rather than needing a fixed height. */
.page-banner {
  margin-top: 1.5rem;
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 1px 4px var(--global-shadow-color);
}

.page-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.page-banner + .post { padding-top: 1.75rem; }

.post-title {
  font-size: 40px;
  font-weight: 300;
  margin: 0 0 0.25rem;
  word-break: break-word;
}

.post-description {
  font-size: 18px;
  font-weight: 300;
  color: var(--global-text-color-light);
  margin: 0 0 1.5rem;
}

.section-title {
  font-size: 32px;
  font-weight: 300;
  margin: 2.5rem 0 1rem;
}

/* -------------------------------------------------------------------------
   Navbar
   ------------------------------------------------------------------------- */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  min-height: var(--navbar-height);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 15px;
  background-color: var(--global-navbar-bg-color);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--global-divider-color);
}

.navbar-inner {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-height: var(--navbar-height);
}

.navbar-brand {
  font-size: 18px;
  font-weight: 300;
  color: var(--global-text-color);
  white-space: nowrap;
  margin-right: auto;
  padding: 4px 0;
}

.navbar-brand:hover {
  color: var(--global-theme-color);
  text-decoration: none;
}

.navbar-toggler {
  display: none;
  border: 1px solid var(--global-divider-color);
  border-radius: 4px;
  background: transparent;
  color: var(--global-text-color);
  padding: 5px 9px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.navbar-nav {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 8px 10px;
  font-size: 16px;
  font-weight: 400;
  color: var(--global-text-color);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--global-theme-color);
  text-decoration: none;
}

.nav-item.active > .nav-link {
  color: var(--global-theme-color);
  font-weight: 500;
}

.theme-toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--global-text-color);
  font-size: 16px;
  padding: 8px 10px;
  line-height: 1;
}

.theme-toggle:hover { color: var(--global-theme-color); }

/* -------------------------------------------------------------------------
   About page
   ------------------------------------------------------------------------- */

.header-bar { margin-bottom: 1.5rem; }

/* Opt-in two-column header (about page only). Its columns match
   .profile-wrapper below, so the contact block sits directly above the profile
   photo on the same edges instead of leaving the name and titles unbalanced.
   Scoped to a modifier: plain .header-bar pages stack title over subtitle. */
.header-bar.header-split {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

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

.header-main .post-description { margin-bottom: 0; }

.header-contact {
  flex: 0 0 30%;
  max-width: 280px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--global-text-color-light);
  /* Optically drops the first line to sit with the name rather than above it. */
  padding-top: 0.7rem;
}

.header-contact p { margin: 0 0 0.2rem; }

.profile-wrapper {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 1rem;
}

.profile {
  flex: 0 0 30%;
  max-width: 280px;
  text-align: center;
}

.profile img {
  width: 100%;
  display: block;
  box-shadow: 0 2px 6px var(--global-shadow-color);
}

.profile img.rounded-circle {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.about-body {
  flex: 1 1 auto;
  min-width: 0;
}

.about-body p { text-align: justify; }

/* Social icons */
.social {
  text-align: center;
  margin: 2rem 0 1rem;
}

.social .contact-icons {
  font-size: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}

.social .contact-icons a {
  color: var(--global-text-color);
  transition: color 0.2s ease;
}

.social .contact-icons a:hover {
  color: var(--global-theme-color);
  text-decoration: none;
}

.social .contact-note {
  font-size: 0.85rem;
  color: var(--global-text-color-light);
  margin-top: 0.75rem;
}

/* News table */
.news { margin-bottom: 1rem; }

.news.scrollable {
  max-height: 22rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.news table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.news th,
.news td {
  padding: 0.35rem 0.5rem;
  vertical-align: top;
  text-align: left;
  border: 0;
  font-weight: 300;
}

.news th {
  width: 22%;
  min-width: 92px;
  color: var(--global-text-color-light);
  white-space: nowrap;
  font-weight: 400;
}

/* Visitor map */
.visitor-map { margin: 2.5rem 0 1rem; }

/* The MapMyVisitors widget is loaded with w=a (auto width): it measures its
   parent, so the frame needs a definite width or the map collapses to ~0px. */
.visitor-map .map-frame {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  padding: 0.5rem;
  border: 1px solid var(--global-divider-color);
  border-radius: 6px;
  background: var(--global-card-bg-color);
}

/* MapMyVisitors builds its background-map PNG filename from the width it
   measures on this container. Fractional widths (e.g. bg-w_542.666666-...png)
   do not exist and 404, leaving a blank blue rectangle with only the dots —
   so pin an integer width at every breakpoint rather than using a percentage. */
.visitor-map .map-inner {
  width: 280px;
  margin: 0 auto;
}

@media (min-width: 360px) {
  .visitor-map .map-inner { width: 320px; }
}

@media (min-width: 480px) {
  .visitor-map .map-inner { width: 420px; }
}

@media (min-width: 576px) {
  .visitor-map .map-inner { width: 500px; }
}

@media (min-width: 768px) {
  .visitor-map .map-inner { width: 540px; }
}

.visitor-map .map-frame svg,
.visitor-map .map-frame img,
.visitor-map .map-frame > a {
  display: block;
  max-width: 100%;
  height: auto;
}

.visitor-map .map-caption {
  font-size: 0.8rem;
  color: var(--global-text-color-light);
  margin-top: 0.6rem;
  text-align: center;
}

/* The widget centres its own map inside the frame only once it has measured a
   definite width; nudge its inner container too in case it renders early. */
.visitor-map .mapmyvisitors-map-container {
  margin: 0 auto;
}

/* -------------------------------------------------------------------------
   Publications (bib list)
   ------------------------------------------------------------------------- */

.publications { margin-top: 1rem; }

.publications h2.year {
  font-size: 46px;
  font-weight: 300;
  color: var(--global-year-watermark);
  text-align: right;
  margin: 2rem 0 -1rem;
  padding: 0.5rem 0.25rem 0 0;
  border-top: 1px solid var(--global-divider-color);
  pointer-events: none;
}

.bib-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bib-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem 0;
}

.bib-preview {
  flex: 0 0 22%;
  max-width: 190px;
}

.bib-preview img {
  width: 100%;
  display: block;
  border-radius: 3px;
  box-shadow: 0 1px 4px var(--global-shadow-color);
  background: var(--global-card-bg-color);
}

.bib-body {
  flex: 1 1 auto;
  min-width: 0;
}

.bib-title {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 0.2rem;
}

.bib-author {
  font-size: 15px;
  margin-bottom: 0.15rem;
}

.bib-author .me { font-weight: 700; }

.bib-venue {
  font-size: 15px;
  color: var(--global-text-color-light);
  margin-bottom: 0.5rem;
}

.bib-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.btn-bib {
  display: inline-block;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  padding: 5px 9px;
  border: 1px solid var(--global-theme-color);
  border-radius: 3px;
  color: var(--global-theme-color);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-bib:hover {
  background-color: var(--global-theme-color);
  color: var(--global-hover-text-color);
  text-decoration: none;
}

.bib-abstract {
  font-size: 15px;
  line-height: 1.5;
  text-align: justify;
  margin: 0;
}

.selected-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--global-theme-color);
  color: var(--global-hover-text-color);
  vertical-align: middle;
  margin-left: 0.4rem;
  font-weight: 400;
}

/* -------------------------------------------------------------------------
   Cards / project grid
   ------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  background-color: var(--global-card-bg-color);
  border: 1px solid var(--global-divider-color);
  border-radius: 6px;
  overflow: hidden;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px var(--global-shadow-color);
}

.card img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card-body {
  padding: 1rem 1.1rem 1.2rem;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 19px;
  font-weight: 400;
  margin: 0 0 0.35rem;
  line-height: 1.25;
}

.card-title a { color: var(--global-text-color); }

.card-title a:hover {
  color: var(--global-theme-color);
  text-decoration: none;
}

.card-text {
  font-size: 14px;
  color: var(--global-text-color-light);
  margin: 0 0 0.6rem;
}

/* Pushed to the bottom of the card body so tag rows line up across a row of
   cards whose descriptions differ in length. */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.4rem;
}

.tag {
  font-size: 11px;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--global-divider-color);
  color: var(--global-text-color-light);
}

/* CV-style list */
.cv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cv-entry {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--global-divider-color);
}

.cv-entry:last-child { border-bottom: 0; }

.cv-when {
  flex: 0 0 22%;
  min-width: 110px;
  color: var(--global-text-color-light);
  font-size: 15px;
}

.cv-what {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* Education entries read: degree + major / school or department / college. */
.cv-what .role {
  font-size: 17px;
  font-weight: 500;
  margin: 0;
}

.cv-what .org {
  font-size: 15px;
  color: var(--global-text-color-light);
  margin: 0;
}

.cv-what .institution {
  font-size: 15px;
  margin: 0;
}

.cv-what .detail {
  font-size: 14px;
  color: var(--global-text-color-light);
  margin: 0;
}

.cv-what p {
  font-size: 15px;
  margin: 0;
}

.cv-what > p:not(.detail) { margin-top: 0.25rem; }

.cv-what ul {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  font-size: 15px;
}

.cv-what li { margin-bottom: 0.2rem; }

.callout {
  border-left: 3px solid var(--global-theme-color);
  background: var(--global-code-bg-color);
  padding: 0.75rem 1rem;
  border-radius: 0 4px 4px 0;
  font-size: 14px;
  margin: 1.5rem 0;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 2rem;
}

.btn-lg-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 15px;
  padding: 9px 16px;
  border: 1px solid var(--global-theme-color);
  border-radius: 4px;
  color: var(--global-theme-color);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-lg-outline:hover {
  background-color: var(--global-theme-color);
  color: var(--global-hover-text-color);
  text-decoration: none;
}

/* -------------------------------------------------------------------------
   Contact page
   ------------------------------------------------------------------------- */

.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}

.contact-method {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--global-divider-color);
  border-radius: 6px;
  background: var(--global-card-bg-color);
}

.contact-method > i {
  font-size: 1.2rem;
  color: var(--global-theme-color);
  margin-top: 3px;
  flex: 0 0 auto;
}

.contact-method .label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--global-text-color-light);
  margin-bottom: 0.15rem;
}

.contact-method .value {
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
}

.contact-form { max-width: 640px; }

.form-row { margin-bottom: 1.1rem; }

.form-row label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 0.35rem;
}

.form-row .req { color: var(--global-theme-color); }

.form-control {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.5;
  padding: 9px 12px;
  color: var(--global-text-color);
  background-color: var(--global-card-bg-color);
  border: 1px solid var(--global-divider-color);
  border-radius: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--global-theme-color);
  box-shadow: 0 0 0 3px var(--global-focus-ring);
}

textarea.form-control {
  min-height: 160px;
  resize: vertical;
}

.form-error {
  display: none;
  font-size: 13px;
  color: var(--global-danger-block);
  margin-top: 0.3rem;
}

.form-row.invalid .form-error { display: block; }
.form-row.invalid .form-control { border-color: var(--global-danger-block); }

/* Spam trap: hidden from people, tempting to bots. Never display it. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  padding: 10px 20px;
  border: 1px solid var(--global-theme-color);
  border-radius: 4px;
  background-color: var(--global-theme-color);
  color: var(--global-hover-text-color);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-submit:hover { opacity: 0.85; }
.btn-submit[disabled] { opacity: 0.55; cursor: not-allowed; }

.form-status {
  display: none;
  margin-top: 1.2rem;
  padding: 0.85rem 1rem;
  border-radius: 4px;
  font-size: 14px;
  border-left: 3px solid;
}

.form-status.show { display: block; }

.form-status.success {
  border-left-color: var(--global-tip-block);
  background-color: var(--global-tip-block-bg);
  color: var(--global-tip-block-text);
}

.form-status.error {
  border-left-color: var(--global-danger-block);
  background-color: var(--global-danger-block-bg);
  color: var(--global-danger-block-text);
}

/* -------------------------------------------------------------------------
   Footer & back-to-top
   ------------------------------------------------------------------------- */

footer.site-footer {
  background-color: var(--global-footer-bg-color);
  color: var(--global-footer-text-color);
  font-size: 12px;
  font-weight: 300;
  text-align: center;
  padding: 8px 15px;
}

footer.site-footer a {
  color: var(--global-footer-link-color);
  text-decoration: underline;
}

@media (min-width: 768px) {
  footer.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1020;
  }
  body { padding-bottom: 34px; }
}

#back-to-top {
  position: fixed;
  right: 16px;
  bottom: 48px;
  z-index: 1040;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background-color: var(--global-back-to-top-bg-color);
  color: var(--global-back-to-top-text-color);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

/* Nav collapses with the rest of the layout at 768px. The six items plus the
   brand need ~584px of viewport, so this leaves comfortable headroom. */
@media (max-width: 767.98px) {
  .navbar-toggler { display: block; order: 2; }
  .navbar-inner { justify-content: space-between; }

  .navbar-collapse {
    order: 3;
    flex-basis: 100%;
    display: none;
    border-top: 1px solid var(--global-divider-color);
    margin-top: 4px;
    padding: 6px 0 10px;
  }

  .navbar-collapse.show { display: block; }

  .navbar-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .navbar-nav li { width: 100%; }
  .nav-link { padding: 10px 4px; width: 100%; }
  .theme-toggle { padding: 10px 4px; }

  .post-title { font-size: 32px; }
  .post-description { font-size: 16px; }
  h2,
  .section-title { font-size: 26px; }

  .profile-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }

  .profile {
    flex: 1 1 auto;
    max-width: 220px;
    width: 100%;
  }

  /* Stack the header: name and titles, then the contact block beneath them. */
  .header-bar.header-split {
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
  }

  .header-contact {
    flex: 1 1 auto;
    max-width: 100%;
    padding-top: 0;
  }

  .about-body p { text-align: left; }

  .bib-item { flex-direction: column; gap: 0.75rem; }
  .bib-preview { flex: 1 1 auto; max-width: 100%; }
  .bib-preview img { max-height: 240px; object-fit: contain; }
  .bib-abstract { text-align: left; }
  .publications h2.year { font-size: 34px; margin-bottom: -0.5rem; }

  .cv-entry { flex-direction: column; gap: 0.25rem; }
  .cv-when { flex: 1 1 auto; }

  .news th { width: 30%; font-size: 14px; white-space: normal; }
  .news td { font-size: 14px; }

  #back-to-top { bottom: 16px; }
}

@media (max-width: 400px) {
  .grid { grid-template-columns: 1fr; }
  .post-title { font-size: 28px; }
}

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

@media print {
  .navbar,
  footer.site-footer,
  #back-to-top,
  .visitor-map { display: none !important; }
  body { padding: 0; }
}
