/*
Theme Name:   Emmegi Child (Hello Elementor)
Theme URI:    https://emmegi.it
Description:  Tema child di Hello Elementor per Emmegi Food & Beverage. Aggiunge variabili colore, header e footer custom.
Author:       Emmegi S.r.l.
Author URI:   https://emmegi.it
Template:     hello-elementor
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  emmegi-child
*/

/*
 * Stili globali Emmegi
 * Le variabili colore vengono iniettate da functions.php
 * in base allo schema selezionato nel Customizer.
 */

/* =========================================
   FONT
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Lato:ital,wght@0,300;0,400;0,700;1,400&family=Roboto:wght@300;400;500;700&display=swap');

/* =========================================
   VARIABILI BASE (default Mediterraneo)
   sovrascritte da emmegi-child-functions.php
   ========================================= */
:root {
  --olive:        #3F4A2F;
  --olive-light:  #5a6843;
  --olive-dark:   #2d3520;
  --cream:        #F7F1E3;
  --cream-dark:   #EDE5CE;
  --bordeaux:     #7A2E2E;
  --bordeaux-dark:#5e2020;
  --gold:         #C99A3D;
  --gold-light:   #d4af6a;
  --anthracite:   #242424;
  --warm-white:   #FFFCF6;

  --font-serif:   'Playfair Display', Georgia, serif;
  --font-sans:    'Lato', 'Helvetica Neue', Arial, sans-serif;
}

/* =========================================
   GLOBAL
   ========================================= */
body {
  font-family: var(--font-sans);
  color: var(--anthracite);
  background: var(--warm-white);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--olive);
  font-weight: 600;
  line-height: 1.2;
}

a { color: var(--bordeaux); transition: color .3s ease; }
a:hover { color: var(--olive); }

/* =========================================
   HEADER EMMEGI
   ========================================= */
#emmegi-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  padding: 22px 0;
  background: var(--olive);
  transition: all .3s ease;
}

.admin-bar #emmegi-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar #emmegi-header { top: 46px; }
}

#emmegi-header.scrolled {
  padding: 14px 0;
  background: rgb(63,74,47);
  box-shadow: 0 2px 24px rgba(0,0,0,.18);
}

.emmegi-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Logo */
.emmegi-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
/* Logo immagine personalizzata nell'header */
.emmegi-logo img,
.emmegi-logo .custom-logo {
  height: 52px !important;
  width: auto !important;
  max-width: 180px !important;
  display: block;
}
.emmegi-logo .logo-mark {
  width: 44px; height: 44px;
  background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.3rem; font-weight: 700;
  color: var(--anthracite);
}
.emmegi-logo .logo-text { display: flex; flex-direction: column; line-height: 1; }
.emmegi-logo .logo-name {
  font-family: var(--font-serif);
  font-size: 1.15rem; font-weight: 700;
  color: var(--warm-white);
}
.emmegi-logo .logo-tagline {
  font-size: .68rem; font-weight: 400;
  color: rgba(255,252,246,.6);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* Nav */
.emmegi-nav { display: flex; align-items: center; gap: 4px; }
.emmegi-nav ul {
  display: flex; align-items: center; gap: 4px;
  list-style: none; padding: 0; margin: 0;
}
.emmegi-nav > ul > li { position: relative; }
.emmegi-nav > ul > li > a {
  display: block;
  padding: 10px 16px;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: rgba(255,252,246,.88);
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: all .25s ease;
}
.emmegi-nav > ul > li > a:hover,
.emmegi-nav > ul > li.current-menu-item > a,
.emmegi-nav > ul > li.current-menu-ancestor > a {
  color: var(--warm-white);
  background: rgba(255,252,246,.1);
}

/* Dropdown */
.emmegi-nav ul ul {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--olive-dark);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,.25);
  padding: 8px;
  flex-direction: column;
  gap: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all .25s ease;
}
.emmegi-nav ul li:hover > ul,
.emmegi-nav ul li:focus-within > ul {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.emmegi-nav ul ul li { width: 100%; }
.emmegi-nav ul ul a {
  display: block;
  padding: 10px 16px;
  font-size: .88rem; font-weight: 600;
  color: rgba(255,252,246,.82);
  border-radius: 6px;
  text-decoration: none;
}
.emmegi-nav ul ul a:hover {
  background: rgba(255,252,246,.1);
  color: var(--warm-white);
}

/* Dropdown arrow */
.emmegi-nav .menu-item-has-children > a::after {
  content: '▾';
  font-size: .7rem;
  margin-left: 5px;
  opacity: .7;
}

/* CTA Button */
.emmegi-nav .nav-cta > a {
  background: var(--gold) !important;
  color: var(--anthracite) !important;
  padding: 10px 20px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  margin-left: 8px;
}
.emmegi-nav .nav-cta > a:hover {
  background: var(--gold-light) !important;
  box-shadow: 0 4px 16px rgba(201,154,61,.4) !important;
  transform: translateY(-1px);
}

/* Mobile toggle */
.emmegi-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.emmegi-nav-toggle span {
  display: block;
  width: 26px; height: 2px;
  background: var(--warm-white);
  border-radius: 2px;
  transition: all .25s ease;
}


/* Quando il menu è aperto, il toggle (X) deve essere visibile sopra al menu */
body.menu-open .emmegi-nav-toggle {
  position: relative;
  z-index: 1001;
}

@media (max-width: 960px) {
  .emmegi-nav { display: none; }
  .emmegi-nav.open {
    display: block;
    position: fixed;
    top: 84px; left: 0; right: 0; bottom: 0;
    background: var(--olive-dark);
    padding: 20px;
    overflow-y: auto;
    z-index: 998;
  }
  .emmegi-nav.open ul { flex-direction: column; gap: 0; align-items: stretch; }
  .emmegi-nav.open > ul > li > a { padding: 14px 16px; font-size: 1rem; }
  .emmegi-nav.open ul ul {
    position: static;
    opacity: 1; visibility: visible;
    transform: none;
    box-shadow: none;
    background: rgba(255,252,246,.04);
    padding-left: 16px;
    margin-top: 4px;
  }
  .emmegi-nav-toggle { display: flex; }
}

/* Body offset for fixed header */
body { padding-top: 88px; }
.admin-bar body { padding-top: calc(88px + 32px); }

/* =========================================
   FOOTER EMMEGI
   ========================================= */
#emmegi-footer {
  background: var(--olive-dark);
  color: rgba(255,252,246,.75);
  padding: 72px 0 0;
  margin-top: 80px;
}

.emmegi-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.emmegi-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,252,246,.1);
}

@media (max-width: 1024px) {
  .emmegi-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 600px) {
  /* Mobile: Brand full width, poi 2 col per navigazione/categorie, contatti full width */
  .emmegi-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .emmegi-footer-brand {
    grid-column: 1 / -1; /* Brand occupa tutta la larghezza */
  }
  .emmegi-footer-col:last-child {
    grid-column: 1 / -1; /* Contatti occupa tutta la larghezza */
  }
  .emmegi-footer-brand p {
    font-size: .82rem;
    margin-bottom: 16px;
  }
  .emmegi-footer-col h5 {
    margin-bottom: 12px;
  }
  .emmegi-footer-col ul li {
    margin-bottom: 7px;
  }
}

.emmegi-footer-brand .logo-mark {
  width: 40px; height: 40px;
  background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.1rem; font-weight: 700;
  color: var(--anthracite);
  margin-bottom: 16px;
}
.footer-logo-link { display: inline-block; margin-bottom: 14px; }
.footer-logo-img {
  height: 60px;
  width: auto;
  display: block;
  filter: brightness(1.1);
}

.emmegi-footer-brand .brand-name {
  font-family: 'Roboto', sans-serif;
  font-size: 1.2rem; font-weight: 700;
  color: var(--warm-white);
  display: block;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.emmegi-footer-brand p {
  font-size: .88rem;
  line-height: 1.75;
  color: rgba(255,252,246,.6);
  margin: 0 0 24px 0;
}
.emmegi-footer-brand .socials { display: flex; gap: 10px; }
.emmegi-footer-brand .socials a {
  width: 38px; height: 38px;
  background: rgba(255,252,246,.08);
  border: 1px solid rgba(255,252,246,.12);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,252,246,.7);
  text-decoration: none;
  font-size: .9rem;
  transition: all .25s ease;
}
.emmegi-footer-brand .socials a:hover {
  background: var(--gold);
  color: var(--anthracite);
  border-color: var(--gold);
}

.emmegi-footer-col h5 {
  color: var(--warm-white);
  font-family: var(--font-sans);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(201,154,61,.3);
}
.emmegi-footer-col ul { list-style: none; padding: 0; margin: 0; }
.emmegi-footer-col ul li { margin-bottom: 10px; }
.emmegi-footer-col ul a {
  font-size: .88rem;
  color: rgba(255,252,246,.6);
  text-decoration: none;
  transition: all .25s ease;
}
.emmegi-footer-col ul a:hover { color: var(--gold); padding-left: 4px; }

.emmegi-footer-contact { display: flex; flex-direction: column; gap: 14px; }
.emmegi-footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .88rem;
  color: rgba(255,252,246,.6);
  line-height: 1.5;
}
.emmegi-footer-contact-item .ico { color: var(--gold); flex-shrink: 0; }
.emmegi-footer-contact-item a { color: inherit; text-decoration: none; }
.emmegi-footer-contact-item a:hover { color: var(--gold); }

.emmegi-footer-bottom {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: .8rem;
  color: rgba(255,252,246,.35);
}
.emmegi-footer-bottom .legal { display: flex; gap: 20px; }
.emmegi-footer-bottom a { color: rgba(255,252,246,.45); text-decoration: none; }
.emmegi-footer-bottom a:hover { color: var(--gold); }

@media (max-width: 600px) {
  .emmegi-footer-bottom { flex-direction: column; text-align: center; }
}



/* =========================================


   CATEGORIA GRID — Plugin Categorie Homepage
   ========================================= */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 1200px) {
  .category-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.cat-card {
  display: flex;
  flex-direction: column;
  background: var(--warm-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(36,36,36,.08);
  transition: all .25s ease;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(36,36,36,.15);
}

.cat-card-image {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 60%; /* aspect ratio 5:3 */
  overflow: hidden;
  background: var(--cream);
}

.cat-card-image img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.cat-card:hover .cat-card-image img {
  transform: scale(1.05);
}

.cat-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 14px;
  background: var(--gold);
  color: var(--anthracite);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.cat-card-body {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-card-body h3 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--olive);
  font-family: var(--font-serif);
  font-weight: 600;
}

.cat-card-body p {
  margin: 0;
  font-size: .95rem;
  color: #6a6a65;
  line-height: 1.6;
}

.cat-card-footer {
  padding: 0 24px 20px;
}

.cat-link {
  display: inline-block;
  color: var(--bordeaux);
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .03em;
  transition: all .25s ease;
}

.cat-link:hover {
  color: var(--olive);
  gap: 4px;
  transform: translateX(2px);
}

/* =========================================
   ELEMENTOR — stili globali sezioni
   ========================================= */

/* Bottoni Elementor con stile Emmegi automatico */
.elementor-button {
  font-family: var(--font-sans) !important;
  font-weight: 700 !important;
  letter-spacing: .04em !important;
  border-radius: 6px !important;
  transition: all .25s ease !important;
}
.elementor-button:hover { transform: translateY(-2px); }
