/* Material detail page */

.md-page {
    padding: 1.1rem 0 4rem;
    background:
        radial-gradient(900px 280px at 0% 0%, rgba(0, 184, 230, 0.1), transparent 55%),
        radial-gradient(700px 240px at 100% 8%, rgba(255, 160, 0, 0.08), transparent 50%),
        linear-gradient(180deg, #eef6fc 0%, #f7fbff 38%, #fff 100%);
}

.md-page.has-mobile-cta {
    padding-bottom: 6.25rem;
}

.md-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    color: var(--web-muted);
}

.md-crumb a {
    color: var(--web-accent);
    text-decoration: none;
    font-weight: 500;
}

.md-crumb a:hover { text-decoration: underline; }

.md-crumb .is-current {
    color: var(--web-ink);
    font-weight: 600;
    max-width: 28rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.md-alert { border-radius: 12px; }

.md-unlocked {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: #e8f8ef;
    color: #146c43;
    font-weight: 600;
}

.md-unlocked a {
    color: var(--web-accent);
    font-weight: 700;
}

.md-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.78fr);
    gap: 1.6rem;
    align-items: start;
}

.md-intro { margin-bottom: 1rem; }

.md-title {
    margin: 0.35rem 0 0.55rem;
    font-family: "Cinzel", serif;
    font-size: clamp(1.55rem, 2.6vw, 2.15rem);
    line-height: 1.2;
    color: var(--web-ink);
}

.md-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.15rem;
    align-items: center;
}

.md-author {
    color: var(--web-ink);
    font-weight: 600;
    text-decoration: none;
}

.md-author small {
    display: block;
    font-weight: 400;
    color: var(--web-muted);
    font-size: 0.8rem;
}

.md-author:hover { color: var(--web-accent); }

.md-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--web-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.md-rating:hover { color: var(--web-accent); }

.md-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.md-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--web-accent-dark);
    font-size: 0.75rem;
    font-weight: 600;
}

.md-chip.is-paid { background: #fff3cd; color: #7a4d00; }
.md-chip.is-free { background: #e6f7ee; color: #146c43; }

.md-chip.is-link {
    text-decoration: none;
    background: #0b1220;
    color: #fff;
}

.md-chip.is-link:hover { background: var(--web-accent); color: #fff; }

.md-cover {
    border-radius: 18px;
    overflow: hidden;
    background: #0b1220;
    margin-bottom: 1rem;
    box-shadow: 0 18px 40px rgba(11, 18, 32, 0.12);
}

.md-cover img {
    width: 100%;
    height: min(52vh, 420px);
    object-fit: cover;
    display: block;
}

.md-cover-fallback {
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #fff;
    font-family: "Cinzel", serif;
    font-size: 1.4rem;
    text-align: center;
    background: var(--web-gradient-brand);
}

.md-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    margin: 0 0 1rem;
    padding: 0.35rem;
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--web-line);
    border-radius: 999px;
    backdrop-filter: blur(8px);
}

.md-tabs a {
    flex: 0 0 auto;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    color: var(--web-muted);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
}

.md-tabs a:hover,
.md-tabs a:focus {
    background: #eef5ff;
    color: var(--web-accent);
}

.md-panel,
.md-page .er-reviews {
    background: #fff;
    border: 1px solid var(--web-line);
    border-radius: 16px;
    padding: 1.25rem 1.35rem 1.4rem;
    margin-bottom: 1.15rem;
    margin-top: 0;
    box-shadow: 0 10px 24px rgba(11, 18, 32, 0.04);
    scroll-margin-top: 4.5rem;
}

.md-page .er-reviews .card-header,
.md-page .er-reviews .card-body {
    padding: 0;
    background: transparent;
    border: 0;
}

.md-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.md-panel h2,
.md-includes h3 {
    margin: 0 0 0.85rem;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--web-ink);
}

.md-panel-head h2 { margin: 0; }

.md-lead {
    color: var(--web-muted);
    margin-bottom: 1rem;
}

.md-reading { line-height: 1.8; }

.md-media,
.md-video,
.md-iframe {
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: #0b1220;
}

.md-iframe { min-height: 280px; }
.md-video { max-height: 420px; }

.md-quiz-list { display: grid; gap: 0.65rem; }

.md-quiz {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--web-line);
    border-radius: 12px;
    background: #f8fbff;
}

.md-quiz p {
    margin: 0.15rem 0 0;
    color: var(--web-muted);
    font-size: 0.82rem;
}

.md-lock {
    display: inline-flex;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: #e9eef4;
    color: #5a6578;
    font-size: 0.75rem;
    font-weight: 600;
}

.md-course-item {
    align-items: flex-start;
}

.md-nested {
    margin-top: 0.65rem;
    padding-left: 0.75rem;
    border-left: 2px solid #d7e6f5;
    display: grid;
    gap: 0.4rem;
}

.md-nested-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    font-size: 0.8rem;
    color: var(--web-muted);
}

.md-nested-row a {
    color: var(--web-accent);
    font-weight: 600;
    text-decoration: none;
}

.md-aside {
    position: sticky;
    top: 1rem;
    align-self: start;
    z-index: 6;
    width: 100%;
}

.md-buy {
    position: relative;
    background: #fff;
    border: 1px solid var(--web-line);
    border-radius: 18px;
    padding: 1.2rem 1.25rem 1.3rem;
    box-shadow: 0 16px 36px rgba(11, 18, 32, 0.06);
    margin-bottom: 1rem;
}

.md-price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    margin-bottom: 1rem;
}

.md-price-now {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--web-accent);
    line-height: 1;
}

.md-price-now.is-free { color: #146c43; }

.md-price del {
    color: var(--web-muted);
    font-size: 1rem;
}

.md-cta { display: grid; gap: 0.55rem; }

.md-btn-block { width: 100%; border-radius: 999px !important; }

.md-btn-dark {
    border-color: var(--web-accent) !important;
    color: var(--web-accent) !important;
    background: #fff !important;
}

.md-btn-dark:hover {
    background: var(--web-accent) !important;
    color: #fff !important;
}

.md-note {
    margin: 0;
    color: var(--web-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.md-facts {
    list-style: none;
    padding: 0.35rem 0;
    margin: 1rem 0;
    border-top: 1px solid var(--web-line);
    border-bottom: 1px solid var(--web-line);
}

.md-facts li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eef3f8;
    font-size: 0.9rem;
}

.md-facts li:last-child { border-bottom: 0; }
.md-facts span { color: var(--web-muted); }
.md-facts strong { color: var(--web-ink); font-weight: 600; }

.md-includes ul { list-style: none; padding: 0; margin: 0; }

.md-includes li {
    position: relative;
    padding: 0.4rem 0 0.4rem 1.35rem;
    border-bottom: 1px solid #eef3f8;
    color: var(--web-ink);
    font-size: 0.9rem;
}

.md-includes li:last-child { border-bottom: 0; }

.md-includes li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.8rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--web-gold);
}

.md-mobile-cta { display: none; }

@media (max-width: 991.98px) {
    .md-shell { grid-template-columns: 1fr; }
    .md-aside,
    .md-buy { position: static; }
    .md-cover img { height: 240px; }
    .md-tabs { border-radius: 14px; }

    .md-mobile-cta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
        background: rgba(255,255,255,0.96);
        border-top: 1px solid var(--web-line);
        box-shadow: 0 -8px 24px rgba(11, 18, 32, 0.08);
    }

    .md-mobile-cta strong {
        font-size: 1.15rem;
        color: var(--web-accent);
    }

    .md-mobile-cta span {
        display: block;
        font-size: 0.75rem;
        color: #7a4d00;
        font-weight: 600;
    }
}
