/* Movilidad Cuenca — sitio público.
   Señalética de transporte: Archivo en ancho condensado para titulares,
   ancho normal para lectura. Rojo teja de marca, azul cúpula como acento. */

@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --teja: #c32532;
  --teja-oscura: #981d27;
  --cupula: #0099cc;
  --cupula-texto: #006f94;
  --cal: #ffffff;
  --piedra-clara: #eef0ec;
  --piedra: #5b6066;
  --andesita: #23272b;
  --linea: #d5d9d3;

  --measure: 68ch;
  --gutter: clamp(20px, 5vw, 56px);
  --maxw: 1180px;

  --t-body: 1.0625rem;
  --t-small: 0.875rem;
  --t-h3: 1.375rem;
  --t-h2: clamp(2rem, 4.2vw, 3rem);
  --t-h1: clamp(3rem, 9vw, 7.25rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family:
    'Archivo',
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--andesita);
  background: var(--cal);
  font-stretch: 100%;
}

a {
  color: var(--cupula-texto);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--andesita);
}

:focus-visible {
  outline: 3px solid var(--cupula);
  outline-offset: 3px;
  border-radius: 2px;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 10;
  background: var(--cal);
  padding: 8px 12px;
}

/* ─── Cabecera ─────────────────────────────────────────────── */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  font-stretch: 80%;
  font-size: 1.25rem;
  letter-spacing: 0.005em;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.hero .brand img {
  box-shadow: 0 0 0 2px var(--cal);
}

.top nav {
  display: flex;
  gap: 22px;
  font-size: var(--t-small);
  font-weight: 600;
}

.top nav a {
  color: inherit;
  text-decoration: none;
}

.top nav a:hover {
  text-decoration: underline;
}

/* ─── Portada en rojo teja ─────────────────────────────────── */

.hero {
  background: var(--teja);
  color: var(--cal);
}

.hero a {
  color: var(--cal);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(32px, 6vw, 88px);
  padding-top: clamp(24px, 5vw, 64px);
  padding-bottom: clamp(48px, 7vw, 96px);
  align-items: start;
}

.hero h1 {
  margin: 0;
  font-size: var(--t-h1);
  line-height: 0.9;
  font-weight: 850;
  font-stretch: 68%;
  letter-spacing: -0.01em;
  max-width: 11ch;
}

.hero .lede {
  margin: 28px 0 36px;
  max-width: 40ch;
  font-size: 1.25rem;
  line-height: 1.45;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.store {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  padding: 8px 20px;
  border-radius: 12px;
  background: var(--andesita);
  color: var(--cal);
  text-decoration: none;
  line-height: 1.15;
}

.store small {
  font-size: 0.75rem;
  opacity: 0.8;
}

.store strong {
  font-size: 1.0625rem;
  font-stretch: 85%;
}

.hero .store:hover {
  background: #000;
  color: var(--cal);
}

.store-soon {
  font-weight: 600;
  padding: 14px 0;
}

/* Diagrama de línea (la pieza memorable de la página) */

.line {
  position: relative;
  margin: 0;
  padding: 4px 0 0;
  list-style: none;
}

.line-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  font-size: var(--t-small);
}

.line-head strong {
  font-stretch: 75%;
  font-size: 1.125rem;
}

.live {
  flex: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
}

.live::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cal);
  opacity: 0.5;
}

.live[data-on='true']::before {
  opacity: 1;
  animation: pulso 1.8s ease-in-out infinite;
}

.line ol {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.line ol::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 12px;
  bottom: 12px;
  width: 6px;
  border-radius: 3px;
  background: var(--cal);
}

.line li {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding-left: 40px;
  font-weight: 600;
  font-stretch: 90%;
}

.line li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--teja);
  border: 4px solid var(--cal);
}

.line li.terminal {
  font-weight: 800;
}

.line li.terminal::before {
  width: 22px;
  height: 22px;
  margin-top: -11px;
  left: 1px;
  background: var(--cal);
}

.eta {
  flex: none;
  font-size: var(--t-small);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--cal);
  color: var(--teja-oscura);
  border-radius: 999px;
  padding: 2px 10px;
}

.eta:empty {
  display: none;
}

.line-note {
  margin: 14px 0 0;
  font-size: 0.8125rem;
  opacity: 0.85;
}

@keyframes pulso {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.6);
    opacity: 0.55;
  }
}

/* ─── Secciones ────────────────────────────────────────────── */

.section {
  padding-top: clamp(56px, 9vw, 112px);
  padding-bottom: clamp(56px, 9vw, 112px);
}

main > .section.wrap + .section.wrap {
  padding-top: 0;
}

.section h2 {
  margin: 0 0 20px;
  font-size: var(--t-h2);
  line-height: 1;
  font-weight: 800;
  font-stretch: 72%;
  letter-spacing: -0.005em;
  max-width: 18ch;
}

.section .intro {
  margin: 0;
  max-width: 52ch;
  color: var(--piedra);
  font-size: 1.125rem;
}

/* Lo que hace la app: filas con distintivo de modo de transporte */

.modes {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 88px);
}

.mode-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--andesita);
}

.mode-list li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--linea);
}

.badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-weight: 850;
  font-stretch: 75%;
  font-size: 1.375rem;
  color: var(--cal);
  background: var(--andesita);
}

.badge.tram {
  background: var(--teja);
}

.badge.bus {
  background: var(--cupula-texto);
}

.badge.event {
  background: var(--cal);
  color: var(--andesita);
  box-shadow: inset 0 0 0 3px var(--andesita);
  border-radius: 10px;
}

.mode-list h3 {
  margin: 4px 0 6px;
  font-size: var(--t-h3);
  font-weight: 750;
  font-stretch: 85%;
  line-height: 1.15;
}

.mode-list p {
  margin: 0;
  color: var(--piedra);
  max-width: 54ch;
}

/* Agenda */

.agenda {
  background: var(--piedra-clara);
}

.agenda-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.events {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--andesita);
}

.events li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--linea);
}

.ev-date {
  font-weight: 800;
  font-stretch: 75%;
  line-height: 1;
}

.ev-date span {
  display: block;
  font-size: 2.25rem;
  color: var(--teja);
}

.ev-date small {
  font-size: var(--t-small);
  color: var(--piedra);
}

.ev-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 750;
  font-stretch: 88%;
  line-height: 1.2;
}

.ev-meta {
  margin: 0;
  color: var(--piedra);
  font-size: 0.9375rem;
}

.ev-price {
  font-weight: 700;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.events li.events-empty {
  display: block;
  padding: 28px 0;
  color: var(--piedra);
  border-bottom: 1px solid var(--linea);
}

/* Enviar evento */

.submit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: paso;
}

.steps li {
  counter-increment: paso;
  position: relative;
  padding: 0 0 22px 52px;
}

.steps li::before {
  content: counter(paso);
  position: absolute;
  left: 0;
  top: -2px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--andesita);
  font-weight: 800;
  font-stretch: 80%;
}

.steps strong {
  display: block;
  font-size: 1.125rem;
}

.steps span {
  color: var(--piedra);
}

/* ─── Pie ──────────────────────────────────────────────────── */

.foot {
  background: var(--andesita);
  color: #d9dcd8;
  font-size: var(--t-small);
  padding: 48px 0 56px;
}

.foot a {
  color: var(--cal);
}

.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
}

.foot p {
  margin: 0 0 10px;
  max-width: 62ch;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: flex-end;
  align-content: start;
}

/* ─── Páginas legales ──────────────────────────────────────── */

.page-top {
  border-bottom: 6px solid var(--teja);
}

.doc {
  max-width: var(--measure);
  padding-top: clamp(40px, 7vw, 80px);
  padding-bottom: clamp(56px, 9vw, 112px);
}

.doc h1 {
  margin: 0 0 8px;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 0.95;
  font-weight: 850;
  font-stretch: 70%;
}

.doc .updated {
  margin: 0 0 40px;
  color: var(--piedra);
  font-size: var(--t-small);
}

.doc h2 {
  margin: 44px 0 12px;
  font-size: 1.5rem;
  font-weight: 780;
  font-stretch: 82%;
  line-height: 1.15;
}

.doc h3 {
  margin: 28px 0 8px;
  font-size: 1.125rem;
  font-weight: 700;
}

.doc p,
.doc li {
  line-height: 1.65;
}

.doc ul {
  padding-left: 1.25em;
}

.doc li + li {
  margin-top: 6px;
}

.doc .summary {
  border-left: 6px solid var(--cupula);
  padding: 4px 0 4px 20px;
  margin: 0 0 8px;
  font-size: 1.125rem;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin: 12px 0;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--linea);
}

.doc th {
  font-weight: 700;
  border-bottom: 2px solid var(--andesita);
}

/* ─── Moderación ───────────────────────────────────────────── */

.mod dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 24px;
  margin: 24px 0;
}

.mod dt {
  color: var(--piedra);
}

.mod dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.mod .desc {
  white-space: pre-wrap;
  border-top: 1px solid var(--linea);
  padding-top: 16px;
}

.status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--t-small);
  background: var(--piedra-clara);
}

.status.published {
  background: #e3f1d0;
  color: #3d5500;
}

.status.rejected {
  background: #f7d9d9;
  color: var(--teja-oscura);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.actions form {
  margin: 0;
}

.btn {
  font: inherit;
  font-weight: 700;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  border: 2px solid var(--andesita);
  background: var(--cal);
  color: var(--andesita);
  cursor: pointer;
}

.btn.primary {
  background: var(--teja);
  border-color: var(--teja);
  color: var(--cal);
}

.btn:hover {
  background: var(--andesita);
  border-color: var(--andesita);
  color: var(--cal);
}

/* ─── Responsive ───────────────────────────────────────────── */

@media (max-width: 860px) {
  .hero-grid,
  .modes,
  .submit,
  .foot-grid {
    grid-template-columns: 1fr;
  }

  .foot nav {
    justify-content: flex-start;
  }

  .events li {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .ev-price {
    grid-column: 2;
  }

  .ev-date span {
    font-size: 1.75rem;
  }
}

@media (max-width: 520px) {
  .top nav {
    gap: 14px;
  }

  .top nav .optional {
    display: none;
  }

  .mod dl {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .mod dd {
    margin-bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live[data-on='true']::before {
    animation: none;
  }
}
