/*
Theme Name:   EIS Elementor
Theme URI:    https://enteitaliasport.it
Description:  Child theme di Hello Elementor per Ente Italia Sport. Layout costruito con Elementor + Pro Elements (Flexbox Container).
Author:       Ente Italia Sport
Author URI:   https://enteitaliasport.it
Template:     hello-elementor
Version:      0.4.2
Text Domain:  eis-elementor
*/

:root {
  --eis-gold: #F0B000;
  --eis-ink: #102030;
  --eis-paper: #ffffff;
}

/* ============================================================
   Base / reset utili
   ============================================================ */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }

/* Logo nell'header (Hello Elementor lo mostra full-width di default). */
.site-header .site-branding img.custom-logo,
header .site-logo img,
.site-logo img,
img.custom-logo {
  max-height: 80px;
  width: auto;
  height: auto;
}

/* ============================================================
   HEADER STICKY + FULL-WIDTH (Theme Builder header su Container)
   Il container "boxed" rende già il bg full-bleed con il contenuto
   centrato a --content-width; qui aggiungo solo sticky + ombra.
   ============================================================ */
[data-elementor-type="header"] {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  width: 100%;
}
[data-elementor-type="header"] > .e-con {
  width: 100% !important;
  max-width: 100% !important;
  box-shadow: 0 2px 12px rgba(16, 32, 48, 0.06);
}
/* Il contenuto del nav resta centrato a 1320 */
[data-elementor-type="header"] > .e-con > .e-con-inner {
  max-width: 1320px;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ============================================================
   COLONNE (container figli): distribuzione per rapporto.
   flex-grow = rapporto (emesso da Elementor) + flex-basis 0 (qui, perché
   Elementor scarta lo 0). Così N colonne con somma 100 stanno su una riga,
   il gap viene sottratto prima della distribuzione: niente wrap a 33%×3.
   ============================================================ */
.eis-col { flex-basis: 0% !important; }

/* ============================================================
   NAV — desktop: logo sx · menu dx · CTA dx
   ============================================================ */
.eis-nav > .e-con-inner {
  align-items: center !important;
  flex-wrap: nowrap !important;
}

/* Solo desktop (≥1025px): menu orizzontale, niente burger */
@media (min-width: 1025px) {
  .eis-nav .elementor-widget-nav-menu .elementor-nav-menu--main {
    display: flex !important;
    justify-content: flex-end;
  }
  .eis-nav .elementor-menu-toggle {
    display: none !important;
  }
}

/* Logo desktop: leggibile a 72px di altezza */
.eis-nav .elementor-widget-image img {
  max-height: 72px !important;
  width: auto !important;
  object-fit: contain;
}

/* ============================================================
   HERO — foto reale a destra in cornice con accento giallo
   La colonna .eis-hero-photo È ora il container (.e-con): bg/padding
   e l'accento ::before stanno direttamente su di essa.
   ============================================================ */
.eis-hero-photo {
  padding: 0 !important;
  position: relative;
}
/* Riquadro giallo offset dietro la foto (accento brand) */
.eis-hero-photo::before {
  content: "";
  position: absolute;
  top: 18px;
  right: -16px;
  width: 78%;
  height: 100%;
  background: var(--eis-gold);
  border-radius: 18px;
  z-index: 0;
}
.eis-hero-photo .eis-hero-image,
.eis-hero-photo .elementor-widget-image {
  position: relative;
  z-index: 1;
  width: 100%;
}
.eis-hero-photo .eis-hero-image img,
.eis-hero-photo .elementor-widget-image img {
  border-radius: 18px;
  width: 100%;
  object-fit: cover;
  box-shadow: 0 18px 44px rgba(16, 32, 48, 0.26);
}

/* ============================================================
   HERO/CTA — riga di bottoni affiancati (hero + cta finale)
   Gli inner-container .eis-hero-cta / .eis-cta-row sono già flex:
   forzo row+wrap e larghezza auto sui figli .eis-cta-col.
   ============================================================ */
.eis-hero-cta,
.eis-cta-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 16px !important;
  justify-content: flex-start !important;
  align-items: center !important;
}
.eis-hero-cta > .eis-cta-col,
.eis-cta-row > .eis-cta-col {
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
}
.eis-hero-cta .elementor-widget-button .elementor-button,
.eis-cta-row .elementor-widget-button .elementor-button {
  white-space: nowrap;
}
/* CTA finale (su sfondo navy) centrata */
.eis-cta-final .eis-hero-cta {
  justify-content: center !important;
}

/* ============================================================
   COURSE CARDS — foto reale + overlay navy + testo bianco
   La card È il container .eis-course-card: foto di sfondo (impostata
   dal seeder), overlay ::before, contenuto in basso, z-index sopra.
   Lo stacco tra le card è dato dal gap del container padre.
   ============================================================ */
.eis-course-card {
  position: relative;
  min-height: 340px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(16, 32, 48, 0.16);
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  transition: transform .35s ease, box-shadow .35s ease;
}
/* Overlay navy sopra la foto, sotto il contenuto */
.eis-course-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    180deg,
    rgba(16, 32, 48, 0.78) 0%,
    rgba(16, 32, 48, 0.74) 45%,
    rgba(16, 32, 48, 0.82) 75%,
    rgba(16, 32, 48, 0.92) 100%
  );
  transition: background .35s ease;
  pointer-events: none;
}
/* I widget (titolo, testo, bottone) sopra l'overlay */
.eis-course-card > .elementor-widget,
.eis-course-card > .elementor-element,
.eis-course-card > .e-con {
  position: relative;
  z-index: 1;
}
.eis-course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 42px rgba(16, 32, 48, 0.28);
}
.eis-course-card:hover::before {
  background: linear-gradient(
    180deg,
    rgba(16, 32, 48, 0.84) 0%,
    rgba(16, 32, 48, 0.80) 45%,
    rgba(16, 32, 48, 0.86) 75%,
    rgba(16, 32, 48, 0.94) 100%
  );
}
/* Testo card: bianco pieno + ombra marcata per massima leggibilità sulla foto */
.eis-course-card .elementor-heading-title,
.eis-course-card .elementor-widget-text-editor,
.eis-course-card .elementor-widget-text-editor p {
  color: #ffffff !important;
  text-shadow: 0 1px 10px rgba(16, 32, 48, 0.75);
}

/* ============================================================
   WHATSAPP BUTTON — verde brand
   ============================================================ */
.eis-wa-btn .elementor-button {
  background-color: #25D366 !important;
  color: #ffffff !important;
  transition: background-color .25s ease, transform .25s ease;
}
.eis-wa-btn .elementor-button:hover,
.eis-wa-btn .elementor-button:focus {
  background-color: #1DA851 !important;
  transform: translateY(-2px);
}
.eis-wa-btn .elementor-button .elementor-button-icon {
  font-size: 1.05em;
}

/* ============================================================
   TABLET + MOBILE (≤ 1024px): menu nascosto, burger attivo,
   hero impilato (testo sopra, foto sotto)
   ============================================================ */
@media (max-width: 1024px) {
  [data-elementor-type="header"] > .e-con {
    padding: 12px 20px !important;
  }
  .eis-nav .elementor-widget-image img {
    max-height: 56px !important;
  }
  .eis-nav .elementor-widget-button .elementor-button {
    padding: 10px 18px !important;
    font-size: 12px !important;
    letter-spacing: 1px !important;
  }
  /* Sotto 1025px: solo burger, niente menu desktop inline */
  .eis-nav .elementor-nav-menu--main {
    display: none !important;
  }
  .eis-nav .elementor-menu-toggle {
    display: inline-flex !important;
    margin: 0 0 0 auto !important;
    font-size: 22px !important;
  }
  /* Hero: le due colonne (testo/foto) si impilano */
  .eis-hero > .e-con-inner > .e-con {
    flex-basis: 100% !important;
    flex-grow: 1 !important;
    max-width: 100% !important;
  }
}

/* ============================================================
   MOBILE (≤ 767px)
   ============================================================ */
@media (max-width: 767px) {

  /* --- OVERFLOW CONTROL --- */
  html, body { overflow-x: hidden !important; max-width: 100vw !important; }
  .e-con,
  .e-con-inner,
  .elementor-widget,
  .elementor-widget-container,
  .elementor-element {
    min-width: 0 !important;
  }

  /* Bottoni: possono andare a capo se troppo larghi */
  .elementor-button {
    max-width: 100% !important;
    white-space: normal !important;
    word-break: keep-all;
  }

  /* --- STACKING: tutte le colonne di contenuto a tutta larghezza --- */
  /* (escluso il nav, gestito a parte; esclusi i bottoni CTA, gestiti dopo) */
  .e-con:not(.eis-nav) > .e-con-inner > .e-con,
  .e-con-full > .e-con {
    flex-basis: 100% !important;
    flex-grow: 1 !important;
    max-width: 100% !important;
  }
  /* Widget capati al container */
  .elementor-widget,
  .elementor-widget-container,
  .elementor-widget-button,
  .elementor-widget-text-editor,
  .elementor-widget-heading {
    max-width: 100% !important;
  }

  /* ---- HEADER mobile: logo + burger only ---- */
  [data-elementor-type="header"] > .e-con {
    padding: 10px 16px !important;
  }
  .eis-nav { position: relative !important; }
  .eis-nav > .e-con-inner {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px;
    position: static !important;
  }
  .eis-nav > .e-con-inner > .e-con {
    flex: 0 0 auto !important;
    width: auto !important;
    position: static !important;
  }
  .eis-nav .elementor-widget-image img {
    max-height: 44px !important;
  }
  .eis-nav .elementor-widget-nav-menu {
    text-align: right;
    position: static !important;
  }
  .eis-nav .elementor-menu-toggle {
    color: var(--eis-ink) !important;
    padding: 8px !important;
  }
  /* Dropdown: full-width sotto la nav, ancorato alla section */
  .eis-nav .elementor-nav-menu--dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    background: #fff !important;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 8px 16px rgba(16,32,48,0.08);
    margin: 0 !important;
  }
  .eis-nav .elementor-nav-menu--dropdown ul,
  .eis-nav .elementor-nav-menu--dropdown .elementor-nav-menu {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .eis-nav .elementor-nav-menu--dropdown .elementor-item {
    padding: 14px 24px !important;
    font-size: 15px !important;
    border-bottom: 1px solid #f1f5f9;
    color: var(--eis-ink) !important;
    width: 100% !important;
    display: block !important;
    text-align: left !important;
  }
  /* Nascondi la CTA "Richiedi informazioni" su mobile (c'è già nell'hero) */
  .eis-nav > .e-con-inner > .e-con:last-child {
    display: none !important;
  }

  /* ---- TIPOGRAFIA mobile ---- */
  body.elementor-page .elementor-widget.elementor-widget-heading h1.elementor-heading-title {
    font-size: 26px !important;
    line-height: 1.2 !important;
    letter-spacing: -0.3px !important;
    overflow-wrap: break-word;
  }
  body.elementor-page .elementor-widget.elementor-widget-heading h2.elementor-heading-title {
    font-size: 22px !important;
    line-height: 1.25 !important;
    letter-spacing: -0.3px !important;
    overflow-wrap: break-word;
  }
  .elementor-page .elementor-widget-heading h3.elementor-heading-title { font-size: 22px !important; }
  .elementor-page .elementor-widget-heading h4.elementor-heading-title { font-size: 18px !important; }
  .elementor-page .elementor-widget-text-editor { font-size: 15px !important; }
  .elementor-page .elementor-widget-text-editor p {
    font-size: 15px !important;
    line-height: 1.7 !important;
    overflow-wrap: break-word;
  }
  .elementor-page .elementor-widget-counter .elementor-counter-number,
  #numeri .elementor-counter-number { font-size: 56px !important; }

  /* ---- HERO mobile: foto sotto al testo ---- */
  .eis-hero-photo { margin-top: 28px; }
  .eis-hero-photo::before {
    top: 12px;
    right: -8px;
    width: 70%;
  }
  .eis-hero-photo .elementor-widget-image img { border-radius: 14px; }

  /* CTA hero + finale: bottoni impilati a tutta larghezza */
  .eis-hero-cta,
  .eis-cta-row {
    gap: 12px !important;
    flex-direction: column !important;
    /* nowrap obbligatorio: column + wrap, con altezza vincolata, riversa i
       bottoni in colonne affiancate a destra (overflow orizzontale). */
    flex-wrap: nowrap !important;
    align-items: stretch !important;
  }
  .eis-hero-cta > .eis-cta-col,
  .eis-cta-row > .eis-cta-col {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
  .eis-hero-cta .elementor-widget-button .elementor-button,
  .eis-cta-row .elementor-widget-button .elementor-button {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 14px 20px !important;
    font-size: 13px !important;
    white-space: normal !important;
  }

  /* ---- Course cards mobile: altezza ridotta ---- */
  .eis-course-card { min-height: 280px; }

  /* ---- Cards con padding generoso: ridotto su mobile ---- */
  .eis-svc-card { padding: 32px 24px !important; }
  .eis-contact-box > .e-con { padding: 32px 24px !important; }

  /* Contatti box navy: niente bordo destro quando stacka, divisore in basso */
  .eis-contact-box > .e-con {
    border-right-width: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  }
  .eis-contact-box > .e-con:last-child {
    border-bottom: 0 !important;
  }

  /* Icon-list: rispettare lo spazio */
  .elementor-widget-icon-list .elementor-icon-list-item { flex-wrap: wrap; }
  .elementor-widget-icon-list .elementor-icon-list-text { word-break: break-word; }
}

/* ============================================================
   MOBILE STRETTO (≤ 480px) — solo riduzioni ulteriori
   ============================================================ */
@media (max-width: 480px) {
  .eis-nav .elementor-widget-image img { max-height: 40px !important; }
  [data-elementor-type="header"] > .e-con { padding: 8px 12px !important; }
  body.elementor-page .elementor-widget.elementor-widget-heading h1.elementor-heading-title { font-size: 24px !important; }
  body.elementor-page .elementor-widget.elementor-widget-heading h2.elementor-heading-title { font-size: 20px !important; }
  body.elementor-page .elementor-widget-counter .elementor-counter-number { font-size: 48px !important; }
}
