@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Lora:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --bg: #f5f0e8;
  --bg-card: #faf7f2;
  --ink: #2c2416;
  --ink-light: #6b5d4a;
  --ink-muted: #9e8e7a;
  --accent: #8b3a1e;
  --accent-light: #c4622d;
  --border: #d9cfc0;
  --shadow: rgba(44, 36, 22, 0.08);
}

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

html { font-size: 18px; }

body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23f5f0e8'/%3E%3Crect width='1' height='1' fill='%23ede8de' opacity='0.6'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: 'Lora', Georgia, serif;
  line-height: 1.7;
  min-height: 100vh;
}

/* HEADER NORMALE (usato nelle pagine interne) */
header {
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 2rem 1.5rem;
  text-align: center;
  position: relative;
}

header::before {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin: 0 auto 1.5rem;
}

/* HERO HEADER (solo homepage) */
header.hero-header {
  border-bottom: none;
  padding: 0;
  position: relative;
  height: 420px;
  overflow: hidden;
}

header.hero-header::before { display: none; }

header.hero-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  filter: brightness(1) sepia(0%);
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-line {
  width: 50px;
  height: 2px;
  background: var(--accent-light);
  margin-bottom: 1.2rem;
}

header.hero-header .site-title {
  color: #f5f0e8;
  text-shadow: 0 0 20px rgba(0,0,0,0.9), 0 0 40px rgba(0,0,0,0.7), 0 0 80px rgba(0,0,0,0.5);
}

header.hero-header .site-title span {
  color: #e8a87c;
}

.hero-desc {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 0.85rem;
  color: rgba(245,240,232,0.75);
  margin-top: 0.6rem;
}

.hero-nav {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.15);
  background: rgba(20,14,8,0.08);
}

.hero-nav a {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.9);
  text-decoration: none;
  padding: 0.75rem 1.2rem;
  border-right: 1px solid rgba(255,255,255,0.12);
  transition: color 0.2s;
  text-shadow: 0 0 12px rgba(0,0,0,0.9), 0 0 30px rgba(0,0,0,0.7);
}

.hero-nav a:first-child { border-left: 1px solid rgba(255,255,255,0.12); }
.hero-nav a:hover, .hero-nav a.active { color: #e8a87c; }

@media (max-width: 640px) {
  header.hero-header { height: 320px; }
  .hero-nav a { padding: 0.75rem 0.7rem; font-size: 0.65rem; }
}

.site-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.1;
}

.site-title span {
  color: var(--accent);
}

.site-desc {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.6rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* NAV */
nav {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

nav a {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  text-decoration: none;
  padding: 0.3rem 1.4rem;
  border-right: 1px solid var(--border);
  transition: color 0.2s;
}

nav a:first-child { border-left: 1px solid var(--border); }

nav a:hover, nav a.active {
  color: var(--accent);
}

/* MAIN LAYOUT */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* HOMEPAGE INTRO */
.intro {
  text-align: center;
  padding: 2rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.intro-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.intro h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  line-height: 1.4;
  max-width: 560px;
  margin: 0 auto;
}

/* SECTIONS GRID */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 3.5rem;
}

.section-card {
  background: var(--bg-card);
  padding: 1.75rem 1rem;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.2s;
  display: block;
}

.section-card:hover {
  background: #fff;
}

.section-card:hover .section-card-title {
  color: var(--accent);
}

.section-card-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--border);
  line-height: 1;
  margin-bottom: 0.8rem;
}

.section-card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.section-card-desc {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-style: italic;
  line-height: 1.5;
}

/* RECENT POSTS */
.recent-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.post-list {
  list-style: none;
}

.post-item {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
}

.post-item a {
  text-decoration: none;
  color: var(--ink);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  transition: color 0.2s;
}

.post-item a:hover { color: var(--accent); }

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.post-cat {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: 'Lora', serif;
}

.post-date {
  font-size: 0.72rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* ARTICLE PAGE */
.article-header {
  text-align: center;
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.article-cat {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}

.article-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 1rem;
}

.article-date {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-style: italic;
}

.article-body {
  max-width: 620px;
  margin: 0 auto;
}

.article-body p {
  margin-bottom: 1.4rem;
  color: var(--ink);
}

.article-body p:first-of-type::first-letter {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3.5rem;
  font-weight: 600;
  float: left;
  line-height: 0.8;
  margin-right: 0.1em;
  margin-top: 0.1em;
  color: var(--accent);
}

/* SECTION INDEX PAGE */
.section-index-header {
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.section-index-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--ink);
}

.section-index-header p {
  font-style: italic;
  color: var(--ink-muted);
  margin-top: 0.4rem;
  font-size: 0.9rem;
}

/* NEWSLETTER FOOTER */
.newsletter-footer {
  text-align: center;
  padding: 1.2rem 2rem;
  border-top: 1px solid var(--border);
}

.newsletter-footer a {
  display: inline-block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.4rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.newsletter-footer a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* NEWSLETTER HOMEPAGE */
.newsletter-home {
  text-align: center;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.newsletter-home p {
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.newsletter-home a {
  display: inline-block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #faf7f2;
  background: var(--accent);
  text-decoration: none;
  padding: 0.7rem 2rem;
  border-radius: 2px;
  transition: background 0.2s;
}

.newsletter-home a:hover {
  background: var(--accent-light);
}

/* FOOTER */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-style: italic;
}

footer::after {
  content: '';
  display: block;
  width: 30px;
  height: 1px;
  background: var(--accent);
  margin: 1rem auto 0;
}

/* BACK LINK */
.back-link {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.back-link:hover { color: var(--accent); }
.back-link::before { content: '← '; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .site-title { font-size: 2rem; }
  .sections-grid { grid-template-columns: 1fr; }
  main { padding: 2rem 1.2rem; }
  .article-title { font-size: 1.6rem; }

  /* nav interna: scorrevole con indicatore */
  nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    scrollbar-width: none;
    padding-bottom: 2px;
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  }

  nav::-webkit-scrollbar { display: none; }

  nav a {
    padding: 0.3rem 1rem;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* hero nav: stessa cosa */
  .hero-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  }

  .hero-nav::-webkit-scrollbar { display: none; }

  .hero-nav a {
    padding: 0.75rem 1rem;
    font-size: 0.68rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
}
