/**
 * Mega Footer — Sovereign Component CSS
 * WP-Kore Framework — Architecture: CUBE CSS + OKLCH Tokens
 *
 * Archetype: mega_footer_watermark_archetype
 * Reference: project_content/design-catalog-references/footer/footer-mega-brand-watermark-with-trust-badges.png
 *
 * @package WP_Kore
 */

/* ── 0. Sovereign 2-Column Split Layout for Mega Footer ── */
:is(footer, .section-footer, .site-footer) :is(.grid-auto-4, .wrapper-wide.grid-auto) {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: var(--space-xl, 2.5rem);
  width: 100%;
}

@media (min-width: 48rem) {
  :is(footer, .section-footer, .site-footer) :is(.grid-auto-4, .wrapper-wide.grid-auto) {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) !important;
    align-items: start;
  }
  :is(footer, .section-footer, .site-footer) :is(.grid-auto-4, .wrapper-wide.grid-auto) > * {
    grid-column: auto !important;
    width: 100%;
  }
}

/* ── 0.1 Right Region Dual Nav Silos Grid ── */
:is(footer, .section-footer, .site-footer) .oxy-container-62326-131,
:is(footer, .section-footer, .site-footer) [class*="130"] > .cluster:first-child {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--space-lg, 2rem) !important;
  width: 100%;
  align-items: start;
}

/* ── 1. Footer Section Pad Immunity: Zero bottom gap beneath monumental watermark ── */
:is(footer, .section-footer, [class*="footer"]):has(.brand-watermark) {
  padding-block-end: 0;
}

/* ── 2. Mega Footer Brand Watermark Container ── */
.brand-watermark {
  --local-watermark-color: oklch(100% 0 0 / 6%);
  --local-watermark-font: var(--font-display, 'Space Grotesk', sans-serif);
  --local-watermark-size: clamp(6.5rem, 23.5vw, 26rem);
  --local-watermark-tracking: -0.04em;
  --local-watermark-leading: 0.75;

  position: relative;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-top: var(--space-xl);
  margin-bottom: 0;
  line-height: var(--local-watermark-leading);
  user-select: none;
  pointer-events: none;
  text-align: center;
}

:is(.stage-dark, .bg-dark, [data-theme="dark"]) .brand-watermark {
  --local-watermark-color: oklch(100% 0 0 / 6%);
}

/* ── 3. Watermark Monumental Text ── */
.brand-watermark .h-display {
  font-family: var(--local-watermark-font) !important;
  font-size: var(--local-watermark-size) !important;
  font-weight: var(--font-weight-black, 900) !important;
  letter-spacing: var(--local-watermark-tracking) !important;
  line-height: var(--local-watermark-leading) !important;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  max-width: none !important;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  color: var(--local-watermark-color) !important;
  opacity: 1 !important;
  display: block;
}

/* ── 4. Footer Navigation & Typographic Links ── */
.footer-nav-link,
:is(footer, .section-footer, .site-footer) a.text-main {
  color: oklch(82% 0.01 145) !important;
  text-decoration: none !important;
  font-size: var(--font-size-sm, 0.875rem);
  line-height: var(--leading-normal, 1.5);
  display: inline-block;
  padding-block: var(--space-3xs, 0.25rem);
  transition: color var(--duration-fast, 0.15s) ease, transform var(--duration-fast, 0.15s) ease;
}

.footer-nav-link:hover,
:is(footer, .section-footer, .site-footer) a.text-main:hover,
.footer-nav-link:focus-visible,
:is(footer, .section-footer, .site-footer) a.text-main:focus-visible {
  color: oklch(100% 0 0) !important;
  transform: translateX(0.1875rem);
}

.footer-nav-link:focus-visible,
:is(footer, .section-footer, .site-footer) a.text-main:focus-visible {
  outline: var(--border-width, 1px) solid var(--text-on-dark, oklch(100% 0 0));
  outline-offset: 0.125rem;
  border-radius: var(--radius-control);
}

/* ── 5. Footer Legal Links ── */
.footer-legal-link {
  color: oklch(65% 0.01 145) !important;
  text-decoration: none;
  font-size: var(--font-size-caption, 0.8125rem);
  line-height: var(--leading-normal, 1.5);
  display: inline-block;
  padding-block: var(--space-3xs, 0.125rem);
  transition: color var(--duration-fast, 0.15s) ease;
}

.footer-legal-link:hover,
.footer-legal-link:focus-visible {
  color: oklch(100% 0 0) !important;
  text-decoration: underline;
}

.footer-legal-link:focus-visible {
  outline: var(--border-width, 1px) solid var(--text-on-dark, oklch(100% 0 0));
  outline-offset: 0.125rem;
  border-radius: var(--radius-control);
}

/* ── 5.1 Footer Section Kickers & Gold Headings ── */
:is(footer, .section-footer, [class*="footer"]) :is(.text-gold, .kicker.text-gold, .kicker) {
  --local-kicker-color: oklch(71.2% 0.145 82);
  color: oklch(71.2% 0.145 82) !important;
  font-family: var(--font-mono, monospace);
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: var(--font-weight-bold, 700);
  letter-spacing: var(--tracking-mono, 0.08em);
  text-transform: uppercase;
}

/* ── 6. Footer Logo Image Sizing & Dark Stage Legibility ── */
:is(footer, .kore-footer, .section-footer) .logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  max-width: 100%;
  text-decoration: none;
}

:is(.kore-image-figure, .image, figure.image, .footer-logo-img, .logo-img):is(.footer-logo-img, .logo-img) {
  position: relative;
  width: 17.5rem !important; /* 280px exactos de producción */
  max-width: 100% !important;
  --local-width: 17.5rem;
  height: auto;
  display: block;
}

:is(.footer-logo-img, .logo-img) .kore-image-wrap,
:is(.footer-logo-img, .logo-img) .kore-picture {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 478 / 78;
}

:is(.footer-logo-img, .logo-img) :is(img, .kore-image, .kore-image.object-cover) {
  width: 100% !important;
  max-width: 17.5rem !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: 478 / 78 !important;
  object-fit: contain;
  object-position: left center;
  display: block;
}

:is(.stage-dark, .bg-dark, [data-theme="dark"]) :is(.footer-logo-img, .logo-img) img:not([src*="-white."]) {
  filter: brightness(0) invert(1);
}

/* ── 7. Footer Social Icons & Capsules (Ergonomía Táctil 44pt WCAG 2.2 AA) ── */
.social-cluster {
  display: flex;
  align-items: center;
  gap: var(--space-xs, 0.5rem);
  flex-wrap: wrap;
}

.social-cluster a,
.social-cluster .oxy-container-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-control, 0.375rem);
  background-color: oklch(100% 0 0 / 6%);
  border: var(--border-width, 1px) solid oklch(100% 0 0 / 12%);
  color: var(--text-on-dark-muted, oklch(75% 0 0));
  text-decoration: none;
  transition: all var(--duration-fast, 0.15s) ease;
}

.social-cluster a:hover,
.social-cluster .oxy-container-link:hover,
.social-cluster a:focus-visible,
.social-cluster .oxy-container-link:focus-visible {
  background-color: oklch(100% 0 0 / 16%);
  border-color: oklch(100% 0 0 / 30%);
  color: var(--text-on-dark, oklch(100% 0 0));
  transform: translateY(-0.125rem);
  box-shadow: 0 0.25rem 0.75rem oklch(0 0 0 / 40%);
}

.social-cluster a:focus-visible,
.social-cluster .oxy-container-link:focus-visible {
  outline: var(--border-width, 1px) solid var(--text-on-dark, oklch(100% 0 0));
  outline-offset: 0.125rem;
}

.social-cluster .oxy-svg-icon2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: inherit;
}

.social-cluster .oxy-svg-icon2 > svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── 8. Footer Badges & Interactive Focus Chips (Stage Dark / Inverse) ── */
:is(footer, .section-footer, .site-footer) :is(.cluster-tag-links, .cluster:has(.badge-chip)) {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3xs) var(--space-2xs);
  align-items: center;
  justify-content: flex-start;
  max-width: 32rem; /* permite que Sell a Toad caiga a la segunda línea exactamente como en producción */
}

:is(footer, .section-footer, .site-footer) .badge-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs, 0.25rem);
  padding: var(--space-3xs) var(--space-xs);
  font-size: var(--font-size-caption, 0.75rem);
  font-weight: var(--font-weight-medium, 500);
  line-height: var(--leading-tight, 1.25);
  border-radius: var(--radius-control, 4px) !important;
  background-color: oklch(100% 0 0 / 6%) !important;
  border: var(--border-width, 1px) solid oklch(100% 0 0 / 14%) !important;
  color: var(--text-on-dark, oklch(100% 0 0)) !important;
  text-decoration: none !important;
  transition: all var(--duration-fast, 0.15s) ease;
}

:is(footer, .section-footer, .site-footer) a.badge-chip:hover,
:is(footer, .section-footer, .site-footer) .badge-chip:hover,
:is(footer, .section-footer, .site-footer) a.badge-chip:focus-visible,
:is(footer, .section-footer, .site-footer) .badge-chip:focus-visible {
  background-color: oklch(100% 0 0 / 16%) !important;
  border-color: oklch(100% 0 0 / 35%) !important;
  color: oklch(100% 0 0) !important;
  transform: translateY(-0.0625rem);
  box-shadow: 0 0.125rem 0.5rem oklch(0 0 0 / 40%);
  text-decoration: none !important;
}

:is(footer, .section-footer, .site-footer) .badge-subtle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs, 0.25rem);
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-control, 4px) !important;
  background-color: oklch(100% 0 0 / 4%) !important;
  border: var(--border-width, 1px) solid oklch(100% 0 0 / 12%) !important;
  color: oklch(85% 0 0) !important;
}

:is(footer, .section-footer, .site-footer) .badge-technical {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs, 0.25rem);
  padding: var(--space-3xs) var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: var(--tracking-mono, 0.04em);
  text-transform: uppercase;
  border-radius: var(--radius-control);
  background-color: oklch(100% 0 0 / 5%) !important;
  border: var(--border-width, 1px) solid oklch(100% 0 0 / 12%) !important;
  color: oklch(92% 0 0) !important;
}

:is(footer, .section-footer, .site-footer) .badge__icon,
:is(footer, .section-footer, .site-footer) .badge-technical .kore-icon {
  color: var(--text-on-dark-muted, oklch(75% 0 0));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── 9. Footer Semantic Kickers & Hierarchy ── */
:is(footer, .section-footer, .site-footer) .kicker {
  font-family: var(--font-mono);
  font-size: var(--font-size-caption, 0.75rem);
  letter-spacing: var(--tracking-mono, 0.04em);
  text-transform: uppercase;
  font-weight: var(--font-weight-semibold, 600);
  color: oklch(71.2% 0.145 82) !important;
  margin: 0;
}

/* ── 10. Mobile Single Column Stacking & Zero Overflow ── */
@media (max-width: 47.99rem) {
  :is(footer, .section-footer) :is(.grid-auto-4, .wrapper-wide.grid-auto) {
    grid-template-columns: 1fr !important;
  }
}

/* ── 11. Modal Portal Closed State Safeguard ── */
:is(.modal, .kore-modal, dialog.modal):not([open]):not(.is-builder-open):not([data-builder-modal]):not([data-builder-mode="inline"]) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}



