/* ==========================================================================
   Testi Sacri — Design minimale contemplativo
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --avorio: #FAF8F5;
  --avorio-scuro: #F0EDE8;
  --grigio-caldo: #6B6560;
  --grigio-chiaro: #6D6B68;
  --terracotta: #C4745A;
  --terracotta-scuro: #A85E46;
  --testo: #2C2824;
  --testo-leggero: #4A4440;
  --bordo: #E0DBD5;
  --bianco: #FFFFFF;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  color: var(--testo);
  background-color: var(--avorio);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* --- Tipografia --- */
h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-weight: 500;
  line-height: 1.3;
  color: var(--testo);
}

h1 { font-size: 2.2rem; margin-bottom: 0.8rem; }
h2 { font-size: 1.6rem; margin-bottom: 0.6rem; margin-top: 2rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.5rem; margin-top: 1.5rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--terracotta);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--terracotta-scuro); }

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

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  min-height: calc(100vh - 160px);
}

/* --- Navigazione --- */
.site-nav {
  background: var(--bianco);
  border-bottom: 1px solid var(--bordo);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--testo);
  letter-spacing: 0.02em;
}
.nav-brand:hover { color: var(--terracotta); }

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-menu a {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--grigio-caldo);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--terracotta);
  border-bottom-color: var(--terracotta);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--testo);
  transition: transform 0.2s;
}

/* --- Hero / Homepage --- */
.hero {
  text-align: center;
  padding: 5rem 0 3rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-bottom: 1.2rem;
}

.citazione {
  font-style: italic;
  color: var(--grigio-caldo);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.intro {
  font-size: 1.05rem;
  color: var(--testo-leggero);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.9;
}

/* --- Griglia categorie homepage --- */
.categorie {
  padding: 2rem 0 4rem;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.cat-card {
  background: var(--bianco);
  border: 1px solid var(--bordo);
  border-radius: 4px;
  padding: 0;
  display: block;
  color: var(--testo);
  transition: box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
}

.cat-card:hover {
  border-color: var(--terracotta);
  box-shadow: 0 4px 20px rgba(44, 40, 36, 0.08);
}

.cat-card-img {
  height: 180px;
  overflow: hidden;
}

.cat-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.cat-card:hover .cat-card-img img {
  transform: scale(1.03);
}

.cat-card h2 {
  font-size: 1.3rem;
  margin: 1.2rem 1.5rem 0.5rem;
  font-weight: 500;
}

.cat-card p {
  font-size: 0.9rem;
  color: var(--grigio-caldo);
  padding: 0 1.5rem 1.5rem;
  line-height: 1.6;
}

/* --- Avvertenza homepage --- */
.avvertenza {
  padding: 2rem 0 4rem;
  border-top: 1px solid var(--bordo);
}

.avvertenza h3 {
  font-size: 1.1rem;
  color: var(--grigio-caldo);
  margin-bottom: 0.8rem;
}

.avvertenza p {
  font-size: 0.95rem;
  color: var(--grigio-chiaro);
  line-height: 1.7;
}

/* --- Pagine indice (categorie) --- */
.page-header {
  text-align: center;
  padding: 4rem 0 2rem;
  border-bottom: 1px solid var(--bordo);
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 400;
}

.page-header .intro {
  margin-top: 1rem;
}

.strumenti {
  padding: 1.5rem 0;
  margin-bottom: 1rem;
}

.strumenti h3 {
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grigio-caldo);
  margin-bottom: 0.8rem;
}

.strumenti ul {
  list-style: none;
  padding: 0;
}

.strumenti li {
  padding: 0.3rem 0;
}

.strumenti a {
  font-size: 0.95rem;
}

/* --- Lista testi per sottocategoria --- */
.testi-lista {
  padding: 1rem 0 4rem;
}

.sottocategoria {
  margin-bottom: 2.5rem;
}

.sottocategoria h2 {
  font-size: 1.2rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--testo);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bordo);
  margin-bottom: 0.8rem;
  margin-top: 0;
}

.sottocategoria ul {
  list-style: none;
  padding: 0;
}

.sottocategoria li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--avorio-scuro);
}

.sottocategoria li:last-child {
  border-bottom: none;
}

.sottocategoria a {
  font-size: 1.05rem;
  display: block;
  padding: 0.2rem 0;
}

/* --- Pagina singolo testo --- */
.testo-page {
  padding: 2rem 0 4rem;
}

.breadcrumb {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--grigio-chiaro);
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.breadcrumb a {
  color: var(--grigio-chiaro);
}

.breadcrumb a:hover {
  color: var(--terracotta);
}

.breadcrumb .sep {
  margin: 0 0.4rem;
}

.testo-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--bordo);
}

.testo-header h1 {
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.introduzione {
  background: var(--avorio-scuro);
  border-left: 3px solid var(--terracotta);
  padding: 1.2rem 1.5rem;
  border-radius: 0 4px 4px 0;
  text-align: left;
}

.introduzione p {
  font-size: 0.95rem;
  color: var(--testo-leggero);
  line-height: 1.7;
  margin: 0;
}

/* --- Corpo del testo --- */
.testo-body {
  font-size: 1rem;
  line-height: 1.85;
}

.testo-body h2 {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  text-align: center;
}

.testo-body h3 {
  font-size: 1.2rem;
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
  color: var(--testo-leggero);
}

.testo-body p {
  margin-bottom: 0.8rem;
}

/* Numerazione versetti */
.testo-body .numeri {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: var(--grigio-chiaro);
  vertical-align: super;
  margin-right: 0.15rem;
  font-weight: 500;
}

.testo-body blockquote {
  border-left: 2px solid var(--bordo);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--testo-leggero);
  font-style: italic;
}

.testo-body ul, .testo-body ol {
  margin: 1rem 0 1rem 1.5rem;
}

.testo-body li {
  margin-bottom: 0.3rem;
}

/* --- Testi correlati --- */
.correlati {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--bordo);
}

.correlati h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grigio-caldo);
  margin-bottom: 0.8rem;
}

.correlati ul {
  list-style: none;
  padding: 0;
}

.correlati li {
  padding: 0.3rem 0;
}

/* --- Link "torna a" --- */
.back-link {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bordo);
}

.back-link a {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--grigio-caldo);
}

.back-link a:hover {
  color: var(--terracotta);
}

/* --- Footer --- */
.site-footer {
  background: var(--avorio-scuro);
  border-top: 1px solid var(--bordo);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer p {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--grigio-chiaro);
  margin: 0;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--grigio-chiaro);
}

.footer-nav a:hover {
  color: var(--terracotta);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  html { font-size: 16px; }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bianco);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0;
    border-bottom: 1px solid var(--bordo);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  }

  .nav-menu.show {
    display: flex;
  }

  .nav-menu li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--avorio-scuro);
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .hero { padding: 3rem 0 2rem; }
  .hero h1 { font-size: 2.2rem; }

  .cat-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .page-header { padding: 2.5rem 0 1.5rem; }
  .page-header h1 { font-size: 2rem; }

  .testo-header h1 { font-size: 1.8rem; }

  .footer-container {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }
}
