/*
Theme Name: UnayGlow
Theme URI: https://unayglow.com
Author: Pol
Description: Tema custom per UnayGlow — minimalismo cinematografico, ritorno alla luce originale.
Version: 3.0.0
Text Domain: unayglow
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  /* Colori */
  --ink:        #101010;   /* nero caldo di base */
  --ink-soft:   #1a1a1a;
  --paper:      #FAF8F5;   /* fondo chiaro caldo */
  --paper-dim:  #F1EDE7;
  --terracotta: #8C5A40;
  --terracotta-light: #C68B66;
  --gold:       #C7A45C;
  --white:      #ffffff;

  /* Testo su fondo scuro */
  --on-dark:        rgba(255, 255, 255, 0.92);
  --on-dark-soft:   rgba(255, 255, 255, 0.72);
  --on-dark-faint:  rgba(255, 255, 255, 0.62); /* contrasto AA su fondo --ink */
  --line-on-dark:   rgba(255, 255, 255, 0.14);

  /* Testo su fondo chiaro */
  --on-light:       #181614;
  --on-light-soft:  #55504a;
  --line-on-light:  rgba(16, 16, 16, 0.1);

  /* Tipografia */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-wordmark: 'Fraunces', 'Playfair Display', Georgia, serif;

  /* Ritmo */
  --space-2: 1rem;
  --space-3: 2rem;
  --space-4: 4rem;
  --space-5: clamp(5rem, 12vh, 9rem);
  --radius: 20px;
  --header-h: 72px; /* spazio riservato in cima alle pagine per non finire sotto la capsula del menu */

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Transizioni native tra le pagine */
@view-transition { navigation: auto; }

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  background-color: var(--ink);
  color: var(--on-dark);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0 0 var(--space-2);
}

p { margin: 0 0 1.5rem; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--terracotta); color: #fff; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); border: 0; white-space: nowrap;
}

.skip-link:focus {
  position: fixed; top: 12px; left: 12px; z-index: 10001;
  width: auto; height: auto; clip-path: none;
  background: var(--paper); color: var(--ink);
  padding: 0.75rem 1.25rem; border-radius: 8px; font-weight: 600;
}

/* Layout */
.container {
  width: min(1200px, 100% - 3rem);
  margin-inline: auto;
}
.container--wide  { width: min(1400px, 100% - 3rem); margin-inline: auto; }
.container--prose { width: min(760px, 100% - 3rem);  margin-inline: auto; }

.section { padding-block: var(--space-5); }
.text-center { text-align: center; }

/* Etichetta sopra i titoli (eyebrow) */
.eyebrow {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--terracotta-light);
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   3. Bottoni
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.95rem 2.2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.35s var(--ease-out), background 0.35s, color 0.35s, box-shadow 0.35s, border-color 0.35s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.btn--light {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}
.btn--light:hover { background: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25); }

.btn--ghost {
  background: transparent;
  color: var(--on-dark);
  border-color: var(--line-on-dark);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.3); }

.btn--dark {
  background: var(--ink);
  color: #fff;
}
.btn--dark:hover { background: #2a2724; }

.btn--block { width: 100%; }

/* ==========================================================================
   4. Preloader
   ========================================================================== */
#unayglow-preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
#unayglow-preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#unayglow-preloader .loader-word {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.35em;
  text-indent: 0.35em; /* compensa lo spazio finale del letter-spacing */
  text-transform: uppercase;
  color: var(--on-dark);
  animation: loaderPulse 1.6s ease-in-out infinite;
}
@keyframes loaderPulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

/* ==========================================================================
   5. Header — capsula flottante compatta
   ========================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem 1.5rem 0;
  pointer-events: none; /* solo il logo e la capsula intercettano i click, non tutta la fascia */
  transition: padding 0.4s ease;
}
.site-header.scrolled { padding-top: 0.9rem; }

.header-inner {
  pointer-events: auto;
  display: flex; align-items: center;
  gap: 2rem;
  padding: 0.5rem 0.5rem 0.5rem 1.15rem;
  border-radius: 999px;
  background: rgba(16, 16, 16, 0.45);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  max-width: calc(100vw - 3rem);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.site-header.scrolled .header-inner {
  background: rgba(16, 16, 16, 0.82);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.site-brand {
  pointer-events: auto; /* il logo vive fuori dalla capsula, sopra l'hero */
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}
.site-brand .custom-logo-link {
  display: flex; align-items: center;
  line-height: 0;
}
.site-brand img {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  transition: height 0.4s ease;
}
.site-header.scrolled .site-brand img { height: 42px; }
.site-brand__text {
  font-family: var(--font-wordmark);
  font-optical-sizing: auto;
  font-style: italic;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  transition: opacity 0.3s, font-size 0.4s ease;
}
.site-header.scrolled .site-brand__text { font-size: 1.45rem; }
.site-brand__text:hover { opacity: 0.8; }

/* Nel footer il logo non ha bisogno di ombra: è già su fondo scuro pieno */
.footer-brand .site-brand__text { text-shadow: none; }

.main-nav { display: flex; align-items: center; gap: 1.5rem; }
.main-nav ul.menu {
  display: flex; align-items: center; gap: 1.5rem;
  list-style: none; margin: 0; padding: 0;
}
.main-nav a {
  position: relative;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--on-dark-soft);
  padding-bottom: 4px;
  white-space: nowrap;
  transition: color 0.3s;
}
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--terracotta-light);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.main-nav a:hover,
.main-nav a[aria-current="page"] { color: #fff; }
.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.main-nav a.nav-cta {
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(198, 139, 102, 0.55);
  background: rgba(140, 90, 64, 0.22);
  color: #fff;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.main-nav a.nav-cta::after { display: none; }
.main-nav a.nav-cta:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
  transform: translateY(-2px);
}

/* Menu mobile */
.nav-toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  width: 40px; height: 40px;
  flex-shrink: 0;
  position: relative; z-index: 1002;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ''; display: block; position: absolute; left: 8px;
  width: 24px; height: 2px; background: #fff; border-radius: 2px;
  transition: transform 0.35s var(--ease-out), opacity 0.25s;
}
.nav-toggle span { top: 19px; }
.nav-toggle span::before { top: -7px; left: 0; }
.nav-toggle span::after  { top: 7px;  left: 0; }
body.nav-open .nav-toggle span { transform: rotate(45deg); }
body.nav-open .nav-toggle span::before { transform: rotate(-90deg) translateX(-7px); }
body.nav-open .nav-toggle span::after  { opacity: 0; }

/* Tablet: riduce lo spazio verticale eccessivo e fissa la griglia a 2 colonne */
@media (max-width: 1024px) {
  :root {
    --space-4: 3rem;
    --space-5: clamp(3.5rem, 9vh, 6rem);
  }
  .chapters-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .chapters-grid { grid-template-columns: 1fr; }
}

/* Header: su schermi piccoli evita il costo del backdrop-filter (GPU) */
@media (max-width: 600px) {
  .header-inner,
  .main-nav,
  .mobile-buy-bar {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .header-inner { background: rgba(16, 16, 16, 0.88); }
  .main-nav { background: rgba(16, 16, 16, 0.98); }
  .mobile-buy-bar { background: rgba(16, 16, 16, 0.97); }
}

/* Schermi bassi (telefono orizzontale): l'hero non deve mai superare la viewport */
@media (max-height: 480px) {
  .hero, .hero--tall { min-height: auto; padding-block: 7rem 3rem; }
  .hero-content { padding-top: 1rem; }
  .scroll-hint { display: none; }
  .social-row { margin-top: 1.5rem; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; inset: 0; z-index: 1001;
    flex-direction: column; justify-content: center; gap: 2rem;
    background: rgba(16, 16, 16, 0.96);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }
  body.nav-open .main-nav { opacity: 1; visibility: visible; }
  .main-nav ul.menu { flex-direction: column; gap: 2rem; }
  .main-nav a { font-size: 1.5rem; font-weight: 600; color: #fff; }
  body.nav-open { overflow: hidden; }
}

/* ==========================================================================
   6. Hero cinematografico
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  background: var(--ink);
}
.hero--tall { min-height: 90svh; }
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.55;
  transform: scale(1.06);
  animation: heroZoom 14s var(--ease-out) forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }

.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to bottom, rgba(16,16,16,0.25) 0%, rgba(16,16,16,0) 40%, rgba(16,16,16,0.65) 100%);
}
.hero-content {
  position: relative; z-index: 2;
  max-width: 860px;
  padding: calc(var(--header-h) + 2rem) 1.5rem 4rem;
}
.hero-title {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 1.2rem;
}
.hero-subtitle {
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  font-weight: 300;
  color: var(--on-dark-soft);
  margin-bottom: 2.6rem;
}

/* Icone social */
.social-row {
  display: flex; justify-content: center; gap: 1.2rem;
  margin-top: 3rem;
}
.social-row a {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--on-dark);
  transition: transform 0.35s var(--ease-out), background 0.35s, color 0.35s;
}
.social-row a:hover {
  transform: translateY(-4px) scale(1.06);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.social-row svg { width: 21px; height: 21px; }

/* Indicatore di scroll */
.scroll-hint {
  /* Ancorato in basso a destra per non sovrapporsi mai alle icone social, che restano centrate. */
  position: absolute; bottom: 2rem; right: 2rem;
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--on-dark-faint);
}
.scroll-hint .line {
  width: 1px; height: 56px; overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
}
.scroll-hint .line::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 50%;
  background: #fff;
  animation: scrollLine 2.2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(220%); }
}

/* ==========================================================================
   7. Sezioni editoriali
   ========================================================================== */
/* Citazione grande su fondo chiaro */
.section--quote {
  background: var(--paper);
  color: var(--on-light);
}
.quote-text {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.45;
  color: var(--on-light);
  max-width: 900px;
  margin-inline: auto;
}
.quote-text em, .quote-highlight {
  font-style: italic;
  color: var(--terracotta);
}

/* Griglia dei capitoli / esperienze */
.section--chapters { background: var(--paper); color: var(--on-light); padding-top: 0; }
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
}
.chapter-card { display: block; }
.chapter-card figure {
  margin: 0 0 1.6rem;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.chapter-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}
.chapter-card:hover img { transform: scale(1.05); }
.chapter-card h3 {
  font-size: 1.45rem;
  color: var(--on-light);
  margin-bottom: 0.4rem;
}
.chapter-card p { color: var(--on-light-soft); margin: 0; }
.chapter-card .card-cta {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--terracotta);
}
.chapter-card:hover .card-cta { text-decoration: underline; text-underline-offset: 4px; }

/* Sezione scura di chiusura (manifesto / libro) */
.section--manifesto {
  background: var(--ink);
  color: var(--on-dark);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.section--manifesto::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 640px; height: 640px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(140, 90, 64, 0.18) 0%, transparent 70%);
  pointer-events: none;
}
.manifesto-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  color: #fff;
}
.manifesto-text {
  font-size: 1.2rem;
  color: var(--on-dark-soft);
  max-width: 620px;
  margin: 0 auto 2.8rem;
}

/* Split scuro (storia) */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 80vh;
  background: var(--ink-soft);
}
.split-media { position: relative; min-height: 320px; }
.split-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.split-body {
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--space-5) clamp(1.5rem, 6vw, 5rem);
  background: rgba(255, 255, 255, 0.03);
}
.split-body h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); color: #fff; }
.split-body p  { font-size: 1.15rem; color: var(--on-dark-soft); line-height: 1.8; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
}

/* Capitolo di testo su fondo scuro */
.chapter-prose h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); color: #fff; }
.chapter-prose p  { font-size: 1.15rem; color: var(--on-dark-soft); line-height: 1.8; }

.portrait {
  width: 124px; height: 124px; border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 2rem;
  border: 2px solid var(--line-on-dark);
}

/* ==========================================================================
   8. Negozio / vetrina libro
   ========================================================================== */
.showcase {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 3rem) 0 var(--space-5);
  background: var(--ink);
  overflow: hidden;
}
.showcase::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 700px; height: 700px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(140, 90, 64, 0.16) 0%, transparent 70%);
  pointer-events: none;
}
.showcase-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(300px, 480px) minmax(300px, 550px);
  justify-content: center;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
}
.showcase-book img {
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.6));
  transition: transform 0.6s var(--ease-out);
}
.showcase-book:hover img { transform: translateY(-8px) rotate(-1deg); }

.showcase-copy h1 {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}
.showcase-copy .sub {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--on-dark);
  margin-bottom: 1.4rem;
}
.showcase-copy .lead {
  font-size: 1.15rem;
  color: var(--on-dark-soft);
  margin-bottom: 2rem;
}
.feature-list {
  list-style: none; margin: 0 0 2.6rem; padding: 0;
  color: var(--on-dark-soft);
  font-size: 1.05rem;
}
.feature-list li {
  display: flex; align-items: baseline; gap: 0.7rem;
  margin-bottom: 0.55rem;
}
.feature-list li::before {
  content: '✦';
  color: var(--terracotta-light);
  flex-shrink: 0;
}

/* Card prezzo */
.pricing-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-on-dark);
  border-radius: var(--radius);
  padding: 2.4rem 2rem;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.price-row {
  display: flex; align-items: baseline; gap: 1rem;
  margin-bottom: 1.8rem;
}
.price-now {
  font-size: 3.2rem; font-weight: 700; line-height: 1; color: #fff;
}
.price-was {
  font-size: 1.1rem; color: var(--on-dark-faint); text-decoration: line-through;
}
.pricing-card .btn { margin-bottom: 1rem; }
.pricing-note { text-align: center; margin-top: 0.6rem; }
.pricing-note .ok   { color: #4ade80; font-weight: 500; font-size: 0.95rem; margin-bottom: 0.15rem; }
.pricing-note .hint { color: var(--on-dark-faint); font-size: 0.85rem; margin: 0; }

@media (max-width: 860px) {
  .showcase { min-height: 0; }
  .showcase-grid { grid-template-columns: 1fr; }
  .showcase-book { max-width: 320px; margin-inline: auto; }
  .showcase-copy { text-align: center; }
  .feature-list li { justify-content: center; }
}

.affiliate-disclosure {
  margin-top: 2rem;
  font-size: 0.82rem;
  color: var(--on-dark-faint);
  line-height: 1.6;
}
.affiliate-disclosure--footer {
  margin-top: 1.5rem;
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
}

/* Barra di acquisto fissa — solo mobile, quando la pricing-card è fuori vista */
.mobile-buy-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  display: none;
  align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  padding-bottom: max(0.9rem, env(safe-area-inset-bottom));
  background: rgba(16, 16, 16, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-on-dark);
  transform: translateY(100%);
  transition: transform 0.35s var(--ease-out);
}
.mobile-buy-bar.is-visible { transform: translateY(0); }
.mobile-buy-bar__info { display: flex; flex-direction: column; min-width: 0; }
.mobile-buy-bar__title {
  font-size: 0.8rem; color: var(--on-dark-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mobile-buy-bar__price { font-weight: 700; color: #fff; font-size: 1.05rem; }
.mobile-buy-bar .btn { padding: 0.7rem 1.5rem; flex-shrink: 0; }

@media (max-width: 860px) {
  .mobile-buy-bar { display: flex; }
}

/* ==========================================================================
   9. Il Diario (blog)
   ========================================================================== */
.page-hero {
  padding: calc(var(--header-h) + 2.5rem) 0 2.5rem;
  background: var(--ink);
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  color: #fff;
}
.page-hero .intro {
  font-size: 1.2rem; color: var(--on-dark-soft);
  max-width: 640px; margin: 0 auto;
}

.section--diario { background: var(--paper); color: var(--on-light); }
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: clamp(2rem, 4vw, 3rem);
}
.post-card {
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(20, 15, 10, 0.05);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s;
}
.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 44px rgba(20, 15, 10, 0.12);
}
.post-card figure { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; }
.post-card figure img { width: 100%; height: 100%; object-fit: cover; }
.post-card .card-body { padding: 1.6rem 1.6rem 1.8rem; display: flex; flex-direction: column; flex: 1; }
.post-card .meta {
  font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--terracotta);
  margin-bottom: 0.6rem;
}
.post-card h2 {
  font-size: 1.3rem;
  color: var(--on-light);
  margin-bottom: 0.6rem;
}
.post-card .excerpt { color: var(--on-light-soft); font-size: 0.98rem; margin: 0; }

.pagination {
  display: flex; justify-content: center; gap: 0.5rem;
  margin-top: var(--space-4);
}
.pagination .page-numbers {
  min-width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line-on-light);
  color: var(--on-light-soft);
  font-weight: 500;
  transition: background 0.3s, color 0.3s;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Articolo singolo */
.section--article { background: var(--paper); color: var(--on-light); }
.article-header { text-align: center; margin-bottom: var(--space-4); }
.article-header .meta {
  font-size: 0.85rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--terracotta);
  margin-bottom: 1rem;
}
.article-header h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  color: var(--on-light);
}
.article-hero-img {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-4);
}
.article-content {
  font-size: 1.13rem;
  line-height: 1.85;
  color: #33302c;
}
.article-content h2, .article-content h3 { color: var(--on-light); margin-top: 2.6rem; }
.article-content a { color: var(--terracotta); text-decoration: underline; text-underline-offset: 3px; }
.article-content blockquote {
  margin: 2.5rem 0;
  padding-left: 1.6rem;
  border-left: 3px solid var(--terracotta);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--on-light);
}
.article-content img { border-radius: var(--radius); }

.post-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line-on-light);
}
.post-nav a { color: var(--terracotta); font-weight: 600; }

/* Condividi — link diretti, senza SDK esterni */
.share-row {
  display: flex; align-items: center; gap: 0.9rem;
  margin-top: var(--space-3);
}
.share-row__label {
  font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--on-light-soft);
  margin-right: 0.3rem;
}
.share-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-on-light);
  background: #fff;
  color: var(--on-light-soft);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, transform 0.3s;
}
.share-btn svg { width: 17px; height: 17px; }
.share-btn:hover {
  color: var(--terracotta);
  border-color: var(--terracotta-light);
  transform: translateY(-2px);
}
.share-btn--copy { position: relative; }
.share-btn__copy-label {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink); color: #fff;
  font-size: 0.72rem; font-weight: 600;
  padding: 0.3rem 0.6rem; border-radius: 6px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.share-btn--copy.is-copied .share-btn__copy-label {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   10. Newsletter
   ========================================================================== */
.section--newsletter {
  background: var(--paper-dim);
  color: var(--on-light);
  text-align: center;
}
.newsletter-title { font-size: clamp(1.8rem, 3.5vw, 2.4rem); color: var(--on-light); }
.newsletter-text  { color: var(--on-light-soft); max-width: 520px; margin: 0 auto 2.2rem; }
.newsletter-form {
  display: flex; gap: 0.7rem;
  max-width: 480px; margin-inline: auto;
}
.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--line-on-light);
  background: #fff;
  font-family: inherit;
  font-size: 1rem;
  color: var(--on-light);
}
.newsletter-form input[type="email"]:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}
@media (max-width: 560px) {
  .newsletter-form { flex-direction: column; }
}
.newsletter-feedback {
  margin: 1.2rem 0 0;
  font-size: 0.92rem;
  font-weight: 500;
  color: #2f7a4d;
  min-height: 1.3em;
}
.newsletter-feedback.is-error { color: #b3432f; }

/* ==========================================================================
   11. Contatti / pagine generiche / 404
   ========================================================================== */
.section--page { background: var(--paper); color: var(--on-light); padding-top: var(--space-4); }
.section--page .article-content { color: #33302c; }

/* Modulo Contatti */
.contact-form {
  padding: 2.2rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(20, 15, 10, 0.05);
}
.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.contact-form__field { margin-bottom: 1.2rem; }
.contact-form label {
  display: block;
  font-size: 0.85rem; font-weight: 600;
  color: var(--on-light-soft);
  margin-bottom: 0.4rem;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line-on-light);
  background: var(--paper-dim);
  font-family: inherit; font-size: 1rem;
  color: var(--on-light);
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: 1px;
}
.contact-form__honeypot {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.contact-form__feedback {
  margin: 1rem 0 0;
  font-size: 0.92rem;
  font-weight: 500;
  color: #2f7a4d;
  min-height: 1.3em;
}
.contact-form__feedback.is-error { color: #b3432f; }
@media (max-width: 640px) {
  .contact-form__row { grid-template-columns: 1fr; }
  .contact-form { padding: 1.6rem; }
}

.error-404 {
  min-height: 70svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: calc(var(--header-h) + 2rem) 1.5rem var(--space-5);
}
.error-404 .code {
  font-size: clamp(5rem, 16vw, 10rem);
  font-weight: 700; line-height: 1;
  color: rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
}
.error-404 h1 { color: #fff; }
.error-404 p  { color: var(--on-dark-soft); max-width: 440px; }

/* Modulo di ricerca */
.search-form {
  display: flex; gap: 0.7rem;
  max-width: 480px;
  margin: 2rem auto 0;
}
.search-form input[type="search"] {
  flex: 1;
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--line-on-dark);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: inherit; font-size: 1rem;
}
.section--page .search-form input[type="search"],
.section--diario .search-form input[type="search"] {
  border-color: var(--line-on-light);
  background: #fff;
  color: var(--on-light);
}

/* ==========================================================================
   12. Footer
   ========================================================================== */
.site-footer {
  background: var(--ink);
  color: var(--on-dark-faint);
  padding: var(--space-5) 0 var(--space-3);
  border-top: 1px solid var(--line-on-dark);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.footer-brand .site-brand { font-size: 1.5rem; }
.footer-brand p { margin-top: 1rem; max-width: 320px; font-size: 0.95rem; }
.footer-col h4 {
  color: var(--on-dark);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 1.2rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a { color: var(--on-dark-faint); font-size: 0.95rem; transition: color 0.3s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line-on-dark);
  font-size: 0.85rem;
}
.footer-bottom .social-row { margin: 0; }
.footer-bottom .social-row a { width: 40px; height: 40px; }
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-3); }
}

/* ==========================================================================
   13. Animazioni di ingresso (reveal)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Titolo hero: righe che salgono */
.hero-title .line {
  display: block;
  overflow: hidden;
}
.hero-title .line > span {
  display: inline-block;
  transform: translateY(110%);
  animation: lineUp 1.2s var(--ease-out) forwards;
}
.hero-title .line:nth-child(2) > span { animation-delay: 0.12s; }
@keyframes lineUp { to { transform: translateY(0); } }

/* Rispetta chi preferisce meno movimento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-title .line > span { transform: none; animation: none; }
  .hero-media img { animation: none; transform: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   14. WooCommerce (integrazione base)
   ========================================================================== */
.woocommerce-page .site-main { background: var(--paper); color: var(--on-light); }
.woo-wrap {
  padding: calc(var(--header-h) + var(--space-4)) 0 var(--space-5);
}
.woo-wrap .woocommerce ul.products li.product {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(20, 15, 10, 0.05);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s;
}
.woo-wrap .woocommerce ul.products li.product:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 44px rgba(20, 15, 10, 0.12);
}
.woocommerce .button, .woocommerce a.button, .woocommerce button.button {
  border-radius: 999px !important;
}
