/* ════════════════════════════════════════
   TONINO BARBUTO — Foglio di stile
   Priorità: leggibilità, calore, semplicità
   ════════════════════════════════════════ */

:root {
  --ink:        #1c1917;
  --ink-soft:   #57534e;
  --ink-muted:  #a8a29e;
  --paper:      #faf8f4;
  --paper-card: #ffffff;
  --line:       #e7e3dd;
  --accent:     #b45309;
  --accent-dk:  #92400e;
  --accent-lt:  #fef3c7;
  --private:    #1e3a5f;
  --private-lt: #dbeafe;
  --radius:     16px;
  --max:        940px;
  --font-serif: 'Lora', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;
  --shadow:     0 12px 32px rgba(60,40,10,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ─── HEADER ─── */
header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 200;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 66px; gap: 12px; flex-wrap: wrap;
  padding-top: 8px; padding-bottom: 8px;
}
.site-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem; font-weight: 600; color: var(--ink);
  white-space: nowrap;
}
nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link {
  font-size: 0.95rem; font-weight: 500; color: var(--ink-soft);
  padding: 8px 14px; border-radius: 9px;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--accent-lt); color: var(--accent-dk); }
.nav-private { background: var(--private-lt); color: var(--private); font-weight: 600; }
.nav-private:hover { background: #c7ddfb; color: var(--private); }
.btn-entra {
  font-family: var(--font-sans);
  font-size: 0.95rem; font-weight: 600;
  color: #fff; background: var(--accent);
  border: none; padding: 8px 18px; border-radius: 9px; cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}
.btn-entra:hover { background: var(--accent-dk); transform: translateY(-1px); }

/* ─── HERO ─── */
.hero {
  padding: 64px 0 46px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.hero--small { padding: 48px 0 36px; }
.hero-foto {
  width: 132px; height: 132px; border-radius: 50%;
  object-fit: cover; margin: 0 auto 24px;
  border: 4px solid #fff; box-shadow: var(--shadow);
}
.hero-label {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 5vw, 2.9rem); font-weight: 600;
  line-height: 1.22; margin: 0 auto 14px; max-width: 16ch;
}
.hero-sub { color: var(--ink-soft); font-size: 1.12rem; max-width: 560px; margin: 0 auto; }
.hero-bio {
  color: var(--ink-soft); font-size: 1.02rem; max-width: 600px;
  margin: 20px auto 0; padding-top: 20px; border-top: 1px solid var(--line);
}

/* ─── POSTS GRID ─── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px; padding: 44px 0 70px;
}
.post-card {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
  display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--accent); }
.card-cover { height: 180px; background-size: cover; background-position: center; background-color: var(--accent-lt); }
.card-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.post-tag {
  display: inline-block; font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--accent-lt); color: var(--accent-dk);
  padding: 4px 12px; border-radius: 99px; width: fit-content;
}
.post-title { font-family: var(--font-serif); font-size: 1.22rem; font-weight: 600; line-height: 1.4; }
.post-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--line); margin-top: auto;
}
.post-date { font-size: 0.85rem; color: var(--ink-muted); }
.post-cta { font-size: 0.88rem; font-weight: 700; color: var(--accent); }

/* ─── EMPTY ─── */
.empty-state { text-align: center; padding: 80px 24px; color: var(--ink-soft); font-size: 1.08rem; }

/* ─── POST FULL ─── */
.post-full { padding: 44px 0 70px; max-width: 720px; margin: 0 auto; }
.back-top { display: inline-block; font-size: 0.92rem; font-weight: 600; color: var(--accent); margin-bottom: 28px; }
.post-full-title { font-family: var(--font-serif); font-size: clamp(1.8rem, 4.5vw, 2.5rem); font-weight: 600; line-height: 1.25; margin-bottom: 12px; }
.post-full-date { font-size: 0.92rem; color: var(--ink-muted); margin-bottom: 28px; }
.post-cover { width: 100%; border-radius: var(--radius); margin-bottom: 32px; }
.post-content { font-family: var(--font-serif); font-size: 1.2rem; line-height: 1.85; }
.post-content p { margin-bottom: 1.2em; }
.post-content h2, .post-content h3 { font-weight: 600; margin: 1.4em 0 0.5em; line-height: 1.3; }
.post-content img { border-radius: 12px; margin: 1.2em 0; }
.post-content a { color: var(--accent); text-decoration: underline; }
.post-content ul, .post-content ol { padding-left: 1.4em; margin-bottom: 1.2em; }

/* ─── MEDIA BLOCKS ─── */
.media-block { margin: 36px 0; padding: 24px; background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius); }
.media-label { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 14px; }
.media-block audio { width: 100%; }
.video-wrap { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 12px; overflow: hidden; background: #000; }
.video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.back-link { display: inline-block; margin-top: 40px; font-weight: 700; color: var(--accent); }

/* ─── GALLERIA ─── */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; padding: 40px 0 70px;
}
.gallery-item {
  position: relative; border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--accent-lt); box-shadow: var(--shadow);
}
.gallery-item img { width: 100%; height: 220px; object-fit: cover; transition: transform 0.3s ease; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff; font-size: 0.9rem; padding: 28px 14px 12px;
}

/* ─── LIGHTBOX ─── */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(20,15,8,0.92); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; padding: 30px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92%; max-height: 80vh; border-radius: 12px; }
.lightbox-cap { color: #fff; margin-top: 16px; font-size: 1.05rem; text-align: center; }
.lightbox-close { position: absolute; top: 22px; right: 28px; color: #fff; font-size: 2rem; cursor: pointer; line-height: 1; }

/* ─── VIDEO LIST ─── */
.video-list { display: flex; flex-direction: column; gap: 40px; padding: 40px 0 70px; }
.video-title { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 600; margin-bottom: 16px; }
.video-file { width: 100%; border-radius: 12px; background: #000; display: block; }

/* ─── FOOTER ─── */
footer { border-top: 1px solid var(--line); padding: 24px 0; font-size: 0.85rem; color: var(--ink-muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-admin { color: var(--ink-muted); }
.footer-admin:hover { color: var(--accent); text-decoration: underline; }

/* ─── ACCESSIBILITÀ ─── */
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ─── RESPONSIVE ─── */
@media (max-width: 680px) {
  body { font-size: 16px; }
  .header-inner { min-height: 56px; }
  .site-logo { font-size: 1.1rem; width: 100%; }
  nav { width: 100%; justify-content: flex-start; }
  .nav-link { padding: 7px 11px; font-size: 0.88rem; }
  .btn-entra { padding: 7px 14px; font-size: 0.88rem; }
  .hero { padding: 44px 0 34px; }
  .posts-grid, .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item img { height: 240px; }
  .post-content { font-size: 1.1rem; }
}
