/* ============================================================
   IMR — Mega Menu (header Elementor #42)
   Pannello full-width in stile arisitende.com, adattato al brand:
   lista voci con thumbnail (foto render o icona) + card categoria
   fotografica a destra. Costruito da assets/megamenu.js.
   Caricato site-wide. Desktop only (>=1025px); il menu mobile resta nativo.
   Palette: mattone #CE6161 / deep #A23B2E, carta #F6F2EA, nero caldo #16130F.
   ============================================================ */

/* ---- CARET voci di primo livello: ruota all'apertura ---- */
header.elementor-location-header .elementor-nav-menu > li > a .sub-arrow svg{
  transition:transform .25s ease;
  width:.7em;height:.7em;
}
header.elementor-location-header .elementor-nav-menu > li:hover > a .sub-arrow svg,
header.elementor-location-header .elementor-nav-menu > li.imr-mega-open > a .sub-arrow svg{
  transform:rotate(180deg);
}

/* ---- Rifinitura tipografica voci L1 (accento solo su header chiaro) ---- */
header.elementor-location-header .elementor-nav-menu > li > a.elementor-item{
  letter-spacing:.09em;
  text-transform:uppercase;
  font-weight:600;
  transition:color .18s ease;
}
header.elementor-location-header .elementor-nav-menu > li:hover > a.elementor-item{
  color:#CE6161;
}

/* l'header deve essere positioned per ancorare il pannello full-width */
header.elementor-location-header{ position:relative; }

/* ============================================================
   MEGA PANEL — solo desktop
   ============================================================ */
@media (min-width:1025px){

  /* quando il mega è attivo, nascondi i dropdown nativi Elementor */
  html.imr-mega-on header.elementor-location-header ul.sub-menu{
    display:none !important;
  }

  .imr-mega{
    position:absolute; left:0; right:0; top:100%;
    background:#fff;
    border-top:3px solid #CE6161;
    box-shadow:0 26px 54px rgba(20,18,15,.15);
    display:none; z-index:970;
  }
  .imr-mega.is-open{ display:block; }
  .imr-mega__panel{ display:none; }

  .imr-mega__grid2{
    max-width:1500px; margin:0 auto;
    padding:28px clamp(18px,4vw,70px);
    display:grid; grid-template-columns:1fr 380px; gap:40px; align-items:stretch;
  }

  /* --- lista voci (sinistra) --- */
  .imr-mega__list{
    display:grid; grid-template-columns:repeat(3,1fr);
    gap:4px 14px; align-content:start;
  }
  .imr-mega__item{
    display:flex; align-items:center; gap:13px;
    padding:9px 12px;
    color:#2b2823; text-decoration:none;
    border-radius:2px;
    transition:background .15s ease, color .15s ease;
  }
  .imr-mega__item:hover{ background:#F6F2EA; color:#A23B2E; }

  /* thumbnail foto */
  .imr-mega__thumb{
    width:56px; height:44px; flex:0 0 56px;
    background-size:cover; background-position:center;
    box-shadow:0 2px 8px rgba(20,18,15,.14);
    transition:transform .25s ease;
  }
  .imr-mega__item:hover .imr-mega__thumb{ transform:scale(1.06); }

  /* thumbnail icona (servizi / voci senza render) */
  .imr-mega__thumb.is-icon{
    display:flex; align-items:center; justify-content:center;
    background:#F6F2EA; box-shadow:none;
    color:#CE6161;
  }
  .imr-mega__item:hover .imr-mega__thumb.is-icon{
    background:#CE6161; color:#fff; transform:none;
  }
  .imr-mega__thumb.is-icon svg{ width:24px; height:24px; }

  .imr-mega__t{
    font-family:"Archivo",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    font-weight:500; font-size:.92rem; line-height:1.2;
  }

  /* --- card categoria fotografica (destra) --- */
  .imr-mega__feat{
    position:relative; display:block; min-height:264px;
    background-size:cover; background-position:center;
    overflow:hidden; text-decoration:none;
  }
  .imr-mega__feat-ov{
    position:absolute; inset:0;
    background:linear-gradient(0deg, rgba(20,16,12,.88) 0%, rgba(20,16,12,.12) 70%);
    transition:background .3s ease;
  }
  .imr-mega__feat:hover .imr-mega__feat-ov{
    background:linear-gradient(0deg, rgba(162,59,46,.92) 0%, rgba(20,16,12,.2) 75%);
  }
  .imr-mega__feat-c{ position:absolute; left:0; right:0; bottom:0; padding:26px; color:#fff; }
  .imr-mega__feat-c .e{
    display:block; color:#EBB3AB; /* mattone chiaro su overlay scuro */
    font-family:"Archivo Expanded","Archivo",sans-serif;
    font-weight:700; letter-spacing:.22em; text-transform:uppercase; font-size:.72rem;
  }
  .imr-mega__feat:hover .imr-mega__feat-c .e{ color:#fff; }
  .imr-mega__feat-c .t{
    display:block;
    font-family:"Archivo Expanded","Archivo",sans-serif;
    font-weight:800; font-size:1.5rem; line-height:1.06; margin:6px 0 12px;
  }
  .imr-mega__feat-c .cta{
    display:inline-block;
    font-family:"Archivo",sans-serif; font-weight:600; font-size:.85rem;
    border-bottom:1px solid rgba(255,255,255,.5); padding-bottom:2px;
  }
}

/* ============================================================
   FALLBACK (no-JS o desktop<1025): dropdown nativo ripulito
   in stile arisi (se megamenu.js non costruisce il pannello).
   ============================================================ */
@media (min-width:1025px){
  html:not(.imr-mega-on) header.elementor-location-header ul.sub-menu.elementor-nav-menu--dropdown{
    background:#fff !important;
    box-shadow:0 24px 60px rgba(20,18,15,.16) !important;
    border:0 !important; border-top:3px solid #CE6161 !important;
    border-radius:0 !important; padding:14px 0 !important; min-width:300px !important;
  }
  html:not(.imr-mega-on) header.elementor-location-header ul.sub-menu .elementor-sub-item{
    font-family:"Archivo",sans-serif !important; font-weight:500 !important;
    font-size:.92rem !important; color:#4B4740 !important; padding:10px 28px !important;
    text-transform:none !important; letter-spacing:0 !important;
    transition:color .15s, background .15s, padding .2s !important;
  }
  html:not(.imr-mega-on) header.elementor-location-header ul.sub-menu .elementor-sub-item:hover{
    color:#CE6161 !important; background:#F6F2EA !important; padding-left:34px !important;
  }
}
