/*
  ============================================================
  TOKENS
  ============================================================

  Variables reutilizables para mantener un sistema visual
  consistente en todo el documento.
*/
@font-face {
  font-family: 'rmregular';
  src: url('rmregular-webfont.woff2') format('woff2'),
       url('rmregular-webfont.woff') format('woff');
  font-weight: normal;
  font-style: normal;

}

:root {
  --color-background: #f4f4f0;
  --color-text: #171717;
  --color-accent: #5b3df5;

  --font-family-base: 'rmregular', system-ui, Arial, Helvetica, sans-serif;

  --font-size-body: 1.125rem;
  --font-size-h1: 2rem;
  --font-size-h2: 2rem;
  --font-size-h3: 1.625rem;
  --font-size-index: 2.25rem;
  --font-size-nav: 1.5rem;

  /* ancho de la franja vertical del menú */
  --nav-width: 4rem;
}

/*
  ============================================================
  SELECTOR UNIVERSAL
  ============================================================
  * funciona como un comodín.
  Selecciona todos los elementos HTML.
*/

* {
  box-sizing: border-box;
}


/*
  ============================================================
  BODY
  ============================================================

  Define el sistema visual base del documento.
*/
body {
  margin: 0;

  background-color: var(--color-background);
  color: var(--color-text);

  font-family: var(--font-family-base);
  font-size: var(--font-size-body);
  line-height: 1.5;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

/* sin espacio extra arriba del título del sitio */
main > header h1 {
  margin-top: 0;
}

header p {
  text-wrap-style: balance;
}

/*
  ============================================================
  JERARQUÍA TIPOGRÁFICA
  ============================================================
  HTML define la jerarquía.
  CSS controla su representación visual.
*/
h1 {
  font-size: var(--font-size-h1);
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

/*
  ============================================================
  CABEZA DE CADA PUBLICACIÓN
  ============================================================

  El número y el título subrayado funcionan como anclas visuales.
  Títulos en redondas (sin bold), subrayados.
*/

article .index {
  font-size: var(--font-size-index);
  line-height: 1;
  margin: 0 0 1.5rem;
}

article header {
  margin-bottom: 1.5rem;
}

article h3 {
  font-weight: normal;
  line-height: 1.3;
  margin: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

article h3 .subtitle {
  display: block;
}

article header p {
  margin: 0;
}

article .authors {
  font-size: var(--font-size-h3);
  line-height: 1.3;
}

/* en celular, títulos y autorxs un poco más contenidos */
@media (max-width: 767px) {
  article h3,
  article .authors {
    font-size: 1.375rem;
  }
}

article .translation {
  margin-top: 1rem;
}


/*
  ============================================================
  LINKS
  ============================================================

  El color de acento identifica enlaces y acciones.
*/

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

/*
  ============================================================
  CONTENEDOR PRINCIPAL
  ============================================================

  width:
  ocupa una proporción del espacio disponible.

  max-width:
  evita que el contenido crezca demasiado.

  margin: 0 auto:
  distribuye el espacio horizontal y centra la caja.
*/

main {
  width: 65%;
  min-width: 290px;
  max-width: 1240px;
  margin: 0 auto;
}

/* en pantallas chicas la columna ocupa todo el espacio junto al menú */
@media (max-width: 767px) {
  body > main {
    width: auto;
    min-width: 0;
    padding-left: 1rem;
    padding-right: 1.25rem;
  }
}

/* en compu, 3/4 del ancho anterior para que las líneas no sean tan largas */
@media (min-width: 768px) {
  main {
    width: 48.75%;
    max-width: 930px;
  }
}


/*
  ============================================================
  ESPACIADO BÁSICO
  ============================================================
*/

main,
footer {
  padding: 2rem;
}

section {
  margin-bottom: 2rem;
  padding-top: 2em;
}

/*
  ============================================================
  MENÚ
  ============================================================

  Franja vertical fija a la izquierda, de arriba abajo:
  t-e-e (girado) arriba, ? al centro y ↑ (subir al inicio) abajo.
  Como el contenido deja libre esa franja, nunca se enciman.
*/

nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--nav-width);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  font-size: var(--font-size-nav);
  line-height: 1;
}

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

/* t-e-e se lee de abajo hacia arriba */
nav .logo {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

body {
  padding-left: var(--nav-width);
}

/* la flecha sube al inicio con desplazamiento suave */
html {
  scroll-behavior: smooth;
}

/*
  ============================================================
  PORTADAS
  ============================================================

  Las imágenes originales miden 600px de ancho;
  aquí se muestran reducidas, con su proporción intacta.
*/

article img {
  display: block;
  margin: 1rem auto;
  width: 170px;
  max-width: 100%;
  height: auto;
}

/*
  ============================================================
  FICHA DE CADA PUBLICACIÓN
  ============================================================

  Año centrado; debajo, la portada con la ficha técnica,
  la disponibilidad y el PDF a su derecha.
*/

article > footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
  margin-top: 3rem;
  padding: 0;
}

/* el año va solo, centrado, arriba de la portada */
article > footer .year {
  flex-basis: 100%;
  text-align: center;
  margin: 0;
}

/* portada y ficha lado a lado, como en la maqueta */
article > footer img {
  margin: 0;
  min-width: 0;
}

/* en celular, portada un poco más chica para que la ficha quepa al lado */
@media (max-width: 767px) {
  article > footer {
    gap: 1rem;
  }

  article > footer img {
    width: 140px;
  }
}

/* espacio entre una publicación y la siguiente */
article {
  margin-bottom: 6rem;
}

article .ficha {
  text-align: left;
  font-size: 0.8rem;
  line-height: 1.3;
}

article .ficha p {
  margin: 1em 0 0;
}

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

/* enlaces dentro de cada publicación en negro, subrayados */
article a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

/* créditos (coediciones, apoyos) al tamaño del texto */
article .credits small {
  font-size: inherit;
}

/*
  ============================================================
  PÁGINA ?  (about.html)
  ============================================================

  Texto de información y contacto en una columna,
  alineada a la izquierda junto al menú.
*/

.about main {
  width: auto;
  min-width: 0;
  max-width: 44rem;
  margin: 0 0 0 10rem;
  padding: 1.5rem 1rem;
}

.about main p {
  margin: 0 0 1.5rem;
}

.about .info {
  margin-bottom: 3rem;
}

.about main a {
  color: var(--color-text);
  text-decoration: none;
}

.about main a:hover,
.about main a:focus {
  text-decoration: underline;
}

/* la página ocupa al menos toda la pantalla
   para que el crédito quede hasta abajo */
.about {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

/* crédito al pie de la pantalla, alineado con el texto */
.about .credito {
  max-width: 44rem;
  margin: auto 0 0 10rem;
  padding: 3rem 1rem 1.5rem;
}

.about .credito a {
  color: var(--color-text);
}

/* en pantallas chicas, junto al menú */
@media (max-width: 767px) {
  .about main,
  .about .credito {
    margin-left: 0;
  }
}

/* texto sólo para lectores de pantalla */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
