/* ===== Fuentes (autoalojadas en /fonts) ===== */
@font-face { font-family: "Platform"; font-weight: 400; font-display: swap;
  src: url("fonts/Platform-Regular-Web.woff2") format("woff2"),
       url("fonts/Platform-Regular-Web.woff") format("woff"); }
@font-face { font-family: "Platform"; font-weight: 500; font-display: swap;
  src: url("fonts/Platform-Medium-Web.woff2") format("woff2"),
       url("fonts/Platform-Medium-Web.woff") format("woff"); }
@font-face { font-family: "Platform"; font-weight: 700; font-display: swap;
  src: url("fonts/Platform-Bold-Web.woff2") format("woff2"),
       url("fonts/Platform-Bold-Web.woff") format("woff"); }
@font-face { font-family: "Platform"; font-weight: 300; font-display: swap;
  src: url("fonts/Platform-Light-Web.woff2") format("woff2"),
       url("fonts/Platform-Light-Web.woff") format("woff"); }

:root {
  --font-heading: "Platform", "Barlow Condensed", system-ui, sans-serif;
  --font-heading-weight: 700;
  --header-h: 56px;
}

html, body { margin: 0; background: var(--color-bg); }

a { color: var(--color-accent-700); }
a:hover { color: var(--color-accent-800); }

/* Contraste AAA (~8.9:1): el accent base (#5980a6) solo da 3.7:1 con texto claro */
.btn-primary { background: var(--color-accent-800); }
.btn-primary:hover { background: var(--color-accent-900); }
.btn-primary:active { background: var(--color-accent-900); }

/* ===== Página ===== */
.page {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}

/* ===== Cabecera ===== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 5vw, 64px);
  padding: 10px 40px;
  border-bottom: 1px solid var(--color-divider);
}
.site-header a { display: flex; align-items: center; justify-content: center; }
.site-header img { display: block; width: auto; height: 44px; object-fit: contain; }
.site-header .logos{display: flex;  gap: 40px;}

/* ===== Hero ===== */
.hero-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 40px 36px;
}
.hero-grid h1 {
  font-size: clamp(40px, 5.4vw, 72px);
  text-transform: uppercase;
  letter-spacing: 0.005em;
  margin: 0 0 20px;
  max-width: 20ch;
}
.hero-grid p {
  font-size: 17px;
  line-height: 1.6;
  max-width: 62ch;
  text-wrap: pretty;
  margin: 0;
  color: color-mix(in srgb, var(--color-text) 88%, transparent);
}

/* ===== Listado de catálogos ===== */
.cards {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px 88px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

a.blueprint {
  min-height: calc((100vh - var(--header-h)) / 3);
  min-height: calc((100svh - var(--header-h)) / 3);
  display: flex;
  align-items: stretch;
  gap: 0;
  text-decoration: none;
  color: var(--color-text);
  background: transparent;
  transition: background 140ms linear, border-color 140ms linear;
}
a.blueprint:hover {
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
  border-color: var(--color-accent);
}

.card-body {
  flex: 1 1 0;
  min-width: 0;
  padding: 34px 34px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
}
.card-body h2 {
  font-size: clamp(30px, 3.6vw, 46px);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0 0 12px;
}
.card-body p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  max-width: 46ch;
  text-wrap: pretty;
  color: color-mix(in srgb, var(--color-text) 82%, transparent);
}
.card-logo {
  display: block;
  align-self: flex-start;
  height: clamp(44px, 5vw, 64px);
  width: auto;
}
.card-cta {
  align-self: flex-start;
  font-size: 15px;
  padding: 12px 20px;
}

.card-media {
  flex: 0 0 38%;
  min-width: 0;
  border-left: 1px solid var(--color-divider);
  background: var(--color-surface);
}
/* Escritorio: caja cuadrada para que las tres tarjetas midan lo mismo aunque
   la imagen de origen tenga otra proporción (la de classic es 3:2).
   Solo >760px: en móvil la imagen es fondo absoluto y el aspect-ratio rompería el alto. */
@media (min-width: 761px) {
  .card-media { aspect-ratio: 1 / 1; }
}
.card-media picture {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
}
.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Selector de idioma ===== */
.lang-switch {
  position: absolute;
  right: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}
.site-header { position: relative; }
.lang-switch a { text-decoration: none; }
.lang-switch a.active { color: var(--color-text); font-weight: 700; }

/* ===== Modal de descarga de catálogos ===== */
.dl-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.dl-overlay[hidden] { display: none; }
.dl-step[hidden] { display: none; }
.dl-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 32px 34px 30px;
  border: 1px solid var(--color-divider);
  box-shadow: 0 18px 50px color-mix(in srgb, var(--color-text) 30%, transparent);
}
.dl-modal h3 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  text-transform: uppercase;
  font-size: 26px;
  margin: 0 0 10px;
}
.dl-intro {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.55;
  color: color-mix(in srgb, var(--color-text) 82%, transparent);
}
.dl-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}
.dl-close:hover { color: var(--color-text); }
.dl-file-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dl-file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-divider);
  font-size: 15px;
  font-weight: 700;
}
.dl-file-list:not(.dl-file-summary) {
  margin-top: 16px;
}
.dl-file-summary li {
  font-weight: 400;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: 15px;
}
.dl-email-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0 18px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
}
.dl-email-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  border: 1px solid var(--color-divider);
  border-radius: 0;
  font-size: 16px;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 140ms linear;
}
.dl-email-field input:hover { border-color: var(--color-accent); }
.dl-email-field input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -1px;
  border-color: var(--color-accent);
}
.dl-email-field input::placeholder {
  color: color-mix(in srgb, var(--color-text) 40%, transparent);
}
.dl-error {
  margin: 0 0 14px;
  font-size: 14px;
  color: #b3261e;
}
.dl-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
}
.dl-actions .btn { font-size: 15px; padding: 12px 20px; cursor: pointer; }
.dl-btn-secondary {
  background: transparent;
  border: 1px solid var(--color-divider);
  color: var(--color-text);
}
.dl-btn-secondary:hover { border-color: var(--color-accent); }
.dl-fallback-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 6px;
}
.dl-fallback-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}
.dl-fallback-form input {
  padding: 10px 12px;
  border: 1px solid var(--color-divider);
  font-size: 15px;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
}
.dl-fallback-form input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -1px;
}
.dl-fallback-form .btn { align-self: flex-start; cursor: pointer; }
.dl-fallback-note {
  margin: 0;
  font-size: 12.5px;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}
@media (max-width: 760px) {
  .lang-switch { right: 16px; font-size: 13px; }
  .dl-modal { padding: 24px 20px 22px; }
  .dl-modal h3 { font-size: 21px; }
}

/* ===== Tablet: todo visible sin scroll, tarjetas con imagen lateral.
   Solo si hay alto suficiente (≥600px); si no (landscape bajo), se
   mantiene el layout de escritorio con scroll para no aplastar el contenido. ===== */
@media (min-width: 761px) and (max-width: 1180px) and (min-height: 600px) {
  html, body { height: 100%; }

  .page {
    height: 100vh;
    height: 100svh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .site-header {
    flex: 0 0 auto;
    padding: 8px 28px;
  }
  .site-header .logos{
    gap: 40px;
  }

  .hero-grid {
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: clamp(16px, 3vh, 32px) 28px clamp(10px, 2vh, 20px);
    display: flex;
    align-items: center;
    gap: clamp(24px, 4vw, 48px);
  }
  .hero-grid > div {
    display: contents;
  }
  .hero-grid h1 {
    font-size: clamp(28px, 4.5vh, 40px);
    margin: 0;
    flex: 0 0 auto;
    max-width: none;
    white-space: nowrap;
  }
  .hero-grid p {
    font-size: clamp(13px, 1.8vh, 13px);
    line-height: 1.5;
    flex: 0 1 auto;
    min-width: 0;
    margin-left: auto;
    text-align: right;
  }

  .cards {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0 28px clamp(14px, 2.5vh, 24px);
    gap: clamp(12px, 2vh, 20px);
  }

  a.blueprint {
    flex: 1 1 0;
    min-height: 0;
  }

  .card-body {
    padding: clamp(12px, 2.2vh, 22px) clamp(16px, 2.5vw, 26px);
    gap: clamp(8px, 1.5vh, 16px);
    justify-content: center;
  }
  .card-body h2 {
    font-size: clamp(20px, 3.2vh, 30px);
    margin: 0 0 6px;
  }
  .card-body p {
    font-size: clamp(12px, 1.8vh, 14px);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
  .card-cta {
    font-size: 13px;
    padding: 8px 16px;
  }

  .card-media {
    overflow: hidden;
  }
  .card-media picture {
    min-height: 0;
  }
}

/* ===== Móvil: todo visible sin scroll, ajustado al alto de pantalla ===== */
@media (max-width: 760px) {
  html, body { height: 100%; }

  .page {
    height: 100vh;
    height: 100svh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .site-header {
    flex: 0 0 auto;
    padding: 8px 16px;
    gap: 18px;
    justify-content: flex-start;
  }
  .site-header img { width: auto; height: 30px; }
  .site-header .logos { gap:20px;}

  .hero-grid {
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 24px 22px 16px;
  }
  .hero-grid h1 { font-size: 26px; margin: 0 0 10px; }
  .hero-grid p { font-size: 12.5px; line-height: 1.5; }

  .cards {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    /* mismo padding lateral que .hero-grid: cajas alineadas con el título */
    padding: 4px 22px 14px;
    gap: 14px;
  }

  a.blueprint {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    /* overflow visible: los corners "+" sobresalen -6px del borde */
    overflow: visible;
  }
  .blueprint > .corner { z-index: 2; }

  /* Imagen como fondo de la tarjeta, con velo para que el texto sea legible */
  .card-media {
    position: absolute;
    inset: 0;
    border-left: none;
    z-index: 0;
    overflow: hidden;
  }
  .card-media picture {
    min-height: 0;
    position: absolute;
    inset: 0;
    z-index: 0;
    /* opacidad alta: con 0.4 el duotono azul no se percibía; el velo ::after
       ya garantiza la legibilidad del texto. Aclarado con filtro para que
       el texto destaque sin perder nitidez */
    opacity: 0.6;
    filter: brightness(2) contrast(0.8);
  }
  /* El velo gradiente ocupa ::after (pisa el ::after azul de .duotone del DS),
     así que el tinte azul duotono se restaura aquí en ::before */
  .card-media::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: var(--color-accent);
    mix-blend-mode: color;
  }
  .card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
      to right,
      color-mix(in srgb, var(--color-accent-100) 92%, transparent) 0%,
      color-mix(in srgb, var(--color-accent-200) 78%, transparent) 60%,
      color-mix(in srgb, var(--color-accent-300) 55%, transparent) 100%
    );
  }

  .card-body {
    position: relative;
    z-index: 1;
    padding: 10px 14px;
    gap: 8px;
    justify-content: center;
  }
  .card-body h2 {
    font-size: 18px;
    margin: 0 0 4px;
    text-shadow: 0 0 4px var(--color-bg), 0 0 8px var(--color-bg);
  }
  .card-body p {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-text);
    text-shadow: 0 0 3px var(--color-bg), 0 0 6px var(--color-bg), 0 1px 2px var(--color-bg);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
  .card-cta { font-size: 12px; padding: 6px 12px; }
  .card-cta svg { width: 13px; height: 13px; }
}
