/* Inner page content area (gallery, library, etc.) */
.gallery-page-wrap {
	padding: 80px 0 90px;
}

.hnc-library-content {
	color: #555;
	font-size: 16px;
	line-height: 1.8;
}

.hnc-library-content h2,
.hnc-library-content h3,
.hnc-library-content h4 {
	color: #111d5e;
	margin-bottom: 15px;
}

.hnc-library-content p:last-child {
	margin-bottom: 0;
}

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 32px;
}

.gallery-card {
	position: relative;
	display: block;
	border-radius: 20px;
	overflow: hidden;
	background: #111d5e;
	box-shadow: 0 14px 40px rgba(17, 29, 94, 0.14);
	text-decoration: none;
	transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.gallery-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 22px 50px rgba(17, 29, 94, 0.22);
	text-decoration: none;
}

.gallery-card .card-image {
	position: relative;
	height: 320px;
	overflow: hidden;
}

.gallery-card .card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.gallery-card:hover .card-image img {
	transform: scale(1.08);
}

.gallery-card .card-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(17, 29, 94, 0.92) 0%,
		rgba(17, 29, 94, 0.45) 45%,
		rgba(17, 29, 94, 0.05) 100%
	);
	transition: background 0.35s ease;
}

.gallery-card:hover .card-overlay {
	background: linear-gradient(
		to top,
		rgba(227, 40, 69, 0.9) 0%,
		rgba(17, 29, 94, 0.55) 50%,
		rgba(17, 29, 94, 0.1) 100%
	);
}

.gallery-card .card-badge {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 2;
	background: rgba(255, 255, 255, 0.95);
	color: #111d5e;
	font-size: 13px;
	font-weight: 700;
	padding: 8px 14px;
	border-radius: 50px;
	line-height: 1;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.gallery-card .card-content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	padding: 28px 26px 26px;
	color: #fff;
}

.gallery-card .card-content h3 {
	margin: 0 0 10px;
	font-size: 24px;
	font-weight: 700;
	color: #fff;
	line-height: 1.25;
}

.gallery-card .card-content h3::after {
	content: '';
	display: block;
	width: 50px;
	height: 3px;
	background: #e32845;
	border-radius: 2px;
	margin-top: 12px;
	transition: width 0.3s ease;
}

.gallery-card:hover .card-content h3::after {
	width: 80px;
}

.gallery-card .card-view {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.9);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-card:hover .card-view {
	opacity: 1;
	transform: translateY(0);
}

.gallery-card .card-view i {
	font-size: 18px;
	transition: transform 0.3s ease;
}

.gallery-card:hover .card-view i {
	transform: translateX(4px);
}

.gallery-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px 20px;
	color: #666;
	font-size: 18px;
}

.gallery-detail-grid .gallery-empty {
	font-size: 16px;
	padding: 30px;
}

/* Category detail — photo bento grid */
.gallery-content-wrap {
	padding: 60px 0;
}

.gallery-category-heading {
	font-size: 40px;
	font-weight: 700;
	color: #111d5e;
	line-height: 1.2;
	margin: 0 0 8px;
	padding-top: 20px;
	text-transform: capitalize;
	position: relative;
}

.gallery-category-heading::after {
	content: '';
	display: block;
	width: 70px;
	height: 4px;
	background: #e32845;
	border-radius: 2px;
	margin-top: 14px;
}

.gallery-detail-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: 220px;
	gap: 20px;
	padding: 30px 0 0;
}

.gallery-detail-item {
	overflow: hidden;
	border-radius: 20px;
	position: relative;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
	background: #fff;
	display: block;
}

.gallery-detail-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.gallery-detail-item:hover img {
	transform: scale(1.04);
}

.gallery-detail-back {
	margin-top: 40px;
	margin-bottom: 20px;
	display: flex;
	justify-content: flex-end;
}

.gallery-detail-back a {
	display: inline-block;
	padding: 12px 26px;
	border-radius: 50px;
	background: #111d5e;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.3s ease, transform 0.3s ease;
}

.gallery-detail-back a:hover {
	background: #e32845;
	transform: translateY(-2px);
	color: #fff;
}

.gallery-detail-item:nth-child(1) {
	grid-column: span 2;
	grid-row: span 2;
}

.gallery-detail-item:nth-child(2) {
	grid-column: span 2;
	grid-row: span 1;
}

.gallery-detail-item:nth-child(3) {
	grid-column: span 1;
	grid-row: span 2;
}

.gallery-detail-item:nth-child(4) {
	grid-column: span 1;
	grid-row: span 1;
}

.gallery-detail-item:nth-child(5) {
	grid-column: span 2;
	grid-row: span 1;
}

.gallery-detail-item:nth-child(6) {
	grid-column: span 1;
	grid-row: span 1;
}

.gallery-detail-item:nth-child(7) {
	grid-column: span 1;
	grid-row: span 2;
}

.gallery-detail-item:nth-child(8) {
	grid-column: span 2;
	grid-row: span 1;
}

.gallery-detail-item:nth-child(9) {
	grid-column: span 1;
	grid-row: span 1;
}

/* Magnific Popup — above header */
.mfp-bg {
	z-index: 1000001 !important;
	opacity: 0.92 !important;
}

.mfp-wrap {
	z-index: 1000002 !important;
}

.mfp-container,
.mfp-content {
	z-index: 1000003 !important;
}

.mfp-wrap > .mfp-close,
.mfp-image-holder .mfp-close {
	color: #fff !important;
	background: #e32845 !important;
	border: 2px solid #fff !important;
	border-radius: 50% !important;
	width: 48px !important;
	height: 48px !important;
	line-height: 44px !important;
	padding: 0 !important;
	font-size: 26px !important;
	font-weight: 700 !important;
	text-align: center !important;
	position: fixed !important;
	top: 24px !important;
	right: 24px !important;
	left: auto !important;
	z-index: 1000010 !important;
	cursor: pointer !important;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45) !important;
	opacity: 1 !important;
	display: block !important;
	transition: background 0.2s ease, transform 0.2s ease !important;
}

.mfp-wrap > .mfp-close:hover,
.mfp-wrap > .mfp-close:focus,
.mfp-image-holder .mfp-close:hover,
.mfp-image-holder .mfp-close:focus {
	background: #111d5e !important;
	transform: scale(1.08) !important;
	opacity: 1 !important;
}

.mfp-gallery .mfp-container {
	padding: 70px 24px 50px;
}

.mfp-gallery .mfp-content {
	max-width: 960px;
}

.mfp-gallery .mfp-figure {
	max-width: 960px;
	margin: 0 auto;
}

.mfp-gallery .mfp-figure .mfp-img,
.mfp-gallery img.mfp-img {
	max-width: min(900px, 75vw) !important;
	max-height: min(580px, 72vh) !important;
	width: auto !important;
	height: auto !important;
	padding: 0 !important;
	margin: 0 auto !important;
	display: block !important;
	object-fit: contain !important;
	border-radius: 8px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.mfp-gallery .mfp-figure:after {
	display: none;
}

.mfp-gallery .mfp-arrow {
	opacity: 0.9 !important;
	z-index: 1000005 !important;
}

.mfp-gallery .mfp-arrow:hover {
	opacity: 1 !important;
}

.mfp-gallery .mfp-counter {
	color: #fff;
	font-size: 14px;
	top: auto;
	bottom: 20px;
	right: 24px;
}

@media (max-width: 991px) {
	.gallery-grid {
		gap: 24px;
	}

	.gallery-card .card-image {
		height: 280px;
	}

	.gallery-card .card-content h3 {
		font-size: 20px;
	}

	.gallery-detail-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-auto-rows: 200px;
	}

	.gallery-detail-item:nth-child(1),
	.gallery-detail-item:nth-child(3),
	.gallery-detail-item:nth-child(5),
	.gallery-detail-item:nth-child(7),
	.gallery-detail-item:nth-child(8) {
		grid-column: span 2;
		grid-row: span 1;
	}
}

@media (max-width: 767px) {
	.gallery-page-wrap {
		padding: 50px 0 60px;
	}

	.gallery-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.gallery-card .card-image {
		height: 260px;
	}

	.gallery-card .card-view {
		opacity: 1;
		transform: translateY(0);
	}

	.mfp-gallery .mfp-container {
		padding: 60px 12px 40px;
	}

	.mfp-gallery .mfp-figure .mfp-img,
	.mfp-gallery img.mfp-img {
		max-width: 92vw !important;
		max-height: 58vh !important;
	}

	.gallery-detail-grid {
		grid-template-columns: 1fr;
		grid-auto-rows: auto;
		padding-top: 20px;
	}

	.gallery-detail-item,
	.gallery-detail-item:nth-child(n) {
		grid-column: span 1 !important;
		grid-row: span 1 !important;
		height: auto;
	}

	.gallery-detail-item a {
		display: block;
		height: 260px;
	}

	.gallery-category-heading {
		font-size: 28px;
	}
}
