html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
iframe,
video {
    max-width: 100%;
    height: auto;
}

@media (max-width: 1180px) {

    .site-container {
        width: min(100% - 40px, 1240px);
    }

    .desktop-nav {
        gap: 18px;
    }

    .desktop-nav a {
        font-size: 14px;
    }

    .portal-layout {
        grid-template-columns: minmax(0, 1fr) 290px;
    }

    .footer-grid {
        gap: 32px;
    }
}

@media (max-width: 980px) {

    .desktop-nav {
        display: none;
    }

    .header-row {
        min-height: 74px;
        gap: 14px;
    }

    .site-logo {
        font-size: 30px;
    }

    .site-logo small {
        font-size: 12px;
    }

    .header-actions {
        gap: 8px;
    }

    .portal-layout,
    .content-layout,
    .main-layout,
    .blog-layout,
    .page-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 22px;
    }

    .portal-main,
    .portal-sidebar,
    .sidebar,
    .right-sidebar,
    .left-sidebar,
    .content-sidebar,
    .main-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .portal-sidebar,
    .sidebar,
    .right-sidebar,
    .left-sidebar,
    .content-sidebar {
        position: static !important;
        top: auto !important;
        order: 2;
    }

    .portal-main,
    .main-content {
        order: 1;
    }

    .portal-hero,
    .portal-widget,
    .post-card,
    .card,
    .ad-card,
    .company-card,
    .sidebar-card,
    .directory-header,
    .archive-header,
    .search-header,
    .category-card,
    .subcategories-box,
    .tag-search-box {
        width: 100% !important;
        max-width: 100% !important;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }

    .search-panel form {
        grid-template-columns: 1fr 120px;
    }
}

@media (max-width: 760px) {

    .site-container {
        width: min(100% - 28px, 1240px);
    }

    .site-main {
        padding-top: 20px;
    }

    .site-logo {
        font-size: 28px;
        letter-spacing: -1px;
    }

    .site-logo small {
        font-size: 11px;
    }

    .header-round-btn,
    .burger-btn {
        width: 44px;
        height: 44px;
    }

    .post-card {
        grid-template-columns: 1fr !important;
    }

    .post-card__image {
        height: 210px;
    }

    .portal-hero h1,
    .directory-header h1,
    .archive-header h1,
    .search-header h1 {
        font-size: 30px !important;
        line-height: 1.15;
    }

    .portal-hero__intro,
    .directory-header p,
    .archive-description,
    .search-summary {
        font-size: 16px !important;
        line-height: 1.7;
    }

    .portal-hero__body,
    .portal-widget,
    .directory-header,
    .archive-header,
    .search-header,
    .category-card,
    .subcategories-box,
    .tag-search-box {
        padding: 20px !important;
    }

    .search-panel form {
        grid-template-columns: 1fr;
    }

    .search-panel button {
        height: 48px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-brand p,
    .footer-col p {
        max-width: 100%;
    }
}

@media (max-width: 480px) {

    .site-container {
        width: min(100% - 20px, 1240px);
    }

    .site-logo {
        font-size: 25px;
    }

    .site-logo small {
        display: none;
    }

    .header-actions {
        gap: 6px;
    }

    .header-round-btn,
    .burger-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .site-drawer {
        width: 92vw;
    }

    .drawer-header {
        min-height: 82px;
        padding: 20px;
    }

    .drawer-header h2 {
        font-size: 24px;
    }

    .drawer-body {
        padding: 20px;
    }

    .drawer-link {
        min-height: 50px;
        font-size: 16px;
    }

    .portal-layout,
    .content-layout,
    .main-layout,
    .blog-layout,
    .page-layout {
        gap: 18px;
    }

    .portal-hero {
        border-radius: 20px;
    }

    .portal-hero__body {
        padding: 18px !important;
    }

    .portal-hero h1,
    .directory-header h1,
    .archive-header h1,
    .search-header h1 {
        font-size: 26px !important;
    }

    .post-card {
        padding: 14px !important;
        border-radius: 18px;
    }

    .post-card__title {
        font-size: 21px;
        line-height: 1.25;
    }

    .post-card__image {
        height: 180px;
    }

    .portal-mini-post {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .portal-mini-post a,
    .portal-mini-post small,
    .post-card__title,
    .portal-hero h1,
    .drawer-link,
    .portal-category-list a,
    .portal-tag-list a,
    .tag-cloud-page a,
    .article-tags a {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .portal-category-list a,
    .portal-tag-list a,
    .tag-cloud-page a,
    .article-tags a {
        max-width: 100%;
    }
}



/* ========================================
   ARTICLE MOBILE FIX
======================================== */

@media (max-width: 992px) {

    .post-layout,
    .article-layout,
    .post-wrapper,
    .article-wrapper {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .post-sidebar,
    .article-sidebar {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        order: 2;

        position: static;
        top: unset;
    }

    .post-content,
    .article-content,
    .post-main,
    .article-main {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        order: 1;
    }

    .post-content *,
    .article-content * {
        max-width: 100%;
        word-break: break-word;
    }

    /* TELEGRAM */

    .telegram-embed,
    .telegram-widget,
    iframe[src*="telegram"] {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden;
        border-radius: 18px;
    }

    /* YOUTUBE */

    iframe[src*="youtube"],
    iframe[src*="youtu.be"] {
        width: 100% !important;
        max-width: 100%;
        aspect-ratio: 16 / 9;
        height: auto !important;

        border: 0;
        border-radius: 18px;
    }

    /* GALLERY */

    .post-gallery,
    .article-gallery,
    .gallery-grid {
        display: grid;

        grid-template-columns: 1fr;
        gap: 16px;
    }

    .post-gallery img,
    .article-gallery img,
    .gallery-grid img {
        width: 100%;
        height: auto;

        border-radius: 18px;
        object-fit: cover;
    }

    /* SHARE */

    .share-buttons,
    .post-share,
    .article-share {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }

    .share-buttons a,
    .post-share a,
    .article-share a {
        flex: 1 1 calc(50% - 12px);

        justify-content: center;
        text-align: center;
    }

    /* SIDEBAR CARDS */

    .sidebar-card,
    .post-sidebar-card {
        width: 100%;
    }

    /* FIX LONG LINKS */

    a {
        overflow-wrap: anywhere;
    }
}