/* ==========================================================
   CABECERA Y PIE COMUNES
   Este archivo puede utilizarse en index.html y páginas internas.
   ========================================================== */

:root {
  --site-header-height: 72px;
  --site-shell-width: 1200px;
  --site-black: #000000;
  --site-white: #ffffff;
  --site-muted: rgba(255, 255, 255, 0.72);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--site-header-height);
}

body {
  margin: 0;
  padding-top: var(--site-header-height);
}

.site-header,
.site-header *,
.site-footer,
.site-footer * {
  box-sizing: border-box;
}

/* Cabecera fija */
.site-header {
  position: fixed;
  z-index: 10000;
  top: 0;
  right: 0;
  left: 0;
  min-height: var(--site-header-height);
  color: var(--site-white);
  background: var(--site-black);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-header__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: min(calc(100% - 32px), var(--site-shell-width));
  min-height: var(--site-header-height);
  margin-inline: auto;
  gap: 16px;
}

.site-header__side {
  min-width: 0;
}

.site-header__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-height: 48px;
  color: var(--site-white);
  text-decoration: none;
}

.site-header__logo img {
  display: block;
  width: auto;
  max-width: 170px;
  max-height: 48px;
  object-fit: contain;
}

/* Botón para páginas interiores. En index.html no se incluye. */
.site-header__back {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--site-white);
  font: 600 0.95rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
  transition: background-color 0.18s ease;
}

.site-header__back:hover,
.site-header__back:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.site-header__back-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* El contenido central mantiene sus propios estilos. */
.site-main {
  min-height: calc(100vh - var(--site-header-height));
}

/* Pie común */
.site-footer {
  color: var(--site-white);
  background: var(--site-black);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 32px), var(--site-shell-width));
  min-height: 72px;
  margin-inline: auto;
  gap: 24px;
  padding: 14px 0;
}

.site-footer__copyright {
  margin: 0;
  color: var(--site-muted);
  font: 400 0.9rem/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-footer__up {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--site-white);
  font: 600 0.9rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
  transition: background-color 0.18s ease;
}

.site-footer__up:hover,
.site-footer__up:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

@media (max-width: 640px) {
  :root {
    --site-header-height: 64px;
  }

  .site-header__inner,
  .site-footer__inner {
    width: min(calc(100% - 20px), var(--site-shell-width));
  }

  .site-header__logo img {
    max-width: 140px;
    max-height: 40px;
  }

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

  .site-footer__inner {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 18px 0;
    text-align: center;
  }
}
