/* ---------------------------------------------------------
   FONT
--------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500&family=Lora:wght@400&display=swap');

/* ---------------------------------------------------------
   ROOT VARS — colori base carta
--------------------------------------------------------- */
:root {
  --paper-base: #d4cabb;
  --paper-warm: #dbcfc0;
  --paper-cool: #cec3b3;
  --paper-shadow: rgba(0,0,0,0.06);

  --ink: #14110e;
  --max-ch: 68ch;
}

/* RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 18px; }

/* ---------------------------------------------------------
   BODY — CARTA RUVIDA CSS
--------------------------------------------------------- */
body {
  min-height: 100vh;
  font-family: 'Lora', serif;
  color: #14110e;
  line-height: 1.75;

  /* SFONDO CARTA REALE */
  background-image: url("/assets/paper.png");
  background-size: 600px;          /* scala naturale identica all’immagine che hai caricato */
  background-repeat: repeat;       /* pattern continuo */
  background-attachment: fixed;    /* effetto carta statica */
  background-position: center;
  background-color: #d4cabb;       /* colore base sotto al pattern */

  padding: 8vh 6vw;
}


/* ---------------------------------------------------------
   CONTENITORE
--------------------------------------------------------- */
.post,
#ultimo-post,
#elenco-completo,
.single-page,
main {
  max-width: var(--max-ch);
  margin: 0 auto;
  text-wrap: pretty;
  hyphens: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------
   TITOLI
--------------------------------------------------------- */
h1{
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(2.2rem, 3vw + 1rem, 3.5rem);
  line-height: 1.15;
  margin-bottom: 1.2rem;
}

.meta{
  color: rgba(0,0,0,0.55);
  font-size: .95rem;
  margin-bottom: 2rem;
  font-style: italic;
}

/* ---------------------------------------------------------
   PARAGRAFI
--------------------------------------------------------- */
p{
  margin-bottom: 1.15rem;
  letter-spacing: .01em;
  text-shadow: 0 0 0.5px rgba(0,0,0,0.06);
}

/* Capolettera */
p:first-of-type::first-letter{
  float: left;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 5rem;
  line-height: 0.9;
  padding-right: 0.3rem;
  margin-top: 0.1rem;
  margin-right: 0.05rem;
  color: var(--ink);
}

/* ---------------------------------------------------------
   FIGURE / IMMAGINI
--------------------------------------------------------- */
figure{
  margin: 2.5rem 0;
  position: relative;
}

figure img{
  width: 100%;
  display: block;
  border-radius: 2px;
  filter: contrast(0.9) brightness(0.97);
  opacity: 0.92;
}

figure::after{
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(0,0,0,0.05) 0 1px, transparent 1.2px);
  background-size: 180px 180px;
  mix-blend-mode: multiply;
  opacity: .22;
  pointer-events: none;
}

figcaption{
  text-align: center;
  font-size: .85rem;
  color: rgba(0,0,0,0.6);
  margin-top: .5rem;
  font-style: italic;
}

/* ---------------------------------------------------------
   BLOCKQUOTE
--------------------------------------------------------- */
blockquote{
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  margin: 1.8rem 0;
  padding: 0 1.2rem;
  border-left: 2px solid rgba(0,0,0,0.18);
  color: rgba(0,0,0,0.8);
}

/* ---------------------------------------------------------
   FOOTER INDICE
--------------------------------------------------------- */
.post-index{
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0,0,0,0.25);
}

.post-index h2{
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.post-index ul{
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.post-index li{
  margin-bottom: 0.4rem;
}

.post-index a{
  color: var(--ink);
  text-decoration: none;
}

.post-index a:hover{
  text-decoration: underline;
}

/* ---------------------------------------------------------
   INDICE COMPLETO (/indice)
--------------------------------------------------------- */
.full-index{
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
}

.full-index li{
  margin-bottom: .4rem;
}

/* ---------------------------------------------------------
   COOKIE BANNER
--------------------------------------------------------- */
#cookie-banner{
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: .8rem 1rem;
  border-radius: 6px;
  font-size: .85rem;
  max-width: 280px;
  z-index: 9999;
}

#cookie-banner button{
  background: #fff;
  border: none;
  padding: .25rem .6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .75rem;
  margin-left: .5rem;
}

/* ---------------------------------------------------------
   SELEZIONE TESTO
--------------------------------------------------------- */
::selection{
  background: rgba(0,0,0,0.12);
  color: var(--ink);
}
