/*
 * Zalfol YouTube explainer block (BLOG-003).
 * Markup comes from scripts/inject_yt_explainer.py; the click-to-play swap from /blog/ytx.js.
 * Scoped to .zf-ytx / .zf-ytx-hub so it never touches the page around it. No animation.
 * Colours are the science-blog tokens (--surface, --amber, --text, --text-mid) with fallbacks.
 */
.zf-ytx[hidden], .zf-ytx-hub[hidden] { display: none !important; }

.zf-ytx { margin: 2rem 0 2.5rem; }

/* the AI notice: the most visible text in the block */
.zf-ytx-notice {
  border: 2px solid var(--amber, #C9A84C);
  border-radius: 12px;
  background: var(--surface, #1c1c1c);
  padding: 1.1rem 1.25rem;
  margin: 0 0 1rem;
}
.zf-ytx-ai {
  margin: 0;
  font-family: var(--font-sans, 'Inter', 'Inter Fallback', 'Inter Fallback Android', system-ui, sans-serif);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text, #e8e4dc);
}
.zf-ytx-ai strong, .zf-ytx-ai-sub strong { font-weight: inherit; }
.zf-ytx-ai-sub {
  margin: 0.6rem 0 0;
  font-family: var(--font-sans, 'Inter', 'Inter Fallback', 'Inter Fallback Android', system-ui, sans-serif);
  font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--text, #e8e4dc);
}

/* the facade: a local poster + play button. Nothing loads from YouTube before the click. */
.zf-ytx-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0d0d0d;
  border: 1px solid rgba(201, 168, 76, 0.35);
}
.zf-ytx-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: #0d0d0d;
  cursor: pointer;
  display: block;
  color: #fff;
}
.zf-ytx-play img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.zf-ytx-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: rgba(8, 8, 8, 0.78);
  border: 2px solid var(--amber, #C9A84C);
  display: flex;
  align-items: center;
  justify-content: center;
}
.zf-ytx-icon svg { width: 30px; height: 30px; margin-left: 4px; fill: var(--amber, #C9A84C); }
.zf-ytx-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.82);
  color: #fff;
  font-family: var(--font-sans, 'Inter', 'Inter Fallback', 'Inter Fallback Android', system-ui, sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
}
.zf-ytx-play:hover .zf-ytx-icon,
.zf-ytx-play:focus-visible .zf-ytx-icon { background: var(--amber, #C9A84C); }
.zf-ytx-play:hover .zf-ytx-icon svg,
.zf-ytx-play:focus-visible .zf-ytx-icon svg { fill: #0d0d0d; }
.zf-ytx-play:focus-visible { outline: 3px solid var(--amber, #C9A84C); outline-offset: -3px; }
.zf-ytx-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.zf-ytx-title {
  margin: 0.75rem 0 0;
  font-family: var(--font-sans, 'Inter', 'Inter Fallback', 'Inter Fallback Android', system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #e8e4dc);
}
.zf-ytx-links {
  margin: 0.5rem 0 0;
  font-family: var(--font-sans, 'Inter', 'Inter Fallback', 'Inter Fallback Android', system-ui, sans-serif);
  font-size: 0.9rem;
  color: var(--text-mid, #b0a99e);
}
.zf-ytx-links a { color: var(--amber, #C9A84C); }

/* /blog/watch/: one notice, then a grid of facades */
.zf-ytx-hub { margin: 2rem 0 3rem; }
.zf-ytx-hub-title {
  font-family: var(--font-serif, 'Cormorant Garamond', 'Cormorant Garamond Fallback', 'Cormorant Garamond Fallback Android', Georgia, serif);
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  color: var(--text, #e8e4dc);
  margin: 0 0 1rem;
}
.zf-ytx-grid { display: grid; grid-template-columns: 1fr; gap: 0 2rem; }
@media (min-width: 720px) { .zf-ytx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.zf-ytx-grid .zf-ytx { margin: 1rem 0 1.5rem; }
