:root {
  --tinta: #1c1c1c;
  --fondo: #d5d5d5;
  --barra: #c56f0a;
  --barra-oscura: #a85c08;
  --crema: #ffe9c4;
  --naranja: #f0a020;
  --papel: #fffdf8;
  --linea: #ead7b4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font-family: Figtree, "Segoe UI", sans-serif;
  overflow-x: clip;
}

a { color: #8a4b05; }

.techo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--barra);
  color: #fff;
}

.sello {
  color: #fff;
  font-family: Literata, Georgia, serif;
  font-weight: 700;
  font-size: 22px;
  text-decoration: none;
}

.mayoria {
  border: 1px solid #fff;
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.cintura {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding: 8px 12px;
  background: var(--barra-oscura);
}

.cintura > a,
.desplegable > summary {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

.cintura > a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }

.desplegable { position: relative; }

.desplegable > summary {
  cursor: pointer;
  list-style: none;
}

.desplegable > summary::-webkit-details-marker { display: none; }

.desplegable[open] .lista-provincias { display: flex; }

.lista-provincias {
  display: none;
  position: absolute;
  z-index: 4;
  left: 0;
  top: calc(100% + 8px);
  width: min(420px, 80vw);
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--papel);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
}

.lista-provincias a {
  color: var(--tinta);
  background: var(--naranja);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.hoja {
  position: relative;
  width: min(920px, calc(100% - 28px));
  margin: 22px auto 48px;
}

.rotulo { text-align: center; margin: 0 0 12px; }

.rotulo h1 {
  margin: 0;
  font-family: Literata, Georgia, serif;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .16);
}

.bajada, .jornada {
  margin: 8px 0 0;
  text-align: center;
}

.cuidado {
  margin: 12px 0;
  padding: 8px 10px;
  background: #fff4d6;
  border: 1px solid #e2c48a;
  border-radius: 8px;
  font-size: 14px;
}

.mesa {
  padding: 14px 12px 16px;
  background: var(--crema);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.epigrafe {
  margin: 0 0 10px;
  text-align: center;
  font-family: Literata, Georgia, serif;
  font-size: 22px;
  font-weight: 700;
}

.grilla {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.grilla th {
  padding: 8px 4px;
  background: var(--naranja);
  font-size: 13px;
  text-align: center;
}

.grilla td {
  padding: 7px 4px;
  border-bottom: 1px solid var(--linea);
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.grilla th:first-child { width: 30%; }
.grilla td.nombre { width: 30%; text-align: left; font-weight: 700; }

.pastilla {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  background: var(--naranja);
  color: var(--tinta);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.fichas { display: none; }

.ficha {
  padding: 8px 10px;
  background: #fff;
  border-radius: 8px;
}

.ficha ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.ficha li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.ficha b { font-variant-numeric: tabular-nums; white-space: pre-line; }

.cabezas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.turno-card {
  padding: 8px;
  background: #fff;
  border-radius: 10px;
  border-top: 4px solid var(--naranja);
}

.turno-card.vacia { opacity: .62; }

.turno-card .turno { margin: 0; font-size: 13px; font-weight: 800; }

.turno-card .cuando, .turno-card .par, .turno-card .sello {
  margin: 2px 0 0;
  font-size: 12px;
  color: #5c5144;
}

.turno-card .cifra {
  margin: 4px 0;
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.extractos { margin-top: 8px; }

.extracto {
  width: 100%;
  margin: 0 0 14px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.extracto caption {
  padding: 8px 4px;
  text-align: left;
  font-weight: 800;
}

.extracto td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--linea);
  overflow-wrap: anywhere;
}

.extracto .puesto { width: 18%; color: #5c5144; }

.extracto .valor { font-variant-numeric: tabular-nums; font-weight: 700; }

.extracto tr.primero .valor { font-size: 18px; }

.grupo-mesa {
  margin: 16px 0 8px;
  font-family: Literata, Georgia, serif;
  font-size: 22px;
}

.vacio-mesa { margin: 12px 0; }

.guia {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 6px 0 8px;
}

.guia h2 {
  grid-column: 1 / -1;
  margin: 18px 0 2px;
  font-family: Literata, Georgia, serif;
  font-size: 28px;
  font-weight: 750;
  line-height: 1.2;
}

.lote {
  margin: 0;
  padding: 12px 14px;
  background: var(--papel);
  border: 1px solid var(--linea);
}

.lote h3 { margin: 0 0 4px; font-size: 17px; line-height: 1.25; }

.lote h3 a { text-decoration: none; }

.lote p { margin: 0; color: #5c5144; font-size: 14.5px; line-height: 1.4; }

.prosa { margin-top: 22px; font-size: 17.5px; line-height: 1.58; }

.prosa h2 {
  margin: 1.15em 0 .4em;
  font-family: Literata, Georgia, serif;
  font-size: 28px;
  line-height: 1.2;
}

.prosa p { margin: .75em 0; }

.prosa ol { margin: 8px 0 16px; padding-left: 1.2em; }

.prosa li { margin: .4em 0; }

.prosa table, .lista-suenos, .lista-nombres {
  width: 100%;
  margin: 12px 0 6px;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--papel);
  font-size: 15px;
}

.prosa caption, .lista-suenos caption, .lista-nombres caption {
  caption-side: bottom;
  padding-top: 8px;
  text-align: left;
  color: #5c5144;
  font-size: 13px;
}

.prosa th, .prosa td, .lista-suenos th, .lista-suenos td, .lista-nombres th, .lista-nombres td {
  padding: 8px;
  border-bottom: 1px solid var(--linea);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.prosa th, .lista-suenos th, .lista-nombres th {
  background: #3a2a16;
  color: #fff8ea;
  font-weight: 700;
}

.origen { margin-top: 18px; color: #5c5144; font-size: 14px; }

.pie {
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid #e0d2b8;
  font-size: 14px;
}

.pie nav { display: flex; flex-wrap: wrap; gap: 6px 12px; }

.tira { width: min(420px, 100%); margin: 18px auto; }

.tira[hidden] { display: none !important; }

.tira a { display: block; }

.tira img { display: block; width: 100%; height: auto; }

@media (min-width: 1240px) {
  .hoja > .tira {
    position: absolute;
    top: 8px;
    bottom: 0;
    left: calc(100% + 18px);
    width: min(280px, calc((100vw - 920px) / 2 - 36px));
    margin: 0;
  }

  .hoja > .tira a { position: sticky; top: 12px; }
}

@media (max-width: 860px) {
  .grilla { display: none; }
  .fichas { display: grid; gap: 8px; }
  .sello { font-size: 18px; }
  .guia { grid-template-columns: 1fr; }
  .guia h2 { font-size: 24px; }
  .prosa { font-size: 16.5px; }
  .prosa h2 { font-size: 24px; }
}
