/* ============================================================
   layout.css — estructura general de la pagina
   ============================================================ */

/* IMPORTANTE: el sticky va en el CONTENEDOR (#header-outlet), no en
   .site-header. Si el padre mide lo mismo que el hijo, sticky no tiene
   margen para "pegarse" y no hace nada (ver bug que encontramos). */
#header-outlet {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.site-header {
  display: grid;
  grid-template-columns:
    minmax(130px, 1fr)
    auto
    minmax(110px, 1fr);
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  min-height: 76px;
  padding: 12px clamp(16px, 3vw, 36px);

  background-color: var(--bg-primary);
  background-image: url("../assets/backgrounds/header-bg.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;

  border-bottom: 3px solid var(--divider);
  color: var(--text-body);
}

.mobile-menu-toggle {
  display: none;
}

.site-logo {
  justify-self: start;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: clamp(130px, 12vw, 170px);
  height: 52px;
  overflow: hidden;
  color: var(--accent-primary);
  text-decoration: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.site-logo:focus-visible {
  outline: 3px solid var(--form-focus);
  outline-offset: 3px;
}

.site-logo:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.site-logo-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.header-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.header-nav a {
  --nav-button-surface: rgba(var(--smoke-green-black-rgb), 0.76);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 5px 12px;
  background: var(--nav-button-surface);
  border: 2px solid rgba(var(--accent-display-green-rgb), 0.32);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease;
}

.header-nav a span {
  display: inline-block;
  padding-block: 0.1em 0.04em;
  padding-inline: 0.03em 0.14em;
  color: var(--text-body);
  -webkit-text-fill-color: var(--text-body);
}

.header-nav a:hover,
.header-nav a:focus-visible {
  border-color: var(--accent-primary);
}

@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .header-nav a::before {
    content: '';
    position: absolute;
    inset: -2px;
    border: 2px solid transparent;
    border-radius: inherit;
    background: var(--display-text-gradient) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }

  .header-nav a:hover,
  .header-nav a:focus-visible {
    border-color: transparent;
  }

  .header-nav a:hover::before,
  .header-nav a:focus-visible::before {
    opacity: 1;
  }
}

.header-nav a:hover span,
.header-nav a:focus-visible span {
  color: var(--accent-primary);
  -webkit-text-fill-color: var(--accent-primary);
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .header-nav a:hover span,
  .header-nav a:focus-visible span {
    background-image: var(--display-text-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

.header-nav a:focus-visible {
  outline: 2px solid var(--form-focus);
  outline-offset: 2px;
}

@media (max-width: 1050px) {
  .site-header {
    grid-template-columns: minmax(130px, 1fr) auto;
    grid-template-areas:
      "logo tools"
      "navigation navigation";
    row-gap: 10px;
    min-height: 124px;
  }

  .site-logo {
    grid-area: logo;
  }

  .header-nav {
    grid-area: navigation;
    width: 100%;
  }

  .header-tools {
    grid-area: tools;
  }
}

.header-tools {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-picker {
  position: relative;
  flex: 0 0 auto;
}

.language-picker-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 50px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(2px);
  border-radius: 10px;
  color: var(--text-h1);
  cursor: pointer;
  list-style: none;
  box-shadow: 0 6px 12px rgba(var(--smoke-black-rgb), 1.34);
}

.language-picker-trigger::-webkit-details-marker {
  display: none;
}

.language-picker-trigger:focus-visible {
  outline: 3px solid var(--form-focus);
  outline-offset: 2px;
}

.language-picker-icon {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
}

@media (min-width: 1051px) {
  .language-picker {
    transform: translateY(4px);
  }
}

.language-picker-current {
  display: inline-block;
  padding: 1px 4px;
  background: var(--cta-primary);
  border-radius: 4px;
  color: var(--cta-primary-text);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.language-picker-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 4px;
  min-width: 86px;
  padding: 6px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
}

.language-picker:not([open]) .language-picker-options {
  display: none;
}

.language-picker-option {
  min-height: 36px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-h1);
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
}

.language-picker-option:hover,
.language-picker-option:focus-visible {
  border-color: var(--hover-primary);
}

.language-picker-option.is-active {
  background: var(--cta-primary);
  border-color: var(--cta-primary);
  color: var(--cta-primary-text);
}

.app-body {
  --aside-width: 220px;
  --aside-gap: clamp(1.5rem, 3vw, 3rem);

  display: grid;
  grid-template-columns:
    minmax(0, 1100px)
    var(--aside-width);
  align-items: start;
  justify-content: center;
  gap: var(--aside-gap);
  width: 100%;
  padding:
    0
    clamp(1rem, 3vw, 3rem)
    clamp(3rem, 6vw, 5rem);
  background-image:
    linear-gradient(
      90deg,
      rgba(var(--smoke-black-rgb), 0.86) 0%,
      rgba(var(--smoke-deep-rgb), 0.62) 13%,
      rgba(var(--smoke-green-black-rgb), 0.22) 27%,
      transparent 40%,
      transparent 60%,
      rgba(var(--smoke-green-black-rgb), 0.22) 73%,
      rgba(var(--smoke-deep-rgb), 0.62) 87%,
      rgba(var(--smoke-black-rgb), 0.86) 100%
    ),
    url('../assets/decorations/pre-footer.png');
  background-position: center, center bottom;
  background-repeat: no-repeat, no-repeat;
  background-size: 100% 100%, 100% auto;
}

.sidebar {
  position: fixed;
  top: 76px;
  bottom: 0;
  left: 0;
  z-index: var(--z-sidebar);
  width: 190px;
  flex-shrink: 0;
  background-color: var(--bg-secondary);
  background-image:
    linear-gradient(
    rgba(var(--smoke-green-black-rgb), 0.10),
    rgba(var(--smoke-green-black-rgb), 0.10)
    ),
    url('../assets/backgrounds/sidebar-bg.jpg');
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  border-top: 3px solid var(--cta-primary);
  border-right: 3px solid var(--cta-primary);
  transform: translateX(-100%);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.sidebar.open {
  transform: translateX(0);
  box-shadow:
    var(--shadow-panel),
    inset -8px 0 12px -8px rgba(var(--divider-rgb), 0.28);
}

.sidebar-blade-edge {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  z-index: 2;
  width: 3px;
  background: var(--cta-primary);
  opacity: 1;
  pointer-events: none;
}

.sidebar.open .sidebar-blade-edge {
  opacity: 1;
}

.sidebar-close-flap {
  position: absolute;
  top: 20px;
  left: calc(100% + 3px);
  right: auto;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 64px;
  padding: 0;
  background-color: var(--surface-card);
  border: 2px solid var(--accent-primary);
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transform: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    width 0.2s ease;
}

.sidebar-flap-icon {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.sidebar-close-flap:hover {
  width: 52px;
  background-color: var(--surface-elevated);
}

.sidebar-close-flap:hover .sidebar-flap-icon {
  transform: scale(1.08);
}

.sidebar-close-flap:focus-visible {
  outline: 3px solid var(--form-focus);
  outline-offset: 3px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.sidebar a {
  color: var(--text-h1);
  text-decoration: none;
  display: block;
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  letter-spacing: 0.5px;
  border-left: 3px solid transparent;
}

.sidebar a:hover {
  background-color: var(--surface-elevated);
  color: var(--hover-primary);
}

.sidebar a.is-active {
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  background-color: var(--surface-elevated);
}

.sidebar-language-switcher {
  display: none;
}

main.content {
  width: 100%;
  min-width: 0;
  max-width: 1100px;
  margin: 0;
  padding: 32px clamp(16px, 4vw, 48px);
}

/*
 * Header y sidebar responsive
 * ============================================================
 */

/* Tablets horizontales: header distribuido en dos filas */
@media (min-width: 901px) and (max-width: 1050px) {
  .sidebar {
    top: 124px;
  }
}

/* Tablets verticales y teléfonos */
@media (max-width: 900px) {

  .site-header {
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    grid-template-areas: "menu logo tools";
    align-items: center;
    gap: 8px;
    min-height: 72px;
    padding: 10px 12px;
  }

  .mobile-menu-toggle {
    display: flex;
    grid-area: menu;
    align-items: center;
    justify-content: center;
    justify-self: start;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--icon-primary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-menu-toggle:hover {
    border-color: var(--hover-primary);
    color: var(--hover-primary);
  }

  .sidebar-close-flap {
    display: none;
  }
  /*
   * La navegación principal se oculta porque estas opciones
   * ya están disponibles en el sidebar.
   */
  .header-nav {
    display: none;
  }

  .site-logo {
    grid-area: logo;
    justify-self: center;
    width: min(140px, 36vw);
    height: 48px;
  }

  .site-logo-image {
    object-position: center;
  }

  .header-tools {
    grid-area: tools;
    justify-self: end;
    gap: 8px;
  }

  .header-tools .language-picker {
    display: none;
  }

  .sidebar-language-switcher {
    display: grid;
    gap: 6px;
    padding: 4px 18px 12px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .sidebar-language-label {
    color: var(--text-h1);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
  }

  .sidebar-language-options {
    display: flex;
    gap: 6px;
  }

  .sidebar-language-option {
    flex: 0 0 64px;
    min-height: 40px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-h1);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
  }

  .sidebar-language-option:hover,
  .sidebar-language-option:focus-visible {
    border-color: var(--hover-primary);
  }

  .sidebar-language-option.is-active {
    background: var(--cta-primary);
    border-color: var(--cta-primary);
    color: var(--cta-primary-text);
  }

  /*
   * El sidebar comienza debajo del nuevo header compacto.
   */
  .sidebar {
    top: 72px;
    width: min(280px, calc(100vw - 44px));
    overflow-y: auto;
  }

  /*
  * En dispositivos móviles, la pestaña permanece fuera del header
  * y en la parte superior del sidebar. Al abrir el menú, acompaña
  * su borde derecho y continúa funcionando como cierre.
  */

  main.content {
    padding-top: 32px;
  }
}

@media (max-width: 480px) {
  .site-header {
    grid-template-columns: 66px minmax(0, 1fr) 66px;
    padding-inline: 8px;
  }

  .site-header .auth-widget-open-modal {
  margin-top: 0;
  padding: 6px 5px;
  font-size: 0.72rem;
  white-space: nowrap;
}

  .site-logo {
    width: min(120px, 36vw);
    height: 42px;
  }

  .header-tools {
    gap: 6px;
  }

  .sidebar {
    width: min(280px, calc(100vw - 44px));
  }
}

/* --- Acordeon del sidebar ("Una Tierra Sin Goku" -> lista de capitulos) --- */
.sidebar-accordion {
  display: flex;
  flex-direction: column;
}

.sidebar-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: var(--text-h1);
  text-decoration: none;
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-align: left;
}

.sidebar-accordion-toggle:hover {
  background-color: var(--surface-elevated);
  color: var(--hover-primary);
}

.sidebar-accordion.is-expanded .sidebar-accordion-toggle {
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  background-color: var(--surface-elevated);
}

.sidebar-accordion-arrow {
  transition: transform 0.2s ease;
}

.sidebar-accordion.is-expanded .sidebar-accordion-arrow {
  transform: rotate(90deg);
}

.sidebar-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.sidebar-accordion.is-expanded .sidebar-submenu {
  max-height: 480px;
  overflow-y: auto;
}

.sidebar-submenu-viewall,
.sidebar-submenu-link {
  display: block;
  padding: 9px 18px 9px 30px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-body);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.sidebar-submenu-viewall {
  color: var(--accent-primary);
  font-weight: 700;
}

.sidebar-submenu-link:hover,
.sidebar-submenu-viewall:hover {
  background-color: var(--surface-deep);
  color: var(--hover-primary);
}

.sidebar-submenu-link.is-active {
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  background-color: var(--surface-deep);
}
/* Contenido complementario
   ========================================================================== */

.complementary-aside {
  position: sticky;
  top: calc(76px + 2rem);
  align-self: start;
  width: var(--aside-width);
  min-width: 0;
}

.complementary-aside-inner {
  width: 100%;
}

.complementary-aside-label {
  margin: 0 0 0.65rem;
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.aside-ad {
  display: block;
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-body);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aside-ad:hover,
.aside-ad:focus-visible {
  border-color: var(--cta-primary);
  box-shadow: 0 0 18px rgba(var(--cta-primary-rgb), 0.35);
}

.aside-ad-video {
  display: block;
  width: 100%;
  height: auto;
}

.aside-ad-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.3;
}

.aside-ad-text strong {
  color: var(--cta-primary);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.5px;
}

@media (max-width: 1200px) {
  .aside-ad-video {
    max-height: 240px;
    object-fit: cover;
  }
}

/* Pantallas donde no entran cómodamente ambos bloques de contenido */

@media (max-width: 1200px) {
  .app-body {
    grid-template-columns: minmax(0, 1100px);
  }

  .complementary-aside {
    position: static;
    width: min(100%, 728px);
    margin: 0 auto;
    padding:
      0
      clamp(16px, 4vw, 48px)
      2rem;
  }

  .complementary-aside-inner {
    width: 100%;
  }

}

/* Teléfonos */

@media (max-width: 768px) {
  .app-body {
    display: block;
    padding: 0 0 2rem;
    background-image:
      linear-gradient(
        90deg,
        rgba(var(--smoke-black-rgb), 0.58),
        transparent 25%,
        transparent 75%,
        rgba(var(--smoke-black-rgb), 0.58)
      ),
      url('../assets/decorations/pre-footer.png');
    background-size: 100% 100%, max(100%, 800px) auto;
  }

  .complementary-aside {
    width: 100%;
    padding:
      0
      clamp(16px, 4vw, 48px)
      2rem;
  }

}

/* Botón flotante para volver arriba
   ========================================================================== */

.back-to-top-button {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: var(--z-back-to-top);

  display: flex;
  align-items: center;
  justify-content: center;

  width: 72px;
  height: 72px;
  padding: 0;

  appearance: none;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: none;

  cursor: pointer;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.9);

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;
}

.back-to-top-button.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;

  filter:
    drop-shadow(
      0 4px 6px
      rgba(var(--shadow-color-rgb), 0.65)
    );

  transition: filter 0.2s ease;
}

.back-to-top-button:hover .back-to-top-image,
.back-to-top-button:focus-visible .back-to-top-image {
  filter:
    drop-shadow(
      0 4px 6px
      rgba(var(--shadow-color-rgb), 0.65)
    )
    drop-shadow(
      0 0 5px
      rgba(var(--accent-primary-rgb), 0.20)
    );
}

.back-to-top-button:focus-visible {
  outline: 3px solid var(--form-focus);
  outline-offset: 4px;
}

/* Footer
   ========================================================================== */

.site-footer {
  position: relative;
  width: 100%;
  margin-left: 0;
  padding:
    3rem
    clamp(1.25rem, 4vw, 4rem)
    1.5rem;
  background:
    radial-gradient(
      circle at 50% 20%,
      rgba(var(--accent-primary-rgb), 0.1),
      transparent 40%
    ),
    var(--bg-secondary);
  border-top: 3px solid var(--divider);
  color: var(--text-body);
  text-align: center;
}

.site-footer-inner {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.5fr)
    repeat(2, minmax(160px, 1fr));
  align-items: start;
  justify-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  width: min(1200px, 100%);
  margin: 0 auto;
  text-align: center;
}

/* Marca y descripción
   ========================================================================== */

.footer-brand {
  width: 100%;
  text-align: center;
}

.footer-brand h2,
.footer-column h3 {
  margin-top: 0;
  text-align: center;
  color: var(--text-h2);
}

.footer-brand h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.04em;
}

.footer-brand p {
  max-width: 52ch;
  margin: 0 auto;
  color: var(--text-body);
  line-height: 1.7;
  text-align: center;
}

/* Columnas
   ========================================================================== */

.footer-column {
  width: 100%;
  text-align: center;
}

.footer-column h3 {
  margin-bottom: 1rem;
  font-size: 1.6rem;
}

/* Navegación
   ========================================================================== */

.footer-links {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.footer-links li {
  width: 100%;
  text-align: center;
}

.footer-links a,
.footer-social-link {
  color: var(--text-body);
  text-decoration: none;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.footer-links a {
  display: inline-block;
}

.footer-links a:hover,
.footer-links a:focus-visible,
.footer-social-link:hover,
.footer-social-link:focus-visible {
  color: var(--hover-primary);
}

/* Redes sociales
   ========================================================================== */

.footer-social-links {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.footer-social-link:hover,
.footer-social-link:focus-visible {
  border-color: var(--hover-primary);
}

.footer-social-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Franja inferior
   ========================================================================== */

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  width: min(1200px, 100%);
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  text-align: center;
}

.footer-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  color: var(--text-caption);
}

.footer-legal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-h3);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.footer-legal-link:hover,
.footer-legal-link:focus-visible {
  background: var(--surface-elevated);
  border-color: var(--hover-primary);
  color: var(--hover-primary);
  transform: translateY(-2px);
}

/* Tablets
   ========================================================================== */

@media (max-width: 768px) {
  .site-footer {
    padding:
      2.5rem
      clamp(1.25rem, 4vw, 4rem)
      1.5rem;
  }

  .site-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem 2rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* Teléfonos
   ========================================================================== */

@media (max-width: 520px) {
  .site-footer {
    padding: 2.5rem 1.25rem 1.5rem;
  }

  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-bottom {
    gap: 1rem;
  }

  .back-to-top-button {
    right: 1rem;
    bottom: 1rem;
    width: 60px;
    height: 60px;
  }
}

/* Accesibilidad: movimiento reducido
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .footer-links a,
  .footer-social-link {
    transition: none;
  }
  .back-to-top-button,
  .back-to-top-image {
    transition: none;
  }

}

@media (min-width: 1051px) {
  :root {
    --header-desktop-height: 96px;
  }

  .site-header {
    min-height: var(--header-desktop-height);
  }

  .sidebar {
    top: var(--header-desktop-height);
  }

  .complementary-aside {
    top: calc(var(--header-desktop-height) + 2rem);
  }
}
