/* Canonical public site shell: one header rhythm and one footer surface. */

@media (min-width: 981px) {
  .litro-header .litro-primary-nav {
    margin-left: clamp(14px, 1.6vw, 24px);
    margin-right: auto;
  }

  .litro-header .litro-header-actions {
    margin-left: 0;
  }
}

/* The cookie manager is a viewport control, never page content. Keep this in the
   shared shell so page-specific styles cannot create layout after the footer.
   The route-planner selector intentionally matches the old override's
   specificity so this cache-busted shell also repairs clients with stale CSS. */
.cookie-preferences-button,
.route-planner-page .cookie-preferences-button {
  position: fixed;
  right: 18px;
  bottom: 14px;
  margin: 0;
}

@media (max-width: 760px) {
  /* Consent is a viewport control. It must not become page content on mobile. */
  .consent-banner {
    position: fixed;
    z-index: 250;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, calc(env(safe-area-inset-bottom) + var(--visual-viewport-bottom, 0px)));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
    max-height: min(70dvh, calc(var(--analytics-viewport-height, 100dvh) - 24px));
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #33495e;
    border-radius: 20px;
    background: rgb(13 32 54 / 0.98);
    box-shadow: 0 22px 64px rgb(0 0 0 / 0.36);
    backdrop-filter: blur(18px);
  }

  .consent-banner-inner {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .consent-banner p {
    max-width: none;
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .consent-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .consent-actions .button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding-inline: 12px;
    white-space: normal;
  }

  body:has(#analytics-consent:not([hidden])) .cookie-preferences-button {
    display: none;
  }
}

@media (max-width: 430px) {
  .consent-banner {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, calc(env(safe-area-inset-bottom) + var(--visual-viewport-bottom, 0px)));
    left: max(8px, env(safe-area-inset-left));
    max-height: min(76dvh, calc(var(--analytics-viewport-height, 100dvh) - 16px));
    padding: 15px;
    border-radius: 18px;
  }

  .consent-actions {
    grid-template-columns: 1fr;
  }
}

.litro-site-footer {
  margin: 0;
  padding: 0;
  border-top: 1px solid rgb(255 255 255 / 0.1);
  color: #edf4f8;
  background: #06111f;
}

.litro-site-footer .litro-footer-directory,
.litro-site-footer .litro-footer-meta {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.litro-site-footer .litro-footer-directory {
  padding-top: clamp(42px, 5vw, 58px);
  padding-bottom: clamp(42px, 5vw, 54px);
  border-top: 0;
}

.litro-site-footer .litro-footer-column strong {
  color: #edf4f8;
}

.litro-site-footer .litro-footer-column a {
  color: #a9bac7;
  text-decoration: none;
}

.litro-site-footer .litro-footer-column a:hover,
.litro-site-footer .litro-footer-column a:focus-visible {
  color: #fff;
}

.litro-footer-lower {
  border-top: 1px solid rgb(255 255 255 / 0.09);
  background: rgb(7 20 38 / 0.72);
}

.litro-footer-meta {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 16px;
}

.litro-footer-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.litro-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #edf4f8;
  font-family: "Sora", "Manrope", system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.litro-footer-brand img {
  width: 28px;
  height: 28px;
  display: block;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.2);
}

.litro-footer-copyright {
  color: #7f93a3;
  font-size: 0.76rem;
  font-weight: 650;
  white-space: nowrap;
}

.litro-footer-language-slot {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.litro-footer-language-slot:empty {
  min-height: 0;
}

.litro-footer-language-slot .litro-language-selector,
.litro-footer-language-slot .litro-language-control {
  margin: 0;
}

.litro-footer-language-slot .litro-language-selector {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.04);
}

.litro-footer-language-slot .litro-language-selector a {
  min-width: 34px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #91a5b5;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.litro-footer-language-slot .litro-language-selector a:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.07);
}

.litro-footer-language-slot .litro-language-selector a[aria-current="page"] {
  color: #06241f;
  background: #67e8d3;
  box-shadow: 0 4px 14px rgb(34 199 173 / 0.2);
}

.litro-footer-language-slot .litro-language-selector a:focus-visible,
.litro-footer-brand:focus-visible {
  outline: 3px solid #67e8d3;
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .litro-site-footer .litro-footer-directory,
  .litro-site-footer .litro-footer-meta {
    width: min(100% - 30px, 620px);
  }

  .litro-footer-meta {
    min-height: 72px;
  }
}

@media (max-width: 540px) {
  .litro-footer-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding-block: 20px;
  }

  .litro-footer-identity {
    width: 100%;
    justify-content: space-between;
  }

  .litro-footer-language-slot {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .litro-footer-language-slot .litro-language-selector a {
    transition: none;
  }
}
