/*
 * NFHB Umsjón 1.7.0: homepage content.
 *  [nfhb_valinn_vidburdur]      the featured event band (.nfhb-vv)
 *  [nfhb_myndir snid="hetja"]   the hero collage (.nfhb-myndir--hetja)
 *  [nfhb_myndir snid="safn"]    "Félagslífið í myndum" (.nfhb-myndir--safn)
 * Colours and shapes of draft homepage 1397 (navy #084b7f, deep navy #053253, red #b22f31, 5–8px radii).
 * The font is inherited from the page.
 */

:root .elementor-widget-shortcode:has(.nfhb-vv-tomt[hidden]),
:root .elementor-widget-shortcode:has(.nfhb-myndir-tomt[hidden]),
:root .nfhb-myndir-hluti:has(.nfhb-myndir-tomt[hidden]) {
	display: none; /* nothing to show: no empty block, gap or spacer is left */
}

.nfhb-vv-tomt--ritill,
.nfhb-myndir-tomt--ritill,
.nfhb-vv-villa,
.nfhb-myndir-villa {
	display: block;
	padding: 12px 16px;
	border: 2px dashed #b22f31;
	border-radius: 6px;
	color: #b22f31;
	font-size: 13px;
	font-weight: 700;
}

.nfhb-vv,
.nfhb-myndir {
	--nfhb-f-navy: #084b7f;
	--nfhb-f-deep: #053253;
	--nfhb-f-red: #b22f31;
	box-sizing: border-box;
}

.nfhb-vv *,
.nfhb-vv *::before,
.nfhb-vv *::after,
.nfhb-myndir *,
.nfhb-myndir *::before,
.nfhb-myndir *::after {
	box-sizing: border-box;
}

.nfhb-vv .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Featured event                                                       */
/* ------------------------------------------------------------------ */

:root .elementor-widget-shortcode:has(.nfhb-vv) {
	width: 100%;
}

.nfhb-vv {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
	width: 100%;
	margin: 56px 0 0;
	overflow: hidden;
	border-radius: 10px;
	background: var(--nfhb-f-deep);
	color: #fff;
	box-shadow: 0 18px 48px rgba(5, 50, 83, 0.22);
}

.nfhb-vv p,
.nfhb-vv h2,
.nfhb-vv h3 {
	margin: 0;
	padding: 0;
}

/* 1.7.1: the page font, not the Elementor kit's heading font (".elementor-kit-N h2": Playfair Display on nfhb.is). */
:root .nfhb-vv :is(h2, h3, p, a, span) {
	font-family: inherit;
}

.nfhb-vv__mynd {
	position: relative;
	min-height: 320px;
	background:
		repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 18px),
		linear-gradient(140deg, #084b7f, #053253 70%);
}

.nfhb-vv .nfhb-vv__img,
.nfhb-vv .nfhb-vv__mynd-tom {
	position: absolute;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
}

.nfhb-vv__dags {
	position: absolute;
	left: 22px;
	top: 22px;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 76px;
	padding: 10px 12px 8px;
	border-top: 5px solid var(--nfhb-f-red);
	border-radius: 6px;
	background: #fff;
	color: var(--nfhb-f-navy);
	box-shadow: 0 4px 14px rgba(5, 50, 83, 0.25);
	line-height: 1;
	text-align: center;
}

.nfhb-vv .nfhb-vv__dagur {
	font-size: 36px;
	font-weight: 800;
	letter-spacing: -0.03em;
}

.nfhb-vv .nfhb-vv__manudur {
	margin-top: 4px;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.nfhb-vv__efni {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 14px;
	padding: 44px 48px;
}

.nfhb-vv__efni::before {
	content: "";
	position: absolute;
	top: 0;
	right: 48px;
	width: 64px;
	height: 6px;
	background: var(--nfhb-f-red);
}

.nfhb-vv .nfhb-vv__yfirlina {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.nfhb-vv__yfirlina > span:first-child::before {
	content: "";
	display: inline-block;
	width: 28px;
	height: 3px;
	margin-right: 10px;
	vertical-align: middle;
	background: var(--nfhb-f-red);
}

.nfhb-vv .nfhb-vv__felag {
	padding: 4px 9px 4px 8px;
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-left-width: 4px;
	border-radius: 4px;
	font-size: 11px;
	letter-spacing: 0.08em;
}

.nfhb-vv__felag--justitia { border-left-color: #e0565a; }
.nfhb-vv__felag--verus { border-left-color: #8cc2ea; }
.nfhb-vv__felag--merkur,
.nfhb-vv__felag--nfhb { border-left-color: #fff; }

.nfhb-vv .nfhb-vv__titill {
	font-size: 36px;
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -0.03em;
	overflow-wrap: anywhere;
}

.nfhb-vv .nfhb-vv__titill a {
	color: #fff;
	text-decoration: none;
	background-image: linear-gradient(var(--nfhb-f-red), var(--nfhb-f-red));
	background-position: 0 100%;
	background-repeat: no-repeat;
	background-size: 0 3px;
	transition: background-size 0.25s;
}

.nfhb-vv .nfhb-vv__titill a:hover,
.nfhb-vv .nfhb-vv__titill a:focus-visible {
	color: #fff;
	background-size: 100% 3px;
}

.nfhb-vv a:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.nfhb-vv .nfhb-vv__hvenaer {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	color: rgba(255, 255, 255, 0.88);
	font-size: 15px;
	line-height: 1.5;
}

.nfhb-vv__timi::before,
.nfhb-vv__stadur::before {
	margin-right: 7px;
	color: #e0565a;
	font-weight: 800;
}

.nfhb-vv__timi::before { content: "◷"; }
.nfhb-vv__stadur::before { content: "⌖"; }

.nfhb-vv__hnappar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
}

.nfhb-vv a.nfhb-vv__nanar,
:root .nfhb-vv .nfhb-skraning .nfhb-skraning__takki {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 45px;
	padding: 12px 19px;
	border: 1px solid var(--nfhb-f-red);
	border-radius: 5px;
	background: var(--nfhb-f-red);
	color: #fff;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none;
	transition: box-shadow 0.2s, background-color 0.2s;
}

.nfhb-vv a.nfhb-vv__nanar:hover {
	color: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* The existing registration buttons (Event_Registration), as white outline buttons on navy
   (:root and the wrapper class: above skraning.css). */
:root .nfhb-vv .nfhb-skraning {
	display: contents;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
}

:root .nfhb-vv .nfhb-skraning .nfhb-skraning__takki,
:root .nfhb-vv .nfhb-skraning .nfhb-skraning__takki:visited {
	width: auto;
	border-color: rgba(255, 255, 255, 0.85);
	background: transparent;
	color: #fff;
}

:root .nfhb-vv .nfhb-skraning .nfhb-skraning__takki:hover,
:root .nfhb-vv .nfhb-skraning .nfhb-skraning__takki:focus-visible {
	border-color: #fff;
	background: #fff;
	color: var(--nfhb-f-deep);
}

:root .nfhb-vv .nfhb-skraning .nfhb-skraning__takki:focus {
	outline-color: #fff;
}

.nfhb-vv .nfhb-skraning__nytt {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

/* Cancelled: AFLÝST stamp, greyed photo, the existing notice; no registration buttons (not rendered). */
.nfhb-vv--aflyst .nfhb-vv__img {
	filter: grayscale(1);
	opacity: 0.45;
}

.nfhb-vv--aflyst .nfhb-vv__dags {
	border-top-color: #6b7a88;
	color: #6b7a88;
}

.nfhb-vv .nfhb-vv__stimpill {
	position: absolute;
	left: 50%;
	top: 50%;
	padding: 10px 22px;
	border: 3px solid #fff;
	border-radius: 6px;
	background: var(--nfhb-f-red);
	color: #fff;
	font-size: 30px;
	font-weight: 800;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	transform: translate(-50%, -50%) rotate(-8deg);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.nfhb-vv--aflyst .nfhb-vv__titill a {
	color: rgba(255, 255, 255, 0.8);
}

.nfhb-vv .nfhb-aflyst-tilkynning {
	margin: 0;
	padding: 10px 14px;
	border: 0;
	border-left: 5px solid var(--nfhb-f-red);
	border-radius: 4px;
	background: #fff;
	color: #7d1c1e;
	font-size: 14px;
	line-height: 1.45;
}

.nfhb-vv .nfhb-aflyst-tilkynning__ord {
	margin-right: 6px;
	color: var(--nfhb-f-red);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.nfhb-vv--aflyst a.nfhb-vv__nanar {
	border-color: rgba(255, 255, 255, 0.85);
	background: transparent;
}

/* ------------------------------------------------------------------ */
/* Hero collage                                                         */
/* ------------------------------------------------------------------ */

:root .elementor-widget-shortcode:has(.nfhb-myndir--hetja) {
	flex: 1 1 auto;
	width: 100%;
}

.nfhb-myndir--hetja {
	width: 100%;
	max-width: 520px;
	margin: 0 auto;
}

.nfhb-myndir--merki {
	display: flex;
	justify-content: center;
}

.nfhb-myndir .nfhb-myndir__merki { /* two classes: above Elementor's ".elementor img" */
	width: 100%;
	max-width: 300px;
	height: auto;
}

.nfhb-myndir__klippimynd {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 0.92;
}

.nfhb-myndir__ramma {
	position: absolute;
	margin: 0;
	overflow: hidden;
	border: 8px solid #fff;
	border-radius: 6px;
	background: #e7edf3;
	box-shadow: 0 14px 38px rgba(5, 50, 83, 0.24);
	transition: transform 0.35s ease;
}

.nfhb-myndir__ramma .nfhb-myndir__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nfhb-myndir__hreim {
	position: absolute;
	right: 6%;
	bottom: 2%;
	z-index: 0;
	width: 34%;
	aspect-ratio: 1;
	border-radius: 6px;
	background: var(--nfhb-f-red);
}

.nfhb-myndir__hreim::after {
	content: "";
	position: absolute;
	left: -132%;
	top: -150%;
	width: 52%;
	aspect-ratio: 1;
	border: 3px solid var(--nfhb-f-navy);
	border-radius: 6px;
}

/* Three photos. */
.nfhb-myndir--n3 .nfhb-myndir__ramma--1 { left: 6%; top: 0; z-index: 2; width: 58%; height: 70%; transform: rotate(-3deg); }
.nfhb-myndir--n3 .nfhb-myndir__ramma--2 { right: 0; top: 16%; z-index: 3; width: 42%; height: 50%; transform: rotate(4deg); }
.nfhb-myndir--n3 .nfhb-myndir__ramma--3 { left: 0; bottom: 0; z-index: 4; width: 50%; height: 40%; transform: rotate(2deg); }

/* Two photos. */
.nfhb-myndir--n2 .nfhb-myndir__ramma--1 { left: 2%; top: 0; z-index: 2; width: 64%; height: 76%; transform: rotate(-3deg); }
.nfhb-myndir--n2 .nfhb-myndir__ramma--2 { right: 2%; bottom: 4%; z-index: 3; width: 52%; height: 50%; transform: rotate(3deg); }

/* One photo (allowed, though 2–3 are recommended). */
.nfhb-myndir--n1 .nfhb-myndir__ramma--1 { left: 8%; top: 4%; z-index: 2; width: 80%; height: 86%; transform: rotate(-2deg); }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.nfhb-myndir__ramma:hover {
		z-index: 5;
		transform: rotate(0deg) scale(1.03);
	}
}

.nfhb-myndir .nfhb-myndir__hofundar {
	margin: 18px 0 0;
	color: #5b6b7a;
	font-size: 11px;
	text-align: right;
}

/* ------------------------------------------------------------------ */
/* Félagslífið í myndum                                                 */
/* ------------------------------------------------------------------ */

:root .elementor-widget-shortcode:has(.nfhb-myndir--safn) {
	width: 100%;
}

.nfhb-myndir--safn {
	width: 100%;
}

.nfhb-myndir .nfhb-myndir__listi {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	grid-auto-rows: 190px;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nfhb-myndir .nfhb-myndir__atridi {
	grid-column: span 2;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.nfhb-myndir .nfhb-myndir__atridi--stor {
	grid-column: span 4;
	grid-row: span 2;
}

/* One or two photos: equal and large. */
/* 1.7.1: one or two photos keep a photo-like shape (no 3:1 crop) and get the large caption. */
.nfhb-myndir--n1 .nfhb-myndir__listi,
.nfhb-myndir--n2 .nfhb-myndir__listi { grid-auto-rows: auto; }
.nfhb-myndir--n1 .nfhb-myndir__atridi { grid-column: 1 / -1; aspect-ratio: 16 / 9; max-height: 620px; }
.nfhb-myndir--n2 .nfhb-myndir__atridi { grid-column: span 3; aspect-ratio: 4 / 3; }
.nfhb-myndir--n1 .nfhb-myndir__mynd,
.nfhb-myndir--n2 .nfhb-myndir__mynd { height: 100%; }
.nfhb-myndir--n1 .nfhb-myndir__texti,
.nfhb-myndir--n2 .nfhb-myndir__texti { padding: 48px 22px 18px; font-size: 16px; }

/* The row(s) after "one large + two": fill the width. */
.nfhb-myndir--n4 .nfhb-myndir__atridi:nth-child(4) { grid-column: 1 / -1; }
.nfhb-myndir--n5 .nfhb-myndir__atridi:nth-child(n+4),
.nfhb-myndir--n7 .nfhb-myndir__atridi:nth-child(n+4) { grid-column: span 3; }

.nfhb-myndir .nfhb-myndir__mynd {
	position: relative;
	height: 100%;
	margin: 0;
	overflow: hidden;
	border-radius: 8px;
	background: #e7edf3;
}

.nfhb-myndir__mynd .nfhb-myndir__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.nfhb-myndir__mynd:hover .nfhb-myndir__img {
		transform: scale(1.04);
	}
}

.nfhb-myndir .nfhb-myndir__texti {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 34px 16px 12px;
	background: linear-gradient(to top, rgba(5, 50, 83, 0.88), rgba(5, 50, 83, 0));
	color: #fff;
	font-size: 13px;
	font-style: normal;
	font-weight: 700;
	line-height: 1.35;
}

.nfhb-myndir__atridi--stor .nfhb-myndir__texti {
	padding: 48px 22px 18px;
	font-size: 16px;
}

.nfhb-myndir__atridi--stor .nfhb-myndir__texti::before {
	content: "";
	display: block;
	width: 32px;
	height: 3px;
	margin-bottom: 10px;
	background: var(--nfhb-f-red);
}

.nfhb-myndir .nfhb-myndir__hofundur {
	display: block;
	margin-top: 2px;
	color: rgba(255, 255, 255, 0.78);
	font-size: 11px;
	font-weight: 400;
}

.nfhb-myndir__listi:focus-visible {
	outline: 3px solid var(--nfhb-f-red);
	outline-offset: 4px;
}

/* ------------------------------------------------------------------ */
/* Tablet and mobile                                                    */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	.nfhb-vv .nfhb-vv__titill {
		font-size: 30px;
	}

	.nfhb-vv__efni {
		padding: 36px 32px;
	}

	.nfhb-myndir .nfhb-myndir__listi {
		grid-auto-rows: 150px;
	}
}

@media (max-width: 767px) {
	.nfhb-vv {
		grid-template-columns: 1fr;
		margin-top: 36px;
	}

	.nfhb-vv__mynd {
		min-height: 0;
		aspect-ratio: 16 / 10;
	}

	.nfhb-vv__dags {
		left: 14px;
		top: 14px;
		min-width: 62px;
	}

	.nfhb-vv .nfhb-vv__dagur {
		font-size: 28px;
	}

	.nfhb-vv__efni {
		padding: 26px 20px 24px;
		gap: 12px;
	}

	.nfhb-vv__efni::before {
		right: 20px;
	}

	.nfhb-vv .nfhb-vv__titill {
		font-size: 26px;
	}

	.nfhb-vv .nfhb-vv__stimpill {
		font-size: 22px;
	}

	.nfhb-vv__hnappar > a,
	:root .nfhb-vv .nfhb-skraning .nfhb-skraning__takki {
		flex: 1 1 100%;
	}

	.nfhb-myndir--hetja {
		max-width: 360px;
	}

	.nfhb-myndir .nfhb-myndir__merki {
		max-width: 200px; /* as the logo widget on 1397 */
	}

	.nfhb-myndir__ramma {
		border-width: 5px;
	}

	/* Gallery: a horizontal, swipeable strip with the next photo peeking in. */
	.nfhb-myndir .nfhb-myndir__listi {
		display: flex;
		gap: 12px;
		margin: 0 -21px;
		padding: 0 21px 10px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: 21px;
		scrollbar-width: thin;
		-webkit-overflow-scrolling: touch;
	}

	.nfhb-myndir .nfhb-myndir__atridi,
	.nfhb-myndir .nfhb-myndir__atridi--stor,
	.nfhb-myndir[class*="nfhb-myndir--n"] .nfhb-myndir__atridi {
		flex: 0 0 80%;
		aspect-ratio: 4 / 5;
		scroll-snap-align: start;
	}

	.nfhb-myndir.nfhb-myndir--n1 .nfhb-myndir__atridi { /* 1.7.1: above the 80% strip rule */
		flex-basis: 100%;
		aspect-ratio: 4 / 3;
		max-height: none;
	}

	.nfhb-myndir--n1 .nfhb-myndir__texti,
	.nfhb-myndir--n2 .nfhb-myndir__texti {
		padding: 34px 16px 12px;
		font-size: 14px;
	}

	.nfhb-myndir__atridi--stor .nfhb-myndir__texti {
		padding: 34px 16px 12px;
		font-size: 14px;
	}
}
