/* ===== БАЗОВЫЕ СТИЛИ ===== */
* {
    box-sizing: border-box;

    scrollbar-width: thin;

    &::-webkit-scrollbar {
        width: thin;
    }
}

body {
    font-family: var(--font-family-primary);
    line-height: var(--line-height-base);
    color: var(--color-text-primary);
    background-color: var(--color-background);
    margin: 0;
    overflow-x: hidden;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    min-height: 100vh;
}

/* Контейнер */
.container {
    padding-inline: var(--container-padding);
}

.main-content {
    padding-block: 120px;
    display: flex;
    flex-direction: column;
    gap: 120px;
    background: #fbfcfd;
    background: var(--background-image-circles);
    background-position: center;
    background-size: cover;
}

.wrapper__background-gradient {
    background-image: var(--background-image-circles);
    background-image: var(--background-image-circles), var(--gradient-background-light);
}

.wrapper__background-circle {
    background: var(--background-image-circles);
}


.page-wrapper {
    padding-bottom: var(--spacing-page-wrapper);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1279px) {


    .info-item {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }

    .info-item:nth-child(even) .info-item__text {
        order: 1;
    }

    .info-item:nth-child(even) .info-item__image {
        order: 2;
    }

    .footer__top {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }

    .footer__right {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

@media (max-width: 767px) {
    .header {
        flex-direction: column;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }



    .dropdown-menu {
        width: 150px;
        min-height: 80px;
    }

    .banner-item__text h2 {
        font-size: var(--font-size-xl);
    }

    .news-list {
        grid-template-columns: 1fr;
    }

    .news-top {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    .main-content {
        padding-block: 60px;
        display: flex;
        flex-direction: column;
        gap: 60px;
        background: var(--background-image-circles);
    }

    .container {
        padding-inline: 24px;
    }
}
/* A10: long Estonian compounds in search result titles (h2 size) overflowed a 390 px screen. */
.search-result .result-title {
    overflow-wrap: anywhere;
}

/*
 * QA 6: images in entry content never get wider than their column, at any screen width
 * (/uudised/twiin-latsin/ has 1440-1638 px photos that overflowed even at 1440).
 * Every the_content() wrapper of the theme: .article-content__main (single.php: posts, team
 * members, documents), .page-body (page.php), service/donor/partner singles, and .article-content
 * (news preview image, plus an old wrapper of that name pasted inside some post bodies).
 * height:auto keeps the proportions of images with width/height attributes once max-width
 * scales them down; an inline style height (e.g. the 300 px gallery rows) still wins.
 */
.article-content img,
.article-content__main img,
.page-body img,
.service-content img,
.donor-content img,
.partner-content img {
    max-width: 100%;
    height: auto;
}

/*
 * QA 3: overflow past a 390 px screen on single pages. Mobile only, desktop is unchanged.
 * - h1/h2 are 39px here (10vw), long Estonian words ("taasiseseisvumispäeva") did not fit;
 * - news, team and document singles share .article-content, but single-news.css (which makes
 *   the preview image fluid) loads only for posts, so team photos and content images kept
 *   their natural width; YouTube iframes are 670px wide;
 * - donor and partner singles print the website URL as one long word.
 */
@media (max-width: 768px) {
    h1,
    h2,
    h3 {
        overflow-wrap: break-word;
    }

    .article-content,
    .donor-single,
    .partner-info {
        overflow-wrap: anywhere;
    }

    /* Content images: see the QA 6 rule above, it applies at every width. */

    .article-content iframe,
    .article-content video,
    .article-content embed {
        max-width: 100%;
    }
}
