/*
Theme Name: NomeSito Theme
Author: Renato
Version: 1.0.0
*/

:root{
  --base: 18px;
  --header-h: 78px;
  --max: 1120px;
  --radius: 18px;
  --hero-h: 440px;
  --hero-h-inner: 340px;
  --fade-distance: 620px;

  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --line: rgba(255,255,255,.10);

  --bg: #0c0f14;
  --paper: rgba(18,20,24,.88);
  --card: rgba(24,27,33,.80);
  --ink: #f0f2f5;
  --muted:#b8bec7;
  --btn-bg: rgba(255,255,255,.06);
  --btn-br: rgba(255,255,255,.16);

  /* hero default (puoi sostituirla da Customizer, vedi functions.php) */
  --hero-img: url("https://images.unsplash.com/photo-1482192596544-9eb780fc7f66?q=80&w=2200&auto=format&fit=crop");
}

/* Theme switch: giorno / notte
   Default: notte (variabili in :root). */
html[data-theme="day"]{
  --bg: #f3f4f6;
  --paper: rgba(255,255,255,.92);
  --card: rgba(255,255,255,.96);
  --ink: #0c0f14;
  --muted:#4b5563;
  --btn-bg: rgba(10,15,20,.06);
  --btn-br: rgba(10,15,20,.18);
  --shadow: 0 18px 60px rgba(12,20,40,.14);
  --line: rgba(10,20,40,.12);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  font-size: var(--base);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(900px 500px at 80% 0%, rgba(255,255,255,.05), transparent 55%),
    var(--bg);
  overflow-x:hidden;
}
a{ color:inherit; text-decoration:none; }
.container{ max-width: var(--max); margin: 0 auto; padding: 0 18px; }

/* HEADER */
.site-header{
  position: fixed;
  top:0; left:0; right:0;
  height: var(--header-h);
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(12,15,20,.65);
  border-bottom: 1px solid var(--line);
}
.nav{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.brand{ display:flex; align-items:center; gap:10px; font-weight: 850; letter-spacing:.2px; }
.logo{
  width:34px; height:34px; border-radius:10px;
  background: linear-gradient(135deg, #f0f2f5, #5b616b);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* WP MENU (desktop) */
.primary-nav{ display:flex; align-items:center; gap: 10px; }
.primary-nav ul{
  list-style:none; margin:0; padding:0;
  display:flex; gap: 6px; align-items:center;
  color: var(--muted);
  font-weight: 800;
  font-size: calc(var(--base) - 2px);
}
.primary-nav li{ position:relative; }
.primary-nav a{
  display:inline-flex;
  align-items:center;
  padding: 10px 12px;
  border-radius: 12px;
}
.primary-nav a:hover{ background: rgba(255,255,255,.08); color: var(--ink); }

/* submenu dropdown */
.primary-nav .sub-menu{
  display:none;
  position:absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(18,20,24,.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 1200;
}
.primary-nav .sub-menu li{ width:100%; }
.primary-nav .sub-menu a{
  width:100%;
  padding: 10px 10px;
  border-radius: 12px;
  color: rgba(184,190,199,.95);
}
.primary-nav li:hover > .sub-menu{ display:block; }

/* CTA */
.cta{ display:flex; align-items:center; gap:10px; }
.btn{
  border: 1px solid var(--btn-br);
  background: var(--btn-bg);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 900;
  font-size: calc(var(--base) - 2px);
  cursor:pointer;
}

/* Theme toggle + mobile menu */
.toggle{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--btn-br);
  background: var(--btn-bg);
  color: var(--ink);
  font-weight: 900;
  font-size: calc(var(--base) - 2px);
  cursor:pointer;
  user-select:none;
}
.dot{
  width:10px; height:10px;
  border-radius:999px;
  background: linear-gradient(135deg, var(--ink), var(--muted));
}

.hamb{
  display:none;
  width: 42px; height: 42px;
  border-radius: 14px;
  border: 1px solid var(--btn-br);
  background: var(--btn-bg);
  cursor:pointer;
  align-items:center;
  justify-content:center;
}
.hamb span{
  width: 18px; height: 2px;
  background: var(--ink);
  display:block;
  position:relative;
  border-radius: 2px;
}
.hamb span::before,
.hamb span::after{
  content:"";
  position:absolute;
  left:0;
  width:18px; height:2px;
  background: var(--ink);
  border-radius:2px;
}
.hamb span::before{ top:-6px; }
.hamb span::after{ top: 6px; }

.drawer{
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 999;
  display:none;
}
.drawer.open{ display:block; }
.drawer-inner{ padding: 12px 18px 16px; }
.mobile-menu{
  list-style:none;
  margin:0; padding:0;
  display:grid;
  gap: 10px;
}
.mobile-menu a{
  display:block;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  color: var(--ink);
  font-weight: 900;
}
.mobile-menu .sub-menu{
  display:grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0 0 0 10px;
  position: static;
  box-shadow: none;
  background: transparent;
  border: 0;
}

/* HERO */
.hero-wrap{ padding-top: var(--header-h); }
.hero{
  position: sticky;
  top: var(--header-h);
  height: var(--hero-h);
  z-index: 1;
  overflow:hidden;
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 20px 20px;
}

/* Inner pages hero (category / single / page) */
.hero.hero--inner{
  height: var(--hero-h-inner);
}

.hero-title{
  margin: 0 0 10px;
  font-size: clamp(32px, 3vw, 48px);
  line-height: 1.04;
  letter-spacing: -.5px;
}
.hero-meta{
  margin: 0 0 8px;
  color: rgba(255,255,255,.82);
  font-size: calc(var(--base) - 2px);
  font-weight: 850;
}
.hero-desc{
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: calc(var(--base) - 1px);
  line-height: 1.5;
  max-width: 70ch;
}
.hero::before{
  content:"";
  position:absolute; inset:0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.10) 0%, rgba(0,0,0,.62) 78%, rgba(0,0,0,.72) 100%),
    var(--hero-img);
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
  filter: grayscale(1) contrast(1.05) brightness(.86);
}
.hero::after{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(900px 380px at 30% 30%, rgba(255,255,255,.10), transparent 55%);
  mix-blend-mode: overlay;
  opacity: .55;
  pointer-events:none;
}
.hero .fade{
  position:absolute; inset:0;
  background: var(--bg);
  opacity: 0;
  pointer-events:none;
  will-change: opacity;
}

.hero-content{
  position: relative;
  height: 60%;
  display:flex;
  align-items:flex-end;
  padding: 24px 0;
  color:#fff;
}
.hero-inner{
  width: 100%;
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 16px;
  align-items:end;
}
.hero h1{
  margin: 0 0 10px;
  font-size: clamp(34px, 3.2vw, 52px);
  line-height: 1.02;
  letter-spacing: -.6px;
}

.search-box{
  display:flex;
  gap: 10px;
  align-items:center;
  background: rgba(12,15,20,.58);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  padding: 10px;
  max-width: 720px;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}
.search-box input{
  flex:1;
  border:0;
  outline:none;
  background: transparent;
  color:#fff;
  padding: 10px 10px;
  font-size: calc(var(--base) - 1px);
  font-weight: 800;
}
.search-box input::placeholder{ color: rgba(255,255,255,.70); }
.search-box button{
  border:0;
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(255,255,255,.14);
  color:#fff;
  font-weight: 900;
  font-size: calc(var(--base) - 2px);
  cursor:pointer;
  white-space:nowrap;
}
.search-box button:hover{ background: rgba(255,255,255,.20); }

/* Lista categorie (20) */
.cat-list{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.cat-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  transition: transform .12s ease, background .12s ease;
}
.cat-row span{ font-weight: 950; color: #fff; }
.cat-row small{
  color: rgba(255,255,255,.78);
  font-weight: 750;
  font-size: calc(var(--base) - 3px);
  text-align:right;
}
.cat-row:hover{ transform: translateY(-1px); background: rgba(255,255,255,.12); }

/* MAIN che copre */
main.site-main{
  position: relative;
  z-index: 5;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(12,15,20,.75) 18%, var(--bg) 45%);
}

/* Category/Page header (with ACF image on categories) */
.tax-hero{
  position: relative;
  border-radius: 22px;
  overflow:hidden;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  min-height: 220px;
}
.tax-hero__bg{
  position:absolute; inset:0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.65) 85%),
    var(--tax-hero, var(--hero-img));
  background-size: cover;
  background-position: center;
  filter: grayscale(1) contrast(1.05) brightness(.86);
  transform: scale(1.03);
}
.tax-hero__inner{
  position: relative;
  padding: 18px 18px 16px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  height: 100%;
}
.tax-hero__title{
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.05;
  letter-spacing: -.4px;
}
.tax-hero__desc{
  margin: 0;
  color: rgba(255,255,255,.86);
  font-weight: 750;
  font-size: calc(var(--base) - 1px);
  max-width: 80ch;
}

/* Single post header */
.post-hero{
  position: relative;
  border-radius: 22px;
  overflow:hidden;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  min-height: 260px;
}
.post-hero__bg{
  position:absolute; inset:0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.75) 92%),
    var(--post-hero, var(--hero-img));
  background-size: cover;
  background-position: center;
  filter: grayscale(1) contrast(1.05) brightness(.86);
  transform: scale(1.03);
}
.post-hero__inner{
  position: relative;
  padding: 18px 18px 16px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  height: 100%;
}
.post-hero__meta{
  margin: 0 0 8px;
  color: rgba(255,255,255,.84);
  font-weight: 800;
  font-size: calc(var(--base) - 2px);
}
.post-hero__title{
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(30px, 3vw, 48px);
  line-height: 1.05;
  letter-spacing: -.4px;
}
.post-hero__desc{
  margin: 0;
  color: rgba(255,255,255,.86);
  font-weight: 750;
  font-size: calc(var(--base) - 1px);
  max-width: 80ch;
}
.main-panel{ margin-top: -110px; padding: 24px 0 40px; }
.panel{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.panel-head{
  padding: 18px 18px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 14px;
  flex-wrap:wrap;
}
.panel-head h2{ margin:0; font-size: calc(var(--base) + 3px); }
.panel-head .sub{ margin:0; color: rgba(184,190,199,.95); font-size: calc(var(--base) - 2px); line-height: 1.4; max-width: 62ch; }

/* grid cards */
.cats{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  padding: 16px 18px 18px;
}
.cat{
  grid-column: span 6;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  min-height: 140px;
  display:flex;
  flex-direction:column;
  gap: 10px;
  position:relative;
  overflow:hidden;
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
}
.cat h3{ margin:0; font-size: calc(var(--base) + 1px); }
.cat p{ margin:0; color: rgba(184,190,199,.92); font-size: calc(var(--base) - 2px); line-height: 1.5; }
.meta{ margin-top:auto; display:flex; justify-content:space-between; gap:10px; color: rgba(184,190,199,.92); font-size: calc(var(--base) - 3px); }
.tag{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 900;
  color: var(--ink);
}

/* layout con sidebar */
.grid-2{
  display:grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items:start;
}
.sidebar{
  padding: 18px;
  position: sticky;
  top: calc(var(--header-h) + 14px);
}
.article{ padding: 18px; line-height: 1.7; }
.article h1{ margin:0 0 10px; font-size: calc(var(--base) + 10px); }
.article p{ color: rgba(184,190,199,.92); }

/* footer 4 colonne */
.site-footer{
  position: relative;
  z-index: 6;
  background: rgba(10,12,16,1);
  border-top: 1px solid var(--line);
}
.footer-inner{
  padding: 34px 0;
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.fcol{
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.03);
}
.fcol h4{
  margin:0 0 10px;
  font-size: calc(var(--base) - 3px);
  text-transform: uppercase;
  letter-spacing:.2px;
}
.fcol a, .fcol p{ margin:0 0 8px; display:block; color: rgba(184,190,199,.95); font-size: calc(var(--base) - 2px); }
.copyright{ border-top: 1px solid rgba(255,255,255,.08); padding:14px 0; color: rgba(184,190,199,.85); font-size: calc(var(--base) - 3px); }

/* responsive */
@media (max-width: 980px){
  .primary-nav{ display:none; }
  .hamb{ display:flex; }
  .hero-inner{ grid-template-columns: 1fr; }
  .cats .cat{ grid-column: span 12; }
  .footer-inner{ grid-template-columns: 1fr 1fr; }
  .grid-2{ grid-template-columns: 1fr; }
  .sidebar{ position: static; }
  .cat-list{ grid-template-columns: 1fr; }
}
@media (max-width: 520px){
  :root{ --hero-h: 360px; --fade-distance: 560px; }
  .footer-inner{ grid-template-columns: 1fr; }
}
