/* Video tutorial cards and player (public pages and the host dashboard). */
.tut-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tut-grid-home { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1199.98px) { .tut-grid-home { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
    .tut-grid, .tut-grid-home { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .tut-grid-home { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
    .tut-grid-home .tut-card { flex: 0 0 78%; scroll-snap-align: start; }
}
.tut-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e3e9f2; border-radius: 18px; overflow: hidden;
    box-shadow: 0 6px 22px rgba(16, 36, 62, .07); transition: transform .18s ease, box-shadow .18s ease; min-width: 0; }
.tut-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(16, 36, 62, .14); }
.tut-card[hidden] { display: none; }
.tut-card-media { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; cursor: pointer;
    background: linear-gradient(135deg, #0b2547, #17508c); overflow: hidden; }
.tut-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.tut-card:hover .tut-card-media img { transform: scale(1.04); }
.tut-card-media:focus-visible { outline: 3px solid #4da3ff; outline-offset: -3px; }
.tut-card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #9cc3ec; font-size: 2.4rem; }
.tut-card-play { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(255, 255, 255, .92); color: #0d4f91; font-size: 1.25rem; box-shadow: 0 8px 26px rgba(0, 0, 0, .3);
    transition: transform .18s ease, background .18s ease; }
/* A play symbol points right in every language. */
.tut-card-play i { display: inline-block; transform: translateX(2px); margin: 0; }
.tut-card-media video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.tut-card:hover .tut-card-play { transform: scale(1.08); background: #fff; }
.tut-card-formats { position: absolute; top: .6rem; inset-inline-start: .6rem; display: flex; gap: .3rem; }
.tut-card-formats > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(6, 21, 43, .72); color: #fff; font-size: .85rem; }
.tut-card-duration { position: absolute; bottom: .6rem; inset-inline-end: .6rem; padding: .1rem .45rem; border-radius: 6px;
    background: rgba(6, 21, 43, .8); color: #fff; font-size: .78rem; font-weight: 600; }
.tut-card-draft { position: absolute; top: .6rem; inset-inline-end: .6rem; padding: .15rem .55rem; border-radius: 999px; background: #ffc107; color: #3b2c00; font-size: .75rem; font-weight: 700; }
.tut-card-body { padding: .95rem 1.05rem 1.1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.tut-card-title { font-size: 1.02rem; font-weight: 700; line-height: 1.55; margin: 0; color: #10243e;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tut-card-text { margin: 0; color: #5b6f86; font-size: .9rem; line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tut-card-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: .25rem; }
.tut-tag { font-size: .75rem; color: #175b9e; background: #eaf3fc; border-radius: 999px; padding: .15rem .6rem; }
.tut-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.tut-chip { border: 1px solid #cfdcec; background: #fff; color: #23476e; border-radius: 999px; padding: .3rem .85rem; font-size: .88rem; }
.tut-chip.active, .tut-chip:hover { background: #175b9e; border-color: #175b9e; color: #fff; }
.tut-empty { padding: 2.5rem 1rem; text-align: center; color: #6b7d90; border: 1px dashed #cfdcec; border-radius: 18px; }

.tut-player .modal-dialog { max-width: min(1120px, 94vw); }
.tut-player.is-portrait .modal-dialog { max-width: min(430px, 94vw); }
.tut-player .modal-content { border-radius: 18px; overflow: hidden; background: #06152b; color: #fff; border: 0; }
.tut-player .modal-header { border-color: rgba(255, 255, 255, .1); }
.tut-player .btn-close { filter: invert(1); }
.tut-player .btn-outline-secondary { color: #d5e3f3; border-color: rgba(255, 255, 255, .3); }
.tut-player-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.tut-player.is-portrait .tut-player-frame { aspect-ratio: 9 / 16; max-height: 82vh; margin: 0 auto; }
.tut-player-frame iframe, .tut-player-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }

/* Library pages */
.tut-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem; margin-top: 2rem; }
.tut-page-link { min-width: 2.6rem; height: 2.6rem; padding: 0 .8rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    border: 1px solid #cfdcec; border-radius: 12px; background: #fff; color: #23476e; font-weight: 600; text-decoration: none; }
a.tut-page-link:hover, a.tut-page-link:focus-visible { border-color: #175b9e; color: #175b9e; }
.tut-page-link.active { background: #175b9e; border-color: #175b9e; color: #fff; }
.tut-page-gap { color: #6b7d90; padding: 0 .2rem; }
.tut-page-step i { font-size: .75rem; }
@media (max-width: 575.98px) {
    .tut-page-step span { display: none; }
}

/* Dark mode, for the dashboard (which does not load public-dark.css) as well as the public pages. */
html[data-theme="dark"] .tut-card { background: #112131; border-color: #24394f; }
html[data-theme="dark"] .tut-card:hover { border-color: #33506b; }
html[data-theme="dark"] .tut-card-title { color: #f5f9fd; }
html[data-theme="dark"] .tut-card-text { color: #9fb1c4; }
html[data-theme="dark"] .tut-tag { color: #9ccdf6; background: rgba(90, 169, 236, .13); }
html[data-theme="dark"] .tut-chip { border-color: #33506b; background: #112131; color: #e7eef6; }
html[data-theme="dark"] .tut-chip.active,
html[data-theme="dark"] .tut-chip:hover { background: #2f6fa8; border-color: #2f6fa8; color: #fff; }
html[data-theme="dark"] .tut-empty { color: #9fb1c4; border-color: #33506b; }
html[data-theme="dark"] .tut-page-link { border-color: #33506b; background: #112131; color: #e7eef6; }
html[data-theme="dark"] a.tut-page-link:hover,
html[data-theme="dark"] a.tut-page-link:focus-visible { border-color: #5aa9ec; color: #82c0f5; }
html[data-theme="dark"] .tut-page-link.active { background: #2f6fa8; border-color: #2f6fa8; color: #fff; }
html[data-theme="dark"] .tut-page-gap { color: #9fb1c4; }
