/**
 * Site Frontend CSS
 * =================
 * UI principale del sito: header, nav, modal, footer, archivi, articoli.
 * Usa esclusivamente Bizdash Design System (BDS).
 * Tutte le variabili sono in formato --bz-*.
 *
 * Riferimento: /DESIGN-SYSTEM.md
 */

/* ===== VARIABILI LAYOUT ===== */
:root {
  --dda-max-width: 1200px;
  --dda-content-width: 720px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; }

/* ===== BASE ===== */
html {
  overflow-x: hidden;
}
body.dda-single,
body.dda-archive {
  margin: 0;
  font-family: var(--bz-font-body);
  font-size: var(--bz-text-base);
  line-height: 1.6;
  color: var(--bz-text-primary);
  background: var(--bz-bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== MAIN ===== */
.dda-main {
  width: 100%;
  overflow-x: hidden;
}

/* ===== CONTAINER ===== */
.dda-container {
  width: 100%;
  max-width: var(--dda-max-width);
  margin: 0 auto;
  padding: 0 var(--bz-space-4);
}
.dda-container--narrow {
  max-width: var(--dda-content-width);
}


/* ===== ABOVE THE FOLD DESIGN SYSTEM ===== */
/*
 * Layout ATF ottimizzato:
 *
 * Desktop/Tablet: Immagine ~50% viewport, titolo sovrapposto
 * Mobile: Immagine ~40% viewport, layout compatto
 *
 * Struttura verticale:
 * [Header rubrica]
 * [Immagine hero con gradient]
 * [Titolo + Player sovrapposti all'immagine]
 * [Testo articolo - peek visibile]
 * [Sticky bar]
 */

/* ===== HERO IMAGE ===== */
.dda-hero-image {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 320px;
  max-height: 600px;
  overflow: hidden;
}
.dda-hero-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.dda-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    transparent 0%,
    transparent 40%,
    rgba(255,255,255,0.3) 65%,
    rgba(255,255,255,0.8) 85%,
    var(--bz-bg-base) 100%
  );
}

/* Dark mode hero overlay */
html.cf-theme-dark .dda-hero-overlay {
  background: linear-gradient(to bottom,
    transparent 0%,
    transparent 40%,
    rgba(18,18,18,0.3) 65%,
    rgba(18,18,18,0.8) 85%,
    var(--bz-bg-base) 100%
  );
}

/* ===== HERO CONTENT (Titolo + Player) ===== */
.dda-hero {
  padding: var(--bz-space-8) 0 var(--bz-space-6);
  text-align: center;
}
.dda-hero--has-image {
  /* Risale sull'immagine */
  margin-top: -100px;
  position: relative;
  z-index: 1;
  padding-top: 0;
  padding-bottom: var(--bz-space-4);
}

/* ===== HEADER (Glassmorphism) ===== */
.dda-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--bz-space-3) var(--bz-space-4);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  -webkit-transform: translate3d(0, 0, 0); /* Force GPU compositing for Safari/iPad */
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}
html.cf-theme-dark .dda-header {
  background: rgba(17, 17, 17, 0.75);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}
.dda-header.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
.dda-header-title {
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-size: var(--bz-text-base);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.dda-header-primary {
  color: var(--bz-text-primary);
}
.dda-header-secondary {
  color: var(--bz-text-primary);
}
.dda-header-menu {
  position: absolute;
  right: var(--bz-space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent !important;
  border: 1px solid var(--bz-gray-400) !important;
  border-radius: var(--bz-radius-sm);
  cursor: pointer;
  color: var(--bz-gray-700) !important;
  transition: all 0.2s;
}
.dda-header-menu svg {
  width: 24px;
  height: 24px;
  stroke: var(--bz-gray-700) !important;
  display: block;
}
html.cf-theme-dark .dda-header-menu {
  border-color: var(--bz-gray-600) !important;
  color: var(--bz-gray-300) !important;
}
html.cf-theme-dark .dda-header-menu svg {
  stroke: var(--bz-gray-300) !important;
}
.dda-header-menu:hover {
  background: var(--bz-bg-muted) !important;
  border-color: var(--bz-primary) !important;
  color: var(--bz-primary) !important;
}
.dda-header-menu:hover svg {
  stroke: var(--bz-primary) !important;
}

/* Header Nav Dropdown (Glassmorphism) */
/* NOTA: position fixed per uscire dallo stacking context dell'header (che ha backdrop-filter) */
.dda-header-nav {
  position: fixed;
  top: 56px; /* altezza header */
  right: var(--bz-space-4);
  min-width: 180px;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--bz-radius-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  padding: var(--bz-space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  z-index: 101; /* sopra header (100) */
}

/* Admin bar adjustment */
body.admin-bar .dda-header-nav {
  top: 88px; /* 56px header + 32px admin bar */
}

@media screen and (max-width: 782px) {
  body.admin-bar .dda-header-nav {
    top: 102px; /* 56px header + 46px admin bar mobile */
  }
}
html.cf-theme-dark .dda-header-nav {
  background: rgba(30, 30, 30, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.dda-header-nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dda-header-nav-item {
  display: flex;
  align-items: center;
  gap: var(--bz-space-2);
  width: 100%;
  padding: var(--bz-space-2) var(--bz-space-3);
  background: transparent;
  border: none;
  border-radius: var(--bz-radius-sm);
  font-family: inherit;
  font-size: var(--bz-text-sm);
  font-weight: 500;
  color: var(--bz-text-primary);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: all 0.2s;
}
.dda-header-nav-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--bz-gray-500);
  flex-shrink: 0;
}
html.cf-theme-dark .dda-header-nav-item svg {
  stroke: var(--bz-gray-400);
}
.dda-header-nav-item:hover {
  background: var(--bz-primary-alpha-20);
  color: var(--bz-primary);
}
.dda-header-nav-item:hover svg {
  stroke: var(--bz-primary);
}

/* Nav divider */
.dda-header-nav-divider {
  height: 1px;
  background: var(--bz-border-default);
  margin: var(--bz-space-2) 0;
}

/* Theme Toggle Switch */
.dda-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--bz-space-2);
  padding: var(--bz-space-2) var(--bz-space-3);
  cursor: pointer;
  user-select: none;
}
.dda-theme-toggle input {
  display: none;
}
.dda-theme-icon-light,
.dda-theme-icon-dark {
  flex-shrink: 0;
  stroke: var(--bz-gray-500);
  transition: stroke 0.2s, opacity 0.2s;
}
html.cf-theme-dark .dda-theme-icon-light,
html.cf-theme-dark .dda-theme-icon-dark {
  stroke: var(--bz-gray-400);
}
.dda-theme-icon-light {
  opacity: 1;
}
.dda-theme-icon-dark {
  opacity: 0.4;
}
html.cf-theme-dark .dda-theme-icon-light {
  opacity: 0.4;
}
html.cf-theme-dark .dda-theme-icon-dark {
  opacity: 1;
}
.dda-theme-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bz-bg-muted);
  border-radius: 12px;
  transition: background 0.3s;
}
.dda-theme-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
html.cf-theme-dark .dda-theme-slider {
  background: var(--bz-primary);
}
html.cf-theme-dark .dda-theme-slider::before {
  transform: translateX(20px);
}

/* ===== FONT SIZE TOGGLE ===== */
.dda-fontsize-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--bz-space-2);
  padding: var(--bz-space-2) var(--bz-space-3);
  cursor: pointer;
  user-select: none;
}
.dda-fontsize-toggle input {
  display: none;
}
.dda-fontsize-icon-normal,
.dda-fontsize-icon-large {
  flex-shrink: 0;
  stroke: var(--bz-gray-500);
  transition: stroke 0.2s, opacity 0.2s;
}
html.cf-theme-dark .dda-fontsize-icon-normal,
html.cf-theme-dark .dda-fontsize-icon-large {
  stroke: var(--bz-gray-400);
}
.dda-fontsize-icon-normal {
  opacity: 1;
}
.dda-fontsize-icon-large {
  opacity: 0.4;
}
html.fp-fontsize-large .dda-fontsize-icon-normal {
  opacity: 0.4;
}
html.fp-fontsize-large .dda-fontsize-icon-large {
  opacity: 1;
  stroke: var(--bz-primary);
}
.dda-fontsize-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bz-bg-muted);
  border-radius: 12px;
  transition: background 0.3s;
}
.dda-fontsize-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
html.fp-fontsize-large .dda-fontsize-slider {
  background: var(--bz-primary);
}
html.fp-fontsize-large .dda-fontsize-slider::before {
  transform: translateX(20px);
}

/* ===== LARGE FONT MODE ===== */
html.fp-fontsize-large {
  /* Increase ALL text sizes by ~15-20% for better readability */
  --bz-text-xs: 0.875rem;   /* 14px (was 12px) */
  --bz-text-sm: 1rem;       /* 16px (was 14px) */
  --bz-text-base: 1.125rem; /* 18px (was 16px) */
  --bz-text-lg: 1.375rem;   /* 22px (was 18px) - body content */
  --bz-text-xl: 1.5rem;     /* 24px (was 20px) */
  --bz-text-2xl: 1.875rem;  /* 30px (was 24px) */
  --bz-text-3xl: 2.25rem;   /* 36px (was 30px) - h2 */
  --bz-text-4xl: 2.75rem;   /* 44px (was 36px) */
  --bz-text-5xl: 3.5rem;    /* 56px (was 48px) */
  --bz-text-6xl: 4.5rem;    /* 72px (was 60px) */
}

/* ===== STICKY BAR (Glassmorphism) ===== */
.dda-sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.05);
  padding: var(--bz-space-3) var(--bz-space-4);
  padding-bottom: calc(var(--bz-space-3) + env(safe-area-inset-bottom, 0));
  min-height: 60px;
  -webkit-transform: translate3d(0, 0, 0); /* Force GPU compositing for Safari/iPad */
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}
html.cf-theme-dark .dda-sticky-bar {
  background: rgba(17, 17, 17, 0.78);
  border-top-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
}
.dda-sticky-bar.is-hidden,
.dda-sticky-bar.is-header-hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/* Stati */
.dda-sticky-state {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--bz-space-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.dda-sticky-state.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Stato Meta - sfondo rosa glassmorphism per l'intera barra (solo quando meta è attivo) */
.dda-sticky-bar:has(.dda-sticky-meta.is-active) {
  background: rgba(252, 228, 236, 0.85);
  border-top-color: rgba(248, 187, 217, 0.6);
}
.dda-sticky-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--bz-space-3);
  font-size: var(--bz-text-sm);
  color: var(--bz-text-primary);
  font-weight: 500;
}
/* Dark mode: sticky bar pink glassmorphism quando meta attivo */
html.cf-theme-dark .dda-sticky-bar:has(.dda-sticky-meta.is-active) {
  background: rgba(74, 26, 46, 0.88);
  border-top-color: rgba(107, 42, 69, 0.6);
}
.dda-sticky-meta .dda-meta-sep {
  opacity: 0.3;
}
.dda-sticky-meta .dda-meta-reading {
  display: inline-flex;
  align-items: center;
  gap: var(--bz-space-0-5);
}
.dda-sticky-meta .dda-meta-reading svg {
  opacity: 0.7;
}
.dda-sticky-meta .dda-meta-comments {
  display: inline-flex;
  align-items: center;
  gap: var(--bz-space-0-5);
  color: var(--bz-text-primary);
  text-decoration: none;
  transition: color 0.2s;
}
.dda-sticky-meta .dda-meta-comments:hover {
  color: var(--bz-primary);
}
.dda-sticky-meta .dda-meta-comments svg {
  opacity: 0.7;
}
/* Vote display (sticky bar) - 1 stella + voto */
.dda-meta-vote {
  display: inline-flex;
  align-items: center;
  gap: var(--bz-space-0-5);
  font-family: var(--bz-font-body);
  font-size: var(--bz-text-sm);
  font-weight: 600;
  color: var(--bz-text-primary);
}
.dda-meta-vote svg {
  flex-shrink: 0;
}
/* Star icon color - gold for both themes */
.dda-meta-vote .dda-star-icon {
  color: #FFA41C; /* Amazon gold */
}

/* Stato Audio */
.dda-sticky-audio {
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}
.dda-audio-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: var(--bz-btn-height-md);   /* 44px WCAG minimum */
  min-height: var(--bz-btn-height-md);  /* 44px WCAG minimum */
  border-radius: 50%;
  background: var(--bz-primary);
  color: white;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.dda-audio-play:hover {
  background: var(--bz-primary-600);
  transform: scale(1.05);
}
/* Sticky audio play/pause toggle */
.dda-audio-play .dda-audio-icon-pause { display: none; }
.dda-audio-play.is-playing .dda-audio-icon-play { display: none; }
.dda-audio-play.is-playing .dda-audio-icon-pause { display: block; }
.dda-audio-progress {
  flex: 1;
  height: 4px;
  background: var(--bz-bg-muted);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}
.dda-audio-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--bz-primary);
  border-radius: 2px;
  transition: width 0.1s linear;
}
.dda-audio-time {
  font-size: var(--bz-text-sm);
  font-weight: 500;
  color: var(--bz-text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: right;
}
/* Stato placeholder (nessun audio) */
.dda-sticky-audio.is-placeholder .dda-audio-play {
  background: var(--bz-bg-muted);
  cursor: default;
}
.dda-sticky-audio.is-placeholder .dda-audio-play:hover {
  transform: none;
}
.dda-sticky-audio.is-placeholder .dda-audio-progress {
  cursor: default;
}
.dda-sticky-audio.is-placeholder .dda-audio-time {
  color: var(--bz-text-muted);
}

@media (max-width: 600px) {
  .dda-sticky-audio {
    max-width: 320px;
    margin: 0 auto;
    padding: 0 var(--bz-space-3);
  }
  .dda-audio-play {
    width: 40px;
    height: 40px;
    /* Keep min-height from WCAG variables */
  }
}

/* ===== NAV BAR (commenti - Glassmorphism) ===== */
.dda-nav-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  background: rgba(79, 55, 99, 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 -8px 32px rgba(79, 55, 99, 0.3);
  padding: var(--bz-space-4) var(--bz-space-6);
  padding-bottom: calc(var(--bz-space-6) + env(safe-area-inset-bottom, 0));
  display: flex;
  transform: translateY(100%) translateZ(0); /* translateZ for GPU */
  will-change: transform, backdrop-filter;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease,
              padding 0.3s ease;
  flex-direction: column;
  align-items: center;
  gap: var(--bz-space-3);
}
.dda-nav-bar.is-visible {
  transform: translateY(0) translateZ(0);
  opacity: 1;
  pointer-events: auto;
}

/* Toggle button (minimize/expand) - Touch Target */
.dda-nav-toggle {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  min-width: var(--bz-btn-height-sm);   /* 36px - secondary actions */
  min-height: var(--bz-btn-height-sm);  /* 36px - secondary actions */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  transition: background 0.2s, color 0.2s, transform 0.3s;
}
.dda-nav-toggle:hover {
  background: rgba(255,255,255,0.25);
  color: white;
}
.dda-nav-toggle-icon {
  transition: transform 0.3s ease;
}
.dda-nav-bar.is-minimized .dda-nav-toggle-icon {
  transform: rotate(180deg);
}

/* Label (Esplora) - clickable when minimized */
.dda-nav-label {
  font-size: var(--bz-text-xs);
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: none;
  border: none;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  transition: all 0.3s ease;
}
.dda-nav-label svg {
  opacity: 0;
  width: 0;
  transition: opacity 0.3s, width 0.3s;
}

/* Minimized state */
.dda-nav-bar.is-minimized {
  padding: var(--bz-space-3) var(--bz-space-4);
  padding-bottom: calc(var(--bz-space-3) + env(safe-area-inset-bottom, 0));
}
.dda-nav-bar.is-minimized .dda-nav-label {
  cursor: pointer;
  color: rgba(255,255,255,0.9);
  font-size: var(--bz-text-sm);
}
.dda-nav-bar.is-minimized .dda-nav-label:hover {
  color: white;
}
.dda-nav-bar.is-minimized .dda-nav-label svg {
  opacity: 1;
  width: 16px;
}
.dda-nav-bar.is-minimized .dda-nav-links {
  display: none;
}
/* Su desktop minimized, centra verticalmente il toggle */
@media (min-width: 601px) {
  .dda-nav-bar.is-minimized .dda-nav-toggle {
    top: 50%;
    transform: translateY(-50%);
  }
}
.dda-nav-links {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: var(--bz-space-4);
  width: 100%;
  max-width: min(500px, 100%);
}
.dda-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--bz-space-2);
  padding: var(--bz-space-2) var(--bz-space-4);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--bz-radius-md);
  font-size: var(--bz-text-base);
  font-weight: 600;
  color: white;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  line-height: 1;
  min-height: 52px;
  flex: 1;
}
.dda-nav-btn svg {
  width: 20px;
  height: 20px;
  stroke: white;
  flex-shrink: 0;
}
.dda-nav-btn:hover {
  background: var(--bz-primary);
  border-color: var(--bz-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196, 46, 111, 0.5);
}
.dda-nav-btn:active {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .dda-nav-bar {
    padding: var(--bz-space-3) var(--bz-space-4) calc(var(--bz-space-4) + env(safe-area-inset-bottom, 0px));
    gap: var(--bz-space-2);
    /* Spazio per il toggle button */
    padding-right: calc(var(--bz-space-4) + 44px);
  }
  .dda-nav-label {
    font-size: var(--bz-text-sm);
  }
  .dda-nav-links {
    flex-direction: column;
    gap: var(--bz-space-2);
    width: 100%;
  }
  .dda-nav-btn {
    padding: var(--bz-space-2) var(--bz-space-3);
    font-size: var(--bz-text-sm);
    min-height: 44px;
    gap: var(--bz-space-1);
    width: 100%;
    justify-content: center;
  }
  .dda-nav-btn svg {
    width: 18px;
    height: 18px;
  }
  /* Toggle button mobile - centrato verticalmente a destra */
  .dda-nav-toggle {
    width: 40px;
    height: 40px;
    top: 50%;
    right: var(--bz-space-3);
    transform: translateY(-50%);
  }
  /* Minimized mobile */
  .dda-nav-bar.is-minimized {
    padding: var(--bz-space-2) var(--bz-space-4);
    padding-bottom: calc(var(--bz-space-2) + env(safe-area-inset-bottom, 0));
    padding-right: calc(var(--bz-space-4) + 44px);
  }
}


/* Titolo */
.dda-title {
  font-family: var(--bz-font-serif);
  font-size: clamp(2.25rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 var(--bz-space-4);
  color: var(--bz-text-primary);
  text-shadow:
    0 1px 2px rgba(255,255,255,0.9),
    0 2px 15px rgba(255,255,255,0.7),
    0 0 30px rgba(255,255,255,0.4);
  text-align: center;
}

html.cf-theme-dark .dda-title {
  text-shadow:
    0 1px 2px rgba(0,0,0,0.9),
    0 2px 15px rgba(0,0,0,0.7),
    0 0 30px rgba(0,0,0,0.4);
}

/* ===== AUDIO PLAYER (Glassmorphism) ===== */
.dda-player {
  max-width: 500px;
  margin: var(--bz-space-3) auto 0;
  padding: var(--bz-space-3) var(--bz-space-4);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--bz-radius-lg);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
html.cf-theme-dark .dda-player {
  background: rgba(30, 30, 30, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.dda-player-inner {
  display: flex;
  align-items: center;
  gap: var(--bz-space-4);
}
.dda-play-btn {
  width: 48px;
  height: 48px;
  min-width: var(--bz-btn-height-md);   /* 44px WCAG minimum */
  min-height: var(--bz-btn-height-md);  /* 44px WCAG minimum */
  border-radius: 50%;
  background: var(--bz-primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 15px var(--bz-primary-alpha-40);
  transition: transform 0.2s, box-shadow 0.2s;
}
.dda-play-btn svg {
  width: 20px;
  height: 20px;
}
.dda-play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px var(--bz-primary-alpha-40);
}
.dda-play-btn--placeholder {
  background: var(--bz-bg-muted);
  box-shadow: none;
  cursor: default;
}
.dda-play-btn--placeholder:hover {
  transform: none;
}
/* Play/Pause icons toggle */
.dda-play-btn .dda-pause-icon { display: none; }
.dda-play-btn.is-playing .dda-play-icon { display: none; }
.dda-play-btn.is-playing .dda-pause-icon { display: block; }

.dda-player-info {
  flex: 1;
  min-width: 0;
}
.dda-player-label {
  display: block;
  font-size: var(--bz-text-sm);
  font-weight: 500;
  color: var(--bz-text-primary);
  margin-bottom: var(--bz-space-1);
}
.dda-player-progress {
  height: 4px;
  background: var(--bz-bg-muted);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}
.dda-player-bar {
  height: 100%;
  width: 0%;
  background: var(--bz-primary);
  border-radius: 2px;
  transition: width 0.1s linear;
}
.dda-player-time {
  font-size: var(--bz-text-xs);
  color: var(--bz-text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.dda-podcast-links {
  display: flex;
  justify-content: center;
  gap: var(--bz-space-2);
  margin-top: var(--bz-space-3);
  padding-top: var(--bz-space-3);
  border-top: 1px solid rgba(0,0,0,0.08);
}
.dda-podcast-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  text-decoration: none;
  border-radius: var(--bz-radius-full);
  background: rgba(0,0,0,0.15);
  transition: all 0.2s;
}
.dda-podcast-link:hover {
  transform: scale(1.1);
}
.dda-podcast-link img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.dda-podcast-spotify:hover {
  background: #1DB954;
}
.dda-podcast-apple:hover {
  background: #9933CC;
}
.dda-podcast-amazon:hover {
  background: #00A8E1;
}
html.cf-theme-dark .dda-podcast-links {
  border-top-color: rgba(255,255,255,0.1);
}
html.cf-theme-dark .dda-podcast-link {
  background: rgba(255,255,255,0.15);
}

/* ===== CONTENUTO ARTICOLO ===== */
.dda-content {
  padding: var(--bz-space-4) 0 var(--bz-space-12);
}
.dda-content p {
  font-family: var(--bz-font-serif);
  font-size: var(--bz-text-lg);
  line-height: 1.85;
  margin: 0 0 var(--bz-space-6);
  color: var(--bz-text-primary);
}
.dda-content p:last-child {
  margin-bottom: 0;
}
.dda-content a {
  color: var(--bz-primary);
  text-decoration: none;
  box-shadow: inset 0 -2px 0 var(--bz-primary-alpha-20);
  transition: box-shadow 0.2s;
}
.dda-content a:hover {
  box-shadow: inset 0 -2px 0 var(--bz-primary-alpha-40);
}
.dda-content blockquote {
  margin: var(--bz-space-8) 0;
  padding: var(--bz-space-4) var(--bz-space-6);
  border-left: 4px solid var(--bz-primary);
  background: var(--bz-bg-subtle);
  border-radius: 0 var(--bz-radius-md) var(--bz-radius-md) 0;
  font-style: italic;
  font-size: var(--bz-text-lg);
}
.dda-content blockquote p {
  margin-bottom: var(--bz-space-3);
}
.dda-content blockquote p:last-child {
  margin-bottom: 0;
}
.dda-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--bz-radius-md);
}
.dda-content h2 {
  font-family: var(--bz-font-serif);
  font-size: var(--bz-text-3xl);
  font-weight: 700;
  line-height: 1.2;
  margin: var(--bz-space-12) 0 var(--bz-space-6);
  color: var(--bz-text-primary);
}
.dda-content h3 {
  font-family: var(--bz-font-serif);
  font-size: var(--bz-text-2xl);
  font-weight: 700;
  line-height: 1.3;
  margin: var(--bz-space-8) 0 var(--bz-space-4);
  color: var(--bz-text-primary);
}
.dda-content ul,
.dda-content ol {
  font-family: var(--bz-font-serif);
  font-size: var(--bz-text-lg);
  line-height: 1.85;
  margin: 0 0 var(--bz-space-6);
  padding-left: var(--bz-space-6);
}
.dda-content li {
  margin-bottom: var(--bz-space-3);
}

/* ===== WIZARD SECTION (Full width ribbon) ===== */
.dda-wizard-section {
  padding: 0;
  background: transparent;
  width: 100%;
}
/* Rimuovi margini dal wizard dentro la sezione */
.dda-wizard-section .fbiz-wizard-wrap,
.dda-wizard-section .promo-banner-capitolo {
  margin: 0;
}

/* ===== RATING SECTION ===== */
.dda-rating-section {
  padding: 0 0 var(--bz-space-8);
  margin-bottom: var(--bz-space-6);
  text-align: center;
  border-bottom: 1px solid var(--bz-border-default);
}

/* ===== COMMENTI (Glassmorphism) ===== */
.dda-comments {
  padding: var(--bz-space-12) 0;
  background: var(--bz-bg-subtle);
}
.dda-comments-title {
  font-family: var(--bz-font-serif);
  font-size: var(--bz-text-2xl);
  font-weight: 700;
  margin: 0 0 var(--bz-space-8);
  color: var(--bz-text-primary);
}
.dda-comments-count {
  color: var(--bz-text-muted);
  font-weight: 400;
}
.dda-comments-closed {
  font-family: var(--bz-font-body);
  font-size: var(--bz-text-sm);
  color: var(--bz-text-muted);
  font-style: italic;
  margin: 0 0 var(--bz-space-8);
  padding: var(--bz-space-4);
  background: var(--bz-bg-muted);
  border-radius: var(--bz-radius-md);
  text-align: center;
}

/* ===== COMMENT FORM (Diario + Bizdash Community) ===== */
.dda-comment-form.fbz-comm-form {
  margin-top: 0;
  margin-bottom: var(--bz-space-16);
}

/* Reply title: "Rispondi a [nome]" + Annulla */
.dda-comment-form #reply-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--bz-space-3);
  font-size: var(--bz-text-base);
  font-weight: 500;
  font-family: var(--bz-font-body);
  color: var(--bz-text-primary);
  margin: 0 0 var(--bz-space-4) 0;
  padding: var(--bz-space-3) var(--bz-space-4);
  background: var(--bz-primary-alpha-10);
  border: 1px solid var(--bz-primary-alpha-20);
  border-radius: var(--bz-radius-md);
}
.dda-comment-form #reply-title a:not(#cancel-comment-reply-link) {
  color: var(--bz-primary);
  font-weight: 600;
  text-decoration: none;
}
.dda-comment-form #reply-title small {
  margin-left: auto;
}
.dda-comment-form #cancel-comment-reply-link {
  font-size: var(--bz-text-sm);
  font-weight: 500;
  color: var(--bz-text-muted);
  text-decoration: none;
  padding: var(--bz-space-2) var(--bz-space-3);
  background: var(--bz-bg-subtle);
  border: 1px solid var(--bz-border-default);
  border-radius: var(--bz-radius-full);
  transition: all 0.2s;
}
.dda-comment-form #cancel-comment-reply-link:hover {
  color: var(--bz-text-primary);
  border-color: var(--bz-text-muted);
}

/* Textarea commento */
.dda-comment-form .comment-form-comment {
  margin-bottom: var(--bz-space-4);
}
.dda-comment-form .fbz-field.fbz-comment {
  margin-bottom: var(--bz-space-4);
}

/* Campi nome/email - griglia */
.dda-comment-form .fbz-comment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--bz-space-4);
  margin-bottom: var(--bz-space-4);
}
.dda-comment-form .fbz-comment-stack {
  display: flex;
  flex-direction: column;
  gap: var(--bz-space-4);
  margin-bottom: var(--bz-space-4);
}
.dda-comment-form .fbz-field {
  display: flex;
  flex-direction: column;
}
.dda-comment-form .fbz-field p {
  margin: 0;
}

/* Input styling */
.dda-comment-form textarea,
.dda-comment-form input[type='text'],
.dda-comment-form input[type='email'] {
  width: 100%;
  padding: var(--bz-space-3) var(--bz-space-4);
  border: 2px solid var(--bz-border-default);
  border-radius: var(--bz-radius-md);
  font-family: inherit;
  font-size: var(--bz-text-base);
  background: var(--bz-bg-base);
  color: var(--bz-text-primary);
  transition: all 0.2s;
  box-sizing: border-box;
}
html.cf-theme-dark .dda-comment-form textarea,
html.cf-theme-dark .dda-comment-form input[type='text'],
html.cf-theme-dark .dda-comment-form input[type='email'] {
  background: var(--bz-bg-muted);
  border-color: var(--bz-border-emphasis);
  color: var(--bz-text-primary);
}
.dda-comment-form textarea::placeholder,
.dda-comment-form input::placeholder {
  color: var(--bz-text-muted);
}
html.cf-theme-dark .dda-comment-form textarea::placeholder,
html.cf-theme-dark .dda-comment-form input::placeholder {
  color: var(--bz-text-muted);
}
.dda-comment-form textarea:focus,
.dda-comment-form input[type='text']:focus,
.dda-comment-form input[type='email']:focus {
  outline: none;
  border-color: var(--bz-primary);
  box-shadow: 0 0 0 3px var(--bz-primary-alpha-20);
}
.dda-comment-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* Utente riconosciuto - campo readonly */
.dda-comment-form input[readonly] {
  background: var(--bz-bg-muted);
  opacity: 0.7;
  cursor: not-allowed;
}
html.cf-theme-dark .dda-comment-form input[readonly] {
  background: var(--bz-border-default);
}

/* Submit button */
.dda-comment-form .form-submit {
  margin: var(--bz-space-4) 0 var(--bz-space-3);
}
.dda-comment-form .dda-comment-submit,
.dda-comment-form input[type='submit'] {
  background: var(--bz-primary);
  color: white;
  border: none;
  padding: var(--bz-space-3) var(--bz-space-6);
  border-radius: var(--bz-radius-full);
  font-size: var(--bz-text-base);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--bz-primary-alpha-40);
  transition: all 0.2s;
}
.dda-comment-form .dda-comment-submit:hover,
.dda-comment-form input[type='submit']:hover {
  background: var(--bz-primary-600);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--bz-primary-alpha-40);
}

/* Note utente riconosciuto */
.dda-comment-form .fbz-meta-note {
  margin: 0 0 var(--bz-space-4) 0;
  padding: var(--bz-space-3) var(--bz-space-4);
  background: var(--bz-primary-alpha-10);
  border: none;
  border-left: 3px solid var(--bz-primary);
  border-radius: var(--bz-radius-md);
  font-size: var(--bz-text-sm);
  color: var(--bz-text-primary);
  line-height: 1.5;
}
.dda-comment-form .fbz-meta-note small {
  font-size: inherit;
}
.dda-comment-form .fbz-meta-note a {
  color: var(--bz-primary);
  text-decoration: underline;
  margin-left: var(--bz-space-2);
}

/* Consenso checkboxes */
.dda-comment-form .fbz-consent-note {
  margin-top: var(--bz-space-2);
  margin-bottom: var(--bz-space-2);
}
.dda-comment-form .fbz-consent-note:last-of-type {
  margin-bottom: var(--bz-space-12);
}
.dda-comment-form .fbz-consent-note label {
  font-weight: 500;
  font-size: var(--bz-text-sm);
  color: var(--bz-text-primary);
}

/* Responsive mobile */
@media (max-width: 640px) {
  .dda-comment-form .fbz-comment-row {
    grid-template-columns: 1fr;
  }
  .dda-comment-form #reply-title small {
    width: 100%;
    margin-left: 0;
    margin-top: var(--bz-space-2);
  }
}

/* Comment List */
.dda-comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dda-comment {
  margin-bottom: var(--bz-space-4);
}
.dda-comment-body {
  background: var(--bz-bg-subtle);
  border: 1px solid var(--bz-border-default);
  border-radius: var(--bz-radius-lg);
  padding: var(--bz-space-3) var(--bz-space-4);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px var(--bz-shadow-primary);
}
.dda-comment--author .dda-comment-body {
  background: var(--bz-primary-alpha-20);
  border-color: var(--bz-primary-alpha-40);
}
.dda-comment-header {
  display: flex;
  align-items: center;
  gap: var(--bz-space-3);
  margin-bottom: var(--bz-space-3);
}
.dda-comment-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.dda-comment-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dda-comment-author {
  font-weight: 600;
  font-size: var(--bz-text-base);
  display: flex;
  align-items: center;
  gap: var(--bz-space-1);
  color: var(--bz-text-primary);
}
.dda-comment-date {
  font-size: var(--bz-text-xs);
  color: var(--bz-text-muted);
}

/* ===== Comment Banner (top strip) ===== */
.dda-comment-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  margin: calc(-1 * var(--bz-space-3)) calc(-1 * var(--bz-space-4)) var(--bz-space-2);
  border-radius: var(--bz-radius-lg) var(--bz-radius-lg) 0 0;
}
.dda-comment-banner .dda-comment-author {
  font-size: var(--bz-text-sm);
  font-weight: 600;
}
.dda-comment-banner .dda-comment-badge {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.3);
}
.dda-comment-meta {
  padding: 0 0 var(--bz-space-2);
}
.dda-comment-meta .dda-comment-date {
  font-size: var(--bz-text-xs);
  color: var(--bz-text-muted);
}
.dda-comment-banner--author {
  background: linear-gradient(135deg, #c42e6f 0%, #992958 100%);
}
.dda-comment-banner--author .dda-comment-author,
.dda-comment-banner--author .dda-comment-badge {
  color: white;
}
.dda-comment-banner--author .dda-comment-badge {
  background: rgba(255,255,255,0.25);
}
.dda-comment-banner--lv1 {
  background: linear-gradient(135deg, rgba(160, 140, 100, 0.18) 0%, rgba(160, 140, 100, 0.12) 100%);
  color: #5a4d3a;
}
.dda-comment-banner--lv1 .dda-comment-badge {
  background: rgba(160, 140, 100, 0.18);
  color: #5a4d3a;
}
.dda-comment-banner--lv2 {
  background: linear-gradient(135deg, rgba(160, 140, 100, 0.32) 0%, rgba(160, 140, 100, 0.24) 100%);
  color: #4a3f30;
}
.dda-comment-banner--lv2 .dda-comment-badge {
  background: rgba(160, 140, 100, 0.25);
  color: #4a3f30;
}
.dda-comment-banner--lv3 {
  background: linear-gradient(135deg, rgba(160, 140, 100, 0.48) 0%, rgba(160, 140, 100, 0.40) 100%);
  color: #3a3225;
}
.dda-comment-banner--lv3 .dda-comment-badge {
  background: rgba(160, 140, 100, 0.35);
  color: #3a3225;
}

/* ===== Comment Body background tint ===== */
.dda-comment-body--author {
  background: rgba(196, 46, 111, 0.08);
  border-color: rgba(196, 46, 111, 0.25);
}
.dda-comment-body--lv1 {
  background: rgba(160, 140, 100, 0.04);
  border-color: rgba(160, 140, 100, 0.12);
}
.dda-comment-body--lv2 {
  background: rgba(160, 140, 100, 0.07);
  border-color: rgba(160, 140, 100, 0.18);
}
.dda-comment-body--lv3 {
  background: rgba(160, 140, 100, 0.11);
  border-color: rgba(160, 140, 100, 0.25);
}

/* Dark mode */
html.cf-theme-dark .dda-comment-banner--lv1 {
  background: linear-gradient(135deg, rgba(180, 160, 120, 0.20) 0%, rgba(180, 160, 120, 0.14) 100%);
  color: #c4b08a;
}
html.cf-theme-dark .dda-comment-banner--lv1 .dda-comment-badge {
  background: rgba(180, 160, 120, 0.22);
  color: #c4b08a;
}
html.cf-theme-dark .dda-comment-banner--lv2 {
  background: linear-gradient(135deg, rgba(180, 160, 120, 0.35) 0%, rgba(180, 160, 120, 0.26) 100%);
  color: #d4c49a;
}
html.cf-theme-dark .dda-comment-banner--lv2 .dda-comment-badge {
  background: rgba(180, 160, 120, 0.30);
  color: #d4c49a;
}
html.cf-theme-dark .dda-comment-banner--lv3 {
  background: linear-gradient(135deg, rgba(180, 160, 120, 0.50) 0%, rgba(180, 160, 120, 0.42) 100%);
  color: #e4d4aa;
}
html.cf-theme-dark .dda-comment-banner--lv3 .dda-comment-badge {
  background: rgba(180, 160, 120, 0.38);
  color: #e4d4aa;
}
html.cf-theme-dark .dda-comment-body--author {
  background: rgba(196, 46, 111, 0.10);
  border-color: rgba(196, 46, 111, 0.20);
}
html.cf-theme-dark .dda-comment-body--lv1 {
  background: rgba(180, 160, 120, 0.04);
  border-color: rgba(180, 160, 120, 0.12);
}
html.cf-theme-dark .dda-comment-body--lv2 {
  background: rgba(180, 160, 120, 0.06);
  border-color: rgba(180, 160, 120, 0.16);
}
html.cf-theme-dark .dda-comment-body--lv3 {
  background: rgba(180, 160, 120, 0.10);
  border-color: rgba(180, 160, 120, 0.22);
}
.dda-comment-content {
  font-size: var(--bz-text-base);
  line-height: 1.7;
  color: var(--bz-text-primary);
}
.dda-comment-content p {
  margin: 0 0 var(--bz-space-3);
  font-family: var(--bz-font-body);
  font-size: inherit;
  line-height: inherit;
}
.dda-comment-content p:last-child {
  margin-bottom: 0;
}
.dda-comment-content a {
  color: var(--bz-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dda-comment-content a:hover {
  color: var(--bz-primary-600);
}
html.cf-theme-dark .dda-comment-content a {
  color: var(--bz-primary-300, #F2A7C5);
}
html.cf-theme-dark .dda-comment-content a:hover {
  color: var(--bz-primary-200, #F7C5D8);
}
.dda-comment-footer {
  margin-top: var(--bz-space-3);
  padding-top: var(--bz-space-3);
  border-top: 1px solid var(--bz-border-default);
  display: flex;
  align-items: center;
  gap: var(--bz-space-4);
}

/* Like button in comment footer */
.dda-comment-footer .fbz-like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  color: var(--bz-text-secondary);
  transition: color 0.2s;
}
.dda-comment-footer .fbz-like:hover {
  color: var(--bz-primary);
}
.dda-comment-footer .fbz-like.is-liked {
  color: var(--bz-primary);
}
.dda-comment-footer .fbz-like-ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
}
.dda-comment-footer .fbz-like.is-liked .fbz-like-ico {
  fill: currentColor;
}
.dda-comment-footer .fbz-like-count {
  font-size: var(--bz-text-sm);
  font-weight: 600;
}

/* Reply trigger button */
.dda-reply-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  font-size: var(--bz-text-sm);
  color: var(--bz-primary);
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.dda-reply-trigger:hover {
  color: var(--bz-primary-600);
  text-decoration: underline;
}
.dda-reply-trigger svg {
  opacity: 0.8;
}

/* ===== Inline Reply Form ===== */
.dda-inline-reply-container {
  margin-top: var(--bz-space-4);
}
.dda-inline-reply-container:empty {
  display: none;
}
.dda-inline-reply-form {
  background: var(--bz-bg-subtle);
  border: 1px solid var(--bz-border-default);
  border-radius: var(--bz-radius-md);
  padding: var(--bz-space-4);
  animation: dda-slide-down 0.25s ease;
}
@keyframes dda-slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.dda-inline-reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--bz-space-3);
}
.dda-inline-reply-title {
  font-size: var(--bz-text-sm);
  color: var(--bz-text-primary);
}
.dda-inline-reply-cancel {
  background: none;
  border: none;
  color: var(--bz-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--bz-radius-sm);
  transition: color 0.2s, background 0.2s;
}
.dda-inline-reply-cancel:hover {
  color: var(--bz-text-primary);
  background: var(--bz-bg-muted);
}
.dda-inline-reply-identity {
  font-size: var(--bz-text-sm);
  color: var(--bz-text-secondary);
  margin: 0 0 var(--bz-space-3);
}
.dda-inline-reply-fields {
  display: flex;
  gap: var(--bz-space-2);
  margin-bottom: var(--bz-space-3);
}
.dda-inline-reply-fields input {
  flex: 1;
  padding: var(--bz-space-2) var(--bz-space-3);
  border: 1px solid var(--bz-border-default);
  border-radius: var(--bz-radius-sm);
  font-size: var(--bz-text-sm);
  background: var(--bz-bg-base);
  color: var(--bz-text-primary);
}
.dda-inline-reply-fields input:focus {
  outline: none;
  border-color: var(--bz-primary);
}
.dda-inline-reply-form textarea {
  width: 100%;
  padding: var(--bz-space-3);
  border: 1px solid var(--bz-border-default);
  border-radius: var(--bz-radius-sm);
  font-size: var(--bz-text-base);
  font-family: inherit;
  background: var(--bz-bg-base);
  color: var(--bz-text-primary);
  resize: vertical;
  min-height: 80px;
}
.dda-inline-reply-form textarea:focus {
  outline: none;
  border-color: var(--bz-primary);
}
.dda-inline-reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--bz-space-3);
  margin-top: var(--bz-space-3);
}
.dda-inline-reply-cancel-btn {
  background: none;
  border: 1px solid var(--bz-border-default);
  padding: var(--bz-space-2) var(--bz-space-4);
  border-radius: var(--bz-radius-sm);
  font-size: var(--bz-text-sm);
  color: var(--bz-text-primary);
  cursor: pointer;
  transition: background 0.2s;
}
.dda-inline-reply-cancel-btn:hover {
  background: var(--bz-bg-muted);
}
.dda-inline-reply-submit {
  background: var(--bz-primary);
  border: none;
  padding: var(--bz-space-2) var(--bz-space-4);
  border-radius: var(--bz-radius-sm);
  font-size: var(--bz-text-sm);
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}
.dda-inline-reply-submit:hover {
  background: var(--bz-primary-600);
}

/* Mobile */
@media (max-width: 600px) {
  .dda-inline-reply-fields {
    flex-direction: column;
  }
  .dda-inline-reply-form {
    padding: var(--bz-space-3);
  }
}

/* Nested comments */
.dda-comment .children {
  list-style: none;
  padding: 0;
  margin: var(--bz-space-4) 0 0 var(--bz-space-6);
}

/* ===== MODALI ESPLORAZIONE ===== */
.dda-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--bz-space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.dda-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.dda-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.dda-modal-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(30px) scale(0.95) translateZ(0);
  will-change: transform, backdrop-filter;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
html.cf-theme-dark .dda-modal-container {
  background: rgba(20, 20, 25, 0.4);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.dda-modal.is-open .dda-modal-container {
  transform: translateY(0) scale(1) translateZ(0);
}

/* Modal Header */
.dda-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--bz-space-6) var(--bz-space-6) var(--bz-space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.dda-modal-title {
  display: flex;
  align-items: center;
  gap: var(--bz-space-2);
  font-family: var(--bz-font-heading);
  font-size: var(--bz-text-xl);
  font-weight: 600;
  margin: 0;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.dda-modal-title svg {
  width: 24px;
  height: 24px;
  stroke: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}
.dda-modal-close {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 50% !important;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8) !important;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 0 !important;
}
.dda-modal-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}
.dda-modal-close:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Modal Body */
.dda-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--bz-space-4) var(--bz-space-6);
}
.dda-modal-grid {
  display: flex;
  flex-direction: column;
  gap: var(--bz-space-3);
}
.dda-modal-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  padding: var(--bz-space-8) 0;
}

/* Modal Cards */
.dda-modal-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: var(--bz-space-4);
  text-decoration: none;
  padding: var(--bz-space-3);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.dda-modal-card:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}
.dda-modal-card-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}
.dda-modal-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dda-modal-card-content {
  display: flex;
  flex-direction: column;
  gap: var(--bz-space-0-5);
  min-width: 0;
}
.dda-modal-card-title {
  font-family: var(--bz-font-heading);
  font-size: var(--bz-text-base);
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dda-modal-card-meta {
  font-size: var(--bz-text-sm);
  color: rgba(255, 255, 255, 0.6);
}
.dda-modal-card-excerpt {
  font-size: var(--bz-text-base);
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Modal Footer */
.dda-modal-footer {
  padding: var(--bz-space-4) var(--bz-space-6) var(--bz-space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.dda-modal-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--bz-space-1);
  width: 100%;
  padding: var(--bz-space-3) var(--bz-space-6);
  font-family: var(--bz-font-heading);
  font-size: var(--bz-text-base);
  font-weight: 600;
  color: white;
  background: var(--bz-primary);
  text-decoration: none;
  border-radius: var(--bz-radius-full);
  transition: all 0.2s;
  box-shadow: 0 4px 15px var(--bz-primary-alpha-40);
}
.dda-modal-cta:hover {
  background: var(--bz-primary-600);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--bz-primary-alpha-40);
}
.dda-modal-cta svg {
  width: 16px;
  height: 16px;
}

/* Modal responsive */
@media (max-width: 600px) {
  .dda-modal {
    padding: var(--bz-space-3);
    align-items: center;
    justify-content: center;
  }
  .dda-modal-container {
    max-height: 80vh;
    max-width: calc(100% - var(--bz-space-4));
    border-radius: var(--bz-radius-lg);
    transform: translateY(30px) scale(0.95) translateZ(0);
  }
  .dda-modal.is-open .dda-modal-container {
    transform: translateY(0) scale(1) translateZ(0);
  }
  .dda-modal-header {
    padding: var(--bz-space-3) var(--bz-space-4);
  }
  .dda-modal-title {
    font-size: var(--bz-text-base);
    gap: var(--bz-space-1);
  }
  .dda-modal-title svg {
    width: 20px;
    height: 20px;
  }
  .dda-modal-close {
    width: 32px;
    height: 32px;
  }
  .dda-modal-close svg {
    width: 18px;
    height: 18px;
  }
  .dda-modal-body {
    padding: var(--bz-space-3) var(--bz-space-4);
    max-height: 45vh;
  }
  .dda-modal-card {
    grid-template-columns: 50px 1fr;
    gap: var(--bz-space-3);
    padding: var(--bz-space-2);
  }
  .dda-modal-card-thumb {
    width: 50px;
    height: 50px;
  }
  .dda-modal-card-title {
    font-size: var(--bz-text-base);
  }
  .dda-modal-card-meta {
    font-size: var(--bz-text-sm);
  }
  .dda-modal-footer {
    padding: var(--bz-space-3) var(--bz-space-4) calc(var(--bz-space-4) + env(safe-area-inset-bottom, 0));
  }
  .dda-modal-cta {
    padding: var(--bz-space-3) var(--bz-space-4);
    font-size: var(--bz-text-sm);
  }
}


/* ===== MODAL LIBRI - Card orizzontale con copertina grande ===== */
#modal-libri .dda-modal-card {
  grid-template-columns: 90px 1fr;
  align-items: stretch;
  padding: var(--bz-space-4);
  background: var(--bz-bg-subtle);
  border: 1px solid var(--bz-border-default);
  gap: var(--bz-space-6);
}
#modal-libri .dda-modal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--bz-shadow-lg);
  border-color: var(--bz-primary-alpha-40);
}
html.cf-theme-dark #modal-libri .dda-modal-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
#modal-libri .dda-modal-card-thumb {
  width: 90px;
  height: 135px;
  border-radius: var(--bz-radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  flex-shrink: 0;
}
#modal-libri .dda-modal-card-thumb img {
  object-fit: cover;
}
#modal-libri .dda-modal-card-content {
  justify-content: center;
  gap: var(--bz-space-2);
}
#modal-libri .dda-modal-card-title {
  font-size: var(--bz-text-lg);
  -webkit-line-clamp: 2;
  white-space: normal;
  line-height: 1.2;
}
#modal-libri .dda-modal-card-meta {
  font-size: var(--bz-text-sm);
  color: var(--bz-text-primary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Modal Libri responsive */
@media (max-width: 767px) {
  #modal-libri .dda-modal-card {
    grid-template-columns: 70px 1fr;
    padding: var(--bz-space-3);
    gap: var(--bz-space-4);
  }
  #modal-libri .dda-modal-card-thumb {
    width: 70px;
    height: 105px;
  }
  #modal-libri .dda-modal-card-title {
    font-size: var(--bz-text-base);
  }
  #modal-libri .dda-modal-card-meta {
    font-size: var(--bz-text-xs);
    -webkit-line-clamp: 2;
  }
}


/* ===== FOOTER ===== */
.dda-footer {
  padding: var(--bz-space-8) 0;
  border-top: 1px solid var(--bz-border-default);
  text-align: center;
}
.dda-footer-nav {
  display: flex;
  justify-content: center;
  gap: var(--bz-space-6);
  flex-wrap: wrap;
}
.dda-footer-nav-item {
  text-decoration: none;
  padding: var(--bz-space-3) var(--bz-space-6);
  border: 1px solid var(--bz-border-default);
  border-radius: var(--bz-radius-full);
  transition: all 0.2s;
}
.dda-footer-nav-item:hover {
  border-color: var(--bz-primary);
  background: var(--bz-primary);
}
.dda-footer-nav-label {
  font-size: var(--bz-text-base);
  font-weight: 500;
  color: var(--bz-text-primary);
  transition: color 0.2s;
}
.dda-footer-nav-item:hover .dda-footer-nav-label {
  color: white;
}
.dda-footer-bottom {
  margin-top: var(--bz-space-8);
  padding-top: var(--bz-space-6);
  border-top: 1px solid var(--bz-border-default);
}
.dda-footer-bottom p {
  margin: 0;
  font-size: var(--bz-text-xs);
  color: var(--bz-text-muted);
}

/* Footer Social Icons */
.dda-footer-social {
  display: flex;
  justify-content: center;
  gap: var(--bz-space-4);
  margin-bottom: var(--bz-space-4);
}
.dda-footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bz-bg-subtle);
  border: 1px solid var(--bz-border-default);
  color: var(--bz-text-primary);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dda-footer-social-link:hover {
  border-color: var(--bz-primary);
  color: var(--bz-primary);
  transform: translateY(-2px);
}
.dda-footer-social-link svg {
  width: 20px;
  height: 20px;
}
.dda-footer-links {
  display: flex;
  justify-content: center;
  gap: var(--bz-space-4);
  margin-bottom: var(--bz-space-3);
}
.dda-footer-link {
  font-family: var(--bz-font-body);
  font-size: var(--bz-text-xs);
  color: var(--bz-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.dda-footer-link:hover {
  color: var(--bz-primary);
}
.dda-footer-copy {
  font-family: var(--bz-font-body);
  font-size: var(--bz-text-xs);
  color: var(--bz-text-muted);
  margin: 0;
}
.dda-footer-copy a {
  color: var(--bz-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.dda-footer-copy a:hover {
  color: var(--bz-primary);
}
.dda-footer-content {
  padding: 0 var(--bz-space-4);
}

/* ===== RESPONSIVE - ABOVE THE FOLD PER DEVICE ===== */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
  .dda-hero-image {
    height: 55vh;
    max-height: 600px;
  }
  .dda-hero--has-image {
    margin-top: -120px;
  }
  .dda-player {
    padding: var(--bz-space-4) var(--bz-space-6);
  }
}

/* Desktop (1024-1399px) */
@media (min-width: 1024px) and (max-width: 1399px) {
  .dda-hero-image {
    height: 50vh;
    max-height: 520px;
  }
  .dda-hero--has-image {
    margin-top: -110px;
  }
}

/* Tablet/iPad (768-1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .dda-hero-image {
    height: 55vh;
    min-height: 320px;
    max-height: 500px;
  }
  .dda-hero--has-image {
    margin-top: -100px;
  }
  .dda-title {
    font-size: clamp(1.75rem, 5vw, 3rem);
  }
  .dda-player {
    padding: var(--bz-space-3) var(--bz-space-4);
  }
}

/* Mobile Large (481-767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .dda-hero-image {
    height: 42vh;
    min-height: 220px;
    max-height: 340px;
  }
  .dda-hero--has-image {
    margin-top: -80px;
  }
  .dda-title {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }
  .dda-player {
    max-width: 100%;
    padding: var(--bz-space-3) var(--bz-space-4);
  }
  .dda-comment-fields {
    grid-template-columns: 1fr;
  }
  .dda-footer-nav {
    flex-direction: column;
    gap: var(--bz-space-4);
  }
  .dda-footer-nav-item {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
}

/* Mobile Standard - iPhone (376-480px) */
@media (min-width: 376px) and (max-width: 480px) {
  .dda-hero-image {
    height: 50vh;
    min-height: 280px;
    max-height: 400px;
  }
  .dda-hero--has-image {
    margin-top: -90px;
  }
  .dda-title {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
  }
  .dda-player {
    padding: var(--bz-space-2) var(--bz-space-3);
  }
  .dda-play-btn {
    width: 44px;
    height: 44px;
  }
  .dda-comment-fields {
    grid-template-columns: 1fr;
  }
  .dda-footer-nav {
    flex-direction: column;
    gap: var(--bz-space-4);
  }
  .dda-footer-nav-item {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
}

/* Mobile Small - iPhone SE (≤375px) */
@media (max-width: 375px) {
  .dda-hero-image {
    height: 48vh;
    min-height: 250px;
    max-height: 380px;
  }
  .dda-hero--has-image {
    margin-top: -80px;
  }
  .dda-title {
    font-size: clamp(2rem, 11vw, 3rem);
  }
  .dda-player {
    padding: var(--bz-space-2) var(--bz-space-3);
  }
  .dda-play-btn {
    width: 42px;
    height: 42px;
  }
  .dda-comment-fields {
    grid-template-columns: 1fr;
  }
  .dda-comment .children {
    margin-left: var(--bz-space-4);
  }
  .dda-comment-body {
    padding: var(--bz-space-2) var(--bz-space-3);
  }
  .dda-footer-nav {
    flex-direction: column;
    gap: var(--bz-space-3);
  }
  .dda-footer-nav-item {
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
  }
}

/* ===== UTILITIES ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===== ARCHIVE PAGE (Tutti i pensieri) ===== */
.dda-archive {
  background: var(--bz-bg-base);
  min-height: 100vh;
}

/* Header back button (icon only) */
.dda-header-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--bz-text-primary);
  background: transparent;
  border: none;
  border-radius: var(--bz-radius-full);
  cursor: pointer;
  transition: all 0.2s;
}
.dda-header-back:hover {
  background: var(--bz-bg-muted);
  color: var(--bz-primary);
}

/* Header back button (with text) */
.dda-header-back-full {
  display: flex;
  align-items: center;
  gap: var(--bz-space-2);
  padding: var(--bz-space-2) var(--bz-space-3);
  font-family: var(--bz-font-body);
  font-size: var(--bz-text-sm);
  font-weight: 500;
  color: var(--bz-text-primary);
  background: transparent;
  border: 1px solid var(--bz-border-default);
  border-radius: var(--bz-radius-full);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.dda-header-back-full:hover {
  background: var(--bz-bg-muted);
  border-color: var(--bz-primary);
  color: var(--bz-primary);
}
.dda-header-back-full svg {
  flex-shrink: 0;
}

.dda-header-spacer {
  width: 40px;
}

/* Header simple (solo bottone indietro) */
.dda-header--simple {
  justify-content: flex-start;
}
.dda-header--simple .dda-header-menu {
  position: absolute;
  right: var(--bz-space-4);
}

/* Hero section */
.dda-archive-hero {
  text-align: center;
  padding: var(--bz-space-4) var(--bz-space-4) var(--bz-space-6);
}
.dda-archive-subtitle {
  font-family: var(--bz-font-serif);
  font-size: var(--bz-text-lg);
  font-style: italic;
  color: var(--bz-text-muted);
  margin: 0;
  line-height: var(--bz-leading-normal);
}

/* Grid articoli */
.dda-archive-list {
  padding: 0 var(--bz-space-4) var(--bz-space-12);
  max-width: 1200px;
  margin: 0 auto;
}
.dda-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--bz-space-6);
}

/* Card articolo */
.dda-archive-card {
  background: var(--bz-bg-subtle);
  border: 1px solid var(--bz-border-default);
  border-radius: var(--bz-radius-lg);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dda-archive-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--bz-shadow-primary);
  border-color: var(--bz-primary);
}
.dda-archive-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.dda-archive-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.dda-archive-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.dda-archive-card:hover .dda-archive-card-thumb img {
  transform: scale(1.05);
}
.dda-archive-card-audio {
  position: absolute;
  bottom: var(--bz-space-3);
  right: var(--bz-space-3);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bz-primary);
  color: white;
  border-radius: var(--bz-radius-full);
  box-shadow: 0 2px 8px var(--bz-primary-alpha-40);
}
.dda-archive-card-content {
  padding: var(--bz-space-4);
}
.dda-archive-card-date {
  font-family: var(--bz-font-body);
  font-size: var(--bz-text-sm);
  color: var(--bz-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dda-archive-card-title {
  font-family: var(--bz-font-serif);
  font-size: var(--bz-text-xl);
  font-weight: 700;
  color: var(--bz-text-primary);
  margin: var(--bz-space-2) 0 var(--bz-space-3);
  line-height: var(--bz-leading-tight);
}
.dda-archive-card-excerpt {
  font-family: var(--bz-font-serif);
  font-size: var(--bz-text-base);
  color: var(--bz-text-primary);
  line-height: var(--bz-leading-relaxed);
  margin: 0 0 var(--bz-space-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dda-archive-card-meta {
  display: flex;
  align-items: center;
  gap: var(--bz-space-4);
}
.dda-archive-card-reading {
  display: flex;
  align-items: center;
  gap: var(--bz-space-2);
  font-family: var(--bz-font-body);
  font-size: var(--bz-text-sm);
  color: var(--bz-text-muted);
}
.dda-archive-card-reading svg {
  opacity: 0.7;
}

/* Poem-specific card styles */
.dda-archive-card--poem .dda-archive-card-excerpt {
  font-family: var(--bz-font-serif);
  font-style: italic;
  color: var(--bz-text-muted);
  -webkit-line-clamp: 3;
}
.dda-archive-card--poem .dda-archive-card-date {
  margin-top: auto;
}
.dda-archive-card--poem .dda-archive-card-content {
  display: flex;
  flex-direction: column;
}

/* Book-specific card styles (ebook format) */
.dda-archive-grid--books {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--bz-space-8);
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--bz-space-4);
}
.dda-archive-card--book {
  background: transparent;
  border: none;
  border-radius: 0;
  text-align: center;
}
.dda-archive-card--book:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}
.dda-archive-card--book .dda-archive-card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dda-archive-card--book .dda-archive-card-thumb {
  aspect-ratio: 2 / 3;
  width: 180px;
  max-width: 100%;
  border-radius: var(--bz-radius-md);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 10px 30px rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
/* Ebook spine effect */
.dda-archive-card--book .dda-archive-card-thumb::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(90deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.05) 100%);
  border-radius: var(--bz-radius-md) 0 0 var(--bz-radius-md);
  z-index: 1;
}
.dda-archive-card--book:hover .dda-archive-card-thumb {
  transform: translateY(-8px) rotateY(-5deg);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.15),
    0 20px 50px rgba(0, 0, 0, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.1);
}
.dda-archive-card--book .dda-archive-card-thumb img {
  border-radius: var(--bz-radius-md);
}
.dda-archive-card--book .dda-archive-card-content {
  padding: var(--bz-space-4) var(--bz-space-3) 0;
  text-align: center;
}
.dda-archive-card--book .dda-archive-card-title {
  font-size: var(--bz-text-xl);
  margin: 0 0 var(--bz-space-2);
}
.dda-archive-card--book .dda-archive-card-excerpt {
  font-size: var(--bz-text-base);
  color: var(--bz-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Dark mode ebook adjustments */
.cf-theme-dark .dda-archive-card--book .dda-archive-card-thumb {
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.3),
    0 10px 30px rgba(0, 0, 0, 0.4),
    0 1px 2px rgba(0, 0, 0, 0.2);
}
.cf-theme-dark .dda-archive-card--book:hover .dda-archive-card-thumb {
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.4),
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive books grid */
@media (max-width: 640px) {
  .dda-archive-grid--books {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--bz-space-4);
  }
  .dda-archive-card--book .dda-archive-card-thumb {
    width: 140px;
  }
}
@media (max-width: 400px) {
  .dda-archive-grid--books {
    grid-template-columns: 1fr;
  }
  .dda-archive-card--book .dda-archive-card-thumb {
    width: 160px;
  }
}

/* Paginazione */
.dda-archive-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--bz-space-4);
  margin-top: var(--bz-space-12);
  padding-top: var(--bz-space-8);
  border-top: 1px solid var(--bz-border-default);
}
.dda-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--bz-space-2);
  min-height: var(--bz-btn-height-md);  /* 44px WCAG minimum */
  padding: var(--bz-space-3) var(--bz-space-4);
  font-family: var(--bz-font-body);
  font-size: var(--bz-text-sm);
  font-weight: 500;
  color: var(--bz-text-primary);
  text-decoration: none;
  background: var(--bz-bg-subtle);
  border: 1px solid var(--bz-border-default);
  border-radius: var(--bz-radius-full);
  transition: all 0.2s;
}
.dda-pagination-btn:hover {
  border-color: var(--bz-primary);
  color: var(--bz-primary);
}
.dda-pagination-info {
  font-family: var(--bz-font-body);
  font-size: var(--bz-text-sm);
  color: var(--bz-text-muted);
}

/* Empty state */
.dda-archive-empty {
  text-align: center;
  padding: var(--bz-space-16) var(--bz-space-4);
  color: var(--bz-text-muted);
}

/* Responsive archive */
@media (max-width: 640px) {
  .dda-archive-grid {
    grid-template-columns: 1fr;
  }
  .dda-archive-hero {
    padding: var(--bz-space-3) var(--bz-space-4) var(--bz-space-4);
  }
  .dda-archive-pagination {
    flex-wrap: wrap;
  }
  /* Back button: hide text on small screens */
  .dda-header-back-full span {
    display: none;
  }
  .dda-header-back-full {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border: none;
  }
}

/* ===== iPAD FALLBACK (no backdrop-filter blur) ===== */
/* Sfondi solidi quando backdrop-blur non funziona correttamente */

html.no-backdrop-blur .dda-header {
  background: var(--bz-bg-subtle);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom-color: var(--bz-border-default);
}

html.no-backdrop-blur .dda-header-nav {
  background: var(--bz-bg-subtle);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: var(--bz-border-default);
}

html.no-backdrop-blur .dda-sticky-bar {
  background: var(--bz-bg-subtle);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-top-color: var(--bz-border-default);
}

html.no-backdrop-blur .dda-sticky-bar:has(.dda-sticky-meta.is-active) {
  background: #fce4ec;
  border-top-color: #f8bbd9;
}

html.no-backdrop-blur .dda-nav-bar {
  background: var(--bz-secondary);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html.no-backdrop-blur .dda-player {
  background: var(--bz-bg-subtle);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: var(--bz-border-default);
}

html.no-backdrop-blur .dda-modal-container {
  background: rgba(40, 40, 50, 0.98);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: rgba(255, 255, 255, 0.1);
}

html.no-backdrop-blur .dda-modal-backdrop {
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* iPad + Dark mode */
html.no-backdrop-blur.cf-theme-dark .dda-header {
  background: var(--bz-bg-subtle);
}

html.no-backdrop-blur.cf-theme-dark .dda-header-nav {
  background: var(--bz-bg-subtle);
}

html.no-backdrop-blur.cf-theme-dark .dda-sticky-bar {
  background: var(--bz-bg-subtle);
}

html.no-backdrop-blur.cf-theme-dark .dda-sticky-bar:has(.dda-sticky-meta.is-active) {
  background: #4a1a2e;
  border-top-color: #6b2a45;
}

html.no-backdrop-blur.cf-theme-dark .dda-player {
  background: var(--bz-bg-subtle);
}

html.no-backdrop-blur.cf-theme-dark .dda-modal-container {
  background: rgba(25, 25, 30, 0.98);
}

/* ===== WORDPRESS ADMIN BAR FIX ===== */
/* Quando l'admin bar è visibile, sposta tutto il contenuto sotto */
body.admin-bar .dda-header {
  top: 32px;
}

body.admin-bar .dda-sticky-bar {
  /* La sticky bar resta in basso, non serve modificarla */
}

body.admin-bar .fbiz-ab-sticky {
  /* Lo sticky player audiobooks resta in basso */
}

/* Mobile: admin bar è 46px */
@media screen and (max-width: 782px) {
  body.admin-bar .dda-header {
    top: 46px;
  }
}

/* Quando admin bar è presente e header è nascosto */
body.admin-bar .dda-header.is-hidden {
  transform: translateY(calc(-100% - 32px));
}

@media screen and (max-width: 782px) {
  body.admin-bar .dda-header.is-hidden {
    transform: translateY(calc(-100% - 46px));
  }
}
