:root {
  --blue: #1460a0;
  --blue-bright: #2f8fd6;
  --blue-hover: #0d4a80;
  --navy: #0f3a6e;
  --navy-deep: #081d3d;
  --text-light: #0f3a6e;
  --text-mute: #97a3b3;
  --glass-bg: rgba(255, 255, 255, 0.26);
  --glass-bg-strong: rgba(255, 255, 255, 0.36);
  --glass-border: rgba(255, 255, 255, 0.45);
  --sh-lg: 0 8px 40px rgba(3, 10, 26, 0.45);
  --r-lg: 16px;
  --ease: 0.25s ease;
}

* { box-sizing: border-box; }

html { background: #ffffff; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text-light);
  background: #ffffff url("assets/recursos/fondo-topografico.png") center top / cover no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* --- contenido por encima del fondo --- */
.hero, .grid { position: relative; z-index: 1; }

.hero {
  background: linear-gradient(180deg, rgba(8, 29, 61, 0.35), rgba(15, 58, 110, 0.55)), url("assets/img/header2.png") center / cover no-repeat;
  padding: 48px 20px 108px;
  text-align: center;
}

.hero__logo {
  height: 100px;
  width: auto;
  margin-bottom: 28px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}

.hero .subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  max-width: 32rem;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 46px 22px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto 56px;
  padding: 0 20px;
}

.section-title {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 8px auto 22px;
  padding: 0 20px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--navy);
}

.card {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(15, 58, 110, 0.06);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform var(--ease), box-shadow var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 55px rgba(3, 10, 26, 0.5);
}

.card__media {
  width: 100%;
  height: 132px;
  line-height: 0;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 4px solid #fff;
  box-sizing: border-box;
}

.card__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #cfe4fb;
  color: var(--blue-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -30px;
  box-shadow: 0 6px 16px rgba(3, 10, 26, 0.18);
  z-index: 1;
}

.card__icon svg {
  width: 26px;
  height: 26px;
}

.card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 22px 28px;
  width: 100%;
  box-sizing: border-box;
}

.card h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
}

.card__desc {
  margin: 0 0 6px;
  font-size: 0.83rem;
  color: #6b7684;
  line-height: 1.45;
  min-height: 2.6em;
}

.btn {
  appearance: none;
  border: none;
  width: 100%;
  border-radius: 8px;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  display: block;
  box-sizing: border-box;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue));
  color: #fff;
  box-shadow: 0 4px 18px rgba(47, 143, 214, 0.45);
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(47, 143, 214, 0.55);
  filter: brightness(1.06);
}

.btn:disabled {
  background: #e2e6ea;
  color: var(--text-mute);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.estado {
  font-size: 0.82rem;
  min-height: 1.2em;
  color: #6b7684;
}

.estado.aviso { color: #a8720c; }

.catalogo {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease), color var(--ease);
}

.catalogo:hover {
  color: var(--blue-hover);
  border-bottom-color: var(--blue-hover);
}

.card--proximamente {
  background: #f4f6f9;
  border-style: dashed;
  border-color: #d3dbe6;
}

.card--proximamente .card__icon {
  background: #eaeef3;
  border-color: #d3dbe6;
  color: #97a3b3;
}

.card--proximamente h2 {
  color: #6b7684;
}

.card--proximamente .card__desc {
  color: #97a3b3;
}

.badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
}

@media (max-width: 768px) {
  /* background-attachment: fixed va con jank en móviles (sobre todo iOS) */
  body { background-attachment: scroll; }

  .hero { padding: 32px 20px 84px; }

  .hero__logo { height: 72px; margin-bottom: 20px; }

  .section-title { font-size: 1.1rem; }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 40px 14px;
  }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
}
