/*
 * NGL Flip Catalog — viewer, cover cards, catalog pages.
 * Colours follow the NGL design system (navy #192431, green #81C91D); every value can be overridden
 * through the custom properties below. Logical properties throughout, so RTL/LTR both work.
 */

.nglfc,
.nglfc-card,
.nglfc-grid,
.nglfc-page,
.nglfc-modal {
	--nglfc-navy: #192431;
	--nglfc-navy-2: #1e293b;
	--nglfc-green: #81c91d;
	--nglfc-green-dark: #6aa617;
	--nglfc-ink: #192431;
	--nglfc-muted: #7f7f7f;
	--nglfc-line: #e3e8ee;
	--nglfc-stage: #e9eef3;
	--nglfc-radius: 16px;
	--nglfc-font: IRANSansX, Tahoma, Arial, sans-serif;
	font-family: var(--nglfc-font);
	box-sizing: border-box;
}

.nglfc *,
.nglfc *::before,
.nglfc *::after,
.nglfc-card *,
.nglfc-modal *,
.nglfc-page * {
	box-sizing: border-box;
}

/*
 * Themes such as Betheme underline every link on hover (`a:hover`, specificity 0,1,1), which beats the
 * plain class rules of these links. They are pills, covers and breadcrumbs, not text links: no line.
 */
.nglfc-filters__item:hover,
.nglfc-card__cover:hover,
.nglfc-page__crumbs a:hover {
	text-decoration: none;
}

.nglfc-lock,
.nglfc-lock body {
	overflow: hidden;
}

.nglfc__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ----------------------------------------------------------------------------------------------
 * Viewer shell
 * ------------------------------------------------------------------------------------------- */

.nglfc {
	position: relative;
	display: flex;
	flex-direction: column;
	height: var(--nglfc-height, min(86vh, 900px));
	min-height: 420px;
	overflow: hidden;
	border-radius: var(--nglfc-radius);
	background: var(--nglfc-stage);
	color: var(--nglfc-ink);
	outline: none;
}

.nglfc.is-fullscreen,
.nglfc--modal {
	height: 100%;
	border-radius: 0;
}

.nglfc__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	padding: 10px 14px;
	background: var(--nglfc-navy);
	color: #fff;
}

.nglfc__group {
	display: flex;
	align-items: center;
	gap: 4px;
}

.nglfc .nglfc__btn {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	box-shadow: none;
	color: #fff;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}

.nglfc .nglfc__btn:hover,
.nglfc .nglfc__btn[aria-pressed="true"] {
	background: rgba(255, 255, 255, 0.1);
	color: var(--nglfc-green);
}

.nglfc .nglfc__btn:focus-visible {
	outline: 2px solid var(--nglfc-green);
	outline-offset: 2px;
}

.nglfc .nglfc__btn:disabled {
	opacity: 0.35;
	cursor: default;
	background: transparent;
	color: #fff;
}

.nglfc .nglfc__btn[hidden] {
	display: none;
}

.nglfc .nglfc__btn--sm {
	width: 34px;
	height: 34px;
}

.nglfc .nglfc__btn--nav {
	border: 1px solid rgba(255, 255, 255, 0.25);
}

.nglfc-icon {
	display: block;
	width: 22px;
	height: 22px;
}

/* Chevrons are drawn left/right: mirror them in RTL so "previous" points right. */
.nglfc[dir="rtl"] [data-nglfc-action="prev"] .nglfc-icon,
.nglfc[dir="rtl"] [data-nglfc-action="next"] .nglfc-icon {
	transform: scaleX(-1);
}

.nglfc__pager {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 4px;
	font-size: 14px;
	color: #cfd6de;
	direction: ltr;
}

.nglfc .nglfc__page-input {
	width: 72px;
	height: 36px;
	margin: 0;
	padding: 0 8px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.06);
	box-shadow: none;
	color: #fff;
	font: 600 14px/1 var(--nglfc-font);
	text-align: center;
}

.nglfc .nglfc__page-input:focus {
	border-color: var(--nglfc-green);
	outline: none;
}

.nglfc__body {
	position: relative;
	display: flex;
	flex: 1;
	min-height: 0;
}

.nglfc__stage {
	position: relative;
	flex: 1;
	min-width: 0;
	padding: 24px;
	background:
		radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 70%),
		var(--nglfc-stage);
}

.nglfc__book {
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity 0.5s;
}

.nglfc.is-ready .nglfc__book {
	opacity: 1;
}

.nglfc__page {
	background: #fff;
	overflow: hidden;
}

.nglfc__page--blank {
	background: #f6f7f9;
}

.nglfc__canvas {
	display: block;
	width: 100%;
	height: 100%;
}

/* A soft placeholder until the page has been drawn. */
.nglfc__page:not(.is-rendered):not(.nglfc__page--blank) {
	background:
		linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0) 70%) #eef1f5;
	background-size: 200% 100%;
	animation: nglfc-shimmer 1.4s linear infinite;
}

@keyframes nglfc-shimmer {
	from {
		background-position: 150% 0;
	}

	to {
		background-position: -50% 0;
	}
}

/* Status (loading / error) */

.nglfc__status {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	color: var(--nglfc-navy);
	font-size: 15px;
	text-align: center;
}

.nglfc__status[hidden] {
	display: none;
}

.nglfc__spinner {
	width: 42px;
	height: 42px;
	border: 3px solid rgba(25, 36, 49, 0.15);
	border-top-color: var(--nglfc-green);
	border-radius: 50%;
	animation: nglfc-spin 0.9s linear infinite;
}

.nglfc__status.is-error .nglfc__spinner,
.nglfc__status.is-error .nglfc__progress {
	display: none;
}

@keyframes nglfc-spin {
	to {
		transform: rotate(360deg);
	}
}

.nglfc__progress {
	width: min(260px, 70%);
	height: 4px;
	overflow: hidden;
	border-radius: 4px;
	background: rgba(25, 36, 49, 0.1);
}

.nglfc__progress span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--nglfc-green);
	transition: width 0.2s;
}

.nglfc__status-link {
	color: var(--nglfc-green-dark);
	font-weight: 700;
}

/* Zoom layer */

.nglfc__zoom {
	position: absolute;
	inset: 0;
	z-index: 4;
	background: rgba(233, 238, 243, 0.97);
}

.nglfc__zoom[hidden] {
	display: none;
}

.nglfc__zoom-scroll {
	width: 100%;
	height: 100%;
	overflow: auto;
	cursor: grab;
	touch-action: pan-x pan-y;
	text-align: center;
}

.nglfc__zoom-scroll.is-dragging {
	cursor: grabbing;
	user-select: none;
}

.nglfc__zoom-canvas {
	display: inline-block;
	max-width: none;
	margin: 20px auto;
	box-shadow: 0 16px 40px rgba(25, 36, 49, 0.18);
	background: #fff;
}

/* Side panel */

.nglfc__panel {
	display: flex;
	flex: 0 0 280px;
	flex-direction: column;
	min-height: 0;
	border-inline-end: 1px solid var(--nglfc-line);
	background: #fff;
}

.nglfc__panel[hidden] {
	display: none;
}

.nglfc__panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	border-bottom: 1px solid var(--nglfc-line);
	font-size: 15px;
}

.nglfc__panel .nglfc__btn {
	color: var(--nglfc-navy);
}

.nglfc__panel .nglfc__btn:hover {
	background: #f4fce9;
	color: var(--nglfc-green-dark);
}

.nglfc__pane {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 14px;
}

.nglfc__pane[hidden] {
	display: none;
}

.nglfc__thumbs {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nglfc__thumbs li {
	margin: 0;
}

.nglfc .nglfc__thumb {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 100%;
	margin: 0;
	padding: 6px;
	border: 2px solid transparent;
	border-radius: 10px;
	background: #f6f8fa;
	box-shadow: none;
	color: var(--nglfc-muted);
	font: 600 12px var(--nglfc-font);
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s;
}

.nglfc .nglfc__thumb:hover {
	border-color: rgba(129, 201, 29, 0.5);
}

.nglfc .nglfc__thumb.is-current {
	border-color: var(--nglfc-green);
	background: #f4fce9;
	color: var(--nglfc-green-dark);
}

.nglfc__thumb canvas {
	width: 100%;
	height: auto;
	min-height: 60px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(25, 36, 49, 0.12);
}

.nglfc__outline-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nglfc__outline-list .nglfc__outline-list {
	padding-inline-start: 14px;
}

.nglfc .nglfc__outline-item,
.nglfc .nglfc__result {
	display: block;
	width: 100%;
	margin: 0 0 4px;
	padding: 8px 10px;
	border: 0;
	border-radius: 8px;
	background: none;
	box-shadow: none;
	color: var(--nglfc-ink);
	font: 500 14px/1.6 var(--nglfc-font);
	text-align: start;
	cursor: pointer;
}

.nglfc .nglfc__outline-item:hover,
.nglfc .nglfc__result:hover {
	background: #f4fce9;
	color: var(--nglfc-green-dark);
}

.nglfc__result strong {
	display: block;
	color: var(--nglfc-green-dark);
	font-size: 12px;
}

.nglfc__result span {
	display: block;
	color: var(--nglfc-muted);
	font-size: 13px;
	overflow-wrap: anywhere;
}

.nglfc__results {
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.nglfc__search {
	display: flex;
	gap: 6px;
	margin: 0;
}

.nglfc .nglfc__search-input {
	flex: 1;
	min-width: 0;
	height: 38px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--nglfc-line);
	border-radius: 10px;
	box-shadow: none;
	font: 400 14px var(--nglfc-font);
}

.nglfc .nglfc__search-input:focus {
	border-color: var(--nglfc-green);
	outline: none;
}

.nglfc__muted {
	margin: 10px 0;
	color: var(--nglfc-muted);
	font-size: 13px;
}

.nglfc__toast {
	position: absolute;
	z-index: 6;
	inset-inline: 0;
	bottom: 20px;
	width: max-content;
	max-width: 90%;
	margin-inline: auto;
	padding: 10px 18px;
	border-radius: 999px;
	background: var(--nglfc-navy);
	color: #fff;
	font-size: 14px;
	box-shadow: 0 10px 30px rgba(10, 13, 18, 0.25);
}

.nglfc__toast[hidden] {
	display: none;
}

.nglfc__noscript {
	padding: 20px;
	text-align: center;
}

@media (max-width: 767px) {
	.nglfc {
		height: var(--nglfc-height, 78vh);
		border-radius: 12px;
	}

	.nglfc__bar {
		justify-content: center;
		padding: 8px;
	}

	.nglfc .nglfc__btn {
		width: 36px;
		height: 36px;
	}

	.nglfc__stage {
		padding: 10px;
	}

	.nglfc__panel {
		position: absolute;
		z-index: 7;
		inset-block: 0;
		inset-inline-start: 0;
		width: min(300px, 88%);
		box-shadow: 0 20px 40px rgba(10, 13, 18, 0.25);
	}

	.nglfc--modal .nglfc__bar .nglfc__group:first-child {
		order: 3;
	}
}

/* ----------------------------------------------------------------------------------------------
 * Lightbox
 * ------------------------------------------------------------------------------------------- */

.nglfc-modal {
	position: fixed;
	z-index: 100000;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: min(3vw, 32px);
	opacity: 0;
	transition: opacity 0.25s;
}

.nglfc-modal.is-open {
	opacity: 1;
}

.nglfc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 13, 18, 0.72);
	backdrop-filter: blur(4px);
}

.nglfc-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1400px, 100%);
	height: 100%;
	overflow: hidden;
	border-radius: 18px;
	background: var(--nglfc-navy);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
	transform: translateY(12px) scale(0.985);
	transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nglfc-modal.is-open .nglfc-modal__dialog {
	transform: none;
}

.nglfc-modal__title {
	padding: 14px 20px 0;
	color: #fff;
	font: 700 16px/1.4 var(--nglfc-font);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nglfc-modal .nglfc {
	flex: 1;
	min-height: 0;
}

@media (max-width: 767px) {
	.nglfc-modal {
		padding: 0;
	}

	.nglfc-modal__dialog {
		border-radius: 0;
	}
}

/* ----------------------------------------------------------------------------------------------
 * Cover cards and grid
 * ------------------------------------------------------------------------------------------- */

.nglfc-grid {
	display: grid;
	grid-template-columns: repeat(var(--nglfc-columns, 3), minmax(0, 1fr));
	gap: 28px;
}

@media (max-width: 1023px) {
	.nglfc-grid {
		grid-template-columns: repeat(min(var(--nglfc-columns, 3), 2), minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.nglfc-grid {
		grid-template-columns: 1fr;
	}
}

.nglfc-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 1px 0 rgba(25, 36, 49, 0.04);
	transition: box-shadow 0.3s, transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nglfc-card:hover {
	box-shadow: 0 18px 40px rgba(25, 36, 49, 0.12);
	transform: translateY(-4px);
}

.nglfc-card__cover {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: #eef1f6;
}

.nglfc-card .nglfc-card__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: top center;
	transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nglfc-card:hover .nglfc-card__img {
	transform: scale(1.04);
}

.nglfc-card__placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	color: #b7c0cb;
}

.nglfc-card__placeholder .nglfc-icon {
	width: 64px;
	height: 64px;
}

.nglfc-card__badge {
	position: absolute;
	inset-inline-start: 14px;
	bottom: 14px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border-radius: 999px;
	background: rgba(25, 36, 49, 0.82);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.3s, transform 0.3s;
}

.nglfc-card__badge .nglfc-icon {
	width: 16px;
	height: 16px;
	color: var(--nglfc-green);
}

.nglfc-card:hover .nglfc-card__badge,
.nglfc-card__cover:focus-visible .nglfc-card__badge {
	opacity: 1;
	transform: none;
}

.nglfc-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	padding: 20px;
}

.nglfc-card .nglfc-card__title {
	margin: 0;
	font: 700 18px/1.5 var(--nglfc-font);
}

.nglfc-card .nglfc-card__title a {
	color: var(--nglfc-ink);
	text-decoration: none;
}

.nglfc-card .nglfc-card__title a:hover {
	color: var(--nglfc-green-dark);
}

.nglfc-card .nglfc-card__text {
	margin: 0;
	color: var(--nglfc-muted);
	font-size: 14px;
	line-height: 1.8;
}

.nglfc-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: auto;
	padding-top: 6px;
}

.nglfc-card .nglfc-card__btn,
.nglfc-page .nglfc-card__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 42px;
	padding: 0 18px;
	border: 1px solid var(--nglfc-green);
	border-radius: 12px;
	color: var(--nglfc-green-dark);
	font: 600 14px var(--nglfc-font);
	text-decoration: none;
	transition: background-color 0.2s, color 0.2s;
}

.nglfc-card .nglfc-card__btn:hover {
	background: #f4fce9;
	color: var(--nglfc-green-dark);
}

.nglfc-card .nglfc-card__btn--primary,
.nglfc-page .nglfc-card__btn--primary {
	background: var(--nglfc-green);
	color: #fff;
}

.nglfc-card .nglfc-card__btn--primary:hover,
.nglfc-page .nglfc-card__btn--primary:hover {
	background: var(--nglfc-green-dark);
	color: #fff;
}

/* Cards standing in for old [real3dflipbook] thumbnails inside existing pages. */
.nglfc-compat {
	max-width: 320px;
	margin: 0 auto 24px;
}

.nglfc-empty {
	padding: 40px 0;
	color: var(--nglfc-muted);
	text-align: center;
}

/* ----------------------------------------------------------------------------------------------
 * Catalog pages (single + archive)
 * ------------------------------------------------------------------------------------------- */

/* A navy band sits behind the site header (old transparent Betheme header or the new one), then the page. */
.nglfc-page {
	display: block;
	padding: 150px 0 96px;
	background: linear-gradient(var(--nglfc-navy) 0 110px, #f7fcfe 110px);
}

.nglfc-page__inner {
	width: min(1200px, 100% - 32px);
	margin-inline: auto;
}

.nglfc-page__crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
	color: var(--nglfc-muted);
	font-size: 14px;
}

.nglfc-page__crumbs a {
	color: var(--nglfc-green-dark);
	text-decoration: none;
}

.nglfc-page__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.nglfc-page__head--center {
	flex-direction: column;
	justify-content: center;
	margin-bottom: 32px;
	text-align: center;
}

.nglfc-page .nglfc-page__title {
	margin: 0;
	color: var(--nglfc-ink);
	font: 800 clamp(26px, 3vw, 44px)/1.4 var(--nglfc-font);
}

.nglfc-page .nglfc-page__lead,
.nglfc-page__desc {
	max-width: 780px;
	margin: 0 0 24px;
	color: var(--nglfc-muted);
	font-size: 16px;
	line-height: 1.9;
}

.nglfc-page__head--center .nglfc-page__lead {
	margin: 0 auto;
}

.nglfc-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-bottom: 36px;
}

.nglfc-filters__item {
	padding: 8px 18px;
	border: 1px solid var(--nglfc-line);
	border-radius: 999px;
	background: #fff;
	color: var(--nglfc-ink);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.nglfc-filters__item:hover,
.nglfc-filters__item.is-active {
	border-color: var(--nglfc-green);
	background: #f4fce9;
	color: var(--nglfc-green-dark);
}

.nglfc-page .navigation.pagination {
	margin-top: 40px;
	text-align: center;
}

@media (max-width: 767px) {
	.nglfc-page {
		padding: 110px 0 64px;
		background: linear-gradient(var(--nglfc-navy) 0 80px, #f7fcfe 80px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.nglfc-card,
	.nglfc-card__img,
	.nglfc-modal,
	.nglfc-modal__dialog,
	.nglfc__book {
		transition: none;
	}

	.nglfc__page:not(.is-rendered) {
		animation: none;
	}
}
