/*
 * Layout — Decurtins Media und Management GmbH
 * CSS Grid component system for the modernized page structure.
 * Depends on tokens defined in styles/base.css. Loaded after the legacy
 * site.css/theme.css/nav.css so these rules win for the sections they
 * cover (hero, services, references, portfolio, testimonials, team,
 * footer). Nav/mmenu/cookie-consent widget styling is left to the
 * legacy stylesheets untouched.
 */

/* ------------------------------------------------------------------ *
 * Shared section rhythm
 * ------------------------------------------------------------------ */

/* scripts/cms-content.js hides a section (and the links to it) when the
   CMS has no visible entry for it */
[hidden] {
    display: none !important;
}

#hero,
#s-projects,
#s-references,
#s-portfolio,
#s-cites,
#s-team,
#s-contact {
    /* the one rhythm for every section (base.css) */
    padding-block: var(--section-space);
    /* horizontal-only: this was clipping every card's hover lift
       (service/portfolio/testimonial/team all translateY on hover)
       since `overflow: hidden` clips both axes. Only needed here to
       stop the marquees' oversized tracks from causing a page-wide
       horizontal scrollbar. */
    overflow-x: hidden;
    overflow-y: visible;
}

/* Section backgrounds: the two "alt" sections take --color-bg-alt,
   which base.css currently sets to white, so the whole page is white.
   Boxes and tiles that should stand out from it (logo tiles,
   testimonials, the address block, the "Unser Angebot" tiles) use
   --color-surface, the subtle #f8f9fa. Boxless content (team,
   projects) sits straight on the white. */
#s-projects,
#s-references {
    background: var(--color-bg-alt);
}

#s-portfolio,
#s-cites,
#s-team,
#s-contact {
    background: var(--color-bg);
}

#hero {
    padding-block: 0;
}

/* Shared side gutter for every section's content: the same
   --page-gutter (32px mobile / 64px from 768px) the floating navbar
   is inset by, so content and navbar share their left and right
   edges at every width. Deliberately no max-width — the navbar has
   none either. (The hero sets the same gutter on its text column; its
   photo is the one deliberately full-bleed element.) */
.section-head,
.services-layout,
.portfolio-grid,
.team-grid,
.contact-grid,
.footer-grid {
    padding-inline: var(--page-gutter);
}

/* The marquees clip their scrolling track at the gutters too, so the
   logos/testimonials run exactly between the navbar's edges. Margin,
   not padding: overflow clips at the padding edge, which would let
   items scroll through the gutter. */
.logo-marquee,
.testimonial-marquee {
    margin-inline: var(--page-gutter);
}

.section-head {
    text-align: center;
    margin-bottom: var(--section-head-space);
}

.section-head h2 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    /* Shrinks on narrow screens so the longest whole title ("UNSERE
       LEISTUNGEN", ~11.2em wide) fits on one line between the page
       gutters; full size from ~700px up. Every section title uses this,
       so they're always the same size. */
    font-size: clamp(1.25rem, calc((100vw - 2 * var(--page-gutter)) / 11.6), var(--font-size-4xl));
    white-space: nowrap;
    line-height: var(--line-height-heading);
    letter-spacing: var(--letter-spacing-wide);
    color: var(--color-brand-primary);
    margin: 0;
    display: inline;
    /* Break at spaces and hyphenation points (the "Beispielprojekte"
       title carries a soft hyphen), only mid-word as a last resort — the
       legacy theme's `word-break: break-word` would split a title after
       any letter. */
    word-break: normal;
    overflow-wrap: break-word;
}

.section-lead {
    max-width: 46rem;
    margin: var(--space-5) auto 0;
    font-family: var(--font-accent);
    font-style: italic;
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
}

/* ------------------------------------------------------------------ *
 * Header / Navigation
 *
 * Floats over the page, full width minus --nav-inset (base.css) on
 * the left and right: 32px on mobile, 64px from 768px up — the same
 * distance the page content keeps from the viewport edges — and
 * --nav-top (half of that) from the top.
 * Logo left, menu right. Below 1200px the menu collapses behind a
 * hamburger and opens as a panel inside the bar; from 1200px up all
 * sections are listed inline (that's the width the six labels fit
 * in alongside the logo without crowding).
 * Highlight/hamburger/panel animations live in styles/motion.css;
 * open/close and the current-section highlight are driven by
 * scripts/site-nav.js.
 * ------------------------------------------------------------------ */

.site-header {
    position: fixed;
    top: var(--nav-top);
    left: var(--nav-inset);
    right: var(--nav-inset);
    z-index: 1030;
}

/* Anchor links land with the section's top edge where the floating
   header starts, so section headings clear it. */
html {
    scroll-padding-top: var(--nav-top);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background: rgba(var(--color-black-rgb), 0.93);
}

.site-nav__logo {
    display: flex;
    align-items: center;
    height: var(--nav-height);
    padding-left: var(--space-5);
}

.site-nav__logo img {
    display: block;
    height: 27px;
    width: auto;
}

.site-nav__toggle {
    position: relative;
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    /* bars are 27px wide inside a 48px button (10.5px of slack each
       side) — pull it in so the bars' edge, not the button's, sits
       the same 24px from the bar's edge as the logo does on the left */
    margin-right: calc(var(--space-5) - 0.65625rem);
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.site-nav__toggle-bar {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 27px;
    height: 3px;
    margin: -1.5px 0 0 -13.5px;
    background: rgba(var(--color-white-rgb), 0.9);
}

.site-nav__toggle-bar:nth-child(1) {
    transform: translateY(-8px);
}

.site-nav__toggle-bar:nth-child(3) {
    transform: translateY(8px);
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-bar:nth-child(1) {
    transform: rotate(45deg);
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-bar:nth-child(2) {
    opacity: 0;
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-bar:nth-child(3) {
    transform: rotate(-45deg);
}

/* Mobile/tablet: the menu is a panel inside the bar that opens
   downward. Animating grid-template-rows 0fr -> 1fr grows it to its
   natural height without a fixed max-height; `visibility` keeps the
   collapsed links out of the keyboard tab order. */
.site-nav__panel {
    flex: 0 0 100%;
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
}

.site-nav.is-open .site-nav__panel {
    grid-template-rows: 1fr;
    visibility: visible;
}

.site-nav__menu {
    min-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__menu li {
    border-top: 1px solid rgba(var(--color-white-rgb), 0.1);
}

.site-nav__link {
    position: relative;
    isolation: isolate;
    display: block;
    padding: var(--space-4) var(--space-5);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    text-decoration: none;
    color: rgba(var(--color-white-rgb), 0.65);
}

/* the highlight fill, collapsed by default (revealed in motion.css) */
.site-nav__link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(var(--color-white-rgb), 0.1);
    transform: scaleX(0);
    transform-origin: left;
}

@media (min-width: 1200px) {
    .site-nav {
        flex-wrap: nowrap;
    }

    .site-nav__toggle {
        display: none;
    }

    .site-nav__panel {
        flex: 0 0 auto;
        display: block;
        visibility: visible;
    }

    .site-nav__menu {
        display: flex;
        align-items: stretch;
        overflow: visible;
    }

    .site-nav__menu li {
        border-top: 0;
    }

    .site-nav__link {
        display: flex;
        align-items: center;
        height: var(--nav-height);
        padding: 0 var(--space-4);
        white-space: nowrap;
    }

    /* the last link runs flush to the bar's right edge (so its
       highlight fill reaches the edge too); the extra padding keeps
       its text the same 24px from the edge as the logo on the left */
    .site-nav__menu li:last-child .site-nav__link {
        padding-right: var(--space-5);
    }
}

/* ------------------------------------------------------------------ *
 * Hero
 * ------------------------------------------------------------------ */

/* Mobile-first DOM order is [image, content] to match "photo sits
   immediately below the nav, text below the photo." From 1024px the
   hero is a strict 50/50 split with text on the left (via `order`, not
   by reordering the markup — keeps source/reading order sane) and
   fills the whole screen height. Below that — phones and tablets — the
   text column would be too narrow beside a half-width photo, so the
   photo stays on top.
   `minmax(0, 1fr)`: a column may shrink below the width of its content.
   Plain `1fr` can't, so the headline (typed out on one line, never
   wrapping) used to push the column wider than the screen and cut the
   text off on the right. */
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1024px) {
    .hero-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        /* the full height of the screen (`svh`: the visible height, so
           browser toolbars on tablets don't push it past the fold) */
        min-height: 100vh;
        min-height: 100svh;
    }

    .hero-media {
        order: 2;
    }

    .hero-content {
        order: 1;
    }
}

.hero-media {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.hero-media img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    /* never stretched: `cover` keeps the photo's own aspect ratio and
       crops to fill the box; `top` anchors it there, so when the box
       is shorter than the photo it's the bottom that gets trimmed */
    object-fit: cover;
    object-position: center top;
    display: block;
    filter: var(--image-filter-grayscale);
}

/* Small phones: the floating navbar covers the top ~88px of the photo,
   which is where the hand is. A square frame shows the photo slightly
   larger (cropped a little at the sides), which moves the hand down
   clear of the bar. Wider screens show the photo larger anyway, so the
   hand clears the bar there without this. */
@media (max-width: 599px) {
    .hero-media img {
        height: auto;
        min-height: 0;
        aspect-ratio: 1 / 1;
    }
}

.hero-content {
    background: var(--color-bg);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* single source of truth for the vertical rhythm between headline,
       quote, body and button — every gap here is the same token */
    gap: var(--space-6);
    /* stacked: the same side gutter as the navbar and every other
       section; the bottom is a full section space, like the end of any
       other section */
    padding: var(--layout-gap) var(--page-gutter) var(--section-space);
}

@media (min-width: 1024px) {
    .hero-content {
        /* top padding clears the floating header (inset + bar height)
           plus a full --space-6 of breathing room — stacked, the text
           block sits below the photo, so it isn't affected */
        padding: calc(var(--nav-top) + var(--nav-height) + var(--space-6)) var(--space-8) var(--space-9);
    }
}

.hero-headline {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    text-transform: uppercase;
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-brand-primary);
    /* The longest line ("UNKOMPLIZIERT.") is typed out on one line and
       never wraps; it is about 8.1em wide. So the size is the smaller of
       the original fluid size and what fits the text column (the
       screen minus both side gutters, ÷ 8.6 for a little room to spare)
       — it can never run past the edge, on any screen. */
    font-size: min(clamp(2.25rem, 2vw + 2rem, 4.5rem), calc((100vw - 2 * var(--page-gutter)) / 8.6));
}

@media (min-width: 1024px) {
    .hero-headline {
        /* the column is half the screen, minus its own side padding */
        font-size: min(clamp(2.25rem, 2vw + 2rem, 4.5rem), calc((50vw - 2 * var(--space-8)) / 8.6));
    }
}

.hero-headline__line {
    display: block;
}

.hero-headline__dot {
    /* Montserrat's period renders as a cleaner, rounder dot than
       Raleway's at heavy weight — matches the brand guide's own
       "heading periods" accent treatment. */
    font-family: var(--font-display);
    color: var(--color-brand-accent);
}

.hero-quote {
    margin: 0;
    font-family: var(--font-accent);
    font-style: italic;
    font-size: var(--font-size-md);
    color: var(--color-text);
}

.hero-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.hero-body p {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text-muted);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    width: fit-content;
    background: var(--color-brand-accent);
    color: var(--color-text-inverse);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    font-size: var(--font-size-sm);
    text-decoration: none;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-sm);
}

.hero-cta:hover {
    background: var(--color-red-hover);
}

.hero-cta__icon {
    transition: transform var(--duration-base) var(--ease-standard);
}

.hero-cta:hover .hero-cta__icon {
    transform: translateX(4px);
}

/* ------------------------------------------------------------------ *
 * Services
 * ------------------------------------------------------------------ */

/* The category tabs (with their text) and the "Unser Angebot" diagram.
   Wide screens: side by side in one row, tabs left and diagram right,
   for as long as the diagram can be shown at a readable size (it
   scales itself to its column). Below 1320px it would have to shrink
   under ~60%, so it goes beneath the tabs instead. */
.services-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--layout-gap);
}

@media (min-width: 1320px) {
    .services-layout {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
}

/* The diagram (assets/html/unserAngebot.html, embedded as an iframe)
   is never wider than the tab slider — 800px, the slider's own maximum
   (.service-tabs__nav below) — and sits centered in its column, or
   under the slider. */
.services-angebot {
    width: 100%;
    max-width: 800px;
    margin-inline: auto;
}

/* The frame is sized by scripts/angebot-frame.js to the diagram's real
   height; this is only the height it has until that first arrives. */
.angebot-frame {
    display: block;
    width: 100%;
    /* until the script sets the real height: the diagram's own
       proportions (768 x 558 at its design width), so the frame is about
       the right height at every width — on a phone the diagram shrinks,
       and a fixed height here would leave a big empty gap under it */
    aspect-ratio: 768 / 558;
    border: 0;
    background: transparent;
}

/* Mobile: no flex — buttons are inline-block by default and simply
   wrap onto new lines as needed (their own margin provides spacing,
   since `gap` doesn't apply outside flex/grid). Avoids the whole
   class of flex-overflow issues on narrow viewports entirely.
   Desktop (768px+): a centered horizontal row, see the media query
   below. */
.service-tabs__nav {
    border-bottom: var(--border-width-thin) solid var(--color-border);
}

.service-tabs__tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: var(--radius-none);
    margin: 0 var(--space-5) var(--space-2) 0;
    padding: var(--space-3) var(--space-1) var(--space-4);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    cursor: pointer;
}

@media (min-width: 768px) {
    .service-tabs__nav {
        display: flex;
        /* `safe center`, not plain `center`: with overflow-x
           scrolling, plain `center` on content wider than the
           container makes the overflowing portion unreachable (no
           valid negative scroll offset). `safe` falls back to
           start-alignment whenever centering would do that. */
        justify-content: safe center;
        /* tight enough that the whole row (~620px) fits inside the
           page gutters on a 768px tablet; roomier again from 1200px,
           below */
        gap: var(--space-4);
        max-width: 800px;
        margin-inline: auto;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .service-tabs__nav::-webkit-scrollbar {
        display: none;
    }

    .service-tabs__tab {
        flex: 0 0 auto;
        margin: 0 0 -1px;
        /* sit on top of .service-tabs__nav's own border */
        white-space: nowrap;
    }
}

@media (min-width: 1200px) {
    .service-tabs__nav {
        gap: var(--space-6);
    }
}

.service-tabs__tab.is-active {
    color: var(--color-brand-primary);
    font-weight: var(--font-weight-bold);
    border-bottom-color: var(--color-brand-accent);
}

/* Sliding indicator — desktop only. One shared bar that moves and
   resizes to sit under whichever tab is active (position/width set
   by scripts/service-tabs.js), instead of each tab toggling its own
   border. Only meaningful in the single-row layout: on mobile the
   tabs wrap across lines, where a horizontal slide wouldn't track
   correctly, so mobile keeps the plain per-tab border toggle above.
   Placed after the base .is-active rule so its border override wins
   in source order. */
.service-tabs__indicator {
    display: none;
}

@media (min-width: 768px) {
    .service-tabs__nav {
        position: relative;
    }

    .service-tabs__tab.is-active {
        border-bottom-color: transparent;
    }

    .service-tabs__indicator {
        display: block;
        position: absolute;
        left: 0;
        bottom: 0;
        height: 3px;
        width: 0;
        background: var(--color-brand-accent);
        pointer-events: none;
        transition: transform var(--duration-slow) var(--ease-standard),
            width var(--duration-slow) var(--ease-standard);
    }
}

/* All panels share the same grid cell (stacked on top of each other)
   so the container's height is always driven by the tallest one —
   switching tabs no longer changes the section's height, since the
   inactive panels still occupy layout space (just invisible), rather
   than being removed from the flow like `display: none` would. */
.service-tabs__panels {
    display: grid;
    padding-top: var(--space-7);
}

/* Section head above stays centered (see .section-head); tab content
   is deliberately left-aligned and width-capped for readability,
   giving the section an asymmetric, dashboard-like feel rather than
   a centered marketing block. */
.service-tabs__panel {
    grid-area: 1 / 1;
    /* all panels stacked in the same cell; container height = tallest */
    justify-self: center;
    max-width: 800px;
    width: 100%;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* visibility switches to hidden only once opacity has fully
       faded out (delayed by the full fade duration), so the outgoing
       panel actually fades away instead of vanishing instantly while
       the incoming one fades in — a real crossfade, matching the
       fade treatment used everywhere else on the page. */
    transition: opacity var(--duration-slow) var(--ease-standard),
        visibility 0s var(--duration-slow);
}

.service-tabs__panel.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* becoming visible: no delay, so the fade-in starts right away */
    transition: opacity var(--duration-slow) var(--ease-standard),
        visibility 0s;
}

.service-tabs__panel.is-visible {
    opacity: 1;
}

.service-tabs__tagline {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
    color: var(--color-brand-primary);
    margin: 0 0 var(--space-4);
}

.service-tabs__panel p:not(.service-tabs__tagline) {
    color: var(--color-text);
    line-height: var(--line-height-base);
    margin: 0;
}

/* ------------------------------------------------------------------ *
 * Referenzen
 * ------------------------------------------------------------------ */

.logo-marquee,
.testimonial-marquee {
    /* draggable to skip ahead — see scripts/drag-marquee.js. Grab
       cursor signals it; pan-y lets vertical page scroll pass through
       untouched on touch while horizontal drag is handled by JS. */
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
}

.logo-marquee.is-dragging,
.testimonial-marquee.is-dragging {
    cursor: grabbing;
}

.logo-marquee {
    /* horizontal-only clipping: masks the scrolling track's edges
       without cutting off the hover-scale on .logo-grid__picture img
       (overflow: hidden would clip that vertically too) */
    overflow-x: hidden;
    overflow-y: visible;
    position: relative;
    /* mask-image is bound to this box regardless of overflow, so
       content that escapes vertically via a hover transform still
       gets masked to nothing unless the box itself is tall enough
       to contain it — hence the padding, not just overflow-y. */
    padding-block: var(--space-3);
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

/* Single flat list = both the visible set and its duplicate, as
   direct siblings (no nested per-copy container). Every item carries
   its own trailing margin instead of a container `gap`. Width is an
   explicit calc() from the same tokens the items are sized with —
   not `max-content` — so it can't drift out of sync with the
   animation's own calc()'d shift in styles/motion.css (see the note
   there for why relying on the browser's own intrinsic-width
   computation here was unreliable). The item count per copy is
   --marquee-count: 39 (the logos written into index.html) until
   scripts/cms-content.js sets the real number from the CMS; x 2 copies. */
.logo-grid {
    list-style: none;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: calc(2 * var(--marquee-count, 39) * (var(--marquee-item-width-logo) + var(--space-5)));
    margin: 0;
    /* animation lives in styles/motion.css */
}

.logo-grid__item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 var(--marquee-item-width-logo);
    margin-right: var(--space-5);
    background: var(--color-surface);
    padding: var(--space-5);
    border-radius: var(--radius-sm);
    height: 96px;
}

.logo-grid__picture {
    display: flex;
    width: 100%;
    height: 100%;
}

.logo-grid__picture img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    margin: auto;
    display: block;
    filter: var(--image-filter-grayscale);
    /* hover/focus transition lives in styles/motion.css */
    -webkit-user-drag: none;
}

.logo-grid__link {
    position: absolute;
    inset: 0;
    -webkit-user-drag: none;
    /* follow the marquee's grab/grabbing cursor instead of the
       browser's default pointer-on-link — the whole area is
       draggable, not just clickable */
    cursor: inherit;
    /* TEMPORARY: link-through to partner sites deactivated for now.
       Markup/href left untouched — remove this line to re-enable. */
    pointer-events: none;
}

/* ...except for logos the CMS marks as linked (admin: "Logo verlinken"),
   which open the site in a new tab. A drag on the marquee still doesn't
   count as a click (scripts/drag-marquee.js). */
.logo-grid__item--linked .logo-grid__link {
    pointer-events: auto;
    cursor: pointer;
}

/* ------------------------------------------------------------------ *
 * Portfolio
 * ------------------------------------------------------------------ */

/* Stacked in one column below 768px: the cards fill the page content on
   a phone, and on a big phone / small tablet keep a comfortable
   reading width (40rem = 640px of card) centered under the title. The
   gutters are added to the max-width because they're padding on this
   element. */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--layout-gap);
    max-width: calc(40rem + 2 * var(--page-gutter));
    margin-inline: auto;
}

/* Two columns from 768px, spanning the full page content like every
   other section. With 5 projects the last one sits alone in the left
   column at normal column width — it deliberately does not stretch
   across both. */
@media (min-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: none;
    }
}

.portfolio-card {
    position: relative;
    /* anchors the ::before accent bar — see styles/motion.css */
    /* no background and no inner padding: the cards sit straight on the
       white section, their text flush with the page gutter like every
       other section; the grid gap separates them */
    padding: 0;
    border-radius: var(--radius-none);
    text-align: left;
}

/* Service categories above the title — the categories of "Unsere
   Leistungen" the project belongs to (one or several) — as an
   "eyebrow": plain red Raleway capitals, no box. Several categories
   read as one line of text, separated by bullets (drawn here, so the
   markup stays a proper list). It sits snug on the title (0.25rem) so
   the two read as one unit. */
.portfolio-card__tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 0 0 var(--space-1);
    padding: 0;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-xs);
    line-height: var(--line-height-heading);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-brand-accent);
}

.portfolio-card__tag:not(:last-child)::after {
    content: "•";
    /* purely visual: no "bullet" read out by screen readers */
    content: "•" / "";
    margin-inline: 0.6em;
}

.portfolio-card h2 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-extrabold);
    font-size: var(--font-size-lg);
    color: var(--color-brand-primary);
    margin: 0;
    /* the markup's Bootstrap utilities (mb-4 / mb-md-5, !important)
       pushed the text 24-48px away from its title; one consistent
       title -> text step instead */
    margin-bottom: var(--space-3) !important;
    /* The legacy theme lets headings break after any letter
       (`word-break: break-word`), which fills each line to the last
       character that fits and ignores hyphenation points — on a phone
       "Schnittstellenmanagement" was split as "Schnittstellenm|anagement".
       Break at real opportunities (spaces, the soft hyphen in that
       word) and only mid-word as a last resort. */
    word-break: normal;
    overflow-wrap: break-word;
    /* titles typed in the CMS carry no soft hyphens ("Schnittstellen&shy;
       management"): let the browser hyphenate long German words itself */
    hyphens: auto;
}

.portfolio-card p {
    font-family: var(--font-body);
    font-weight: var(--font-weight-regular);
    color: var(--color-text);
    line-height: var(--line-height-base);
    margin: 0;
}

/* a project text from the CMS may have several paragraphs */
.portfolio-card p + p {
    margin-top: var(--space-3);
}

/* ------------------------------------------------------------------ *
 * Kundenstimmen — same continuous horizontal marquee mechanism as
 * Referenzen (see .logo-marquee above), one row of cards.
 * ------------------------------------------------------------------ */

.testimonial-marquee {
    /* horizontal-only clipping: masks the scrolling track's edges
       without cutting off the hover lift on .testimonial-card
       (overflow: hidden would clip that vertically too) */
    overflow-x: hidden;
    overflow-y: visible;
    position: relative;
    /* mask-image is bound to this box regardless of overflow, so a
       card that escapes vertically via translateY(-4px) on hover
       still gets masked to nothing unless the box itself is tall
       enough to contain it — hence the padding, not just overflow-y. */
    padding-block: var(--space-3);
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

/* Single flat list, same reasoning as .logo-grid above: every card
   carries its own trailing margin instead of a container `gap`, and
   width is an explicit calc(), not `max-content`. --marquee-count is
   10 (the testimonials written into index.html) until
   scripts/cms-content.js sets the real number from the CMS; x 2 copies. */
.testimonial-grid {
    list-style: none;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: calc(2 * var(--marquee-count, 10) * (var(--marquee-item-width-testimonial) + var(--marquee-gap-testimonial)));
    margin: 0;
    /* animation lives in styles/motion.css */
}

.testimonial-card {
    flex: 0 0 var(--marquee-item-width-testimonial);
    margin-right: var(--marquee-gap-testimonial);
    background: var(--color-surface);
    /* 32px on a phone -> 48px on desktop */
    padding: clamp(var(--space-6), 1.5rem + 1.5vw, var(--space-7));
    display: flex;
    /* cursor: grab, inherited from .testimonial-marquee */
}

.testimonial-card blockquote {
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: var(--space-5);
}

/* Decorative quote mark: heading font + accent color, not an icon */
.testimonial-card__mark {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    font-size: var(--font-size-5xl);
    line-height: 1;
    color: var(--color-brand-accent);
}

.testimonial-card__quote p {
    font-family: var(--font-accent);
    font-style: italic;
    color: var(--color-text);
    line-height: var(--line-height-relaxed);
    margin: 0;
}

.testimonial-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: auto;
    padding-top: var(--space-5);
}

.testimonial-card__avatar img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-pill);
    object-fit: cover;
    filter: var(--image-filter-grayscale);
}

.testimonial-card__person {
    display: flex;
    flex-direction: column;
}

.testimonial-card__author {
    font-family: var(--font-heading);
    font-style: normal;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    color: var(--color-brand-primary);
}

.testimonial-card__role {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin: 0;
}

/* ------------------------------------------------------------------ *
 * Über uns / Team — boxless: photo, name and title sit straight on the
 * white section. No cards, backgrounds, borders or shadows.
 *
 * The same structure on every device — photo, name, title, then the
 * details (languages + contact) below the title — with two ways of
 * opening them:
 *  - touch: the name row is a "+" toggle (scripts/team-cards.js) and
 *    the details unfold under the title
 *  - real hover (mouse): no toggle; the details appear on hover / focus
 * Transitions live in styles/motion.css.
 * ------------------------------------------------------------------ */

.team-grid {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    /* row gap = between stacked members, column gap = between columns */
    gap: var(--layout-gap) var(--grid-gap);
    /* Bootstrap gives every <ul> a 1rem bottom margin, which made this
       the only section with extra space under its content */
    margin-block: 0;
    align-items: start;
}

@media (min-width: 768px) {
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.team-card {
    display: flex;
    flex-direction: column;
    /* stacked (phones): each member is a block centered on the page —
       full width on a small phone, a fixed 22rem on wider ones — with
       its photo and text left-aligned inside */
    width: 100%;
    max-width: 22rem;
    margin-inline: auto;
}

@media (min-width: 768px) {
    .team-card {
        width: auto;
        max-width: none;
        margin-inline: 0;
    }
}

.team-card__photo {
    display: block;
    /* small, flush-left portrait (13rem = 208px), never wider than the block */
    width: min(100%, 13rem);
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius-sm);
    filter: var(--image-filter-grayscale);
}

/* Three columns: the photo is about half a column wide, flush left
   (and never smaller than 8.5rem, so it holds up on a small tablet). */
@media (min-width: 768px) {
    .team-card__photo {
        width: clamp(8.5rem, 50%, 100%);
    }
}

.team-card__body {
    padding-top: var(--space-4);
    text-align: left;
}

.team-member-name {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-xl);
    line-height: var(--line-height-heading);
    color: var(--color-brand-primary);
}

/* Touch only: scripts/team-cards.js wraps the name in a button that
   toggles the details, with a "+" that turns into an "×" while open
   (motion.css). Devices with a real hover keep a plain heading — no
   "+", no dead control. */
.team-member-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;
    margin: 0;
    padding: var(--space-1) 0;
    border: 0;
    border-radius: var(--radius-none);
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.team-member-toggle::after {
    content: "";
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    color: var(--color-brand-accent);
    background:
        linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
        linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
}

.team-card__title {
    margin: var(--space-2) 0 0;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-base);
    color: var(--color-text-muted);
}

/* Three across: everyone's details sit on the same lines, with Marco's
   card as the standard. His title runs to two lines, so every title
   keeps room for two (a one-line title leaves the second line blank),
   and "Sprachen" starts at the same height in all three cards. */
@media (min-width: 768px) {
    .team-card__title {
        min-height: calc(2em * var(--line-height-base));
    }
}

/* Details (languages, contact): collapsed until the toggle opens the
   card. Height animates via grid-template-rows 0fr -> 1fr, so there's
   no fixed max-height to keep in sync with the copy; `visibility`
   keeps the collapsed links out of the tab order. */
.team-card__details {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
}

.team-card.is-open .team-card__details {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
}

.team-card__details-inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    overflow: clip;
}

.team-card__bio {
    margin: var(--space-3) 0 0;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-base);
    color: var(--color-text-muted);
}

/* Contact, written out typographically: a small letter label and the
   number / address — "E name@…", "T +41 79 …" (e-mail first, so it's on the same line for everyone, with or without a phone number). No icons. The type size
   follows the width of the list (`cqi` = 1% of it, 14px at most) so
   even the longest address (jacqueline@decurtins-management.ch) stays
   on one line; only in a column too narrow for the smallest size may
   it wrap. */
.team-card__contact {
    margin-top: var(--space-2);
    container-type: inline-size;
}

.team-card__contact-link {
    display: flex;
    gap: var(--space-3);
    padding-block: var(--space-2);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    font-size: clamp(0.7rem, 4.6cqi, var(--font-size-sm));
    line-height: var(--line-height-base);
    color: var(--color-brand-primary);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.team-card__contact-label {
    flex: 0 0 1.1em;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-muted);
}


/* Web (a real mouse): the full information — languages and contact —
   is always shown, no hover needed. Touch devices keep the tap-to-open
   accordion above. */
@media (hover: hover) and (pointer: fine) {
    .team-card__details {
        grid-template-rows: 1fr;
        opacity: 1;
        visibility: visible;
    }
}

/* ------------------------------------------------------------------ *
 * Kontakt
 * ------------------------------------------------------------------ */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* same gap as the services layout's two columns */
    gap: var(--layout-gap);
}

@media (min-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.contact-form__row {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.contact-form__label {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    color: var(--color-text-muted);
}

.contact-form__input {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-bg);
    border: var(--border-width-thin) solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
}

.contact-form__textarea {
    resize: vertical;
    min-height: 140px;
    font-family: inherit;
}

.contact-form__submit {
    align-self: flex-start;
    border: none;
    cursor: pointer;
}

/* while sending and during the cooldown after a send (scripts/contact-form.js) */
.contact-form__submit:disabled {
    background: var(--color-charcoal);
    cursor: not-allowed;
}

.contact-form__submit:disabled .hero-cta__icon {
    display: none;
}

/* field messages: empty (no space taken) until a field is invalid */
.contact-form__error {
    margin: 0;
    font-size: var(--font-size-xs);
    color: var(--color-brand-accent);
}

.contact-form__error:empty {
    display: none;
}

.contact-form__input[aria-invalid="true"] {
    border-color: var(--color-brand-accent);
}

/* result line under the button */
.contact-form__status {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-base);
    color: var(--color-text-muted);
}

.contact-form__status:empty {
    display: none;
}

.contact-form__status.is-success {
    color: var(--color-text);
}

.contact-form__status.is-error {
    color: var(--color-brand-accent);
}

/* honeypot: off-screen for people (not display:none, which some bots
   skip), out of the tab order and hidden from screen readers */
.contact-form__hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-7);
    background: var(--color-surface);
    padding: var(--space-7) var(--space-6);
}

.contact-info__block {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.contact-info__heading {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
    color: var(--color-brand-primary);
}

.contact-info__address {
    font-style: normal;
    font-family: var(--font-body);
    line-height: var(--line-height-base);
    color: var(--color-text-muted);
}

.contact-info__address a {
    color: var(--color-link);
    text-decoration: none;
}

.contact-info__address a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

/* ------------------------------------------------------------------ *
 * Back-to-top — sits in normal document flow directly above the
 * footer, right-aligned. No fixed positioning and no JS: it's simply
 * off-screen until a visitor scrolls far enough to reach it, which
 * is exactly "scrolled all the way down."
 * ------------------------------------------------------------------ */

.back-to-top-wrap {
    padding: var(--space-6) var(--page-gutter) var(--space-5);
    display: flex;
    justify-content: flex-end;
}

.back-to-top {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-bg-dark);
    /* matches .site-footer's own background */
    color: var(--color-text-inverse);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.back-to-top__icon {
    font-size: var(--font-size-lg);
    line-height: 1;
}

/* ------------------------------------------------------------------ *
 * Footer (new — the site previously had none)
 * ------------------------------------------------------------------ */

.site-footer {
    background: var(--color-bg-dark);
    color: var(--color-text-inverse);
    padding-block: var(--section-head-space);
}

.footer-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    text-align: center;
}

.footer-brand {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    margin: 0;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-5);
}

.footer-nav a {
    color: var(--color-text-inverse);
    text-decoration: none;
    font-size: var(--font-size-sm);
}

.footer-legal {
    color: var(--color-ink-muted);
    font-size: var(--font-size-xs);
    margin: 0;
}
