/* IAOM Networking Functions — front end.
 *
 * IAOM's own design for the Cape Town 2026 page (their Elementor JSON
 * "Networking Functions — Cape Town 2026", 5 Nov 2026), value for value:
 * the same colours, Poppins, the 1px burgundy frame with a 4px top, gold
 * round icons, "Sponsored by" over a hairline, and the logos moving in a
 * continuous strip (assets/frontend.js). Breakpoints are theirs too:
 * 1024px and 767px.
 *
 * Burgundy follows the site's Primary colour (Elementor Site Settings →
 * Global Colors), so a new edition's rebrand carries over; the value
 * after the comma is Cape Town's. Override any variable in Site Settings
 * → Custom CSS, e.g.  .iaomnf { --iaomnf-gold: #b88838; }
 */
.iaomnf {
	--iaomnf-burgundy: var(--e-global-color-primary, #8c2920);
	--iaomnf-gold: #b88838;
	--iaomnf-ink: #372b27;
	--iaomnf-line: #eadfd2;
	--iaomnf-desc: #5a4c46;
	--iaomnf-sponsor-title: #855f23;
	--iaomnf-sponsor-names: #685952;
	--iaomnf-font: Poppins, Arial, sans-serif;

	direction: ltr;
	color: var(--iaomnf-ink);
	font-family: var(--iaomnf-font);
	width: 100%;
}
.iaomnf *,
.iaomnf *::before,
.iaomnf *::after { box-sizing: border-box; }

/* Two cards side by side, stacked from 767px down. */
.iaomnf-grid {
	display: flex;
	gap: 26px;
	align-items: stretch;
}
.iaomnf-card {
	width: calc((100% - 26px) / 2);
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	padding: 32px;
	border: 1px solid var(--iaomnf-burgundy);
	border-top: 4px solid var(--iaomnf-burgundy);
	border-radius: 5px;
	background: #fff;
}
.iaomnf-grid.is-single { justify-content: center; }

/* ---------- Title ---------- */
.iaomnf .iaomnf-title {
	min-height: 70px;
	margin: 0 0 19px;
	padding: 0;
	color: var(--iaomnf-burgundy);
	font-family: var(--iaomnf-font);
	font-size: 27px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -.6px;
	text-transform: uppercase;
}

/* ---------- Date and venue rows ---------- */
.iaomnf-detail {
	display: flex;
	align-items: flex-start;
	gap: 17px;
	margin: 0 0 24px;
	text-align: left;
}
.iaomnf-icon {
	flex: 0 0 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--iaomnf-gold);
	color: #fff;
}
.iaomnf-icon svg { display: block; width: 22px; height: 22px; }
.iaomnf-detail-text { min-width: 0; padding-top: 2px; }
.iaomnf .iaomnf-detail-title {
	margin: 0 0 3px;
	color: var(--iaomnf-burgundy);
	font-family: var(--iaomnf-font);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.6;
}
.iaomnf .iaomnf-detail-desc {
	margin: 0;
	color: var(--iaomnf-desc);
	font-family: var(--iaomnf-font);
	font-size: 15px;
	line-height: 1.7;
}

/* ---------- Sponsored by ----------
 * Pushed to the bottom, so two cards side by side line up. */
.iaomnf-sponsors {
	margin-top: auto;
	padding-top: 23px;
	border-top: 1px solid var(--iaomnf-line);
	text-align: center;
}
.iaomnf .iaomnf-sponsors-title {
	margin: 0 0 10px;
	padding: 0;
	color: var(--iaomnf-sponsor-title);
	font-family: var(--iaomnf-font);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.5;
	text-transform: none;
	letter-spacing: normal;
}
.iaomnf .iaomnf-sponsor-names {
	min-height: 44px;
	margin: 0 0 8px;
	color: var(--iaomnf-sponsor-names);
	font-family: var(--iaomnf-font);
	font-size: 12px;
	line-height: 1.8;
}

/* The logos. As plain HTML they sit in a centred row (no JavaScript, or
 * reduced motion); frontend.js turns the row into the moving strip. */
.iaomnf-logos {
	position: relative;
	min-height: 130px;
	overflow: hidden;
	direction: ltr;
}
.iaomnf .iaomnf-logo-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	list-style: none;
}
.iaomnf .iaomnf-logo {
	flex: 0 0 205px;
	width: 205px;
	height: 108px;
	margin: 0;
	padding: 16px 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	list-style: none;
}
.iaomnf .iaomnf-logo img {
	display: block;
	width: 100%;
	height: 76px;
	object-fit: contain;
}

.iaomnf-logos.is-moving .iaomnf-window {
	overflow: hidden;
	width: 100%;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
	mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}
.iaomnf-logos.is-moving .iaomnf-track {
	display: flex;
	width: max-content;
	animation: iaomnf-scroll var(--iaomnf-duration, 24s) linear infinite;
	will-change: transform;
}
.iaomnf-logos.is-moving .iaomnf-logo-row { flex-wrap: nowrap; flex-shrink: 0; }
.iaomnf-logos.is-moving:hover .iaomnf-track { animation-play-state: paused; }
@keyframes iaomnf-scroll { to { transform: translateX(calc(-1 * var(--iaomnf-distance, 410px))); } }

.iaomnf .iaomnf-empty { color: var(--iaomnf-desc); text-align: center; }

/* ---------- 1.2.0: tabs layout (the default) ----------
 * One tab per function: its card, and its details beside it on wide
 * screens / under it on phones. The buttons follow the hotel tabs of the
 * IAOM Event Accommodation plugin (outlined pills, filled when chosen), so
 * the site's two tabbed pages look alike. The buttons only appear once the
 * script has run (.is-ready); without it every function is shown, stacked. */
.iaomnf-tabs {
	display: none;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 0 0 28px;
	padding: 0 0 20px;
	border-bottom: 1px solid var(--iaomnf-line);
}
.iaomnf--tabs.is-ready .iaomnf-tabs { display: flex; }
.iaomnf .iaomnf-tab {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 200px;
	padding: 10px 22px;
	border: 2px solid var(--iaomnf-burgundy);
	border-radius: 30px;
	background: #fff;
	color: var(--iaomnf-burgundy);
	font-family: var(--iaomnf-font);
	text-align: center;
	cursor: pointer;
	transition: background-color .25s ease, color .25s ease;
}
.iaomnf .iaomnf-tab-name { font-size: 14px; font-weight: 700; line-height: 1.3; letter-spacing: .4px; text-transform: uppercase; }
.iaomnf .iaomnf-tab-date { font-size: 12px; font-weight: 500; line-height: 1.3; opacity: .85; }
.iaomnf .iaomnf-tab:hover,
.iaomnf .iaomnf-tab[aria-selected="true"] { background: var(--iaomnf-burgundy); color: #fff; }
.iaomnf .iaomnf-tab:focus-visible { outline: 3px solid var(--iaomnf-gold); outline-offset: 2px; }

.iaomnf-panel { margin: 0 0 32px; }
.iaomnf-panel:focus { outline: none; }
.iaomnf-panel:focus-visible { outline: 2px dashed var(--iaomnf-gold); outline-offset: 6px; }
.iaomnf--tabs.is-ready .iaomnf-panel[hidden] { display: none !important; }
.iaomnf--tabs.is-ready .iaomnf-panel { margin-bottom: 0; }

.iaomnf-panel-grid {
	display: grid;
	grid-template-columns: minmax(0, 560px);
	justify-content: center;
	gap: 32px;
	align-items: start;
}
.iaomnf-panel.has-info .iaomnf-panel-grid {
	grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
	justify-content: stretch;
}
.iaomnf-panel .iaomnf-card { width: 100%; }
.iaomnf-panel .iaomnf-title { min-height: 0; }

/* ---------- The details column ---------- */
.iaomnf-info { min-width: 0; text-align: left; }
.iaomnf .iaomnf-text {
	color: var(--iaomnf-desc);
	font-family: var(--iaomnf-font);
	font-size: 15px;
	line-height: 1.75;
}
.iaomnf .iaomnf-text p { margin: 0 0 14px; }
.iaomnf .iaomnf-text ul,
.iaomnf .iaomnf-text ol { margin: 0 0 16px; padding-left: 1.3em; }
.iaomnf .iaomnf-text li { margin: 0 0 10px; }
.iaomnf .iaomnf-text strong { color: var(--iaomnf-ink); font-weight: 600; }
.iaomnf .iaomnf-text a { color: var(--iaomnf-burgundy); text-decoration: underline; word-break: break-word; }
.iaomnf .iaomnf-info-title {
	margin: 22px 0 10px;
	padding: 0;
	color: var(--iaomnf-burgundy);
	font-family: var(--iaomnf-font);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.4;
	text-transform: none;
	letter-spacing: normal;
}
.iaomnf .iaomnf-info > :first-child { margin-top: 0; }

.iaomnf .iaomnf-map-link { margin: 4px 0 22px; }
.iaomnf a.iaomnf-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 20px;
	border-radius: 30px;
	background: var(--iaomnf-burgundy);
	color: #fff !important;
	font-family: var(--iaomnf-font);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	transition: opacity .2s ease;
}
.iaomnf a.iaomnf-button:hover { opacity: .88; }
.iaomnf a.iaomnf-button:focus-visible { outline: 3px solid var(--iaomnf-gold); outline-offset: 2px; }

.iaomnf-notice {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0 0 24px;
	padding: 18px 20px;
	border-left: 4px solid var(--iaomnf-burgundy);
	border-radius: 5px;
	background: #fbf5ec;
}
.iaomnf-notice .iaomnf-icon { flex-basis: 40px; width: 40px; height: 40px; }
.iaomnf-notice .iaomnf-icon svg { width: 20px; height: 20px; }
.iaomnf .iaomnf-notice .iaomnf-text { color: var(--iaomnf-ink); }
.iaomnf .iaomnf-notice .iaomnf-text p:last-child { margin-bottom: 0; }
.iaomnf .iaomnf-notice .iaomnf-text strong { color: var(--iaomnf-burgundy); font-size: 16px; }

.iaomnf .iaomnf-map { margin: 0; }
.iaomnf .iaomnf-zoom {
	all: unset;
	box-sizing: border-box;
	display: block;
	width: 100%;
	cursor: zoom-in;
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid var(--iaomnf-line);
}
.iaomnf .iaomnf-zoom:focus-visible { outline: 3px solid var(--iaomnf-gold); outline-offset: 2px; }
.iaomnf .iaomnf-map-img { display: block; width: 100%; height: auto; }
.iaomnf .iaomnf-map figcaption {
	margin-top: 8px;
	color: var(--iaomnf-desc);
	font-family: var(--iaomnf-font);
	font-size: 13px;
	text-align: center;
}

/* The larger map, over the page. Tap the picture to zoom further in and
 * scroll around it; tap outside it, the close button or Escape to close. */
.iaomnf-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 12px 12px;
	background: rgba(20, 14, 12, .92);
}
.iaomnf-lightbox-frame {
	max-width: 100%;
	max-height: 100%;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}
.iaomnf-lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 70px); width: auto; height: auto; cursor: zoom-in; }
.iaomnf-lightbox.is-zoomed .iaomnf-lightbox-frame { width: 100%; height: 100%; }
.iaomnf-lightbox.is-zoomed img { max-width: none; max-height: none; width: 250%; cursor: zoom-out; }
.iaomnf-lightbox-close {
	all: unset;
	position: absolute;
	top: 10px;
	right: 12px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #fff;
	color: var(--iaomnf-burgundy, #8c2920);
	font: 600 26px/40px Arial, sans-serif;
	text-align: center;
	cursor: pointer;
}
.iaomnf-lightbox-close:focus-visible { outline: 3px solid #b88838; outline-offset: 2px; }
html.iaomnf-noscroll, html.iaomnf-noscroll body { overflow: hidden; }

@media (max-width: 1024px) {
	.iaomnf-panel.has-info .iaomnf-panel-grid { grid-template-columns: minmax(0, 1fr); }
	.iaomnf-panel .iaomnf-card { max-width: 640px; margin: 0 auto; }
}
@media (max-width: 599px) {
	/* Two buttons per row, equal width - as the hotel tabs. */
	.iaomnf--tabs.is-ready .iaomnf-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
	.iaomnf .iaomnf-tab { min-width: 0; padding: 9px 10px; }
	.iaomnf .iaomnf-tab-name { font-size: 12px; }
	.iaomnf .iaomnf-tab-date { font-size: 11px; }
	.iaomnf-panel-grid { gap: 24px; }
	.iaomnf-notice { padding: 16px; gap: 12px; }
}

/* ---------- Tablets ---------- */
@media (max-width: 1024px) {
	.iaomnf-card { padding: 26px; }
	.iaomnf .iaomnf-title { font-size: 24px; }
	.iaomnf .iaomnf-detail-title { font-size: 16px; }
}

/* ---------- Phones ---------- */
@media (max-width: 767px) {
	.iaomnf-grid { flex-direction: column; gap: 24px; }
	.iaomnf-card { width: 100%; padding: 25px 21px; }
	.iaomnf .iaomnf-title { min-height: 0; margin-bottom: 26px; font-size: 25px; }
	.iaomnf-detail { gap: 13px; }
	.iaomnf .iaomnf-logo { flex-basis: 180px; width: 180px; }
}

@media (prefers-reduced-motion: reduce) {
	.iaomnf-logos.is-moving .iaomnf-track { animation: none !important; transform: none !important; width: 100%; }
	.iaomnf-logos.is-moving .iaomnf-logo-row { flex-wrap: wrap; width: 100%; }
	.iaomnf-logos.is-moving .iaomnf-logo-row[aria-hidden="true"],
	.iaomnf-logos.is-moving .iaomnf-logo[data-repeat="true"] { display: none !important; }
	.iaomnf-logos.is-moving .iaomnf-window { -webkit-mask-image: none; mask-image: none; }
}
