/* ==========================================================================
   Luigi Petrosino — sito pubblico
   ========================================================================== */

:root {
  --color-bg: #faf8f4;
  --color-bg-alt: #f1ece3;
  --color-ink: #1d1c1a;
  --color-ink-soft: #4a4640;
  --color-accent: #16324a;
  --color-accent-soft: #2b4f6e;
  --color-gold: #a9803f;
  --color-line: #e3ddd1;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--color-accent);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--color-gold);
  font-weight: 600;
}

.page-title {
  text-align: center;
  padding: 64px 0 32px;
}

.page-title h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.lede {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  color: var(--color-ink-soft);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.97);
  border-bottom: 1px solid var(--color-line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-accent);
  letter-spacing: 0.02em;
}

.brand span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-accent);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.main-nav > ul > li {
  position: relative;
}

.main-nav a {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-ink);
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}

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

.main-nav .has-children > .submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(20, 20, 15, 0.08);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.main-nav .has-children:hover > .submenu,
.main-nav .has-children.open > .submenu {
  display: flex;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    inset: 84px 0 0 0;
    background: var(--color-bg);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 16px 0 40px;
  }

  .main-nav.open {
    transform: translateX(0);
  }

  .main-nav > ul {
    flex-direction: column;
    padding: 0 24px;
  }

  .main-nav a {
    padding: 14px 8px;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--color-line);
  }

  .main-nav .has-children > .submenu {
    position: static;
    box-shadow: none;
    border: none;
    display: none;
    padding-left: 16px;
  }

  .main-nav .has-children.open > .submenu {
    display: flex;
  }
}

/* ---------- Hero / slideshow ---------- */

.hero {
  position: relative;
  height: min(78vh, 640px);
  min-height: 380px;
  overflow: hidden;
  background: var(--color-accent);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: kenburns 12s ease-in-out forwards;
}

@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 25, 35, 0.15) 0%, rgba(15, 25, 35, 0.55) 100%);
}

.hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 0 24px;
}

.hero-caption .quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  max-width: 760px;
  margin: 0 auto;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* ---------- Sections / cards ---------- */

.section-block {
  padding: 72px 0;
}

.section-block.alt {
  background: var(--color-bg-alt);
}

.section-heading {
  text-align: center;
  margin-bottom: 40px;
}

.bio-teaser {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 760px) {
  .bio-teaser {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.bio-teaser > img {
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(20, 20, 15, 0.12);
}

.signatures {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 24px;
  margin-top: 28px;
}

.signatures img {
  height: 46px;
  width: auto;
  opacity: 0.85;
}

@media (max-width: 760px) {
  .signatures {
    justify-content: center;
  }
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  text-decoration: none;
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  background: var(--color-accent);
  color: #fff;
}

.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.section-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  text-decoration: none;
  color: #fff;
  display: block;
  background: var(--color-accent);
  box-shadow: 0 16px 32px rgba(20, 20, 15, 0.1);
}

.section-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.section-card:hover img {
  transform: scale(1.06);
}

.section-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 20, 15, 0) 40%, rgba(15, 20, 25, 0.85) 100%);
}

.section-card .label {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.section-card .label small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 4px;
}

/* ---------- Gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px 18px;
}

.gallery-figure {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-title {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  line-height: 1.35;
}

.gallery-title.is-empty {
  font-style: italic;
  color: var(--color-ink-soft);
  opacity: 0.6;
}

.gallery-item {
  border: 1px solid var(--color-line);
  background: #fff;
  padding: 14px;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  position: relative;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.gallery-item:hover {
  border-color: var(--color-gold);
  box-shadow: 0 12px 24px rgba(20, 20, 15, 0.1);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
}

.section-nav a {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--color-line);
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--color-ink-soft);
}

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

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 14, 0.94);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: min(90vw, 1100px);
  max-height: 72vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-caption {
  color: #f2efe9;
  text-align: center;
  margin-top: 18px;
  max-width: 700px;
}

.lightbox-caption h3 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.lightbox-caption .meta {
  color: var(--color-gold);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-nav.prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav.next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- Testo lungo (bio, curriculum, critiche) ---------- */

.prose {
  max-width: 760px;
  margin: 0 auto;
}

.prose p {
  margin: 0 0 1.2em;
  color: var(--color-ink-soft);
}

.prose p:first-child::first-letter {
  font-family: var(--font-display);
}

/* ---------- Critica ---------- */

.critique-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.critique-item {
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: #fff;
}

.critique-item summary {
  cursor: pointer;
  padding: 18px 24px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-accent);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.critique-item summary::-webkit-details-marker {
  display: none;
}

.critique-item summary::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--color-gold);
}

.critique-item[open] summary::after {
  content: '\2212';
}

.critique-item .prose {
  padding: 0 24px 24px;
}

/* ---------- Contatti ---------- */

.contact-card {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  padding: 48px 32px;
}

.contact-card .prose p {
  margin-bottom: 0.6em;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--color-accent);
  color: #d9e2ea;
  padding: 48px 0 28px;
  margin-top: 40px;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

.site-footer .prose p {
  color: #d9e2ea;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #fff;
}

.footer-legal {
  padding-top: 20px;
  font-size: 0.8rem;
  opacity: 0.75;
  text-align: center;
}

.footer-legal a {
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  color: var(--color-ink-soft);
  padding: 40px 0;
}
