/* ═══════════════════════════════════════════════
   Bejco Referencer — Frontend Styles
   Matcher "Leveret og i drift" kort fra forsiden
   ═══════════════════════════════════════════════ */

.br-section {
    --br-blue-deep: #00458a;
    --br-cream: #f7f0da;
    --br-white: #ffffff;

    font-family: 'Source Sans 3', system-ui, sans-serif;
    color: #2a3748;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.br-section *,
.br-section *::before,
.br-section *::after {
    box-sizing: border-box;
}

/* ── Grid: 3 kort per række ── */
.br-section .br-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

@media (max-width: 1024px) {
    .br-section .br-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .br-section .br-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* ── Card ── */
.br-section .br-card {
    position: relative;
    aspect-ratio: 590/420;
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 1px 2px rgba(0, 69, 138, 0.04),
        0 2px 6px rgba(0, 69, 138, 0.04);
    isolation: isolate;
    transition:
        transform 420ms cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 420ms ease;
    cursor: default;
    background: #0a1628;

    /* Stagger entrance — initial state */
    opacity: 0;
    transform: translateY(28px);
    will-change: opacity, transform;
}

/* Stagger entrance — when section becomes visible */
.br-section.is-visible .br-card {
    animation: br-card-in 800ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
    animation-delay: calc(var(--br-i, 0) * 90ms);
}

@keyframes br-card-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (hover: hover) and (pointer: fine) {
    .br-section .br-card:hover {
        box-shadow:
            0 12px 28px rgba(0, 69, 138, 0.08),
            0 24px 56px rgba(0, 69, 138, 0.1);
        transform: translateY(-4px);
    }

    .br-section .br-card:hover .br-card-img {
        transform: scale(1.06);
        filter: saturate(1.05);
    }
}

/* ── Image ── */
.br-section .br-card-img {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.02);
    filter: saturate(0.95);
    transition:
        transform 900ms cubic-bezier(0.23, 1, 0.32, 1),
        filter 600ms ease;
}

.br-section .br-card-img--empty {
    background: linear-gradient(135deg, #0a1628, #00458a);
}

/* ── Gradient overlay ── */
.br-section .br-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(10, 22, 40, 0) 35%,
        rgba(10, 22, 40, 0.4) 60%,
        rgba(10, 22, 40, 0.88) 100%
    );
    pointer-events: none;
}

/* ── Body ── */
.br-section .br-card-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 24px 28px 26px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--br-white);
}

.br-section .br-card-customer {
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--br-cream);
    margin: 0;
}

.br-section .br-card .br-card-text,
.br-section p.br-card-text {
    font-family: 'Oswald', system-ui, sans-serif !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    line-height: 1.35 !important;
    letter-spacing: -0.01em !important;
    color: var(--br-white) !important;
    margin: 0 !important;
    max-width: 440px;
}

@media (max-width: 720px) {
    .br-section .br-card-body {
        padding: 20px 24px 22px;
    }
    .br-section .br-card .br-card-text,
    .br-section p.br-card-text {
        font-size: 0.9375rem !important;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .br-section .br-card,
    .br-section .br-card-img {
        transition: none !important;
        transform: none !important;
        animation: none !important;
        opacity: 1 !important;
    }
}

/* ═══════════════════════════════════════════════
   Bejco Referencer — FRISE / Marquee
   Til shortcode [bejco_referencer_frise]
   ═══════════════════════════════════════════════ */

.br-frise {
    --br-blue-deep: #00458a;
    --br-red: #e2161c;
    --br-cream: #f7f0da;
    --br-white: #ffffff;
    --br-off-white: #fafbfc;
    --br-ink-900: #0a1628;
    --br-ink-500: #5a6578;

    --br-shadow-sm: 0 1px 2px rgba(0, 69, 138, 0.04), 0 2px 6px rgba(0, 69, 138, 0.04);
    --br-shadow-lg: 0 12px 28px rgba(0, 69, 138, 0.08), 0 24px 56px rgba(0, 69, 138, 0.1);

    --br-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --br-ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

    --br-container-max: 1800px;
    --br-gutter: clamp(24px, 5vw, 72px);

    font-family: 'Source Sans 3', system-ui, sans-serif;
    color: var(--br-ink-500);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;

    position: relative;

    /* Containment — prevent the marquee track (which is wider than viewport)
       from causing horizontal page scroll. Multiple layers because some themes
       and page builders set their own overflow rules on parents. */
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    overflow-x: clip;
    overflow-y: visible;
    contain: paint;
}

/* Fallback for browsers without overflow: clip support (~3% globally) */
@supports not (overflow: clip) {
    .br-frise {
        overflow: hidden;
    }
}

.br-frise *,
.br-frise *::before,
.br-frise *::after {
    box-sizing: border-box;
}

.br-frise::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 480px;
    background: radial-gradient(ellipse 60% 100% at center, rgba(40, 133, 193, 0.11), transparent 65%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

.br-frise__container {
    width: 100%;
    max-width: var(--br-container-max);
    margin: 0 auto;
    padding: 0 var(--br-gutter);
    position: relative;
    z-index: 1;
}

/* ── Head ── */
.br-frise__head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.br-frise__heading {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 640px;
}

.br-frise__eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--br-red);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.br-frise__eyebrow::before {
    content: '';
    width: 32px;
    height: 2px;
    background: var(--br-red);
    border-radius: 2px;
}

.br-frise .br-frise__title,
.br-frise h2.br-frise__title {
    font-family: 'Oswald', system-ui, sans-serif !important;
    font-size: clamp(1.875rem, 3.4vw, 2.75rem) !important;
    line-height: 1.1 !important;
    letter-spacing: -0.02em !important;
    color: var(--br-ink-900) !important;
    font-weight: 500 !important;
    margin: 0 !important;
}

.br-frise__title .br-accent {
    color: var(--br-blue-deep);
    font-weight: 600;
}

.br-frise .br-frise__lead,
.br-frise p.br-frise__lead {
    font-size: 1.0625rem !important;
    line-height: 1.65 !important;
    color: var(--br-ink-500) !important;
    margin: 0 !important;
    max-width: 520px;
}

/* ── CTA ── */
.br-frise__cta {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--br-blue-deep);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: color 220ms ease;
}

.br-frise__arrow {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--br-off-white);
    color: var(--br-ink-500);
    transition:
        background-color 320ms ease,
        color 320ms ease,
        transform 420ms var(--br-ease-out);
}

.br-frise__arrow svg {
    width: 12px;
    height: 12px;
}

@media (hover: hover) and (pointer: fine) {
    .br-frise__cta:hover { color: var(--br-red); }
    .br-frise__cta:hover .br-frise__arrow {
        background: var(--br-red);
        color: var(--br-white);
        transform: rotate(-45deg);
    }
}

/* ── Marquee ──
   The track inside is wider than the viewport (width: max-content with many cards).
   We need bulletproof containment so the wide track never expands the parent.
   Strategy:
   1. Explicit width clamped to min(parent, viewport) — track can't push us wider
   2. min-width: 0 — allows shrink past flex-content size
   3. overflow: clip with contain: paint — strongest possible scroll containment
*/
.br-frise__marquee {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    max-width: min(var(--br-container-max), calc(100vw - (var(--br-gutter) * 2)));
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    overflow-x: clip;
    contain: paint;
    border-radius: 24px;
    mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 96px,
        #000 calc(100% - 96px),
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 96px,
        #000 calc(100% - 96px),
        transparent 100%
    );
}

@media (min-width: 1944px) {
    .br-frise__marquee {
        max-width: var(--br-container-max);
    }
}

.br-frise__track {
    display: flex;
    width: max-content;
    gap: 20px;
    transform: translate3d(0, 0, 0);
    transition: transform 900ms var(--br-ease-in-out);
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .br-frise__track { transition: none; }
}

/* ── Item ── */
.br-frise__item {
    position: relative;
    flex-shrink: 0;
    width: clamp(380px, 36vw, 580px);
    aspect-ratio: 590/420;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--br-shadow-sm);
    text-decoration: none;
    color: inherit;
    isolation: isolate;
    background: #0a1628;
    transition:
        transform 420ms var(--br-ease-out),
        box-shadow 420ms ease;
}

.br-frise__img {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.02);
    filter: saturate(0.95);
    transition:
        transform 900ms var(--br-ease-out),
        filter 600ms ease;
}

.br-frise__img--empty {
    background: linear-gradient(135deg, #0a1628, #00458a);
}

.br-frise__item::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg,
        rgba(10, 22, 40, 0) 35%,
        rgba(10, 22, 40, 0.4) 60%,
        rgba(10, 22, 40, 0.88) 100%);
    pointer-events: none;
}

.br-frise__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 24px 28px 26px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--br-white);
}

.br-frise__customer {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--br-cream);
}

.br-frise .br-frise__text,
.br-frise p.br-frise__text {
    font-family: 'Oswald', system-ui, sans-serif !important;
    font-size: 1rem !important;
    line-height: 1.35 !important;
    color: var(--br-white) !important;
    margin: 0 !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em !important;
    max-width: 440px;
}

@media (hover: hover) and (pointer: fine) {
    .br-frise__item:hover {
        box-shadow: var(--br-shadow-lg);
        transform: translateY(-4px);
    }
    .br-frise__item:hover .br-frise__img {
        transform: scale(1.06);
        filter: saturate(1.05);
    }
}

@media (max-width: 720px) {
    .br-frise { padding: 80px 0 100px; }
    .br-frise__marquee {
        mask-image: none;
        -webkit-mask-image: none;
    }
    .br-frise__item {
        width: clamp(300px, 82vw, 420px);
    }
    .br-frise__track { gap: 14px; }
    .br-frise__body { padding: 20px 24px 22px; }
    .br-frise .br-frise__text,
    .br-frise p.br-frise__text {
        font-size: 0.9375rem !important;
    }
}
