/* vDan "Watch the demo" block and video dialog (1.40.0). Loaded only on pages with a demo video. */

.vdan-video { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "thumb body" "thumb more"; gap: 6px 16px; align-items: start; margin: 18px 0 16px; padding: 12px; border: 1px solid var(--border); border-left: 3px solid var(--red, #f85149); border-radius: var(--radius); background: var(--bg2); }
.vdan-video a { text-decoration: none; }

.vdan-video-thumb { grid-area: thumb; position: relative; display: block; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg4); aspect-ratio: 16 / 9; line-height: 0; }
.vdan-video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.vdan-video-thumb:hover img { transform: scale(1.03); }
.vdan-video-btn { position: absolute; left: 50%; top: 50%; width: 54px; height: 38px; margin: -19px 0 0 -27px; border-radius: 10px; background: rgba(14,15,17,.82); display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.4); transition: background .15s; }
.vdan-video-btn svg { width: 22px; height: 22px; fill: #fff; }
.vdan-video-thumb:hover .vdan-video-btn, .vdan-video-thumb:focus-visible .vdan-video-btn { background: #e5322d; }
.vdan-video-len { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,.78); color: #fff; font: 600 11px/1.4 var(--fm); }

.vdan-video-body { grid-area: body; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vdan-video-more { grid-area: more; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vdan-video-kicker { display: inline-flex; align-items: center; gap: 6px; font: 500 11px/1.4 var(--fm); letter-spacing: .06em; text-transform: uppercase; color: var(--red-t, #ff7b72); }
.vdan-video-kicker svg { width: 12px; height: 12px; fill: currentColor; }
.vdan-video .vdan-video-title { font-family: var(--fd); font-weight: 700; font-size: 17px; line-height: 1.3; color: var(--text1); }
.vdan-video .vdan-video-title:hover { color: var(--blue-hl); }
.vdan-video-jump { font-size: 12.5px; color: var(--text3); margin-top: 2px; }
.vdan-video-chapters { list-style: none; margin: 0 !important; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 6px; }
.vdan-video-chapters li { margin: 0 !important; padding: 0 !important; }
.vdan-video-chapters li::before, .vdan-video-chapters li::marker { content: none; }
.vdan-video .vdan-video-chap { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 10px; border: 1px solid var(--border2); border-radius: 999px; font-size: 12.5px; line-height: 1.3; color: var(--text2); background: var(--bg); }
.vdan-video .vdan-video-chap b { font: 500 11px var(--fm); color: var(--blue-hl); }
.vdan-video .vdan-video-chap:hover { border-color: var(--blue-hl); color: var(--text1); }
.vdan-video-foot { font-size: 12px; color: var(--text3); margin-top: 2px; }
.vdan-video .vdan-video-foot a { color: var(--ac-text); }
.vdan-video a:focus-visible { outline: 2px solid var(--blue-hl); outline-offset: 2px; }

@media (max-width: 720px) {
  .vdan-video { grid-template-columns: 128px minmax(0, 1fr); grid-template-rows: auto auto; grid-template-areas: "thumb body" "more more"; gap: 10px 12px; padding: 10px; }
  .vdan-video-btn { width: 40px; height: 28px; margin: -14px 0 0 -20px; border-radius: 8px; }
  .vdan-video-btn svg { width: 16px; height: 16px; }
  .vdan-video .vdan-video-title { font-size: 15px; }
  .vdan-video-kicker { font-size: 10px; letter-spacing: .03em; }
  /* chapters in one swipeable row instead of five wrapped lines above the tool */
  .vdan-video-chapters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px !important; }
  .vdan-video-chapters::-webkit-scrollbar { display: none; }
  .vdan-video .vdan-video-chap { white-space: nowrap; }
}

/* Dialog */
.vdan-video-dialog { width: min(1000px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--border2); border-radius: var(--radius-lg); background: var(--bg2); color: var(--text1); box-shadow: var(--shadow-lg); overflow: auto; }
.vdan-video-dialog::backdrop { background: rgba(5,6,8,.72); backdrop-filter: blur(4px); }
.vdan-video-dialog[open] { animation: vdan-video-in .18s ease-out; }
@keyframes vdan-video-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.vdan-video-dialog-in { padding: 10px 12px 12px; }
.vdan-video-dialog-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.vdan-video-dialog-title { flex: 1; min-width: 0; font-family: var(--fd); font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vdan-video-dialog-yt { font-size: 12.5px; color: var(--ac-text); white-space: nowrap; text-decoration: none; }
.vdan-video-dialog-close { width: 36px; height: 36px; flex-shrink: 0; border: 1px solid var(--border2); border-radius: var(--radius-sm); background: var(--bg); color: var(--text1); font-size: 22px; line-height: 1; cursor: pointer; }
.vdan-video-dialog-close:hover, .vdan-video-dialog-close:focus-visible { border-color: var(--blue-hl); color: var(--blue-hl); }
.vdan-video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-sm); overflow: hidden; }
.vdan-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; min-height: 0; }
.vdan-video-dialog-note { margin: 8px 2px 0; font-size: 12px; color: var(--text3); }
@media (max-width: 560px) { .vdan-video-dialog-yt { display: none; } }

/* Tools hub: video marker on the cards and the tour button */
.tool-badges { display: inline-flex; align-items: center; gap: 6px; }
.tool-video { display: inline-flex; align-items: center; gap: 4px; font: 500 10px/1 var(--fm); letter-spacing: .04em; color: var(--red-t, #ff7b72); border: 1px solid currentColor; border-radius: 4px; padding: 3px 6px; }
.tool-video svg { width: 9px; height: 9px; fill: currentColor; }
.tools-btn.is-video svg { fill: currentColor; stroke: none; }

@media (prefers-reduced-motion: reduce) {
  .vdan-video-thumb img, .vdan-video-btn { transition: none; }
  .vdan-video-thumb:hover img { transform: none; }
  .vdan-video-dialog[open] { animation: none; }
}
