/* Estilos del sitio. Bootstrap hace el resto. */

:root {
  --azul: #2F4689;
  --azul-oscuro: #23355C;
  --coral: #F56055;
  --fondo: #ede9e4;
  --panel: #f5f2f2;
  --texto: #222;
  --bg-image: url("../img/bg.7e10246e3974.jpg");
}

body {
  background: var(--fondo);
  color: var(--texto);
  font-family: "input-mono-narrow", monospace;
  font-size: 13.5px;
  line-height: 21.5px;
}

a { color: var(--azul); }

.container { padding-inline: 5vw; }

@media (min-width: 1400px) {
  .container { max-width: 1920px; padding-inline: 140px; }
}

h1 {
  font-family: "input-mono-condensed", monospace;
  font-size: 36px;
  font-weight: 700;
  line-height: 44.5px;
  text-transform: uppercase;
  max-width: 14ch;
  margin: 0 0 60px;
}

h1.page-title { max-width: none; margin-bottom: 40px; }

p { margin-bottom: 21px; }

.label {
  font-family: "input-mono-compressed", monospace;
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 6px;
}

ul.plain { list-style: none; padding: 0; }

/* --- cabecera ------------------------------------------------------------ */

.topbar {
  position: relative;
  height: 64px;
  margin-bottom: 36px;
  background: var(--azul-oscuro) var(--bg-image) center / cover no-repeat;
}

@media (min-width: 992px) {
  .topbar { position: sticky; top: 0; z-index: 1030; }
}

.site-title {
  font-family: "input-sans-compressed", sans-serif;
  font-size: 22.5px;
  font-weight: 300;
  color: #fff;
  text-decoration: none;
}

.navbar-toggler { border: 0; }

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23fff' stroke-linecap='round' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.dropdown-menu {
  --bs-dropdown-padding-y: 0;
  --bs-dropdown-border-width: 0;
  --bs-dropdown-border-radius: 0;
  --bs-dropdown-link-color: var(--azul);
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-hover-bg: transparent;
  --bs-dropdown-link-active-color: var(--azul);
  --bs-dropdown-link-active-bg: transparent;
  --bs-dropdown-item-padding-x: 1.9rem;
  width: 266px;
  font-family: "input-sans-compressed", sans-serif;
  font-size: 18.75px;
  line-height: 38px;
  box-shadow: 6px 6px 8px rgba(0, 0, 0, .35);
}

/* el menú se ancla a la esquina superior derecha de la cabecera */
.topbar .dropdown-menu[data-bs-popper] { top: 0; right: 0; margin: 0; }

.dropdown-item {
  position: relative;
  z-index: 1;
  padding-block: 0;
  white-space: normal;
  transition: color .2s .05s;
}

.dropdown-item:hover, .dropdown-item:focus { text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.dropdown-item.active { border-left: 4px solid var(--azul); padding-left: calc(1.9rem - 4px); }
.dropdown-item.active:hover { color: #fff; }

/* resaltado del menú: una ventana (movida por site.js) que se desliza hasta el ítem
   y deja ver ese trozo de una sola imagen fija */
.menu-hl {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  background: var(--azul-oscuro) var(--bg-image) no-repeat;
  transition: top .3s cubic-bezier(.2, .7, .2, 1), height .3s cubic-bezier(.2, .7, .2, 1),
    background-position .3s cubic-bezier(.2, .7, .2, 1), opacity .2s;
}

.menu-hl.on { opacity: 1; }
.menu-hl.snap { transition: opacity .2s; }
.sub-menu .dropdown-item { font-size: 14px; line-height: 20px; padding: 8px 1.9rem 8px 3.4rem; }
.sub-menu .dropdown-item.active { padding-left: calc(3.4rem - 4px); }

/* --- pie ----------------------------------------------------------------- */

.site-footer {
  height: 120px;
  margin-top: 120px;
  background: var(--azul-oscuro) var(--bg-image) center bottom / cover no-repeat;
}

.site-footer a, .credit {
  color: #fff;
  font-size: 8.25px;
  text-decoration: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

/* --- películas ----------------------------------------------------------- */

.films { font-family: "input-mono-compressed", monospace; font-size: 12px; line-height: 19.5px; }
.film-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: filter .25s; }
.film-tile a:hover img { filter: brightness(1.15); }
.film-tile + .label { margin-top: 21px; }
.film-placeholder { aspect-ratio: 1; background: #d9d3cb; }

.modal-content {
  border: 0;
  border-radius: 0;
  box-shadow: 6px 6px 12px rgba(0, 0, 0, .3);
  font-family: "input-sans", sans-serif;
}

.modal-body { padding: 48px 48px 32px; }

/* .modal-body es position: relative y viene después: sin esto tapa el botón de cerrar */
.modal-content > .btn-close { z-index: 2; }

/* --- etiquetas ----------------------------------------------------------- */

.tag {
  display: inline-block;
  border: 1px solid var(--azul);
  color: var(--azul);
  padding: 0 .6em;
  margin: 0 .4em .4em 0;
  font-size: 12px;
  line-height: 20px;
  text-decoration: none;
  transition: background-color .3s, color .3s;
}

.tag:hover { background: var(--azul); color: #fff; }

/* --- listados ------------------------------------------------------------ */

.entry {
  display: block;
  padding: 20px 0 24px;
  border-top: 1px solid rgba(34, 34, 34, .25);
  color: inherit;
  text-decoration: none;
}

.entry h2 {
  font-family: "input-mono-condensed", monospace;
  font-size: 36px;
  font-weight: 700;
  line-height: 44px;
  margin: 0;
}

.entry p, .entry small { margin: 0; }
.entry:hover h2 { color: var(--azul); }

/* panel desplegable de corpus */
.corpus-panel {
  margin-top: 40px;
  padding: 0 1.5rem;
  background: var(--panel);
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, .12);
  font-family: "input-mono-compressed", monospace;
}

.corpus-toggle {
  display: block;
  width: 100%;
  padding: 25px 0;
  border: 0;
  background: none;
  text-align: left;
  font-size: 21px;
  font-weight: 700;
  text-transform: uppercase;
}

.corpus-panel ul { list-style: none; padding: 0 0 30px; margin: 0; }
.corpus-panel li { margin-bottom: 16px; }
.corpus-panel a { color: inherit; text-decoration: none; }
.corpus-panel a:hover { color: var(--azul); }

/* acordeones (escritos, actividades) */
.accordion {
  --bs-accordion-bg: transparent;
  --bs-accordion-border-color: rgba(34, 34, 34, .25);
  --bs-accordion-border-radius: 0;
  --bs-accordion-inner-border-radius: 0;
  --bs-accordion-active-bg: transparent;
  --bs-accordion-active-color: var(--azul);
  --bs-accordion-btn-focus-box-shadow: none;
  --bs-accordion-btn-padding-x: 0;
  --bs-accordion-body-padding-x: 0;
}

.accordion-button { font-family: "input-mono-condensed", monospace; font-size: 22px; font-weight: 700; line-height: 28px; }
.accordion-item { border-inline: 0; scroll-margin-top: 96px; }

/* --- investigadores ------------------------------------------------------ */

.person { display: flex; flex-direction: column; justify-content: flex-start; padding: 0; border: 0; background: none; text-align: left; }
.person h2 { font-family: "input-mono-condensed", monospace; font-size: 22px; font-weight: 700; line-height: 28px; padding: 16px 24px 20px; margin: 0; }
.person:hover h2 { color: var(--azul); }
.people .person:nth-child(n+2) { border-top: 1px solid #fff; }

@media (min-width: 768px) {
  .people .person:nth-child(n+2) { border-top: 0; }
  .people .person:nth-child(n+5) { border-top: 1px solid #fff; }
  .people .person:not(:nth-child(4n+1)) { border-left: 1px solid #fff; }
}

/* --- mapa ---------------------------------------------------------------- */

.mapa { position: relative; display: grid; grid-template-columns: 22% 1fr 22%; min-height: 1500px; }
.mapa-col { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; }
.mapa-films { grid-column: 1; }
.mapa-tags { grid-column: 3; }
.mapa-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mapa-edges path { fill: none; stroke: var(--texto); stroke-opacity: .18; transition: stroke .25s, stroke-opacity .25s; }

.mapa-film, .mapa-tag { transition: opacity .25s, transform .2s cubic-bezier(.2, .7, .2, 1); }
.mapa-film { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: "input-mono-compressed", monospace; font-size: 12px; line-height: 15px; }
.mapa-film img { width: 105px; height: 56px; object-fit: cover; flex: none; }
.mapa-tag { align-self: flex-end; white-space: nowrap; margin: 0; }

.mapa.hover .mapa-film, .mapa.hover .mapa-tag, .mapa.hover path { opacity: .15; }
.mapa.hover .on { opacity: 1; }
.mapa-edges path.on { stroke: var(--coral); stroke-opacity: 1; stroke-width: 2px; }
.mapa-tag.on { background: var(--azul); color: #fff; }
.mapa-film.on span { font-weight: 700; }

/* --- portada ------------------------------------------------------------- */

body.home {
  --eje-pad-y: 1.85rem;
  background: #f47553 var(--bg-image) center / cover no-repeat;
  color: #fff;
}

body.home main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: none;
  padding: 97px 7.3vw 78px;
}

.home-title {
  font-family: "input-sans-compressed", sans-serif;
  font-size: 30.375px;
  font-weight: 300;
  line-height: 38.25px;
  letter-spacing: -.06em;
  text-transform: none;
  max-width: 22ch;
  text-shadow: 0 3px 6px rgba(0, 0, 0, .3);
}

.home .list-group {
  --bs-list-group-bg: transparent;
  --bs-list-group-color: #fff;
  --bs-list-group-border-color: rgba(255, 255, 255, .75);
  --bs-list-group-border-radius: 0;
  --bs-list-group-item-padding-y: var(--eje-pad-y);
  --bs-list-group-action-color: #fff;
  --bs-list-group-action-hover-color: #fff;
  --bs-list-group-action-active-color: #fff;
  font-family: "input-sans-narrow", sans-serif;
  font-size: 14px;
  text-shadow: 0 3px 6px rgba(0, 0, 0, .16);
}

.home .list-group-item { border-inline: 0; transition: background-color .4s, color .4s; }

.home-menu {
  --bs-list-group-item-padding-x: 3.3rem;
  --bs-list-group-item-padding-y: 1.2rem;
  --bs-list-group-action-hover-bg: rgba(255, 255, 255, .5);
  --bs-list-group-action-hover-color: #000;
  font-weight: 500;
  letter-spacing: .05em;
}

@media (min-width: 992px) {
  /* el borde inferior del menú queda a la altura del primer eje: se sube lo que miden los ejes 2 a 4 */
  .home-menu { margin-bottom: calc(3 * (2 * var(--eje-pad-y) + 1.5em + 1px)); }
}

.home-ejes strong { font-weight: 800; }
.home-ejes .list-group-item:nth-child(1) { --bs-list-group-action-hover-bg: #F5605580; }
.home-ejes .list-group-item:nth-child(2) { --bs-list-group-action-hover-bg: #B58D9A80; }
.home-ejes .list-group-item:nth-child(3) { --bs-list-group-action-hover-bg: #616A8F80; }
.home-ejes .list-group-item:nth-child(4) { --bs-list-group-action-hover-bg: #23355C80; }

.credit { position: absolute; right: 7.3vw; bottom: 24px; }
