/* K'áak': colores y letra de la imagen del proyecto (assets/kaak_ancha.png). */

@font-face {
  font-family: "Space Grotesk";
  src: url("../fuentes/SpaceGrotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --fondo: #0b0d12;
  --fondo-alto: #12151d;
  --linea: rgba(255, 241, 201, 0.12);
  --crema: #fff1c9;
  --texto: #e8e2d6;
  --gris: #9a968f;
  --ambar: #ffa630;
  --brasa: #d9440f;
  --radio: 14px;
  --ancho: 46rem;
  --letra: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--letra);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--texto);
  background-color: var(--fondo);
  /* Un resplandor de brasa arriba a la derecha, como el mapa del logo. */
  background-image:
    radial-gradient(60rem 36rem at 105% -10%, rgba(217, 68, 15, 0.16), transparent 60%),
    radial-gradient(40rem 24rem at 110% 0%, rgba(255, 166, 48, 0.08), transparent 55%);
  background-repeat: no-repeat;
}

.saltar {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--ambar);
  color: var(--fondo);
  border-radius: 8px;
  font-weight: 600;
  z-index: 10;
}
.saltar:focus { top: 1rem; }

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

/* Cabecera */
.cabecera,
.pestanas,
main,
.pie {
  width: 100%;
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: 1rem;
}

.cabecera {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
}

.marca { display: flex; flex-direction: column; gap: 0.15rem; }

.marca-nombre {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--crema);
}

.marca-lema {
  max-width: 22rem;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--gris);
}

.idiomas {
  display: flex;
  flex-shrink: 0;
  border: 1px solid var(--linea);
  border-radius: 999px;
  padding: 3px;
}

.idiomas button {
  min-width: 2.75rem;
  min-height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--gris);
  font: 600 0.8125rem var(--letra);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.idiomas button[aria-pressed="true"] {
  background: var(--crema);
  color: var(--fondo);
}

/* Pestañas de las tres secciones */
.pestanas {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 0.25rem;
  margin-top: 1.25rem;
  background: rgba(11, 13, 18, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
  overflow-x: auto;
  scrollbar-width: none;
}
.pestanas::-webkit-scrollbar { display: none; }

.pestanas a {
  flex-shrink: 0;
  padding: 0.85rem 0.6rem 0.75rem;
  color: var(--gris);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.pestanas a:hover { color: var(--texto); }
.pestanas a[aria-current="page"] {
  color: var(--crema);
  border-bottom-color: var(--ambar);
}

/* Secciones */
main {
  flex: 1;
  padding-top: 1.75rem;
  padding-bottom: 3rem;
}
main:focus { outline: none; }

.seccion { animation: aparecer 0.45s ease-out both; }

.titulo {
  margin: 0;
  font-size: clamp(1.6rem, 6vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--crema);
  text-wrap: balance;
}

.entrada {
  margin: 0.75rem 0 0;
  max-width: 38rem;
  color: var(--texto);
}

/* Lista de municipios */
.selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

.selector label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ambar);
}

.selector select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 3rem 0.75rem 1rem;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  background-color: var(--fondo-alto);
  /* Flecha del selector, en el color crema. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23fff1c9' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
  color: var(--crema);
  font: 500 1.0625rem var(--letra);
  cursor: pointer;
}
.selector select:hover { border-color: rgba(255, 166, 48, 0.45); }

.aviso {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--ambar);
  background: rgba(255, 166, 48, 0.07);
  border-radius: 0 var(--radio) var(--radio) 0;
  color: var(--texto);
}

/* Ficha del municipio */
.ficha {
  margin-top: 1.5rem;
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--linea);
  border-radius: calc(var(--radio) + 4px);
  background: linear-gradient(160deg, rgba(217, 68, 15, 0.08), transparent 45%), var(--fondo-alto);
  animation: aparecer 0.4s ease-out both;
}

.ficha-estado {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gris);
}

.ficha-nombre {
  margin: 0.2rem 0 0;
  font-size: clamp(2.2rem, 10vw, 3.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--crema);
  overflow-wrap: anywhere;
}

.ficha-datos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem 1.5rem;
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--linea);
}
.ficha-datos dt {
  font-size: 0.8125rem;
  color: var(--gris);
}
.ficha-datos dd {
  margin: 0.2rem 0 0;
  font-weight: 500;
  color: var(--crema);
}

.etiqueta {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.5rem;
  border: 1px solid rgba(255, 166, 48, 0.5);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ambar);
  vertical-align: 0.1em;
}

/* Lo que todavía no está: se ve como un espacio reservado, no como un error. */
.pendiente {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--linea);
  border-radius: var(--radio);
  color: var(--gris);
}
.pendiente h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--texto);
}
.pendiente p { margin: 0; font-size: 0.9375rem; }
.seccion > .pendiente { margin-top: 1.75rem; }

/* Pie */
.pie {
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--linea);
  font-size: 0.8125rem;
  color: var(--gris);
}
.pie p { margin: 0 0 0.35rem; }

@keyframes aparecer {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (min-width: 40rem) {
  .cabecera { padding-top: 2.25rem; }
  .marca-nombre { font-size: 2.6rem; }
  .pestanas a { padding-inline: 0.9rem; }
  .ficha { padding: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .seccion, .ficha { animation: none; }
}
