/* ========================================
   PAGE LAYOUT
======================================== */

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

.page-main {
    min-width: 0;
    padding-bottom: 90px;
}

.page-sidebar {
    position: relative;
    min-width: 0;
}

.sidebar-content {
    position: sticky;
    top: 20px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.sidebar-title {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.sidebar-section {
    min-width: 0;
}

.sidebar-empty {
    color: #888;
    font-size: 13px;
    text-align: center;
}

.sidebar-content hr {
    margin: 20px 0;
    border-color: #e5e7eb;
}


/* ========================================
   ARTICLES
======================================== */

.sidebar-article {
    display: block;
    margin-bottom: 12px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.sidebar-article:hover {
    color: #0d6efd;
}

.sidebar-article-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 400;
    color: var(--bs-secondary-color);
}

.sidebar-article-title {
    display: block;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

.sidebar-more {
    display: block;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}


/* ========================================
   OFFERS
======================================== */

.offer-item {
    margin-bottom: 16px;
    text-align: center;
}

.offer-item a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.offer-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 7px;
}

.offer-item span {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.offer-item a:hover span {
    color: #0d6efd;
}


/* ========================================
   GITHUB
======================================== */

.sidebar-project {
    display: block;
    padding: 5px 20px;
    color: inherit;
    text-align: center;
    text-decoration: none;
}

.sidebar-project img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.sidebar-project strong {
    display: block;
    font-size: 14px;
}

.sidebar-project small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 12px;
}

.project-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    margin-bottom: 10px;
    background: #f1f3f5;
    border-radius: 8px;
    font-size: 42px;
}

.github-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    color: inherit;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.github-link:hover {
    color: #0d6efd;
    border-color: #0d6efd;
}


/* ========================================
   YOUTUBE
======================================== */

/* Offers */
.sidebar-offer-image {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    object-position: center;
}

/* YouTube */
.sidebar-video-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    object-position: center;
}

/* Общий стиль */
.offer-item,
.sidebar-video {
    display: block;
    overflow: hidden;
}

.offer-item img,
.sidebar-video img {
    border-radius: 8px;
}

.sidebar-video {
    display: block;
    padding: 5px 20px;
    color: inherit;
    text-align: center;
    text-decoration: none;
}

.sidebar-video img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.sidebar-video strong {
    display: block;
    font-size: 13px;
}

.sidebar-carousel {
    padding-bottom: 30px;
}

.sidebar-carousel .carousel-control-prev,
.sidebar-carousel .carousel-control-next {
    top: auto;
    bottom: 0;
    width: 35px;
    height: 28px;
    background: #555;
    border-radius: 6px;
    opacity: .8;
}

.sidebar-carousel .carousel-control-prev {
    left: calc(50% - 40px);
}

.sidebar-carousel .carousel-control-next {
    right: calc(50% - 40px);
}

.sidebar-carousel .carousel-control-prev-icon,
.sidebar-carousel .carousel-control-next-icon {
    width: 14px;
    height: 14px;
}


/* ========================================
   BLOG MODAL
======================================== */

.blog-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}

.blog-modal-item img {
    width: 75px;
    height: 60px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 7px;
}

.blog-modal-item span {
    font-weight: 600;
}

.blog-modal-item:hover {
    color: #0d6efd;
}


/* ========================================
   DESKTOP NAVIGATION
======================================== */

.desktop-navigation {
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 15px;
    display: flex;
    gap: 10px;
    padding: 7px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 30px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, .12);
    transform: translateX(-50%);
}

.desktop-navigation a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 22px;
}

.desktop-navigation a:hover {
    color: #0d6efd;
    background: #f2f6ff;
}


/* ========================================
   MOBILE NAVIGATION
======================================== */

.bottom-navigation {
    display: none;
}

.sidebar-backdrop {
    display: none;
}


/* ========================================
   MOBILE SIDEBARS
======================================== */

/* ========================================
   MOBILE LAYOUT
======================================== */

@media (max-width: 991.98px) {

    .page-layout {
        display: flex;
        flex-direction: column;
    }

    .page-main {
        width: 100%;
        padding-bottom: 30px;
    }

    /* Sidebars become normal page sections */
    .page-sidebar {
        position: static;
        display: block;
        width: 100%;
        max-width: none;
        height: auto;
        max-height: none;
        padding: 0;
        overflow: visible;
        background: transparent;
        transform: none;
        transition: none;
    }

    .page-sidebar .sidebar-title {
        text-align: left;
        font-size: 20px;
        margin-bottom: 18px;
    }

    .sidebar-article {
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }

    .sidebar-article:last-of-type {
        border-bottom: 0;
    }

    .offer-item {
        max-width: 320px;
        margin: 0 auto 20px;
    }

    .sidebar-project,
    .sidebar-video {
        padding-left: 10px;
        padding-right: 10px;
    }

    .page-sidebar-left,
    .page-sidebar-right {
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
    }

    .sidebar-content {
        position: static;
        padding: 16px;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
    }

    .sidebar-section {
        scroll-margin-top: 20px;
    }

    .sidebar-content hr {
        margin: 24px 0;
    }

    /* Hide old backdrop */
    .sidebar-backdrop {
        display: none !important;
    }

    /* Navigation */
    .desktop-navigation {
        display: none;
    }

    .bottom-navigation {
        position: fixed;
        z-index: 1100;
        right: 0;
        bottom: 0;
        left: 0;

        display: flex;
        justify-content: space-around;

        padding: 8px 4px calc(8px + env(safe-area-inset-bottom));

        background: #fff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -3px 15px rgba(0, 0, 0, .08);
    }

    .mobile-nav-item {
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;

        padding: 5px 2px;

        color: #555;
        background: transparent;
        border: 0;

        font-size: 11px;
        text-decoration: none;
    }

    .mobile-nav-item i {
        font-size: 21px;
        line-height: 1;
    }

    .mobile-nav-item:active,
    .mobile-nav-item:hover {
        color: #0d6efd;
    }

    body {
        padding-bottom: 75px;
    }
}
