/* ==========================================================================
   ForFans.me App Tutorials — built on home.css + pages.css theme tokens
   ========================================================================== */

.tut-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 132px 28px 60px;
}

.tut-head {
    max-width: 780px;
    margin-bottom: 40px;
}

.tut-head .p-title {
    font-size: clamp(38px, 5.6vw, 68px);
}

.tut-head .p-lede {
    font-size: clamp(16.5px, 1.5vw, 19px);
    margin-top: 18px;
}

.tut-meta-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 22px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
}

.tut-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    font-weight: 600;
    font-size: 13px;
}

.tut-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--rose);
}

/* ---------- Studio layout: sticky portrait player + sequential playlist ---------- */
.tut-studio {
    display: grid;
    grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

/* Left: Active Video Stage */
.tut-stage-col {
    position: sticky;
    top: 94px;
}

.tut-stage-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 20px;
    box-shadow: 0 18px 50px rgba(23, 17, 15, 0.06);
}

.tut-phone-shell {
    position: relative;
    width: 100%;
    max-width: 310px;
    aspect-ratio: 9 / 19.2;
    max-height: 62vh;
    margin: 0 auto;
    border-radius: 34px;
    background: #0d090a;
    padding: 7px;
    box-shadow:
        0 24px 54px rgba(23, 17, 15, 0.24),
        inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    overflow: hidden;
}

.tut-phone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 27px;
    overflow: hidden;
    background: #000;
}

.tut-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

/* Poster + Play button overlay (0 video bytes loaded until user clicks Play) */
.tut-poster-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    border: 0;
    padding: 0;
    background: #0d090a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s var(--ease);
}

.tut-poster-overlay[hidden] {
    display: none;
}

.tut-poster-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.82);
    transition: transform 0.45s var(--ease), filter 0.3s;
}

.tut-poster-overlay:hover .tut-poster-img {
    transform: scale(1.03);
    filter: brightness(0.72);
}

.tut-play-circle {
    position: relative;
    z-index: 2;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--rose);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 14px 36px rgba(233, 64, 87, 0.52);
    transition: transform 0.25s var(--ease), background 0.2s;
}

.tut-poster-overlay:hover .tut-play-circle {
    transform: scale(1.08);
    background: #ff4d65;
}

.tut-play-circle svg {
    width: 26px;
    height: 26px;
    margin-left: 3px;
}

/* Loading spinner inside player */
.tut-spinner {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 9, 10, 0.45);
    pointer-events: none;
}

.tut-spinner[hidden] {
    display: none;
}

.tut-spinner::after {
    content: '';
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--rose);
    animation: tut-spin 0.7s linear infinite;
}

@keyframes tut-spin {
    to { transform: rotate(360deg); }
}

/* Active lesson info below player */
.tut-now {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.tut-now-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tut-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rose-deep);
    background: var(--blush);
    padding: 4px 10px;
    border-radius: 999px;
}

.tut-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tut-copy-btn:hover {
    background: var(--paper-2);
    color: var(--ink);
}

.tut-now-title {
    margin-top: 10px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--ink);
}

.tut-now-desc {
    margin-top: 8px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink-2);
}

.tut-now-desc span {
    display: block;
}

.tut-now-desc span + span {
    margin-top: 2px;
}

.tut-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

.tut-nav-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s var(--ease), opacity 0.2s;
}

.tut-nav-btn:hover:not(:disabled) {
    background: var(--paper-2);
}

.tut-nav-btn-primary {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.tut-nav-btn-primary:hover:not(:disabled) {
    background: #000;
}

.tut-nav-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

/* Right: Playlist Column */
.tut-list-col {
    min-width: 0;
}

.tut-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.tut-list-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.tut-search-wrap {
    position: relative;
    flex: 1;
    max-width: 280px;
    min-width: 190px;
}

.tut-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--muted);
    pointer-events: none;
}

.tut-search {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 36px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-family: var(--sans);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tut-search:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(233, 64, 87, 0.14);
}

.tut-search::placeholder {
    color: var(--muted);
}

.tut-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.tut-item {
    width: 100%;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    text-align: left;
    padding: 12px 14px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: transform 0.22s var(--ease), border-color 0.2s, box-shadow 0.22s, background 0.2s;
    content-visibility: auto;
    contain-intrinsic-size: 98px;
}

.tut-item:hover {
    transform: translateY(-1px);
    border-color: rgba(233, 64, 87, 0.35);
    box-shadow: 0 10px 26px rgba(23, 17, 15, 0.06);
}

.tut-item.is-active {
    background: #fff9fa;
    border-color: var(--rose);
    box-shadow: 0 10px 28px rgba(233, 64, 87, 0.12);
}

.tut-thumb {
    position: relative;
    width: 52px;
    height: 82px;
    border-radius: 12px;
    overflow: hidden;
    background: #17110f;
    flex-shrink: 0;
    border: 1px solid rgba(23, 17, 15, 0.1);
}

.tut-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tut-thumb-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(23, 17, 15, 0.28);
    color: #fff;
    transition: background 0.2s;
}

.tut-item.is-active .tut-thumb-play {
    background: rgba(233, 64, 87, 0.55);
}

.tut-thumb-play svg {
    width: 16px;
    height: 16px;
}

.tut-item-body {
    min-width: 0;
}

.tut-item-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rose-deep);
}

.tut-item.is-watched .tut-watched-tag {
    display: inline-flex;
}

.tut-watched-tag {
    display: none;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #15803d;
    background: #dcfce7;
    padding: 1px 7px;
    border-radius: 999px;
}

.tut-item-title {
    margin-top: 3px;
    font-size: 16.5px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ink);
    line-height: 1.25;
}

.tut-item-desc {
    margin-top: 5px;
    font-size: 13.5px;
    line-height: 1.48;
    color: var(--ink-2);
}

.tut-item-desc span {
    display: block;
}

.tut-item-status {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink-2);
    transition: background 0.2s, color 0.2s;
}

.tut-item.is-active .tut-item-status {
    background: var(--rose);
    color: #fff;
}

.tut-empty {
    padding: 36px 20px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--muted);
    font-size: 15px;
}

.tut-empty[hidden] {
    display: none;
}

/* Active nav highlight */
.h-nav-links a[aria-current="page"] {
    color: var(--ink) !important;
    font-weight: 600;
}

.h-nav-links a[aria-current="page"]::after {
    transform: scaleX(1);
}

/* ---------- Responsive: Tablet & Mobile ---------- */
@media (max-width: 960px) {
    .tut-wrap {
        padding: 112px 18px 40px;
    }

    .tut-studio {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .tut-stage-col {
        position: static;
    }

    .tut-phone-shell {
        max-width: 280px;
        max-height: 58svh;
    }
}

@media (max-width: 640px) {
    .tut-wrap {
        padding: 100px 14px 32px;
    }

    .tut-head {
        margin-bottom: 24px;
    }

    .tut-stage-card {
        padding: 14px;
        border-radius: 24px;
    }

    .tut-phone-shell {
        max-width: 264px;
        max-height: 56svh;
        border-radius: 30px;
        padding: 6px;
    }

    .tut-phone-screen {
        border-radius: 24px;
    }

    .tut-now-title {
        font-size: 19px;
    }

    .tut-now-desc {
        font-size: 14px;
    }

    .tut-list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .tut-search-wrap {
        max-width: none;
    }

    .tut-item {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
        border-radius: 18px;
    }

    .tut-thumb {
        width: 46px;
        height: 74px;
    }

    .tut-item-status {
        display: none;
    }

    .tut-item-title {
        font-size: 15.5px;
    }

    .tut-item-desc {
        font-size: 13px;
    }
}
