/* Back-to-top button (injected by /assets/js/site.js initScrollTop).
   Colours: primary #1d162d (header bg-cz-bar), accent #ff6a13 (cz-orange). */
.scroll-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 45; /* above sticky header / mobile nav (z-40), below skip link focus (z-50) */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 2px solid #ff6a13;
  border-radius: 50%;
  background: #1d162d;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0s linear 0.25s,
    background-color 0.2s ease,
    color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.scroll-top svg {
  display: block;
  width: 22px;
  height: 22px;
}
.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0s linear 0s,
    background-color 0.2s ease,
    color 0.2s ease;
}
.scroll-top:hover,
.scroll-top:focus-visible {
  background: #ff6a13;
  color: #1d162d;
}
.scroll-top:focus {
  outline: none;
}
.scroll-top:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}
/* Below 1024px a fixed bottom nav (64px + safe area) is shown: sit above it. */
@media (max-width: 1023px) {
  .scroll-top {
    bottom: calc(64px + 16px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 767px) {
  .scroll-top {
    right: 16px;
    width: 44px;
    height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-top,
  .scroll-top.is-visible {
    transition: none;
    transform: none;
  }
}

/* ------------------------------------------------------------------
   Site header (.site-header). Utility classes come from the site's Tailwind
   build; only sticky positioning, anchor offset, narrow-phone fit and the
   JS-built mobile menu are added here.
   ------------------------------------------------------------------ */
.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 40;
}
/* Keep #anchor targets clear of the sticky header (57px mobile / 65px >=640px). */
html {
  scroll-padding-top: 73px;
}
@media (min-width: 640px) {
  html {
    scroll-padding-top: 81px;
  }
}

/* Mobile (<640px): keep the header row inside the viewport (was 399px at 390px). */
@media (max-width: 639px) {
  .site-header > div {
    gap: 8px;
  }
  .site-header > div > a[aria-label] {
    flex-shrink: 0;
    gap: 5px;
  }
  .site-header > div > a[aria-label] > span[title] {
    margin-left: 0;
  }
  .site-header > div > a[aria-label] .text-\[19px\] {
    font-size: 17px;
  }
  .site-header > div > .ml-auto {
    flex-shrink: 0;
    gap: 6px;
  }
}
@media (max-width: 389px) {
  /* Very narrow phones: drop the decorative "ES" badge before anything overflows. */
  .site-header a[aria-label] > span[title] {
    display: none;
  }
}

/* Hamburger (.nav-toggle, existing "Abrir menú" button, class added by site.js):
   44x44 tap target below the desktop breakpoint. */
.site-header.has-mobile-nav .nav-toggle {
  width: 44px;
  height: 44px;
  margin-left: -4px;
  flex-shrink: 0;
  color: #ffffff;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.site-header.has-mobile-nav .nav-toggle:hover,
.site-header.has-mobile-nav .nav-toggle[aria-expanded="true"] {
  background-color: #3b3058;
}

/* Mobile menu sheet (built by site.js initMenu) */
[data-cz-sheet="dialog"] {
  max-width: 85vw;
  max-height: 100vh;
  overscroll-behavior: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: cz-sheet-in 0.25s ease-out;
}
[data-cz-sheet="overlay"] {
  animation: cz-fade-in 0.2s ease-out;
}
[data-cz-sheet="dialog"] nav a {
  min-height: 48px;
  color: #ffffff;
}
[data-cz-sheet="dialog"] nav a:hover {
  background-color: #2c2342;
}
[data-cz-sheet="dialog"] nav a[aria-current="page"] {
  background-color: #3b3058;
  box-shadow: inset 3px 0 0 #ff6a13;
}
[data-cz-sheet="dialog"] .nav-sheet-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  top: 8px;
  right: 8px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: #ffffff;
  opacity: 0.8;
  cursor: pointer;
}
[data-cz-sheet="dialog"] .nav-sheet-close:hover,
[data-cz-sheet="dialog"] .nav-sheet-close:focus-visible {
  opacity: 1;
  background-color: #3b3058;
}
[data-cz-sheet="dialog"] a:focus-visible,
[data-cz-sheet="dialog"] button:focus-visible {
  outline: 2px solid #ff6a13;
  outline-offset: 2px;
}
[data-cz-sheet="dialog"]:focus {
  outline: none;
}
@keyframes cz-sheet-in {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes cz-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-cz-sheet="dialog"],
  [data-cz-sheet="overlay"] {
    animation: none;
  }
  .site-header a,
  .site-header button {
    transition: none;
  }
}
@media (max-width: 359px) {
  /* Smallest phones: keep the "C" mark (link keeps its aria-label), hide the wordmark. */
  .site-header > div > a[aria-label] > .text-\[19px\] {
    display: none;
  }
}

/* Tailwind utility used on content images but absent from the build */
.aspect-video {
  aspect-ratio: 16 / 9;
}
