/* Caratteri ospitati nel sito (licenza OFL, file e licenze in /fonts) */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url('/fonts/cinzel-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2');
}

/* Design System Praevia: Ramo d'oro (scuro) & Travertino (chiaro) */
#deck[data-theme="dark"] {
  color-scheme: dark;
  --pr-bg: #13110E;
  --pr-surface: #1C1915;
  --pr-surface-alt: #24201B;
  --pr-text: #EFE6D2;
  --pr-muted: #CFC5AF;
  --pr-sec: #AD9C7E;
  --pr-border: #686051;
  --pr-gold: #D4AF37;
  --pr-gold-soft: rgba(212, 175, 55, 0.14);
  --pr-on-gold: #13110E;
  --pr-up: #7FBF9E;
  --pr-down: #E07A62;
  --pr-amber: #E3A35A;
}

#deck[data-theme="light"] {
  color-scheme: light;
  --pr-bg: #F1EBDF;
  --pr-surface: #FAF6EE;
  --pr-surface-alt: #EAE2D3;
  --pr-text: #221C16;
  --pr-muted: #3F362C;
  --pr-sec: #6A5F52;
  --pr-border: #8C867B;
  --pr-gold: #7A5C17;
  --pr-gold-soft: rgba(122, 92, 23, 0.12);
  --pr-on-gold: #F8F3E8;
  --pr-up: #2F6E4C;
  --pr-down: #A3302A;
  --pr-amber: #8A4B12;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

#deck {
  min-height: 100vh;
  background-color: var(--pr-bg);
  color: var(--pr-text);
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  transition: background-color 220ms ease, color 220ms ease;
}

.font-cinzel {
  font-family: 'Cinzel', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  letter-spacing: 0.08em;
}

.font-mono-pr {
  font-family: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* SVG ufficiali reattivi ai temi */
.pr-svg-gold {
  fill: var(--pr-gold);
  stroke: var(--pr-gold);
  stroke-width: 0.25;
}

.pr-svg-gold-stroke {
  fill: none;
  stroke: var(--pr-gold);
  stroke-width: 2;
  stroke-linecap: round;
}

.pr-svg-gold-fill {
  fill: var(--pr-gold);
}

.pr-svg-text {
  fill: var(--pr-text);
}

.pr-logo-header {
  height: 22px;
  width: auto;
  display: block;
}

.pr-logo-hero {
  width: 250px;
  max-width: 100%;
  height: auto;
  display: block;
}

.pr-logo-closing {
  width: 210px;
  max-width: 100%;
  height: auto;
  display: block;
}

.pr-ramo-icon {
  width: 26px;
  height: auto;
  display: block;
  flex-shrink: 0;
}

/* Vetrina: i comandi da presentazione restano nel codice ma non si vedono */
.pr-deck-only {
  display: none !important;
}

/* Contenitore e intestazione */
.pr-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

.pr-header {
  position: sticky;
  top: 0;
  padding-top: env(safe-area-inset-top);
  z-index: 40;
  background-color: var(--pr-bg);
  border-bottom: 1px solid var(--pr-border);
}

.pr-progress {
  width: 100%;
  height: 2px;
  display: block;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: var(--pr-surface-alt);
}

.pr-progress::-webkit-progress-bar {
  background: var(--pr-surface-alt);
}

.pr-progress::-webkit-progress-value {
  background: var(--pr-gold);
  transition: width 260ms ease;
}

.pr-progress::-moz-progress-bar {
  background: var(--pr-gold);
}

.pr-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.pr-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pr-counter {
  font-weight: 700;
}

.pr-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pr-pill-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* Controlli a pillola */
.pr-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 9999px;
  border: 1px solid var(--pr-border);
  background: transparent;
  color: var(--pr-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease, opacity 180ms ease;
  text-decoration: none;
  white-space: nowrap;
}

.pr-pill-sm {
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
}

.pr-pill:hover {
  border-color: var(--pr-gold);
  background-color: var(--pr-gold-soft);
  color: var(--pr-text);
}

.pr-pill:focus-visible,
.pr-dot:focus-visible,
.pr-tendina-btn:focus-visible,
.pr-chapter-row:focus-visible {
  outline: 2px solid var(--pr-gold);
  outline-offset: 2px;
}

.pr-pill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Scelta attiva: solo bordo e scritta oro, senza riempimento */
.pr-pill-choice.is-active {
  border-color: var(--pr-gold);
  border-width: 1.5px;
  color: var(--pr-gold);
  background: transparent;
}

@media (hover: hover) {
  .pr-pill-choice:hover {
    background-color: var(--pr-gold);
    border-color: var(--pr-gold);
    color: var(--pr-on-gold);
  }
}

.pr-pill-choice.is-tapped {
  background-color: var(--pr-gold);
  border-color: var(--pr-gold);
  color: var(--pr-on-gold);
}

/* CTA che apre la strada: oro pieno */
.pr-pill-cta {
  background-color: var(--pr-gold);
  border-color: var(--pr-gold);
  color: var(--pr-on-gold);
}

.pr-pill-cta:hover {
  filter: brightness(1.06);
  background-color: var(--pr-gold);
  color: var(--pr-on-gold);
}

/* Tendine */
.pr-tendina-wrap {
  padding-top: 14px;
  border-top: 1px solid var(--pr-border);
}

.pr-tendina-wrap-plain {
  padding-top: 16px;
}

.pr-tendina-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 9999px;
  border: 1px solid var(--pr-border);
  background: transparent;
  color: var(--pr-text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease;
}

.pr-tendina-btn[aria-expanded="true"] {
  border-color: var(--pr-gold);
  border-width: 1.5px;
  color: var(--pr-gold);
  background: transparent;
}

.pr-tendina-arrow {
  display: inline-block;
  transition: transform 220ms ease;
}

.pr-tendina-btn[aria-expanded="true"] .pr-tendina-arrow {
  transform: rotate(180deg);
}

.pr-tendina-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 240ms ease, opacity 220ms ease, margin-top 240ms ease;
  margin-top: 0;
}

.pr-tendina-panel.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 18px;
}

.pr-tendina-inner {
  overflow: hidden;
}

/* Superfici e filetti (elenchi mai arrotondati) */
.pr-surface {
  background-color: var(--pr-surface);
  border: 1px solid var(--pr-border);
  padding: 24px;
}

.pr-surface-gold {
  border-color: var(--pr-gold);
}

.pr-hero-box {
  padding: 48px 28px;
  text-align: center;
}

.pr-closing-box {
  padding: 36px 28px;
}

.pr-list-row {
  border-top: 1px solid var(--pr-border);
  border-radius: 0;
  padding: 14px 0;
}

.pr-list-row:last-child {
  border-bottom: 1px solid var(--pr-border);
}

.pr-timeline-row {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
}

.pr-timeline-time {
  min-width: 96px;
}

.pr-timeline-label {
  font-size: 14px;
}

/* Modalità Pagina vs Slide */
#deck[data-mode="slides"] .pr-slide {
  display: none;
}

#deck[data-mode="slides"] .pr-slide.is-current {
  display: block;
  animation: prFadeIn 220ms ease;
}

#deck[data-mode="page"] .pr-slide {
  display: block;
  padding: 44px 0;
  border-bottom: 1px solid var(--pr-border);
}

#deck[data-mode="page"] .pr-slide:last-of-type {
  border-bottom: none;
}

#deck[data-mode="page"] .pr-bottom-nav {
  display: none;
}

@keyframes prFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pr-slide-wrap {
  padding: 36px 0 96px 0;
}

#deck[data-mode="page"] .pr-slide-wrap {
  padding: 12px 0 48px 0;
}

/* Griglie */
.pr-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.pr-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.pr-grid-why {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 20px 0;
}

@media (min-width: 760px) {
  .pr-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pr-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pr-grid-why {
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: baseline;
  }
}

/* Tipografia e utilità */
.pr-h1 {
  font-size: clamp(30px, 4.4vw, 40px);
  line-height: 1.1;
  font-weight: 500;
  margin: 0 auto 18px auto;
  max-width: 760px;
  color: var(--pr-text);
}

.pr-h2 {
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.2;
  font-weight: 500;
  margin: 8px 0 0 0;
  color: var(--pr-text);
}

.pr-h3 {
  margin: 8px 0;
  font-size: 20px;
  font-weight: 500;
}

.pr-lead {
  font-size: 20px;
  line-height: 24px;
  font-weight: 400;
  color: var(--pr-muted);
  margin: 0;
}

.pr-hero-lead {
  max-width: 660px;
  margin: 0 auto 30px auto;
}

.pr-kicker {
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  color: var(--pr-muted);
  letter-spacing: 0.06em;
}

.pr-meta {
  font-size: 12px;
  line-height: 18px;
  color: var(--pr-sec);
  margin-top: 4px;
}

.pr-body-sm {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--pr-muted);
}

.pr-body-md {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--pr-muted);
}

.pr-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid var(--pr-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--pr-muted);
}

.pr-section-head {
  margin-bottom: 24px;
}

.pr-section-head-split {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.pr-center {
  display: flex;
  justify-content: center;
}

.pr-hero-logo-wrap {
  margin-bottom: 24px;
}

.pr-hero-badge-wrap {
  margin-bottom: 18px;
}

.pr-cta-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pr-col-head {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

/* Toni semantici */
.tone-up { color: var(--pr-up); }
.tone-down { color: var(--pr-down); }
.tone-amber { color: var(--pr-amber); }
.tone-sec { color: var(--pr-sec); }
.tone-gold { color: var(--pr-gold); }
.tone-text { color: var(--pr-text); }

.pr-badge.tone-up { border-color: var(--pr-up); }
.pr-badge.tone-down { border-color: var(--pr-down); }
.pr-badge.tone-amber { border-color: var(--pr-amber); }
.pr-badge.tone-sec { border-color: var(--pr-sec); }
.pr-badge.tone-gold { border-color: var(--pr-gold); }

/* Demo Il Perché */
.pr-why-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--pr-border);
}

.pr-why-id {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pr-why-ticker {
  font-size: 18px;
  font-weight: 700;
}

.pr-why-change {
  font-size: 28px;
  font-weight: 600;
}

.pr-why-headline {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 500;
}

.pr-why-source-wrap {
  margin-top: 12px;
}

/* Demo Il Mattino */
.pr-morning-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.pr-morning-now {
  font-size: 16px;
  font-weight: 500;
}

.pr-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 54px;
  padding: 6px 0;
  user-select: none;
}

.pr-wave-bar {
  flex: 1 1 0;
  min-width: 3px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 2px;
  transition: background-color 140ms ease, height 140ms ease;
  cursor: pointer;
}

.pr-wave-bar[data-bar-state="played"] { background-color: var(--pr-gold); }
.pr-wave-bar[data-bar-state="mine"] { background-color: var(--pr-muted); }
.pr-wave-bar[data-bar-state="other"] { background-color: var(--pr-border); }

.h-22 { height: 22px; }
.h-24 { height: 24px; }
.h-26 { height: 26px; }
.h-28 { height: 28px; }
.h-30 { height: 30px; }
.h-32 { height: 32px; }
.h-34 { height: 34px; }
.h-36 { height: 36px; }
.h-38 { height: 38px; }
.h-40 { height: 40px; }
.h-42 { height: 42px; }
.h-44 { height: 44px; }
.h-46 { height: 46px; }
.h-48 { height: 48px; }
.h-50 { height: 50px; }
.h-52 { height: 52px; }

.pr-wave-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 6px 0 18px 0;
}

.pr-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  vertical-align: middle;
  margin-right: 6px;
}

.pr-swatch-gold { background: var(--pr-gold); }
.pr-swatch-muted { background: var(--pr-muted); }
.pr-swatch-border { background: var(--pr-border); }

.pr-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--pr-border);
}

.pr-chapters-list {
  margin-top: 8px;
}

.pr-chapter-row {
  width: 100%;
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
  color: var(--pr-text);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
}

.pr-chapter-row.is-active {
  color: var(--pr-gold);
  font-weight: 700;
}

.pr-chapter-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pr-transcript-box {
  padding: 14px 16px;
  background: var(--pr-surface-alt);
  border-left: 2px solid var(--pr-gold);
  font-size: 14px;
  color: var(--pr-muted);
}

/* Tabella confronto */
.pr-table-wrap {
  overflow-x: auto;
}

.pr-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.pr-table th,
.pr-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--pr-border);
  vertical-align: top;
  font-size: 14px;
}

.pr-table thead th {
  border-top: 1px solid var(--pr-border);
  border-bottom: 1.5px solid var(--pr-gold);
  color: var(--pr-text);
  font-size: 12px;
  text-transform: uppercase;
}

.pr-table-win {
  font-weight: 600;
}

/* Chiusura & contatti */
.pr-closing-intro {
  text-align: center;
  max-width: 660px;
  margin: 0 auto 28px auto;
}

.pr-closing-steps {
  margin-bottom: 28px;
}

.pr-step-col {
  border-top: 1px solid var(--pr-border);
  padding-top: 14px;
}

.pr-step-title {
  font-size: 14px;
  font-weight: 700;
}

.pr-contact-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.pr-legal-box {
  padding-top: 18px;
  border-top: 1px solid var(--pr-border);
  text-align: center;
}

.pr-legal-text {
  max-width: 740px;
  margin: 0 auto;
}

.pr-mail-link {
  color: var(--pr-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Navigatore inferiore (modalità Slide) */
.pr-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 35;
  background-color: var(--pr-bg);
  border-top: 1px solid var(--pr-border);
  padding: 10px 20px;
}

.pr-bottom-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pr-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.pr-dot {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: 1px solid var(--pr-border);
  background: transparent;
  color: var(--pr-sec);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pr-dot.is-active {
  border-color: var(--pr-gold);
  border-width: 1.5px;
  color: var(--pr-gold);
}

/* Stampa / PDF */
@media print {
  .pr-header,
  .pr-bottom-nav,
  .no-print {
    display: none !important;
  }

  #deck {
    background: #FAF6EE !important;
    color: #221C16 !important;
    min-height: auto;
  }

  #deck .pr-slide {
    display: block !important;
    page-break-after: always;
    break-after: page;
    padding: 24px 0 !important;
    border-bottom: none !important;
  }

  #deck .pr-slide:last-of-type {
    page-break-after: auto;
    break-after: auto;
  }

  .pr-tendina-panel {
    grid-template-rows: 1fr !important;
    opacity: 1 !important;
    margin-top: 14px !important;
  }

  .pr-slide-wrap {
    padding: 0 !important;
  }
}

/* Telefono: logo e scelta del tema su una sola riga */
@media (max-width: 420px) {
  .pr-header-inner {
    gap: 8px;
  }
  .pr-controls-group,
  .pr-pill-group {
    gap: 4px;
  }
  .pr-controls-group .pr-pill-sm {
    padding: 0 12px;
  }
}
