/* BN Referencer – forside */
.bnref {
	--bnref-accent: #2563eb;
	--bnref-cols: 3;
	--bnref-radius: 14px;
	--bnref-text: inherit;
	--bnref-muted: rgba(127, 127, 127, .95);
	--bnref-line: rgba(127, 127, 127, .22);
	--bnref-card: rgba(127, 127, 127, .06);
	margin: 1.5em 0;
}
.bnref *, .bnref-modal * { box-sizing: border-box; }

/* Filter */
.bnref-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.bnref-filter button {
	appearance: none; cursor: pointer; font: inherit; font-size: .9em; line-height: 1;
	padding: .65em 1.15em; border-radius: 999px; border: 1px solid var(--bnref-line);
	background: transparent; color: inherit; transition: all .15s;
}
.bnref-filter button:hover { border-color: var(--bnref-accent); color: var(--bnref-accent); }
.bnref-filter button.is-active { background: var(--bnref-accent); border-color: var(--bnref-accent); color: #fff; }

/* Grid */
.bnref-grid { display: grid; grid-template-columns: repeat(var(--bnref-cols), minmax(0, 1fr)); gap: 26px; }
@media (max-width: 960px) { .bnref-grid { grid-template-columns: repeat(min(var(--bnref-cols), 2), minmax(0, 1fr)); } }
@media (max-width: 600px) { .bnref-grid { grid-template-columns: 1fr; } }

.bnref-card {
	display: flex; flex-direction: column; overflow: hidden;
	border: 1px solid var(--bnref-line); border-radius: var(--bnref-radius); background: var(--bnref-card);
	transition: transform .2s ease, box-shadow .2s ease, opacity .25s ease;
}
.bnref-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0, 0, 0, .14); }
.bnref-card.is-hidden { display: none; }
.bnref-card.is-featured { border-color: var(--bnref-accent); }

.bnref-card-img {
	position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; padding: 0; margin: 0;
	border: 0; border-bottom: 1px solid var(--bnref-line); background: rgba(127,127,127,.12);
	cursor: zoom-in; overflow: hidden;
}
.bnref-card-img img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform .5s ease, object-position 3s ease; }
.bnref-card:hover .bnref-card-img img { transform: scale(1.04); }
.bnref-noimg { display: flex; align-items: center; justify-content: center; height: 100%; padding: 1em; font-weight: 700; font-size: 1.2em; color: var(--bnref-muted); }
.bnref-zoom {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	background: rgba(0, 0, 0, .45); color: #fff; font-weight: 600; letter-spacing: .02em; opacity: 0; transition: opacity .2s;
}
.bnref-card-img:hover .bnref-zoom, .bnref-card-img:focus-visible .bnref-zoom { opacity: 1; }
.bnref-badge, .bnref-count {
	position: absolute; top: 12px; z-index: 1; font-size: 12px; font-weight: 600; line-height: 1;
	padding: 6px 10px; border-radius: 999px; color: #fff;
}
.bnref-badge { left: 12px; background: var(--bnref-accent); }
.bnref-count { right: 12px; background: rgba(0, 0, 0, .6); }

.bnref-card-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.bnref-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bnref-tags span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--bnref-accent); }
.bnref-tags span + span::before { content: "·"; margin-right: 6px; color: var(--bnref-muted); }
.bnref .bnref-title { margin: 0 0 4px; font-size: 1.2em; line-height: 1.3; }
.bnref .bnref-meta { margin: 0 0 8px; font-size: .88em; color: var(--bnref-muted); }
.bnref .bnref-opgave { margin: 0 0 8px; font-size: .92em; font-weight: 600; }
.bnref .bnref-excerpt { margin: 0 0 16px; font-size: .95em; line-height: 1.55; opacity: .9; }
.bnref-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }

.bnref-btn, .bnref-modal .bnref-btn {
	display: inline-flex; align-items: center; gap: .35em; appearance: none; cursor: pointer;
	font: inherit; font-size: .9em; font-weight: 600; line-height: 1; text-decoration: none !important;
	padding: .8em 1.2em; border-radius: 8px; border: 1px solid var(--bnref-accent);
	background: var(--bnref-accent); color: #fff !important; transition: filter .15s, background .15s;
}
.bnref-btn:hover { filter: brightness(1.1); }
.bnref-btn-ghost { background: transparent; color: var(--bnref-accent) !important; }
.bnref-btn-ghost:hover { background: var(--bnref-accent); color: #fff !important; filter: none; }
.bnref-none { padding: 1em; border: 1px dashed var(--bnref-line); border-radius: 8px; }

/* Enkelt reference */
.bnref-single { margin-top: 0; }
.bnref-single-info { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 34px; padding: 18px 22px; margin-bottom: 22px; border: 1px solid var(--bnref-line); border-radius: var(--bnref-radius); background: var(--bnref-card); }
.bnref-single-info span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--bnref-muted); }
.bnref-single-btn { margin-left: auto; }
.bnref-single-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 26px; }
.bnref-single-thumb { padding: 0; border: 1px solid var(--bnref-line); border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; cursor: zoom-in; background: none; }
.bnref-single-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform .3s; }
.bnref-single-thumb:hover img { transform: scale(1.05); }
.bnref-quote { margin: 2em 0; padding: 1.2em 1.5em; border-left: 4px solid var(--bnref-accent, #2563eb); background: rgba(127,127,127,.07); border-radius: 0 10px 10px 0; font-style: italic; }
.bnref-quote cite { display: block; margin-top: .6em; font-style: normal; font-weight: 600; font-size: .9em; }

/* Modal / lightbox */
.bnref-modal {
	position: fixed; inset: 0; z-index: 999999; display: none; align-items: center; justify-content: center;
	padding: 3vh 3vw; background: rgba(10, 12, 16, .86); backdrop-filter: blur(4px);
	font-family: inherit; color: #1d2327;
}
.bnref-modal.is-open { display: flex; animation: bnrefFade .2s ease; }
@keyframes bnrefFade { from { opacity: 0; } to { opacity: 1; } }
.bnref-modal-box {
	position: relative; display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr);
	width: 100%; max-width: 1240px; max-height: 94vh; overflow: hidden; border-radius: 16px; background: #fff;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.bnref-modal-media { position: relative; display: flex; flex-direction: column; min-height: 0; background: #0f1115; }
.bnref-modal-stage { position: relative; flex: 1; min-height: 0; overflow: auto; display: flex; align-items: flex-start; justify-content: center; }
.bnref-modal-stage img { width: 100%; height: auto; display: block; }
.bnref-modal-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; background: #0b0c0f; }
.bnref-modal-thumbs button { flex: 0 0 auto; width: 84px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; opacity: .55; background: #222; transition: opacity .15s; }
.bnref-modal-thumbs button.is-active, .bnref-modal-thumbs button:hover { opacity: 1; border-color: var(--bnref-accent); }
.bnref-modal-thumbs img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.bnref-nav {
	position: absolute; top: 50%; z-index: 2; width: 44px; height: 44px; margin-top: -22px; padding: 0;
	border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #111; font-size: 22px; line-height: 44px;
	cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.bnref-prev { left: 14px; } .bnref-next { right: 14px; }
.bnref-nav[hidden] { display: none; }
.bnref-modal-info { padding: 30px 28px; overflow-y: auto; }
.bnref-modal-info .bnref-tags { margin-bottom: 8px; }
.bnref-modal-info h2 { margin: 0 0 6px; font-size: 1.6em; line-height: 1.2; color: #111; }
.bnref-modal-host { margin: 0 0 16px; font-size: .92em; color: #646970; }
.bnref-modal-facts { display: grid; gap: 10px; margin: 0 0 18px; padding: 14px 16px; border-radius: 10px; background: #f6f7f7; }
.bnref-modal-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: .92em; }
.bnref-modal-facts span { color: #646970; }
.bnref-modal-text { font-size: .96em; line-height: 1.6; }
.bnref-modal-text img { max-width: 100%; height: auto; }
.bnref-modal-info .bnref-quote { margin: 1.4em 0; }
.bnref-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.bnref-close {
	position: absolute; top: 12px; right: 12px; z-index: 3; width: 38px; height: 38px; padding: 0;
	border: 0; border-radius: 50%; background: rgba(0, 0, 0, .06); color: #111; font-size: 24px; line-height: 38px; cursor: pointer;
}
.bnref-close:hover { background: rgba(0, 0, 0, .12); }
body.bnref-lock { overflow: hidden; }

@media (max-width: 860px) {
	.bnref-modal { padding: 0; }
	.bnref-modal-box { grid-template-columns: 1fr; max-height: 100vh; height: 100%; border-radius: 0; overflow-y: auto; }
	.bnref-modal-stage { max-height: 55vh; }
	.bnref-close { background: rgba(255,255,255,.9); }
}
