/* ==========================================================================
   Rall Gruppe - Blog stage (blog.html + /blog/thema/*)
   Framed "film still" hero, topic index, filter + search.
   Every hidden start state sits under .mo-js + prefers-reduced-motion:
   no-preference. The featured image (LCP) is never hidden or clipped: its
   entrance is an overlay curtain, its motion is translate/scale only.
   ========================================================================== */

.bs {
    --bs-navy: #0f1829;
    --bs-navy-2: #1a2744;
    --bs-gold: var(--accent, #e6d14d);
    --bs-gold-deep: #8a7a12;
    --bs-ease: var(--mo-ease, cubic-bezier(0.16, 1, 0.3, 1));
    background: var(--bg-secondary, #f8f9fa);
}

/* --------------------------------------------------------------------------
   1. Hero
   -------------------------------------------------------------------------- */
.bs-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 124px 0 clamp(3rem, 6vw, 5.5rem);
    color: #fff;
    background: linear-gradient(160deg, var(--bs-navy-2) 0%, var(--bs-navy) 62%);
}

.bs-hero__bg {
    position: absolute;
    inset: -10% 0 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(48rem 26rem at 88% 8%, rgba(230, 209, 77, 0.16), transparent 70%),
        radial-gradient(40rem 30rem at -5% 100%, rgba(45, 61, 92, 0.9), transparent 70%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 96px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 96px);
    translate: 0 calc(var(--p, 0) * 90px);
}

.bs-crumb {
    margin-bottom: var(--space-8, 2rem);
    color: rgba(255, 255, 255, 0.6);
}

.bs-crumb .breadcrumb__link,
.bs-crumb .breadcrumb__separator {
    color: rgba(255, 255, 255, 0.62);
}

.bs-crumb .breadcrumb__link:hover {
    color: var(--bs-gold);
}

.bs-crumb .breadcrumb__current {
    color: #fff;
}

.bs-hero__intro {
    max-width: 1040px;
}

.bs-eyebrow {
    color: var(--bs-gold);
}

.bs-title {
    margin: var(--space-4, 1rem) 0 var(--space-5, 1.25rem);
    color: #fff;
    font-size: clamp(2.1rem, 1.3rem + 2.8vw, 3.6rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.bs-lead {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.78);
    font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.18rem);
    line-height: 1.7;
}

.bs-products {
    margin-top: var(--space-4, 1rem);
    color: rgba(255, 255, 255, 0.72);
    font-size: var(--text-sm, 0.875rem);
    line-height: 1.8;
}

.bs-products a,
.bs-cta__text a {
    color: var(--bs-gold);
    text-decoration: underline;
    text-decoration-color: rgba(230, 209, 77, 0.4);
    text-underline-offset: 3px;
}

.bs-products a:hover,
.bs-cta__text a:hover {
    text-decoration-color: currentColor;
}

.bs-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3, 0.75rem);
    margin: var(--space-8, 2rem) 0 0;
    padding: 0;
    list-style: none;
}

.bs-stats li {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-full, 9999px);
    color: rgba(255, 255, 255, 0.78);
    font-size: var(--text-sm, 0.875rem);
    background: rgba(255, 255, 255, 0.04);
}

.bs-stats strong {
    color: var(--bs-gold);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   2. Featured post as a framed film still
   -------------------------------------------------------------------------- */
.bs-feature {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(1.75rem, 4vw, 3.5rem);
    align-items: center;
    margin-top: clamp(2.25rem, 4vw, 3.25rem);
}

.bs-frame {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-xl, 1rem);
    background: #0b1220;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.bs-frame picture {
    position: absolute;
    inset: 0;
    display: block;
    scale: calc(1 + var(--p, 0) * 0.08);
}

.bs-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* letterbox bars: decorative, they never cover more than 7 % per edge */
.bs-frame__bars::before,
.bs-frame__bars::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: 2;
    height: 7%;
    background: #05080f;
    pointer-events: none;
}

.bs-frame__bars::before {
    top: 0;
    transform-origin: 50% 0;
}

.bs-frame__bars::after {
    bottom: 0;
    transform-origin: 50% 100%;
}

.bs-frame__corners {
    position: absolute;
    inset: 9% 3.5%;
    z-index: 3;
    pointer-events: none;
    --c: rgba(230, 209, 77, 0.85);
    --l: 22px;
    background:
        linear-gradient(var(--c), var(--c)) 0 0 / var(--l) 2px,
        linear-gradient(var(--c), var(--c)) 0 0 / 2px var(--l),
        linear-gradient(var(--c), var(--c)) 100% 0 / var(--l) 2px,
        linear-gradient(var(--c), var(--c)) 100% 0 / 2px var(--l),
        linear-gradient(var(--c), var(--c)) 0 100% / var(--l) 2px,
        linear-gradient(var(--c), var(--c)) 0 100% / 2px var(--l),
        linear-gradient(var(--c), var(--c)) 100% 100% / var(--l) 2px,
        linear-gradient(var(--c), var(--c)) 100% 100% / 2px var(--l);
    background-repeat: no-repeat;
}

.bs-frame__hud {
    position: absolute;
    left: 5.5%;
    right: 5.5%;
    bottom: 11%;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.bs-frame__rec {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bs-gold);
    box-shadow: 0 0 0 4px rgba(230, 209, 77, 0.25);
}

.bs-frame__track {
    position: relative;
    flex: 1;
    height: 2px;
    margin-left: 0.5rem;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.28);
}

.bs-frame__track span {
    position: absolute;
    inset: 0;
    background: var(--bs-gold);
    transform-origin: 0 50%;
    scale: 0.35 1;
}

/* curtain over the still: an overlay, the image itself stays painted */
.bs-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(120deg, var(--bs-navy-2), var(--bs-navy));
    clip-path: inset(0 0 0 100%);
}

.bs-feature__content {
    color: rgba(255, 255, 255, 0.8);
}

.bs-feature__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: var(--space-4, 1rem);
    color: rgba(255, 255, 255, 0.62);
    font-size: var(--text-sm, 0.875rem);
}

.bs-feature .blog-featured__title {
    margin-bottom: var(--space-4, 1rem);
    color: #fff;
    font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.35rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.015em;
}

.bs-feature .blog-featured__excerpt {
    margin-bottom: var(--space-6, 1.5rem);
    line-height: 1.7;
}

.bs-feature__cta svg,
.bs-topic__more svg,
.blog-card__link svg {
    width: 18px;
    height: 18px;
}

.bs-feature__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   3. Index: tools, chips, topic groups
   -------------------------------------------------------------------------- */
.bs-index {
    padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem);
}

.bs-index__head {
    max-width: 760px;
    margin-bottom: var(--space-6, 1.5rem);
}

.bs-index__title {
    margin-top: var(--space-3, 0.75rem);
    color: var(--text-primary, #1a2744);
    font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.bs-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4, 1rem);
    padding: var(--space-4, 1rem);
    border: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
    border-radius: var(--radius-xl, 1rem);
    background: #fff;
    box-shadow: var(--shadow-md);
}

.bs-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 280px;
    max-width: 420px;
}

.bs-search svg {
    position: absolute;
    left: 0.9rem;
    width: 18px;
    height: 18px;
    color: var(--text-muted, #7a7a8a);
    pointer-events: none;
}

.bs-search input {
    width: 100%;
    min-height: 46px;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    border: 1px solid var(--border-medium, rgba(0, 0, 0, 0.12));
    border-radius: var(--radius-full, 9999px);
    color: var(--text-primary, #1a2744);
    font: inherit;
    font-size: 0.95rem;
    background: var(--bg-secondary, #f8f9fa);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.bs-search input:focus {
    outline: none;
    border-color: var(--primary, #1a2744);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(230, 209, 77, 0.35);
}

.bs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 999 1 420px;
}

.bs-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0.45rem 0.95rem;
    border: 1px solid var(--border-medium, rgba(0, 0, 0, 0.12));
    border-radius: var(--radius-full, 9999px);
    color: var(--text-primary, #1a2744);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.25s var(--bs-ease), color 0.25s, border-color 0.25s, translate 0.35s var(--bs-ease);
}

.bs-chip:hover {
    border-color: var(--primary, #1a2744);
    translate: 0 -2px;
}

.bs-chip:focus-visible,
.bs-reset:focus-visible,
.blog-card__title a:focus-visible {
    outline: 3px solid var(--bs-gold);
    outline-offset: 3px;
}

.bs-chip__n {
    min-width: 1.6em;
    padding: 0.05rem 0.4rem;
    border-radius: var(--radius-full, 9999px);
    color: var(--text-secondary, #4a4a5a);
    font-size: 0.75rem;
    text-align: center;
    background: var(--bg-tertiary, #e9ecef);
}

.bs-chip.is-active,
.bs-chip[aria-pressed="true"] {
    border-color: var(--primary, #1a2744);
    color: #fff;
    background: var(--primary, #1a2744);
}

.bs-chip.is-active .bs-chip__n,
.bs-chip[aria-pressed="true"] .bs-chip__n {
    color: var(--primary, #1a2744);
    background: var(--bs-gold);
}

.bs-count {
    margin: var(--space-5, 1.25rem) 0 var(--space-2, 0.5rem);
    color: var(--text-muted, #7a7a8a);
    font-size: var(--text-sm, 0.875rem);
}

.bs-count span {
    color: var(--text-primary, #1a2744);
    font-weight: 700;
}

.bs-topic {
    padding-top: clamp(2rem, 4vw, 3rem);
}

.bs-topic__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 1.25rem;
    margin-bottom: var(--space-6, 1.5rem);
    padding-left: 1rem;
    border-left: 3px solid var(--bs-gold);
}

.bs-topic__title {
    margin: 0;
    color: var(--text-primary, #1a2744);
    font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -0.01em;
}

.bs-topic__short {
    flex: 1 1 320px;
    margin: 0;
    color: var(--text-secondary, #4a4a5a);
    font-size: 0.95rem;
}

.bs-topic__more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--bs-gold-deep);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: gap 0.3s var(--bs-ease);
}

.bs-topic__more:hover {
    gap: 0.7rem;
    color: var(--primary, #1a2744);
}

.bs .blog-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: clamp(1.25rem, 2.2vw, 2rem);
}

/* filtered: one flat grid, group headers out of the way */
.bs.is-filtered .bs-groups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: clamp(1.25rem, 2.2vw, 2rem);
    padding-top: var(--space-4, 1rem);
}

.bs.is-filtered .bs-topic,
.bs.is-filtered .bs-topic .blog-grid {
    display: contents;
}

.bs.is-filtered .bs-topic__head {
    display: none;
}

.bs-topic[hidden],
.blog-card[hidden] {
    display: none !important;
}

.bs-empty {
    margin-top: var(--space-6, 1.5rem);
    padding: var(--space-8, 2rem);
    border: 1px dashed var(--border-medium, rgba(0, 0, 0, 0.12));
    border-radius: var(--radius-xl, 1rem);
    color: var(--text-secondary, #4a4a5a);
    text-align: center;
    background: #fff;
}

.bs-reset {
    padding: 0;
    border: 0;
    color: var(--primary, #1a2744);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    background: none;
    cursor: pointer;
}

.bs-hubnav {
    margin-top: clamp(2.5rem, 5vw, 4rem);
    padding-top: var(--space-6, 1.5rem);
    border-top: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
}

.bs-hubnav__title {
    margin-bottom: var(--space-3, 0.75rem);
    color: var(--text-primary, #1a2744);
    font-weight: 700;
}

.bs-hubnav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* --------------------------------------------------------------------------
   4. Cards
   -------------------------------------------------------------------------- */
.bs .blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-xl, 1rem);
    background: #fff;
    box-shadow: var(--shadow-md);
    transition: translate 0.55s var(--bs-ease), box-shadow 0.35s;
}

.bs .blog-card:hover {
    box-shadow: 0 24px 48px -18px rgba(15, 24, 41, 0.35);
}

html:not(.mo-js) .bs .blog-card:hover {
    translate: 0 -6px;
}

.bs .blog-card__image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #e9edf4;
}

.bs .blog-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: scale 0.9s var(--bs-ease);
}

.bs .blog-card:hover .blog-card__image img {
    scale: 1.06;
}

/* gold wipe along the image's lower edge on hover */
.bs .blog-card__image::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--bs-gold);
    transform-origin: 0 50%;
    scale: 0 1;
    transition: scale 0.6s var(--bs-ease);
}

.bs .blog-card:hover .blog-card__image::after,
.bs .blog-card:focus-within .blog-card__image::after {
    scale: 1 1;
}

.bs .blog-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: var(--space-5, 1.25rem) var(--space-6, 1.5rem) var(--space-6, 1.5rem);
}

.bs .blog-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    margin-bottom: var(--space-3, 0.75rem);
    color: var(--text-muted, #7a7a8a);
    font-size: 0.8rem;
}

.bs .blog-card__category {
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full, 9999px);
    color: var(--bs-gold-deep);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(230, 209, 77, 0.18);
}

.bs .blog-card__time::before {
    content: "·";
    margin-right: 0.75rem;
}

.bs .blog-card__title {
    margin-bottom: var(--space-3, 0.75rem);
    color: var(--text-primary, #1a2744);
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
}

.bs .blog-card__title a {
    color: inherit;
    text-decoration: none;
}

/* the whole card is the click target, the link text stays the real anchor */
.bs .blog-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
}

.bs .blog-card__excerpt {
    flex: 1;
    margin-bottom: var(--space-4, 1rem);
    color: var(--text-secondary, #4a4a5a);
    font-size: 0.9rem;
    line-height: 1.65;
}

.bs .blog-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--primary, #1a2744);
    font-size: 0.9rem;
    font-weight: 700;
    transition: gap 0.3s var(--bs-ease);
}

.bs .blog-card:hover .blog-card__link {
    gap: 0.8rem;
}

/* --------------------------------------------------------------------------
   5. CTA
   -------------------------------------------------------------------------- */
.bs-cta {
    padding: 0 0 clamp(3.5rem, 7vw, 6rem);
}

.bs-cta__inner {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 4rem);
    border-radius: calc(var(--radius-xl, 1rem) * 1.5);
    color: rgba(255, 255, 255, 0.8);
    background:
        radial-gradient(36rem 20rem at 100% 0%, rgba(230, 209, 77, 0.18), transparent 70%),
        linear-gradient(150deg, var(--bs-navy-2), var(--bs-navy));
}

.bs-cta__title {
    max-width: 760px;
    margin: var(--space-3, 0.75rem) 0 var(--space-4, 1rem);
    color: #fff;
    font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.4rem);
    font-weight: 800;
    line-height: 1.15;
}

.bs-cta__text {
    max-width: 680px;
    line-height: 1.7;
}

.bs-cta__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3, 0.75rem);
    margin-top: var(--space-6, 1.5rem);
}

.bs-cta__ghost {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    background: transparent;
}

.bs-cta__ghost:hover {
    border-color: var(--bs-gold);
    color: var(--primary, #1a2744);
    background: var(--bs-gold);
}

/* --------------------------------------------------------------------------
   6. Motion (only with JS and without a reduced-motion preference)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {

    /* slow Ken Burns drift on the featured still; paused offscreen via data-mo-pause */
    .bs-frame picture {
        animation: bs-kenburns 22s ease-in-out infinite alternate;
    }

    .bs-frame__track span {
        animation: bs-track 22s linear infinite alternate;
    }

    .bs-frame__rec {
        animation: bs-rec 1.6s steps(2, jump-none) infinite;
    }

    .mo-js .bs-frame::after {
        animation: bs-curtain 1.15s var(--mo-ease-io, cubic-bezier(0.7, 0, 0.2, 1)) 0.15s both;
    }

    .mo-js .bs-frame__bars::before,
    .mo-js .bs-frame__bars::after {
        animation: bs-bars 1.2s var(--bs-ease) 0.9s both;
    }

    .mo-js .bs-frame__corners,
    .mo-js .bs-frame__hud {
        animation: bs-fade 0.9s var(--bs-ease) 1.3s both;
    }

    /* cards re-entering after a filter change: clip-path wipe, staggered by --k */
    .bs .blog-card.bs-enter {
        animation: bs-card-in 0.7s var(--bs-ease) calc(min(var(--k, 0), 12) * 45ms) both;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bs-hero__bg,
    .bs-frame picture {
        translate: none;
        scale: none;
    }
}

@keyframes bs-kenburns {
    from {
        translate: 0 0;
    }

    to {
        translate: -2.5% -1.5%;
    }
}

/* scale headroom for the drift, kept apart from the scroll-linked scale above */
.bs-frame img {
    scale: 1.06;
}

@keyframes bs-track {
    from {
        scale: 0.04 1;
    }

    to {
        scale: 1 1;
    }
}

@keyframes bs-rec {
    50% {
        opacity: 0.25;
    }
}

@keyframes bs-curtain {
    from {
        clip-path: inset(0 0 0 0);
    }

    to {
        clip-path: inset(0 0 0 100%);
    }
}

@keyframes bs-bars {
    from {
        scale: 1 0;
    }

    to {
        scale: 1 1;
    }
}

@keyframes bs-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes bs-card-in {
    from {
        opacity: 0;
        clip-path: inset(0 0 22% 0 round var(--radius-xl, 1rem));
        translate: 0 18px;
    }

    to {
        opacity: 1;
        clip-path: inset(0 0 0 0 round var(--radius-xl, 1rem));
        translate: 0 0;
    }
}

/* --------------------------------------------------------------------------
   7. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
    .bs-feature {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .bs-hero {
        padding-top: 112px;
    }

    .bs-frame {
        aspect-ratio: 4 / 3;
    }

    .bs-frame__hud {
        font-size: 0.62rem;
    }

    .bs-tools {
        padding: var(--space-3, 0.75rem);
    }

    .bs-search {
        max-width: none;
    }

    /* chips scroll sideways instead of stacking five rows deep */
    .bs-chips {
        flex-wrap: nowrap;
        margin: 0 calc(var(--space-3, 0.75rem) * -1);
        padding: 0 var(--space-3, 0.75rem) 0.25rem;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .bs-chips::-webkit-scrollbar {
        display: none;
    }

    .bs-chip {
        flex: none;
    }
}

.bs-feature__meta .badge {
    color: var(--primary, #1a2744);
    background: var(--bs-gold);
}
