:root {
  --primary: #00498d;
  --primary-dark: #003666;
  --text: #111111;
  --surface: #ffffff;
  --surface-alt: #f2f6fa;
  --border: #c8d5e1;
  --focus: #ffbf47;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--surface);
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.15em;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 48rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-family: "Open Sans", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

h2 {
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-family: "Open Sans", sans-serif;
  font-size: 2.4em;
  font-weight: 700;
  line-height: 1.5;
}

h3 {
  margin-bottom: 0.75rem;
  color: var(--primary);
  font-family: "Open Sans", sans-serif;
  font-size: 1.25em;
  font-weight: 700;
  line-height: 1.5;
}

p {
  font-size: 1em;
  line-height: 1.5;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* Enlace para saltar directamente al contenido principal */

.skip-link {
  position: absolute;
  z-index: 9999;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1rem;
  transform: translateY(-160%);
  color: #000000;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Encabezado */

/* Encabezado */

.site-header {
  background: #ffffff;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1.5rem;
  padding-bottom: 1.25rem;
}

.site-logo {
  display: block;
  width: 160px;
  height: auto;
  margin-bottom: 0.75rem;
  object-fit: contain;
}

.header-inner h1 {
  margin-bottom: 0;
}

/* Menú principal */

.main-nav {
  width: 100%;
  color: #ffffff;
  background-color: var(--primary);
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin-inline: auto;
  padding: 0;
  color: #ffffff;
  background-color: var(--primary);
  list-style: none;
}

.main-nav li {
  display: flex;
  color: #ffffff;
  background-color: var(--primary);
}

.main-nav a,
.main-nav a:visited {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 68px;
  padding: 1rem 1.5rem;
  color: #ffffff;
  background-color: transparent;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.main-nav a:hover {
  color: #ffffff;
  background-color: var(--primary-dark);
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.3em;
}

.main-nav a:focus-visible {
  outline: 3px solid #000000;
  outline-offset: -3px;
}

/* Secciones generales */

.section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.section-alt {
  background: var(--surface-alt);
}

.section-lead {
  max-width: 48rem;
  margin-bottom: 2rem;
  font-size: 1.125rem;
}

.two-columns,
.authority-grid {
  display: grid;
  gap: 1.5rem;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-card,
.authority-card,
.center-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 0.25rem 1rem rgba(0, 54, 102, 0.08);
}

.content-card {
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-top: 0.4rem solid var(--primary);
}

/* Autoridades */

.authority-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.authority-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  text-align: center;
  border-left: 0;
  border-top: 0.35rem solid var(--primary);
}

.authority-photo {
  display: block;
  width: 100%;
  height: 22rem;
  object-fit: cover;
  object-position: center top;
  border: 0;
  border-radius: 0;
  background-color: #e9eef3;
}

.authority-info {
  min-width: 0;
  padding: 1.5rem;
}

.authority-card h3 {
  margin-bottom: 0.25rem;
}

.authority-card p {
  margin-bottom: 0;
  font-weight: 600;
}

/* Regiones */

.region-block + .region-block {
  margin-top: 3.5rem;
}

.region-title {
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary);
  font-size: 1.65rem;
}

/* Centros */

.centers-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.center-card {
  display: grid;
  grid-template-columns: 30% 70%;
  padding: 0;
  overflow: hidden;
}

.center-card-image {
  min-width: 0;
  background-color: #e9eef3;
}

.center-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
}

.center-card-content {
  min-width: 0;
  padding: 1.5rem 2rem;
}

.center-card-content h3 {
  margin-bottom: 0.75rem;
}

.center-data {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.center-data p {
  margin: 0;
  line-height: 1.45;
}

.center-data strong {
  font-weight: 700;
}

.center-data a {
  overflow-wrap: anywhere;
}

/* Footer */

.site-footer {
  padding-top: 3rem;
  color: #ffffff;
  background: var(--primary-dark);
}

.site-footer h2 {
  color: #ffffff;
  font-size: 1.5rem;
}

.site-footer a {
  color: #ffffff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

address {
  font-style: normal;
}

address p {
  margin-bottom: 0.5rem;
}

.social-icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 0.25rem;
}

.social-icons a:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 3px;
}

.social-icons img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.footer-bottom {
  margin-top: 2rem;
  padding-block: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.footer-bottom p {
  margin: 0;
}

/* Texto disponible solamente para lectores de pantalla */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tablet y dispositivos medianos */

@media (max-width: 800px) {
  h2 {
    font-size: 2rem;
  }

  .two-columns,
  .authority-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding-block: 3rem;
  }

  .center-card {
    grid-template-columns: 1fr;
  }

  .center-card-image img {
    width: 100%;
    height: 16rem;
    min-height: 0;
  }

  .center-card-content {
    padding: 1.5rem;
  }
}

/* Teléfonos */

@media (max-width: 480px) {
  .container {
    width: min(100% - 1.25rem, var(--max-width));
  }

  h2 {
    font-size: 1.75rem;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .main-nav li {
    display: block;
  }

  .main-nav a {
    width: 100%;
    min-height: 58px;
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
  }

  .main-nav li:first-child a {
    border-top: 0;
  }

  .center-card-image img {
    height: 13rem;
  }

  .center-card-content {
    padding: 1.25rem;
  }

  .center-data {
    gap: 0.4rem;
  }
}

/* Reduce las animaciones cuando el usuario así lo solicita */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Compatibilidad con el modo de colores forzados */

@media (forced-colors: active) {
  .content-card,
  .authority-card,
  .center-card {
    box-shadow: none;
  }
}