/* Estilos del sitio, siguiendo las convenciones del tema al-folio: fondo
   blanco, Roboto, un único color de acento y la misma disposición de la
   portada, las publicaciones y los proyectos. Para cambiar el acento basta
   con --global-theme-color. */

:root {
  --global-bg-color: #ffffff;
  --global-text-color: #000000;
  --global-text-color-light: #828282;
  --global-theme-color: #b509ac;
  --global-hover-color: #b509ac;
  --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-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  --global-shadow-hover: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
  --max-width: 930px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --global-bg-color: #1c1c1d;
    --global-text-color: #e8e8e8;
    --global-text-color-light: #9c9c9c;
    --global-theme-color: #2698ba;
    --global-hover-color: #2698ba;
    --global-footer-bg-color: #e8e8e8;
    --global-footer-text-color: #1c1c1d;
    --global-footer-link-color: #000000;
    --global-divider-color: #424246;
    --global-card-bg-color: #212529;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-top: 57px;
  padding-bottom: 70px;
  background: var(--global-bg-color);
  color: var(--global-text-color);
  font: 300 1rem/1.5 Roboto, "Helvetica Neue", Arial, sans-serif;
}
strong, b, .negrita { font-weight: 700; }
img { max-width: 100%; height: auto; }

a { color: var(--global-theme-color); text-decoration: none; }
a:hover { color: var(--global-hover-color); text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--global-theme-color); outline-offset: 2px; }

h1, h2, h3, h4 { font-weight: 400; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 2rem; margin-top: 2rem; }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; }

.contenedor { max-width: var(--max-width); margin: 0 auto; padding: 0 15px; }
.saltar { position: absolute; left: -9999px; }
.saltar:focus { left: 16px; top: 8px; z-index: 100; background: var(--global-bg-color); padding: 8px 12px; }

/* Barra de navegación fija */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  background: var(--global-bg-color);
  border-bottom: 1px solid var(--global-divider-color);
  opacity: .95;
}
.navbar__fila { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1rem; min-height: 56px; }
.navbar__marca { color: var(--global-text-color); font-size: 1.25rem; font-weight: 300; }
.navbar__marca:hover { color: var(--global-text-color); text-decoration: none; }
.navbar__menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.navbar__menu a { display: block; padding: .5rem .6rem; color: var(--global-text-color); font-weight: 400; }
.navbar__menu a:hover { color: var(--global-theme-color); text-decoration: none; }
.navbar__menu a[aria-current="page"] { color: var(--global-theme-color); font-weight: 700; }
@media (max-width: 767px) {
  body { padding-top: 0; }
  .navbar { position: static; }
  .navbar__fila { padding-top: 8px; padding-bottom: 4px; }
  .navbar__menu { margin-left: -.6rem; }
  .navbar__menu a { padding: .35rem .6rem; }
}

/* Pie fijo, como en al-folio */
.pie {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  background: var(--global-footer-bg-color);
  color: var(--global-footer-text-color);
  font-size: .75rem; font-weight: 400;
}
.pie .contenedor { padding-top: 9px; padding-bottom: 8px; }
.pie a { color: var(--global-footer-link-color); }
@media (max-width: 767px) { .pie { position: static; margin-top: 2rem; } body { padding-bottom: 0; } }

/* Cabecera de página */
.post-header { margin: 1.6rem 0 1.5rem; }
.post-title { font-size: 2.5rem; font-weight: 300; margin-bottom: .25rem; }
.post-description { color: var(--global-text-color-light); margin-bottom: 0; }
.desc { margin: 0; }
.migas { margin: 0 0 .25rem; color: var(--global-text-color-light); font-size: .9rem; }
.nota { color: var(--global-text-color-light); font-size: .9rem; }

/* Portada */
.profile { float: right; width: 30%; margin: 0 0 1rem 1.5rem; }
.profile .address { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .8rem; color: var(--global-text-color-light); }
.profile .address p { margin: 0; }
.clearfix::after { content: ""; display: table; clear: both; }
@media (max-width: 575px) { .profile { float: none; width: 100%; margin: 0 0 1rem; } }

.news table { width: 100%; border-collapse: collapse; }
.news th { width: 20%; text-align: left; vertical-align: top; font-weight: 700; padding: .5rem 1rem .5rem 0; white-space: nowrap; }
.news td { padding: .5rem 0; vertical-align: top; }
@media (max-width: 575px) { .news th { width: auto; } }

.social { text-align: center; margin-top: 2.5rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.25rem; }
.social .contact-note { flex-basis: 100%; color: var(--global-text-color-light); font-size: .9rem; margin: .5rem 0 0; }
.heredado, .heredado:hover { color: inherit; }

/* Publicaciones */
.publications { margin-top: 1rem; }
h2.bibliography {
  color: var(--global-divider-color);
  border-top: 1px solid var(--global-divider-color);
  padding-top: 1rem; margin-top: 2rem; margin-bottom: -1rem;
  text-align: right; font-size: 2rem;
}
ol.bibliography { list-style: none; padding: 0; margin-top: 0; }
ol.bibliography li { margin-bottom: 1rem; }
ol.bibliography .row { display: flex; gap: 0 1.5rem; }
ol.bibliography .abbr { flex: 0 0 16.6%; padding-top: .15rem; }
ol.bibliography .cuerpo { flex: 1; min-width: 0; max-width: 66.6%; }
.badge {
  display: inline-block; min-width: 76px; text-align: center; border-bottom: 0; text-decoration: none;
  background: var(--global-theme-color); color: #fff;
  font-size: .75rem; font-weight: 700; padding: .3rem .6rem; border-radius: .125rem;
}
.title { font-weight: 700; }
.author em { font-style: normal; border-bottom: 1px solid; }
.periodical em { font-style: italic; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .4rem; }
.links a.btn {
  color: var(--global-text-color); border: 1px solid var(--global-text-color);
  padding: .1rem 1rem; font-size: .75rem; font-weight: 400; border-radius: .125rem;
}
.links a.btn:hover { color: var(--global-theme-color); border-color: var(--global-theme-color); text-decoration: none; }
.links .citas { font-size: .8rem; color: var(--global-text-color-light); margin-left: .4rem; }
@media (max-width: 767px) {
  ol.bibliography .row { flex-direction: column; }
  ol.bibliography .abbr { flex-basis: auto; margin-bottom: .25rem; }
  ol.bibliography .cuerpo { max-width: none; }
  h2.bibliography { margin-bottom: 0; }
}

.filtros { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.filtros button {
  font: 400 .8rem/1.4 Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--global-text-color); background: none; cursor: pointer;
  border: 1px solid var(--global-divider-color); border-radius: .125rem; padding: .25rem .75rem;
}
.filtros button:hover { border-color: var(--global-theme-color); color: var(--global-theme-color); }
.filtros button[aria-pressed="true"] { background: var(--global-theme-color); border-color: var(--global-theme-color); color: #fff; }

/* Proyectos (recursos) */
h2.asignatura a { color: inherit; }
.category { color: var(--global-divider-color); border-top: 1px solid var(--global-divider-color); padding-top: .5rem; margin-top: 2rem; margin-bottom: 1rem; text-align: right; font-size: 2rem; }
h3.category { font-size: 1.6rem; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; margin-bottom: 1rem; }
.card { background: var(--global-card-bg-color); border-radius: .25rem; box-shadow: var(--global-shadow); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s ease-in-out; }
.card:hover { box-shadow: var(--global-shadow-hover); }
.card__enlace { color: inherit; flex: 1; }
.card__enlace:hover { color: inherit; text-decoration: none; }
.card-img-top { display: block; width: 100%; aspect-ratio: 720 / 458; object-fit: cover; object-position: top; border-bottom: 1px solid var(--global-divider-color); }
.card-body { padding: 1.25rem 1.25rem .5rem; }
.card-title { font-size: 1.25rem; font-weight: 400; margin-bottom: .5rem; }
.card__enlace:hover .card-title { color: var(--global-theme-color); }
.card-text { font-size: .9rem; margin: 0; }
.card-pie { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: 0 1.25rem 1rem; margin: .5rem 0 0; font-size: .8rem; color: var(--global-text-color-light); }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

/* Docencia e investigación */
.horario { border-collapse: collapse; margin: 0 0 1rem; }
.horario th, .horario td { text-align: left; vertical-align: top; padding: .3rem 1.2rem .3rem 0; border-bottom: 1px solid var(--global-divider-color); }
.horario th { font-weight: 700; }
.horario td:nth-child(2) { white-space: nowrap; }

.asignaturas { padding-left: 1.2rem; }
.asignaturas li { margin-bottom: .4rem; }
.linea { margin-top: 1rem; }
.linea h2 { font-size: 1.6rem; }
details summary { cursor: pointer; color: var(--global-theme-color); font-weight: 400; margin-bottom: .5rem; }

/* Páginas de vídeo (_layouts/video.html) */
.video { position: relative; aspect-ratio: 16 / 9; margin: 1rem 0 .5rem; background: #000; border-radius: .25rem; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-ficha { margin-top: 0; }
.capitulos { list-style: none; padding: 0; margin: 0 0 1.5rem; columns: 2 18rem; column-gap: 2rem; }
.capitulos li { break-inside: avoid; padding: .15rem 0; }
.capitulos__marca { display: inline-block; min-width: 3.2em; font-variant-numeric: tabular-nums; color: var(--global-text-color-light); }
.transcripcion h3 { font-size: 1.05rem; font-weight: 500; margin: 1.5rem 0 .5rem; scroll-margin-top: 4rem; }
.card-img-top.es-video { object-position: center; }

/* Ficha de una publicación (/publicaciones/<id>/) */
.ficha-publicacion .author { font-size: 1.05rem; margin-bottom: .25rem; }
.ficha-publicacion .periodical { color: var(--global-text-color-light); margin-bottom: .5rem; }
.ficha-publicacion h2 { font-size: 1.3rem; margin-top: 1.5rem; }
.bibtex { font-size: .8rem; white-space: pre-wrap; background: var(--global-code-bg-color, var(--global-card-bg-color)); padding: .75rem 1rem; border-radius: .25rem; overflow-x: auto; }
.pub .title a { color: inherit; }
.pub .title a:hover { color: var(--global-theme-color); }

/* Proyectos docentes (/docencia/proyectos/) */
.proyecto { margin-bottom: 2.5rem; }
.proyecto h2 { font-size: 1.6rem; }
.proyecto__captura img { display: block; width: 100%; height: auto; border: 1px solid var(--global-divider-color); border-radius: .25rem; box-shadow: var(--global-shadow); margin: .5rem 0 1rem; }
.proyecto__enlaces { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.datos { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: .5rem; }
.datos th, .datos td { text-align: left; vertical-align: top; padding: .4rem .5rem .4rem 0; border-bottom: 1px solid var(--global-divider-color); }
.datos th[scope="row"] { font-weight: 500; white-space: nowrap; }
.datos .num { text-align: right; padding-right: 0; }

/* Trabajos dirigidos (/docencia/trabajos/) */
.trabajos { list-style: none; padding: 0; margin: 0 0 2rem; }
.trabajo { padding: 1rem 0; border-bottom: 1px solid var(--global-divider-color); }
.trabajo .title { font-weight: 500; }
.trabajo .title a { color: inherit; }
.trabajo .title a:hover { color: var(--global-hover-color); }
.trabajo p { margin: .5rem 0 0; }
