/* Medya X / Teknik kalite turu 1 / Mobil ve tablet tasma guvenligi */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

@supports (overflow: clip) {
    html,
    body { overflow-x: clip; }
}

:where(main, section, article, aside, header, footer, nav, form, fieldset, div) {
    min-width: 0;
}

:where(img, video, canvas, svg, iframe, embed, object) {
    max-width: 100%;
}

:where(p, li, a, button, label, input, textarea, select, code, pre, td, th) {
    overflow-wrap: anywhere;
}

:where(input, textarea, select, button) {
    max-width: 100%;
}

.prose :where(table, pre),
.table-container {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.prose table {
    display: block;
    width: max-content;
    min-width: 100%;
}

.prose :where(img, video, iframe) {
    width: auto;
    height: auto;
}

.prose iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.mx-unified-content-width,
.mx-news-container,
.author-shell,
.authors-shell,
.mx-collections-shell {
    min-width: 0;
}

/* Orta ekran: iki kolonlu icerik sayfalari daralmadan tek kolona iner. */
@media (max-width: 1023px) {
    .category-page .mx-category-layout,
    .tag-page .mx-tag-layout,
    .search-page-shell .grid.lg\:grid-cols-12,
    .post-page .mx-post-layout {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1.75rem !important;
    }

    .category-page .mx-category-layout > :where(section, div, aside),
    .tag-page .mx-tag-layout > :where(section, div, aside),
    .search-page-shell .grid.lg\:grid-cols-12 > :where(section, div, aside),
    .post-page .mx-post-layout > :where(section, div, aside) {
        grid-column: 1 / -1 !important;
        width: 100%;
    }

    .category-page aside,
    .tag-page aside,
    .search-page-shell aside {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 1rem;
    }

    .mx-reader-layout,
    .mx-collections-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .mx-post-sidebar {
        position: static !important;
    }
}

/* Telefon: kartlar, formlar ve eylemler ekrana tam oturur. */
@media (max-width: 640px) {
    .mx-unified-content-width {
        width: calc(100% - 1rem) !important;
    }

    .category-page,
    .tag-page,
    .search-page-shell,
    .author-page,
    .authors-page,
    .post-page {
        padding-top: 1.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .category-page .mx-category-layout,
    .tag-page .mx-tag-layout,
    .search-page-shell .grid.lg\:grid-cols-12 {
        gap: 1.25rem !important;
    }

    .category-page aside,
    .tag-page aside,
    .search-page-shell aside {
        grid-template-columns: minmax(0, 1fr);
    }

    .category-page :where(.p-8, .p-10, .p-12),
    .tag-page :where(.p-8, .p-10, .p-12),
    .search-page-shell :where(.p-8, .p-10, .p-12) {
        padding: 1.25rem !important;
    }

    .search-page-shell > .mx-unified-content-width > div[style*="grid-template-columns"] {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1rem !important;
    }

    .category-page header .flex.items-start,
    .author-archive-header,
    .authors-card,
    .mx-reader-card-head,
    .mx-reader-item-top,
    .mx-collection-manage,
    .mx-collection-manage-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .category-page header .w-16.h-16 {
        width: 3.25rem;
        height: 3.25rem;
    }

    .authors-card {
        text-align: left !important;
    }

    .authors-card > a,
    .authors-avatar {
        align-self: flex-start;
    }

    .author-trust-layout,
    .author-hero-layout {
        align-items: flex-start !important;
        text-align: left !important;
    }

    .author-trust-link,
    .mx-category-follow-button,
    .mx-collection-primary,
    .mx-collection-secondary,
    .mx-collection-danger {
        width: 100%;
    }

    .mx-reader-profile {
        min-width: 0;
    }

    .mx-reader-name,
    .mx-reader-mail {
        overflow-wrap: anywhere;
    }

    .mx-reader-stats,
    .mx-reader-duo,
    .mx-reader-category-grid,
    .mx-auth-actions,
    .footer-newsletter .grid-cols-2 {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .mx-reader-card,
    .mx-collection-card,
    .mx-auth-card {
        padding: 1.2rem !important;
        border-radius: 1.15rem !important;
    }

    .mx-collection-rename,
    .mx-collection-rename input,
    .mx-collection-manage-actions > form,
    .mx-collection-manage-actions button {
        width: 100%;
        min-width: 0;
    }

    .mx-post-meta,
    .mx-post-share,
    .author-pagination,
    .mx-news-pagination {
        flex-wrap: wrap !important;
    }

    .mx-news-question-actions,
    .mx-news-compare-controls,
    .mx-news-compare-result,
    .mx-impact-analysis > div,
    .mx-away-grid,
    .mx-news-quiet > div {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .mx-news-radar-grid,
    .mx-news-minute-grid,
    .mx-news-latest-grid,
    .mx-news-files-grid,
    .mx-news-categories,
    .mx-news-pulse-layout,
    .mx-news-archive-layout {
        min-width: 0;
    }

    .mx-pwa-dialog-card {
        width: calc(100% - 1rem) !important;
        max-height: calc(100dvh - 1rem);
        overflow-y: auto;
    }

    #backToTop {
        right: .75rem !important;
        bottom: .75rem !important;
    }
}

@media (max-width: 380px) {
    .mx-reader-stats {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .mx-news-container :where(h1, h2),
    .post-header-card h1,
    .author-page h1,
    .authors-page h1 {
        word-break: normal;
        hyphens: auto;
    }
}
