/* Agency, blog, contact, account and downloads. Native markup and handlers stay in place. */
:is(.cms-page-view:not(.cms-home-en), .blog-page, .account, .customer-account-login, .customer-account-forgotpassword, .customer-account-create, .customer-account-createpassword, .customer-account-logoutsuccess) {
    background: var(--mp-wash);
    color: var(--mp-ink);
    font-family: var(--mp-font);
}

:is(.cms-page-view:not(.cms-home-en), .blog-page, .account, .customer-account-login, .customer-account-forgotpassword, .customer-account-create, .customer-account-createpassword, .customer-account-logoutsuccess) .columns {
    max-width: var(--mp-content);
    padding: 32px var(--mp-gutter) 72px;
}

body:is(.category-tulemused, .category-results) .page-title,
body:is(.category-tulemused, .category-results) .category-cms,
body:is(.category-tulemused, .category-results) .category-description {
    display: none;
}

body:is(.category-tulemused, .category-results) .mp-work-page {
    display: block;
}

.catalog-category-view .category-description,
.cms-page-view:not(.cms-home-en) .column.main,
.blog-page .column.main,
.account .column.main {
    min-width: 0;
    max-width: 100%;
}

.cms-page-view:not(.cms-home-en) .column.main :where(p, li) {
    line-height: 1.65;
}

.cms-page-view:not(.cms-home-en) .column.main :where(a),
.blog-page .post-title a {
    color: var(--mp-accent);
}

.catalog-category-view .category-description img,
.cms-page-view:not(.cms-home-en) .column.main img,
.blog-page img,
[data-form-id] img {
    max-width: 100%;
    height: auto;
}

/* A 320px column floor plus padding made .mp2-card.mp2-case 327px wide, past a 360px screen. */
.catalog-category-view .mp2-page-tulemused .mp2-wrap,
.catalog-category-view .mp2-page-tookindel .mp2-wrap {
    width: 100%;
    max-width: 1180px;
}

.mp2-page-tulemused .mp2-grid--cases,
.mp2-page-tulemused .mp2-card.mp2-case,
.mp2-page-tulemused .mp2-case-figure,
.mp2-page-tulemused .mp2-case-text,
.mp2-page-tookindel .mp2-cols,
.mp2-page-tookindel .mp2-grid--sla,
.mp2-page-tookindel .mp2-card {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 780px) {
    .mp2-page-tulemused .mp2-card.mp2-case,
    .mp2-page-tulemused .mp2-card.mp2-case.mp2-case--alt,
    .mp2-page-tulemused .mp2-hero,
    .mp2-page-tookindel .mp2-cols,
    .mp2-page-tookindel .mp2-grid--sla {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }
}

.catalog-category-view .mp-logo-band {
    position: relative;
    left: auto;
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
    overflow: hidden;
}

.catalog-category-view .mp2-page-tulemused .mp2-block--alt::before,
.catalog-category-view .mp2-page-tulemused .mp2-block--dark::before,
.catalog-category-view .mp2-page-tulemused .mp2-surface--bleed::before {
    left: 0;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
}

.blog-page .sidebar {
    min-width: 0;
    max-width: 100%;
}

.blog-page .sidebar input.input-text {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.blog-page .post-list {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-page .post-holder,
.blog-page .block,
:is(.account, .customer-account-login, .customer-account-create, .customer-account-forgotpassword, .customer-account-createpassword) .card,
.hyva-dev-subscriptions .card {
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--mp-line);
    border-radius: 12px;
    background: #fff;
}

.blog-page .post-holder {
    padding: 16px;
}

.blog-page .post-title {
    color: var(--mp-ink);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

.blog-page .post-title a {
    font: inherit;
    text-decoration: none;
}

.blog-page .post-read-more,
.account a,
.cms-page-view:not(.cms-home-en) .column.main a {
    overflow-wrap: anywhere;
}

:is(.account, .customer-account-login, .customer-account-forgotpassword, .customer-account-create, .customer-account-createpassword, .downloadable-customer-products, .hyva-dev-subscriptions, .hyva-dev-contact) :is(.form-input, .form-select, .form-textarea, .btn, button),
.account-nav a,
.account-nav strong {
    min-height: 44px;
}

:is(.account, .customer-account-login, .customer-account-create, .customer-account-forgotpassword, .downloadable-customer-products) .btn-primary,
.hyva-dev-subscriptions .btn {
    border-color: transparent;
    border-radius: 7px;
    background: var(--mp-accent);
    color: #fff;
}

.account-nav a,
.account-nav strong {
    display: flex;
    align-items: center;
}

.downloadable-customer-products .overflow-x-auto,
.account .table-wrapper {
    max-width: 100%;
}

[data-form-id] .form-input {
    width: 100%;
    border: 1px solid var(--mp-line);
    border-radius: 7px;
}

:is(.blog-page, .cms-page-view:not(.cms-home-en), .account, .customer-account-login, .customer-account-forgotpassword, .customer-account-create, .catalog-category-view) :focus-visible {
    outline: 3px solid var(--mp-accent);
    outline-offset: 2px;
}

@media (max-width: 1023px) {
    :is(.cms-page-view:not(.cms-home-en), .blog-page, .account, .customer-account-login, .customer-account-forgotpassword, .customer-account-create, .customer-account-createpassword) .columns {
        padding-right: var(--mp-gutter);
        padding-left: var(--mp-gutter);
    }
}

@media (max-width: 767px) {
    :is(.cms-page-view:not(.cms-home-en), .blog-page, .account, .customer-account-login, .customer-account-forgotpassword, .customer-account-create, .customer-account-createpassword) .columns {
        padding-right: var(--mp-gutter);
        padding-left: var(--mp-gutter);
    }
}

/* About columns stay a desktop flex row in Page Builder. Stack them before 430px. */
#html-body:is(.category-meist, .category-about-us) .pagebuilder-column-line {
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
}

#html-body:is(.category-meist, .category-about-us) .pagebuilder-column,
#html-body:is(.category-meist, .category-about-us) [data-content-type="buttons"] {
    min-width: 0;
    max-width: 100%;
}

#html-body:is(.category-meist, .category-about-us) [data-content-type="buttons"] {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 767px) {
    #html-body:is(.category-meist, .category-about-us) .pagebuilder-column {
        flex-basis: 100%;
        width: 100%;
    }

    #html-body:is(.category-meist, .category-about-us) .pagebuilder-column:empty {
        display: none;
    }
}

.mp2-page-tulemused .mp2-grid--cases {
    gap: 24px;
}

.mp2-page-tulemused .mp2-case-figure img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top center;
}

:is(.cms-page-view, .blog-page, .catalog-category-view, .account) :is(h1, h2, h3, h4, .page-title) {
    font-family: var(--mp-font);
    letter-spacing: -0.02em;
}

@media (max-width: 389px) {
    :is(.cms-page-view:not(.cms-home-en), .blog-page, .account, .customer-account-login, .customer-account-forgotpassword, .customer-account-create, .customer-account-createpassword, .catalog-category-view) .columns {
        padding-right: 16px;
        padding-left: 16px;
    }
}

/* Full-width services CMS sits outside .column.main. Scope by the body class and .mp2-page-tookindel. */
body:is(.category-teenused, .category-services) .page-title {
    display: none;
}

body:is(.category-teenused, .category-services) .mp-bridge-wrap,
body:is(.category-teenused, .category-services) .mp-logo-band {
    display: none;
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel {
    color: var(--mp-ink);
    font-family: var(--mp-font);
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel :is(h1, h2, h3, p, li, a, button) {
    font-family: var(--mp-font);
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-wrap {
    box-sizing: border-box;
    width: 100%;
    max-width: calc(var(--mp-content) + (var(--mp-gutter) * 2));
    margin-right: auto;
    margin-left: auto;
    padding-right: var(--mp-gutter);
    padding-left: var(--mp-gutter);
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-hero {
    margin-bottom: 16px;
    padding-top: 32px;
    padding-bottom: 32px;
    border-radius: 8px;
    background: var(--mp-navy);
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-hero,
body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-hero :is(.mp2-title, .mp2-eyebrow, .mp2-lead) {
    color: #fff;
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-hero-card,
body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-hero-card :is(h2, h3, p, li) {
    color: var(--mp-ink);
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-title {
    font-size: 40px;
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-h2,
body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-card-title {
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel :is(p, li) {
    line-height: 1.65;
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-btn > a.pagebuilder-button-primary {
    min-height: 44px;
    padding: 12px 24px;
    border: 0;
    border-radius: 8px;
    background: var(--mp-accent);
    color: #fff;
    box-shadow: none;
    font-weight: 650;
    text-decoration: none;
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-dot {
    background: var(--mp-accent);
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel :is(.mp2-card--bronze, .mp2-card--silver) {
    border-color: var(--mp-line);
}

body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-card {
    border-radius: 8px;
    box-shadow: none;
}

body:is(.category-teenused, .category-services) .mp-lk-bridge {
    background: var(--mp-wash);
}

body:is(.category-teenused, .category-services) .mp-lk-bridge__link {
    color: var(--mp-accent);
}

#html-body.category-about-us .mp-en-about,
#html-body.category-about-us .mp-en-about :is(p, li, h2, a, strong, ul) {
    font-family: var(--mp-font) !important;
    color: var(--mp-ink);
}

#html-body.category-about-us .mp-en-about .btn > a.pagebuilder-button-primary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    border-radius: 8px;
    background: var(--mp-accent) !important;
    color: #fff !important;
    font-family: var(--mp-font) !important;
}

@media (max-width: 767px) {
    body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-title {
        font-size: 32px;
    }
}

/* Services only. Saved CMS CSS adds a second inset and 32px card padding. */
@media (max-width: 430px) {
    body:is(.category-teenused, .category-services) .category-view.container {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        padding-right: 16px;
        padding-left: 16px;
    }

    body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-wrap,
    body:is(.category-teenused, .category-services) .mp-bridge-wrap {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        margin-left: 0;
        padding-right: 0;
        padding-left: 0;
    }

    /* Page Builder puts container padding on the full-width row. That is the inset around .mp2-page-tookindel. */
    body:is(.category-teenused, .category-services) .category-cms [data-content-type="row"][data-appearance="full-width"] > .row-full-width-inner,
    body:is(.category-teenused, .category-services) .mp-lk-bridge__inner {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    /* Public HTML has no .mp2-hero-right. The white hero is .mp2-card.mp2-hero-card, a sibling of .mp2-hero-left, so one 16px inset covers it. */
    body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-hero-left,
    body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-card {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        padding-right: 16px;
        padding-left: 16px;
    }

    body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        max-width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    body:is(.category-teenused, .category-services) .mp2-page-tookindel .mp2-tab {
        min-height: 44px;
        max-width: 100%;
        white-space: normal;
    }

    body:is(.category-teenused, .category-services) .mp2-page-tookindel :is(.mp2-surface--bleed, .mp2-block--alt)::before {
        left: 0;
        width: 100%;
        margin-left: 0;
    }

    body:is(.category-teenused, .category-services) .category-cms {
        max-width: 100%;
        overflow-x: clip;
    }
}
