/* ===========================================================
   robertocabras.com — Editorial White / Gold / Black theme
   =========================================================== */

:root {
  /* Palette */
  --paper:        #FBFAF6;
  --paper-warm:   #F5F2EA;
  --ink:          #1A1815;
  --ink-soft:     #2D2A24;
  --ink-mute:     #6E665B;
  --gold:         #B8924A;
  --gold-light:   #D4B074;
  --gold-deep:    #8C6E33;
  --hairline:     rgba(26, 24, 21, 0.18);
  --hairline-strong: rgba(26, 24, 21, 0.55);
  --gold-line:    rgba(184, 146, 74, 0.6);

  /* Fonts */
  --display:  'Cinzel', 'Trajan Pro', serif;
  --serif:    'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --body:     'EB Garamond', 'Cormorant Garamond', Georgia, serif;

  --max:      1240px;

  /* Easing */
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Subtle paper texture */
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(26,24,21,0.025) 1px, transparent 1px),
    radial-gradient(1px 1px at 70% 70%, rgba(26,24,21,0.02) 1px, transparent 1px),
    linear-gradient(180deg, #FBFAF6 0%, #F8F5EE 100%);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* --- Language visibility ---
   Default state: both languages shown ("body[data-lang=both]"),
   English in italic and slightly muted to keep visual hierarchy.
*/
.lang-en { font-style: italic; color: var(--ink-mute); }
body[data-lang="it"]   .lang-en { display: none !important; }
body[data-lang="en"]   .lang-it { display: none !important; }
body[data-lang="en"]   .lang-en { color: var(--ink); font-style: normal; }
/* In "both" mode, separate the languages with a subtle gap */
body[data-lang="both"] .lang-it + .lang-en { margin-top: 0.35em; display: block; }
body[data-lang="both"] .lang-it { display: block; }
/* Inline contexts (buttons, nav, meta) keep both inline */
.brand .lang-it, .brand .lang-en,
.primary-nav a .lang-it, .primary-nav a .lang-en,
.btn .lang-it, .btn .lang-en,
.lang-switch .lang-it, .lang-switch .lang-en,
.book-genre .lang-it, .book-genre .lang-en,
.book-status .lang-it, .book-status .lang-en,
.video-empty .lang-it, .video-empty .lang-en,
.field-label .lang-it, .field-label .lang-en,
.scroll-cue .lang-it, .scroll-cue .lang-en,
.footer-col h4 .lang-it, .footer-col h4 .lang-en,
.footer-tag .lang-it, .footer-tag .lang-en,
.author-meta .lang-it, .author-meta .lang-en,
.floating-subscribe .lang-it, .floating-subscribe .lang-en {
  display: inline;
}
body[data-lang="both"] .primary-nav a .lang-it::after,
body[data-lang="both"] .footer-col a .lang-it::after,
body[data-lang="both"] .btn .lang-it::after { content: ' · '; opacity: 0.5; font-style: normal; color: var(--gold); }
body[data-lang="both"] .lang-switch .lang-it::after,
body[data-lang="both"] .brand .lang-it::after { content: ''; }

/* ============== HEADER ============== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 246, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 32px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 24px;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  letter-spacing: 0.18em;
  font-size: 14px;
  text-transform: uppercase;
}
.brand-mark {
  font-family: var(--display);
  font-weight: 600;
  color: var(--gold);
  border: 1px solid var(--gold);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  font-size: 18px;
  letter-spacing: 0;
  position: relative;
}
.brand-mark::before, .brand-mark::after {
  content:''; position: absolute; inset: 3px;
  border: 1px solid rgba(184,146,74,0.3);
  pointer-events: none;
}
.brand-mark.large {
  width: 64px; height: 64px; font-size: 32px;
}
.brand-name { font-weight: 500; }

.primary-nav {
  display: flex;
  gap: 28px;
  justify-content: center;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.primary-nav a {
  position: relative;
  padding: 4px 0;
  color: var(--ink-soft);
  transition: color .25s var(--ease);
}
.primary-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.primary-nav a:hover { color: var(--ink); }
.primary-nav a:hover::after { transform: scaleX(1); }

.lang-switch {
  display: flex;
  border: 1px solid var(--hairline-strong);
  border-radius: 0;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.2em;
}
.lang-btn {
  background: transparent;
  border: 0;
  padding: 8px 12px;
  color: var(--ink-mute);
  border-right: 1px solid var(--hairline);
  transition: all .2s var(--ease);
}
.lang-btn:last-child { border-right: 0; }
.lang-btn:hover { color: var(--ink); background: rgba(184,146,74,0.05); }
.lang-btn.is-active {
  color: var(--paper);
  background: var(--ink);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px; height: 18px;
  background: transparent;
  border: 0;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 1px;
  background: var(--ink);
  transition: transform .3s var(--ease), opacity .2s;
}

/* ============== HERO ============== */
.hero {
  min-height: 92vh;
  display: grid;
  place-items: center;
  position: relative;
  padding: 80px 32px 120px;
}
.hero-frame {
  max-width: 980px;
  text-align: center;
  position: relative;
}
.hero-ornament {
  color: var(--gold);
  margin: 0 auto;
  width: 200px;
}
.hero-ornament svg { width: 100%; }
.hero-ornament-top    { margin-bottom: 36px; }
.hero-ornament-bottom { margin-top: 48px; }
.hero-eyebrow {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 32px;
}
.hero-eyebrow .lang-en { color: var(--ink-mute); font-style: italic; }
.hero-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(48px, 9vw, 132px);
  letter-spacing: 0.04em;
  line-height: 1;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15em 0.3em;
  justify-content: center;
  text-transform: uppercase;
}
.hero-title .word { display: inline-block; }
.hero-title .ampersand {
  color: var(--gold);
  font-weight: 400;
  font-size: 0.7em;
  align-self: center;
}
.hero-tagline {
  font-family: var(--serif);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 300;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 36px auto 0;
}
.hero-tagline .lang-en { color: var(--ink-mute); }
body[data-lang="both"] .hero-tagline .lang-it,
body[data-lang="both"] .hero-tagline .lang-en { display: block; }

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 48px;
  flex-wrap: wrap;
}
.scroll-cue {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.scroll-cue svg {
  width: 12px; height: 22px;
  animation: scrollCue 2.4s var(--ease) infinite;
}
@keyframes scrollCue {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(6px); opacity: 1; }
}

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  transition: all .35s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn-small { padding: 10px 20px; font-size: 11px; }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gold);
  transform: translateX(-100%);
  transition: transform .4s var(--ease);
  z-index: -1;
}
.btn-primary:hover { color: var(--ink); border-color: var(--gold); }
.btn-primary:hover::before { transform: translateX(0); }

.btn-ghost { background: transparent; border-color: var(--hairline-strong); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-deep); }

.btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-color: var(--hairline-strong);
  background: transparent;
}

/* ============ FIX BOTTONI: visibilità testo in tutte le lingue ============
 * I lang span (.lang-it, .lang-en) hanno colori forzati globalmente per il
 * corpo del sito (italico, grigio per EN, nero per EN-only). Dentro i
 * bottoni queste regole entrano in conflitto con i colori del bottone
 * (bianco su nero per btn-primary). Quindi resettiamo:
 * - colore ereditato dal bottone padre
 * - stile ereditato (no italic)
 * - mantenuti inline anche in modalità "both"
 */
.btn .lang-it,
.btn .lang-en {
  color: inherit !important;
  font-style: inherit !important;
}
body[data-lang="both"] .btn .lang-it,
body[data-lang="both"] .btn .lang-en {
  display: inline !important;
}
body[data-lang="both"] .btn .lang-it + .lang-en {
  margin-top: 0 !important;
}

/* Fix hover btn-primary: lo sfondo dorato ::before resta nascosto perché
 * il ::before ha z-index: -1 e sta DIETRO al background nero opaco del
 * bottone. Rendendo il bg transparente al hover, il dorato diventa visibile
 * e il testo nero (color: var(--ink)) torna leggibile.
 */
.btn-primary:hover {
  background: transparent;
}
/* Al hover, il separatore "·" su sfondo dorato perderebbe contrasto:
 * lo rendiamo nero per coerenza con il testo. */
body[data-lang="both"] .btn-primary:hover .lang-it::after {
  color: var(--ink);
  opacity: 0.4;
}

/* ============== SECTION SCAFFOLD ============== */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px 32px;
  position: relative;
}
.section-head { text-align: center; margin-bottom: 80px; }
.section-num {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--gold-deep);
  display: inline-block;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: 0.06em;
  margin: 0;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.section-title .lang-en {
  font-size: 0.55em;
  letter-spacing: 0.3em;
  color: var(--gold-deep);
  font-style: normal;
  font-weight: 400;
}
.section-title.centered { align-items: center; }
.section-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-mute);
  margin-top: 16px;
}
body[data-lang="both"] .section-sub .lang-it,
body[data-lang="both"] .section-sub .lang-en { display: block; }

.ornament-line {
  width: 80px;
  height: 1px;
  background: var(--gold);
  margin: 24px auto;
  position: relative;
}
.ornament-line::before, .ornament-line::after {
  content: '';
  position: absolute;
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
  top: 50%; transform: translateY(-50%);
}
.ornament-line::before { left: -12px; }
.ornament-line::after  { right: -12px; }

/* ============== ABOUT ============== */
.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 80px;
  align-items: start;
}
.portrait-frame {
  position: relative;
  aspect-ratio: 3/4;
  border: 1px solid var(--hairline-strong);
  padding: 12px;
  background: var(--paper-warm);
}
.portrait-frame::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid var(--gold-line);
  pointer-events: none;
}
.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  image-rendering: auto;
}
.portrait-fallback {
  position: absolute; inset: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #F5F2EA 0%, #EAE3D2 100%);
  font-family: var(--display);
  font-size: 64px;
  letter-spacing: 0.1em;
  color: var(--gold);
}
.portrait-frame:not(.no-image) .portrait-fallback { display: none; }

.about-text { font-size: 19px; line-height: 1.85; }
.about-text p { margin: 0 0 24px; }
.about-text .dropcap {
  float: left;
  font-family: var(--display);
  font-size: 70px;
  line-height: 0.85;
  padding: 8px 12px 0 0;
  color: var(--gold);
  font-weight: 600;
}
.about-text em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold-deep);
}
.author-meta {
  list-style: none;
  padding: 24px 0 0;
  margin: 32px 0 0;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.author-meta li { display: flex; flex-direction: column; gap: 4px; }
.meta-key {
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--gold-deep);
  text-transform: uppercase;
}
.meta-val {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
}

/* ============== BOOKS ============== */
.book {
  display: grid;
  grid-template-columns: 80px 320px 1fr;
  gap: 60px;
  align-items: start;
  padding: 80px 0;
  border-top: 1px solid var(--hairline);
  position: relative;
}
.book:first-of-type { border-top: 1px solid var(--hairline-strong); }
.book:last-child    { border-bottom: 1px solid var(--hairline-strong); }
.book-index {
  font-family: var(--display);
  font-size: clamp(48px, 6vw, 96px);
  font-weight: 500;
  color: var(--gold);
  line-height: 1;
}

/* Cover area */
.book-cover {
  aspect-ratio: 2/3;
  border: 1px solid var(--hairline-strong);
  padding: 8px;
  background: var(--paper-warm);
  position: relative;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.book:hover .book-cover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -30px rgba(26, 24, 21, 0.25);
}
.book-cover::before {
  content: '';
  position: absolute; inset: 4px;
  border: 1px solid var(--gold-line);
  pointer-events: none; z-index: 1;
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
}
.cover-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.cover-placeholder::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.15), transparent 70%);
  pointer-events: none;
}
.cover-frame {
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
  justify-content: center;
}
.cover-genre {
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}
.cover-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin: 0;
  text-transform: uppercase;
  line-height: 1.2;
}
.cover-author {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.1em;
}

/* Cover unique themes per book */
.cover-trova-e-uccidi-alan-mark {
  background: linear-gradient(160deg, #1A1815 0%, #2D2A24 100%);
  color: var(--paper);
}
.cover-trova-e-uccidi-alan-mark .cover-genre,
.cover-trova-e-uccidi-alan-mark .cover-author { color: var(--gold-light); }

.cover-blade-demon {
  background: linear-gradient(160deg, #2D1F1A 0%, #4A2A1F 50%, #1A1815 100%);
  color: var(--paper);
}
.cover-blade-demon .cover-genre,
.cover-blade-demon .cover-author { color: #C24A3D; }
.cover-blade-demon .cover-title { color: #F5F2EA; }

.cover-aelyr-la-doppia-luna {
  background: linear-gradient(160deg, #1A2A40 0%, #0F1A2D 50%, #050A14 100%);
  color: var(--paper);
}
.cover-aelyr-la-doppia-luna::before {
  content: '';
  position: absolute;
  top: 18%; left: 28%;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, #E8E4D9 0%, #B8B4A8 100%);
  box-shadow: 0 0 40px rgba(232, 228, 217, 0.3);
}
.cover-aelyr-la-doppia-luna .cover-frame::before {
  content: '';
  position: absolute;
  top: 10%; right: 18%;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, #C9B97D 0%, #8A7A4D 100%);
  box-shadow: 0 0 25px rgba(201, 185, 125, 0.4);
}
.cover-aelyr-la-doppia-luna .cover-frame { position: relative; z-index: 2; }
.cover-aelyr-la-doppia-luna .cover-genre,
.cover-aelyr-la-doppia-luna .cover-author { color: var(--gold-light); }

/* Book info */
.book-info { padding-top: 24px; }
.book-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.book-genre {
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold-deep);
  text-transform: uppercase;
}
.book-status {
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid currentColor;
}
.status-published { color: var(--gold-deep); border-color: var(--gold); background: rgba(184,146,74,0.08); }
.status-editing   { color: var(--ink); border-color: var(--ink); }
.status-project   { color: var(--ink-mute); border-color: var(--hairline-strong); }
.book-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 3.5vw, 44px);
  letter-spacing: 0.04em;
  line-height: 1.15;
  margin: 0 0 12px;
  text-transform: uppercase;
}
body[data-lang="both"] .book-title .lang-en {
  font-size: 0.55em;
  letter-spacing: 0.18em;
  color: var(--gold-deep);
  font-style: italic;
  font-weight: 400;
  margin-top: 6px;
}
.book-year {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-mute);
  margin: 0 0 20px;
  font-size: 16px;
}
.book-synopsis {
  font-size: 18px;
  line-height: 1.75;
  margin: 0 0 16px;
  max-width: 60ch;
}
.book-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============== VIDEOS ============== */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 48px 32px;
}
.video-card { display: flex; flex-direction: column; }
.video-frame {
  position: relative;
  aspect-ratio: 16/9;
  border: 1px solid var(--hairline-strong);
  padding: 6px;
  background: var(--paper-warm);
  margin-bottom: 16px;
  overflow: hidden;
}
.video-frame::before {
  content: '';
  position: absolute; inset: 2px;
  border: 1px solid var(--gold-line);
  pointer-events: none; z-index: 1;
}
.video-frame iframe,
.video-frame video {
  width: 100%; height: 100%;
  border: 0;
  display: block;
}
.video-empty {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #F5F2EA, #EAE3D2);
  color: var(--gold-deep);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.video-empty svg { width: 50px; height: 50px; opacity: 0.6; }
.video-title {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
  text-transform: uppercase;
  font-weight: 500;
}
.video-desc { font-size: 16px; color: var(--ink-soft); margin: 0; }

/* ============== NEWSLETTER ============== */
.newsletter {
  max-width: 920px;
  padding: 80px 32px 120px;
}
.newsletter-card {
  position: relative;
  padding: 80px 60px;
  border: 1px solid var(--hairline-strong);
  background: var(--paper-warm);
  text-align: center;
}
.ornament-corner {
  position: absolute;
  width: 32px; height: 32px;
  border: 1px solid var(--gold);
}
.ornament-tl { top: 12px;    left: 12px;    border-right: 0; border-bottom: 0; }
.ornament-tr { top: 12px;    right: 12px;   border-left: 0;  border-bottom: 0; }
.ornament-bl { bottom: 12px; left: 12px;    border-right: 0; border-top: 0; }
.ornament-br { bottom: 12px; right: 12px;   border-left: 0;  border-top: 0; }
.ornament-corner::after {
  content: '';
  position: absolute;
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
}
.ornament-tl::after { bottom: -3px; right:  -3px; }
.ornament-tr::after { bottom: -3px; left:   -3px; }
.ornament-bl::after { top:    -3px; right:  -3px; }
.ornament-br::after { top:    -3px; left:   -3px; }

.newsletter-card .section-num { display: block; margin-bottom: 16px; }
.newsletter-lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto 40px;
}

.newsletter-form {
  text-align: left;
  max-width: 720px;
  margin: 0 auto;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.field-row-bottom {
  grid-template-columns: 1fr auto;
  align-items: end;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold-deep);
  text-transform: uppercase;
}
.field input, .field select {
  font-family: var(--serif);
  font-size: 17px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline-strong);
  padding: 10px 0;
  color: var(--ink);
  outline: none;
  transition: border-color .25s var(--ease);
  border-radius: 0;
}
.field input:focus,
.field select:focus { border-bottom-color: var(--gold); }
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2 4 L6 9 L10 4' stroke='%23B8924A' stroke-width='1' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 24px;
}
.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important; height: 1px !important;
  opacity: 0 !important;
}
.form-message {
  margin: 24px 0 0;
  padding: 12px 16px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  border-left: 2px solid var(--gold);
  background: rgba(184, 146, 74, 0.06);
  display: none;
}
.form-message.is-error {
  border-left-color: #B33A2E;
  background: rgba(179, 58, 46, 0.06);
  color: #7A2A22;
}
.form-message.show { display: block; }
.form-privacy {
  margin: 24px 0 0;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink-mute);
  font-style: italic;
}
body[data-lang="both"] .form-privacy .lang-it,
body[data-lang="both"] .form-privacy .lang-en { display: block; }

/* ============== CONTACT FORM ============== */
.contact {
  background: var(--paper);
  padding: 80px 32px 120px;
}
.contact-card {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: 80px 60px;
  border: 1px solid var(--hairline-strong);
  background: var(--paper-warm);
  text-align: center;
}
.contact-card .section-num { display: block; margin-bottom: 16px; }
.contact-lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto 48px;
  line-height: 1.5;
}
.contact-form {
  text-align: left;
  max-width: 720px;
  margin: 0 auto;
}
.contact-form .field-row { margin-bottom: 24px; }
.contact-form .field-full {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  position: relative;
}
.contact-form textarea {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  background: rgba(255,255,255,0.4);
  border: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline-strong);
  padding: 14px 16px;
  color: var(--ink);
  outline: none;
  transition: border-color .25s var(--ease), background .25s var(--ease);
  border-radius: 0;
  resize: vertical;
  min-height: 140px;
}
.contact-form textarea:focus {
  border-color: var(--gold);
  background: rgba(255,255,255,0.7);
}
.field-counter {
  position: absolute;
  bottom: -22px;
  right: 0;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.field-counter.is-near { color: var(--gold-deep); }

/* Checkbox elegante */
.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 32px 0 24px;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.checkbox-field input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.checkbox-mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1px solid var(--hairline-strong);
  background: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s var(--ease);
  margin-top: 2px;
  color: var(--gold);
}
.checkbox-mark svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(0.6);
  transition: all .2s var(--ease);
}
.checkbox-field input[type="checkbox"]:checked + .checkbox-mark {
  border-color: var(--gold);
  background: var(--paper-warm);
}
.checkbox-field input[type="checkbox"]:checked + .checkbox-mark svg {
  opacity: 1;
  transform: scale(1);
}
.checkbox-field input[type="checkbox"]:focus-visible + .checkbox-mark {
  box-shadow: 0 0 0 3px rgba(184, 146, 74, 0.25);
}
.checkbox-text { flex: 1; }
.iubenda-link {
  color: var(--gold-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s var(--ease);
}
.iubenda-link:hover { color: var(--gold); }

.contact-submit-row {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}
.contact-submit-row .btn { min-width: 220px; }

/* Loading state del bottone */
.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  color: var(--paper);
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Popup successo */
.popup-success .success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  color: var(--gold);
  animation: success-pop 0.5s var(--ease) both;
}
.popup-success .success-icon svg {
  width: 100%;
  height: 100%;
}
.popup-success .success-icon polyline {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: success-draw 0.6s var(--ease) 0.2s forwards;
}
@keyframes success-pop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes success-draw {
  to { stroke-dashoffset: 0; }
}

/* ============== FOOTER ============== */
.site-footer {
  background: var(--ink);
  color: var(--paper-warm);
  padding: 80px 32px 32px;
  border-top: 4px double var(--gold);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-brand .brand-mark { color: var(--gold); border-color: var(--gold); }
.footer-brand .brand-mark::before, .footer-brand .brand-mark::after {
  border-color: rgba(184,146,74,0.3);
}
.footer-name {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.15em;
  margin: 0;
  text-transform: uppercase;
}
.footer-tag {
  font-family: var(--serif);
  font-style: italic;
  margin: 0;
  color: rgba(245, 242, 234, 0.65);
}
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col h4 {
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.3em;
  margin: 0 0 8px;
  text-transform: uppercase;
  color: var(--gold);
}
.footer-col a {
  font-family: var(--serif);
  font-size: 16px;
  color: rgba(245, 242, 234, 0.8);
  transition: color .25s;
}
.footer-col a:hover { color: var(--gold-light); }
.footer-legal p { margin: 0; font-family: var(--serif); font-size: 14px; color: rgba(245,242,234,0.6); }
.footer-legal .ps { font-style: italic; margin-top: 8px; }

body[data-lang="both"] .site-footer a .lang-it::after { color: var(--gold); }

/* ============== POPUP ============== */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 21, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
}
.popup-overlay.is-open { opacity: 1; visibility: visible; }
.popup-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--gold);
  padding: 56px 48px 40px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  transform: translateY(20px) scale(0.97);
  transition: transform .5s var(--ease);
}
.popup-overlay.is-open .popup-card { transform: translateY(0) scale(1); }
.popup-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  background: transparent;
  border: 0;
  font-size: 28px;
  color: var(--ink-mute);
  line-height: 1;
  transition: color .2s;
}
.popup-close:hover { color: var(--gold); }
.popup-eyebrow {
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 12px;
}
.popup-title {
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.popup-text {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 28px;
}
.popup-form {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.popup-form input[type="email"] {
  flex: 1;
  font-family: var(--serif);
  font-size: 15px;
  border: 1px solid var(--hairline-strong);
  background: var(--paper-warm);
  padding: 12px 14px;
  outline: none;
  transition: border-color .25s;
}
.popup-form input[type="email"]:focus { border-color: var(--gold); }
.popup-form .btn { padding: 12px 20px; font-size: 11px; }
.popup-message {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  min-height: 1em;
  color: var(--gold-deep);
}
.popup-message.is-error { color: #B33A2E; }
.popup-dismiss {
  background: transparent;
  border: 0;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--hairline);
}
.popup-dismiss:hover { color: var(--ink); }

/* ============== FLOATING BUTTON ============== */
.floating-subscribe {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--gold);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  box-shadow: 0 14px 30px -12px rgba(26,24,21,0.4);
  transition: all .3s var(--ease);
  transform: translateY(80px);
  opacity: 0;
}
.floating-subscribe.is-visible { transform: translateY(0); opacity: 1; }
.floating-subscribe:hover {
  background: var(--gold);
  color: var(--ink);
}
.floating-subscribe svg { width: 16px; height: 16px; }

/* ============== REVEAL ANIMATIONS ============== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ============== RESPONSIVE ============== */
@media (max-width: 980px) {
  .header-inner { grid-template-columns: auto auto; padding: 14px 20px; }
  .primary-nav {
    grid-column: 1 / -1;
    order: 4;
    overflow: hidden;
    max-height: 0;
    transition: max-height .4s var(--ease);
    flex-direction: column;
    gap: 16px;
    padding: 0 0;
  }
  .site-header.is-open .primary-nav { max-height: 400px; padding: 16px 0; }
  .lang-switch { order: 2; }
  .nav-toggle { display: flex; order: 3; }
  .site-header.is-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .site-header.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.is-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .section { padding: 80px 24px; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .portrait-frame { max-width: 280px; margin: 0 auto; }
  .author-meta { grid-template-columns: 1fr; gap: 16px; }
  .book {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 60px 0;
  }
  .book-cover { max-width: 280px; }
  .book-index { font-size: 56px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .newsletter-card { padding: 60px 28px; }
  .contact-card { padding: 60px 28px; }
  .field-row, .field-row-bottom { grid-template-columns: 1fr; }
  .popup-form { flex-direction: column; }
  .floating-subscribe span { display: none; }
  .floating-subscribe { padding: 14px; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .hero { padding: 60px 20px 100px; min-height: 80vh; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .footer-inner { grid-template-columns: 1fr; }
  .newsletter-card { padding: 48px 20px; }
  .contact-card { padding: 48px 20px; }
  .contact-submit-row .btn { width: 100%; }
  .book-index { font-size: 44px; }
}

/* ============== PRINT ============== */
@media print {
  .site-header, .floating-subscribe, .popup-overlay,
  .lang-switch, .nav-toggle, .scroll-cue, .hero-cta { display: none !important; }
  body { background: white; }
}

/* ============================================================
   LIGHTBOX COPERTINE
   ============================================================ */

/* Overlay zoom al hover sulla copertina */
.book-cover {
  overflow: hidden; /* contiene lo zoom */
}
.book-cover img.cover-zoomable {
  transition: transform 0.45s var(--ease), filter 0.45s var(--ease);
  cursor: zoom-in;
}
.book-cover:hover img.cover-zoomable {
  transform: scale(1.06);
  filter: brightness(0.55);
}
.cover-zoom-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #FFFFFF !important;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0,0,0,0.9), 0 0 24px rgba(0,0,0,0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
  z-index: 2;
}
.cover-zoom-hint span {
  color: #FFFFFF !important;
  text-shadow: 0 1px 8px rgba(0,0,0,0.9), 0 0 24px rgba(0,0,0,0.7);
}
.cover-zoom-hint::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B8924A' stroke-width='1.5'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E") center/20px no-repeat;
  margin-bottom: 8px;
}
.book-cover:hover .cover-zoom-hint {
  opacity: 1;
}

/* Lightbox backdrop + contenuto */
.cover-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-lightbox[hidden] {
  display: none;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 14, 12, 0.92);
  cursor: zoom-out;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lightbox-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: min(90vw, 520px);
  animation: lightbox-in 0.35s var(--ease) both;
}
@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.lightbox-content img {
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.8);
  border: 1px solid rgba(184,146,74,0.25);
}
.lightbox-caption {
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 242, 234, 0.55);
  text-align: center;
  margin: 0;
}
.lightbox-close {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 9001;
  width: 44px;
  height: 44px;
  background: rgba(26, 24, 21, 0.7);
  border: 1px solid rgba(184, 146, 74, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  padding: 0;
}
.lightbox-close svg {
  width: 18px;
  height: 18px;
  stroke: var(--gold);
}
.lightbox-close:hover {
  background: rgba(184, 146, 74, 0.15);
  border-color: var(--gold);
  transform: rotate(90deg);
}

/* Mobile */
@media (max-width: 560px) {
  .lightbox-content {
    max-width: 94vw;
  }
  .lightbox-close {
    top: 14px;
    right: 14px;
  }
}
