/*
 * AVAX WEB - item detail page
 *
 * This stylesheet is deliberately scoped to .item-page. It only changes the
 * article detail surface and leaves the shared navbar and footer untouched.
 */

body.item-page {
    --item-ink: #13233f;
    --item-muted: #70809a;
    --item-line: #e5ebf3;
    --item-surface: #ffffff;
    --item-soft: #f5f8fc;
    --item-soft-blue: #edf5ff;
    --item-radius: 20px;
    background: #f6f8fb;
    color: var(--item-ink);
}

body.item-page .item-detail-section {
    background:
        radial-gradient(circle at 100% 0, rgba(16, 166, 151, 0.08), transparent 30%),
        linear-gradient(180deg, #f8fbff 0, #f6f8fb 72%);
}

body.item-page .item-detail-container {
    max-width: 1240px;
}

body.item-page .item-detail-header {
    padding: clamp(1.25rem, 2.5vw, 2rem);
    border: 1px solid rgba(220, 229, 240, 0.95);
    border-radius: var(--item-radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 36px rgba(27, 54, 88, 0.08);
}

body.item-page .item-detail-header .breadcrumb {
    margin-bottom: 1.25rem;
    font-size: 0.82rem;
}

body.item-page .item-detail-header .breadcrumb-item a {
    color: var(--item-muted);
}

body.item-page .item-detail-header .breadcrumb-item.active {
    color: var(--primary_color);
    font-weight: 600;
}

body.item-page .item-single-title {
    max-width: 820px;
    color: var(--item-ink);
    font-size: clamp(1.55rem, 2.4vw, 2.35rem);
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

body.item-page .item-detail-heading .text-muted,
body.item-page .item-detail-heading .row {
    color: var(--item-muted);
}

body.item-page .item-detail-heading .row.row-cols-auto {
    align-items: center;
}

body.item-page .item-detail-heading .col > a {
    color: inherit;
}

body.item-page .item-detail-heading .btn {
    min-height: 44px;
    border-radius: 12px;
    font-weight: 600;
}

body.item-page .item-detail-body {
    position: relative;
}

body.item-page .item-detail-layout {
    align-items: flex-start;
}

body.item-page .item-detail-main,
body.item-page .item-detail-sidebar {
    min-width: 0;
}

body.item-page .item-detail-main .card-v,
body.item-page .item-detail-sidebar .card-v,
body.item-page .item-detail-content-card {
    border-color: var(--item-line) !important;
    border-radius: var(--item-radius);
    box-shadow: 0 10px 28px rgba(27, 54, 88, 0.055);
}

body.item-page .item-detail-preview-card {
    padding: clamp(0.8rem, 2vw, 1.25rem) !important;
    background: var(--item-surface);
}

body.item-page .item-detail-preview-card .item-single-preview {
    overflow: hidden;
    border: 1px solid var(--item-line);
    border-radius: calc(var(--item-radius) - 5px);
    background: var(--item-soft);
}

body.item-page .item-detail-preview-card .item-single-img {
    display: flex;
    min-height: clamp(220px, 37vw, 520px);
    align-items: center;
    justify-content: center;
    background: #eef3f9;
}

body.item-page .item-detail-preview-card .item-single-img img {
    display: block;
    width: 100%;
    max-height: 620px;
    object-fit: contain;
    border-radius: 0;
}

body.item-page .item-detail-preview-card .item-badge {
    top: 1rem;
    z-index: 2;
    padding: 0.65rem 0.9rem;
    border-radius: 0 999px 999px 0;
    box-shadow: 0 8px 18px rgba(17, 37, 65, 0.18);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

body.item-page .item-detail-preview-card .item-swiper {
    margin: 0;
    padding: 0.8rem;
    border-top: 1px solid var(--item-line);
    background: #fff;
}

body.item-page .item-detail-preview-card .item-slide-img {
    height: clamp(64px, 9vw, 88px);
    border-color: #dbe4ef;
    border-radius: 12px;
    background: #f5f8fc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

body.item-page .item-detail-preview-card .item-slide-img:hover {
    border-color: var(--primary_color);
    box-shadow: 0 6px 16px rgba(27, 54, 88, 0.12);
    transform: translateY(-2px);
}

body.item-page .item-detail-preview-card .item-swiper .swiper-actions .swiper-button-prev,
body.item-page .item-detail-preview-card .item-swiper .swiper-actions .swiper-button-next {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    margin: 0 0.35rem;
    border: 1px solid #dce6f1;
    background: #fff;
    box-shadow: 0 5px 14px rgba(27, 54, 88, 0.1);
}

body.item-page .item-detail-preview-card .item-swiper .swiper-actions .swiper-button-prev:hover,
body.item-page .item-detail-preview-card .item-swiper .swiper-actions .swiper-button-next:hover {
    color: #fff;
    border-color: var(--primary_color);
    background: var(--primary_color);
}

body.item-page .item-detail-preview-card .item-single-video,
body.item-page .item-detail-preview-card .item-single-audio {
    overflow: hidden;
    border: 0;
    border-radius: calc(var(--item-radius) - 5px);
    background: #0e1b30;
}

body.item-page .item-detail-preview-card .item-single-video .plyr,
body.item-page .item-detail-preview-card .item-single-video video {
    display: block;
    width: 100%;
    height: auto;
    min-height: 260px;
    max-height: 620px;
    object-fit: contain;
}

body.item-page .item-detail-preview-card .item-single-audio {
    min-height: 250px;
    border: 0;
    background: linear-gradient(135deg, #122742, #0c7d78);
}

body.item-page .item-detail-tabs {
    margin-bottom: 0;
}

body.item-page .item-detail-content-card {
    padding: clamp(1rem, 2.5vw, 1.75rem) !important;
    background: var(--item-surface);
}

body.item-page .item-detail-tabs-nav {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--item-line);
}

body.item-page .item-detail-tabs-nav .btn {
    min-height: 46px;
    padding-inline: 1rem;
    border-radius: 12px;
    font-weight: 650;
    white-space: normal;
}

body.item-page .item-detail-content-card .description,
body.item-page .item-detail-content-card .item-single-paragraph {
    min-width: 0;
    color: #40516c;
    font-size: 1rem;
    line-height: 1.78;
    overflow-wrap: anywhere;
}

body.item-page .item-detail-content-card .item-single-paragraph > :first-child {
    margin-top: 0;
}

body.item-page .item-detail-content-card .item-single-paragraph h1,
body.item-page .item-detail-content-card .item-single-paragraph h2,
body.item-page .item-detail-content-card .item-single-paragraph h3,
body.item-page .item-detail-content-card .item-single-paragraph h4,
body.item-page .item-detail-content-card .item-single-paragraph h5,
body.item-page .item-detail-content-card .item-single-paragraph h6 {
    margin-top: 1.7em;
    margin-bottom: 0.65em;
    color: var(--item-ink);
    font-weight: 750;
    line-height: 1.3;
}

body.item-page .item-detail-content-card .item-single-paragraph h2 {
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--item-line);
    font-size: clamp(1.35rem, 2vw, 1.75rem);
}

body.item-page .item-detail-content-card .item-single-paragraph h3 {
    font-size: 1.25rem;
}

body.item-page .item-detail-content-card .item-single-paragraph a {
    color: var(--primary_color);
    font-weight: 600;
}

body.item-page .item-detail-content-card .item-single-paragraph ul,
body.item-page .item-detail-content-card .item-single-paragraph ol {
    padding-inline-start: 1.4rem;
}

body.item-page .item-detail-content-card .item-single-paragraph li + li {
    margin-top: 0.35rem;
}

body.item-page .item-detail-content-card .item-single-paragraph img,
body.item-page .item-detail-content-card .item-single-paragraph iframe,
body.item-page .item-detail-content-card .item-single-paragraph video {
    max-width: 100%;
    border-radius: 12px;
}

body.item-page .item-detail-content-card .item-single-paragraph table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

body.item-page .item-detail-content-card .item-single-paragraph th,
body.item-page .item-detail-content-card .item-single-paragraph td {
    min-width: 120px;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--item-line);
}

body.item-page .item-detail-content-card .item-single-paragraph th {
    color: var(--item-ink);
    background: var(--item-soft);
}

body.item-page .item-detail-content-card .item-single-paragraph pre,
body.item-page .item-detail-content-card .item-single-paragraph code {
    max-width: 100%;
    overflow-x: auto;
}

body.item-page .item-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.item-page .item-detail-sidebar > .card-v {
    margin-bottom: 0 !important;
}

body.item-page .item-detail-purchase-card {
    overflow: hidden;
    background: var(--item-surface);
}

body.item-page .item-detail-purchase-card .card-v-header {
    padding: 1.1rem 1.25rem !important;
    border-bottom-color: var(--item-line) !important;
    background: linear-gradient(135deg, #f9fbff, #eef7fb);
}

body.item-page .item-detail-purchase-card .card-v-header h5,
body.item-page .item-detail-purchase-card .card-v-body h3 {
    color: var(--item-ink);
    font-weight: 750;
}

body.item-page .item-detail-purchase-card .card-v-body {
    padding: 1.25rem !important;
}

body.item-page .item-detail-purchase-card .btn {
    min-height: 46px;
    border-radius: 12px;
    font-weight: 700;
}

body.item-page .item-detail-license-card .form-check {
    margin-bottom: 0.75rem !important;
    padding: 0.95rem 1rem 0.95rem 2.6rem;
    border: 1px solid var(--item-line);
    border-radius: 14px;
    background: #fbfcfe;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

body.item-page .item-detail-license-card .form-check:focus-within {
    border-color: var(--primary_color);
    background: var(--item-soft-blue);
    box-shadow: 0 0 0 3px rgba(16, 166, 151, 0.1);
}

body.item-page .item-detail-license-card .form-check-label {
    gap: 1rem;
    cursor: pointer;
}

body.item-page .item-detail-license-card .form-check-label h6 {
    color: var(--item-ink);
    font-weight: 750;
}

body.item-page .item-detail-license-card .item-price {
    flex-wrap: wrap;
    justify-content: flex-end;
    color: var(--primary_color);
    font-size: 1.05rem;
}

body.item-page .item-detail-license-card .item-price-through {
    color: var(--item-muted);
    font-size: 0.8rem;
}

body.item-page .item-detail-license-card .item-price-number {
    font-weight: 800;
}

body.item-page .item-detail-license-card .bg-light {
    border: 1px solid var(--item-line);
    background: var(--item-soft) !important;
}

body.item-page .item-detail-license-card .list {
    padding-top: 0.25rem;
}

body.item-page .item-detail-license-card .list-item {
    padding: 0.45rem 0;
    color: var(--item-muted);
}

body.item-page .item-detail-author-card {
    background: linear-gradient(145deg, #ffffff, #f8fbff);
}

body.item-page .item-detail-author-card .user-avatar-lg {
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(27, 54, 88, 0.16);
}

body.item-page .item-detail-author-card .item-author-badge {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    padding: 0.35rem;
    border: 1px solid var(--item-line);
    border-radius: 12px;
    background: #fff;
}

body.item-page .item-detail-author-card .item-author-badge img {
    max-width: 100%;
    max-height: 100%;
}

body.item-page .item-detail-author-card .btn,
body.item-page .item-detail-stat-card,
body.item-page .item-detail-meta-card,
body.item-page .item-detail-featured-card {
    border-radius: 16px;
}

body.item-page .item-detail-stat-card h5 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--item-ink);
    font-size: 1rem;
}

body.item-page .item-detail-stat-card h5 i {
    color: var(--primary_color);
}

body.item-page .item-detail-meta-card {
    overflow: hidden;
    background: #fff;
}

body.item-page .item-detail-meta-card .small > .d-flex {
    gap: 0.8rem;
    flex-wrap: wrap;
    align-items: flex-start;
    color: var(--item-muted);
}

body.item-page .item-detail-meta-card .small > .d-flex > p:first-child {
    color: var(--item-ink);
    font-weight: 650;
}

body.item-page .item-detail-meta-card .small > .d-flex > p:last-child,
body.item-page .item-detail-meta-card .small > .d-flex > span,
body.item-page .item-detail-meta-card .small > .d-flex > div {
    max-width: 68%;
    overflow-wrap: anywhere;
}

body.item-page .item-detail-meta-card .breadcrumb {
    justify-content: flex-end;
    margin-bottom: 0;
    text-align: end;
}

body.item-page .item-detail-related-section {
    padding-top: 1rem;
    background: #fff;
}

body.item-page .item-detail-related-section .section-title-text {
    color: var(--item-ink);
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    font-weight: 750;
}

body.item-page .item-detail-related-section .section-title-divider {
    width: 48px;
    height: 4px;
    border-radius: 99px;
    background: var(--primary_color);
}

body.item-page .item-detail-related-grid > .col {
    min-width: 0;
}

body.item-page .item-detail-related-grid .item {
    height: 100%;
    overflow: hidden;
    border-color: var(--item-line) !important;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(27, 54, 88, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.item-page .item-detail-related-grid .item:hover {
    box-shadow: 0 14px 30px rgba(27, 54, 88, 0.12);
    transform: translateY(-3px);
}

body.item-page .item-detail-related-grid .item-header,
body.item-page .item-detail-related-grid .item-img,
body.item-page .item-detail-related-grid .item-video,
body.item-page .item-detail-related-grid .item-audio {
    border-radius: 16px 16px 0 0;
}

body.item-page .item-detail-related-grid .item-body {
    padding: 1rem;
}

body.item-page .item-detail-related-grid .item-title {
    color: var(--item-ink);
    font-weight: 700;
}

body.item-page .item-detail-related-grid .item-purchase {
    margin-top: 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--item-line);
}

body.item-page .item-detail-related-grid .btn {
    border-radius: 10px;
}

body.item-page .item-detail-related-section + .item-detail-related-section {
    border-top: 1px solid #edf1f6;
}

@media (min-width: 992px) {
    body.item-page .item-detail-sidebar {
        position: sticky;
        top: 1.25rem;
    }
}

@media (max-width: 991.98px) {
    body.item-page .item-detail-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    body.item-page .item-detail-sidebar > .item-detail-license-card,
    body.item-page .item-detail-sidebar > .item-detail-free-card,
    body.item-page .item-detail-sidebar > .item-detail-premium-card,
    body.item-page .item-detail-sidebar > .item-detail-author-card,
    body.item-page .item-detail-sidebar > .item-detail-meta-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    body.item-page .item-detail-section {
        padding-top: 1.25rem !important;
    }

    body.item-page .item-detail-header {
        padding: 1rem;
        border-radius: 16px;
    }

    body.item-page .item-detail-header .breadcrumb {
        margin-bottom: 0.9rem;
        white-space: normal;
    }

    body.item-page .item-single-title {
        font-size: 1.45rem;
    }

    body.item-page .item-detail-preview-card,
    body.item-page .item-detail-content-card {
        border-radius: 16px;
    }

    body.item-page .item-detail-preview-card .item-single-img {
        min-height: 180px;
    }

    body.item-page .item-detail-preview-card .item-single-video .plyr,
    body.item-page .item-detail-preview-card .item-single-video video {
        min-height: 190px;
    }

    body.item-page .item-detail-preview-card .item-swiper {
        padding: 0.55rem;
    }

    body.item-page .item-detail-preview-card .item-slide-img {
        height: 64px;
    }

    body.item-page .item-detail-sidebar {
        display: flex;
    }

    body.item-page .item-detail-license-card .form-check-label {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    body.item-page .item-detail-license-card .item-price {
        width: 100%;
        justify-content: flex-start;
        padding-top: 0.35rem;
    }

    body.item-page .item-detail-meta-card .small > .d-flex > p:last-child,
    body.item-page .item-detail-meta-card .small > .d-flex > span,
    body.item-page .item-detail-meta-card .small > .d-flex > div {
        max-width: 100%;
        width: 100%;
        text-align: start !important;
    }

    body.item-page .item-detail-meta-card .breadcrumb {
        justify-content: flex-start;
        text-align: start;
    }

    body.item-page .item-detail-content-card .item-single-paragraph {
        font-size: 0.96rem;
        line-height: 1.7;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.item-page .item-detail-preview-card .item-slide-img,
    body.item-page .item-detail-license-card .form-check,
    body.item-page .item-detail-related-grid .item {
        transition: none;
    }
}
