/*
 Theme Name:   Jafet Child
 Theme URI:    https://jafet.fivegroupsrl.com/
 Description:  Child theme Divi per Jafet srl — Grafica, stampa e personalizzazione
 Author:       Jafet srl
 Author URI:   https://jafet.fivegroupsrl.com/
 Template:     Divi
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 Text Domain:  jafet-child
*/

/*
 * NOTA FONT:
 * Il @import di Adobe Fonts (Typekit vzl2kgv) NON va messo qui
 * perché in Divi non funziona da style.css.
 * Va tenuto in DUE posti:
 *   1. Divi > Opzioni Tema > CSS personalizzato  (per il Divi Builder)
 *   2. functions.php > wp_enqueue_style          (per il front-end — già fatto)
 */

/* ==========================================================
   1. VARIABILI GLOBALI
   ========================================================== */
:root {
  --navy-950:     #101d34;
  --navy-900:     #14233f;
  --navy-800:     #1a2a47;
  --navy-700:     #213357;
  --navy-600:     #2b3d63;
  --orange:       #ea5d1b;
  --orange-bright:#f46e26;
  --cream:        #f2eee6;
  --white:        #ffffff;
  --muted:        #9fabc2;
  --ring:         rgba(234,93,27,.55);
  --maxw:         1240px;
  --head-h:       88px;
}

/* ==========================================================
   2. RESET & BASE
   ========================================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html { scroll-behavior: smooth; }
body {
  background: var(--navy-800);
  color: var(--cream);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Texture grain sottile */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height%3D'100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================
   3. LAYOUT
   ========================================================== */
.jafet-wrap,
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 2;
}

/* ==========================================================
   4. UTILITY
   ========================================================== */
.disp { font-weight: 900; text-transform: uppercase; }
.ital { font-style: italic; }
.o    { color: var(--orange); }

/* ==========================================================
   5. COMPONENTI
   ========================================================== */

/* ── Bottone ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  text-decoration: none;
  color: #fff;
  background: var(--orange);
  padding: .95em 1.6em;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), background .25s, box-shadow .25s;
}
.btn:hover {
  background: var(--orange-bright);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -12px var(--orange);
}
.btn .arrow {
  display: grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: .85em;
}
.btn-ghost {
  background: transparent;
  border: 2px solid var(--orange);
  color: var(--orange);
}
.btn-ghost:hover { background: var(--orange); color: #fff; }

/* ── Eyebrow ── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--orange); }

/* ── Marquee ── */
.jafet-marquee {
  overflow: hidden;
  background: var(--orange);
  padding: 18px 0;
  white-space: nowrap;
}
.jafet-marquee .track {
  display: inline-flex;
  animation: jafet-scroll 26s linear infinite;
  will-change: transform;
}
.jafet-marquee span {
  font-size: clamp(1.25rem,2vw,1.45rem);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  padding: 0 1.2rem;
  color: #fff;
}
.jafet-marquee .dot { opacity: .6; }
@keyframes jafet-scroll { to { transform: translateX(-50%); } }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .1s; }
.reveal[data-d="2"] { transition-delay: .2s; }
.reveal[data-d="3"] { transition-delay: .3s; }
.reveal[data-d="4"] { transition-delay: .4s; }
.reveal[data-d="5"] { transition-delay: .5s; }

/* ==========================================================
   6. HEADER PERSONALIZZATO JAFET
   Sovrascrive l'header di Divi tramite header.php nel child theme.
   ========================================================== */
#main-header.jafet-header {
  position: sticky;
  top: 0;
  z-index: 100002;
  background: #0c2340;
  height: var(--head-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 24px rgba(0,0,0,.3);
}

/* Nasconde tutto ciò che Divi potrebbe iniettare nell'header */
#main-header .et-menu-nav,
#main-header #et-top-navigation,
#main-header .mobile_menu_bar,
#main-header #et_search_icon,
#main-header .et_close_search_field {
  display: none !important;
}

.jafet-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 60px;
}

.jafet-logo { display: block; text-decoration: none; line-height: 1; }
.jafet-logo img { height: 52px; width: auto; display: block; }
.jafet-logo-text {
  font-size: 1.9rem;
  font-weight: 700;
  font-style: italic;
  color: #fff;
  letter-spacing: -.02em;
}

/* ==========================================================
   7. SEZIONI DI PAGINA COMUNI
   ========================================================== */

/* ── Hero base ── */
.jafet-hero {
  position: relative;
  padding: 80px 0 64px;
  overflow: hidden;
}
.jafet-hero::before {
  content: "";
  position: absolute;
  top: -140px; right: -120px;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(234,93,27,.22), transparent 62%);
}
.hero-anim-rise { display: block; overflow: hidden; }
.hero-anim-rise > span {
  display: block;
  transform: translateY(110%);
  animation: rise .9s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes rise { to { transform: translateY(0); } }
@keyframes fade-in { to { opacity: 1; } }

/* ── CTA + Form sezione ── */
.jafet-cta {
  padding: 90px 0;
  background: var(--cream);
  color: var(--navy-900);
}
.jafet-cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.jafet-cta h2 { color: var(--navy-900); font-size: clamp(1.9rem,3.6vw,2.9rem); }
.jafet-cta .lead { margin-top: 1rem; color: #41506b; font-size: 1.05rem; max-width: 26em; }
.jafet-cta .contacts { margin-top: 32px; display: grid; gap: 16px; }
.jafet-cta .ci { display: flex; gap: 14px; align-items: flex-start; }
.jafet-cta .ci .ic {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: var(--orange); display: grid; place-items: center; color: #fff;
}
.jafet-cta .ci .ic svg { width: 18px; height: 18px; }
.jafet-cta .ci b { display: block; font-weight: 800; font-size: .95rem; }
.jafet-cta .ci span { color: #5a6478; font-size: .92rem; }

/* Form bianco */
.jafet-form {
  background: #fff;
  border-radius: 22px;
  padding: 34px;
  box-shadow: 0 30px 70px -40px rgba(20,35,63,.4);
}
.jafet-field { margin-bottom: 18px; }
.jafet-field label {
  display: block;
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--navy-800);
  margin-bottom: .5rem;
}
.jafet-field input,
.jafet-field select {
  width: 100%;
  padding: .85em 1em;
  border: 1.5px solid #d9d2c4;
  border-radius: 12px;
  background: #fbf9f5;
  font-size: .95rem;
  color: var(--navy-900);
  transition: border-color .2s, box-shadow .2s;
}
.jafet-field input:focus,
.jafet-field select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(234,93,27,.12);
}
.jafet-radios { display: flex; gap: 10px; flex-wrap: wrap; }
.jafet-radios label {
  flex: 1; min-width: 90px; text-align: center;
  border: 1.5px solid #d9d2c4; border-radius: 12px; padding: .7em;
  cursor: pointer; font-weight: 600; font-size: .85rem;
  color: var(--navy-800); transition: .2s;
}
.jafet-radios input { display: none; }
.jafet-radios label:has(input:checked) {
  border-color: var(--orange);
  background: rgba(234,93,27,.07);
  color: var(--orange);
}
.form-note { font-size: .85rem; color: #5a6478; margin: .4rem 0 1.2rem; }

/* ==========================================================
   8. FOOTER  (usato nel modulo codice Divi)
   ========================================================== */
.jafet-footer {
  background: var(--navy-950);
  padding: 72px 0 36px;
  color: #fff;
  font-size: 1.08rem;
}
.et_pb_section:has(.jafet-footer),
.et_pb_row:has(.jafet-footer),
.et_pb_column:has(.jafet-footer),
.et_pb_code:has(.jafet-footer),
.et_pb_code_inner:has(.jafet-footer) {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: none !important;
}
.jafet-footer .inner { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.jafet-foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 42px;
}
.et_pb_module .jafet-footer h5,
.jafet-footer h5 {
  font-weight: 800;
  font-size: 2.15rem !important;
  line-height: 1;
  color: var(--orange) !important;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.jafet-footer p,
.jafet-footer a { color: #fff; font-size: 1.08rem; text-decoration: none; line-height: 1.85; }
.jafet-footer a:hover { color: var(--orange); }
.jafet-foot-logo .name { font-weight: 900; font-style: italic; font-size: 1.7rem; color: #fff; }
.jafet-foot-logo p { margin-top: .8rem; max-width: 24em; }
.jafet-foot-brand .foot-logo { display: block; margin-bottom: 1.25rem; }
.jafet-foot-brand .foot-logo img { height: 120px; width: auto; display: block; }
.jafet-foot-social { display: flex; gap: .7rem; margin-top: 1.2rem; }
.jafet-foot-social a {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--navy-700); display: grid; place-items: center; transition: .25s;
}
.jafet-foot-social a:hover { background: var(--orange); transform: translateY(-2px); }
.jafet-foot-social svg { width: 22px; height: 22px; color: var(--cream); }
.jafet-foot-bottom {
  margin-top: 44px; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 10px; font-size: .95rem; color: #fff;
}

@media (max-width: 980px) {
  .jafet-foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .jafet-footer { text-align: center; padding: 56px 0 30px; }
  .jafet-footer .inner { padding: 0 20px; }
  .jafet-foot-grid { grid-template-columns: 1fr; gap: 34px; }
  .et_pb_module .jafet-footer h5,
  .jafet-footer h5 { font-size: 2.3rem !important; }
  .jafet-foot-brand .foot-logo img { height: 104px; margin: 0 auto; }
  .jafet-foot-social { justify-content: center; }
  .jafet-foot-bottom { justify-content: center; text-align: center; }
}

/* ==========================================================
   9. DIVI OVERRIDES
   Rimuove padding/margin automatici di Divi dove necessario.
   Aggiungere la classe CSS "jafet-no-pad" o "jafet-full"
   alle sezioni/righe Divi per applicarle.
   ========================================================== */
.et_pb_section.jafet-no-pad { padding: 0 !important; }
.et_pb_row.jafet-full       { max-width: 100% !important; padding: 0 !important; }
.et_pb_code_inner            { padding: 0; }

/* Evita che Divi aggiunga uno spazio sopra la prima sezione */
.et_pb_section.et_section_regular:first-of-type {
  padding-top: 0;
}

/* ==========================================================
   10. RESPONSIVE
   ========================================================== */
@media (max-width: 980px) {
  .jafet-header-inner       { padding: 0 28px; }
  .jafet-cta-grid           { grid-template-columns: 1fr; gap: 40px; }
  .jafet-foot-grid          { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .jafet-header-inner       { padding: 0 20px; }
  .jafet-logo img           { height: 62px; }
  .custom-menu-trigger      { font-size: 23px !important; gap: 9px; }
  .custom-menu-trigger .menu-icon { font-size: 34px !important; }
  .jafet-wrap, .wrap        { padding: 0 20px; }
  .jafet-foot-grid,
  .jafet-radios             { grid-template-columns: 1fr; }
}
