/*
 * Small project-owned bridge between CMS markup and imported brand CSS.
 * Keep external theme files copied as-is; put local CMS adjustments here.
 */

body[class*="theme-"] {
    margin: 0;
    background: var(--cms-page-background);
    color: var(--cms-text-color);
    font-family: var(--cms-font-body);
    line-height: 1.5;
}

body[class*="theme-"] main {
    min-height: 100vh;
}

body.theme-tryg-dk {
    --s-color-background-section: #ededed;
    --s-color-background-brand: #ce0303;
    --s-color-text-on-dark-default: #fff;
    --s-color-text-default: #262626;
    --s-color-cta-on-dark-default: #fff;
    --b-color-neutral-darker: #535c5e;
    --b-color-neutral-default: #e1e1e1;
    /* Bundled TrygDesign uses dynamic spacing tokens; map to legacy rem scale. */
    --p-size-dynamic-100: 0.938rem;
    --p-size-dynamic-125: 1.125rem;
    --p-size-dynamic-150: 1.25rem;
    --p-size-dynamic-200: 1.563rem;
    --p-size-dynamic-250: 1.875rem;
    --p-size-dynamic-300: 2.188rem;
    --p-size-dynamic-400: 2.5rem;
    --p-size-dynamic-500: 3.125rem;
    --p-size-dynamic-600: 3.75rem;
    --p-size-dynamic-700: 4.375rem;
    /* Bundled TrygDesign heading scale uses --s-size-text-heading-* tokens. */
    --s-font-weight-heading-default: 300;
    --s-font-family-heading: "27Sans", "Fira Sans", Helvetica, Arial, sans-serif;
    --s-size-text-heading-large-default: 3.125rem;
    --s-size-text-heading-large-mobile: 2.188rem;
    --s-size-line-height-heading-large-default: 1.1;
    --s-size-line-height-heading-large-mobile: 1.1;
    --s-size-text-heading-medium-default: 1.875rem;
    --s-size-text-heading-medium-mobile: 1.563rem;
    --s-size-line-height-heading-medium-default: 1.333;
    --s-size-line-height-heading-medium-mobile: 1.333;
    --s-size-text-heading-small-default: 1.563rem;
    --s-size-text-heading-small-mobile: 1.25rem;
    --s-size-line-height-heading-small-default: 1.4;
    --s-size-line-height-heading-small-mobile: 1.4;
    --s-size-text-heading-xsmall-default: 1.25rem;
    --s-size-text-heading-xsmall-mobile: 0.938rem;
    --s-size-line-height-heading-xsmall-default: 1.5;
    --s-size-line-height-heading-xsmall-mobile: 1.5;
    --cms-page-background: #fff;
    --cms-surface-background: #fff;
    --cms-section-background-muted: #ededed;
    --cms-text-color: #262626;
    --cms-text-muted: #767676;
    --cms-heading-color: #262626;
    --cms-link-color: #ce0303;
    --cms-link-hover-color: #b00000;
    --cms-border-color: #e1e1e1;
    --cms-font-body: "27Sans", "Fira Sans", Helvetica, Arial, sans-serif;
    --cms-font-heading: "27Sans", "Fira Sans", Helvetica, Arial, sans-serif;
    --cms-section-width-narrow: 48.125rem;
    --cms-section-width-normal: 73.125rem;
    --cms-section-width-wide: none;
    --cms-section-spacing-small: 1.5rem;
    --cms-section-spacing-medium: 3rem;
    --cms-section-spacing-large: 4.5rem;
    --cms-content-gap: 1.5rem;
}

body.theme-tryg-dk .header.deck {
    position: relative;
}

/* Bundled styles-theme-tryg.css zeroes header inset at large breakpoints; match affinity.tryg.dk. */
body.theme-tryg-dk .header .w--wide {
    margin-inline: 0.938rem !important;
    margin-block: 0;
}

@media (min-width: 95em) {
    body.theme-tryg-dk .header .w--wide {
        margin-inline: 2.5rem !important;
    }
}

body.theme-tryg-dk .header .logo {
    display: inline-block;
    margin: 0.625rem 0;
    max-width: 6.563rem;
    position: relative;
    z-index: 10;
}

@media (min-width: 64em) {
    body.theme-tryg-dk .header .logo {
        margin: 1.063rem 6.25rem 1.063rem 0;
    }
}

@media (min-width: 64em) and (max-width: 71.25em) {
    body.theme-tryg-dk .header .logo {
        margin: 1.625rem 3.125rem 1.625rem 0;
    }
}

body.theme-tryg-dk .header .top-navigation-bg {
    display: none;
}

@media (min-width: 64em) {
    body.theme-tryg-dk .header .top-navigation-bg {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 0;
        width: 100%;
        height: 2.625rem;
        background-color: #ededed;
    }

    body.theme-tryg-dk .header .w--wide {
        position: relative;
        z-index: 1;
    }

    body.theme-tryg-dk .header .top-navigation {
        display: block;
        float: none;
        height: 2.625rem;
        text-align: right;
    }

    body.theme-tryg-dk .header .top-navigation .top-navigation__menu__item {
        display: inline-block;
        font-size: 1rem;
    }

    body.theme-tryg-dk .header .top-navigation .top-navigation__menu__item.is-active {
        background-color: #fff;
    }

    body.theme-tryg-dk .header .top-navigation .top-navigation__menu__item a {
        display: inline-block;
        padding: 0.625rem 1.25rem;
        text-transform: uppercase;
        font-size: 1rem;
        font-weight: 400;
        color: #262626;
    }

    body.theme-tryg-dk .header .top-navigation .top-navigation__menu__item.is-active a {
        font-weight: 700;
        color: #262626;
    }
}

body.theme-tryg-dk .header,
body.theme-tryg-dk .header .top-navigation,
body.theme-tryg-dk .header .main-navigation,
body.theme-tryg-dk .footer {
    font-family: "27Sans", "Fira Sans", Helvetica, Arial, sans-serif;
}

body.theme-tryg-dk.is-fixed {
    overflow: hidden;
}

body.theme-tryg-dk .header .logo img,
body.theme-tryg-dk .header .logo svg {
    display: block;
    max-width: 7.813rem;
    width: auto;
    height: auto;
}

body.theme-tryg-dk .header .main-navigation__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.theme-tryg-dk .header .login-wrapper ul.menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.theme-tryg-dk .flag-icon {
    background-size: contain;
    background-position: 50%;
    background-repeat: no-repeat;
    position: relative;
    display: inline-block;
    width: 1.33333333em;
    line-height: 1em;
}

body.theme-tryg-dk .flag-icon::before {
    content: "\00a0";
}

body.theme-tryg-dk .header .top-navigation__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.theme-tryg-dk .header .login-wrapper a {
    text-decoration: none;
}

body.theme-tryg-dk .header .main-navigation__menu a,
body.theme-tryg-dk .header .top-navigation__menu a {
    text-decoration: none;
}

/* Bundled styles-theme-tryg.css omits .sub-menu rules from TrygDesign. */
body.theme-tryg-dk .header .sub-menu .sub-menu__items {
    position: absolute;
    display: flex;
    flex-flow: column;
    opacity: 0;
    transform: translate(0, 10px);
    transition: opacity 200ms ease-in, transform 200ms ease-in, visibility 200ms ease-in;
    background-color: #fff;
    list-style: none;
    margin: 0;
    padding: 0;
    visibility: hidden;
}

body.theme-tryg-dk .header .sub-menu .sub-menu__item {
    flex: 1;
}

body.theme-tryg-dk .header .sub-menu .sub-menu__item > a {
    padding: 0.625rem 1.25rem;
    display: flex;
    color: #262626;
    text-decoration: none;
}

body.theme-tryg-dk .header .sub-menu .sub-menu__item:hover {
    background-color: #ededed;
}

body.theme-tryg-dk .header .sub-menu .sub-menu__item-text,
body.theme-tryg-dk .header .sub-menu .sub-menu__selected-item-text {
    padding-left: 0.625rem;
    color: #262626;
    white-space: nowrap;
}

body.theme-tryg-dk .header .sub-menu .sub-menu__selected-item {
    cursor: pointer;
    transform: translateY(-0.1rem);
}

body.theme-tryg-dk .header .sub-menu:hover .sub-menu__items {
    opacity: 1;
    transform: translate(0, 0);
    visibility: visible;
    box-shadow: 0.063rem 0.188rem 0.125rem 0.188rem rgba(83, 92, 94, 0.2);
}

body.theme-tryg-dk .header .sub-menu__selected-item-arrow {
    position: relative;
    top: 0.3rem;
}

body.theme-tryg-dk .header .sub-menu:hover svg {
    transform: rotate(90deg);
    transition: transform 0.2s ease;
}

@media (min-width: 64em) {
    body.theme-tryg-dk .header .sub-menu {
        position: relative;
        display: inline-block;
        vertical-align: top;
        padding: 0 2.188rem 0 1.25rem;
    }

    body.theme-tryg-dk .header .sub-menu .sub-menu__items {
        right: 0;
        top: 100%;
        z-index: 20;
        min-width: 100%;
    }
}

@media (max-width: 63.99em) {
    body.theme-tryg-dk .header .sub-menu {
        position: relative;
        display: inline-block;
        vertical-align: top;
        padding: 0.75rem 2.188rem 1.125rem 1.25rem;
    }

    body.theme-tryg-dk .header .sub-menu .sub-menu__selected-item {
        transform: translateY(-0.4rem);
    }
}

body.theme-tryg-dk .footer__bottom__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.theme-trygghansa-se {
    --cms-page-background: var(--th-theme-background-base, #fff);
    --cms-surface-background: var(--th-theme-fill-white, #fff);
    --cms-section-background-muted: var(--th-theme-background-alternative, #f9f9f9);
    --cms-text-color: var(--th-theme-text-weak, #4a4a4a);
    --cms-text-muted: var(--th-theme-text-weak, #4a4a4a);
    --cms-heading-color: var(--th-theme-text-strong, #191919);
    --cms-link-color: var(--th-theme-text-brand, #e50000);
    --cms-link-hover-color: var(--th-theme-fill-brand-hover, #db0000);
    --cms-border-color: var(--th-theme-stroke-weak, #dedede);
    --cms-font-body: var(--th-theme-family-body, Arial, Helvetica, sans-serif);
    --cms-font-heading: var(--th-theme-family-heading, "ApexNew", Arial, Helvetica, sans-serif);
    --cms-section-width-narrow: 48rem;
    --cms-section-width-normal: 74rem;
    --cms-section-width-wide: 82rem;
    --cms-section-spacing-small: 1.5rem;
    --cms-section-spacing-medium: 3.5rem;
    --cms-section-spacing-large: 5rem;
    --cms-content-gap: 1.75rem;
}

body.theme-trygghansa-se .th-language-picker {
    position: relative;
}

body.theme-trygghansa-se .th-language-picker .selected-language {
    position: relative;
}

body.theme-trygghansa-se .th-language-picker .languages {
    right: 0;
    top: 100%;
    z-index: 20;
    visibility: hidden;
    list-style: none;
    margin: 0;
    padding: 0;
}

body.theme-trygghansa-se .th-footer__logo-icon {
    object-fit: none;
}

body.theme-trygghansa-se .th-language-picker:hover .languages {
    visibility: visible;
}

body.theme-trygghansa-se .th-language-picker .languages .language > a {
    color: #262626;
}

body.theme-trygghansa-se .th-header__nav-item .menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Trygg-Hansa's own reset only sets border-box under #content; CMS blocks render
   inside .cms-column, so full-width th-* elements + padding overflow on mobile
   without this. */
body.theme-trygghansa-se .cms-column *,
body.theme-trygghansa-se .cms-column *::before,
body.theme-trygghansa-se .cms-column *::after {
    box-sizing: border-box;
}

body.theme-tryg-no {
    --cms-page-background: #f8faf6;
    --cms-surface-background: #fff;
    --cms-section-background-muted: #f1f1f1;
    --cms-text-color: #222222;
    --cms-text-muted: #5a5a5a;
    --cms-heading-color: #222222;
    --cms-link-color: #ce0303;
    --cms-link-hover-color: #ce0303;
    --cms-border-color: #e1e1e1;
    --cms-font-body: "27 Sans", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --cms-font-heading: "27 Sans", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --cms-section-width-narrow: 48rem;
    --cms-section-width-normal: 71.25rem;
    --cms-section-width-wide: 100rem;
    --cms-section-spacing-small: 1.5rem;
    --cms-section-spacing-medium: 2.75rem;
    --cms-section-spacing-large: 4rem;
    --cms-content-gap: 1.25rem;
}

/* Mobile section rhythm — shrink vertical padding so blocks aren't stranded
   by desktop spacing on small screens. */
@media (max-width: 768px) {
    body.theme-tryg-dk {
        --cms-section-spacing-medium: 2rem;
        --cms-section-spacing-large: 2.5rem;
    }

    body.theme-trygghansa-se {
        --cms-section-spacing-medium: 2rem;
        --cms-section-spacing-large: 2.5rem;
    }

    body.theme-tryg-no {
        --cms-section-spacing-medium: 1.5rem;
        --cms-section-spacing-large: 2rem;
    }
}

body[class*="theme-"] .cms-section {
    color: var(--cms-text-color);
}

body[class*="theme-"] .cms-section--background-muted {
    background-color: var(--cms-section-background-muted);
}

body[class*="theme-"] .cms-rich-text {
    color: var(--cms-text-color);
    font-family: var(--cms-font-body);
}

body[class*="theme-"] .cms-rich-text h1,
body[class*="theme-"] .cms-rich-text h2,
body[class*="theme-"] .cms-rich-text h3,
body[class*="theme-"] .cms-rich-text h4,
body[class*="theme-"] .cms-rich-text h5,
body[class*="theme-"] .cms-rich-text h6 {
    color: var(--cms-heading-color);
    font-family: var(--cms-font-heading);
    line-height: 1.15;
}

/* TinyMCE's frame keeps the browser heading margins. Brand CSS resets them. */
body[class*="theme-"] .cms-rich-text h1 { --cms-rich-text-heading-margin: 0.67em; }
body[class*="theme-"] .cms-rich-text h2 { --cms-rich-text-heading-margin: 0.83em; }
body[class*="theme-"] .cms-rich-text h3 { --cms-rich-text-heading-margin: 1em; }
body[class*="theme-"] .cms-rich-text h4 { --cms-rich-text-heading-margin: 1.33em; }
body[class*="theme-"] .cms-rich-text h5 { --cms-rich-text-heading-margin: 1.67em; }
body[class*="theme-"] .cms-rich-text h6 { --cms-rich-text-heading-margin: 2.33em; }

body[class*="theme-"] .cms-rich-text :is(h1, h2, h3, h4, h5, h6) {
    margin-block: var(--cms-rich-text-heading-margin);
}

body.theme-tryg-no .paragraph.rich-text .text.description.cms-rich-text :is(h1, h2, h3, h4, h5, h6) {
    margin-block: var(--cms-rich-text-heading-margin);
}

body[class*="theme-"] .cms-rich-text > :first-child {
    margin-block-start: 0;
}

body[class*="theme-"] .cms-rich-text > :last-child {
    margin-block-end: 0;
}

body.theme-tryg-no .paragraph.rich-text .text.description.cms-rich-text > :first-child {
    margin-block-start: 0;
}

body.theme-tryg-no .paragraph.rich-text .text.description.cms-rich-text > :last-child {
    margin-block-end: 0;
}

body[class*="theme-"] .cms-rich-text a {
    color: var(--cms-link-color);
}

body[class*="theme-"] .cms-rich-text a:hover,
body[class*="theme-"] .cms-rich-text a:focus {
    color: var(--cms-link-hover-color);
}

body[class*="theme-"] .cms-rich-text hr {
    border: 0;
    border-top: 1px solid var(--cms-border-color);
}

body[class*="theme-"] .cms-rich-text ul,
body[class*="theme-"] .cms-rich-text ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

body[class*="theme-"] .cms-rich-text ul {
    list-style: disc outside;
}

body[class*="theme-"] .cms-rich-text ol {
    list-style: decimal outside;
}

body[class*="theme-"] .cms-rich-text ul li::before,
body[class*="theme-"] .cms-rich-text ol li::before {
    content: none;
}

body[class*="theme-"] .cms-rich-text strong,
body[class*="theme-"] .cms-rich-text b {
    font-weight: 700;
}

body[class*="theme-"] .cms-hero__heading {
    color: var(--cms-heading-color);
    font-family: var(--cms-font-heading);
}

body[class*="theme-"] .cms-hero__body {
    color: var(--cms-text-muted);
    font-family: var(--cms-font-body);
}

body[class*="theme-"] .cms-hero--full.cms-hero--has-image .cms-hero__heading,
body[class*="theme-"] .cms-hero--full.cms-hero--has-image .cms-hero__body {
    color: #fff;
}

body[class*="theme-"] .cms-hero--splitted .cms-hero__heading {
    color: var(--cms-heading-color);
}

body[class*="theme-"] .cms-hero--splitted .cms-hero__body {
    color: var(--cms-text-color);
}

body.theme-tryg-dk .cms-hero--splitted,
body.theme-tryg-dk .cms-hero--splitted::after {
    background-color: #e8e8e8;
}

body[class*="theme-"] .cms-hero__button {
    background-color: var(--cms-link-color);
    color: #fff;
}

body[class*="theme-"] .cms-hero__button:hover,
body[class*="theme-"] .cms-hero__button:focus {
    background-color: var(--cms-link-hover-color);
}

body[class*="theme-"] .cms-button--primary {
    background-color: var(--cms-link-color);
    color: #fff;
}

body[class*="theme-"] .cms-button--primary:hover,
body[class*="theme-"] .cms-button--primary:focus {
    background-color: var(--cms-link-hover-color);
    color: #fff;
}

body[class*="theme-"] .cms-button--secondary {
    background-color: transparent;
    color: var(--cms-link-color);
    border-color: var(--cms-link-color);
}

body[class*="theme-"] .cms-button--secondary:hover,
body[class*="theme-"] .cms-button--secondary:focus {
    background-color: var(--cms-link-color);
    color: #fff;
}

body[class*="theme-"] .cms-page-teaser__body,
body[class*="theme-"] .cms-page-teaser__bottom-text,
body[class*="theme-"] .cms-cta__body,
body[class*="theme-"] .cms-card,
body[class*="theme-"] .cms-accordion__body {
    color: var(--cms-text-color);
    font-family: var(--cms-font-body);
}

body[class*="theme-"] .cms-link-card__title,
body[class*="theme-"] .cms-card__heading,
body[class*="theme-"] .cms-accordion__title,
body[class*="theme-"] .cms-cta__title {
    font-family: var(--cms-font-heading);
}

body.theme-tryg-dk .cms-button {
    border-radius: 0.25rem;
}

body.theme-trygghansa-se .cms-button {
    border-radius: 0.625rem;
}

body.theme-tryg-no .cms-button {
    border-radius: 0.25rem;
}

body.theme-tryg-no {
    background-color: var(--cms-page-background);
}

body.theme-tryg-no .cms-section--hero-flush-top {
    padding-block-start: 0;
}

body.theme-tryg-no .cms-section--hero-only {
    padding-block: 0;
}

body.theme-tryg-no .cms-section--hero-flush-top > .cms-section__inner:has(.banner.hero-banner-height-leftside),
body.theme-tryg-no .cms-section--hero-only > .cms-section__inner:has(.banner.hero-banner-height-leftside) {
    max-width: none;
    padding-inline: 0;
}

body.theme-tryg-no .cms-section--hero-flush-top > .cms-section__content:has(.banner.hero-banner-height-leftside),
body.theme-tryg-no .cms-section--hero-only > .cms-section__content:has(.banner.hero-banner-height-leftside) {
    gap: 0;
}

body.theme-tryg-no .cms-section--hero-flush-top > .cms-section__content:has(.banner.hero-banner-height-leftside) > .cms-column,
body.theme-tryg-no .cms-section--hero-only > .cms-section__content:has(.banner.hero-banner-height-leftside) > .cms-column {
    flex: 1 1 100%;
    max-width: 100%;
}

/* Link card — Tryg NO claim shortcut. Matches the live button card:
   icon, light title, chevron, 6rem white tile with a hairline border. */
body.theme-tryg-no .cms-link-card {
    position: relative;
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    align-items: center;
    column-gap: 0.5rem;
    box-sizing: border-box;
    width: 100%;
    min-height: 6rem;
    height: 100%;
    padding: 0.625rem 3rem 0.625rem 0.9375rem;
    background-color: #fff;
    border: 0.125rem solid #e1e1e1;
    border-radius: 0.5rem;
    color: #222;
    text-decoration: none;
}

body.theme-tryg-no .cms-link-card:hover {
    background-color: #f0ece4;
    border-color: #e8e2d5;
    color: #222;
    text-decoration: none;
}

body.theme-tryg-no .cms-link-card:focus {
    border-width: 0.25rem;
    border-color: #5a5a5a;
    background-color: #e8e2d5;
    outline: none;
}

body.theme-tryg-no .cms-link-card::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 1.5rem;
    height: 1.5rem;
    transform: translateY(-50%) rotate(-90deg);
    background-color: #222;
    -webkit-mask: url("/themes/tryg-no/svg/svg/tryg-icon-chevron-down-24.svg") center / contain no-repeat;
    mask: url("/themes/tryg-no/svg/svg/tryg-icon-chevron-down-24.svg") center / contain no-repeat;
}

body.theme-tryg-no .cms-link-card__icon {
    display: block;
    grid-column: 1;
    grid-row: 1 / -1;
    width: 3rem;
    height: 3rem;
}

body.theme-tryg-no .cms-link-card__icon img {
    display: block;
    width: 3rem;
    height: 3rem;
    object-fit: contain;
}

body.theme-tryg-no .cms-link-card__title {
    grid-column: 2;
    margin-bottom: 0;
    font-family: "27 Sans", sans-serif;
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1.5rem;
    color: #222;
}

body.theme-tryg-no .cms-link-card__body {
    grid-column: 2;
    font-family: "27 Sans", sans-serif;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #5a5a5a;
}

/* Link card — Tryg DK product tile. Icon above a regular label on a white card. */
body.theme-tryg-dk .cms-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-height: 7.875rem;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: #222;
    background-color: #fff;
    border: 0;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(34, 34, 34, 0.08);
}

body.theme-tryg-dk .cms-link-card:hover,
body.theme-tryg-dk .cms-link-card:focus {
    color: #222;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(34, 34, 34, 0.12);
}

body.theme-tryg-dk .cms-link-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
}

body.theme-tryg-dk .cms-link-card__icon img {
    display: block;
    width: 3rem;
    height: 3rem;
    object-fit: contain;
}

body.theme-tryg-dk .cms-link-card__title {
    margin-bottom: 0;
    font-family: "Source Sans Pro", "27Sans", Helvetica, Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4;
    color: #222;
}

body.theme-tryg-dk .cms-link-card__body {
    font-family: "Source Sans Pro", "27Sans", Helvetica, Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.3;
    color: #5a5a5a;
}

/* Link card sits in a CMS column. The theme card is capped at 19.875rem and
   the icon sprite rules are commented out, so size the card to the column and
   mask the icon from the path set on the element. */
body.theme-trygghansa-se .cms-column .th-cards {
    height: 100%;
    margin-block-end: 0;
}

body.theme-trygghansa-se .cms-column .th-cards__item {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
}

body.theme-trygghansa-se .cms-column .th-card {
    box-sizing: border-box;
    flex: 1 1 auto;
    max-width: none;
}

body.theme-trygghansa-se .th-card__icon:before {
    -webkit-mask-size: contain;
    mask-size: contain;
}

body.theme-tryg-no #Header .search-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.75rem;
    color: #222;
    text-decoration: none;
    font-family: "27 Sans", sans-serif;
    font-size: 0.875rem;
}

body.theme-tryg-no #Header .search-menu-icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    background: url("/themes/tryg-no/svg/svg/tryg-icon-magnifier.svg") center / contain no-repeat;
}

/* Facts list — full-width brand-story band on the row/column that contains it */
body[class*="theme-"] .cms-section:has(.brand-story__headline.grid__col) {
    padding-block: 0;
}

body[class*="theme-"] .cms-section__content:has(.brand-story__headline.grid__col) {
    max-width: none;
    padding-inline: 0;
}

body[class*="theme-"] .cms-section__content:has(.brand-story__headline.grid__col) > *:has(.brand-story__headline.grid__col) {
    flex: 0 0 100%;
}

/* Section padding is flush for the red band; restore row spacing on the last (only) row. */
body[class*="theme-"] .cms-section:has(.brand-story__headline.grid__col) > .cms-section__content:last-child.cms-row--spacing-small {
    margin-block-end: var(--cms-row-gap-small);
}

body[class*="theme-"] .cms-section:has(.brand-story__headline.grid__col) > .cms-section__content:last-child.cms-row--spacing-medium {
    margin-block-end: var(--cms-row-gap);
}

body[class*="theme-"] .cms-section:has(.brand-story__headline.grid__col) > .cms-section__content:last-child.cms-row--spacing-large {
    margin-block-end: var(--cms-row-gap-large);
}

/* Tryg DK — brand-story two-column layout (Affinity quick-facts / TrygDesign grid) */
body.theme-tryg-dk .cms-facts-list.deck.brand-story > div:has(> .brand-story__inner.grid) {
    width: 100%;
    margin-inline: auto;
    box-sizing: border-box;
    max-width: 48.125rem;
}

body.theme-tryg-dk .cms-facts-list .brand-story__inner.grid {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;
    margin: 0;
}

body.theme-tryg-dk .cms-facts-list .brand-story__headline.grid__col,
body.theme-tryg-dk .cms-facts-list .brand-story__content.grid__col {
    box-sizing: border-box;
    flex: 0 1 100%;
    margin-left: 1.25%;
    margin-right: 1.25%;
}

@media (min-width: 64em) {
    body.theme-tryg-dk .cms-facts-list.deck.brand-story > div:has(> .brand-story__inner.grid) {
        max-width: 46.25rem;
    }

    body.theme-tryg-dk .cms-facts-list .brand-story__inner.grid {
        align-items: flex-start;
    }

    body.theme-tryg-dk .cms-facts-list .brand-story__headline.grid__col.grid__col--md-6,
    body.theme-tryg-dk .cms-facts-list .brand-story__content.grid__col.grid__col--md-6 {
        flex: 0 1 47.5%;
        align-self: flex-start;
    }

    body.theme-tryg-dk .cms-facts-list .brand-story__headline.grid__col {
        max-width: 29.375rem;
    }
}

@media (min-width: 48em) and (max-width: 63.99em) {
    body.theme-tryg-dk .cms-facts-list .brand-story__headline.grid__col {
        margin-bottom: 1.25rem;
    }
}

body.theme-tryg-dk .cms-facts-list.brand-story .brand-story__headline :is(h3, p) {
    color: inherit;
    margin: 0;
    font: 400 1.563rem/1.333 var(--cms-font-heading);
}

@media (min-width: 48em) {
    body.theme-tryg-dk .cms-facts-list.brand-story .brand-story__headline :is(h3, p) {
        font-size: 1.875rem;
    }
}

body.theme-tryg-dk .cms-facts-list.brand-story .brand-story__headline :is(h3, p) strong {
    font-weight: 700;
}

/* Tryg DK — usp-list icon offset (bundle uses --p-size-dynamic-* tokens above) */
body.theme-tryg-dk .cms-facts-list.brand-story .usp-list__item {
    position: relative;
    margin-top: 1.25rem;
}

body.theme-tryg-dk .cms-facts-list.brand-story .usp-list__item:first-child {
    margin-top: 0.625rem;
}

body.theme-tryg-dk .cms-facts-list.brand-story .usp-list__item .icon {
    position: absolute;
    top: 0;
    left: 0;
}

body.theme-tryg-dk .cms-facts-list.brand-story .usp-list .headline,
body.theme-tryg-dk .cms-facts-list.brand-story .usp-list .body {
    padding-left: 3.125rem;
    padding-right: 0.938rem;
}

body.theme-tryg-dk .cms-facts-list.brand-story .usp-list .headline {
    font-weight: bold;
}

@media (max-width: 47.99em) {
    body.theme-tryg-dk .cms-facts-list.brand-story .usp-list {
        margin-top: 1.875rem;
    }
}

body.theme-tryg-dk .cms-facts-list.brand-story .svg-icon {
    fill: currentColor;
}

/* Spacing after splitted hero — matches .hero.simple + .deck.brand-story in TrygDesign */
body.theme-tryg-dk .cms-section:has(.cms-hero--splitted) + .cms-section:has(.brand-story__headline.grid__col) .cms-facts-list.deck.brand-story {
    margin-top: 2.5rem;
}

@media (min-width: 64em) {
    body.theme-tryg-dk .cms-section:has(.cms-hero--splitted) + .cms-section:has(.brand-story__headline.grid__col) .cms-facts-list.deck.brand-story {
        margin-top: 5rem;
    }
}

/*
   Trygg-Hansa hero — match dxctest full-bleed th-section layout.
   The image is absolutely positioned at 50% of the full-width row, not the
   centered th-container, so the row must be the positioning context.
*/
body.theme-trygghansa-se .cms-section:has(.th-cta-image-block) {
    padding-block-start: 0;
}

body.theme-trygghansa-se .cms-section__inner:has(.th-cta-image-block) {
    position: relative;
    z-index: 0;
    max-width: none;
    width: 100%;
    padding-inline: 0;
    gap: 0;
    overflow: hidden;
}

body.theme-trygghansa-se .cms-section__inner:has(.th-cta-image-block) .cms-column {
    flex: 0 0 100%;
    max-width: none;
}

body.theme-trygghansa-se .cms-section__inner:has(.th-cta-image-block) .th-cta-image-block {
    max-width: 90rem;
    margin-inline: auto;
}

@media (min-width: 1024px) {
    body.theme-trygghansa-se .cms-section__inner:has(.th-cta-image-block) {
        min-height: 22.875rem;
        display: flex;
        align-items: stretch;
    }

    body.theme-trygghansa-se .cms-section__inner:has(.th-cta-image-block) .cms-column {
        display: flex;
        align-items: center;
    }

    body.theme-trygghansa-se .cms-section__inner:has(.th-cta-image-block) .cms-column > div {
        width: 100%;
    }

    body.theme-trygghansa-se .cms-section__inner:has(.th-cta-image-block) .th-cta-image-block {
        width: 100%;
        min-height: 22.875rem;
    }
}

body.theme-trygghansa-se .th-cta-image-block__image {
    margin-block-start: 0;
}

body.theme-trygghansa-se .th-cta-image-block__image picture,
body.theme-trygghansa-se .th-cta-image-block__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    margin-inline-start: 0;
}

/* Intro band — grey full-bleed row like dxctest th-section deck--collapse-bottom */
body.theme-trygghansa-se .cms-section__inner:has(.th-intro-band) {
    position: relative;
    z-index: 1;
    max-width: none;
    width: 100%;
    padding-inline: 0;
    padding-block: 2.5rem;
    background-color: var(--cms-section-background-muted);
}

/* Bottom CTA row — heading + accent buttons like dxctest th-cta-text-block */
@media (min-width: 1024px) {
    body.theme-trygghansa-se .cms-section__inner:has(.th-block__introduction h1):has(.th-button-primary-accent) {
        flex-wrap: nowrap;
        align-items: center;
        column-gap: 1.25rem;
    }

    body.theme-trygghansa-se .cms-section__inner:has(.th-block__introduction h1):has(.th-button-primary-accent) > .cms-column {
        flex: 0 1 auto;
        width: auto;
        max-width: none;
    }

    body.theme-trygghansa-se .cms-section__inner:has(.th-block__introduction h1):has(.th-button-primary-accent) > .cms-column:first-child {
        flex: 1 1 auto;
    }

    body.theme-trygghansa-se .cms-section__inner:has(.th-block__introduction h1):has(.th-button-primary-accent) .th-button-medium {
        align-self: center;
        min-width: fit-content;
    }
}

@media (min-width: 1024px) {
    body.theme-trygghansa-se .cms-section__inner:has(.th-intro-band) {
        padding-block: 4.6875rem;
    }
}

body.theme-trygghansa-se .cms-facts-list.th-quick-facts-block {
    width: 100%;
}

body.theme-tryg-no .cms-facts-list.deck.brand-story {
    padding-block: 3rem;
}

/* Tryg NO — brand-story / usp-list (from TrygDesign; not in NO theme bundle) */
body.theme-tryg-no .cms-facts-list.brand-story {
    background-color: #ce0303;
    color: #fff;
}

body.theme-tryg-no .cms-facts-list.brand-story--grey {
    background-color: #535c5e;
    color: #fff;
}

body.theme-tryg-no .cms-facts-list.brand-story--grey-light {
    background-color: #e1e1e1;
    color: #262626;
}

body.theme-tryg-no .cms-facts-list.brand-story a {
    color: inherit;
}

body.theme-tryg-no .cms-facts-list.brand-story .svg-icon {
    fill: currentColor;
}

body.theme-tryg-no .cms-facts-list .brand-story__inner.grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto;
    max-width: 73.125rem;
    padding-inline: 1rem;
    gap: 1.5rem;
}

body.theme-tryg-no .cms-facts-list .brand-story__headline,
body.theme-tryg-no .cms-facts-list .brand-story__content {
    flex: 1 1 100%;
}

@media (min-width: 48em) {
    body.theme-tryg-no .cms-facts-list .brand-story__headline,
    body.theme-tryg-no .cms-facts-list .brand-story__content {
        flex: 1 1 calc(50% - 0.75rem);
    }
}

body.theme-tryg-no .cms-facts-list .usp-list__item {
    position: relative;
    margin-top: 1.25rem;
}

body.theme-tryg-no .cms-facts-list .usp-list__item:first-child {
    margin-top: 0.625rem;
}

body.theme-tryg-no .cms-facts-list .usp-list__item .icon {
    position: absolute;
    top: 0;
    left: 0;
}

body.theme-tryg-no .cms-facts-list .usp-list .headline,
body.theme-tryg-no .cms-facts-list .usp-list .body {
    padding-left: 3.125rem;
}

body.theme-tryg-no .cms-facts-list .usp-list .headline {
    font-weight: 700;
}

