/* ==========================================================================
   HOME — Front page sections
   Personalizar por vertical: hero, servicios, proceso, CTA, etc.
   ========================================================================== */

/* Body + wp-site-blocks background matches hero to prevent flash/gap.
   The header template-part (height:0, overflow:visible) can cause a
   subpixel rendering line between itself and main on mobile browsers.
   Matching bg on wp-site-blocks eliminates the visible artifact. */
body.home,
body.page-template-front-page {
  background-color: var(--color-secondary);
}

body.home .wp-site-blocks,
body.page-template-front-page .wp-site-blocks {
  background-color: var(--color-secondary);
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Kill WordPress flow gap between header template-part and main */
body.home .wp-site-blocks > *,
body.page-template-front-page .wp-site-blocks > * {
  margin-block-start: 0 !important;
}

/* --- Hero with video background ----------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--color-secondary);
}

/* Video iframe — covers entire hero */
.hero__video-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero__video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw; /* 16:9 */
  min-height: 100%;
  min-width: 177.78vh; /* 16:9 inverse */
  transform: translate(-50%, -50%);
  border: 0;
  object-fit: cover;
}

/* YouTube facade — thumbnail + play button before iframe loads */
.hero__video-facade {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.hero__video-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.hero__video-play:hover,
.hero__video-play:focus-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

/* Once iframe is loaded, hide the facade */
.hero__video-facade--active {
  z-index: -1;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

/* Dark gradient overlay on top of video */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.4) 40%,
    rgba(0, 0, 0, 0.5) 70%,
    rgba(0, 0, 0, 0.8) 100%
  );
  z-index: 1;
}

/* Content on top */
.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--space-3xl) var(--space-m);
  max-width: var(--wide-width);
}

.hero__title {
  color: #fff;
  font-size: var(--text-5xl);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.1;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.hero__subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--text-l);
  line-height: 1.6;
  margin: var(--space-s) auto 0;
  max-width: 700px;
}

.hero__actions {
  display: flex;
  justify-content: center;
  gap: var(--space-m);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

/* Hero CTA styles moved to components.css (reusable across pages) */

/* Fallback: no video — just dark bg */
.hero:not(.hero--has-video) .hero__overlay {
  background: var(--color-secondary);
}

/* Scroll indicator — text + line + chevron */
.hero__scroll-hint {
  position: absolute;
  bottom: var(--space-l);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3xs);
  z-index: 2;
  color: var(--color-white);
}

.hero__scroll-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.7;
}

.hero__scroll-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.6));
  animation: hero-line-grow 2s ease-in-out infinite;
}

.hero__scroll-hint svg {
  opacity: 0.8;
  animation: hero-chevron-bounce 2s ease-in-out infinite;
}

@keyframes hero-line-grow {
  0%, 100% { height: 24px; opacity: 0.4; }
  50%      { height: 36px; opacity: 0.8; }
}

@keyframes hero-chevron-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(6px); opacity: 1; }
}

/* --- Hero responsive ---------------------------------------------------- */
@media (max-width: 768px) {
  .hero {
    min-height: 500px;
  }

  .hero__content {
    padding: var(--space-2xl) var(--space-s);
  }

  .hero__actions {
    flex-direction: column;
    align-items: center;
    gap: var(--space-s);
  }

  .hero__cta {
    width: 100%;
    max-width: 320px;
  }

  .hero__scroll-label,
  .hero__scroll-line {
    display: none;
  }
}

/* Servicios Grid + servicio-card: in components.css */

/* ==========================================================================
   Últimas Noticias — dark section on home page
   ========================================================================== */

/* Grid: 3 columns, collapses to 1 on mobile */
.noticias-home__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

@media (max-width: 768px) {
  .noticias-home__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs);
  }
  .noticias-home__thumb {
    aspect-ratio: 4 / 3;
    background: var(--color-surface);
  }
  .noticias-home__body {
    padding: var(--space-xs);
    text-align: center;
    align-items: center;
  }
  .noticias-home__cat {
    font-size: 0.65rem;
    padding: 2px 6px;
  }
  .noticias-home__title {
    font-size: var(--text-s);
  }
  .noticias-home__excerpt,
  .noticias-home__date {
    display: none;
  }
}

/* Card — white bg, linked block */
.noticias-home__card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-foreground);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.noticias-home__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-l);
}

/* Thumbnail */
.noticias-home__thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.noticias-home__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.noticias-home__card:hover .noticias-home__img {
  transform: scale(1.05);
}

/* Body */
.noticias-home__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-m);
}

/* Category badge */
.noticias-home__cat {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

/* Title — 2-line clamp */
.noticias-home__title {
  font-size: var(--text-l);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Excerpt — 2-line clamp */
.noticias-home__excerpt {
  font-size: var(--text-s);
  color: var(--color-foreground-light);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Date */
.noticias-home__date {
  font-size: var(--text-xs);
  color: var(--color-foreground-light);
  margin-top: auto;
}

/* Footer — centered link */
.noticias-home__footer {
  text-align: center;
  margin-top: var(--space-xl);
}

.noticias-home__more {
  display: inline-block;
  color: var(--color-primary);
  font-size: var(--text-l);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-base);
}

.noticias-home__more:hover {
  color: var(--color-primary-dark);
}
