/* Formaciones Tripartitas — hoja de estilos
   Tipografía: Archivo (variable, ancho 62–125 %), autoalojada. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations"),
       url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations"),
       url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --rojo: #C8141C;
  --rojo-oscuro: #A00F16;
  --amarillo: #FFC20E;
  --tinta: #161A26;
  --hormigon: #EDECE8;
  --gris: #555A66;
  --linea: #D6D4CE;
  --blanco: #FFFFFF;

  --ancho: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radio: 6px;
  --fuente: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--tinta);
  background: var(--blanco);
  font-stretch: 100%;
}
img { max-width: 100%; height: auto; display: block; }
picture { display: contents; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.08; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 2px; border-radius: 2px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saltar { position: absolute; left: 8px; top: -60px; background: var(--tinta); color: #fff; padding: 10px 14px; z-index: 100; border-radius: var(--radio); }
.saltar:focus { top: 8px; }
.contenedor { width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 0 var(--gutter); }

/* Botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .7em 1.25em;
  font-weight: 700; font-stretch: 105%; text-decoration: none; line-height: 1.1;
  border-radius: var(--radio); border: 2px solid transparent; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.boton--rojo { background: var(--rojo); color: #fff; }
.boton--rojo:hover { background: var(--rojo-oscuro); }
.boton--tinta { background: var(--tinta); color: #fff; }
.boton--tinta:hover { background: #2A3042; }
.boton--borde { border-color: var(--tinta); color: var(--tinta); background: transparent; }
.boton--borde:hover { background: var(--tinta); color: #fff; }
.boton--ancho { width: 100%; }

/* Cabecera */
.cabecera { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: saturate(1.2) blur(6px); border-bottom: 1px solid var(--linea); }
.cabecera__fila { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.cabecera__logo img { width: clamp(190px, 24vw, 270px); }
.nav__lista { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav__lista a:not(.boton) { text-decoration: none; font-weight: 600; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav__lista a:not(.boton):hover { border-bottom-color: var(--rojo); }
.nav__tel { min-height: 42px; padding: .55em 1em; }
.nav__abrir { display: none; background: none; border: 0; width: 48px; height: 48px; cursor: pointer; position: relative; }
.nav__hamburguesa, .nav__hamburguesa::before, .nav__hamburguesa::after { position: absolute; left: 12px; width: 24px; height: 2.5px; background: var(--tinta); content: ""; transition: transform .2s; }
.nav__hamburguesa { top: 23px; }
.nav__hamburguesa::before { top: -8px; left: 0; }
.nav__hamburguesa::after { top: 8px; left: 0; }
.nav__abrir[aria-expanded="true"] .nav__hamburguesa { background: transparent; }
.nav__abrir[aria-expanded="true"] .nav__hamburguesa::before { transform: translateY(8px) rotate(45deg); }
.nav__abrir[aria-expanded="true"] .nav__hamburguesa::after { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav__abrir { display: block; }
  .nav__lista { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; background: #fff; border-bottom: 1px solid var(--linea); padding: 8px var(--gutter) 20px; }
  .nav__lista.abierto { display: flex; }
  .nav__lista a:not(.boton) { display: block; padding: 14px 0; border-bottom: 1px solid var(--linea); }
  .nav__tel { margin-top: 14px; }
}

/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); }
.hero__pinceladas {
  position: absolute; right: -5%; top: 4%;
  width: min(46vw, 620px); pointer-events: none;
}
.hero__texto { position: relative; }
.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 4.6rem);
  font-weight: 860; font-stretch: 112%;
  max-width: 12ch; text-wrap: balance; letter-spacing: -0.02em; line-height: 1.02;
}
.hero__entradilla { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--gris); max-width: 46ch; margin: 1.4rem 0 2rem; }
.hero__acciones { display: flex; flex-wrap: wrap; gap: 12px; }

.oficios { position: relative; margin-top: clamp(48px, 7vw, 88px); }
.oficios__titulo { font-size: 1.05rem; font-weight: 700; font-stretch: 100%; color: var(--rojo); margin-bottom: 14px; }
.oficios__muro { list-style: none; margin: 0; padding: 18px 0 0; border-top: 3px solid var(--tinta); display: flex; flex-wrap: wrap; gap: 4px 0; }
.oficios__muro li { display: flex; align-items: center; }
.oficios__muro li:not(:last-child)::after { content: "/"; color: #B9B6AE; font-weight: 300; font-size: clamp(1.5rem, 3.4vw, 2.6rem); padding: 0 .28em; line-height: 1; }
.oficios__muro button {
  background: none; border: 0; padding: 2px 0; cursor: pointer;
  font-size: clamp(1.5rem, 3.4vw, 2.6rem); font-weight: 820; font-stretch: 78%;
  letter-spacing: -0.01em; line-height: 1.15; color: var(--tinta);
  background-image: linear-gradient(var(--amarillo), var(--amarillo));
  background-repeat: no-repeat; background-position: 0 88%; background-size: 0% 32%;
  transition: background-size .2s ease, color .15s;
}
.oficios__muro button:hover, .oficios__muro button:focus-visible { background-size: 100% 32%; }
.oficios__muro button:active { color: var(--rojo); }

@media (max-width: 760px) {
  .hero { padding-top: 8px; }
  .hero__pinceladas { position: relative; right: auto; top: auto; width: 54vw; max-width: 280px; margin: 0 0 0 auto; }
}

/* Cursos */
.cursos { background: var(--hormigon); padding: clamp(56px, 8vw, 104px) 0; scroll-margin-top: 76px; }
.cursos__cabeza { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 40px; margin-bottom: 28px; }
.cursos__cabeza h2, .empresas h2, .contacto h2 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-stretch: 112%; font-weight: 850; }
.cursos__cabeza p { max-width: 44ch; color: var(--gris); margin: 0; }

.filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 20px; }
.filtro {
  min-height: 42px; padding: .45em 1em; border-radius: 999px; cursor: pointer;
  background: #fff; border: 1.5px solid var(--linea); font-weight: 600; font-size: .98rem;
}
.filtro:hover { border-color: var(--tinta); }
.filtro[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.buscador { margin-left: auto; flex: 0 1 260px; }
.buscador input {
  width: 100%; min-height: 42px; padding: .45em .9em .45em 2.3em; border-radius: 999px;
  border: 1.5px solid var(--linea); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23555A66' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 12px 50%;
}
.buscador input:focus { border-color: var(--tinta); outline: none; box-shadow: 0 0 0 3px var(--amarillo); }

.catalogo { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 10px; border: 1px solid var(--linea); overflow: hidden; }
.curso {
  display: grid; grid-template-columns: minmax(0, 1fr) 190px 120px auto; align-items: center; gap: 8px 24px;
  padding: 18px 24px; border-top: 1px solid var(--linea); position: relative;
}
.curso:first-child { border-top: 0; }
.curso::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; transition: background-color .15s; }
.curso:hover::before { background: var(--rojo); }
.curso.resaltado::before { background: var(--amarillo); }
.curso__nombre { font-size: 1.12rem; font-weight: 700; font-stretch: 100%; line-height: 1.3; }
.curso__area { color: var(--gris); font-size: .95rem; }
.curso__horas { display: flex; gap: 6px; flex-wrap: wrap; }
.horas { display: inline-block; padding: .15em .6em; background: var(--amarillo); color: var(--tinta); font-weight: 750; font-size: .92rem; border-radius: 4px; font-variant-numeric: tabular-nums; }
.curso__pedir { font-weight: 700; color: var(--rojo); text-decoration: none; white-space: nowrap; padding: 8px 0; }
.curso__pedir:hover { text-decoration: underline; text-underline-offset: 4px; }
.curso[hidden] { display: none; }
.catalogo__vacio { margin-top: 20px; padding: 20px 24px; background: #fff; border-radius: 10px; border: 1px dashed var(--gris); }

@media (max-width: 900px) {
  .curso { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nombre nombre" "area horas" "pedir pedir"; padding: 16px 18px; gap: 6px 16px; }
  .curso__nombre { grid-area: nombre; }
  .curso__horas { grid-area: horas; justify-content: end; }
  .curso__area { grid-area: area; font-size: .9rem; }
  .curso__pedir { grid-area: pedir; padding: 4px 0 0; }
  .buscador { margin-left: 0; flex: 1 1 100%; order: -1; }
}

/* Empresas */
.empresas { padding: clamp(56px, 8vw, 104px) 0; scroll-margin-top: 76px; }
.empresas__rejilla { display: grid; grid-template-columns: 5fr 7fr; gap: 40px 72px; align-items: start; }
.empresas__intro p { font-size: 1.15rem; color: var(--gris); margin: 1.2rem 0 1.8rem; max-width: 40ch; }
.empresas__lista { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.empresas__lista > div { padding: 22px 0; border-top: 3px solid var(--tinta); }
.empresas__lista dt { font-weight: 800; font-size: 1.2rem; font-stretch: 105%; margin-bottom: 6px; }
.empresas__lista dd { margin: 0; color: var(--gris); }
@media (max-width: 860px) {
  .empresas__rejilla { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .empresas__lista { grid-template-columns: 1fr; }
}

/* Contacto */
.contacto { background: var(--hormigon); padding: clamp(56px, 8vw, 104px) 0; scroll-margin-top: 76px; }
.contacto__rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: 48px 64px; align-items: start; }
.contacto address { font-style: normal; margin: 24px 0 28px; }
.dato { margin: 0 0 18px; }
.dato__etiqueta { display: block; font-size: .9rem; color: var(--gris); font-weight: 600; }
.dato a { text-decoration-color: var(--rojo); text-underline-offset: 4px; }
.dato__grande { font-size: clamp(1.8rem, 3.6vw, 2.5rem); font-weight: 850; font-stretch: 110%; text-decoration: none; line-height: 1.15; }
.dato__grande:hover { color: var(--rojo); }

.mapa { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #DCDAD4; border: 1px solid var(--linea); }
.mapa::before { /* plano esquemático de fondo mientras el mapa no está cargado */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(115deg, transparent 47%, #fff 47%, #fff 50%, transparent 50%),
    linear-gradient(10deg, transparent 60%, #fff 60%, #fff 62%, transparent 62%),
    linear-gradient(80deg, transparent 30%, #fff 30%, #fff 31.5%, transparent 31.5%),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(255,255,255,.5) 38px 40px),
    repeating-linear-gradient(90deg, transparent 0 52px, rgba(255,255,255,.5) 52px 54px);
}
.mapa__aviso { position: absolute; inset: auto 16px 16px 16px; background: #fff; border-radius: 8px; padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; box-shadow: 0 6px 24px rgba(22,26,38,.12); }
.mapa__aviso p { flex: 1 1 100%; margin: 0; font-size: .95rem; color: var(--gris); }
.mapa__aviso a { font-weight: 700; color: var(--rojo); }
.mapa iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.formulario { background: #fff; border-radius: 10px; padding: clamp(22px, 3.5vw, 36px); border: 1px solid var(--linea); }
.formulario h3 { font-size: 1.6rem; font-weight: 800; font-stretch: 108%; margin-bottom: 20px; }
.campo { display: block; margin-bottom: 16px; }
.campo > span { display: block; font-weight: 650; font-size: .95rem; margin-bottom: 6px; }
.campo small { font-weight: 400; color: var(--gris); }
.campo input, .campo select, .campo textarea {
  width: 100%; min-height: 48px; padding: .6em .8em; border: 1.5px solid var(--linea); border-radius: var(--radio); background: #fff;
}
.campo textarea { resize: vertical; min-height: 110px; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--tinta); outline: none; box-shadow: 0 0 0 3px var(--amarillo); }
.campo input[aria-invalid="true"] { border-color: var(--rojo); }
.campo-doble { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.campo-oculto { position: absolute; left: -9999px; }
.casilla { display: flex; gap: 10px; align-items: start; margin: 4px 0 20px; font-size: .95rem; }
.casilla input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--rojo); flex: none; }
.aviso { padding: 12px 14px; border-radius: var(--radio); margin-bottom: 16px; font-weight: 600; }
.aviso--ok { background: #E6F4EA; color: #135C2A; }
.aviso--error { background: #FBE7E8; color: var(--rojo-oscuro); }
@media (max-width: 860px) {
  .contacto__rejilla { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .campo-doble { grid-template-columns: 1fr; }
}

/* Pie */
.pie { background: var(--tinta); color: #C9CCD6; padding: 64px 0 0; }
.pie__rejilla { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr .8fr; gap: 32px 40px; }
.pie__logo { width: min(100%, 300px); }
.pie__titulo { color: #fff; font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.pie a { color: #fff; text-decoration: none; }
.pie a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pie__final { margin-top: 48px; padding-bottom: 28px; font-size: .9rem; }
.pie__final p { padding-top: 20px; border-top: 1px solid #2E3446; }
.pie__final p { margin: 0; }
@media (max-width: 900px) { .pie__rejilla { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .pie__rejilla { grid-template-columns: 1fr; } }

/* Páginas legales */
.legal { padding: clamp(40px, 6vw, 80px) 0; }
.legal .contenedor { max-width: 820px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-stretch: 112%; margin-bottom: 24px; }
.legal h2 { font-size: 1.6rem; margin: 48px 0 14px; scroll-margin-top: 90px; }
.legal h3 { font-size: 1.15rem; margin: 26px 0 8px; }
.legal nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pendiente { background: var(--amarillo); padding: 0 .25em; border-radius: 3px; font-weight: 700; }
