/* ============================================================
 * USE Theme — footer.css
 * Two layouts: app (full builder) and classic (copyright only).
 * Hidden visibility renders nothing — no CSS needed.
 *
 * App layout (desktop):
 *   [brand] [menu-col-1 | menu-col-2] [socials]
 *
 * Socials support vertical / horizontal orientation on desktop.
 * On mobile they always go horizontal.
 * ============================================================ */

@layer components {

.use-footer {
  /*
   * Defaults derivados del preset activo. Si el preset es claro (Sage Garden,
   * Terra Clay…), el texto sale del color de texto del preset; si es oscuro
   * (Modern Dark, Neon Cyber…), igualmente. --uf-muted y --uf-border se
   * derivan de --uf-fg con color-mix() para garantizar contraste sin
   * importar el preset. El admin puede sobreescribir cualquiera.
   */
  --uf-bg:           var(--use-color-surface, #0f172a);
  --uf-fg:           var(--use-color-text,    #f1f5f9);
  --uf-titles-color: var(--uf-fg);
  --uf-accent:       var(--use-color-primary, #2563eb);
  --uf-muted:        color-mix(in srgb, var(--uf-fg) 65%, transparent);
  --uf-border:       color-mix(in srgb, var(--uf-fg) 14%, transparent);
  --uf-social-bg:    color-mix(in srgb, var(--uf-fg)  8%, transparent);

  background: var(--uf-bg); color: var(--uf-fg);
  padding: 2.5rem 0 0;
}
/* Fallback para navegadores sin color-mix() (Safari <16.4 / Chrome <111).
 * Si no soportan, --uf-muted/--uf-border caen a estos rgba neutros que
 * funcionan razonablemente sobre cualquier paleta. */
@supports not (color: color-mix(in srgb, red, blue)) {
  .use-footer {
    --uf-muted:     rgba(127, 127, 127, .8);
    --uf-border:    rgba(127, 127, 127, .25);
    --uf-social-bg: rgba(127, 127, 127, .15);
  }
}

/* ── Classic ─────────────────────────────────────────────── */

.use-footer--classic { padding: 1.25rem 0; }
.use-footer--classic .use-footer__inner { text-align: center; }
.use-footer--classic .use-footer__copy { margin: 0; color: var(--uf-muted); }

/* ── App — inner grid ────────────────────────────────────── */

.use-footer__inner {
  width: 100%; max-width: var(--use-container-max, 1280px);
  margin-inline: auto;
  padding: 0 var(--use-container-px, 1rem) 2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem 3rem;
  align-items: start;
}

/* ── Brand ───────────────────────────────────────────────── */

.use-footer__brand {
  display: flex; flex-direction: column; gap: .35rem;
  max-width: max-content;
}
.use-footer__brand .custom-logo-link,
.use-footer__logo-link { display: block; }
.use-footer__brand .custom-logo,
.use-footer__logo {
  height: auto; max-height: 56px; width: auto;
}
.use-footer__name {
  margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em;
}
.use-footer__tag {
  margin: 0; color: var(--uf-muted);
  font-size: .72rem; line-height: 1.4;
  text-align: center; letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── Menu columns ────────────────────────────────────────── */

.use-footer__menus {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 2.5rem;
}

.use-footer__col-title {
  margin: 0 0 .5rem;
  font-size: .75rem; letter-spacing: .08em;
  color: var(--uf-titles-color);
  font-weight: var(--uf-titles-weight, 600);
  font-style: var(--uf-titles-style, normal);
  text-transform: var(--uf-titles-case, uppercase);
  opacity: .9;
}

.use-footer__menu {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: .15rem;
}
.use-footer__menu li { list-style: none; }
.use-footer__menu a {
  display: inline-block; padding: .3rem 0;
  color: var(--uf-link, var(--uf-fg));
  font-size: .92rem; opacity: .85;
  transition: opacity .15s ease, color .15s ease;
  font-weight: var(--uf-menu-weight, 400);
  font-style: var(--uf-menu-style, normal);
  text-transform: var(--uf-menu-case, none);
}
.use-footer__menu a:hover { opacity: 1; color: var(--uf-accent); }
/* ── Social icons ────────────────────────────────────────── */

.use-footer__socials {
  list-style: none; padding: 0; margin: 0;
  display: inline-flex; gap: .55rem; flex-wrap: wrap;
}

.use-footer__socials--vertical {
  flex-direction: column;
}
.use-footer__socials--horizontal {
  flex-direction: row;
}

.use-footer__socials a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--uf-social-bg);
  color: var(--uf-fg);
  text-decoration: none;
  transition: background .15s ease, transform .12s ease;
}
.use-footer__socials a:hover {
  background: var(--uf-accent); color: #fff;
  transform: translateY(-1px);
}

/* ── Bottom ──────────────────────────────────────────────── */

.use-footer__bottom {
  border-top: 1px solid var(--uf-border);
  padding: 1.1rem var(--use-container-px, 1rem);
  max-width: var(--use-container-max, 1280px);
  margin-inline: auto;
  text-align: center;
}
.use-footer__bottom .use-footer__copy {
  margin: 0; color: var(--uf-muted); font-size: .82rem;
  font-weight: var(--uf-credits-weight, 400);
  font-style: var(--uf-credits-style, normal);
}
.use-footer__bottom .use-footer__copy span { opacity: .75; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 720px) {
  .use-footer__inner {
    grid-template-columns: 1fr;
    text-align: center; justify-items: center;
  }

  .use-footer__menus {
    width: 100%;
    justify-items: center;
  }

  /* Socials always horizontal on mobile */
  .use-footer__socials--vertical {
    flex-direction: row;
  }
}

@media (max-width: 380px) {
  .use-footer__menus {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

}

/* Unlayered — overrides WP global `a:where()` rule. */
.use-footer a {
  color: inherit;
  text-decoration: none;
}
/* Menu link decoration — unlayered so it beats the reset above. */
.use-footer__menu a {
  text-decoration: var(--uf-menu-deco, none);
  text-underline-offset: 4px;
}
[data-uf-menu-deco="hover"] .use-footer__menu a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
