/* =========================================================
   LemmaPress Minimal Theme - style.css
   ========================================================= */

/* ---------------------------------------------------------
   VARIABILI BASE
   Colori e font globali
--------------------------------------------------------- */
:root {
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --color-text: #111;
  --color-bg: #fff;
  --color-accent: #b52828;
  --color-muted: #666;
  --max-width: 60rem;
}

/* ---------------------------------------------------------
   RESET BASE
--------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 1rem;
}

/* ---------------------------------------------------------
   TIPOGRAFIA
--------------------------------------------------------- */
.site-title,
.hero h1 {
  text-transform: none !important;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

p {
  margin: 0.8rem 0;
  max-width: 40em;
}

a {
  color: var(--color-accent);
  text-decoration: underline;        /* sottolineatura sempre visibile */
}
a:hover {
  color: #911f1f;
  text-decoration: underline;
}

/* ---------------------------------------------------------
   LAYOUT GENERALE
--------------------------------------------------------- */
header,
footer {
  text-align: center;
  padding: 1rem;
  border-bottom: 1px solid #ddd;
}

main {
  width: 90%;
  max-width: var(--max-width);
  margin: 2rem auto;
/*  text-align: center; */
}
.hero,
.catalogo-evidenza,
.manifesto,
.collabora {
  text-align: center;
}
main h1,
main h2,
main h3 {
  text-align: center;
}
main p {
  text-align: left;
  margin: 0.9rem auto;
  max-width: 40em;
  line-height: 1.7;
}

/* ---------------------------------------------------------
   HEADER E LOGO
--------------------------------------------------------- */
.site-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem; /* spazio tra logo e testo */
  font-size: 1.5rem;
  font-family: "Spectral", serif;
  text-transform: none;
  font-variant: normal;
}

.site-title a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo {
  width: 42px;
  height: auto;
}

/* ---------------------------------------------------------
   NAVIGAZIONE - DESKTOP
--------------------------------------------------------- */
.site-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.site-nav a {
  color: var(--color-accent);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.site-nav a:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: underline;
}

/* link attivo (pagina corrente) */
.site-nav a.active {
  text-decoration: underline;
  font-weight: 600;
  color: #911f1f; /* tono più scuro per evidenziare la pagina corrente */
}

/* Icona hamburger e checkbox nascosti di default (desktop) */
.menu-icon,
#menu-toggle {
  display: none;
}

/* ---------------------------------------------------------
   RESPONSIVE MENU (600px)
--------------------------------------------------------- */
@media (max-width: 600px) {
  header {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .site-title {
    justify-content: center;
  }
  .menu-icon {
    display: inline-block;
    font-size: 1.8rem;
    cursor: pointer;
  }
  nav {
    display: none;
    flex-direction: column;
    background: #fff;
    padding: 1rem 0;
    gap: 0.6rem;
  }
  #menu-toggle:checked + .menu-icon + nav {
    display: flex;
  }
  nav a {
    padding: 0.4rem 0;
  }
}

/* ---------------------------------------------------------
   CARD LIBRI - CATALOGO
--------------------------------------------------------- */
.catalogo .grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  width: 80%;
  margin: 2rem auto;
  justify-content: center;
}

.card {
  border: 1px solid #eee;
  padding: 1rem;
  border-radius: 6px;
  background: #fff;
  text-align: center;
  transition: transform .1s ease-in-out, box-shadow .1s ease-in-out;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.card img {
  width: 100%;
  max-width: 180px;
  border-radius: 5px;
  height: auto;
  margin-bottom: 0.5rem;
  object-fit: cover;
  aspect-ratio: auto;
}

@media (max-width: 600px) {
  .card img {
    max-width: 60vw;
  }
}

.cover-box {
  width: 334px;
  height: 500px;
  max-width: 100%;
  overflow: hidden;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: -webkit-optimize-contrast;
  transform: translateZ(0);
}
.cover-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ---------------------------------------------------------
   PULSANTI
--------------------------------------------------------- */
.buy-button {
  background: var(--color-accent);
  color: #fff !important;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 5px;
  display: inline-block;
  margin-top: 0.6rem;
  text-decoration: none;
  transition: background 0.15s ease-in-out, transform 0.1s ease-in-out;
}
.buy-button:hover {
  background: #911f1f;
  transform: translateY(-2px);
}
.buy-button.small {
  padding: 0.4rem 0.7rem;
  font-size: 0.9rem;
}

/* ---------------------------------------------------------
   FOOTER
--------------------------------------------------------- */
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  border-top: 1px solid #ddd;
  font-size: 0.9rem;
  color: var(--color-muted);
  padding: 1.5rem 1rem;
  margin-top: 3rem;
  background: #fff;
  box-sizing: border-box;
}
footer p {
  margin: 0.4rem 0;
  line-height: 1.4;
}

/* ---------------------------------------------------------
   HERO + HOME GRID + SEZIONI
--------------------------------------------------------- */
.hero {
  text-align: center;
  margin-top: 2rem;
}
.hero h1 {
  font-family: "Spectral", serif;
  font-size: 4rem;
  margin-bottom: 0.3rem;
  text-transform: none;
}
.hero .subtitle {
  font-family: "Spectral", serif;
  color: var(--color-muted);
  font-style: italic;
}
.hero .lead {
  font-family: "Spectral", serif;
  font-size: 1.1rem;
  max-width: 40em;
  margin: 1rem auto 0 auto;
  line-height: 1.7;
  color: #222;
}

/* ---------------------------------------------------------
   PAGINE STATICHE
--------------------------------------------------------- */
.page-wrapper {
  width: 80%;
  max-width: var(--max-width);
  margin: 3rem auto;
  line-height: 1.7;
  text-align: left;
}
.page-wrapper h1,
.page-wrapper h2,
.page-wrapper h3 {
  text-align: center;
  font-family: "Bebas Neue", sans-serif;
  margin-bottom: 1rem;
}
.page-wrapper p {
  font-family: "Spectral", serif;
  font-size: 1.05rem;
  color: #222;
  max-width: 40em;
  margin: 0.9rem auto;
}
@media (max-width: 600px) {
  .page-wrapper {
    width: 92%;
  }
}

/* ---------------------------------------------------------
   SCHEDA LIBRO (layout flessibile immagine + dati)
--------------------------------------------------------- */
.book-flex {
  max-width: var(--max-width);
  width: 90%;
  margin: 2rem auto;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.book-image img {
  max-width: 240px;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  display: block;
}

.book-data {
  flex: 1;
  min-width: 240px;
  max-width: 30rem;
  font-family: "Spectral", serif;
  line-height: 1.6;
  text-align: left;
}

.book-data p {
  margin: 0.4rem 0;
}

.book-content {
  text-align: left;
  max-width: 42em;
  margin: 2.5rem auto 0 auto;
  line-height: 1.7;
  font-family: "Spectral", serif;
}

/* Mobile - impila immagine sopra i dati */
@media (max-width: 800px) {
  .book-flex {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .book-data { text-align: left; }
  .book-image img { max-width: 70vw; }
}

/* =========================================================
   HERO (homepage)
   ========================================================= */
.hero {
  display: block;
  width: 100%;
  max-width: var(--max-width);
  margin: 3rem auto 4rem auto;
  padding: 2rem 1rem;
  text-align: center;
}

.hero h1 {
  font-family: "Spectral", serif;
  font-size: 4rem;
  margin: 0 0 0.4rem 0;
  color: #111;
}

.hero .subtitle {
  font-family: "Spectral", serif;
  font-style: italic;
  color: var(--color-muted);
  display: block;
  margin-bottom: 0.8rem;
}

.hero .lead {
  font-family: "Spectral", serif;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #222;
  max-width: 40em;
  margin: 0 auto;
}

/* elimina vecchi debug */
.hero * {
  outline: none !important;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  visibility: visible;
  opacity: 1;
  background: none;
}

/* =========================================================
   CATALOGO-EVIDENZA (home grid immagini)
   ========================================================= */
.catalogo-evidenza {
  text-align: center;
  margin: 3rem auto;
}

.catalogo-evidenza .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  justify-content: center;
  width: 80%;
  margin: 0 auto 2rem auto;
}

.catalogo-evidenza .thumb {
  text-decoration: none;
  color: inherit;
  text-align: center;
}

.catalogo-evidenza .thumb img {
  width: 100%;
  max-width: 180px;
  border-radius: 5px;
  height: auto;
  margin: 0 auto 0.3rem auto;
  transition: transform .15s ease-in-out;
  aspect-ratio: 0.66;
  object-fit: cover;
}

.catalogo-evidenza .thumb img:hover {
  transform: scale(1.03);
}

.catalogo-evidenza .thumb h3 {
  font-family: "Spectral", serif;
  font-size: 1rem;
}

@media (max-width: 600px) {
  .catalogo-evidenza .grid {
    width: 95%;
    gap: 1rem;
  }
  .catalogo-evidenza .thumb img {
    max-width: 45vw;
    aspect-ratio: 0.66;
  }
}

/* =========================================================
   REFINEMENT - Catalogo layout & titles + Home
   ========================================================= */

/* 1 === Titolo nero non sottolineato (uniforme alla home) === */
.catalogo .info h2 a {
  color: #111;
  text-decoration: none;
}
.catalogo .info h2 a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* 2 === Dimezza spazio fra immagine e titolo === */
.card img {
  margin-bottom: 0.25rem; /* prima era 0.5rem */
}

/* 3 === Pulsante "Acquista" sempre in basso === */
.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* distanzia contenuto e bottone */
  height: 100%;
}
.card .info {
  flex-grow: 1; /* permette alla descrizione di occupare lo spazio disponibile */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.card .buy-button.small {
  align-self: center;     /* centra orizzontalmente */
  margin-top: auto;       /* forza il bottone in basso */
}

/* 4 === Descrizione troncata a due righe con ellissi ===  */
.card .excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;      /* massimo due righe */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.8rem;      /* un po' di respiro sopra il bottone */
}

/* 5 === Compatta definitivamente spazi verticali nella griglia Catalogo === */
.catalogo .grid .card {
  padding-top: -2rem !important;      /* meno aria sopra */
  padding-bottom: 1rem !important;   /* meno aria sotto */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.catalogo .grid .card img {
  max-width: 200px !important;
  margin-top: -12rem !important;      /* spinge l'immagine verso l'alto */
  margin-bottom: -0.2rem !important;   /* riduce il vuoto sotto */
  display: block;
}

/* === Rimuove spazio eccessivo tra immagine e titolo === */
.catalogo .grid .card .info h2 {
  margin-top: -8rem !important;   /* prima il browser default: ~1.5rem */
  margin-bottom: 0.3rem !important; /* spazio uniforme sopra/sotto */
  line-height: 1.3;
}

.catalogo .grid .card {
  height: 760px;             /* stessa altezza per tutte le card */
  justify-content: flex-start;
}


