:root {
  /* Palette calda e luminosa: carta antica, cuoio e oro */
  --bg: #fdfcf8;
  --card: #ffffff;
  --text: #2c241e;
  --muted: #6d5a4a;
  --brand: #916a3b;
  --brand-light: #e6dccf;
  --line: #dcd0c0;
  --radius: 8px;
  --max: 1100px;
  --shadow: 0 4px 20px rgba(145, 106, 59, 0.10);
  --sans: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Georgia", "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { font-family: var(--sans); }

body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);

  /* Texture "carta" leggerissima su TUTTE le pagine */
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(145, 106, 59, 0.015) 2px,
      rgba(145, 106, 59, 0.015) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(145, 106, 59, 0.012) 2px,
      rgba(145, 106, 59, 0.012) 4px
    );
  line-height: 1.6;
}

h1, h2, h3, .brand-name {
  font-family: var(--serif);
  color: var(--brand);
}

a {
  color: var(--brand);
  text-underline-offset: 3px;
  transition: all 0.2s;
}
a:hover { color: var(--text); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand);
  color: #fff;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus { top: 0; }

/* =========================
   HEADER CON ANIMAZIONE EDITORIALE
   ========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 252, 248, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--brand);
  box-shadow: 0 2px 10px rgba(145, 106, 59, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 0;
}

.brand-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.brand-sub {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-toggle {
  margin-left: auto;
  display: none;
  border: 1px solid var(--line);
  background: var(--brand-light);
  color: var(--brand);
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

.site-nav a {
  text-decoration: none;
  padding: 8px 15px;
  color: var(--text);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  position: relative;
  transition: color 0.3s ease;
}

/* Linea animata per il menu */
.site-nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 5px;
  left: 50%;
  background-color: var(--brand);
  transition: all 0.25s ease;
  transform: translateX(-50%);
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  width: 60%;
}

.site-nav a.is-active {
  color: var(--brand);
}

.site-nav a:hover {
  color: var(--brand);
  background: transparent;
}

/* =========================
   HOME: HERO SOLO IMMAGINE
   ========================= */

.hero-image-only {
  height: 60vh;
  background-image: url("images/hero-carlo2.jpg");
  background-size: cover;
  background-position: center 18%;
  background-repeat: no-repeat;
  border-bottom: 3px solid var(--brand);
}

/* =========================
   HOME: HERO CONTENT (INTRO)
   ========================= */

.intro-narrative {
  background: linear-gradient(
    to bottom,
    #efe3d4 0%,
    #fdfcf8 60%
  );
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.intro-home-refined {
  padding: 35px 0 85px;
}

/* "Tra Roma, Anghiari e la memoria" - effetto paesaggio */
.hero-sub-label {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #4a332d;
  opacity: 0.75;
  margin: 0;
  line-height: 1.5;
}

.hero-label-group {
  margin-bottom: 35px;
}

/* Citazione */
.manifesto-refined {
  margin: 0 auto;
  max-width: 820px;
}

/* Frase-manifesto (grande) */
.quote-main {
  font-family: var(--serif);
  font-size: 3.15rem;
  font-weight: 700;
  color: #3b2a24;
  margin: 0 0 22px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

/* Nota a margine (piccola, stretta) */
.quote-details {
  max-width: 460px;
  margin: 0 auto;
}

.quote-details p {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--muted);
  font-style: italic;
}

.quote-details cite {
  display: block;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 0.70rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  opacity: 0.75;
  font-style: normal;
}

/* CTA: ancorate con più spazio (ritmo) */
.cta-anchor {
  max-width: 520px;
  margin: 50px auto 0;
}

.cta-line {
  width: 44px;
  height: 1px;
  background: var(--line);
  margin: 0 auto 22px;
}

/* CTA LINK MODEL: ANIMAZIONE EDITORIALE */
.cta-links-refined {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin-top: 2px;
}

.cta-links-refined a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.84rem;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

/* Effetto sottolineatura che si espande dal centro */
.cta-links-refined a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 50%;
  background-color: currentColor;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.cta-links-refined a:hover::after {
  width: 100%;
}

/* Link Principale: I romanzi (Marcato) */
.link-main {
  font-weight: 800;
  color: #7b552f;
}

/* Sottolineatura fissa leggera per il principale */
.link-main::after {
  width: 60%;
  opacity: 0.4;
}

.link-main:hover {
  color: var(--text);
}

.link-main:hover::after {
  opacity: 1;
}

/* Link Secondario: Il percorso (Discreto) */
.link-sub {
  font-weight: 500;
  color: var(--muted);
  opacity: 0.75;
}

.link-sub:hover {
  opacity: 1;
  color: var(--brand);
}

/* Separatore */
.link-sep {
  color: var(--line);
  font-family: var(--serif);
  font-size: 1.1rem;
  user-select: none;
  opacity: 0.6;
}

/* =========================
   (Legacy) Stili pulsanti - non usati in home ma lasciati per compatibilità
   ========================= */

.cta {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 800;
  transition: all 0.2s;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-size: 0.84rem;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  padding: 13px 40px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}

.btn-primary:hover {
  background: #5d4037;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.16);
}

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 12px 28px;
}

.btn-secondary:hover {
  background: var(--brand-light);
  color: var(--text);
}

/* =========================
   HERO PAGINE INTERNE
   ========================= */

.hero {
  position: relative;
  padding: 80px 0;
  background-image: url("images/hero-carlo2.jpg");
  background-size: cover;
  background-position: center 18%;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(253, 252, 248, 0.75);
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.hero.hero-small { padding: 70px 0; }

.hero.hero-small .hero-text {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero.hero-small h1 {
  font-size: 3rem;
  color: #5d4037;
  margin: 0 0 15px;
  text-shadow: 0 2px 8px rgba(255,255,255,0.8);
  border-bottom: 3px solid var(--brand);
  display: inline-block;
  padding-bottom: 8px;
}

.hero.hero-small .hero-text p {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text);
  margin: 0;
}

/* =========================
   CONTENUTO PRINCIPALE
   ========================= */

.content { padding: 60px 0; }

.prose {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 40px;
  box-shadow: var(--shadow);
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.prose::before {
  content: "";
  position: absolute;
  top: 10px; left: 10px; right: 10px; bottom: 10px;
  border: 1px solid #f0e6d8;
  pointer-events: none;
}

.prose h2 {
  margin: 0 0 30px;
  font-size: 2rem;
  text-align: center;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--brand-light);
}

.prose h3 {
  margin: 30px 0 20px;
  font-size: 1.5rem;
  color: var(--brand);
}

.prose p {
  margin: 0 0 20px;
  font-size: 1.05rem;
  color: var(--text);
  text-align: justify;
  line-height: 1.8;
}

.prose p:last-of-type {
  margin-bottom: 0;
}

.prose .note {
  text-align: center;
  margin-top: 30px;
  font-style: italic;
}

/* Link "Leggi la biografia": animazione freccia */
.read-more-link {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--brand);
  text-decoration: none;
  transition: all 0.3s ease;
}

.read-more-link span {
  display: inline-block;
  transition: transform 0.3s ease;
  margin-left: 5px;
}

.read-more-link:hover {
  color: var(--text);
}

.read-more-link:hover span {
  transform: translateX(6px);
}

/* Link esterni ufficiali (fuori dalla hero) */
.external-links {
  margin-top: 26px;
  text-align: center;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.external-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}
.external-links a:hover { color: var(--brand); }
.external-links .sep {
  margin: 0 12px;
  color: var(--line);
}

/* =========================
   BIO PAGE
   ========================= */

.bio-intro {
  position: relative;
}

.bio-img {
  float: right;
  width: 300px;
  margin: 0 0 20px 20px;
  border: 5px solid #fff;
  box-shadow: var(--shadow);
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

.video-section {
  margin: 30px 0;
}

.video-section h3 {
  text-align: center;
  margin-bottom: 10px;
  color: var(--brand);
  font-family: var(--serif);
}

.video-section p {
  text-align: center;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 20px 0;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =========================
   ARTICOLI (2+2 GRID)
   ========================= */

.articles-section {
  margin: 30px 0;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-top: 25px;
}

.article-card {
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: bold;
  text-align: center;
  transition: transform 0.2s;
  display: block;
}

.article-card:hover {
  transform: translateY(-5px);
}

.article-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* =========================
   SOCIAL FEED (Facebook)
   ========================= */

.social-feed {
  background: transparent;
  padding: 40px 0;
}

.social-feed .prose {
  text-align: center;
}

.fb-embed {
  margin-top: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #fff;
  padding: 10px;
}

/* =========================
   FOOTER
   ========================= */

.site-footer {
  background: #2c241e;
  padding: 40px 0;
  color: #dcd0c0;
  margin-top: 60px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 20px;
  justify-content: flex-end;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--brand-light); }

.copyright {
  margin: 0;
  font-size: 0.9rem;
}

.credits {
  grid-column: 1 / -1;
  border-top: 1px solid #453a31;
  padding-top: 20px;
  margin-top: 10px;
  font-size: 0.85rem;
  opacity: 0.8;
  text-align: center;
}

.credits a {
  color: var(--brand-light);
  text-decoration: none;
}
.credits a:hover { text-decoration: underline; }

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 880px) {
  .hero-image-only { height: 50vh; }

  .nav-toggle { display: inline-block; }

  .site-nav {
    display: none;
    width: 100%;
    padding: 10px 0;
    border-top: 1px solid var(--line);
  }

  .site-nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .prose { padding: 25px; }
  .prose h2 { font-size: 1.6rem; }
  .prose h3 { font-size: 1.3rem; }
  .prose p { font-size: 1rem; }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-links { justify-content: center; }

  .hero-sub-label {
    font-size: 1.5rem;
    letter-spacing: 0.18em;
  }

  .quote-main { font-size: 2.55rem; }

  .cta-anchor { margin-top: 46px; }
}

@media (max-width: 768px) {
  .hero-image-only { height: 40vh; }

  .intro-home-refined { padding: 30px 0 70px; }

  .hero-sub-label {
    font-size: 1.3rem;
    letter-spacing: 0.16em;
  }

  .quote-main { font-size: 2.2rem; }

  .quote-details { max-width: 520px; }
  .quote-details p { font-size: 0.98rem; }

  .cta-links-refined {
    flex-wrap: wrap;
    gap: 10px;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero-image-only { height: 35vh; }

  .hero-sub-label {
    font-size: 1.1rem;
    letter-spacing: 0.14em;
  }

  .quote-main { font-size: 1.95rem; }

  .cta-anchor { margin-top: 40px; }
  .cta-line { margin-bottom: 18px; }

  .bio-img {
    float: none;
    width: 100%;
    margin: 0 0 20px 0;
  }
}

/* =========================
   BIBLIOGRAFIA (Book Grid)
   ========================= */

.book-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:18px;
  align-items:stretch;
  margin-top: 18px;
}

@media (max-width: 1100px){
  .book-grid{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px){
  .book-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .book-grid{ grid-template-columns:1fr; }
}

.book-card{
  background: var(--card, #ffffff);
  border:1px solid rgba(80, 50, 20, 0.14);
  border-radius:14px;
  overflow:hidden;
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.book-card:hover{
  transform: translateY(-2px);
  border-color: rgba(80, 50, 20, 0.25);
  box-shadow: 0 12px 30px rgba(27, 20, 12, 0.14);
}

.book-cover{
  background: linear-gradient(180deg, rgba(205, 178, 125, 0.10), rgba(205, 178, 125, 0.02));
  padding:14px;
}

.book-cover img{
  width:100%;
  height:auto;
  display:block;
  border-radius:10px;
  border:1px solid rgba(80, 50, 20, 0.10);
  background:#fff;
  box-shadow: 0 8px 18px rgba(27, 20, 12, 0.12);
  /* se le copertine hanno formati diversi, questo uniforma */
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.book-info{
  padding:14px 14px 16px;
  display:flex;
  flex-direction:column;
  gap:8px;
  flex:1;
}

.book-info h3{
  margin:0;
  font-size: 1.05rem;
  line-height:1.25;
}

.book-year{
  margin:0;
  color: var(--muted);
  font-size: .95rem;
}

.btn.btn-outline{
  margin-top:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  border:1px solid rgba(80, 50, 20, 0.26);
  color: var(--ink);
  background: transparent;
  padding:10px 12px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.btn.btn-outline:hover{
  background: rgba(205, 178, 125, 0.18);
  border-color: rgba(80, 50, 20, 0.38);
  transform: translateY(-1px);
}

/* =========================
   SCHEDA LIBRO (Detail)
   ========================= */

.book-detail-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 60px;
  margin-top: 40px;
}

@media (max-width: 850px) {
  .book-detail-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .book-aside {
    max-width: 300px;
    margin: 0 auto;
  }
}

.book-sticky-cover {
  position: sticky;
  top: 100px;
}

.main-cover {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.05);
}

.book-meta-box {
  margin-top: 20px;
  padding: 15px;
  background: rgba(205, 178, 125, 0.1);
  border-radius: 8px;
  font-size: 0.9rem;
}

.book-meta-box p {
  margin: 5px 0;
}

.btn-amazon {
  display: block;
  text-align: center;
  background: #232f3e;
  color: white !important;
  padding: 12px;
  border-radius: 6px;
  margin-top: 20px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s;
}

.btn-amazon:hover {
  background: #37475a;
}

.breadcrumb {
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.book-header h1 {
  margin-top: 0;
  font-size: 2.5rem;
  color: var(--ink);
}

.book-subtitle {
  font-size: 1.4rem;
  font-style: italic;
  color: var(--muted);
  margin-top: -10px;
  margin-bottom: 30px;
}

.book-section {
  margin-bottom: 40px;
}

.quotes blockquote {
  border-left: 4px solid var(--gold);
  padding-left: 20px;
  margin-left: 0;
  font-style: italic;
  background: rgba(205, 178, 125, 0.05);
  padding: 20px;
}

.quotes cite {
  display: block;
  margin-top: 10px;
  font-weight: bold;
  font-style: normal;
}


.facebook-posts .fb-page > span,
.facebook-posts .fb-page iframe {
  margin: 0 auto !important;
  display: block !important;
  max-width: 100%;
}

@media (max-width: 880px) {
  .facebook-posts .container {
    margin: 20px 15px;
    padding: 25px 15px;
  }
}
/* Sezione Facebook normalizzata - LARGHEZZA IDENTICA AL BOX SUPERIORE */
.facebook-posts .container {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 40px;                    /* Aumentato a 40px per matchare .prose */
  max-width: 900px;                 /* PORTATO A 900PX come la classe .prose */
  margin: 40px auto;
  border-radius: var(--radius);
  text-align: center;
  position: relative;
}

/* Bordo interno identico a .prose */
.facebook-posts .container::before {
  content: "";
  position: absolute;
  top: 10px; left: 10px; right: 10px; bottom: 10px;
  border: 1px solid #f0e6d8;
  pointer-events: none;
}

.facebook-posts h2 {
  font-family: var(--serif);
  color: var(--brand);
  margin: 0 0 30px;                 /* Matchato il margine di .prose h2 */
  font-size: 2rem;                  /* Matchata la dimensione di .prose h2 */
  padding-bottom: 15px;
  border-bottom: 2px solid var(--brand-light); /* Aggiunta linea sotto titolo come sopra */
  position: relative;
  z-index: 1;
}

/* Centratura del widget */
.facebook-posts .fb-page,
.facebook-posts .fb-page > span,
.facebook-posts .fb-page iframe {
  margin: 0 auto !important;
  display: block !important;
}