/* AI Digest responsive layout layer.
   Loaded last so templates stay clean and layout fixes live in one place. */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: clip;
}

body {
    min-width: 0;
}

img,
video,
iframe,
embed,
object {
    max-width: 100%;
}

.site-content,
.ast-container,
.content-area,
.ast-article-single,
.entry-content {
    min-width: 0;
}

body .site-content {
    width: 100%;
    max-width: min(1400px, 100%);
}

.ast-separate-container .site-content .ast-container,
.ast-plain-container .site-content .ast-container {
    width: 100%;
    max-width: min(1240px, 100%);
}

.ast-separate-container .site-content #primary,
.ast-plain-container .site-content #primary {
    width: 100%;
    max-width: 100%;
}

.ast-separate-container .ast-article-single {
    width: 100%;
    max-width: 100%;
}

.entry-content,
.entry-content p,
.entry-content li,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.entry-title,
.aid-hero h1,
.aid-nb-lead h3,
.aid-nb-row-title,
.aid-art-feature-body h2,
.aid-art-card-body h3,
.aid-guide-body h3,
.product-card-body h3,
.pd-title,
.pd-description,
.pd-variant-text {
    overflow-wrap: anywhere;
    word-break: normal;
}

.entry-content pre,
.entry-content code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.entry-content .wp-block-table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.entry-content table {
    max-width: 100%;
}

/* Header */
.hdr-bar-inner,
.hdr-masthead-inner,
.hdr-nav-strip-inner {
    width: 100%;
    min-width: 0;
}

.hdr-live,
.hdr-ticker-mini,
.hdr-actions,
.hdr-search,
.site-logo,
.logo-words {
    min-width: 0;
}

.hdr-ticker-mini {
    flex: 1 1 auto;
}

.hdr-bar-links {
    flex: 0 0 auto;
}

.nav-overlay {
    left: 0;
    right: auto;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    contain: layout paint;
}

.nav-overlay:not(.open) {
    display: none;
    transform: none;
    visibility: hidden;
    pointer-events: none;
}

.nav-overlay.open {
    display: flex;
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

@media (max-width: 767px) {
    .hdr-bar-inner {
        justify-content: flex-start;
        gap: 10px;
        overflow: hidden;
    }

    .hdr-ticker-mini,
    .hdr-bar-links {
        display: none;
    }

    .hdr-live {
        max-width: 100%;
    }

    .hdr-live-lbl {
        white-space: normal;
    }

    .hdr-masthead-inner {
        gap: 14px;
    }

    .logo-name {
        font-size: 18px;
    }
}

/* Homepage */
.aid-hero,
.aid-section,
.aid-nl-section,
footer {
    max-width: 100%;
}

.aid-sec-body,
.aid-nl-inner,
.aid-ft-grid,
.aid-ft-bottom,
.aid-hero-content {
    width: 100%;
    min-width: 0;
}

.aid-news-layout,
.aid-news-broadsheet,
.aid-guides-layout,
.aid-nl-inner,
.aid-ft-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.aid-news-layout {
    grid-template-columns: minmax(0, 1fr);
}

.aid-articles-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: stretch;
}

.aid-art-feature {
    grid-column: 1;
    grid-row: 1 / 3;
}

.aid-art-feature,
.aid-art-card {
    height: 100%;
}

.aid-art-feature-body {
    flex: 0 0 auto;
}

.aid-art-feature-body p {
    flex: 0 0 auto;
}

.aid-art-feature .aid-art-byline {
    margin-top: 20px;
}

.aid-art-feature-body,
.aid-art-card-body {
    min-height: 0;
}

.aid-art-feature:not(:has(.aid-art-feature-img)) .aid-art-feature-body,
.aid-art-card:not(:has(.aid-art-card-img)) .aid-art-card-body {
    justify-content: flex-start;
}

.aid-news-left,
.aid-news-right,
.aid-nb-col,
.aid-art-feature,
.aid-art-card,
.aid-topic,
.aid-guide-card {
    min-width: 0;
}

@media (max-width: 1060px) {
    .aid-news-layout {
        grid-template-columns: 1fr;
    }

    .aid-news-stats {
        border-left: 0;
        border-top: 1px solid #d1d5db;
    }
}

@media (max-width: 767px) {
    .aid-articles-layout {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .aid-art-feature {
        grid-column: auto;
        grid-row: auto;
    }

    .aid-hero {
        height: auto;
        min-height: 420px;
    }

    .aid-hero-content {
        position: relative;
        min-height: 420px;
        padding: 72px 20px 56px;
    }

    .aid-hero-actions,
    .aid-sec-head,
    .aid-nl-stats,
    .aid-ft-bottom,
    .aid-ft-bottom-links {
        align-items: flex-start;
        flex-direction: column;
    }

    .aid-hero-read,
    .aid-nl-submit {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* Archive/category card grids */
.ast-blog-layout-4-grid .ast-row {
    min-width: 0;
}

.ast-blog-layout-4-grid .ast-row > article,
.ast-blog-layout-4-grid .ast-row > .ast-article-post {
    min-width: 0;
}

@media (max-width: 1023px) {
    .ast-blog-layout-4-grid .ast-row > article,
    .ast-blog-layout-4-grid .ast-row > .ast-article-post {
        width: 50%;
        flex-basis: 50%;
        max-width: 50%;
    }
}

@media (max-width: 767px) {
    .ast-blog-layout-4-grid .ast-row > article,
    .ast-blog-layout-4-grid .ast-row > .ast-article-post {
        width: 100%;
        flex-basis: 100%;
        max-width: 100%;
    }
}

/* Single posts/pages */
@media (max-width: 1240px) {
    .ast-separate-container .site-content {
        padding-right: 20px;
        padding-left: 20px;
    }

    .ast-separate-container .site-content .ast-container {
        padding-right: 0;
        padding-left: 0;
    }
}

@media (max-width: 767px) {
    .ast-separate-container .site-content {
        padding-right: 12px;
        padding-left: 12px;
    }

    .ast-separate-container .ast-article-single {
        padding: 18px 16px;
        border-radius: 8px;
    }

    .entry-content {
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    .entry-content table,
    .entry-content .wp-block-table table {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* Shop catalog and product detail */
body.page-id-1146 .site-content {
    max-width: none;
    padding: 0;
}

body.page-id-1146 .site-content .ast-container {
    display: block;
    width: 100%;
    max-width: none;
    padding: 0;
}

body.page-id-1146 #primary {
    width: 100%;
    max-width: none;
}

.shop-hero-inner,
.shop-filters-inner,
.shop-grid,
.pd-breadcrumbs-inner,
.pd-layout,
.pd-section,
.pd-nav-inner {
    width: 100%;
    min-width: 0;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.shop-grid .product-card {
    width: auto;
    min-width: 0;
}

.product-price-row,
.product-stats,
.pd-price-block,
.pd-stats,
.pd-nav-inner,
.pd-nominal-block {
    flex-wrap: wrap;
}

.pd-layout {
    display: grid;
    grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
}

.pd-gallery,
.pd-info {
    min-width: 0;
}

.pd-swiper-main {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

.pd-pricing-table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pd-pricing-table table {
    min-width: 420px;
}

@media (max-width: 1024px) {
    .pd-layout {
        grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
        gap: 28px;
    }
}

@media (max-width: 860px) {
    .pd-layout {
        grid-template-columns: 1fr;
    }

    .pd-gallery {
        width: 100%;
        max-width: 520px;
        margin-right: auto;
        margin-left: auto;
    }
}

@media (max-width: 560px) {
    .shop-hero-inner {
        padding: 40px 16px 32px;
    }

    .shop-hero h1 {
        font-size: 24px;
    }

    .shop-filters-inner {
        padding-right: 12px;
        padding-left: 12px;
    }

    .shop-grid {
        padding: 20px 12px 36px;
        gap: 14px;
    }

    .pd-layout,
    .pd-section,
    .pd-nav {
        padding-right: 12px;
        padding-left: 12px;
    }

    .pd-breadcrumbs {
        padding-right: 12px;
        padding-left: 12px;
    }

    .pd-title {
        font-size: 20px;
    }

    .pd-price {
        font-size: 26px;
    }

    .pd-nominal-block {
        align-items: stretch;
        flex-direction: column;
    }

    .pd-nav-inner {
        align-items: stretch;
    }
}
