/* ==========================================================================
   Tiber Spano — Editorial & Philosophical Redesign
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Light Theme (Warm Alabaster / Parchment) */
  --bg-primary: #FAF7F2;
  --bg-secondary: #F2ECE1;
  --bg-surface: #FFFFFF;
  --bg-glass: rgba(250, 247, 242, 0.85);
  --bg-dark-section: #171513;
  --bg-dark-card: #221F1C;

  --text-primary: #1B1917;
  --text-secondary: #4E4842;
  --text-muted: #787067;
  --text-on-dark: #F4EFE6;
  --text-muted-on-dark: #B5ADA2;

  /* Accents inspired by Franco Battiato gold leaf & crimson */
  --accent-gold: #B6862C;
  --accent-gold-light: #D4A84F;
  --accent-gold-subtle: rgba(182, 134, 44, 0.14);
  --accent-crimson: #7C1D1D;
  --accent-crimson-hover: #5E1414;

  --border-subtle: rgba(27, 25, 23, 0.1);
  --border-gold: rgba(182, 134, 44, 0.35);

  --shadow-sm: 0 4px 20px -2px rgba(24, 20, 16, 0.05);
  --shadow-md: 0 12px 36px -4px rgba(24, 20, 16, 0.08);
  --shadow-lg: 0 24px 56px -12px rgba(24, 20, 16, 0.15);
  --shadow-book: -12px 18px 32px rgba(15, 12, 9, 0.22), -2px 4px 8px rgba(15, 12, 9, 0.12);

  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --transition-smooth: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
}

[data-theme="dark"] {
  --bg-primary: #131110;
  --bg-secondary: #1B1816;
  --bg-surface: #221E1B;
  --bg-glass: rgba(19, 17, 16, 0.85);
  --bg-dark-section: #0D0B0A;
  --bg-dark-card: #191614;

  --text-primary: #F4EFE6;
  --text-secondary: #C7BFB3;
  --text-muted: #8E867B;

  --accent-gold: #D4A84F;
  --accent-gold-light: #E8C272;
  --accent-gold-subtle: rgba(212, 168, 79, 0.15);
  --accent-crimson: #A83232;
  --accent-crimson-hover: #C24040;

  --border-subtle: rgba(244, 239, 230, 0.1);
  --border-gold: rgba(212, 168, 79, 0.35);

  --shadow-sm: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 36px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 56px -12px rgba(0, 0, 0, 0.65);
  --shadow-book: -14px 20px 38px rgba(0, 0, 0, 0.6), -2px 4px 10px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease, opacity 0.25s ease;
}

ul {
  list-style: none;
}

/* Subtle paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.025;
  background-image: radial-gradient(var(--text-primary) 0.75px, transparent 0.75px);
  background-size: 24px 24px;
}

/* ==========================================================================
   Scroll Progress Bar
   ========================================================================== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-crimson), var(--accent-gold), var(--accent-gold-light));
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 1001;
}

@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  .scroll-progress {
    animation: grow-progress auto linear both;
    animation-timeline: scroll(root block);
  }
}

@keyframes grow-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */

h1, h2, h3, h4, .serif {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.story-text,
.section-subtitle,
.event-desc,
.topic-text,
.book-description p,
.frammento-body p,
blockquote {
  text-wrap: pretty;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-gold);
  margin-bottom: 1rem;
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 24px;
  height: 1px;
  background-color: var(--accent-gold);
  opacity: 0.6;
}

.eyebrow.left-align::before {
  display: none;
}

.section-title {
  font-size: clamp(2.4rem, 4.5vw, 3.75rem);
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.section-subtitle {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 760px;
  margin-inline: auto;
  line-height: 1.8;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.section {
  padding-block: clamp(4.5rem, 8vw, 7.5rem);
  position: relative;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.85rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--accent-gold);
  color: #131110;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-gold {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  color: #131110;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(182, 134, 44, 0.25);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(182, 134, 44, 0.4);
  filter: brightness(1.05);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-gold);
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--accent-gold-subtle);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.btn-outline-light {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(212, 168, 79, 0.45);
  color: var(--text-on-dark);
}

.btn-outline-light:hover {
  background-color: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #131110;
  transform: translateY(-2px);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #1E7E48, #25A25A);
  color: #FFFFFF;
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 22px rgba(30, 126, 72, 0.25);
}

.btn-whatsapp:hover {
  background: linear-gradient(135deg, #259656, #2BB866);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(30, 126, 72, 0.38);
}

/* ==========================================================================
   Navigation Header
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 84px;
  display: flex;
  align-items: center;
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: height 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.site-header.scrolled {
  height: 68px;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  width: 100%;
  max-width: 1320px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-monogram {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent-gold);
  background: var(--accent-gold-subtle);
  position: relative;
  flex-shrink: 0;
}

.brand-monogram::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-gold);
  position: absolute;
  bottom: 4px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-tagline {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.85rem, 1.35vw, 1.5rem);
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding-block: 0.35rem;
  white-space: nowrap;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--accent-gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-actions .btn {
  padding: 0.75rem 1.4rem;
  font-size: 0.88rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.theme-toggle:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: rotate(12deg);
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   Hero & Bio Section
   ========================================================================== */

.hero-section {
  padding-top: calc(84px + clamp(3rem, 6vw, 5.5rem));
  padding-bottom: clamp(4rem, 7vw, 6.5rem);
  position: relative;
  overflow: hidden;
}

.hero-ambient {
  position: absolute;
  top: -10%;
  right: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(182, 134, 44, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-header {
  text-align: center;
  max-width: 900px;
  margin-inline: auto;
  margin-bottom: clamp(3.5rem, 6vw, 5.5rem);
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(3.4rem, 7vw, 5.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin-bottom: 1.5rem;
}

.hero-lead {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.55;
}

.hero-lead strong {
  color: var(--text-primary);
  font-weight: 600;
  font-style: italic;
}

/* Story Rows (Bio + Vision) */
.story-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(3.5rem, 7vw, 6rem);
  position: relative;
  z-index: 1;
}

.story-row {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.story-row.reverse {
  grid-template-columns: 0.92fr 1.08fr;
}

.story-row.reverse .story-media {
  order: 2;
}

.story-row.reverse .story-content {
  order: 1;
}

.story-media {
  position: relative;
}

.image-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-gold);
  background-color: var(--bg-dark-card);
}

.image-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.image-frame:hover img {
  transform: scale(1.03);
}

.media-caption {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(19, 17, 16, 0.75);
  backdrop-filter: blur(10px);
  color: #F4EFE6;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(212, 168, 79, 0.25);
}

.story-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.story-text {
  font-size: 1.08rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.85;
}

.story-text em {
  font-family: var(--font-serif);
  font-size: 1.22em;
  color: var(--text-primary);
  font-style: italic;
}

.story-quote {
  margin: 0.5rem 0 2rem;
  padding: 1.35rem 1.65rem;
  border-left: 3px solid var(--accent-gold);
  background-color: var(--bg-secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--text-primary);
}

/* ==========================================================================
   Riflessioni (Triptych with Enhanced Paintings)
   ========================================================================== */

.riflessioni-section {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  text-align: center;
  margin-bottom: clamp(3rem, 5vw, 4.5rem);
}

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

.triptych-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.triptych-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.triptych-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-gold);
}

.triptych-card:hover::before {
  opacity: 1;
}

.triptych-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-gold);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  position: relative;
}

.triptych-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s ease;
}

.triptych-card:hover .triptych-art img {
  transform: scale(1.05);
}

.triptych-number {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--accent-gold);
  margin-bottom: 0.35rem;
}

.triptych-title {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.triptych-link {
  margin-top: auto;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   Dialoghi (Featured Events & Manifesto)
   ========================================================================== */

.dialoghi-manifesto {
  max-width: 880px;
  margin-inline: auto;
  margin-bottom: 4rem;
  padding: clamp(1.75rem, 4vw, 3rem);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-md);
  text-align: center;
  position: relative;
}

.manifesto-pill {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  background-color: var(--accent-gold-subtle);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.events-showcase {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}

.event-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.event-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-gold);
}

.event-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.event-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.event-card:hover .event-media img {
  transform: scale(1.04);
}

.event-date-badge {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  background: rgba(19, 17, 16, 0.85);
  backdrop-filter: blur(8px);
  color: var(--accent-gold-light);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(212, 168, 79, 0.4);
}

.event-body {
  padding: clamp(1.75rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.event-title {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.event-subtitle {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--accent-gold);
  margin-bottom: 1rem;
}

.event-desc {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  flex-grow: 1;
}

/* ==========================================================================
   Prossimamente (Upcoming Topics Grid + Schedule Banner)
   ========================================================================== */

.prossimamente-section {
  background-color: var(--bg-dark-section);
  color: var(--text-on-dark);
}

.prossimamente-section .section-title {
  color: var(--text-on-dark);
}

.prossimamente-section .section-subtitle {
  color: var(--text-muted-on-dark);
}

.torino-schedule-banner {
  max-width: 900px;
  margin: 0 auto 3.5rem;
  padding: 1.5rem 2rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(182, 134, 44, 0.16), rgba(124, 29, 29, 0.18));
  border: 1px solid rgba(212, 168, 79, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.schedule-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.schedule-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(212, 168, 79, 0.2);
  border: 1px solid var(--accent-gold-light);
  display: grid;
  place-items: center;
  color: var(--accent-gold-light);
  flex-shrink: 0;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.75rem;
}

.topic-card {
  background-color: var(--bg-dark-card);
  border: 1px solid rgba(244, 239, 230, 0.08);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  transition: all 0.35s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.topic-card:hover {
  border-color: rgba(212, 168, 79, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.topic-index {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--accent-gold-light);
  opacity: 0.8;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topic-index::after {
  content: "";
  height: 1px;
  width: 32px;
  background: var(--accent-gold-light);
  opacity: 0.4;
}

.topic-title {
  font-size: 1.75rem;
  color: var(--text-on-dark);
  margin-bottom: 1rem;
}

.topic-text {
  color: var(--text-muted-on-dark);
  font-size: 0.98rem;
  line-height: 1.75;
}

.continuous-update-note {
  text-align: center;
  margin-top: 3rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--accent-gold-light);
  opacity: 0.9;
}

/* ==========================================================================
   Pubblicazioni (Books Showcase)
   ========================================================================== */

.books-list {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.book-showcase {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: clamp(2rem, 4.5vw, 3.5rem);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.book-showcase:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-lg);
}

.book-cover-wrap {
  display: flex;
  justify-content: center;
  perspective: 1000px;
}

.book-cover {
  width: 100%;
  max-width: 260px;
  border-radius: 6px 12px 12px 6px;
  box-shadow: var(--shadow-book);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.book-showcase:hover .book-cover {
  transform: rotateY(-6deg) translateY(-6px) scale(1.02);
}

.book-badge {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--accent-gold);
  background: var(--accent-gold-subtle);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}

.book-title {
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  margin-bottom: 0.4rem;
}

.book-subtitle {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.book-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.75rem;
}

.book-description p + p {
  margin-top: 0.9rem;
}

.book-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.75rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.meta-value {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.book-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.availability-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.availability-note strong {
  color: var(--text-primary);
}

/* ==========================================================================
   Frammenti di un insegnamento conosciuto
   ========================================================================== */

.frammenti-section {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
}

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

.frammento-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 3.5vw, 3rem);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.frammento-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-md);
}

.frammento-quote-mark {
  font-family: var(--font-serif);
  font-size: 4rem;
  line-height: 0.8;
  color: var(--accent-gold);
  opacity: 0.25;
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  pointer-events: none;
}

.frammento-title {
  font-size: 1.9rem;
  margin-bottom: 1.15rem;
  color: var(--text-primary);
}

.frammento-body {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.frammento-date {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  font-weight: 600;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Contatti & Prenotazioni
   ========================================================================== */

.contact-wrapper {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: stretch;
}

.contact-info-card {
  background-color: var(--bg-dark-section);
  color: var(--text-on-dark);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3.25rem);
  border: 1px solid rgba(212, 168, 79, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.contact-info-card h3 {
  font-size: 2.3rem;
  margin-bottom: 1rem;
  color: var(--text-on-dark);
}

.contact-info-card p {
  color: var(--text-muted-on-dark);
  margin-bottom: 2rem;
}

.info-badges {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.info-badge-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(244, 239, 230, 0.08);
}

.info-badge-icon {
  color: var(--accent-gold-light);
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.info-badge-content strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-on-dark);
}

.info-badge-content span,
.info-badge-content a {
  font-size: 0.92rem;
  color: var(--text-muted-on-dark);
}

.info-badge-content a:hover {
  color: var(--accent-gold-light);
}

.contact-form-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3.25rem);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.96rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-subtle);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.form-alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  display: none;
}

.form-alert.success {
  display: block;
  background-color: rgba(46, 125, 50, 0.12);
  border: 1px solid rgba(46, 125, 50, 0.4);
  color: #2e7d32;
}

.form-alert.error {
  display: block;
  background-color: rgba(168, 50, 50, 0.12);
  border: 1px solid rgba(168, 50, 50, 0.4);
  color: #a83232;
}

/* ==========================================================================
   Closing Quote & Epilogue
   ========================================================================== */

.epilogue-section {
  padding-block: clamp(4rem, 7vw, 6.5rem);
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  text-align: center;
}

.epilogue-box {
  max-width: 780px;
  margin-inline: auto;
}

.gurdjieff-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-style: italic;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.gurdjieff-author {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-gold);
  font-weight: 600;
  margin-bottom: 2.5rem;
}

.epilogue-image-wrap {
  max-width: 680px;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-gold);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: var(--bg-dark-section);
  color: var(--text-muted-on-dark);
  padding-block: 3.5rem;
  border-top: 1px solid rgba(212, 168, 79, 0.2);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.footer-links a:hover {
  color: var(--accent-gold-light);
}

/* ==========================================================================
   Scroll Reveal Animations (Progressive Enhancement)
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 992px) {
  .story-row,
  .story-row.reverse {
    grid-template-columns: 1fr;
  }
  .story-row.reverse .story-media {
    order: 1;
  }
  .story-row.reverse .story-content {
    order: 2;
  }
  .triptych-grid,
  .events-showcase,
  .frammenti-grid,
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
  .book-showcase {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .book-actions {
    justify-content: center;
  }
}

.nav-mobile-cta {
  display: none;
}

@media (max-width: 960px) {
  .nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    flex-direction: column;
    padding: 2rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
    transform: translateY(-130%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s ease;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-mobile-cta {
    display: block;
    width: 100%;
    padding-top: 0.5rem;
  }
  .nav-mobile-cta .btn {
    width: 100%;
    color: #131110;
  }
  .nav-mobile-cta .btn::after {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .nav-actions .btn {
    display: none;
  }
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .topics-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Scritti & Audio — Archivio e Lettore Modale (<dialog>)
   ========================================================================== */

.scritti-container {
  max-width: 820px;
  margin-inline: auto;
}

.scritti-search-wrap {
  max-width: 680px;
  margin: 2rem auto 0;
  position: relative;
}

.scritti-search-input {
  width: 100%;
  padding: 1rem 1.4rem 1rem 3rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.scritti-search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-subtle);
}

.scritti-search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-gold);
  pointer-events: none;
}

.scritti-count-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-inline: 0.25rem;
}

.scritti-grid {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

.scritto-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.scritto-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.scritto-preview {
  position: relative;
  width: 100%;
  height: 250px;
  background-color: var(--bg-secondary);
  overflow: hidden;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}

.scritto-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.scritto-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(23, 21, 19, 0.84);
  backdrop-filter: blur(6px);
  color: var(--accent-gold-light);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-gold);
}

.scritto-body {
  padding: clamp(1.5rem, 3vw, 2.2rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.scritto-meta {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
  font-weight: 600;
}

.scritto-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.22;
  cursor: pointer;
  transition: color 0.2s ease;
  text-wrap: balance;
}

.scritto-title:hover {
  color: var(--accent-gold);
}

.scritto-excerpt {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  text-wrap: pretty;
}

.audio-player {
  width: 100%;
  margin-top: 0.35rem;
  border-radius: 30px;
  outline: none;
}

.scritto-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

/* Native <dialog> Reader Modal */
dialog.reader-dialog {
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  background: var(--bg-primary);
  color: var(--text-primary);
  max-width: 760px;
  width: calc(100% - 2rem);
  margin: 2rem auto;
  padding: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  max-height: calc(100dvh - 4rem);
  overflow-y: auto;
}

dialog.reader-dialog:modal {
  overscroll-behavior: contain;
}

dialog.reader-dialog::backdrop {
  background: rgba(19, 17, 16, 0.72);
  backdrop-filter: blur(6px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.reader-sticky-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.75rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.reader-inner {
  padding: clamp(1.75rem, 4vw, 3rem);
}

.btn-close-dialog {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-gold);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-close-dialog:hover {
  background: var(--accent-gold);
  color: #131110;
}

.reader-title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.5vw, 2.5rem);
  line-height: 1.18;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  text-wrap: balance;
}

.reader-meta {
  color: var(--accent-gold);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.btn-share-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-gold);
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-share-link:hover {
  background: var(--accent-gold-subtle);
  color: var(--text-primary);
}

.reader-audio-wrap {
  margin-bottom: 1.85rem;
  padding: 0.95rem 1.2rem;
  border-radius: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
}

.reader-audio-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
  margin-bottom: 0.45rem;
}

.reader-body {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2vw, 1.35rem);
  line-height: 1.82;
  color: var(--text-primary);
}

.reader-body p {
  margin-bottom: 1.55rem;
  text-wrap: pretty;
}

.reader-body figure {
  margin: 2.2rem 0 0.5rem;
  text-align: center;
}

.reader-body img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  border: 1px solid var(--border-gold);
  display: block;
  margin: 0 auto;
}

.status-msg {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  line-height: 1.8;
}

@media (max-width: 600px) {
  .scritto-preview {
    height: 190px;
  }
  dialog.reader-dialog {
    width: calc(100% - 1rem);
    margin: 0.5rem auto;
    max-height: calc(100dvh - 1rem);
  }
  .reader-sticky-top {
    padding: 0.75rem 1.15rem;
  }
}

