/* static/css/tutorials.css
   Tutorial videos: home-page section, tool-page "Watch the tutorial" pill and
   the shared player. Quiet by design: thin borders, soft shadows, colour only
   on interaction. Uses the site palette (--primary-color, --secondary-color). */

:root {
    --tut-ink: #0f172a;
    --tut-muted: #64748b;
    --tut-line: #e2e8f0;
    --tut-mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;
}

/* ── Home section ─────────────────────────────────────────────────────── */
.dh-tut-section {
    position: relative;
    background-color: var(--light-bg, #f0f9ff);
    /* faint engineering grid, as in the hero */
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
    border-top: 1px solid var(--tut-line);
}
.dh-tut-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem;
    margin-bottom: 2rem; flex-wrap: wrap;
}
.dh-tut-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--tut-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--primary-color, #006994); margin-bottom: .6rem;
}
.dh-tut-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--secondary-color, #00a86b);
    box-shadow: 0 0 0 4px rgba(0, 168, 107, .14);
}
.dh-tut-progress { text-align: right; line-height: 1.1; }
.dh-tut-progress-num { font-family: var(--tut-mono); font-size: 1.6rem; font-weight: 600; color: var(--tut-ink); }
.dh-tut-progress-num span { color: #94a3b8; font-size: 1.1rem; }
.dh-tut-progress-label { display: block; font-size: .72rem; color: var(--tut-muted); text-transform: uppercase; letter-spacing: .08em; }

.dh-tut-card {
    position: relative; height: 100%; display: flex; flex-direction: column;
    background: #fff; border: 1px solid var(--tut-line); border-radius: 14px; overflow: hidden;
    transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.dh-tut-card::before {                 /* hairline accent that draws in on hover */
    content: ''; position: absolute; top: 0; left: 0; height: 2px; width: 0; z-index: 2;
    background: var(--gradient-primary, linear-gradient(135deg, #006994, #00a86b));
    transition: width .45s ease;
}
.dh-tut-card:hover { border-color: #cbd5e1; box-shadow: 0 10px 28px -12px rgba(15, 23, 42, .22); transform: translateY(-2px); }
.dh-tut-card:hover::before { width: 100%; }

.dh-tut-thumb {
    position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0;
    background: #0f172a; overflow: hidden; cursor: pointer;
}
.dh-tut-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease, filter .3s ease; }
.dh-tut-thumb::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 55%, rgba(15, 23, 42, .45) 100%);
}
.dh-tut-card:hover .dh-tut-thumb img { transform: scale(1.03); }
.dh-tut-play {
    position: absolute; left: 50%; top: 50%; z-index: 1; transform: translate(-50%, -50%);
    width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
    color: #fff; font-size: 1rem; padding-left: 3px;
    background: rgba(15, 23, 42, .5); border: 1px solid rgba(255, 255, 255, .35);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    transition: background-color .25s ease, transform .25s ease;
}
.dh-tut-thumb:hover .dh-tut-play, .dh-tut-thumb:focus-visible .dh-tut-play {
    background: var(--primary-color, #006994); transform: translate(-50%, -50%) scale(1.06);
}
.dh-tut-thumb:focus-visible { outline: 2px solid var(--primary-color, #006994); outline-offset: -2px; }
.dh-tut-dur {
    position: absolute; right: 10px; bottom: 10px; z-index: 1;
    font-family: var(--tut-mono); font-size: .72rem; color: #fff; letter-spacing: .02em;
    background: rgba(15, 23, 42, .72); border-radius: 5px; padding: .12rem .42rem;
}

.dh-tut-body { padding: 1rem 1.15rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.dh-tut-module {
    display: inline-flex; align-items: center; gap: .45rem;
    font-family: var(--tut-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--primary-color, #006994); margin-bottom: .45rem;
}
.dh-tut-title { font-size: 1.02rem; font-weight: 700; color: var(--tut-ink); line-height: 1.35; margin: 0 0 .4rem; }
.dh-tut-summary {
    font-size: .86rem; color: var(--tut-muted); margin: 0 0 .9rem; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.dh-tut-actions { margin-top: auto; display: flex; gap: 1.1rem; align-items: center; border-top: 1px dashed var(--tut-line); padding-top: .75rem; }
.dh-tut-link {
    display: inline-flex; align-items: center; gap: .4rem; padding: 0; border: 0; background: none;
    font-size: .84rem; font-weight: 600; color: var(--primary-color, #006994); text-decoration: none;
}
.dh-tut-link.muted { color: var(--tut-muted); }
.dh-tut-link:hover { color: var(--secondary-color, #00a86b); }
.dh-tut-link .fa-arrow-right { font-size: .72rem; transition: transform .2s ease; }
.dh-tut-link:hover .fa-arrow-right { transform: translateX(3px); }

/* hero button on the home page */
.hero-tut-btn i { opacity: .85; }
#tutorials { scroll-margin-top: 80px; }     /* land below the fixed navbar */

/* ── Tool-page pill (sits in the dark hero) ─────────────────────────────── */
.dh-tut-pill-wrap { margin-top: 1.4rem; display: flex; justify-content: center; }
.dh-tut-pill-wrap.start { justify-content: flex-start; margin-top: 1.1rem; }
.dh-tut-pill {
    display: inline-flex; align-items: center; gap: .7rem; text-align: left;
    padding: .32rem 1rem .32rem .32rem; border-radius: 50px; cursor: pointer;
    color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .24);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}
.dh-tut-pill:hover, .dh-tut-pill:focus-visible { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .45); transform: translateY(-1px); outline: none; }
.dh-tut-pill-thumb {
    position: relative; width: 58px; height: 34px; border-radius: 50px; overflow: hidden; flex: none;
    display: grid; place-items: center; background: #0f172a;
}
.dh-tut-pill-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.dh-tut-pill-thumb i { position: relative; font-size: .7rem; padding-left: 2px; }
.dh-tut-pill-label { display: block; font-size: .86rem; font-weight: 600; line-height: 1.15; }
.dh-tut-pill-meta { display: block; font-family: var(--tut-mono); font-size: .68rem; opacity: .75; letter-spacing: .03em; }

/* ── Player ───────────────────────────────────────────────────────────── */
.dh-tut-modal .modal-content {
    background: #0b1220; color: #e2e8f0; border: 1px solid rgba(148, 163, 184, .18); border-radius: 16px; overflow: hidden;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
}
.dh-tut-modal .modal-dialog { max-width: min(1080px, 94vw); }
body:has(#dhTutorialModal.show) .modal-backdrop { --bs-backdrop-opacity: .82; --bs-backdrop-bg: #020617; }
.dh-tut-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem .85rem; }
.dh-tut-modal .dh-tut-module { color: #7dd3fc; margin-bottom: .25rem; }
.dh-tut-modal-title { font-size: 1.08rem; font-weight: 600; margin: 0; color: #f8fafc; }
.dh-tut-close {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(148, 163, 184, .3); flex: none;
    background: transparent; color: #cbd5e1; display: grid; place-items: center; transition: background-color .2s ease;
}
.dh-tut-close:hover { background: rgba(148, 163, 184, .15); color: #fff; }
.dh-tut-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.dh-tut-frame-inner, .dh-tut-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.dh-tut-modal-foot {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
    padding: .85rem 1.25rem 1rem; border-top: 1px solid rgba(148, 163, 184, .14);
}
.dh-tut-chapters { display: flex; flex-wrap: wrap; gap: .4rem; }
.dh-tut-chapter {
    display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; color: #cbd5e1;
    background: rgba(148, 163, 184, .1); border: 1px solid rgba(148, 163, 184, .2); border-radius: 6px; padding: .2rem .55rem;
    transition: background-color .2s ease, color .2s ease;
}
.dh-tut-chapter b { font-family: var(--tut-mono); font-weight: 500; color: #7dd3fc; }
.dh-tut-chapter:hover, .dh-tut-chapter.active { background: rgba(125, 211, 252, .14); color: #fff; }
.dh-tut-modal-links { display: flex; gap: 1.1rem; margin-left: auto; }
.dh-tut-flink { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; color: #94a3b8; text-decoration: none; }
.dh-tut-flink:hover { color: #fff; }
.dh-tut-flink.hidden { display: none; }
.min-w-0 { min-width: 0; }

@media (max-width: 576px) {
    .dh-tut-head { align-items: flex-start; }
    .dh-tut-progress { text-align: left; }
    .dh-tut-modal .modal-dialog { margin: .5rem; }
    .dh-tut-modal-links { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .dh-tut-card, .dh-tut-card::before, .dh-tut-thumb img, .dh-tut-play, .dh-tut-pill { transition: none; }
}
