/* CMS article content — readable on dark theme (mg2026) */

body .cms-article-show {
  color: var(--color-text, #ffffff);
}

/* Hero con titolo sovrapposto in basso — si adatta alla larghezza disponibile (16:9) */
body .cms-article-show__hero {
  position: relative;
  width: 100%;
  margin-bottom: 0.75rem;
  border-radius: 0.5rem;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #111111;
}

body .cms-article-show__hero .cms-article-show__cover {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  margin: 0;
  border-radius: 0;
}

body .cms-article-show__header--overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 2.5rem 1.25rem 1.25rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.5) 45%,
    transparent 100%
  );
}

body .cms-article-show__header--overlay .cms-article-show__title {
  color: #ffffff;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

body .cms-article-show__header--overlay .cms-article-show__meta {
  margin-top: 0.5rem;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.875rem;
  line-height: 1.4;
}

body .cms-article-show__header--overlay .cms-article-show__meta-sep {
  opacity: 0.75;
}

/* Articolo senza copertina */
body .cms-article-show > .cms-article-show__header:not(.cms-article-show__header--overlay) {
  margin-bottom: 1rem;
}

body .cms-article-show > .cms-article-show__header:not(.cms-article-show__header--overlay) .cms-article-show__title {
  color: var(--color-text, #ffffff);
}

body .cms-article-show > .cms-article-show__header:not(.cms-article-show__header--overlay) .cms-article-show__meta {
  margin-top: 0.5rem;
  margin-bottom: 0;
  color: var(--color-text-muted, rgba(255, 255, 255, 0.65));
  font-size: 0.875rem;
  line-height: 1.4;
}

body .cms-article-show__meta-sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}

body .cms-article-show__views {
  white-space: nowrap;
}

body .cms-article-show__body {
  margin-top: 1rem;
}

/* Light reading panel: dark text colors need a light background */
body .cms-article-show .cms_content {
  background-color: #ffffff;
  color: #333333;
  padding: 2rem;
  border-radius: 0.5rem;
}

body .cms-article-show .cms_content h1,
body .cms-article-show .cms_content h2,
body .cms-article-show .cms_content h3 {
  color: #111111;
}

body .cms-article-show .cms_content img {
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 1rem 0;
}

body .cms-article-show .cms_content table {
  border-collapse: collapse;
  border: 1px solid #d1d5db;
}

body .cms-article-show .cms_content table th,
body .cms-article-show .cms_content table td {
  border: 1px solid #d1d5db;
  padding: 0.5rem 0.75rem;
}

/* Interview / article intro */
body .cms_content .intervista-intro {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.7;
  color: #444444;
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 0 20px 1.5rem;
  border-bottom: 1px solid #e8e8e8;
}

body .cms_content .intervista-intro:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

body .cms_content .intervista-intro p {
  margin: 0 0 0.75rem;
}

body .cms_content .intervista-intro p:last-child {
  margin-bottom: 0;
}

/* Interview blocks */
body .cms_content .intervista-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  line-height: 1.6;
  color: #333333;
}

body .cms_content .intervista-blocco {
  margin-bottom: 30px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 25px;
}

body .cms_content .intervista-blocco:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

body .cms_content .intervista-domanda {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111111;
  margin-top: 0;
  margin-bottom: 12px;
  padding-left: 15px;
  border-left: 4px solid #da251d;
}

body .cms_content .intervista-risposta {
  font-size: 1.05rem;
  color: #555555;
  margin: 0;
  padding-left: 19px;
}

/* Embedded video (YouTube, Vimeo) */
body .cms_content .cms-video-box {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem 1.25rem 1.25rem;
  background: linear-gradient(145deg, #fafafa 0%, #ffffff 100%);
  border: 1px solid #e5e7eb;
  border-left: 4px solid #da251d;
  border-radius: 10px;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.04);
}

body .cms_content .cms-video-box__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #da251d;
}

body .cms_content .cms-video-box__play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #da251d;
  flex-shrink: 0;
}

body .cms_content .cms-video-box__play-icon::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #ffffff;
}

body .cms_content .cms-video-box__embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #111111;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

body .cms_content .cms-video-box__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

body .cms_content .cms-video-box__caption {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid #eeeeee;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #444444;
  text-align: center;
  font-style: italic;
  font-weight: 500;
}

body .cms_content .cms-video-box__caption:last-child {
  margin-bottom: 0;
}

/* Fallback: didascalia subito dopo il box (HTML TinyMCE non ancora rielaborato) */
body .cms_content .cms-video-box + p {
  max-width: 800px;
  margin: -1rem auto 2rem;
  padding: 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #444444;
  text-align: center;
  font-style: italic;
  font-weight: 500;
}

/* Mobile: contenuto articolo e video a tutta larghezza */
@media (max-width: 991.98px) {
  body .cms-article-show {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
    box-shadow: none !important;
  }

  body .cms-article-show__hero {
    margin-bottom: 0;
    border-radius: 0;
  }

  body .cms-article-show > .cms-article-show__header:not(.cms-article-show__header--overlay) {
    padding-left: 16px;
    padding-right: 16px;
    margin-bottom: 0;
  }

  body .cms-article-show__body {
    margin-top: 0;
  }

  body .cms-article-show .cms_content {
    width: 100%;
    max-width: none;
    padding: 1.25rem 16px;
    border-radius: 0;
    box-sizing: border-box;
  }

  body .cms_content .intervista-intro,
  body .cms_content .intervista-container {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  body .cms_content .intervista-intro {
    padding-bottom: 1.25rem;
  }

  body .cms_content .cms-video-box {
    max-width: none;
    width: calc(100% + 32px);
    margin: 1.5rem -16px;
    padding: 0.85rem 0 1rem;
    border-radius: 0;
    border-left-width: 0;
    border-right-width: 0;
    box-sizing: border-box;
  }

  body .cms_content .cms-video-box__embed {
    border-radius: 0;
  }

  body .cms_content .cms-video-box__caption {
    padding-left: 16px;
    padding-right: 16px;
  }

  body .cms_content .cms-video-box + p {
    max-width: none;
    width: calc(100% + 32px);
    margin: -0.75rem -16px 1.5rem;
    padding: 0 16px;
    box-sizing: border-box;
  }
}

@media (max-width: 575.98px) {
  body .cms-article-show .cms_content {
    padding: 1rem 12px;
  }

  body .cms-article-show > .cms-article-show__header:not(.cms-article-show__header--overlay) {
    padding-left: 12px;
    padding-right: 12px;
  }

  body .cms_content .cms-video-box {
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-right: -12px;
  }

  body .cms_content .cms-video-box__caption,
  body .cms_content .cms-video-box + p {
    padding-left: 12px;
    padding-right: 12px;
  }

  body .cms_content .cms-video-box + p {
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-right: -12px;
  }
}
