/* Diego Deplano's website: single stylesheet.
   Breakpoints (same as the original template): xl >= 1200, lg 992-1199, md 768-991, sm 576-767, xs <= 575. */

:root {
  --accent: #db545a;
  --dark: #333333;
  --text: #111111;
  --light-bg: #f2f2f2;
}

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

html { font-size: 16px; }

body {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: #ffffff;
}

h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
img { max-width: 100%; }

.container { width: 1140px; margin-left: auto; margin-right: auto; }
/* keep the margins of headings/paragraphs inside their coloured sections */
.site-footer, .bio .container, .phd .container, .course-body .container { display: flow-root; }

/* ---------------------------------------------------------------- header and menu */
.site-header { background: var(--dark); color: #ffffff; position: relative; z-index: 10; }
.header-inner { display: flex; align-items: center; min-height: 77px; }

.site-title {
  margin-left: 21px;
  font-family: Oswald, sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: #ffffff;
  text-decoration: none;
}

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block;
  padding: 10px 20px;
  font-size: 1rem;
  line-height: 1;
  color: #ffffff;
  text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }

.menu-toggle, .menu-close, .nav-overlay { display: none; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--dark); color: #ffffff; text-align: center; }
.site-footer p {
  width: 417px;
  max-width: calc(100% - 20px);
  margin: 49px auto;
  font-size: 0.875rem;
  font-style: italic;
}

/* ---------------------------------------------------------------- home: photo and contacts */
.hero { background: var(--light-bg); }
.hero .container { display: grid; grid-template-columns: 1fr 862px; min-height: 464px; }

.hero-photo { position: relative; width: 210px; height: 264px; margin: 108px 0 0 34px; }
.hero-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: 30px;
}
.hero-photo img {
  position: absolute;
  left: -6px;
  top: 14px;
  width: 200px;
  height: 250px;
  object-fit: cover;
  border-radius: 30px;
}

.hero-text { padding: 60px 30px 15px 25px; }
.hero h1 { font-family: Oswald, sans-serif; font-weight: 700; font-size: 3rem; line-height: 1.1; }
.hero .role { margin-top: 17px; font-family: Roboto, sans-serif; font-weight: 700; font-size: 1.5rem; line-height: 1.2; }
.hero .contacts { margin-top: 17px; font-size: 1.125rem; }
.hero .contacts a { color: #000000; text-decoration: underline; }
.hero .contacts a:hover { color: var(--accent); }
.hero .contacts a.dept { color: var(--accent); font-weight: 700; }

/* ---------------------------------------------------------------- home: research interests */
.areas { background: var(--light-bg); }
.areas .container { display: grid; grid-template-columns: 1fr 1fr; padding: 60px 0; min-height: 413px; }
.areas .col { padding: 30px; text-align: center; }
.areas h2 { font-family: Oswald, sans-serif; font-size: 2.25rem; line-height: 1.2; }
.areas p { margin-top: 20px; font-size: 1.125rem; }

/* ---------------------------------------------------------------- biography */
.bio .container { min-height: 667px; }
.bio p { margin: 60px 0; font-size: 1.125rem; }

/* ---------------------------------------------------------------- red banners (publication categories, courses) */
.banner { background: var(--accent); color: #ffffff; }
.banner .container { display: flex; align-items: center; min-height: 92px; }
.banner h2 {
  margin: 20px 0;
  font-family: Oswald, sans-serif;
  font-size: 3rem;
  line-height: 1.1;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- publications */
.phd .container { min-height: 344px; }
.phd h2 { margin-top: 43px; font-family: Roboto, sans-serif; font-weight: 700; font-size: 1.5rem; line-height: 1.2; }
.phd p { margin: 27px 0 43px; font-size: 1.125rem; }
.phd .award { color: var(--accent); font-weight: 700; }

.pub {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 47fr) minmax(0, 10fr);
  min-height: 233px;
  padding-top: 15px;
}
.pub-label {
  padding: 30px 0;
  text-align: center;
  font-family: Oswald, sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
}
.pub-body { padding: 30px; }
.pub-title {
  font-family: Oswald, sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  text-transform: uppercase;
}
.pub-title a { color: #000000; text-decoration: none; }
.pub-info { margin-top: 10px; font-size: 1.125rem; line-height: 2.2; }
.pub-info .me { text-decoration: underline; }
/* co-authors linked to their personal/academic page (coauthors.json) */
.pub-info a.coauthor { color: inherit; text-decoration: none; }
.pub-info a.coauthor:hover, .pub-info a.coauthor:focus-visible { color: var(--accent); }
.course-body a { color: #000000; font-style: italic; text-decoration: none; }
.course-body .sep { margin: 0 0.9em; }
/* material links rendered as buttons: side by side, wrapping to the left edge */
.pub-info .mat, .phd .mat { display: flex; flex-wrap: wrap; gap: 0.5em; margin: 0.3em 0; }
.pub-info .mat a, .phd .mat a, .mat .bib-btn {
  display: inline-block; padding: 0.15em 0.85em;
  font-size: 0.95rem; line-height: 1.6; color: var(--accent); text-decoration: none;
  border: 1px solid var(--accent); border-radius: 4px; background: #ffffff;
  transition: background-color 0.15s, color 0.15s;
}
.pub-info .mat a:hover, .pub-info .mat a:focus-visible,
.phd .mat a:hover, .phd .mat a:focus-visible { background: var(--accent); color: #ffffff; }
.mat .bib-btn { font-family: inherit; cursor: pointer; background: var(--accent); color: #ffffff; }
.mat .bib-btn:hover, .mat .bib-btn:focus-visible { background: #b8383e; border-color: #b8383e; }
.pub-info .xref { color: inherit; text-decoration: underline; }
.pub-title a:hover, .course-body a:hover, .pub-info .xref:hover { color: var(--accent); }
.pub-logo { padding: 30px 0; }
.pub-logo img { display: block; width: 100%; height: auto; aspect-ratio: 190 / 105; object-fit: cover; }

.pub-sep { height: 3px; margin: 7px auto; border: 0; background: var(--accent); }
@media (min-width: 1200px) {
  .pub-sep.container { width: 1200px; }  /* the divider is 30px wider than the text on each side */
}
/* papers, banners and dividers hidden by the publication filters */
.pub[hidden], .banner[hidden], .pub-sep[hidden] { display: none; }

/* ---------------------------------------------------------------- teachings */
.course-body .container { min-height: 105px; }
.course-body p { margin: 38px 0; font-size: 1.125rem; }
.course-body .label { margin-right: 1.2em; }

/* ================================================================ lg: 992-1199 */
@media (max-width: 1199px) {
  .container { width: 940px; }
  .hero .container { grid-template-columns: 1fr 653px; min-height: 483px; }
  .hero-photo { margin-left: 30px; }
  .hero-photo img { left: -2px; }
  .hero h1 { font-size: 2.75rem; }
  .hero .role { font-size: 1.375rem; }
  .hero .contacts { font-size: 1rem; }
  .areas .container { min-height: 396px; }
  .areas h2 { font-size: 2.125rem; }
  .areas p { font-size: 1rem; }
  .bio p { font-size: 1rem; }
  .banner h2 { margin: 15px 0; font-size: 2.75rem; }
  .phd h2 { font-size: 1.375rem; }
  .phd p { font-size: 1rem; }
  .pub { min-height: 195px; }
  .pub-label { font-size: 1.375rem; }
  .pub-title { font-size: 1.375rem; }
  .pub-info { font-size: 1rem; }
  .course-body p { font-size: 1rem; }
}

/* ================================================================ md: 768-991 (menu becomes a side panel) */
@media (max-width: 991px) {
  .container { width: 720px; }
  .header-inner { min-height: 76px; }

  .menu-toggle {
    display: block;
    margin-left: auto;
    padding: 4px 0;
    border: 0;
    background: none;
    color: #ffffff;
    cursor: pointer;
  }
  .menu-toggle svg { display: block; width: 24px; height: 24px; fill: currentColor; }
  .menu-toggle:hover { color: var(--accent); }

  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 30;
    width: 250px;
    margin: 0;
    padding-top: 80px;
    background: rgba(0, 0, 0, 0.95);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    visibility: hidden;
  }
  .menu-open .site-nav { transform: none; visibility: visible; }
  .site-nav ul { flex-direction: column; text-align: center; }
  .site-nav a { padding: 10px 20px; font-size: 1.25rem; line-height: 1.6; }
  .menu-close {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
    border: 0;
    background: none;
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
  }
  .menu-close:hover { color: var(--accent); }
  .nav-overlay { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.7); }
  .menu-open .nav-overlay { display: block; }

  .hero .container { grid-template-columns: 1fr 441px; min-height: 493px; }
  .hero h1 { font-size: 2.5rem; }
  .hero .role { margin-top: 9px; font-size: 1.25rem; }
  .hero .contacts { margin-top: 25px; }
  .hero-text { padding-bottom: 30px; }
  .areas .container { min-height: 423px; }
  .areas h2 { font-size: 2rem; }
  .banner .container { min-height: 85px; }
  .banner h2 { margin: 21px 0; font-size: 2.5rem; }
  .phd h2 { margin-top: 56px; font-size: 1.25rem; }
  .phd p { margin: 28px 0 57px; }
  .pub { min-height: 230px; padding-top: 14px; }
  .pub-title { font-size: 1.25rem; }
}

/* ================================================================ sm: 576-767 (one column, photo on top) */
@media (max-width: 767px) {
  .container { width: 540px; }
  .site-title { font-size: 1rem; }

  .hero .container { display: flow-root; min-height: 0; padding-bottom: 40px; }
  .hero-photo { width: 157px; height: 197px; margin: 30px auto 0; }
  .hero-photo img { left: -3px; top: 9px; width: 150px; height: 188px; }
  .hero-text { padding: 25px 10px 0; }
  .hero h1 { font-size: 2.25rem; }
  .hero .role { margin-top: 10px; font-size: 1.125rem; }

  .areas .container { display: block; padding: 1px 0; min-height: 0; }
  .areas .col { padding: 30px 10px 15px; }
  .areas h2 { font-size: 1.875rem; }

  .phd h2 { font-size: 1.125rem; }
  .pub { grid-template-columns: minmax(0, 5fr) minmax(0, 54fr) minmax(0, 1fr); }
  .pub-logo { display: none; }
  .pub-info { line-height: 1.7; }
}

/* ================================================================ xs: <= 575 */
@media (max-width: 575px) {
  .container { width: min(340px, calc(100% - 20px)); }
  .hero h1 { font-size: 2rem; }
  .hero .role { font-size: 1rem; }
  .areas h2 { font-size: 1.75rem; }
  .bio .container { min-height: 0; }
  .bio p { margin: 35px 0; }
  .banner h2 { font-size: 1.875rem; }
  .pub { grid-template-columns: minmax(0, 7fr) minmax(0, 52fr) minmax(0, 1fr); }
  .course-body p { margin: 30px 0; }
}

/* BibTeX popup */
.bib-dialog {
  width: min(640px, calc(100% - 32px)); max-width: none; padding: 24px; border: 0; border-radius: 12px;
  color: var(--text); background: #ffffff; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.bib-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.bib-dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.bib-dialog h2 { margin: 0; font-size: 1.25rem; }
.bib-close { padding: 0 6px; font-size: 1.6rem; line-height: 1; color: #555555; background: none; border: 0; cursor: pointer; }
.bib-close:hover { color: var(--accent); }
.bib-dialog pre {
  max-height: 60vh; margin: 0 0 20px; padding: 16px; overflow: auto;
  font-family: Consolas, Menlo, monospace; font-size: 0.875rem; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
  background: #f5f5f7; border: 1px solid #e3e3e3; border-radius: 8px;
}
.bib-dialog pre:focus { outline: none; }
.bib-copy {
  padding: 0.6em 1.2em; font-family: inherit; font-size: 1rem; font-weight: 700; color: #ffffff;
  background: var(--accent); border: 0; border-radius: 6px; cursor: pointer;
}
.bib-copy:hover, .bib-copy:focus-visible { background: #b8383e; }

/* Material popup: manuscripts, slides and posters (desktop only) and videos, see site.js */
.pdf-dialog {
  display: none; width: min(1200px, calc(100% - 48px)); max-width: none; height: calc(100% - 48px); max-height: none;
  padding: 0; overflow: hidden; border: 0; border-radius: 12px;
  color: var(--text); background: #ffffff; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.pdf-dialog[open] { display: flex; flex-direction: column; }
.pdf-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.pdf-dialog-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 24px; border-bottom: 1px solid #e3e3e3; }
.pdf-dialog h2 { margin: 0 auto 0 0; font-size: 1.125rem; }
.pdf-action {
  padding: 0.15em 0.85em; font-size: 0.95rem; line-height: 1.6; color: var(--accent); text-decoration: none;
  border: 1px solid var(--accent); border-radius: 4px; transition: background-color 0.15s, color 0.15s;
}
.pdf-action:hover, .pdf-action:focus-visible { background: var(--accent); color: #ffffff; }
.pdf-dialog iframe { flex: 1; width: 100%; border: 0; background: #525659; }
.pdf-dialog.is-video { width: min(1100px, calc(100% - 32px), (100vh - 140px) * 16 / 9); height: fit-content; }
.pdf-dialog.is-video iframe { flex: none; aspect-ratio: 16 / 9; background: #000000; }
.pdf-action[hidden] { display: none; }
@media (max-width: 575px) {
  .pdf-dialog-head { padding-left: 16px; }
  .pdf-dialog h2 { font-size: 1rem; }
}

/* Publication filters: dropdown menus side by side (built by site.js) */
.pub-filter { background: var(--light-bg); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 18px 0; }
.filter-title { margin-right: 6px; font-family: Roboto, sans-serif; font-weight: 700; font-size: 1.125rem; }
.filter-dd { position: relative; }
.filter-dd summary {
  display: flex; align-items: center; gap: 0.4em; min-width: 150px; padding: 0.4em 0.8em;
  font-size: 0.95rem; line-height: 1.6; list-style: none; cursor: pointer; user-select: none;
  background: #ffffff; border: 1px solid #c8c8c8; border-radius: 6px;
}
.filter-dd summary::-webkit-details-marker { display: none; }
.filter-dd summary::after {  /* chevron */
  content: ''; flex: none; width: 0.45em; height: 0.45em; margin: -0.2em 0 0 auto;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.filter-dd[open] summary::after { margin-top: 0.25em; transform: rotate(-135deg); }
.filter-dd summary:hover, .filter-dd[open] summary { border-color: var(--accent); }
.filter-dd.is-active summary { color: var(--accent); border-color: var(--accent); }
.filter-name { font-weight: 700; }
.filter-value { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.filter-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 5; min-width: 100%; max-height: 60vh; overflow: auto;
  padding: 6px 0; background: #ffffff; border: 1px solid #e3e3e3; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.filter-group {
  padding: 8px 14px 2px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; white-space: nowrap; color: #777777;
}
.filter-option { display: flex; align-items: center; gap: 0.6em; padding: 5px 14px; font-size: 0.95rem; white-space: nowrap; cursor: pointer; }
.filter-option:hover { background: #f5f5f7; }
.filter-option input { margin: 0; accent-color: var(--accent); cursor: inherit; }
.filter-option .count { margin-left: auto; padding-left: 1.5em; font-size: 0.85rem; color: #888888; }
.filter-option.is-empty { color: #b0b0b0; cursor: default; }
.filter-option.is-empty:hover { background: none; }
.filter-status { display: flex; align-items: center; gap: 14px; margin-left: auto; font-size: 0.95rem; color: #555555; }
.filter-reset { padding: 0; font: inherit; color: var(--accent); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.filter-empty { margin: 0; padding: 0 0 30px; font-size: 1.125rem; color: #555555; }
@media (max-width: 575px) {
  .filter-bar { column-gap: 8px; }
  .filter-title { flex-basis: 100%; }
  .filter-dd { flex: 1 1 calc(50% - 4px); min-width: 0; }  /* four menus on two rows */
  .filter-dd summary { gap: 0.3em; min-width: 0; padding: 0.4em 0.5em; font-size: 0.875rem; }
  .filter-dd:nth-of-type(even) .filter-menu { left: auto; right: 0; }
  .filter-status { flex-basis: 100%; justify-content: space-between; margin-left: 0; }
}
