/*
  What kungfu2 adds to web.css: the menu, the inner-page header, the
  weekly timetable, photos with a caption, the list of pages on the home
  page and the photo gallery. Same tokens, same three colour themes.
*/

/* ---------- Brand as a link home ---------- */

.cabecera .marca a,
.pie .marca a {
  color: inherit;
  text-decoration: none;
}

.cabecera .marca a:hover,
.pie .marca a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* ---------- Menu ---------- */

/* Every page, under the brand. A plain wrapping list: no JavaScript, no
   hidden menu. Each link is a 44px-high target; the current page is
   underlined in the accent. */
.menu > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--e-4);
  margin: 0;
  padding: var(--e-1) 0;
  list-style: none;
  border-bottom: 1px solid var(--linea);
  font-size: var(--t-0);
}

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--tinta);
  text-decoration: none;
}

.menu a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.menu a[aria-current="page"] {
  color: var(--verde);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

@media (max-width: 26em) {
  .menu > ul {
    gap: 0 var(--e-3);
  }
}

/* ---------- Inner pages: a short band ---------- */

.interior .cabecera > .wrap {
  padding-bottom: var(--e-5);
}

.interior .cabecera h1 {
  margin-top: var(--e-5);
}

.interior .cabecera .lead {
  max-width: 34em;
}

/* ---------- Home: the week ---------- */

/* The four classes in the header, in time order, on the same evenings. */
.semana {
  margin: var(--e-2) 0 0;
  padding: 0;
  list-style: none;
}

.semana > li {
  display: flex;
  justify-content: space-between;
  gap: var(--e-3);
  padding: var(--e-2) 0;
  border-bottom: 1px solid var(--linea);
}

.semana__hora {
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

/* ---------- Timetable ---------- */

.tabla-horario {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: lining-nums tabular-nums;
}

.tabla-horario caption {
  margin-bottom: var(--e-3);
  text-align: left;
  color: var(--gris);
  font-size: var(--t-0);
}

.tabla-horario th,
.tabla-horario td {
  padding: var(--e-2) var(--e-3) var(--e-2) 0;
  border-bottom: 1px solid var(--linea);
  text-align: left;
  vertical-align: top;
}

.tabla-horario thead th {
  font-size: var(--t-0);
  font-weight: 400;
  color: var(--gris);
}

.tabla-horario tbody th {
  font-weight: 600;
}

.tabla-horario td:last-child {
  white-space: nowrap;
}

/* ---------- Photos with a caption ---------- */

.foto {
  margin: var(--e-4) 0;
}

.seccion > .foto--ancha {
  grid-column: wide;
}

.foto img,
.galeria img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--hueco);
  outline: 1px solid var(--borde-foto);
  outline-offset: -1px;
}

.foto figcaption,
.galeria figcaption {
  margin-top: var(--e-2);
  font-size: var(--t-0);
  line-height: 1.45;
  color: var(--gris);
}

/* Two photos side by side from 40em. */
.seccion > .pareja {
  grid-column: wide;
  display: grid;
  gap: var(--e-3);
  margin: var(--e-4) 0;
}

.pareja > .foto {
  margin: 0;
}

@media (min-width: 40em) {
  .pareja {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* A portrait photo beside the text from 60em; above it on a phone. */
.seccion > .con-foto {
  grid-column: wide;
  display: grid;
  gap: var(--e-4);
}

.con-foto > div > :last-child {
  margin-bottom: 0;
}

.con-foto > .foto {
  margin: 0;
  max-width: 24rem;
}

@media (min-width: 60em) {
  .con-foto {
    grid-template-columns: minmax(0, var(--col)) minmax(0, 1fr);
    column-gap: var(--e-6);
    align-items: start;
  }

  .con-foto > .foto {
    justify-self: end;
  }
}

/* ---------- Home: the other pages ---------- */

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

.indice > li {
  padding: var(--e-3) 0;
  border-top: 1px solid var(--linea);
}

.indice > li:last-child {
  border-bottom: 1px solid var(--linea);
}

.indice a {
  font-size: var(--t-2);
  font-weight: 600;
}

.indice p {
  margin: var(--e-1) 0 0;
  color: var(--tinta-suave);
}

/* ---------- Lists inside the text ---------- */

.seccion ul.lista,
.seccion ol.lista {
  margin: 0 0 var(--e-3);
  padding-left: 1.25em;
}

.lista > li + li {
  margin-top: var(--e-2);
}

/* ---------- Gallery ---------- */

/* Every photo cut to 3:2 in a grid; each opens the large version. */
.seccion > .galeria {
  grid-column: wide;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--e-4) var(--e-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.galeria figure {
  margin: 0;
}

.galeria img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  /* Cut from the top fifth: portraits keep their faces. */
  object-position: 50% 20%;
}

.galeria a {
  display: block;
}

.galeria a:hover img {
  outline: 2px solid var(--verde);
  outline-offset: 2px;
}

.seccion > h2 + .galeria {
  margin-top: 0;
}

/* ---------- Print ---------- */

@media print {
  .menu {
    display: none;
  }
}

/* ---------- Home header: room for the three classes ---------- */

@media (min-width: 60em) {
  .cabecera__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 25rem);
    align-items: start;
  }

  .cabecera h1 {
    margin-top: var(--e-5);
  }

  .cabecera__accion {
    margin-top: var(--e-5);
  }
}

.tabla-horario + p {
  margin-top: var(--e-4);
}
