/*
 * DIGITAL MARKETS & MEDIA LAB
 * Main stylesheet
 *
 * The easiest place to customize the site is the SETTINGS section below.
 * Most font sizes, colors, spacing, cards, and team portraits can be changed
 * there without editing the component rules farther down the file.
 */

/* ==========================================================================
   1. SITE SETTINGS / QUICK CUSTOMIZATION
   ========================================================================== */

:root {
  /* --- Fonts -------------------------------------------------------------
   * Change --font-body to alter normal paragraphs and interface text.
   * Change --font-headings to give titles a different typeface.
   * The listed fonts are fallbacks, so the site works without font downloads.
   */
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-headings: var(--font-body);

  /* --- Main font sizes ---------------------------------------------------
   * These variables control each distinct text environment.
   */
  --font-size-body: 16px;                 /* Normal page and card text */
  --font-size-lead: 16px;                 /* Introductory paragraphs */
  --font-size-prose: 17px;                /* Long-form text blocks */
  --font-size-page-title: clamp(22px, 5.2vw, 22px); /* Main H1 titles */
  --font-size-section-title: clamp(26px, 3.2vw, 36px); /* H2 titles */
  --font-size-card-title: 20px;           /* H3 and card titles */
  --font-size-navigation: 15px;           /* Header navigation */
  --font-size-eyebrow: 13px;              /* Small uppercase section labels */
  --font-size-role: 14px;                 /* Team member positions */
  --font-size-person-link: 14px;          /* Personal website links */
  --font-size-tag: 12px;                  /* Project category pills */
  --font-size-status: 11px;               /* Project status labels */
  --font-size-date: 14px;                 /* News dates and event details */

  /* --- Font weights ------------------------------------------------------
   * 400 = regular, 600 = semibold, 700 = bold, 800 = extra bold.
   */
  --weight-body: 400;
  --weight-heading: 700;
  --weight-link: 700;
  --weight-label: 800;

  /* --- Line heights and title spacing ---------------------------------- */
  --line-height-body: 1.65;
  --line-height-lead: 1.75;
  --line-height-prose: 1.85;
  --line-height-heading: 1.12;
  --heading-letter-spacing: -0.035em;

  /* --- Colors ----------------------------------------------------------- */
  --bg: #fcfbf9;             /* Main page and section background */
  --paper: rgba(98, 98, 98, 0.055);          /* Cards and card-like panels */
  --ink: #2f2f31;            /* Main body text */
  
  --ink-strong: #111827;     /* Titles and emphasized text */
  --muted: #667085;          /* Secondary text */
  --line: #e6e8ee;           /* Borders and separators */
  --soft: #f4f6f9;           /* Subtle backgrounds / avatar placeholders */
  --blue: #3062ff;           /* Links and primary accent */
  --orange: #f3ab00;         /* Secondary accent */

  /* --- Page layout ------------------------------------------------------ */
  /*--content-width: 1120px;*/    /* Maximum width of page content */
  --content-width: 1050px;    /* Maximum width of page content */
  --page-gutter: 24px;        /* Left/right space on small screens */
  --section-spacing: 68px;    /* Vertical space inside normal sections */
  --eyebrow-top-spacing: 62px; /* Navigation bar to page eyebrow */
  --grid-gap: 18px;           /* Space between cards */

  /* --- Header logos -----------------------------------------------------
   * Change these three values to resize the UZH logo and adjust the
   * horizontal spacing between the two logos and the navigation menu. */
  --header-uzh-logo-height: 44px; /* UZH logo size */
  --header-uzh-logo-offset-y: -1px; /* + moves down; - moves up */
  --header-logo-gap: 220px;        /* Space between DM² and UZH logos */
  --header-nav-gap: 24px;         /* Minimum space between logos and menu */

  /* --- Cards ------------------------------------------------------------ */
  --card-radius: 5px;         /* Corner roundness of all cards */
  --card-padding: 26px;       /* Inner space of standard cards */
  --person-card-padding: 20px;

  /* --- Team portraits ---------------------------------------------------
   * Use 50% radius for circles, 0 for square images, or e.g. 16px for
   * rounded corners. Adjust object-position on an individual image when
   * a face needs different centering.
   */
  --avatar-size: 120px;
  --avatar-radius: 50%;
  --avatar-position: center;

  /* --- Funding logos on the home page -----------------------------------
   * Each logo has its own height control because their proportions differ.
   * Increase or decrease these values to resize individual logos.
   */
  --uzh-logo-height: 38px;
  --erc-logo-height: 50px;
  --snsf-logo-height: 25px;
}

/* Larger-screen scaling overrides */
:root {
  --font-size-body: clamp(16px, 0.85vw, 18px);
  --font-size-lead: clamp(16px, 1vw, 18px);
  --font-size-prose: clamp(17px, 0.95vw, 20px);
  --font-size-page-title: clamp(28px, 3.2vw, 28px);
  --font-size-section-title: clamp(28px, 2.4vw, 42px);
  --font-size-card-title: clamp(20px, 1.2vw, 24px);
  --font-size-navigation: clamp(15px, 0.8vw, 17px);

  /* Stay at the laptop-sized canvas through typical 14-inch viewports, then
   * expand gradually on larger desktop displays. The upper cap keeps prose
   * and cards from becoming uncomfortably wide on ultrawide screens. */
  --content-width: clamp(1120px, 72vw, 1480px);
  --page-gutter: clamp(24px, 4vw, 64px);
  --section-spacing: clamp(68px, 6vw, 110px);
  --grid-gap: clamp(18px, 2vw, 28px);

  --card-padding: clamp(26px, 2.2vw, 36px);
  --person-card-padding: clamp(20px, 1.8vw, 30px);
  --avatar-size: clamp(120px, 8vw, 150px);
}
/* ==========================================================================
   2. BASE / GLOBAL ELEMENTS
   ========================================================================== */

* {
  box-sizing: border-box;
}

/* Reserve the scrollbar track even on short pages. Without this, centered
 * header and footer logos shift slightly when moving to a longer page. */
html {
  scrollbar-gutter: stable;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  font-weight: var(--weight-body);
  line-height: var(--line-height-body);
  color: var(--ink);
  background: var(--bg);
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

/* All heading levels share the same visual character. */
h1,
h2,
h3 {
  margin-top: 0;
  font-family: var(--font-headings);
  font-weight: var(--weight-heading);
  line-height: var(--line-height-heading);
  letter-spacing: var(--heading-letter-spacing);
  color: var(--ink-strong);
}

/* Main page title, used on Projects, Publications, and Contact. */
h1 {
  margin-bottom: 22px;
  font-size: var(--font-size-page-title);
}

/* Section titles, such as "What we study". */
h2 {
  margin-bottom: 16px;
  font-size: var(--font-size-section-title);
}

/* Card and team-member titles. */
h3 {
  margin-bottom: 0;
  font-size: var(--font-size-card-title);
}

/* ==========================================================================
   3. SHARED PAGE LAYOUT
   ========================================================================== */

/* Centers content and prevents it from becoming too wide on large screens. */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

/* Standard vertical spacing for content sections. */
.section {
  padding: var(--section-spacing) 0;
}

/* Optional white section with horizontal borders. */
.section.border {
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* Header area used at the top of inner pages. */
.page-title {
  padding: var(--eyebrow-top-spacing) 0 0;
}

/* The Home introduction is a normal section rather than a .page-title, so
 * use the same top-spacing variable to keep its eyebrow aligned site-wide. */
.home-intro {
  padding-top: var(--eyebrow-top-spacing);
}

/* The footer already supplies the page's lower separator. */
.section.border.home-intro {
  border-bottom: 0;
}

.page-title p {
  max-width: 760px;
}

/* Reusable two-column content layouts. */
.two-col {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
}

.two-col-intro {
  display: grid;
  align-items: center;
  grid-template-columns: 1.16fr 0.84fr;
  gap: 56px;
}

/* Reusable card grids. */
.grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ==========================================================================
   4. HEADER AND NAVIGATION
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(252, 251, 249, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--header-nav-gap);
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 14px var(--page-gutter);
}

/* Keep both header logos in one row and align their vertical centers. */
.header-logos {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--header-logo-gap);
}

.header-logos > a {
  display: flex;
  align-items: center;
}

.logo-full {
  display: block;
  width: 210px;
  max-width: 48vw;
  height: auto;
}

.header-uzh-logo {
  display: block;
  width: auto;
  height: var(--header-uzh-logo-height);
  transform: translateY(var(--header-uzh-logo-offset-y));
}

@media (min-width: 1051px) {
  .header-logos {
    width: calc((100% - 56px) * 0.58);
    justify-content: space-between;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.nav a {
  position: relative;
  padding: 6px 0;
  font-size: var(--font-size-navigation);
  color: var(--muted);
}

.nav a:hover,
.nav a.active {
  color: var(--ink-strong);
}

/* Blue line below the currently active page. */
.nav a.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -15px;
  left: 0;
  height: 2px;
  background: var(--blue);
}

/* ==========================================================================
   5. HERO AND INTRODUCTORY TEXT
   ========================================================================== */

/* Kept for pages that use the original hero layout. */
.hero {
  background:
    linear-gradient(90deg, rgba(48, 98, 255, 0.035), transparent 34%),
    linear-gradient(180deg, var(--bg), var(--bg));
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 78px var(--page-gutter) 82px;
}

/* Larger paragraph used below page titles and on the home introduction. */
.lead {
  max-width: 70ch;
  margin: 0;
  font-size: var(--font-size-lead);
  line-height: var(--line-height-lead);
  color: var(--ink);
}

/* Optional long-form text style. */
.prose {
  font-size: var(--font-size-prose);
  line-height: var(--line-height-prose);
  color: var(--muted);
}

.prose p {
  margin: 0 0 18px;
}

.intro-image {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}

.intro-image img {
  display: block;
  width: min(100%, 680px);
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.two-col-intro .lead {
  text-align: justify;
}

/* Small uppercase label above a page or section title. */
.eyebrow {
  margin-bottom: 20px;
  font-size: var(--font-size-eyebrow);
  font-weight: var(--weight-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.listing-page .eyebrow {
  margin-bottom: 0;
}

/* LISTING PAGE TITLE SPACING
 * Change 24px below to adjust the gap between the eyebrow and page content.
 * Smaller value = less space; larger value = more space. */
.listing-page .page-title + .section {
  padding-top: 28px;
}

/* Orange dash displayed before each eyebrow label. */
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 2px;
  margin-right: 10px;
  vertical-align: middle;
  background: var(--orange);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 28px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 3px;
  font-weight: var(--weight-link);
  color: var(--ink-strong);
  border-bottom: 2px solid transparent;
}

.text-link:hover {
  border-color: var(--orange);
}

/* ==========================================================================
   6. GENERAL CARDS
   ========================================================================== */

.card {
  padding: var(--card-padding);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
}

.card:hover {
  border-color: rgba(48, 98, 255, 0.32);
}

/* Normal descriptive text inside cards. */
.card p,
.project p,
.person p {
  margin: 12px 0 0;
  font-size: var(--font-size-body);
  color: var(--muted);
}

/* Colored top border used by research-area cards on the home page. */
.research-card {
  border-top: 3px solid rgba(48, 98, 255, 0.22);
}

.research-card:nth-child(even) {
  border-top-color: rgba(243, 171, 0, 0.32);
}

/* ==========================================================================
   7. SITE FOOTER / FUNDING LOGOS
   ========================================================================== */

.site-footer {
  padding: 28px 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.funding-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px 48px;
}

.funding-logo {
  display: block;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.funding-logo--erc {
  height: var(--erc-logo-height);
}

.funding-logo--uzh {
  height: var(--uzh-logo-height);
}

.funding-logo--snsf {
  height: var(--snsf-logo-height);
}

.about-section {
  /* The eyebrow already provides the same 20px gap used on the Home page. */
  padding-top: 0;
}

/* The opening paragraph occupies the wider left column and the contact card
 * occupies the narrower right column. align-items:start prevents the
 * card from stretching to match the paragraph's height. */
.about-intro-grid {
  display: grid;
  align-items: start;
  grid-template-columns: 1.16fr 0.84fr;
  gap: 56px;
}


.about-section .lead {
  max-width: none;
  text-align: justify;
}


.about-intro-grid .contact-card {
  padding: 12px 28px; /* First number controls vertical padding */
}

.about-intro-grid .contact-row {
  padding: 20px 0; /* First number controls vertical row spacing */
}

.about-intro-grid .contact-details {
  line-height: 1.4; /* Controls spacing between address lines */
}

/* These paragraphs sit below the two-column row and span the full container.
 * Change 32px to adjust their distance from the opening row. */
.about-full-text {
  margin-top: 32px;
}

.about-full-text .lead + .lead {
  margin-top: 18px;
}

.about-section .lead a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.about-section .lead a:hover,
.about-section .lead a:focus {
  color: var(--blue);
  text-decoration-color: var(--blue);
}

/* ==========================================================================
   8. TEAM CARDS
   ========================================================================== */

.person {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: var(--person-card-padding);
}

/* Team portrait or initials placeholder.
 * To reposition every photo, change --avatar-position above.
 * For one photo only, add a custom class and use:
 * .avatar-luis { object-position: center 25%; }
 */
.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  font-weight: var(--weight-label);
  color: var(--ink-strong);
  background: var(--soft);
  border-radius: var(--avatar-radius);
  object-fit: cover;
  object-position: var(--avatar-position);
}

.role {
  margin-top: 3px;
  font-size: var(--font-size-role);
  font-weight: var(--weight-link);
  color: var(--muted);
}

.person-link {
  display: inline-block;
  margin-top: 8px;
  font-size: var(--font-size-person-link);
  font-weight: var(--weight-link);
  color: var(--blue);
}

.person-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   9. PROJECT CARDS
   ========================================================================== */

.project {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

/* Rounded project-category label. */
.tag {
  padding: 5px 10px;
  font-size: var(--font-size-tag);
  font-weight: var(--weight-link);
  color: #2448b8;
  background: rgba(48, 98, 255, 0.07);
  border-radius: 999px;
}

.status {
  font-size: var(--font-size-status);
  font-weight: var(--weight-label);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #8a94a6;
}

/* ==========================================================================
   10. PUBLICATION LIST
   ========================================================================== */

.publication-group + .publication-group {
  margin-top: 56px;
}

.publication-section-title {
  margin-bottom: 20px;
  font-size: 22px; /* Change this value to resize publication section titles. */
}

.publication-list {
  display: grid;
  gap: var(--grid-gap);
}

.publication-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 22px;
  align-items: start;
  /* Change 20px to adjust the inner margin on all sides of paper cards. */
  padding: 20px;
}

.publication-card--no-cover {
  grid-template-columns: minmax(0, 1fr);
}

/* No-cover cards keep their title and metadata on the left and place the
 * paper-link buttons in a compact right-hand column. This automatically
 * applies to newly added Working Papers that use --no-cover. */
.publication-card--no-cover > div:first-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 22px;
  align-items: center;
}

.publication-card--no-cover > div:first-child > .publication-title,
.publication-card--no-cover > div:first-child > .publication-meta,
.publication-card--no-cover > div:first-child > .publication-note {
  grid-column: 1;
}

.publication-card--no-cover > div:first-child > .publication-actions {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  justify-content: flex-end;
  margin-top: 0;
}

.publication-title {
  margin-bottom: 0;
  font-size: 16px; /* Change this value to resize individual paper titles. */
  font-weight: 550;
  line-height: 1.35;
  color: var(--blue);
}

.publication-card .publication-meta,
.publication-card .publication-note {
  margin: 6px 0 0;
  font-size: 15px; /* Change this value to resize citation and author text. */
  line-height: 1.55;
  color: var(--muted);
}

.publication-journal {
  font-style: italic;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.publication-cover-cell {
  display: flex;
  justify-content: flex-end;
}

.publication-cover {
  display: block;
  width: auto;
  max-width: 72px;
  height: auto;
  max-height: 96px;
  object-fit: contain;
}

.publication-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.publication-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: var(--weight-link);
  color: #5a557f;
  border: 1px solid rgba(48, 98, 255, 0.28);
  border-radius: var(--card-radius);
}

.publication-link:hover,
.publication-link:focus {
  color: var(--ink-strong);
  border-color: var(--blue);
}

.publication-coverage {
  grid-column: 1 / -1;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.publication-coverage summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: var(--weight-link);
  color: var(--muted);
}

.publication-coverage .publication-actions {
  margin-top: 10px;
}

.list {
  display: grid;
  gap: 14px;
  margin-top: 0;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
}

/* ==========================================================================
   11. NEWS PAGE
   ========================================================================== */

.news-list {
  display: grid;
  gap: var(--grid-gap);
}

.news-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
}

.news-date {
  padding-top: 3px;
  font-size: var(--font-size-date);
  font-weight: var(--weight-link);
  color: var(--muted);
}

/* News titles are smaller than main section headings. */
.news-title {
  margin-bottom: 0;
  font-size: var(--font-size-card-title);
}

/* ==========================================================================
   12. EVENTS PAGE
   ========================================================================== */

.event-section-heading {
  margin-bottom: 20px;
}

.event-section-heading--past {
  margin-top: 52px;
}

/* Event cards use wider columns than the general two-column card grid. */
.event-grid {
  grid-template-columns: minmax(0, 820px);
}

.event-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Event photo gallery.
 * Each image can be centered independently with an inline CSS variable:
 * style="--event-image-position: center 30%;"
 * The first value is horizontal; the second is vertical.
 */
.event-gallery {
  position: relative;
  width: calc(100% + (2 * var(--card-padding)));
  height: 220px;
  margin: calc(-1 * var(--card-padding));
  margin-bottom: var(--card-padding);
  overflow: hidden;
  background: var(--soft);
}

.event-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: cover;
  object-position: var(--event-image-position, center);
  transition: opacity 0.25s ease;
}

.event-image.is-active {
  opacity: 1;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  color: #ffffff;
  cursor: pointer;
  background: rgba(17, 24, 39, 0.65);
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
}

.gallery-arrow:hover,
.gallery-arrow:focus {
  background: var(--blue);
}

.gallery-arrow--previous {
  left: 12px;
}

.gallery-arrow--next {
  right: 12px;
}

.gallery-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: var(--weight-link);
  color: #ffffff;
  background: rgba(17, 24, 39, 0.65);
  border-radius: 999px;
}

.event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.event-details {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  font-size: var(--font-size-date);
}

.event-details div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
}

.event-details dt {
  font-weight: var(--weight-link);
  color: var(--ink-strong);
}

.event-details dd {
  margin: 0;
  color: var(--muted);
}

.event-link {
  color: var(--blue);
  font-weight: var(--weight-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.event-link:hover,
.event-link:focus {
  color: var(--ink-strong);
}

.empty-state {
  margin: 0;
  padding: 24px;
  color: var(--muted);
  background: var(--soft);
  border-radius: var(--card-radius);
}

/* ==========================================================================
   13. CONTACT PAGE
   ========================================================================== */

.contact-layout {
  grid-template-columns: 1.16fr 0.84fr; /* Same ratio as Home */
}

.contact-card {
  width: fit-content;
  max-width: 100%;
  justify-self: end; /* Align card to the right of its column */
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
}

.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.contact-details {
  padding-top: 5px;
  font-size: 14px;
}


.contact-row:first-child {
  padding-top: 0;
}

.contact-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.contact-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  font-weight: var(--weight-label);
  color: var(--blue);
  background: rgba(48, 98, 255, 0.07);
  border-radius: 12px;
}

/* ==========================================================================
   14. DESKTOP SCALING
   Both common desktop monitors use the same composition. Values interpolate
   gradually with viewport width, avoiding an abrupt layout change when a
   browser window moves between a 1920px and 2560px display.
   ========================================================================== */

@media (min-width: 1600px) {
  :root {
    --header-uzh-logo-height:
      clamp(44px, calc(20px + 1.25vw), 52px);
    --font-size-eyebrow:
      clamp(13px, calc(10px + 0.16vw), 14px);
  }

  .nav-wrap {
    padding-top: clamp(14px, calc(6px + 0.47vw), 18px);
    padding-bottom: clamp(14px, calc(6px + 0.47vw), 18px);
  }

  .logo-full {
    width: clamp(210px, calc(140px + 4.69vw), 260px);
  }

  /* Team cards keep a stable, compact size on both desktop monitors instead
   * of expanding with the full page canvas. */
  .team-grid {
    max-width: 1260px;
  }

  .person {
    gap: 20px;
    padding: 20px 22px;
  }

  .avatar {
    width: 118px;
    height: 118px;
  }

  /* Publication typography scales continuously across desktop widths. */
  .publication-section-title {
    font-size: clamp(22px, calc(17px + 0.35vw), 26px);
  }

  .publication-card {
    grid-template-columns:
      minmax(0, 1fr)
      clamp(86px, calc(44px + 2.2vw), 100px);
    gap: clamp(22px, calc(10px + 0.63vw), 26px);
    padding: clamp(20px, calc(8px + 0.63vw), 24px);
  }

  .publication-card--no-cover {
    grid-template-columns: minmax(0, 1fr);
  }

  .publication-title {
    font-size: clamp(16px, calc(11px + 0.35vw), 20px);
    line-height: 1.4;
  }

  .publication-card .publication-meta,
  .publication-card .publication-note {
    margin-top: clamp(6px, calc(2px + 0.31vw), 8px);
    font-size: clamp(15px, calc(10.5px + 0.29vw), 18px);
    line-height: 1.6;
  }

  .publication-cover {
    max-width: clamp(72px, calc(36px + 1.88vw), 84px);
    max-height: clamp(96px, calc(48px + 2.5vw), 112px);
  }

  .publication-link {
    padding:
      clamp(5px, calc(2px + 0.16vw), 6px)
      clamp(10px, calc(4px + 0.31vw), 12px);
    font-size: clamp(13px, calc(9px + 0.23vw), 15px);
  }

  .publication-coverage summary {
    font-size: clamp(14px, calc(10px + 0.23vw), 16px);
  }

  .home-page .home-intro > .container {
    max-width: clamp(1380px, 72vw, 1600px);
  }

  .home-page .two-col-intro {
    gap: clamp(56px, 3.13vw, 80px);
  }

  .home-page .lead,
  .about-page .lead {
    font-size: clamp(18px, calc(12px + 0.31vw), 20px);
  }

  .home-page .intro-image img {
    width: min(100%, clamp(540px, calc(360px + 10.16vw), 620px));
  }

  .about-page .about-intro-grid {
    grid-template-columns: 1.18fr 0.82fr;
    gap: clamp(56px, 2.81vw, 72px);
  }

  .about-page .contact-card {
    width: 100%;
    padding:
      clamp(18px, 1vw, 24px)
      clamp(28px, 1.5vw, 36px);
  }

  .about-page .contact-row {
    gap: clamp(16px, 0.9vw, 20px);
    padding: clamp(20px, 1.15vw, 24px) 0;
  }

  .about-page .contact-details {
    padding-top: 6px;
    font-size: clamp(16px, calc(11px + 0.31vw), 17px);
  }

  .about-page .contact-icon {
    width: clamp(42px, 2.3vw, 48px);
    height: clamp(42px, 2.3vw, 48px);
    border-radius: 14px;
  }
}

/* On tall desktop windows the two short informational pages use the same
 * vertically balanced composition on both monitors. */
@media (min-width: 1600px) and (min-height: 800px) {
  .home-page main,
  .about-page main {
    display: flex;
    flex-direction: column;
  }

  .home-page .home-intro {
    display: flex;
    flex: 1;
    align-items: center;
    width: 100%;
    padding-top: clamp(64px, 5vh, 80px);
    padding-bottom: clamp(88px, 8vh, 120px);
  }

  .about-page main {
    justify-content: center;
    padding-top: clamp(64px, 5vh, 80px);
    padding-bottom: clamp(88px, 8vh, 120px);
  }

  .about-page .page-title,
  .about-page .about-section {
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* ==========================================================================
   15. RESPONSIVE / MOBILE LAYOUT
   Everything below applies only to screens 860px wide or narrower.
   ========================================================================== */

/* Move the menu to a second row before the combined logos and links become
 * crowded. Change 1050px if you want this transition earlier or later. */
@media (max-width: 1050px) {
  .nav-wrap {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .nav {
    width: 100%;
    margin-left: 0;
    padding-bottom: 2px;
    overflow-x: auto;
  }

  .nav a.active::after {
    bottom: -7px;
  }
}

@media (max-width: 860px) {
  /* At this breakpoint the Team grid becomes one column. Change 620px to
   * adjust its maximum tablet width; phones still use their available width. */
  .team-grid {
    max-width: 620px;
  }

  /* Stack multi-column layouts into a single readable column. */
  .two-col,
  .two-col-intro,
  .about-intro-grid,
  .grid.two,
  .grid.three,
  .event-grid {
    grid-template-columns: 1fr;
  }

  .intro-image img {
    max-width: 320px;
    border-radius: 18px;
  }

  .intro-image {
    align-self: auto;
  }

  .news-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .funding-logos {
    justify-content: center;
  }
}

/* Extra-small screens: place the logo above the navigation. */
@media (max-width: 620px) {
  .nav-wrap {
    flex-wrap: wrap;
    gap: 10px;
  }

  .logo-full {
    width: min(210px, 54vw);
    max-width: none;
  }

  /* Scale the UZH logo and inter-logo gap down only when needed so the two
   * aligned logos continue to fit together on narrow phone screens. */
  .header-logos {
    gap: min(var(--header-logo-gap), 4vw);
  }

  .header-uzh-logo {
    height: min(var(--header-uzh-logo-height), 9vw);
  }

  .publication-card {
    grid-template-columns: 1fr;
  }

  .publication-card--no-cover > div:first-child {
    grid-template-columns: 1fr;
  }

  .publication-card--no-cover > div:first-child > .publication-actions {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
    margin-top: 12px;
  }

  .publication-cover-cell {
    justify-content: flex-start;
  }

  .funding-logo--erc {
    height: min(var(--erc-logo-height), 125px);
  }

  .funding-logo--uzh {
    height: min(var(--uzh-logo-height), 70px);
  }

  .funding-logo--snsf {
    height: min(var(--snsf-logo-height), 60px);
  }
}
