/* ===============================================
   Astrolabio — Theme CSS
   Magazine di astronomia, 8–16 anni
   =============================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette Astrolabio */
  --bg:          #0F1830;
  --bg-2:        #16223D;
  --glass:       rgba(46,67,114,0.40);
  --glass-hover: rgba(46,67,114,0.65);
  --border:      rgba(201,138,60,0.22);
  --border-glow: rgba(201,138,60,0.55);

  /* Brand */
  --brass:       #C98A3C;
  --brass-dim:   #8A6A3A;
  --orange:      #E8643C;
  --ivory:       #F2E6CE;
  --navy:        #16223D;
  --navy-deep:   #0F1830;
  --blue-rotta:  #2E4372;
  --text-muted:  #C7D0E0;

  /* Alias legacy (usati nel CSS esistente → mappati sulla palette) */
  --purple:    #C98A3C;
  --purple-l:  #E8A84C;
  --cyan:      #C98A3C;
  --cyan-l:    #F2E6CE;
  --teal:      #E8643C;
  --coral:     #E8643C;
  --gold:      #C98A3C;
  --pink:      #C98A3C;

  --text:   #F2E6CE;
  --text-2: #C7D0E0;
  --text-3: #7A8AB0;

  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-pill: 100px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Atkinson Hyperlegible', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.65;
}

h1, h2, h3, h4, h5, h6,
.section-title, .hero-featured-body h1,
.post-hero-inner h1, .cat-hero-inner h1 {
  font-family: 'Oswald', 'Archivo Narrow', 'Saira Condensed', sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ── Starfield ── */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}


/* (kept for any inline usage elsewhere) */
.nebula { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; }
.nb-purple { background: radial-gradient(circle, rgba(201,138,60,.14) 0%, transparent 65%); }
.nb-cyan   { background: radial-gradient(circle, rgba(0,212,255,.09) 0%, transparent 65%); }
.nb-gold   { background: radial-gradient(circle, rgba(255,215,0,.07) 0%, transparent 65%); }
.nb-coral  { background: radial-gradient(circle, rgba(255,107,107,.08) 0%, transparent 65%); }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
section, .section { position: relative; z-index: 1; }

/* ── Header / Nav ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(7,7,26,.88);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  height: 68px;
  gap: 8px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.logo-dot {
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.logo-dot img { width: 38px; height: 38px; display: block; }
.logo span, .logo-name {
  background: linear-gradient(135deg, var(--purple-l), var(--cyan-l));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
header nav {
  display: flex;
  gap: 2px;
  margin-left: 28px;
}
header nav a {
  display: block;
  padding: 7px 14px;
  color: var(--text-2);
  text-decoration: none;
  border-radius: var(--r-sm);
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s;
}
header nav a:hover, header nav a.active {
  color: var(--text);
  background: rgba(201,138,60,.12);
}
.nav-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 7px 16px;
  color: var(--text-2);
  font-size: .875rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .2s;
}
.nav-search:hover { border-color: var(--border-glow); color: var(--text); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: all .2s;
}
.mobile-menu {
  display: none;
  flex-direction: column;
  background: rgba(15,24,48,.97);
  border-top: 1px solid var(--border);
  padding: 12px 28px 20px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 10px 0;
  color: var(--text-2);
  text-decoration: none;
  font-size: .95rem;
  border-bottom: 1px solid var(--border);
}
.mobile-menu a:hover { color: var(--text); }

/* ── Progress bar ── */
.progress-bar {
  position: fixed;
  top: 68px; left: 0; right: 0;
  height: 2px;
  background: rgba(255,255,255,.05);
  z-index: 201;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  transition: width .1s;
}

/* ── Buttons ── */
.btn, .read-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px;
  border-radius: var(--r-pill);
  font-family: inherit; font-size: .95rem; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: all .25s ease; white-space: nowrap;
}
.btn-primary, .read-btn {
  background: var(--orange);
  color: var(--ivory);
}
.btn-primary:hover, .read-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  color: var(--ivory);
}
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--glass); border-color: var(--border-glow); color: var(--text); }
.btn-teal { background: var(--orange); color: var(--ivory); font-weight: 700; }
.btn-teal:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn-sm { padding: 7px 16px; font-size: .85rem; }
.nav-subscribe { background: var(--orange); color: var(--ivory) !important; border-radius: var(--r-pill) !important; padding: 7px 18px !important; }
.nav-subscribe:hover { filter: brightness(1.08); }

/* ── Tags ── */
.category-tag a, .cat-tag, .subcat-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: rgba(201,138,60,.17); color: var(--purple-l);
  border: 1px solid rgba(201,138,60,.25);
  text-decoration: none; transition: all .2s;
}
.category-tag a:hover, .subcat-pill:hover {
  background: rgba(201,138,60,.28);
  color: var(--text);
}
.age-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: .7rem; font-weight: 600;
  background: rgba(255,255,255,.06);
  color: var(--text-2);
  border: 1px solid var(--border);
}

/* ── Cards ── */
.post-card, .rel-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all .3s ease;
  display: flex; flex-direction: column;
}
.post-card:hover {
  background: var(--glass-hover);
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.card-thumb, .rel-thumb {
  display: block;
  width: 100%; height: 180px;
  overflow: hidden;
}
.card-thumb img, .rel-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.post-card:hover .card-thumb img { transform: scale(1.04); }
.card-body .category-tag, .rel-body .category-tag { display: none; }
.card-body, .rel-body {
  padding: 20px;
  flex: 1;
  display: flex; flex-direction: column;
}
.card-body h2 a, .card-body h2, .rel-body h3 a, .rel-body h3 {
  font-size: 1rem; font-weight: 600; line-height: 1.35;
  color: var(--text); text-decoration: none; margin: 8px 0;
}
.card-body h2 a:hover, .rel-body h3 a:hover { color: var(--purple-l); }
.card-body p { font-size: .875rem; color: var(--text-2); line-height: 1.6; flex: 1; }
.card-footer { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; }
.card-read { font-size: .82rem; color: var(--purple-l); text-decoration: none; transition: color .2s; }
.card-read:hover { color: var(--cyan-l); }
.rel-cat { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--purple-l); margin-bottom: 6px; }

/* ── Post meta ── */
.post-meta {
  display: flex; gap: 10px; align-items: center;
  font-size: .75rem; color: var(--text-3);
}

/* Section headers */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.section-title {
  font-size: clamp(1.35rem,2.5vw,1.8rem);
  font-weight: 700; color: var(--text);
}
.section-link, .see-all {
  font-size: .875rem; color: var(--purple-l);
  text-decoration: none; transition: color .2s;
}
.section-link:hover, .see-all:hover { color: var(--cyan-l); }
.section-eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--purple-l); margin-bottom: 6px;
}

/* ── Grids ── */
.post-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.latest-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

/* ── Hero ── */
.hero {
  padding-top: 68px;
  position: relative; overflow-x: hidden;
  display: flex; align-items: stretch;
}
.hero-inner {
  max-width: 1200px; margin: 0 auto; padding: 80px 28px;
  display: grid; grid-template-columns: 1fr 380px;
  gap: 56px; align-items: center;
  position: relative; z-index: 1;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  background: rgba(201,138,60,.1); border: 1px solid rgba(201,138,60,.22);
  border-radius: var(--r-pill);
  font-size: .82rem; font-weight: 600; color: var(--purple-l); margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(2.4rem,5.2vw,3.8rem);
  font-weight: 700; line-height: 1.07; margin-bottom: 20px; color: var(--text);
}
.hero-title .hl {
  background: linear-gradient(135deg, var(--purple-l), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub {
  font-size: 1.08rem; color: var(--text-2); line-height: 1.7;
  max-width: 520px; margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 36px; }
.stat-val {
  font-size: 1.7rem; font-weight: 700;
  background: linear-gradient(135deg, var(--purple-l), var(--cyan-l));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1;
}
.stat-label { font-size: .75rem; color: var(--text-3); margin-top: 3px; }
.hero-visual {
  display: flex; align-items: center; justify-content: center;
  position: relative;
}

/* ── Planet CSS Art ── */
.planet-orb {
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  animation: float 6s ease-in-out infinite;
}
.planet-orb::after {
  content: '';
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, rgba(255,255,255,.18) 0%, transparent 55%);
}
.p-mars {
  width: 200px; height: 200px;
  background: radial-gradient(circle at 35% 35%, #ff9070, #d44020, #7a1808);
  box-shadow: inset -30px -25px 55px rgba(0,0,0,.6), inset 8px 8px 28px rgba(255,180,130,.12);
}
.p-jwst {
  width: 190px; height: 190px;
  background: radial-gradient(circle at 35% 35%, #c084fc, #7c3aed, #2d0a6b);
  box-shadow: inset -28px -24px 52px rgba(0,0,0,.6);
}
.p-saturn-body {
  width: 150px; height: 150px;
  background: radial-gradient(circle at 35% 35%, #f7d888, #c89930, #7a5c10);
  box-shadow: inset -22px -20px 44px rgba(0,0,0,.45);
  z-index: 2;
  animation: float 6s ease-in-out infinite;
}
.saturn-ring {
  position: absolute;
  width: 280px; height: 55px;
  border: 11px solid rgba(200,153,48,.42);
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) rotateX(72deg);
  z-index: 1;
}
.p-earth {
  width: 180px; height: 180px;
  background: radial-gradient(circle at 35% 35%, #60c8f8, #1565c0, #0a2340);
  box-shadow: inset -26px -22px 50px rgba(0,0,0,.55);
}

/* ── Hero Slider ── */
.hero-featured { position: relative; border-radius: var(--r-xl); overflow: hidden; flex: 1; display: flex; flex-direction: column; }
.hero-slide { display: none; }
.hero-slide.active { display: flex; flex-direction: column; }
.hero-featured-img { display: block; width: 100%; height: clamp(200px, 30vh, 340px); overflow: hidden; border-radius: var(--r-xl); }
.hero-featured-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-featured-body {
  padding: 16px 20px;
  background: linear-gradient(0deg, rgba(7,7,26,.95) 0%, rgba(7,7,26,.6) 60%, transparent 100%);
  margin-top: -80px; position: relative;
}
.hero-featured-body h1 { font-size: clamp(1.2rem,2.2vw,1.6rem); font-weight: 700; margin: 6px 0; color: var(--text); }
.hero-featured-body h1 a { color: inherit; text-decoration: none; }
.hero-featured-body h1 a:hover { color: var(--purple-l); }
.hero-featured-body p { font-size: .875rem; color: var(--text-2); margin-bottom: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.hero-slider-nav { position: absolute; bottom: 14px; right: 14px; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 0; }
.hero-slider-btn { background: rgba(15,24,48,.55); backdrop-filter: blur(6px); border: 1px solid rgba(201,138,60,.3); color: var(--ivory); border-radius: 50%; width: 28px; height: 28px; font-size: .8rem; cursor: pointer; transition: all .2s; display: flex; align-items: center; justify-content: center; }
.hero-slider-btn:hover { border-color: var(--brass); color: var(--brass); }
.hero-slider-dots { display: flex; gap: 5px; }
.hero-slider-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(242,230,206,.35); border: none; cursor: pointer; transition: all .2s; padding: 0; }
.hero-slider-dot.active { background: var(--brass); transform: scale(1.3); }

/* Hero sidebar */
.hero-sidebar { display: flex; flex-direction: column; justify-content: space-between; padding: 12px 0; }
.hero-sidebar-post {
  display: flex; gap: 14px; align-items: center;
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px; cursor: pointer; transition: all .25s;
}
.hero-sidebar-post:hover, .hero-sidebar-post.active {
  border-color: var(--border-glow);
  background: var(--glass-hover);
}
.sidebar-thumb { width: 80px; height: 60px; border-radius: var(--r-sm); overflow: hidden; flex-shrink: 0; }
.sidebar-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-cat { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--purple-l); margin-bottom: 4px; }
.sidebar-post-body h3 { font-size: .875rem; font-weight: 600; color: var(--text); line-height: 1.35; }
.hero-inner-wrapper {
  width: 100%;
  max-width: 1200px; margin: 0 auto; padding: 24px 28px 20px;
  display: grid; grid-template-columns: 1fr 320px;
  gap: 32px; align-items: stretch;
  position: relative; z-index: 1;
}

/* ── Categories grid ── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 12px; }
.cat-pill {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none; color: var(--text-2);
  transition: all .25s;
}
.cat-pill:hover {
  background: rgba(201,138,60,.1);
  border-color: rgba(201,138,60,.35); color: var(--text);
}
.cat-pill-icon { font-size: 1.8rem; margin-bottom: 4px; }
.cat-pill-label { font-size: .9rem; font-weight: 600; }
.cat-pill-count { font-size: .72rem; color: var(--text-3); }

/* ── Fact box ── */
.fact-box {
  background: linear-gradient(135deg, rgba(255,215,0,.08), rgba(255,140,66,.06));
  border: 1px solid rgba(255,215,0,.18);
  border-radius: var(--r-xl);
  padding: 32px 36px;
  display: flex; gap: 24px; align-items: center;
}
.fact-emoji { font-size: 3rem; flex-shrink: 0; }
.fact-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.fact-text { font-size: 1.05rem; color: var(--text); line-height: 1.65; }
.fact-text strong { color: var(--gold); }

/* ── Stat cards ── */
.stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat-card {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px;
}
.stat-card-val {
  font-size: 2.6rem; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 6px;
}
.stat-card-val.cyan-grad {
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-card-label { font-size: .82rem; color: var(--text-2); line-height: 1.5; }

/* ── Newsletter ── */
.newsletter-box {
  background: linear-gradient(135deg, rgba(0,229,160,.08), rgba(0,212,255,.05));
  border: 1px solid rgba(0,229,160,.18);
  border-radius: var(--r-xl);
  padding: 44px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 40px; align-items: center;
}
.newsletter-form { display: flex; gap: 10px; margin-top: 16px; }
.newsletter-input {
  flex: 1; padding: 12px 20px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(0,229,160,.2);
  border-radius: var(--r-pill);
  color: var(--text); font-family: inherit; font-size: .95rem; outline: none;
  min-width: 200px;
}
.newsletter-input:focus { border-color: var(--teal); }
.newsletter-input::placeholder { color: var(--text-3); }

/* ── List posts ── */
.list-posts { display: flex; flex-direction: column; gap: 16px; }
.list-post-item {
  display: grid; grid-template-columns: 100px 1fr;
  gap: 16px; align-items: center;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px;
  text-decoration: none; transition: all .25s;
}
.list-post-item:hover { border-color: var(--border-glow); background: var(--glass-hover); }
.list-thumb { width: 100px; height: 70px; border-radius: var(--r-sm); overflow: hidden; }
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-body h3 { font-size: .95rem; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.35; }
.list-body h3 a { color: inherit; text-decoration: none; }
.list-body h3 a:hover { color: var(--purple-l); }
.list-body p { font-size: .82rem; color: var(--text-2); margin-bottom: 6px; line-height: 1.5; }

/* ── Main layout (article + sidebar) ── */
.main-wrap {
  max-width: 1200px; margin: 0 auto; padding: 60px 28px 80px;
  display: grid; grid-template-columns: 1fr 300px;
  gap: 48px; align-items: start;
  position: relative; z-index: 1;
}
.home-main { grid-template-columns: 1fr 280px; }

/* ── Sidebar ── */
.sidebar { position: sticky; top: 88px; padding-top: 36px; }
.sidebar-widget {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; margin-bottom: 20px;
}
.sidebar-widget-title {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 14px;
}
.sidebar-post {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); text-decoration: none;
}
.sidebar-post:last-child { border-bottom: none; }
.sidebar-post:hover .sidebar-post-title { color: var(--purple-l); }
.sidebar-post-img { width: 60px; height: 44px; border-radius: var(--r-sm); overflow: hidden; flex-shrink: 0; }
.sidebar-post-img img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-post-title { font-size: .82rem; font-weight: 600; color: var(--text); line-height: 1.35; }
.sidebar-post-meta { font-size: .7rem; color: var(--text-3); margin-top: 3px; }
.hot-topic-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border); text-decoration: none;
}
.hot-topic-item:last-child { border-bottom: none; }
.hot-topic-num {
  font-size: 1.4rem; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, var(--purple-l), var(--cyan-l));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  min-width: 28px;
}
.hot-topic-title { font-size: .82rem; color: var(--text-2); line-height: 1.4; }
.hot-topic-item:hover .hot-topic-title { color: var(--text); }

/* ── Pagination ── */
.pagination {
  display: flex; gap: 6px; margin: 40px 0; justify-content: center;
  position: relative; z-index: 1;
}
.page-btn {
  padding: 8px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--border); color: var(--text-2);
  text-decoration: none; font-size: .875rem; font-weight: 500;
  transition: all .2s; background: var(--glass);
}
.page-btn:hover { border-color: var(--border-glow); color: var(--text); }
.page-btn.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.page-btn.disabled { opacity: .3; pointer-events: none; }

/* ── Post / Article ── */
.post-hero {
  padding-top: 68px; position: relative; overflow-x: hidden;
  background: rgba(46,67,114,.78);
  border-bottom: 1px solid rgba(201,138,60,.2); padding-bottom: 0;
}
.post-hero-inner {
  max-width: 1200px; margin: 0 auto; padding: 56px 28px 44px;
  position: relative; z-index: 1;
}
.post-hero-cat {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: rgba(201,138,60,.17); color: var(--purple-l);
  border: 1px solid rgba(201,138,60,.25); margin-bottom: 16px;
}
.post-hero-inner h1 {
  font-size: clamp(1.9rem,4.5vw,3rem); font-weight: 700; line-height: 1.1;
  margin-bottom: 16px; color: var(--text);
}
.post-hero-excerpt {
  font-size: 1.1rem; color: var(--text-2); line-height: 1.7;
  margin-bottom: 24px; font-weight: 500;
  border-left: 3px solid var(--purple); padding-left: 20px;
}
.post-hero-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: .8rem; color: var(--text-3); align-items: center;
}
.author-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 4px 12px 4px 4px;
}
.author-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.author-avatar-lg {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* Post wrap */
.post-wrap {
  max-width: 1200px; margin: 0 auto; padding: 0 28px 80px;
  display: grid; grid-template-columns: 1fr 280px;
  gap: 48px; align-items: start;
  position: relative; z-index: 1;
}
.post-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  left: 50%; transform: translateX(-50%);
  width: 100vw;
  background: rgba(15,24,48,.18);
  z-index: -1;
}
.article-content { max-width: 740px; }
.post-cover { width: 100%; border-radius: var(--r-xl); overflow: hidden; margin: 36px 0; }
.post-cover img { width: 100%; height: auto; display: block; }

/* Prose */
.prose { font-size: 1.05rem; color: var(--text-2); line-height: 1.85; }
.prose p { margin-bottom: 1.3rem; }
.prose h2 { font-size: 1.45rem; font-weight: 700; color: var(--text); margin: 2.5rem 0 .75rem; }
.prose h3 { font-size: 1.2rem; font-weight: 600; color: var(--text); margin: 2rem 0 .5rem; }
.prose strong { color: var(--text); }
.prose a { color: var(--purple-l); text-decoration: underline; }
.prose a:hover { color: var(--cyan-l); }
.prose ul, .prose ol { margin: 0 0 1.3rem 1.5rem; }
.prose li { margin-bottom: .4rem; }
.prose blockquote {
  background: rgba(201,138,60,.1); border-left: 3px solid var(--purple);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 16px 22px; margin: 1.5rem 0; font-style: italic;
  color: var(--purple-l);
}
.prose img { width: 100%; border-radius: var(--r-md); margin: 1.5rem 0; }

/* Post tags */
.post-tags { margin: 28px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.post-tags-label { font-size: .8rem; color: var(--text-3); }

/* Share bar */
.share-bar {
  display: flex; gap: 10px; align-items: center;
  padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin: 28px 0;
}
.share-label { font-size: .8rem; color: var(--text-3); }
.share-btn {
  padding: 7px 16px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--glass);
  color: var(--text-2); font-size: .82rem; text-decoration: none;
  transition: all .2s; display: inline-block;
}
.share-btn:hover { background: var(--glass-hover); color: var(--text); border-color: rgba(255,255,255,.18); }

/* Author bio */
.author-bio {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px; margin: 32px 0;
}
.author-bio-text h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.author-bio-text p { font-size: .875rem; color: var(--text-2); line-height: 1.6; }

/* Related articles */
.related-section { margin: 40px 0; }
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.section-head h2 { font-size: 1.25rem; font-weight: 700; }
.section-head a { font-size: .875rem; color: var(--purple-l); text-decoration: none; }
.section-head a:hover { color: var(--cyan-l); }
.rel-card { background: var(--glass); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; transition: all .25s; text-decoration: none; color: inherit; }
.rel-card:hover { border-color: var(--border-glow); transform: translateY(-3px); }
.rel-thumb { height: 120px; }

/* ── Category hero ── */
.cat-hero {
  padding-top: 68px; position: relative; overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.cat-hero-inner {
  max-width: 1200px; margin: 0 auto; padding: 60px 28px 48px;
  display: grid; grid-template-columns: 1fr 220px;
  gap: 32px; align-items: center;
  position: relative; z-index: 1;
}
.cat-hero-visual { display: flex; align-items: center; justify-content: center; position: relative; }
.breadcrumb {
  font-size: .82rem; color: var(--text-3); margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--purple-l); }
.breadcrumb span { margin: 0 6px; }

/* Filter bar */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; align-items: center; }
.filter-label { font-size: .82rem; color: var(--text-3); }
.filter-pill {
  padding: 6px 16px; border-radius: var(--r-pill);
  border: 1px solid var(--border); color: var(--text-2);
  font-size: .85rem; font-weight: 500; cursor: pointer;
  background: transparent; font-family: inherit; transition: all .2s;
}
.filter-pill:hover { background: rgba(201,138,60,.1); border-color: rgba(201,138,60,.3); color: var(--purple-l); }
.filter-pill.active { background: var(--purple); color: #fff; border-color: var(--purple); }

/* ── Search page ── */
.search-hero {
  padding-top: 68px; position: relative; z-index: 1;
}
.search-hero-inner { max-width: 700px; margin: 0 auto; padding: 60px 28px 40px; text-align: center; }
.search-hero-inner h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.search-hero-inner p { color: var(--text-2); }

/* ── 404 page ── */
.page-404 {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 100px 28px;
  position: relative; z-index: 1;
}
.page-404 h1 {
  font-size: 8rem; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, var(--purple-l), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 12px;
}
.page-404 h2 { font-size: 1.6rem; margin-bottom: 12px; }
.page-404 p { color: var(--text-2); margin-bottom: 32px; }

/* ── ADV slots ── */
.adv-banner, .adv-slot-banner { display: none; }

/* ── Footer ── */
footer {
  background: rgba(0,0,0,.45); border-top: 1px solid var(--border);
  padding: 60px 0 32px; position: relative; z-index: 1;
}
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 48px;
}
.footer-brand p { color: var(--text-2); font-size: .875rem; margin-top: 12px; max-width: 260px; line-height: 1.65; }
.footer-col h4 { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: var(--text-2); text-decoration: none; font-size: .875rem; transition: color .2s; }
.footer-col a:hover { color: var(--purple-l); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; color: var(--text-3);
}
.footer-bottom a { color: var(--text-3); text-decoration: none; }
.footer-bottom a:hover { color: var(--purple-l); }

hr { border: none; border-top: 1px solid var(--border); margin: 48px 0; }

/* ── Animations ── */
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

/* ── Responsive ── */
@media(max-width:1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-inner-wrapper { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .post-wrap { grid-template-columns: 1fr; }
  .main-wrap { grid-template-columns: 1fr; }
  .home-main { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .cat-hero-inner { grid-template-columns: 1fr; }
  .cat-hero-visual { display: none; }
  .newsletter-box { grid-template-columns: 1fr; }
}
@media(max-width:768px) {
  .post-grid, .latest-grid, .related-grid { grid-template-columns: repeat(2,1fr); }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  header nav { display: none; }
  .nav-search { display: none; }
  .hamburger { display: flex; }
}
@media(max-width:520px) {
  .post-grid, .latest-grid, .related-grid, .stat-cards { grid-template-columns: 1fr; }
  .container, .nav-inner, .hero-inner, .hero-inner-wrapper, .post-hero-inner, .post-wrap, .main-wrap, .footer-inner { padding-left: 16px; padding-right: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .fact-box { flex-direction: column; align-items: flex-start; }
}

/* ── Margini del Navigatore ─────────────────────────────────── */
.nav-margins {
  background: var(--blue-rotta);
  border: 0.5px solid var(--brass);
  border-radius: var(--r-md);
  padding: 20px 22px;
  margin: 32px 0;
}
.nav-margins-header {
  font-family: 'Oswald', 'Archivo Narrow', sans-serif;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-margins-header svg {
  flex-shrink: 0;
  stroke: var(--brass);
}
.nav-margins-table {
  width: 100%;
  border-collapse: collapse;
}
.nav-margins-table tr + tr td {
  border-top: 0.5px solid rgba(201,138,60,.18);
}
.nav-margins-table td {
  padding: 7px 0;
  font-size: .85rem;
  vertical-align: top;
  line-height: 1.4;
}
.nav-margins-table td:first-child {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  padding-right: 20px;
  width: 40%;
}
.nav-margins-table td:last-child {
  color: var(--ivory);
  font-weight: 400;
}
@media(max-width:600px) {
  .nav-margins-table, .nav-margins-table tbody,
  .nav-margins-table tr, .nav-margins-table td { display: block; }
  .nav-margins-table td:first-child { color: var(--brass); padding-bottom: 2px; padding-right: 0; width: auto; }
  .nav-margins-table tr + tr td:first-child { border-top: 0.5px solid rgba(201,138,60,.18); padding-top: 10px; }
  .nav-margins-table tr + tr td:last-child { border-top: none; padding-top: 0; }
}

/* ═══════════════════════════════════════════════
   COMPONENTI ARTICOLO — callout, glossario, quiz
   ═══════════════════════════════════════════════ */

/* Lead paragraph */
.prose .article-lead {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.7;
  border-left: 3px solid var(--brass);
  padding-left: 20px;
  margin-bottom: 2rem;
}

/* Figure + figcaption */
.prose figure {
  margin: 2rem 0;
}
.prose figure img {
  width: 100%;
  border-radius: var(--r-md);
  display: block;
  margin: 0;
}
.prose figcaption {
  font-size: .78rem;
  color: var(--text-3);
  line-height: 1.5;
  padding: 8px 12px;
  background: rgba(15,24,48,.55);
  border-radius: 0 0 var(--r-md) var(--r-md);
  border: 1px solid var(--border);
  border-top: none;
}
.prose figcaption .credit {
  display: block;
  margin-top: 3px;
  font-style: italic;
  color: var(--text-3);
  opacity: .8;
}

/* Tabelle articolo */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  font-size: .9rem;
}
.prose th {
  background: rgba(201,138,60,.18);
  color: var(--brass);
  font-family: 'Oswald', sans-serif;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.prose td {
  padding: 9px 14px;
  color: var(--text-2);
  border-bottom: 1px solid rgba(201,138,60,.1);
  vertical-align: top;
}
.prose tr:last-child td { border-bottom: none; }
.prose tr:hover td { background: rgba(46,67,114,.3); }

/* Callout box — formula chimica e "Lo sapevi?" */
.prose .callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(124,106,255,.1);
  border: 1px solid rgba(124,106,255,.18);
  border-left: 3px solid #7c6aff;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 16px 20px;
  margin: 1.8rem 0;
  font-size: .95rem;
  color: #c4bcff;
  line-height: 1.65;
}
.prose .callout .callout-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.prose .callout strong { color: #d4ccff; }
.prose .callout code {
  font-family: 'Courier New', monospace;
  background: rgba(124,106,255,.2);
  color: #b3a8ff;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .9em;
}

/* Compare grid (prima/dopo) */
.prose .compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 1.8rem 0;
}
.prose .compare-card {
  border-radius: var(--r-md);
  padding: 18px;
}
.prose .compare-card:first-child {
  background: rgba(201,138,60,.08);
  border: 1px solid rgba(201,138,60,.22);
}
.prose .compare-card:last-child {
  background: rgba(0,180,230,.07);
  border: 1px solid rgba(0,180,230,.2);
}
.prose .compare-card-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-family: 'Oswald', sans-serif;
}
.prose .compare-card:first-child .compare-card-title { color: #e8b46a; }
.prose .compare-card:last-child  .compare-card-title { color: #60d8f8; }
.prose .compare-card ul {
  list-style: none;
  margin: 0; padding: 0;
  font-size: .9rem;
  color: var(--text-2);
  line-height: 1.8;
}
@media(max-width:560px) {
  .prose .compare-grid { grid-template-columns: 1fr; }
}

/* Glossario */
.prose .glossary-box {
  background: rgba(0,229,160,.06);
  border: 1px solid rgba(0,229,160,.18);
  border-radius: var(--r-lg);
  padding: 24px 26px;
  margin: 2.5rem 0;
}
.prose .glossary-eyebrow {
  font-family: 'Oswald', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #00e5a0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.prose .glossary-item {
  font-size: .9rem;
  color: var(--text-2);
  line-height: 1.6;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,229,160,.1);
}
.prose .glossary-item:last-child { border-bottom: none; }
.prose .glossary-term {
  font-weight: 700;
  color: #7de8c0;
  margin-right: 6px;
}

/* Quiz */
.prose .quiz-box {
  background: rgba(124,106,255,.08);
  border: 1px solid rgba(124,106,255,.2);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  margin: 2.5rem 0;
}
.prose .quiz-eyebrow {
  font-family: 'Oswald', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #b3a8ff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.prose .quiz-q {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.4;
}
.prose .quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.prose .quiz-opt {
  text-align: left;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(124,106,255,.18);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: .95rem;
  font-family: inherit;
  padding: 12px 18px;
  cursor: pointer;
  transition: all .2s;
  line-height: 1.45;
  width: 100%;
}
.prose .quiz-opt:hover:not([disabled]) {
  background: rgba(124,106,255,.12);
  border-color: rgba(124,106,255,.4);
  color: var(--text);
}
.prose .quiz-opt.correct {
  background: rgba(0,229,160,.15);
  border-color: #00e5a0;
  color: #7de8c0;
}
.prose .quiz-opt.wrong {
  background: rgba(255,107,107,.12);
  border-color: #ff6b6b;
  color: #ffaaaa;
}
.prose .quiz-opt[disabled] { cursor: default; }
.prose .quiz-feedback {
  font-size: .9rem;
  line-height: 1.55;
  min-height: 1.4em;
  color: var(--text-2);
}
