/* ═══════════════════════════════════════════════
   Bejco Nyheder — Frontend Styles
   Matcher Bejco-designsystemet (referencer-kort)
   ═══════════════════════════════════════════════ */

.bn-section,
.bn-single {
    --bn-blue-deep: #00458a;
    --bn-blue-bright: #2885c1;
    --bn-red: #e2161c;
    --bn-cream: #f7f0da;
    --bn-white: #ffffff;
    --bn-off-white: #fafbfc;
    --bn-ink-900: #0a1628;
    --bn-ink-700: #2a3748;
    --bn-ink-500: #5a6578;

    --bn-ease-out: cubic-bezier(0.23, 1, 0.32, 1);

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

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

/* ═══════════════════════════════════════════════
   GRID — [bejco_nyheder]
   ═══════════════════════════════════════════════ */

.bn-section .bn-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
}

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

/* ── Card ── */
.bn-section .bn-card {
    display: flex;
    flex-direction: column;
    background: var(--bn-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 1px 2px rgba(0, 69, 138, 0.04),
        0 2px 6px rgba(0, 69, 138, 0.04);
    transition:
        transform 420ms var(--bn-ease-out),
        box-shadow 420ms ease;

    opacity: 0;
    transform: translateY(28px);
    will-change: opacity, transform;
}

.bn-section.is-visible .bn-card {
    animation: bn-card-in 800ms var(--bn-ease-out) forwards;
    animation-delay: calc(var(--bn-i, 0) * 90ms);
}

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

@media (hover: hover) and (pointer: fine) {
    .bn-section .bn-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);
    }
    .bn-section .bn-card:hover .bn-card-img {
        transform: scale(1.06);
        filter: saturate(1.05);
    }
}

/* ── Card media ── */
.bn-section .bn-card-media {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #0a1628;
}

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

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

.bn-section .bn-card-gallery-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(10, 22, 40, 0.78);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    padding: 6px 9px;
    border-radius: 8px;
    letter-spacing: 0.02em;
}

.bn-section .bn-card-gallery-badge svg { width: 13px; height: 13px; }

/* ── Card body ── */
.bn-section .bn-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 24px 26px;
}

.bn-section .bn-card-date {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bn-blue-deep);
}

.bn-section .bn-card-media {
    display: block;
    text-decoration: none;
}

.bn-section .bn-card .bn-card-title,
.bn-section h3.bn-card-title {
    font-family: 'Oswald', system-ui, sans-serif !important;
    font-weight: 500 !important;
    font-size: 1.3125rem !important;
    line-height: 1.22 !important;
    letter-spacing: -0.01em !important;
    color: var(--bn-ink-900) !important;
    margin: 0 !important;
}

.bn-section .bn-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 220ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .bn-section .bn-card-title a:hover { color: var(--bn-blue-deep); }
}

.bn-section .bn-card .bn-card-excerpt,
.bn-section p.bn-card-excerpt {
    font-size: 0.9375rem !important;
    line-height: 1.55 !important;
    color: var(--bn-ink-500) !important;
    margin: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Læs mere CTA ── */
.bn-section .bn-card-cta {
    align-self: flex-start;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--bn-red);
    text-decoration: none;
    transition: gap 320ms var(--bn-ease-out), color 220ms ease;
}

.bn-section .bn-card-cta-arrow {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--bn-cream);
    color: var(--bn-red);
    transition:
        background-color 320ms ease,
        color 320ms ease,
        transform 420ms var(--bn-ease-out);
}

.bn-section .bn-card-cta-arrow svg { width: 12px; height: 12px; }

@media (hover: hover) and (pointer: fine) {
    .bn-section .bn-card:hover .bn-card-cta { gap: 14px; }
    .bn-section .bn-card:hover .bn-card-cta-arrow {
        background: var(--bn-red);
        color: #fff;
        transform: translateX(2px);
    }
}

/* ═══════════════════════════════════════════════
   SINGLE — banner + indhold
   ═══════════════════════════════════════════════ */

.bn-single { padding: 0 0 clamp(56px, 8vw, 96px); }

/* ── Banner (porteret fra [page_banner], bn-prefiks) ── */
.bn-banner {
    position: relative;
    max-width: var(--container-max, 1800px);
    margin: 16px var(--gutter, clamp(24px, 5vw, 72px)) clamp(40px, 6vw, 72px);
    min-height: 480px;
    max-height: 560px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 20px;
    background: #0b1a2d;
    box-shadow: var(--shadow-hero, 0 40px 80px -40px rgba(0, 69, 138, 0.4), 0 0 0 1px rgba(0, 69, 138, 0.06));
    isolation: isolate;
    opacity: 0;
    transform: translateY(40px);
    animation: bn-banner-enter 1100ms var(--bn-ease-out) 100ms forwards;
}

@keyframes bn-banner-enter { to { opacity: 1; transform: translateY(0); } }

@media (min-width: 1944px) {
    .bn-banner { margin-left: auto; margin-right: auto; }
}
@media (max-width: 1100px) {
    .bn-banner { min-height: 420px; }
}
@media (max-width: 960px) {
    .bn-banner { min-height: 380px; border-radius: 14px; }
}
@media (max-width: 560px) {
    .bn-banner { border-radius: 12px; min-height: 340px; }
}

.bn-banner__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: inherit;
}

.bn-banner__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
    opacity: 0;
    transform: scale(1.06);
    animation: bn-banner-img-enter 1800ms var(--bn-ease-out) 200ms forwards;
}

@keyframes bn-banner-img-enter { to { opacity: 1; transform: scale(1); } }

.bn-banner__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background:
        linear-gradient(100deg,
            rgba(0, 69, 138, 0.78) 0%,
            rgba(0, 69, 138, 0.55) 35%,
            rgba(40, 133, 193, 0.28) 65%,
            rgba(247, 240, 218, 0.22) 100%),
        linear-gradient(180deg,
            rgba(10, 22, 40, 0.35) 0%,
            rgba(10, 22, 40, 0) 30%,
            rgba(10, 22, 40, 0) 60%,
            rgba(10, 22, 40, 0.55) 100%);
    pointer-events: none;
}

.bn-banner__grid {
    position: absolute;
    inset: 0;
    z-index: 2;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse at 70% 30%, black 10%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 70% 30%, black 10%, transparent 75%);
    opacity: 0;
    animation: bn-banner-grid-fade 1600ms ease-out 700ms forwards;
    border-radius: inherit;
    pointer-events: none;
}

@keyframes bn-banner-grid-fade { to { opacity: 1; } }

.bn-banner__inner {
    position: relative;
    z-index: 4;
    width: 100%;
    padding: clamp(60px, 9vh, 100px) clamp(32px, 5vw, 72px) clamp(40px, 6vh, 64px);
}
@media (max-width: 960px) {
    .bn-banner__inner { padding-top: clamp(48px, 7vh, 72px); }
}

.bn-banner__text { max-width: 900px; }

.bn-banner__text > * {
    opacity: 0;
    transform: translateY(16px);
    animation: bn-banner-rise 900ms var(--bn-ease-out) forwards;
}
.bn-banner__text > *:nth-child(1) { animation-delay: 600ms; }
.bn-banner__text > *:nth-child(2) { animation-delay: 750ms; }
.bn-banner__text > *:nth-child(3) { animation-delay: 900ms; }

@keyframes bn-banner-rise { to { opacity: 1; transform: translateY(0); } }

.bn-banner__breadcrumb {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
    text-shadow: 0 1px 8px rgba(0, 30, 60, 0.3);
}
.bn-banner__breadcrumb a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: color 220ms ease;
}
.bn-banner__breadcrumb svg {
    width: 12px;
    height: 12px;
    color: var(--bn-cream);
    flex-shrink: 0;
}
.bn-banner__breadcrumb-current {
    color: var(--bn-cream);
    font-weight: 600;
}
@media (hover: hover) and (pointer: fine) {
    .bn-banner__breadcrumb a:hover { color: var(--bn-cream); }
}

.bn-banner__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 0;
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bn-cream);
}
.bn-banner__eyebrow::before {
    content: '';
    width: 28px;
    height: 2px;
    background: var(--bn-red);
    border-radius: 2px;
}

.bn-banner .bn-banner__title,
.bn-banner h1.bn-banner__title {
    margin: 14px 0 0 !important;
    font-family: 'Oswald', system-ui, sans-serif !important;
    font-weight: 600 !important;
    font-size: clamp(1.75rem, 2.8vw, 2.75rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.02em !important;
    color: #ffffff !important;
    text-shadow: 0 2px 24px rgba(0, 30, 60, 0.35);
}

/* ── Indholdscontainer ── */
.bn-single__container {
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(40px, 6vw, 72px) 24px 0;
}

/* Hero image */
.bn-single__hero {
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 36px;
    background: #0a1628;
}

.bn-single__hero-img {
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    cursor: zoom-in;
    transition: transform 900ms var(--bn-ease-out);
}
@media (hover: hover) and (pointer: fine) {
    .bn-single__hero-img:hover { transform: scale(1.03); }
}

/* Body */
.bn-single__body {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--bn-ink-700);
    margin-bottom: 40px;
}
.bn-single__body p { margin: 0 0 1.2em; }
.bn-single__body p:last-child { margin-bottom: 0; }
.bn-single__body a { color: var(--bn-blue-deep); text-decoration: underline; }
.bn-single__body h2,
.bn-single__body h3 {
    font-family: 'Oswald', system-ui, sans-serif;
    font-weight: 500;
    color: var(--bn-ink-900);
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 1.6em 0 0.5em;
}

/* Secondary gallery grid */
.bn-single__gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
@media (max-width: 640px) {
    .bn-single__gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

.bn-single__gallery-item {
    aspect-ratio: 1;
    border: 0;
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    background-color: #0a1628;
    background-size: cover;
    background-position: center;
    cursor: zoom-in;
    transition:
        transform 420ms var(--bn-ease-out),
        box-shadow 420ms ease;
}
@media (hover: hover) and (pointer: fine) {
    .bn-single__gallery-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(0, 69, 138, 0.18);
    }
}

/* ── Tilbage til nyheder ── */
.bn-single__back {
    margin-top: clamp(40px, 6vw, 64px);
    padding-top: 32px;
    border-top: 1px solid rgba(10, 22, 40, 0.08);
}

.bn-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--bn-blue-deep);
    text-decoration: none;
    padding: 13px 22px 13px 16px;
    border-radius: 999px;
    background: var(--bn-cream);
    transition:
        background-color 320ms ease,
        color 320ms ease,
        transform 420ms var(--bn-ease-out);
}

.bn-back-btn__arrow {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--bn-white);
    color: var(--bn-blue-deep);
    transition:
        background-color 320ms ease,
        color 320ms ease,
        transform 420ms var(--bn-ease-out);
}
.bn-back-btn__arrow svg { width: 14px; height: 14px; }

@media (hover: hover) and (pointer: fine) {
    .bn-back-btn:hover {
        background: var(--bn-blue-deep);
        color: #fff;
    }
    .bn-back-btn:hover .bn-back-btn__arrow {
        background: rgba(255, 255, 255, 0.16);
        color: #fff;
        transform: translateX(-2px);
    }
}

/* ═══════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════ */

.bn-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(6, 14, 26, 0.92);
    backdrop-filter: blur(8px);
    cursor: zoom-out;
}
.bn-lightbox.is-open { display: flex; animation: bn-lb-fade 0.22s ease; }

@keyframes bn-lb-fade { from { opacity: 0; } to { opacity: 1; } }

.bn-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: bn-lb-zoom 0.28s var(--bn-ease-out, cubic-bezier(0.23,1,0.32,1));
}

@keyframes bn-lb-zoom {
    from { transform: scale(0.94); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.bn-lightbox__close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}
.bn-lightbox__close:hover { background: rgba(255, 255, 255, 0.22); }
.bn-lightbox__close svg { width: 22px; height: 22px; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .bn-section .bn-card,
    .bn-section .bn-card-img,
    .bn-banner,
    .bn-banner__img,
    .bn-banner__grid,
    .bn-banner__text > *,
    .bn-single__hero-img,
    .bn-single__gallery-item,
    .bn-lightbox__img {
        transition: none !important;
        transform: none !important;
        animation: none !important;
        opacity: 1 !important;
    }
}
