/* Tutorials page (/tutorials): a narrow course column with a branded cover,
   course intro, and a grid of Aparat video cards that open in place. */

.info-page-wrap--learn {
    padding: 0;
}

/* Edge-to-edge header like the homepage, instead of the floating card used
   on the other information pages. */
.info-page-wrap--learn .platform-shared-header {
    top: 0;
    width: 100%;
    margin: 0 0 14px;
    border-width: 0 0 1px;
    border-radius: 0;
    box-sizing: border-box;
}

.info-page-wrap--learn {
    background:
        radial-gradient(60rem 26rem at 105% -6%, rgba(232, 37, 28, 0.07), transparent 70%),
        radial-gradient(48rem 24rem at -8% 38%, rgba(52, 120, 229, 0.06), transparent 70%),
        #f7f8fa;
}

.bb-learn {
    --learn-ink: #1f2430;
    --learn-muted: #6b7280;
    --learn-card: #ffffff;
    --learn-line: #eceef2;
    --learn-red: #e8251c;
    --learn-red-soft: #fdecea;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 6px 16px 72px;
    box-sizing: border-box;
    color: var(--learn-ink);
    direction: rtl;
}

.bb-learn svg[data-lucide] {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bb-learn-crumbs {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 4px 0 16px;
    font-size: 0.8rem;
    color: var(--learn-muted);
}

.bb-learn-crumbs a {
    color: inherit;
    text-decoration: none;
}

.bb-learn-crumbs a:hover {
    color: var(--learn-red);
}

/* ---------- hero ---------- */

.bb-learn-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 8.4;
    border-radius: 20px;
    overflow: hidden;
    background: #0d0d10;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
    isolation: isolate;
}

.bb-learn-cover-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(70% 90% at 92% 8%, rgba(232, 37, 28, 0.6), transparent 62%),
        radial-gradient(60% 80% at 6% 100%, rgba(232, 37, 28, 0.32), transparent 64%);
    z-index: -1;
}

.bb-learn-cover-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 80%);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 80%);
    z-index: -1;
}

.bb-learn-cover-art {
    position: absolute;
    left: 7%;
    top: 50%;
    width: clamp(150px, 30%, 224px);
    aspect-ratio: 1;
    transform: translateY(-54%);
}

.bb-learn-cover-art::before,
.bb-learn-cover-art::after {
    content: "";
    position: absolute;
    inset: 12%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
}

.bb-learn-cover-art::after {
    inset: 28%;
    border-color: rgba(255, 255, 255, 0.1);
}

.bb-learn-cover-main-icon,
.bb-learn-cover-orbit {
    position: absolute;
    z-index: 1;
    display: grid;
    place-items: center;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(10px);
}

.bb-learn-cover-main-icon {
    inset: 29%;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(232, 37, 28, 0.95), rgba(186, 24, 18, 0.92));
    transform: rotate(-4deg);
}

.bb-learn-cover-main-icon svg {
    width: 58%;
    height: 58%;
}

.bb-learn-cover-orbit {
    width: 22%;
    aspect-ratio: 1;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
}

.bb-learn-cover-orbit svg {
    width: 56%;
    height: 56%;
}

.bb-learn-cover-orbit.is-store { top: 4%; right: 39%; }
.bb-learn-cover-orbit.is-package { top: 39%; right: 1%; }
.bb-learn-cover-orbit.is-plug { bottom: 2%; right: 39%; }
.bb-learn-cover-orbit.is-scan { top: 39%; left: 1%; }

.bb-learn-cover-text {
    position: absolute;
    right: 7%;
    top: 22%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.bb-learn-cover-line {
    color: #fff;
    font-weight: 900;
    font-size: clamp(1.45rem, 4.4vw, 2.6rem);
    line-height: 1.25;
}

.bb-learn-cover-line.is-boxed {
    padding: 4px 18px 8px;
    border-radius: 14px;
    background: var(--learn-red);
    transform: rotate(-1.5deg);
}

.bb-learn-cover-chips {
    position: absolute;
    right: 7%;
    left: 7%;
    bottom: 7%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bb-learn-cover-chips span {
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bb-learn-cover-chips svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bb-learn-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 22px;
    font-size: 0.82rem;
    color: var(--learn-muted);
}

.bb-learn-badges {
    display: flex;
    gap: 6px;
}

.bb-learn-badge {
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bb-learn-badge svg {
    width: 15px;
    height: 15px;
}


.bb-learn-title {
    margin: 10px 0 0;
    font-size: clamp(1.35rem, 3.4vw, 1.8rem);
    font-weight: 900;
    line-height: 1.6;
    color: var(--learn-ink);
}

.bb-learn-lead {
    margin: 10px 0 0;
    font-size: 0.92rem;
    line-height: 2.05;
    color: #4b5563;
    text-align: justify;
}

.bb-learn-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 26px;
    border-radius: 999px;
    background: var(--learn-red);
    color: #fff;
    font-weight: 800;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.bb-learn-cta:hover {
    background: #c81e16;
}

.bb-learn-cta svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- learning path ---------- */

.bb-learn-path {
    margin-top: 44px;
    padding-top: 40px;
    border-top: 1px solid var(--learn-line);
    scroll-margin-top: 172px;
}

.bb-learn-path + .bb-learn-path {
    margin-top: 36px;
}

.bb-learn-path-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--learn-ink);
    display: flex;
    align-items: center;
    gap: 10px;
}

.bb-learn-path-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 11px;
    color: var(--learn-red);
    background: var(--learn-red-soft);
}

.bb-learn-path-icon svg {
    width: 20px;
    height: 20px;
}

.bb-learn-path-lead {
    margin: 8px 0 0;
    font-size: 0.86rem;
    line-height: 1.9;
    color: var(--learn-muted);
}

/* Lessons are video cards (thumbnail, duration, title) in a grid. Opening a
   card turns it into a full-width drawer with the player underneath. */
.bb-learn-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 18px;
    margin-top: 22px;
}

.bb-lesson {
    min-width: 0;
    border-radius: 18px;
    /* Clears the sticky two-row site header on desktop (~158px). */
    scroll-margin-top: 172px;
}

.bb-lesson-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}

.bb-lesson-head::-webkit-details-marker {
    display: none;
}

.bb-lesson-head:focus-visible {
    outline: 2px solid rgba(232, 37, 28, 0.45);
    outline-offset: 4px;
    border-radius: 16px;
}

.bb-lesson-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #0d0d10;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.bb-lesson-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.bb-lesson-head:hover .bb-lesson-thumb img {
    transform: scale(1.04);
}

/* Lessons without an uploaded thumbnail get a branded cover. */
.bb-lesson-thumb-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    padding: 0 8%;
    color: #fff;
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.22), transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(0, 0, 0, 0.35), transparent 55%),
        linear-gradient(135deg, #ff4b3e, #c8160f 60%, #8f0d08);
}

.bb-lesson-thumb-mark {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.74rem;
    font-weight: 800;
}

.bb-lesson-thumb-name {
    max-width: 70%;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bb-lesson-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    margin: -27px 0 0 -27px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(13, 13, 16, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.bb-lesson-play svg {
    width: 30px;
    height: 30px;
    color: #fff;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* On the branded cover the title sits on the right, so the play button
   moves to the left edge. */
.bb-lesson-thumb-fallback ~ .bb-lesson-play {
    left: 8%;
    margin: -27px 0 0;
    background: rgba(255, 255, 255, 0.18);
}

.bb-lesson-head:hover .bb-lesson-play {
    transform: scale(1.1);
    background: var(--learn-red);
}

.bb-lesson-time {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(13, 13, 16, 0.8);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.6;
    direction: ltr;
}

.bb-lesson-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 0 2px;
}

.bb-lesson-kicker {
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--learn-red);
}

.bb-lesson-title {
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.75;
    color: var(--learn-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bb-lesson-chevron {
    display: none;
    flex: none;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--learn-red);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: rotate(180deg);
}

/* ---------- an open lesson: the card becomes a full-width drawer ---------- */

.bb-lesson[open] {
    grid-column: 1 / -1;
    padding: 14px;
    background: var(--learn-card);
    border: 1px solid rgba(232, 37, 28, 0.3);
}

.bb-lesson[open] .bb-lesson-head {
    flex-direction: row;
    align-items: center;
    gap: 14px;
}

.bb-lesson[open] .bb-lesson-thumb {
    flex: none;
    width: 132px;
    border-radius: 10px;
}

.bb-lesson[open] :is(.bb-lesson-play, .bb-lesson-thumb-name) {
    display: none;
}

.bb-lesson[open] .bb-lesson-thumb-fallback {
    align-items: center;
    padding: 0;
}

.bb-lesson[open] .bb-lesson-info {
    flex: 1;
}

.bb-lesson[open] .bb-lesson-chevron {
    display: block;
}

.bb-lesson-body {
    padding: 0;
}

.bb-lesson[open] .bb-lesson-body {
    animation: bb-lesson-reveal 0.28s ease-out;
}

.bb-lesson-video {
    position: relative;
    margin-top: 14px;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(232, 37, 28, 0.18), transparent 60%),
        #0d0d10;
}

.bb-lesson-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.bb-lesson-text {
    margin-top: 16px;
    font-size: 0.9rem;
    line-height: 2.05;
    color: #4b5563;
    text-align: justify;
}

.bb-lesson-text p {
    margin: 0 0 10px;
}


.bb-learn-empty {
    text-align: center;
}

/* ---------- ask box ---------- */

.bb-learn-ask {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 48px;
    padding: 22px;
    border-radius: 20px;
    background: linear-gradient(115deg, #fff4f3, #f2f7ff);
    border: 1px solid #f1e3e2;
}

.bb-learn-ask-icon {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid #f1e3e2;
}

.bb-learn-ask-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: var(--learn-red);
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bb-learn-ask-copy {
    flex: 1;
    min-width: 0;
}

.bb-learn-ask-copy h2 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 900;
    color: var(--learn-ink);
}

.bb-learn-ask-copy p {
    margin: 6px 0 0;
    font-size: 0.84rem;
    line-height: 1.9;
    color: var(--learn-muted);
}

.bb-learn-ask-actions {
    flex: none;
    display: flex;
    gap: 8px;
}

.bb-learn-ask-actions a {
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.bb-learn-ask-actions svg {
    width: 17px;
    height: 17px;
}

.bb-learn-ask-primary {
    background: var(--learn-red);
    color: #fff;
}

.bb-learn-ask-secondary {
    background: #fff;
    color: var(--learn-ink);
    border: 1px solid #e5e7eb;
}

@keyframes bb-lesson-reveal {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .bb-learn {
        padding: 2px 12px 56px;
    }

    .bb-learn-path,
    .bb-lesson {
        scroll-margin-top: 150px;
    }

    .bb-learn-cover {
        aspect-ratio: 16 / 10.5;
        border-radius: 16px;
    }

    .bb-learn-cover-text {
        top: 16%;
        gap: 8px;
    }

    .bb-learn-cover-line.is-boxed {
        padding: 2px 12px 6px;
        border-radius: 10px;
    }

    .bb-learn-cover-art {
        left: 4%;
        width: 37%;
    }

    .bb-learn-cover-chips {
        display: none;
    }

    .bb-learn-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .bb-learn-cta {
        display: flex;
        justify-content: center;
    }

    .bb-learn-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    .bb-lesson[open] {
        padding: 10px;
    }

    .bb-lesson[open] .bb-lesson-thumb {
        width: 96px;
    }

    .bb-lesson-title {
        font-size: 0.92rem;
    }

    .bb-learn-ask {
        flex-direction: column;
        text-align: center;
    }

    .bb-learn-ask-actions {
        width: 100%;
        flex-direction: column;
    }

    .bb-learn-ask-actions a {
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bb-lesson[open] .bb-lesson-body {
        animation: none;
    }

    .bb-lesson-head:hover :is(.bb-lesson-thumb img, .bb-lesson-play) {
        transform: none;
    }
}

body.theme-dark .info-page-wrap--learn {
    background: #0f172a;
}

body.theme-dark .bb-learn {
    --learn-ink: #f1f5f9;
    --learn-muted: #94a3b8;
    --learn-card: #111827;
    --learn-line: #263247;
    --learn-red-soft: rgba(232, 37, 28, 0.16);
}

body.theme-dark .bb-learn-lead,
body.theme-dark .bb-lesson-text {
    color: #cbd5e1;
}

body.theme-dark .bb-learn-badge {
    background: #1e293b;
    color: #cbd5e1;
}

body.theme-dark .bb-learn-ask {
    background: linear-gradient(115deg, #1c1517, #131c2c);
    border-color: #263247;
}

body.theme-dark .bb-learn-ask-icon,
body.theme-dark .bb-learn-ask-secondary {
    background: #111827;
    border-color: #334155;
    color: #f1f5f9;
}
