/* =========================================================================
   PC Calidad — Hoja de estilos compartida
   Diseño neutro blanco/negro. Accesibilidad WCAG 2.1 AA.
   ========================================================================= */

/* ----- Reset ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ----- Variables de color (contraste >= 4.5:1 sobre blanco) ----- */
:root {
  --color-bg: #ffffff;
  --color-text: #111111;       /* Contraste 15:1 sobre blanco */
  --color-muted: #4d4d4d;      /* Contraste 7.5:1 sobre blanco */
  --color-border: #d0d0d0;
  --color-focus: #000000;
  --color-hover-bg: #f2f2f2;
  --max-width: 1200px;
  --space: 1rem;
  --radius: 4px;
  --font-base: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 100%; /* Respeta configuración del usuario */
}

body {
  font-family: var(--font-base);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

/* ----- Tipografía ----- */
h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--color-text);
  text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 2.5rem 0 1rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); margin: 1.5rem 0 0.75rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

ul, ol { margin: 0 0 1rem 1.5rem; }
li { margin-bottom: 0.5rem; }

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

/* ----- Enlace de salto (skip link) ----- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  background: var(--color-text);
  color: var(--color-bg);
  padding: 0.75rem 1rem;
  z-index: 1000;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
  top: 0;
}

/* ----- Foco visible (teclado) ----- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ----- Cabecera ----- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand span {
  border: 2px solid var(--color-text);
  padding: 0.1em 0.35em;
  margin-right: 0.15em;
}

/* ----- Navegación ----- */
.main-nav__list {
  list-style: none;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.main-nav__list li { margin: 0; }

.main-nav__link {
  display: block;
  padding: 0.5rem 0.85rem;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
}

.main-nav__link:hover {
  background: var(--color-hover-bg);
}

.main-nav__link[aria-current="page"] {
  background: var(--color-text);
  color: var(--color-bg);
}

/* Botón menú móvil */
.nav-toggle {
  display: none;
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}

/* ----- Layout principal ----- */
.main {
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
}

.section { padding: 2.5rem 0; }

.section--alt {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.lead {
  font-size: 1.15rem;
  color: var(--color-muted);
  max-width: 70ch;
}

/* ----- Hero ----- */
.hero {
  background: var(--color-text);
  color: var(--color-bg);
  padding: 4rem 1rem;
}

.hero__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero h1 {
  color: var(--color-bg);
  margin-bottom: 1rem;
  max-width: 18ch;
}

.hero p {
  font-size: 1.2rem;
  max-width: 60ch;
  opacity: 0.95;
  margin-bottom: 2rem;
}

.hero a {
  color: var(--color-text);
  background: var(--color-bg);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
}

.hero a:hover {
  background: #e6e6e6;
}

/* ----- Grids ----- */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ----- Tarjetas ----- */
.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card__media {
  aspect-ratio: 16 / 10;
  background: var(--color-bg);
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__body {
  padding: 1.25rem;
  flex: 1;
}

.card__body h3 { margin-top: 0; }

.card__body p { color: var(--color-muted); }

/* ----- Botones ----- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--color-text);
  color: var(--color-bg);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 700;
  border: 2px solid var(--color-text);
  cursor: pointer;
  font-size: 1rem;
}

.btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn--outline {
  background: transparent;
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ----- Tabla horario ----- */
.schedule {
  border-collapse: collapse;
  width: 100%;
  max-width: 480px;
  margin-top: 1rem;
}

.schedule th,
.schedule td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.schedule thead th {
  border-bottom: 2px solid var(--color-text);
  font-weight: 700;
}

.schedule tr--closed td {
  color: var(--color-muted);
}

/* ----- Datos de contacto ----- */
.contact-block dl dt {
  font-weight: 700;
  margin-top: 1rem;
}

.contact-block dl dd {
  margin: 0 0 0.5rem 0;
}

/* ----- Mapa ----- */
.map-embed {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1rem;
}

.map-embed iframe {
  width: 100%;
  height: 360px;
  border: 0;
  display: block;
}

/* ----- Pie ----- */
.site-footer {
  background: var(--color-text);
  color: var(--color-bg);
  padding: 2.5rem 1rem 1.5rem;
  margin-top: 2rem;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-footer a {
  color: var(--color-bg);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.site-footer h2,
.site-footer h3 {
  color: var(--color-bg);
}

.site-footer__bottom {
  border-top: 1px solid #555;
  padding-top: 1rem;
  font-size: 0.875rem;
  color: #d0d0d0;
}

/* ----- Breadcrumb ----- */
.breadcrumb {
  list-style: none;
  margin: 0 0 1.5rem 0;
  padding: 0;
  font-size: 0.875rem;
}

.breadcrumb li {
  display: inline;
  margin: 0;
}

.breadcrumb li + li::before {
  content: "›";
  margin: 0 0.5rem;
  color: var(--color-muted);
}

/* ----- Imagen destacada de sección ----- */
.feature-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  margin: 1.5rem 0;
}

/* ----- Responsive ----- */
@media (max-width: 860px) {
  .nav-toggle {
    display: inline-block;
  }

  .main-nav {
    width: 100%;
  }

  .main-nav__list {
    display: none;
    flex-direction: column;
    gap: 0;
    padding-top: 0.5rem;
  }

  .main-nav__list[data-open="true"] {
    display: flex;
  }

  .main-nav__link {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .hero { padding: 3rem 1rem; }
}

/* ----- Reducción de movimiento ----- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----- Impresión ----- */
@media print {
  .site-header,
  .site-footer,
  .nav-toggle,
  .hero a {
    display: none;
  }

  body {
    color: #000;
  }
}
