/* ==========================================================================
   Matsuri Barcelona — Layout: Site Header, mobile menu drawer, Site Footer
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 1000;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 12px;
  width: auto;
  height: auto;
  clip: auto;
  overflow: visible;
}

/* ------------------------------- Aviso bar ---------------------------------
   Site-wide announcement bar, sits right above .site-header (see
   template-parts/aviso-bar.php and header.php) — on every page, not just
   the homepage. Not sticky: scrolls away normally; .site-header below
   takes over at top:0 once you scroll past it. Solid vermillion rather
   than a quiet paper/outline treatment — this is for the handful of times
   a year it's actually used (tickets on sale, lineup announced, etc.), so
   it's meant to be noticed, not blend in. */
.aviso-bar {
  background: var(--vermillion);
  color: var(--white);
}

.aviso-bar__inner {
  max-width: var(--page-max);
  margin-inline: auto;
  padding: 8px 44px;
}

@media (max-width: 782px) {
  .aviso-bar__inner {
    padding: 8px var(--content-pad-sp);
  }
}

.aviso-bar__content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  text-align: center;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

a.aviso-bar__content:hover .aviso-bar__text {
  text-decoration: underline;
}

.aviso-bar__icon {
  font-size: 13px;
  line-height: 1;
  flex: 0 0 auto;
}

.aviso-bar__date {
  flex: 0 0 auto;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.aviso-bar__text {
  flex: 0 1 auto;
}

/* ------------------------------ Site Header -------------------------------
   Figma's "Component — Site Header" is a solid ink (dark) bar — see the
   history note below for why this theme no longer matches that node.

   Flipped from dark (var(--ink)) to white, text flipped to ink, per the
   user, 2026-10-29: shown as a design comparison first (dark vs.
   white-bg/navy-text), then approved. Every element in this section that
   was hardcoded white-on-ink (nav links, language switcher, dropdowns,
   social icon, hamburger bars) is flipped to ink-on-white below — only
   the header bar itself; the separate full-screen mobile menu drawer
   further down this file is unchanged (dark), since that wasn't part of
   what was asked and a dark full-menu overlay opening from a light bar
   is a normal pattern. Say the word if that should flip too. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--ink-10);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  max-width: var(--page-max);
  margin-inline: auto;
  height: 82px;
  padding-inline: 44px;
}

@media (max-width: 782px) {
  .site-header__inner {
    padding-inline: var(--content-pad-sp);
  }
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  /* Hard cap so an uploaded Customizer logo can never blow out the
     header bar, regardless of the image's own native dimensions —
     belt-and-braces alongside the img rule below (the real bug was the
     invalid nested <a> markup in header.php/footer.php, fixed
     separately, but this makes the container itself fail safe too). */
  max-height: 48px;
  overflow: hidden;
}

.site-header__logo a,
.site-header__logo .custom-logo-link {
  display: flex;
  align-items: center;
}

.site-header__logo img,
.site-header__logo .custom-logo {
  display: block;
  height: auto;
  max-height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.site-header__logo-mark {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--vermillion);
  line-height: 1;
}

.site-header__logo-text {
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.site-header__nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav__item {
  position: relative;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.06em;
  /* Was var(--ink-78) — reasonable on the old near-black ink, but Deep
     Blue (#221c43) at 78% opacity over white reads as a washed-out
     grey-blue rather than a crisp navy (reported by the user,
     2026-10-29: "header text looks faint"). Full solid --ink instead. */
  color: var(--ink);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav__link:hover {
  background: var(--ink-06);
  color: var(--ink);
}

.nav__link[aria-current='page'] {
  background: var(--ink-10);
  color: var(--ink);
}

/* Chevron on the two items that carry a dropdown in Figma (El Festival,
   Colabora) — a plain CSS triangle stands in for the akar-icons asset. */
.nav__item--has-children > .nav__link::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.85;
}

.nav__submenu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--ink-10);
  box-shadow: var(--shadow-card-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.nav__item--has-children:hover > .nav__submenu,
.nav__item--has-children:focus-within > .nav__submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__submenu .nav__link {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.9375rem;
  white-space: nowrap;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.lang-switch__current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: var(--ink-06);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.lang-switch__current::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.85;
}

.lang-switch__current:hover {
  background: var(--ink-10);
}

/* Dropdown added per the user, 2026-10-28, once matsuri_lang_switcher()
   started rendering Polylang's real language list instead of a single
   inert "ES" button — .lang-switch itself is the positioning context
   (it was a bare flex item before, with nothing absolutely positioned
   inside it). Hidden by default; main.js toggles aria-expanded on
   .lang-switch__current, same pattern as .mobile-menu-toggle. */
.lang-switch {
  position: relative;
}

.lang-switch__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 6px;
  min-width: 140px;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--ink-10);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.lang-switch__current[aria-expanded='true'] + .lang-switch__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-switch__option {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.lang-switch__option:hover {
  background: var(--ink-06);
}

.lang-switch__option.is-current {
  color: var(--amber);
  font-weight: 600;
}

.site-header__social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--ink-06);
  transition: background-color var(--transition-fast);
}

/* The real Instagram/YouTube/Facebook icons (matsuri_social_icon(),
   inc/template-tags.php) now sit inside .site-header__social and
   .mobile-menu__social-icon in place of the old plain-text "IG"/"YT"/
   "FB" labels — display:block just avoids the few extra px of baseline
   whitespace an inline <img> gets by default. width/height: auto +
   max-width/max-height (rather than a fixed width/height here) keeps
   each PNG's own aspect ratio no matter what its width/height HTML
   attributes say — social-youtube.png is a wide 550×388 rounded-rect,
   not a square like the Instagram/Facebook ones, and a fixed square
   box stretched it, per the user, 2026-11-19. */
.matsuri-social-icon {
  display: block;
  width: auto;
  height: auto;
  max-width: 20px;
  max-height: 20px;
}

.site-header__social:hover {
  background: var(--ink-10);
}

/* Header CTA — solid ink-section button (Figma 18:21): 8px corners,
   14px SemiBold, distinct from the pill/caps button modifiers used
   elsewhere. */
.site-header__tickets {
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 1024px) {
  .site-header__social {
    display: none;
  }
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-toggle__bar {
  display: block;
  height: 2px;
  width: 24px;
  margin-inline: auto;
  /* Was var(--paper) (light bars on the old dark header) — flipped to
     var(--ink) along with the rest of .site-header, per the user,
     2026-10-29. The full-screen drawer this button opens is unchanged
     (still dark), so its own close-button/X bars stay as they were —
     this only affects the hamburger icon as it sits in the now-white
     header bar. */
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.mobile-menu-toggle[aria-expanded='true'] .mobile-menu-toggle__bar:nth-child(2) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded='true'] .mobile-menu-toggle__bar:nth-child(3) {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded='true'] .mobile-menu-toggle__bar:nth-child(4) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Figma's "Component — Mobile Header" (104:14) keeps the ticket pill
   visible next to the hamburger — just shrunk — rather than hiding it,
   and uses tighter 16/18px padding and a 22px hamburger. Confirmed via
   get_design_context; an earlier pass wrongly hid the ticket button
   entirely below 1024px. */
@media (max-width: 1024px) {
  .site-header__nav,
  .lang-switch {
    display: none;
  }

  .site-header__inner {
    height: auto;
    padding-block: 18px;
  }

  .site-header__tickets {
    padding: 8px 14px;
    font-size: 0.625rem;
    letter-spacing: 0.04em;
  }

  .mobile-menu-toggle {
    display: flex;
    width: 32px;
    gap: 5px;
  }

  .mobile-menu-toggle__bar {
    width: 22px;
  }
}

/* ------------------------------ Mobile menu --------------------------------
   Figma's "Component — Mobile Menu (open)" (196:82) is an ink (dark)
   drawer, not a light one — the same light/dark inversion mistake made
   elsewhere in this theme. Nav links are white SemiBold 20px; the two
   items with a submenu show their children inline, always expanded, in
   amber; a single "ES" control + circular IG/FB icons replace what was
   a 4-language chip row; the ticket button is a full-width 8px-radius
   bar, not a pill. */
.mobile-menu {
  position: fixed;
  inset: 0;
  top: 82px;
  z-index: 99;
  background: var(--ink);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med), transform var(--transition-med);
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .mobile-menu {
    top: 74px;
  }
}

.mobile-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-menu__inner {
  padding: 32px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.mobile-menu__nav .nav__item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu__nav .nav__link {
  padding: 0;
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: 0;
  color: var(--paper);
}

.mobile-menu__nav .nav__item--has-children > .nav__link::after {
  border-top-color: var(--amber);
}

.mobile-menu__nav .nav__submenu {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 0 0 16px;
  margin: 0;
  background: none;
  box-shadow: none;
  opacity: 1;
  visibility: visible;
  transform: none;
}

.mobile-menu__nav .nav__submenu .nav__link {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--amber);
}

.mobile-menu__divider {
  border: 0;
  height: 1px;
  background: rgba(244, 239, 225, 0.15);
  margin: 0;
}

.mobile-menu__utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu__lang {
  border: 0;
  background: none;
  padding: 0;
  font-weight: 600;
  font-size: 0.8125rem;
  color: rgba(244, 239, 225, 0.85);
  cursor: pointer;
}

/* Only the fallback <button> (no Polylang) gets the dropdown chevron —
   once Polylang renders .mobile-menu__lang-group, the same class is
   reused on each flat <a> language link, which has no dropdown to
   indicate. */
button.mobile-menu__lang::after {
  content: ' ▾';
}

/* Flat language list — mobile equivalent of .lang-switch__menu, added
   per the user, 2026-10-28. No dropdown on mobile: all languages show
   at once, same density as the IG/YT/FB icon row beside it. */
.mobile-menu__lang-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-menu__lang-group .mobile-menu__lang {
  text-decoration: none;
}

.mobile-menu__lang-group .mobile-menu__lang.is-current {
  color: var(--amber);
}

.mobile-menu__social {
  display: flex;
  gap: 8px;
}

.mobile-menu__social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(244, 239, 225, 0.5);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--paper);
}

.mobile-menu__tickets {
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 15px 26px;
}

body.mobile-menu-open {
  overflow: hidden;
}

/* ------------------------------ Site Footer -------------------------------- */
.site-footer {
  background: var(--ink);
  color: var(--paper-78);
}

.site-footer a {
  color: var(--paper-78);
  transition: color var(--transition-fast);
}

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

.site-footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-block: 72px 48px;
}

.site-footer__brand .site-header__logo-text,
.site-footer__brand .site-header__logo-mark {
  color: var(--paper);
}

.site-footer__tagline {
  margin-top: 14px;
  max-width: 32ch;
}

.footer-col__title {
  color: var(--paper);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.site-footer__col ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.9375rem;
}

/* "Entradas (Pronto)" while tickets aren't on sale yet — see
   matsuri_tickets_on_sale() in inc/template-tags.php. Dimmer than the
   live footer links (--paper-78) and not a hover color, since it isn't
   a link at all while disabled. */
.footer-link--disabled {
  color: var(--paper-55);
  cursor: not-allowed;
}

.site-footer__bottom {
  border-top: 1px solid rgba(234, 234, 244, 0.12);
}

.site-footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
  flex-wrap: wrap;
}

.site-footer__bottom-inner p {
  color: var(--paper-55);
}

.site-footer__social {
  display: flex;
  gap: 16px;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

/* "Right group" in Figma: Legal links + Social icons, gap 40px between the
   two clusters (node 40:28). Wraps the existing .site-footer__social so the
   space-between on .site-footer__bottom-inner still puts the copyright on
   the far left and this whole cluster on the right, as in the design. */
.site-footer__right {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

/* Legal links (FAQs / Contacto / Política de cookies / Política de
   privacidad) — node 40:16, exact values: 12px, #99948a (already the same
   composited color as --paper-55 used for the copyright line), gap 28px. */
.site-footer__legal {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 0.75rem;
}

.site-footer__legal a {
  color: var(--paper-55);
}

@media (max-width: 1024px) {
  .site-footer__top {
    grid-template-columns: 1fr 1fr;
    row-gap: 40px;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .site-footer__top {
    grid-template-columns: 1fr;
  }

  /* Mobile Footer component (node 104:34): copyright → legal links →
     social icons stacked in a single column, gap 20px between the three
     groups and 10px between each legal link. */
  .site-footer__bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .site-footer__right {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .site-footer__legal {
    flex-direction: column;
    gap: 10px;
  }
}
