/* ============================================
   NEURAL AGORÀ — Foglio di stile principale
   Seta, silicio e pura energia
   ============================================ */

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

/* ── VARIABILI ── */
:root {
  --plum:        #2F1B25;
  --plum-mid:    #4A3040;
  --plum-light:  #5C4A55;
  --charcoal:    #2A2520;
  --ivory:       #F5EFE4;
  --ivory-deep:  #E8DFD0;
  --ivory-dark:  #D4C9B8;
  --peach:       #FFD5C2;
  --blush:       #FDE2E4;
  --gold:        #DFBA6B;
  --gold-dark:   #B8943A;
  --muted:       #8A7A80;
  --slate:       #5C4A55;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'Space Mono', monospace;

  --radius:       4px;
  --transition:   0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--ivory);
  color: var(--plum);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-dark); }

/* ── TIPOGRAFIA ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--plum);
}

h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.8rem); }

p { margin-bottom: 1.5rem; font-size: 1.05rem; }

/* ── LAYOUT ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ── HEADER ── */
.site-header {
  background: rgba(245, 239, 228, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--ivory-deep);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  max-width: 1200px;
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.site-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--plum);
  letter-spacing: 0.02em;
}

.site-title em {
  color: var(--gold-dark);
  font-style: italic;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a, .site-nav ul li a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--slate);
  transition: color var(--transition);
  position: relative;
}

.site-nav a::after, .site-nav ul li a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--transition);
}

.site-nav a:hover, .site-nav ul li a:hover { color: var(--plum); }
.site-nav a:hover::after, .site-nav ul li a:hover::after { width: 100%; }

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav ul li a {
  display: block;
  font-size: 0.9rem;
  color: var(--ivory);
  opacity: 0.7;
  margin-bottom: 8px;
  transition: opacity var(--transition);
}

.footer-nav ul li a:hover { opacity: 1; color: var(--peach); }

.header-cta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: var(--plum);
  color: var(--peach);
  padding: 9px 20px;
  border-radius: 30px;
  transition: background var(--transition);
}

.header-cta:hover {
  background: var(--plum-mid);
  color: var(--peach);
}

/* ── HERO HOMEPAGE ── */
.site-hero {
  background: var(--plum);
  position: relative;
  overflow: hidden;
  padding: 80px 28px;
  text-align: center;
  border-bottom: 2px solid var(--gold);
}

.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #4A3040 0%, #1A0D14 100%);
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
  display: block;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--ivory);
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-title em {
  color: var(--gold);
  font-style: italic;
}

.hero-desc {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--peach);
  opacity: 0.85;
  line-height: 1.7;
  margin-bottom: 0;
}

/* ── GRIGLIA ARTICOLI ── */
.posts-section {
  padding: 60px 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ivory-deep);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* Featured post — primo articolo grande */
.posts-grid .post-card:first-child {
  grid-column: span 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.posts-grid .post-card:first-child .post-card-image {
  height: 380px;
}

.posts-grid .post-card:first-child .post-card-content {
  padding: 40px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.posts-grid .post-card:first-child .post-card-title {
  font-size: 2rem;
}

/* ── CARD ARTICOLO ── */
.post-card {
  background: white;
  border: 1.5px solid var(--ivory-deep);
  border-radius: 12px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(47, 27, 37, 0.12);
  border-color: var(--gold);
}

.post-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--plum-mid);
}

.post-card-image-placeholder {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, var(--plum) 0%, var(--plum-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card-content {
  padding: 24px 24px 28px;
}

.post-card-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 10px;
  display: block;
}

.post-card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--plum);
  margin-bottom: 12px;
  transition: color var(--transition);
}

.post-card:hover .post-card-title {
  color: var(--plum-mid);
}

.post-card-excerpt {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--slate);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--ivory-deep);
}

.post-card-date {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.post-card-readtime {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── PAGINAZIONE ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 0;
  border-top: 1px solid var(--ivory-deep);
  margin-top: 48px;
}

.pagination a, .pagination span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 10px 20px;
  border: 1px solid var(--ivory-deep);
  border-radius: 8px;
  color: var(--plum);
  transition: all var(--transition);
}

.pagination a:hover {
  background: var(--plum);
  color: var(--peach);
  border-color: var(--plum);
}

.pagination .page-number {
  background: var(--plum);
  color: var(--peach);
  border-color: var(--plum);
}

/* ── SINGOLO ARTICOLO ── */
.post-hero {
  position: relative;
  background: var(--plum);
  overflow: hidden;
}

.post-hero-image {
  width: 100%;
  height: 520px;
  object-fit: cover;
  opacity: 0.5;
}

.post-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 28px 48px;
  background: linear-gradient(transparent, rgba(47,27,37,0.95));
}

.post-hero-inner {
  max-width: 800px;
  margin: 0 auto;
}

.post-hero-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  display: block;
}

.post-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--ivory);
  line-height: 1.15;
  margin-bottom: 20px;
}

.post-hero-meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.post-hero-author {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--peach);
  opacity: 0.8;
}

.post-hero-date {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--peach);
  opacity: 0.6;
}

/* ── CORPO ARTICOLO ── */
.post-content-wrap {
  padding: 64px 0 80px;
}

.post-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 28px;
}

.post-content p {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--charcoal);
  margin-bottom: 1.8rem;
}

.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--plum);
  margin: 2.5rem 0 1rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ivory-deep);
}

.post-content h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--plum);
  margin: 2rem 0 0.8rem;
}

.post-content blockquote {
  border-left: 3px solid var(--gold);
  padding: 20px 28px;
  margin: 2rem 0;
  background: rgba(223, 186, 107, 0.06);
  border-radius: 0 8px 8px 0;
}

.post-content blockquote p {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--plum);
  margin: 0;
}

.post-content a {
  color: var(--gold-dark);
  border-bottom: 1px solid rgba(184,148,58,0.3);
  transition: border-color var(--transition);
}

.post-content a:hover {
  border-color: var(--gold-dark);
}

.post-content img {
  border-radius: 8px;
  margin: 2rem 0;
}

.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--ivory-deep);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--plum);
}

.post-content pre {
  background: var(--charcoal);
  color: var(--ivory);
  padding: 24px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2rem 0;
}

.post-content pre code {
  background: none;
  color: var(--ivory);
  padding: 0;
}

/* Primo paragrafo in evidenza */
.post-content > p:first-of-type {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--slate);
  line-height: 1.8;
}

/* ── TAG ARTICOLO ── */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--ivory-deep);
}

.post-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: var(--ivory-deep);
  color: var(--slate);
  padding: 5px 12px;
  border-radius: 20px;
  transition: all var(--transition);
}

.post-tag:hover {
  background: var(--plum);
  color: var(--peach);
}

/* ── ARTICOLI CORRELATI ── */
.related-posts {
  background: var(--ivory-deep);
  padding: 60px 0;
  margin-top: 60px;
}

.related-posts-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ── FOOTER ── */
.site-footer {
  background: var(--plum);
  color: var(--ivory);
  padding: 48px 0 32px;
  border-top: 2px solid var(--gold);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .site-title {
  color: var(--ivory);
  font-size: 20px;
  margin-bottom: 12px;
  display: block;
}

.footer-brand .site-title em { color: var(--gold); }

.footer-desc {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--peach);
  opacity: 0.7;
  line-height: 1.6;
}

.footer-nav-title {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.footer-nav a {
  display: block;
  font-size: 0.9rem;
  color: var(--ivory);
  opacity: 0.7;
  margin-bottom: 8px;
  transition: opacity var(--transition);
}

.footer-nav a:hover { opacity: 1; color: var(--peach); }

.footer-newsletter input {
  width: 100%;
  background: rgba(245,239,228,0.08);
  border: 1px solid rgba(245,239,228,0.2);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 10px;
  outline: none;
  transition: border-color var(--transition);
}

.footer-newsletter input:focus {
  border-color: var(--gold);
}

.footer-newsletter input::placeholder {
  color: rgba(245,239,228,0.4);
}

.footer-newsletter button {
  width: 100%;
  background: var(--gold);
  color: var(--plum);
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}

.footer-newsletter button:hover { background: var(--gold-dark); color: var(--ivory); }

.footer-bottom {
  border-top: 1px solid rgba(245,239,228,0.1);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ivory);
  opacity: 0.4;
}

.footer-gold-line {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--gold);
  opacity: 0.6;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .posts-grid .post-card:first-child { grid-column: span 2; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .site-nav { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .posts-grid .post-card:first-child {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
  .posts-grid .post-card:first-child .post-card-image { height: 220px; }
  .posts-grid .post-card:first-child .post-card-content { padding: 24px; }
  .footer-inner { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .post-hero-image { height: 320px; }
}
