/* =========================================================
   Widget: Portada de inicio
   ========================================================= */
.sml-portada-inicio {
  display: grid; grid-template-rows: 1fr auto;
  min-height: clamp(640px, calc(100svh - var(--sml-header-h)), 900px);
  overflow: hidden;
  isolation: isolate;
}

.sml-portada-inicio .sml-hero-media { position: absolute; inset: 0; z-index: -1; }
.sml-portada-inicio .sml-hero-media img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 72% 50%; }
.sml-portada-inicio .sml-hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--sml-graphite) 0%, rgba(28, 28, 28, .9) 28%, rgba(28, 28, 28, .35) 52%, rgba(28, 28, 28, 0) 70%),
    linear-gradient(0deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 30%);
}

.sml-portada-inicio .sml-hero-inner { align-self: center; padding-block: clamp(40px, 5vw, 72px); }
.sml-portada-inicio .sml-hero-copy { max-width: 640px; }
.sml-portada-inicio .sml-hero-title { font-size: 2em; }

.sml-portada-inicio .sml-hero-kicker {
  display: block; margin-bottom: 22px;
  font-family: var(--sml-f-head); font-weight: 500; font-size: .82rem; line-height: 1.12;
  letter-spacing: .26em; text-transform: uppercase; color: var(--sml-gold);
}
.sml-portada-inicio .sml-hero-display {
  display: block;
  font-size: clamp(2.6rem, 4.5vw, 4.05rem);
  font-weight: 600; line-height: 1.08; letter-spacing: -.025em; color: var(--sml-white);
}

.sml-portada-inicio .sml-hero-lead { max-width: 548px; font-size: 1.125rem; color: rgba(255, 255, 255, .8); }
.sml-portada-inicio .sml-hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

/* Secuencia de entrada */
.sml-portada-inicio .sml-hero-kicker,
.sml-portada-inicio .sml-hero-display,
.sml-portada-inicio .sml-hero-lead,
.sml-portada-inicio .sml-hero-ctas,
.sml-portada-inicio .sml-hero-rail { opacity: 0; animation: sml-rise .9s var(--sml-ease-out) forwards; }
.sml-portada-inicio .sml-hero-kicker { animation-delay: .05s; }
.sml-portada-inicio .sml-hero-display { animation-delay: .15s; }
.sml-portada-inicio .sml-hero-lead { animation-delay: .9s; }
.sml-portada-inicio .sml-hero-ctas { animation-delay: 1.02s; }
.sml-portada-inicio .sml-hero-rail { animation-delay: 1.2s; }

/* Título palabra a palabra y luz dorada que sigue al cursor */
.sml-portada-inicio .sml-hero-display.sml-is-split { opacity: 1; animation: none; }
.sml-portada-inicio .sml-hero-display .sml-wd { display: inline-block; }
.sml-portada-inicio .sml-hero-display.sml-is-split:not(.sml-is-lit) .sml-wd {
  opacity: 0; filter: blur(10px); transform: translateY(.3em);
  animation: sml-word-in 1s var(--sml-ease-out) forwards;
  animation-delay: calc(.2s + var(--i) * 80ms);
}
@keyframes sml-word-in { to { opacity: 1; filter: blur(0); transform: none; } }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .sml-portada-inicio .sml-hero-display.sml-is-lit {
    background-image: radial-gradient(circle 230px at var(--mx, 18%) var(--my, 45%), #f6dca6 0%, #ddb062 24%, #fff 72%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
}

.sml-portada-inicio .sml-hero-rail {
  background: rgba(0, 0, 0, .62);
  border-top: 1px solid var(--sml-line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

/* Hero apilado: tablet vertical y móvil */
@media (max-width: 900px), (max-aspect-ratio: 4/5) {
  .sml-portada-inicio { display: block; min-height: 0; }
  .sml-portada-inicio .sml-hero-media { position: relative; height: min(56vw, 440px); min-height: 280px; }
  .sml-portada-inicio .sml-hero-media img { object-position: 80% 50%; }
  .sml-portada-inicio .sml-hero-media::after {
    background:
      linear-gradient(180deg, rgba(28, 28, 28, 0) 45%, var(--sml-graphite) 100%),
      linear-gradient(90deg, rgba(28, 28, 28, .55) 0%, rgba(28, 28, 28, 0) 45%);
  }
  .sml-portada-inicio .sml-hero-inner { position: relative; margin-top: -40px; padding-block: 0 44px; }
  .sml-portada-inicio .sml-hero-display { font-size: clamp(2.6rem, 6.6vw, 3.5rem); }
  .sml-portada-inicio .sml-hero-rail { background: transparent; border-top: 1px solid var(--sml-line); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (max-width: 760px) {
  .sml-portada-inicio .sml-hero-media { height: 62vw; min-height: 230px; }
  .sml-portada-inicio .sml-hero-kicker { font-size: .74rem; letter-spacing: .22em; margin-bottom: 16px; }
  .sml-portada-inicio .sml-hero-display { font-size: clamp(2.05rem, 8.8vw, 2.7rem); }
  .sml-portada-inicio .sml-hero-lead { font-size: 1.02rem; }
  .sml-portada-inicio .sml-hero-ctas { margin-top: 26px; }
  .sml-portada-inicio .sml-hero-ctas .sml-btn { flex: 1 1 100%; }
}

/* En el editor de Elementor no se repite la entrada en cada cambio */
.elementor-editor-active .sml-portada-inicio .sml-hero-kicker,
.elementor-editor-active .sml-portada-inicio .sml-hero-display,
.elementor-editor-active .sml-portada-inicio .sml-hero-lead,
.elementor-editor-active .sml-portada-inicio .sml-hero-ctas,
.elementor-editor-active .sml-portada-inicio .sml-hero-rail { opacity: 1; animation: none; }
