/* ============================================================
   Haizebegi Hero Banner Widget
   Inspired by haizebegi.eu — Art · Science · Société
   ============================================================ */

/* ------ Root Layout ------ */
.hzb-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

/* ------ Height variants ------ */
.hzb-hero--h-full   { min-height: 100vh; }
.hzb-hero--h-large  { min-height: 85vh; }
.hzb-hero--h-medium { min-height: 65vh; }
.hzb-hero--h-small  { min-height: 45vh; }

/* ------ Background layer ------ */
.hzb-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hzb-hero__bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  transition: transform 8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hzb-hero:hover .hzb-hero__bg-image {
  transform: scale(1.04);
}

.hzb-hero__overlay {
  position: absolute;
  inset: 0;
}

/* ------ Watermark / Filigrane ------ */
.hzb-hero__watermark {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

/* Style 1: Mot géant centré */
.hzb-hero__watermark--word {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hzb-hero__watermark--word .hzb-hero__wm-text {
  font-family: halyard-display, "DM Sans", sans-serif;
  font-size: clamp(6rem, 22vw, 20rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
  opacity: 0.07;
  color: currentColor;
  text-transform: uppercase;
}

/* Style 2: Diagonal repeat */
.hzb-hero__watermark--diagonal {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  transform: rotate(-25deg) scale(1.5);
  transform-origin: center center;
}

.hzb-hero__watermark--diagonal .hzb-wm-rows {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
}

.hzb-hero__watermark--diagonal .hzb-wm-row {
  display: flex;
  gap: 2.5em;
  white-space: nowrap;
}

.hzb-hero__watermark--diagonal .hzb-wm-row span {
  font-family: halyard-display, "DM Sans", sans-serif;
  font-size: clamp(1.4rem, 3.5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.06;
  color: currentColor;
}

/* Style 3: Lignes horizontales */
.hzb-hero__watermark--lines {
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent calc(100% / 12 - 1px),
    currentColor calc(100% / 12 - 1px),
    currentColor calc(100% / 12)
  );
  opacity: 0.06;
}

/* Style 4: Points */
.hzb-hero__watermark--dots {
  background-image: radial-gradient(currentColor 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  opacity: 0.1;
}

/* Style 5: Grille */
.hzb-hero__watermark--grid {
  background-image:
    linear-gradient(currentColor 1px, transparent 1px),
    linear-gradient(90deg, currentColor 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.06;
}

/* Style 6: Marquee horizontal */
.hzb-hero__watermark--marquee {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hzb-wm-marquee-track {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  animation: hzb-marquee-wm 30s linear infinite;
}

.hzb-wm-marquee-track span {
  font-family: halyard-display, "DM Sans", sans-serif;
  font-size: clamp(4rem, 14vw, 11rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  opacity: 0.07;
  color: currentColor;
  flex-shrink: 0;
}

@keyframes hzb-marquee-wm {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ------ Inner content wrapper ------ */
.hzb-hero__inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 8rem) clamp(1.5rem, 4vw, 4rem);
  box-sizing: border-box;
}

/* Content horizontal alignment */
.hzb-hero--align-left   .hzb-hero__inner { align-items: flex-start; }
.hzb-hero--align-center .hzb-hero__inner { align-items: center; text-align: center; }
.hzb-hero--align-right  .hzb-hero__inner { align-items: flex-end; text-align: right; }

/* Vertical alignment */
.hzb-hero--valign-top    { justify-content: flex-start; }
.hzb-hero--valign-middle { justify-content: center; }
.hzb-hero--valign-bottom { justify-content: flex-end; }

/* ------ Eyebrow / Surtitre ------ */
.hzb-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: "DM Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
  opacity: 0.75;
}

.hzb-hero__eyebrow::before,
.hzb-hero__eyebrow::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

/* ------ Titre principal ------ */
.hzb-hero__title {
  font-family: halyard-display, sans-serif;
  font-size: clamp(2.8rem, 7.5vw, 7rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0 0 0.35em;
  max-width: 14ch;
}

.hzb-hero--align-center .hzb-hero__title { max-width: 18ch; }
.hzb-hero--align-right  .hzb-hero__title { max-width: 14ch; }

/* ------ Sous-titre ------ */
.hzb-hero__subtitle {
  font-family: halyard-display, sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.7rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin: 0 0 2rem;
  opacity: 0.8;
  max-width: 28ch;
}

.hzb-hero--align-center .hzb-hero__subtitle { max-width: 40ch; }

/* ------ Description ------ */
.hzb-hero__description {
  font-family: "DM Sans", sans-serif;
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  line-height: 1.72;
  margin: 0 0 2.5rem;
  opacity: 0.75;
  max-width: 50ch;
}

/* ------ Actions / Boutons ------ */
.hzb-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 0.5rem;
}

.hzb-hero--align-center .hzb-hero__actions { justify-content: center; }
.hzb-hero--align-right  .hzb-hero__actions { justify-content: flex-end; }

/* Bouton principal */
.hzb-hero__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65em;
  padding: 0.9rem 2.4rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1.5px solid currentColor;
  background: transparent;
  cursor: pointer;
  color: inherit;
  transition:
    background 0.28s ease,
    color 0.28s ease,
    border-color 0.28s ease,
    transform 0.22s ease,
    box-shadow 0.28s ease;
}

.hzb-hero__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Variante: rempli */
.hzb-hero__btn--filled {
  background: currentColor;
}

.hzb-hero__btn--filled .hzb-btn-label {
  color: #fff;
  mix-blend-mode: difference;
}

/* Variante: accent rouge */
.hzb-hero__btn--accent {
  border-color: #f14849;
  color: #f14849;
}

.hzb-hero__btn--accent:hover {
  background: #f14849;
  color: #fff;
}

/* Variante: accent rempli */
.hzb-hero__btn--accent-filled {
  background: #f14849;
  border-color: #f14849;
  color: #fff;
}

.hzb-hero__btn--accent-filled:hover {
  background: #c8020c;
  border-color: #c8020c;
}

/* Flèche du bouton */
.hzb-btn-arrow {
  display: inline-block;
  transition: transform 0.28s ease;
}

.hzb-hero__btn:hover .hzb-btn-arrow {
  transform: translateX(5px);
}

/* ------ Bouton Scroll vers le bas ------ */
.hzb-hero__scroll-wrap {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hzb-hero__scroll-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hzb-hero__scroll-btn:hover {
  opacity: 0.6;
  transform: translateY(3px);
}

.hzb-scroll-label {
  font-family: "DM Sans", sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.65;
}

.hzb-scroll-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.hzb-scroll-icon svg {
  width: 18px;
  height: 18px;
  animation: hzb-bounce 2.2s ease-in-out infinite;
}

.hzb-scroll-line {
  width: 1px;
  height: 36px;
  background: currentColor;
  opacity: 0.4;
  animation: hzb-line-grow 2.2s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes hzb-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(7px); }
}

@keyframes hzb-line-grow {
  0%   { transform: scaleY(0); opacity: 0; transform-origin: top center; }
  50%  { transform: scaleY(1); opacity: 0.4; }
  100% { transform: scaleY(0); opacity: 0; transform-origin: bottom center; }
}

/* ------ Schéma de couleurs ------ */
/* On définit la couleur sur le conteneur ET explicitement sur chaque élément
   pour garantir la visibilité dans l'éditeur Elementor (canvas preview). */
.hzb-hero--scheme-light { color: #FFFFFF; }
.hzb-hero--scheme-dark  { color: #252324; }

/* Couleurs explicites scheme-light */
.hzb-hero--scheme-light .hzb-hero__eyebrow,
.hzb-hero--scheme-light .hzb-hero__title,
.hzb-hero--scheme-light .hzb-hero__subtitle,
.hzb-hero--scheme-light .hzb-hero__description,
.hzb-hero--scheme-light .hzb-hero__scroll-btn,
.hzb-hero--scheme-light .hzb-hero__btn {
  color: #FFFFFF;
}

/* Couleurs explicites scheme-dark */
.hzb-hero--scheme-dark .hzb-hero__eyebrow,
.hzb-hero--scheme-dark .hzb-hero__title,
.hzb-hero--scheme-dark .hzb-hero__subtitle,
.hzb-hero--scheme-dark .hzb-hero__description,
.hzb-hero--scheme-dark .hzb-hero__scroll-btn,
.hzb-hero--scheme-dark .hzb-hero__btn {
  color: #252324;
}

/* ------ Fallback visuel dans l'éditeur Elementor ------ */
/* Quand l'éditeur rend le widget avant que le fond soit défini,
   on garantit un contraste lisible via un fond de repli. */
.elementor-editor-active .hzb-hero--scheme-light,
.elementor-element .hzb-hero--scheme-light {
  background-color: #252324; /* fond sombre par défaut si aucun inline style */
}

.elementor-editor-active .hzb-hero--scheme-dark,
.elementor-element .hzb-hero--scheme-dark {
  background-color: #f5f4f2; /* fond clair par défaut */
}

/* L'inline style du widget surcharge ces règles CSS grâce à la spécificité */
/* => en pratique, le fond inline s'applique toujours sur le front et en preview */

/* ------ Animations d'entrée ------ */
.hzb-hero--animated .hzb-hero__eyebrow,
.hzb-hero--animated .hzb-hero__title,
.hzb-hero--animated .hzb-hero__subtitle,
.hzb-hero--animated .hzb-hero__description,
.hzb-hero--animated .hzb-hero__actions {
  opacity: 0;
  transform: translateY(28px);
}

.hzb-hero--animated.hzb-hero--visible .hzb-hero__eyebrow {
  animation: hzb-fade-up 0.8s cubic-bezier(0.25,0.46,0.45,0.94) 0.1s forwards;
}
.hzb-hero--animated.hzb-hero--visible .hzb-hero__title {
  animation: hzb-fade-up 0.9s cubic-bezier(0.25,0.46,0.45,0.94) 0.25s forwards;
}
.hzb-hero--animated.hzb-hero--visible .hzb-hero__subtitle {
  animation: hzb-fade-up 0.8s cubic-bezier(0.25,0.46,0.45,0.94) 0.4s forwards;
}
.hzb-hero--animated.hzb-hero--visible .hzb-hero__description {
  animation: hzb-fade-up 0.8s cubic-bezier(0.25,0.46,0.45,0.94) 0.52s forwards;
}
.hzb-hero--animated.hzb-hero--visible .hzb-hero__actions {
  animation: hzb-fade-up 0.8s cubic-bezier(0.25,0.46,0.45,0.94) 0.68s forwards;
}

@keyframes hzb-fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------ Responsive ------ */
@media (max-width: 768px) {
  .hzb-hero__title   { font-size: clamp(2.2rem, 9vw, 3.5rem); }
  .hzb-hero__subtitle { font-size: clamp(1rem, 4vw, 1.3rem); }

  .hzb-hero__actions { flex-direction: column; align-items: flex-start; }
  .hzb-hero--align-center .hzb-hero__actions { align-items: center; }
  .hzb-hero--align-right .hzb-hero__actions  { align-items: flex-start; }

  .hzb-hero__watermark--word .hzb-hero__wm-text {
    font-size: clamp(5rem, 30vw, 8rem);
  }
}

@media (max-width: 480px) {
  .hzb-hero__eyebrow::before,
  .hzb-hero__eyebrow::after { display: none; }
  .hzb-hero__scroll-wrap { bottom: 1.5rem; }
}
