/* Design tokens — mirrors toujou's own CSS custom-property naming (see design-reference/tokens.md) */
:root {
    --primary-color: #004122;
    --primary-color--light: #315056;
    --primary-color--dark: #5D767D;

    --secondary-color: #47474A;
    --secondary-color--dark: #282826;
    --secondary-color--light: #FFFFFF;

    --font-color: #47474A;
    --font-color--dark: #282826;
    --font-color--light: #6B6B6F;

    --bg-color: #FFFFFF;
    --nav-color-bg: #FFFFFF;
    --nav-color-item: #47474A;
    --nav-color-highlight: #004122;
    --nav-color-icon: #FFFFFF;

    --success-color: #5CA52C;
    --error-color: #FF6A1A;
    --warning-color: #FFBB00;

    --font-family: "Segoe UI Light", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    --headline__weight: 700;
    --paragraph__normal: 500;
    --paragraph__bold: 700;

    --max-content-width: 1200px;
    --spacing-unit: 1rem;
    --measure: 68ch;
    --rule-color: rgba(0, 65, 34, 0.18);
    --rule-color--strong: var(--primary-color);
    --section-gap: clamp(2.75rem, 5vw, 4.5rem);
    /* sticky header height + breathing room, so anchor jumps land below it */
    --anchor-offset: 8.5rem;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    accent-color: var(--primary-color);
    caret-color: var(--primary-color);
    scrollbar-color: var(--primary-color--light) #f1f1ef;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

::selection {
    background: rgba(0, 65, 34, 0.16);
    color: var(--font-color--dark);
}

[id],
h1, h2, h3 {
    scroll-margin-top: var(--anchor-offset);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 200;
    background: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1.25rem;
    font-weight: var(--paragraph__bold);
}

.skip-link:focus {
    top: 0.75rem;
}

main:focus {
    outline: none;
}

body {
    margin: 0;
    font-family: var(--font-family);
    font-weight: var(--paragraph__normal);
    color: var(--font-color);
    background: var(--bg-color);
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

a, button, input, select, textarea, label {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4 {
    font-weight: var(--headline__weight);
    color: var(--primary-color);
    line-height: 1.2;
    margin: 0 0 1rem;
    text-wrap: balance;
}

h1 { font-size: clamp(1.75rem, 3vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; text-wrap: pretty; }

/* Inline links in editorial content: visibly links, in brand green */
.frame a:not(.btn) {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: text-decoration-thickness 0.15s ease, color 0.15s ease;
}

.frame a:not(.btn):hover {
    color: var(--font-color--dark);
    text-decoration-thickness: 2px;
}

/* Comfortable reading measure for running text */
.frame p,
.frame ul,
.frame ol {
    max-width: var(--measure);
}

/* Legal texts (privacy policy): section headings inside the running text need air above them */
.frame-legal-text > h2 {
    font-size: 1.35rem;
    margin-top: 2.5rem;
    max-width: var(--measure);
}

.frame-legal-text li {
    margin-bottom: 0.35rem;
}

.container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Buttons (matches live site: square corners, primary-color fill) */
.btn,
a.btn,
.frame-type-html .btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    font-family: var(--font-family);
    font-weight: var(--paragraph__bold);
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: 0;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}

.btn:hover {
    background: var(--primary-color--light);
}

/* Hero image (homepage only) — fades out via JS as the visitor scrolls, see main.js */
.hero-fade {
    width: 100%;
    max-height: 65vh;
    overflow: hidden;
    will-change: opacity;
}

.hero-fade img {
    width: 100%;
    height: 100%;
    max-height: 65vh;
    object-fit: cover;
    display: block;
}

@media (max-width: 600px) {
    .hero-fade,
    .hero-fade img {
        max-height: 40vh;
    }
}

/* Header */
.site-header {
    background: var(--nav-color-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.site-header__row {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--font-color);
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header.nav-is-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header.nav-is-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

.site-header.nav-is-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-header__row--1 {
    padding-bottom: 0.4rem;
}

.site-header__row--2 {
    padding-top: 0.4rem;
    justify-content: flex-end;
    gap: 1rem;
    font-size: 0.9rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    background: var(--bg-color);
}

.site-header__logo img {
    width: 165px;
    height: auto;
    flex-shrink: 0;
}

/* Top-level list only: scoping with ">" keeps this display:flex from
   overriding the submenu's own display rules (mobile accordion). */
.main-nav > ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.main-nav li {
    position: relative;
}

.main-nav__item {
    display: flex;
    align-items: center;
}

.main-nav a {
    color: var(--nav-color-item);
    font-weight: var(--paragraph__bold);
    font-size: 0.95rem;
    padding: 0.5rem 0;
    display: inline-block;
    white-space: nowrap;
}

.main-nav li:hover .main-nav__item > a,
.main-nav li.is-active .main-nav__item > a {
    color: var(--nav-color-highlight);
}

.main-nav__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--nav-color-item);
    font-size: 1.3rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.main-nav li.is-open > .main-nav__item > .main-nav__toggle {
    transform: rotate(90deg);
}

/* drawn chevron (points right; the button rotates it down when open) */
.main-nav__chevron {
    display: block;
    width: 0.5rem;
    height: 0.5rem;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(-45deg);
}

/* desktop: small down-chevron after items that open a flyout */
@media (min-width: 1200px) {
    .main-nav li.has-children > .main-nav__item > a::after {
        content: "";
        display: inline-block;
        width: 0.35rem;
        height: 0.35rem;
        margin: 0 0 0.2rem 0.45rem;
        border: solid currentColor;
        border-width: 0 1.5px 1.5px 0;
        transform: rotate(45deg);
        vertical-align: middle;
    }
}

.main-nav__sub li.is-active > a,
.main-nav__group li.is-active > a {
    color: var(--nav-color-highlight);
}

/* solution pages grouped under their overview page */
.main-nav__group {
    list-style: none;
    margin: 0 0 0.35rem;
    padding: 0;
}

.main-nav .main-nav__group a {
    font-weight: var(--paragraph__normal);
    padding-left: 2rem;
}

.main-nav__sub {
    list-style: none;
    margin: 0;
    display: flex;
    position: absolute;
    /* anchored directly to the hovered tab (no gap), and layered above row 2
       so it can overlay it without ever breaking the hover chain */
    left: 0;
    top: 100%;
    background: var(--bg-color);
    border: 1px solid rgba(0, 0, 0, 0.08);
    min-width: 220px;
    flex-direction: column;
    padding: 0.5rem 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 30;
}

.main-nav li:hover > .main-nav__sub,
.main-nav li:focus-within > .main-nav__sub {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Escape closes a flyout even while focus stays inside it (see main.js) */
.main-nav li.is-dismissed > .main-nav__sub {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.main-nav__sub li {
    width: 100%;
}

.main-nav__sub {
    width: max-content;
    max-width: 22rem;
}

/* flyouts of the last items open leftwards, so they never run off the viewport */
.main-nav > ul > li:nth-last-child(-n + 2) > .main-nav__sub {
    left: auto;
    right: 0;
}

.main-nav__sub a {
    display: block;
    padding: 0.6rem 1.1rem;
    white-space: normal;
    line-height: 1.35;
}

.main-nav__sub a:hover,
.main-nav__sub a:focus-visible {
    background: rgba(0, 65, 34, 0.08);
    color: var(--nav-color-highlight);
}

.service-nav__phone,
.service-nav__cta {
    display: inline-flex;
    align-items: center;
}

.service-nav__cta {
    background: var(--primary-color);
    color: #fff;
    padding: 0.6rem 1.25rem;
    font-weight: var(--paragraph__bold);
}

.service-nav__cta:hover {
    background: var(--primary-color--light);
}

/* Language switcher */
.lang-switch {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.35rem;
    border-left: 1px solid rgba(0, 0, 0, 0.12);
    padding-left: 0.85rem;
}

.lang-switch__item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.4rem;
    border-radius: 3px;
    font-weight: var(--paragraph__bold);
    font-size: 0.8rem;
    color: var(--font-color);
}

/* inactive language: muted via the flag only, the text keeps AA contrast */
.lang-switch__item:not(.is-active) .lang-switch__flag {
    filter: saturate(0.4);
    opacity: 0.7;
}

.lang-switch__item:hover {
    color: var(--primary-color);
}

.lang-switch__item:hover .lang-switch__flag {
    filter: none;
    opacity: 1;
}

.lang-switch__item.is-active {
    color: var(--primary-color);
    background: rgba(0, 65, 34, 0.08);
}

.lang-switch__flag {
    width: 20px;
    height: 12px;
    display: block;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.lang-switch__code {
    letter-spacing: 0.02em;
}

/* Footer */
.site-footer {
    background: var(--secondary-color--dark);
    color: #fff;
    margin-top: 4rem;
}

.site-footer__top {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.site-footer__logo {
    width: 160px;
    height: auto;
    /* RGBA logo: render as a pure white silhouette for contrast on the dark footer */
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

/* "Leistungsspektrum": each service is its own content element (frame_class = leistung-tile).
   Rendered as rows of a catalogue index: name left, description + link right, hairline between. */
.frame.frame-leistung-tile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: clamp(1.5rem, 4vw, 4rem);
    align-items: baseline;
    margin-bottom: 0;
    padding-top: 1.35rem;
    padding-bottom: 1.35rem;
}

/* hairline on the content edge, not across the frame's side padding */
.frame-leistung-tile,
.frame-leistung-tile + .frame:not(.frame-leistung-tile) {
    background: linear-gradient(var(--rule-color), var(--rule-color)) center top / calc(100% - 3rem) 1px no-repeat;
}

.frame-leistung-tile + .frame:not(.frame-leistung-tile) {
    padding-top: clamp(2.5rem, 5vw, 4rem);
}

.frame-leistung-tile > header h2,
.frame-leistung-tile > header h3 {
    margin: 0;
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
}

.frame-leistung-tile > p {
    grid-column: 2;
    margin: 0 0 0.5rem;
}

.frame-leistung-tile > p:last-child {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .frame-leistung-tile {
        grid-template-columns: minmax(0, 1fr);
    }

    .frame-leistung-tile > p {
        grid-column: 1;
    }

    .frame-leistung-tile > header h2,
    .frame-leistung-tile > header h3 {
        margin-bottom: 0.5rem;
    }
}

.site-footer__contact {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.site-footer__address {
    font-style: normal;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.site-footer__social {
    margin-left: auto;
}

.site-footer__legal {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 1rem 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
}

.site-footer__legal nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

/* FAQ (also mirrored as FAQPage structured data — see Templates/Default.html) */
.faq {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem 2rem;
    margin-top: 1rem;
}

.faq__item h3 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.faq__item p {
    margin: 0;
    color: var(--font-color);
}

/* Content element spacing baseline */
.frame {
    margin: 0 auto var(--section-gap);
    max-width: var(--max-content-width);
    padding: 0 1.5rem;
}

.frame > header h2 {
    margin-bottom: 1.25rem;
}

main > .frame:first-child {
    margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.hero-fade {
    margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

/* Full-width page header image (first element of inner pages) */
.content-image--header {
    width: 100%;
    aspect-ratio: 3 / 1;
    object-fit: cover;
    object-position: center 30%;
    margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

/* renderings that must be seen whole */
.content-image--header.is-full {
    aspect-ratio: auto;
    height: auto;
    object-fit: contain;
}

/* photos that need more height than the 3:1 band (people, groups) */
.content-image--header.is-wide {
    aspect-ratio: 2 / 1;
}

/* ---------- Text + image split ----------
   The editor wraps a content image in its own <p>. On wide screens that image
   floats beside the text (alternating sides); every other child becomes its own
   block formatting context, so it sits in a clean column next to the image
   instead of wrapping around it. */
.frame-type-text > p:has(> .content-image:not(.content-image--header)) {
    margin-bottom: 1.5rem;
}

/* the <p> around an image or video must not inherit the text measure */
.frame p:has(> img),
.frame p:has(> video) {
    max-width: none;
}

/* a video takes an image's place in the text + image split */
video.content-image {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
}

@media (min-width: 900px) {
    .frame-type-text:has(> p > .content-image:not(.content-image--header)):not(:has(.team-member)) {
        display: flow-root;
    }

    .frame-type-text:has(> p > .content-image:not(.content-image--header)):not(:has(.team-member)) > p:has(> .content-image:not(.content-image--header)) {
        float: left;
        width: min(42%, 32rem);
        margin: 0.35rem clamp(2rem, 4vw, 3.5rem) 1rem 0;
    }

    .frame-type-text:has(> p > .content-image:not(.content-image--header)):not(:has(.team-member)):nth-of-type(even) > p:has(> .content-image:not(.content-image--header)) {
        float: right;
        margin-right: 0;
        margin-left: clamp(2rem, 4vw, 3.5rem);
    }

    /* plain text blocks become their own formatting context, so they form a clean
       column beside the image; grids (facts, benefits) already are one */
    .frame-type-text:has(> p > .content-image:not(.content-image--header)):not(:has(.team-member)) > p:not(:has(> img)),
    .frame-type-text:has(> p > .content-image:not(.content-image--header)):not(:has(.team-member)) > ul:not([class]),
    .frame-type-text:has(> p > .content-image:not(.content-image--header)):not(:has(.team-member)) > ol {
        display: flow-root;
    }
}

/* ---------- Image tiles (solutions, references) ---------- */
.frame .card-row {
    list-style: none;
    margin: 1.75rem 0 1.5rem;
    padding: 0;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr));
    gap: clamp(1rem, 2.2vw, 1.75rem);
}

.card-row__item,
.frame .card-row__item > a {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    color: inherit;
    text-decoration: none;
}

.card-row__item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    transition: filter 0.25s ease;
}

.card-row__item span {
    font-weight: var(--paragraph__bold);
    color: var(--primary-color);
    font-size: 1.05rem;
    line-height: 1.3;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 0.25em;
    transition: text-decoration-color 0.2s ease;
}

.card-row__item small {
    display: block;
    margin-top: -0.4rem;
    font-size: 0.9rem;
    color: var(--font-color);
    font-variant-numeric: tabular-nums;
}

.card-row__item > a:hover img,
.card-row__item > a:focus-visible img {
    filter: brightness(0.92) saturate(1.05);
}

.card-row__item > a:hover span,
.card-row__item > a:focus-visible span {
    text-decoration-color: currentColor;
}

/* ---------- Project galleries (photos, plans, renderings, video) ----------
   Photos fill a common 4:3 frame; drawings and renderings on white
   (.is-plan) are shown whole on a ruled sheet instead of being cropped. */
.frame .gallery {
    margin: 1.75rem 0 0;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
    gap: clamp(1rem, 2.2vw, 1.75rem);
    align-items: start;
}

.gallery figure {
    margin: 0;
}

.gallery img,
.gallery video {
    display: block;
    width: 100%;
    height: auto;
    background: var(--sand);
}

.gallery img.is-plan {
    aspect-ratio: 4 / 3;
    object-fit: contain;
    padding: clamp(0.5rem, 1.5vw, 1rem);
    background: #fff;
    outline: 1px solid var(--rule-color);
    outline-offset: -1px;
}

.gallery video {
    background: #000;
}

/* a single picture keeps a readable size instead of spanning the page */
.frame .gallery:has(> figure:only-child) {
    grid-template-columns: minmax(0, 44rem);
}

.frame .gallery figcaption {
    max-width: none;
    margin-top: 0.55rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--font-color);
}

.gallery-block > h2 {
    margin-bottom: 0;
}

/* ---------- Datasheet: "Label: value" facts ---------- */
.frame .facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    max-width: var(--measure);
    margin: 1.5rem 0;
    border-top: 2px solid var(--rule-color--strong);
    font-variant-numeric: tabular-nums;
}

.facts dt,
.facts dd {
    margin: 0;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--rule-color);
}

.facts dt {
    padding-right: clamp(1rem, 3vw, 2rem);
    font-weight: var(--paragraph__bold);
    color: var(--primary-color);
}

@media (max-width: 480px) {
    .frame .facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .facts dt {
        padding-bottom: 0;
        border-bottom: none;
    }

    .facts dd {
        padding-top: 0.15rem;
    }
}

/* ---------- Key figures strip (homepage), drawn like a plan's title block ---------- */
.frame .spec-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
    margin: 0;
    border-top: 2px solid var(--rule-color--strong);
    border-bottom: 1px solid var(--rule-color);
    font-variant-numeric: tabular-nums;
}

.spec-strip > div {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    gap: 0.35rem;
    padding: 1.1rem 1.25rem 1.25rem;
    border-left: 1px solid var(--rule-color);
}

.spec-strip > div:first-child {
    border-left: none;
    padding-left: 0;
}

.spec-strip dd {
    margin: 0;
    font-size: clamp(1.3rem, 2.1vw, 1.65rem);
    font-weight: var(--headline__weight);
    color: var(--primary-color);
    line-height: 1.15;
}

.spec-strip dt {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--font-color);
}

@media (max-width: 640px) {
    .frame .spec-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .spec-strip > div {
        padding: 0.9rem 0.9rem 1rem;
        border-left: none;
        border-top: 1px solid var(--rule-color);
    }

    .spec-strip > div:nth-child(odd) {
        padding-left: 0;
    }

    .spec-strip > div:nth-child(even) {
        border-left: 1px solid var(--rule-color);
    }

    .spec-strip > div:nth-child(-n + 2) {
        border-top: none;
    }
}

/* ---------- Benefit lists ---------- */
.frame .benefits {
    list-style: none;
    padding: 0;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
    column-gap: clamp(1.5rem, 3vw, 2.5rem);
    margin: 1.25rem 0 1.5rem;
}

.benefits li {
    position: relative;
    padding: 0.8rem 0 0.8rem 1.75rem;
    border-top: 1px solid var(--rule-color);
    font-weight: var(--paragraph__bold);
    color: var(--font-color--dark);
}

/* drawn check mark: geometry, not a glyph */
.benefits li::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 1.05rem;
    width: 0.4rem;
    height: 0.75rem;
    border: solid var(--primary-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ---------- Partner logos ---------- */
.partner-row,
.partner-row > p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3rem);
    margin: 1rem 0 1.25rem;
}

.partner-row > p {
    margin: 0;
}

.partner-row img {
    width: auto;
    max-height: 72px;
}

/* ---------- Team members ---------- */
.team-member {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
    max-width: 52rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--rule-color);
}

.team-member img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.team-member__body strong {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

@media (max-width: 480px) {
    .team-member {
        grid-template-columns: 6rem minmax(0, 1fr);
        gap: 1rem;
    }
}

/* ---------- Contact form (TYPO3 form framework markup) ---------- */
.frame-type-form_formframework form {
    max-width: 40rem;
}

.frame-type-form_formframework form h2 {
    margin-bottom: 1.5rem;
}

.form-element {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: var(--paragraph__bold);
    color: var(--font-color--dark);
}

.form-label .required,
.form-check-label .required {
    color: var(--primary-color);
}

.form-control {
    display: block;
    width: 100%;
    min-height: 3rem;
    padding: 0.7rem 0.85rem;
    font: inherit;
    color: var(--font-color--dark);
    background: #fff;
    border: 1px solid #a9aaa6;
    border-radius: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.form-control {
    min-height: 9rem;
    resize: vertical;
}

.form-control:hover {
    border-color: var(--font-color);
}

.form-control:focus-visible {
    border-color: var(--primary-color);
    outline: 2px solid var(--primary-color);
    outline-offset: 0;
}

.form-control.is-invalid {
    border-color: var(--error-color);
    box-shadow: inset 0 0 0 1px var(--error-color);
}

.invalid-feedback {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: var(--paragraph__bold);
    /* live --error-color (#FF6A1A) is too light for text; it marks the field border instead */
    color: var(--font-color--dark);
}

.form-check-wrapping-label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0.15rem 0 0;
}

.form-check-label {
    cursor: pointer;
}

.form-check-label a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.form-navigation .btn {
    min-height: 3rem;
    margin-top: 0.5rem;
}

/* ---------- Contact page: form left, contact details right ----------
   Any page whose main content holds the form gets this two-column layout. */
@media (min-width: 900px) {
    main:has(> .frame-type-form_formframework) {
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        column-gap: clamp(2.5rem, 5vw, 5rem);
        align-items: start;
        max-width: var(--max-content-width);
        margin: 0 auto;
        padding: 0 1.5rem;
    }

    main:has(> .frame-type-form_formframework) > .frame {
        grid-column: 2;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        padding: 0;
        margin-bottom: 2.25rem;
    }

    main:has(> .frame-type-form_formframework) > .frame:first-child {
        grid-column: 1 / -1;
        margin-bottom: var(--section-gap);
    }

    main:has(> .frame-type-form_formframework) > .frame-type-form_formframework {
        grid-column: 1;
        grid-row: 2 / span 6;
    }

    main:has(> .frame-type-form_formframework) > .frame:not(:first-child):not(.frame-type-form_formframework) {
        padding-top: 1.25rem;
        border-top: 1px solid var(--rule-color);
    }

    main:has(> .frame-type-form_formframework) > .frame h2 {
        font-size: 1.25rem;
    }
}

/* ---------- Default section layout on wide screens ----------
   Heading in a narrow left column, text on the right (catalogue/index look);
   wide components (tiles, figures, FAQ, benefits) span the full width below. */
@media (min-width: 1000px) {
    main:not(:has(> .frame-type-form_formframework)) > .frame-type-text:not(:has(> header h1)):not(:has(> p > .content-image)):not(.frame-leistung-tile):not(:has(.team-member)):has(> header) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        column-gap: clamp(2rem, 4vw, 4rem);
        align-items: start;
    }

    main:not(:has(> .frame-type-form_formframework)) > .frame-type-text:not(:has(> header h1)):not(:has(> p > .content-image)):not(.frame-leistung-tile):not(:has(.team-member)):has(> header) > :not(header) {
        grid-column: 2;
    }

    main:not(:has(> .frame-type-form_formframework)) > .frame-type-text:not(:has(> header h1)):not(:has(> p > .content-image)):not(.frame-leistung-tile):not(:has(.team-member)):has(> header) > :is(.card-row, .spec-strip, .benefits, .faq) {
        grid-column: 1 / -1;
    }

    main:not(:has(> .frame-type-form_formframework)) > .frame-type-text:not(:has(> header h1)):not(:has(> p > .content-image)):not(.frame-leistung-tile):not(:has(.team-member)):has(> header) > header {
        grid-row: 1 / span 20;
    }

    main:not(:has(> .frame-type-form_formframework)) > .frame-type-text:not(:has(> header h1)):not(:has(> p > .content-image)):not(.frame-leistung-tile):not(:has(.team-member)):has(> header) > header h2 {
        font-size: clamp(1.3rem, 1.7vw, 1.55rem);
    }
}

/* Confirmation after sending */
.frame-type-form_formframework > div[id^="kontakt-"]:not(:has(form)) {
    max-width: 40rem;
    padding: 1.25rem 1.5rem;
    border-top: 2px solid var(--primary-color);
    background: rgba(0, 65, 34, 0.05);
    font-weight: var(--paragraph__bold);
    color: var(--font-color--dark);
}

@media (max-width: 840px) {
    .service-nav__phone {
        display: none;
    }
}

/* ============================================================
   Mobile navigation (< 1200px): hamburger toggle + tap-accordion
   submenus. Desktop keeps the hover mega-menu (see rules above).
   ============================================================ */
@media (max-width: 1199px) {
    /* wrap so the opened nav (flex-basis 100%) drops below logo + toggle
       instead of squeezing the logo to zero width */
    .site-header__row--1 {
        flex-wrap: wrap;
        column-gap: 0.5rem;
    }

    .site-header__logo {
        flex-shrink: 0;
        min-width: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        width: 100%;
        flex-basis: 100%;
        order: 3;
        /* viewport minus logo row and service row, so the whole header fits on screen */
        max-height: calc(100dvh - 9rem);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .site-header.nav-is-open .main-nav {
        display: block;
    }

    .main-nav > ul {
        flex-direction: column;
        gap: 0;
        margin-top: 0.25rem;
    }

    .main-nav li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .main-nav__sub li:last-child {
        border-bottom: none;
    }

    .main-nav__item {
        justify-content: space-between;
    }

    .main-nav a {
        padding: 0.85rem 0;
        width: 100%;
        white-space: normal;
    }

    .main-nav__toggle {
        display: inline-flex;
    }

    /* Accordion instead of floating dropdown */
    .main-nav__sub {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        box-shadow: none;
        border: none;
        min-width: 0;
        width: auto;
        max-width: none;
        padding: 0 0 0.5rem 1rem;
        background: rgba(0, 0, 0, 0.02);
    }

    .main-nav li.is-open > .main-nav__sub {
        display: flex;
    }

    .main-nav__sub a {
        padding: 0.65rem 0.5rem;
    }

    .site-header__row--2 {
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 0.75rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .lang-switch {
        border-left: none;
        padding-left: 0;
    }
}

/* Call button in the logo row: shown once the phone number leaves the service row */
.nav-call {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    color: var(--primary-color);
}

@media (max-width: 840px) {
    .nav-call {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-call + .nav-toggle {
        margin-left: 0;
    }
}

@media (min-width: 1200px) {
    /* seven top-level items: compact enough to stay on the logo row */
    .main-nav > ul {
        gap: 0.85rem;
    }

    .main-nav a {
        font-size: 0.9rem;
    }

    .site-header__row--1 {
        gap: 1rem;
    }

    .site-header__logo img {
        width: 150px;
    }
}

@media (min-width: 1200px) {
    /* Desktop: hover handles submenus, no tap-toggle button needed */
    .main-nav__toggle {
        display: none;
    }
}

@media (max-width: 480px) {
    .site-header__logo img {
        width: 140px;
    }

    .service-nav__cta {
        padding: 0.6rem 1rem;
    }

    h1 {
        font-size: 1.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .frame-leistung-tile:hover {
        transform: none;
    }
}

/* ============================================================
   WohnCube product page: mirrors the WohnCube brochure
   (green bands, warm sand surface, square-marked section labels).
   ============================================================ */
:root {
    --sand: #f3efe8;
}

.wc-bleed {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.frame-type-html:first-child:has(.wc-hero) {
    margin-top: 0;
}

.wc-kicker {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.9rem;
    font-size: 0.78rem;
    font-weight: var(--paragraph__bold);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.wc-kicker::before {
    content: "";
    width: 0.7rem;
    height: 0.7rem;
    background: currentColor;
    flex-shrink: 0;
}

.wc-section h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--font-color--dark);
    margin-bottom: 1.25rem;
}

/* The building is shown whole: full image above the band on small screens,
   image and green band side by side on wide ones. */
.wc-hero__img {
    display: block;
    width: 100%;
    height: auto;
}

.wc-hero__band {
    background: var(--primary-color);
    color: #fff;
    padding: clamp(2rem, 5vw, 3.5rem) max(1.5rem, calc(50vw - 600px + 1.5rem)) clamp(1.75rem, 4vw, 2.75rem);
}

@media (min-width: 900px) {
    .wc-hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        background: var(--primary-color);
    }

    .wc-hero__img {
        grid-column: 2;
        grid-row: 1;
        height: 100%;
        max-height: 82vh;
        object-fit: cover;
    }

    .wc-hero__band {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        padding: clamp(2rem, 4vw, 3.5rem) clamp(2rem, 4vw, 3.5rem) clamp(2rem, 4vw, 3.5rem) max(1.5rem, calc(50vw - 600px + 1.5rem));
    }

    .wc-hero .wc-hero__band h1 {
        font-size: clamp(2.4rem, 4.6vw, 4rem);
    }

    .frame .wc-hero > .wc-caption {
        grid-column: 2;
        margin: 0.5rem 1.5rem 0.75rem;
        color: rgba(255, 255, 255, 0.85);
    }
}

.wc-hero__band .wc-kicker,
.wc-band .wc-kicker {
    color: rgba(255, 255, 255, 0.8);
}

.wc-hero__band h1 {
    color: #fff;
    font-size: clamp(2.6rem, 7vw, 4.5rem);
    margin: 0 0 0.35rem;
}

.wc-hero__lead {
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    margin: 0 0 1.75rem;
}

.frame .wc-hero__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    max-width: none;
    margin: 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

.frame .wc-caption {
    max-width: none;
    margin: 0.5rem 1.5rem 0;
    font-size: 0.8rem;
    color: var(--font-color--light);
    text-align: right;
}

.wc-figures {
    margin: 0;
    display: grid;
    font-variant-numeric: tabular-nums;
}

.wc-figures > div {
    display: flex;
    flex-direction: column-reverse;
    padding: 0.8rem 0;
    border-top: 1px solid var(--rule-color);
}

.wc-figures dd {
    margin: 0;
    font-size: 1.45rem;
    font-weight: var(--headline__weight);
    color: var(--primary-color);
    line-height: 1.2;
}

.wc-figures dt {
    font-size: 0.85rem;
    color: var(--font-color);
}

.wc-intro__grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 5vw, 5rem);
    align-items: start;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.wc-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
    align-items: start;
}

.wc-pair img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.wc-quote {
    margin: 1rem 0 0;
    padding: 1.4rem 1.6rem;
    background: var(--sand);
    border-top: 2px solid var(--primary-color);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--font-color--dark);
}

.wc-media {
    width: 100%;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.wc-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.25rem, 4vw, 3rem);
}

.frame .wc-cols p {
    margin: 0;
}

.wc-bath {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: clamp(1.5rem, 5vw, 5rem);
    align-items: start;
}

.wc-bath > img {
    grid-column: 1 / -1;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    margin-top: clamp(1rem, 3vw, 2rem);
}

.frame .wc-features {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: none;
}

.wc-features li {
    position: relative;
    padding: 0.85rem 0 0.85rem 1.75rem;
    border-top: 1px solid var(--rule-color);
    color: var(--font-color--dark);
}

.wc-features li::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 1.05rem;
    width: 0.4rem;
    height: 0.75rem;
    border: solid var(--primary-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.wc-overlay > img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.wc-overlay__card {
    position: relative;
    max-width: 34rem;
    margin: -7rem 0 0 clamp(0rem, 4vw, 3rem);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    background: #fff;
    box-shadow: 0 18px 40px rgba(40, 40, 38, 0.12);
}

.wc-model {
    padding: clamp(1.5rem, 3vw, 2.5rem) max(1.5rem, calc(50vw - 600px + 1.5rem));
    background: var(--sand);
    margin-bottom: 1rem;
}

.wc-model h3 {
    margin: 0 0 1rem;
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
}

.wc-model__plan {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    gap: clamp(1.25rem, 3vw, 2.5rem);
    align-items: center;
}

.wc-model__plan img {
    width: 100%;
    background: #fff;
    padding: 0.75rem;
}

.frame .wc-note {
    font-size: 0.82rem;
    color: var(--font-color--light);
    font-style: italic;
}

.wc-spec {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
    gap: 0 clamp(1.5rem, 4vw, 3rem);
    margin: 1.5rem 0 0;
}

.wc-spec > div {
    padding: 1.1rem 0 1.25rem;
    border-top: 1px solid var(--rule-color);
}

.wc-spec dt {
    font-weight: var(--paragraph__bold);
    color: var(--font-color--dark);
    margin-bottom: 0.3rem;
}

.wc-spec dd {
    margin: 0;
    color: var(--font-color);
}

.wc-band {
    background: var(--primary-color);
    color: #fff;
    padding: clamp(2.5rem, 6vw, 4.5rem) max(1.5rem, calc(50vw - 600px + 1.5rem));
}

.wc-band h2,
.wc-band h3 {
    color: #fff;
}

.wc-band p,
.wc-band li {
    color: rgba(255, 255, 255, 0.9);
}

.frame .wc-steps {
    list-style: none;
    counter-reset: step;
    margin: 1.5rem 0 0;
    padding: 0;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
    gap: clamp(1.5rem, 4vw, 3rem);
}

.wc-steps li {
    counter-increment: step;
}

.wc-steps li::before {
    content: counter(step);
    display: block;
    margin-bottom: 0.75rem;
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: var(--headline__weight);
    line-height: 1;
    color: #fff;
}

.wc-steps h3 {
    margin-bottom: 0.4rem;
}

.frame .wc-steps p {
    margin: 0;
}

.wc-contact__media {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    max-height: 80vh;
    object-fit: cover;
    object-position: center 60%;
}

.wc-contact__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.75rem;
    margin: 1.5rem 0 2.25rem;
}

.wc-band .btn {
    background: #fff;
    color: var(--primary-color);
}

.wc-band .btn:hover {
    background: var(--sand);
}

.frame .wc-band a:not(.btn) {
    color: #fff;
}

.wc-included {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.5rem, 4vw, 3rem);
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.wc-included h3 {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.frame .wc-included ul {
    margin: 0;
    padding-left: 1.1rem;
}

.frame .wc-band .wc-note {
    color: rgba(255, 255, 255, 0.75);
    margin: 1.75rem 0 0;
    max-width: none;
}

.frame-type-html:has(.wc-band, .wc-model) {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .wc-intro__grid,
    .wc-cols,
    .wc-bath,
    .wc-model__plan,
    .wc-included,
    .wc-pair {
        grid-template-columns: minmax(0, 1fr);
    }

    .wc-overlay__card {
        margin: -4rem 1rem 0;
    }

    .wc-overlay > img {
        aspect-ratio: 4 / 3;
    }

    .wc-contact__media {
        aspect-ratio: 3 / 2;
    }
}
