/*
 * TZIT Media Album — Elementor Widgets Stylesheet
 * Version: 1.0.0
 *
 * Covers:
 *  1. Shared: section title, empty state, pagination
 *  2. Archive cards  (photo + video)
 *  3. Photo Content grid + lightbox
 *  4. Video Content grid + modal
 */

/* ─────────────────────────────────────────────────────────────────────────────
   1. Shared
───────────────────────────────────────────────────────────────────────────── */

.hbmg-el-archive-wrap,
.hbmg-el-photo-content-wrap,
.hbmg-el-video-content-wrap {
	width: 100%;
}

/* Section Title */
.hbmg-el-section-title {
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	font-weight: 700;
	margin: 0 0 32px;
	text-align: center;
	color: #1a1a1a;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

/* Empty state */
.hbmg-el-empty {
	text-align: center;
	color: #6b7280;
	padding: 48px 24px;
	border: 2px dashed #e5e7eb;
	border-radius: 10px;
	font-size: 1rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   2. Archive Grid & Cards
───────────────────────────────────────────────────────────────────────────── */

.hbmg-el-archive-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	width: 100%;
}

/* ── Card ── */
.hbmg-el-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
	transition: transform 0.3s cubic-bezier(.4,0,.2,1),
	            box-shadow 0.3s cubic-bezier(.4,0,.2,1);
}

.hbmg-el-card:hover,
.hbmg-el-card:focus-visible {
	transform: translateY(-5px);
	box-shadow: 0 16px 40px rgba(0, 0, 0, .14);
	outline: none;
}

/* Card thumbnail */
.hbmg-el-card__thumb {
	position: relative;
	width: 100%;
	height: 220px;
	overflow: hidden;
	background: #1a2e1e;
}

.hbmg-el-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s cubic-bezier(.4,0,.2,1);
}

.hbmg-el-card:hover .hbmg-el-card__thumb img {
	transform: scale(1.08);
}

/* Placeholder (no featured image) */
.hbmg-el-card__placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #0f4f1d 0%, #1a3a22 100%);
	color: rgba(255,255,255,.3);
}

/* Count badge */
.hbmg-el-card__badge {
	position: absolute;
	top: 10px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	background: rgba(15, 79, 29, .92);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	border-radius: 20px;
	letter-spacing: .03em;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.hbmg-el-card__badge--video {
	background: rgba(180, 20, 20, .88);
}

/* Play icon overlay on video cards */
.hbmg-el-card__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
	transition: transform 0.3s ease, opacity 0.3s ease;
	opacity: .88;
	filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}

.hbmg-el-card:hover .hbmg-el-card__play {
	transform: translate(-50%, -50%) scale(1.15);
	opacity: 1;
}

/* Caption */
.hbmg-el-card__caption {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px 16px 14px;
	background-color: #0f4f1d; /* default — overridden by Elementor controls */
}

.hbmg-el-card__title {
	font-size: .95rem;
	font-weight: 700;
	color: #fff;
	line-height: 1.3;
	display: block;
	text-align: center;
}

.hbmg-el-card__meta {
	font-size: .78rem;
	color: rgba(255,255,255,.75);
	text-align: center;
	letter-spacing: .03em;
	display: block;
}

.hbmg-el-card__excerpt {
	font-size: .82rem;
	color: rgba(255,255,255,.8);
	line-height: 1.4;
	text-align: center;
	margin-top: 4px;
	display: block;
}

/* ─────────────────────────────────────────────────────────────────────────────
   3. Photo Content Grid
───────────────────────────────────────────────────────────────────────────── */

.hbmg-el-photo-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	width: 100%;
}

/* Individual photo item */
.hbmg-el-photo-item {
	display: block;
	text-decoration: none;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	overflow: hidden;
	background: #f3f4f6;
	box-shadow: 0 2px 8px rgba(0,0,0,.05);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hbmg-el-photo-item:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 28px rgba(0,0,0,.12);
}

/* Image wrapper */
.hbmg-el-photo-item__thumb {
	position: relative;
	width: 100%;
	height: 220px;
	overflow: hidden;
}

.hbmg-el-photo-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s cubic-bezier(.4,0,.2,1);
}

.hbmg-el-photo-item:hover .hbmg-el-photo-item__thumb img {
	transform: scale(1.08);
}

/* Zoom overlay */
.hbmg-el-photo-item__zoom {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0);
	color: #fff;
	opacity: 0;
	transition: opacity 0.25s ease, background 0.25s ease;
	pointer-events: none;
}

.hbmg-el-photo-item:hover .hbmg-el-photo-item__zoom,
.hbmg-el-photo-item:focus-visible .hbmg-el-photo-item__zoom {
	opacity: 1;
	background: rgba(0,0,0,.35);
}

.hbmg-el-photo-item__zoom svg {
	filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
}

/* Caption bar under image */
.hbmg-el-photo-item__caption {
	padding: 8px 12px 10px;
	font-size: .82rem;
	font-weight: 600;
	text-align: center;
	background-color: #0f4f1d;
	color: #fff;
	line-height: 1.3;
}

/* ─────────────────────────────────────────────────────────────────────────────
   4. Lightbox
───────────────────────────────────────────────────────────────────────────── */

.hbmg-el-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: hbmgElFadeIn .2s ease;
}

.hbmg-el-lb-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.92);
	cursor: pointer;
}

.hbmg-el-lb-wrap {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 92vw;
	padding: 0 8px;
}

.hbmg-el-lb-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.hbmg-el-lb-img {
	max-width: 82vw;
	max-height: 82vh;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 24px 80px rgba(0,0,0,.6);
	display: block;
}

.hbmg-el-lb-caption {
	color: rgba(255,255,255,.8);
	font-size: .875rem;
	margin: 0;
	text-align: center;
}

/* Lightbox nav buttons */
.hbmg-el-lb-btn {
	background: rgba(255,255,255,.12);
	border: none;
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background .2s ease;
}

.hbmg-el-lb-btn:hover {
	background: rgba(255,255,255,.28);
}

.hbmg-el-lb-close {
	position: absolute;
	top: -52px;
	right: 0;
}

/* Fade animations */
@keyframes hbmgElFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes hbmgElFadeOut { from { opacity: 1; } to { opacity: 0; } }

.hbmg-el-lightbox.is-closing {
	animation: hbmgElFadeOut .18s ease forwards;
}

/* ─────────────────────────────────────────────────────────────────────────────
   5. Video Content Grid
───────────────────────────────────────────────────────────────────────────── */

.hbmg-el-video-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	width: 100%;
}

.hbmg-el-video-item {
	border-radius: 8px;
	overflow: hidden;
	background: #111;
	border: 1px solid #222;
	box-shadow: 0 4px 16px rgba(0,0,0,.15);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hbmg-el-video-item:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 36px rgba(0,0,0,.25);
}

/* Thumbnail 16:9 */
.hbmg-el-video-item__thumb {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	cursor: pointer;
}

.hbmg-el-video-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease, opacity 0.3s ease;
}

.hbmg-el-video-item:hover .hbmg-el-video-item__thumb img {
	transform: scale(1.04);
	opacity: .9;
}

/* Play button */
.hbmg-el-video-item__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	transition: transform 0.25s ease;
	filter: drop-shadow(0 2px 8px rgba(0,0,0,.5));
}

.hbmg-el-video-item:hover .hbmg-el-video-item__play {
	transform: translate(-50%, -50%) scale(1.15);
}

/* Inline player */
.hbmg-el-video-item__player {
	aspect-ratio: 16 / 9;
}

.hbmg-el-video-item__player iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* Caption */
.hbmg-el-video-item__caption {
	padding: 10px 14px 12px;
	font-size: .85rem;
	font-weight: 600;
	text-align: center;
	background-color: #0f4f1d;
	color: #fff;
	letter-spacing: .02em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   6. Video Modal
───────────────────────────────────────────────────────────────────────────── */

.hbmg-el-video-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: hbmgElFadeIn .2s ease;
}

.hbmg-el-vm-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.9);
	cursor: pointer;
}

.hbmg-el-vm-wrap {
	position: relative;
	z-index: 1;
	width: min(900px, 90vw);
}

.hbmg-el-vm-close {
	position: absolute;
	top: -44px;
	right: 0;
	background: rgba(255,255,255,.15);
	border: none;
	color: #fff;
	border-radius: 50%;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .2s;
}

.hbmg-el-vm-close:hover {
	background: rgba(255,255,255,.3);
}

.hbmg-el-vm-player {
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0,0,0,.6);
}

.hbmg-el-vm-player iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

.hbmg-el-video-modal.is-closing {
	animation: hbmgElFadeOut .18s ease forwards;
}

/* ─────────────────────────────────────────────────────────────────────────────
   7. Pagination
───────────────────────────────────────────────────────────────────────────── */

.hbmg-el-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 40px;
	flex-wrap: wrap;
}

.hbmg-el-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border-radius: 6px;
	border: 1.5px solid #d1d5db;
	color: #374151;
	text-decoration: none;
	font-size: .875rem;
	font-weight: 500;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.hbmg-el-pagination .page-numbers:hover,
.hbmg-el-pagination .page-numbers:focus-visible {
	background: #0f4f1d;
	border-color: #0f4f1d;
	color: #fff;
	outline: none;
}

.hbmg-el-pagination .page-numbers.current {
	background: #0f4f1d;
	border-color: #0f4f1d;
	color: #fff;
	pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   8. Responsive
   Breakpoints match Elementor defaults: tablet ≤1024px, mobile ≤767px.
   !important overrides any inline scoped grid styles from the widget PHP.
───────────────────────────────────────────────────────────────────────────── */

/* ── Tablet ── */
@media (max-width: 1024px) {
	.hbmg-el-archive-grid  { grid-template-columns: repeat(2, 1fr) !important; }
	.hbmg-el-photo-grid    { grid-template-columns: repeat(2, 1fr) !important; }
	.hbmg-el-video-grid    { grid-template-columns: repeat(2, 1fr) !important; }
	.hbmg-el-card__thumb   { height: 180px; }
}

/* ── Mobile ── */
@media (max-width: 767px) {
	.hbmg-el-archive-grid  { grid-template-columns: 1fr !important; gap: 14px; }
	.hbmg-el-photo-grid    { grid-template-columns: 1fr !important; gap: 10px; }
	.hbmg-el-video-grid    { grid-template-columns: 1fr !important; gap: 14px; }

	/* Cards */
	.hbmg-el-card__thumb   { height: 200px; }
	.hbmg-el-section-title { font-size: 1.4rem; margin-bottom: 20px; }

	/* Lightbox */
	.hbmg-el-lb-wrap       { max-width: 98vw; gap: 4px; padding: 0 2px; }
	.hbmg-el-lb-img        { max-width: 92vw; max-height: 72vh; }
	.hbmg-el-lb-btn        { width: 36px; height: 36px; }
	.hbmg-el-lb-close      { top: -44px; }

	/* Video modal */
	.hbmg-el-vm-wrap       { width: 97vw; }
	.hbmg-el-vm-close      { top: -40px; }

	/* Year filter */
	.hbmg-el-year-filter   { gap: 6px; margin-bottom: 18px; }
	.hbmg-el-year-btn      { padding: 5px 14px; font-size: .8rem; }
}

/* ── Small mobile (≤480px) ── */
@media (max-width: 480px) {
	.hbmg-el-photo-item__thumb { height: 180px; }
	.hbmg-el-card__thumb       { height: 170px; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   9. Year Taxonomy — Fallback Card, Badges & Filter Bar
───────────────────────────────────────────────────────────────────────────── */

/* Fallback SVG fills the entire thumb area */
.hbmg-el-card__year-fallback,
.hbmg-card-year-fallback {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: stretch;
}

.hbmg-el-card__year-fallback svg,
.hbmg-card-year-fallback svg {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

/* Year pill — top-left corner of the card thumb */
.hbmg-el-card__year-pill {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 3px 9px;
	background: rgba(15, 79, 29, 0.90);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	border-radius: 20px;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	line-height: 1.6;
	pointer-events: none;
}

/* Year filter bar */
.hbmg-el-year-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-bottom: 28px;
}

.hbmg-el-year-btn {
	padding: 7px 20px;
	border-radius: 30px;
	border: 1.5px solid #d1d5db;
	background: #fff;
	color: #374151;
	font-size: .875rem;
	font-weight: 500;
	cursor: pointer;
	transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
	letter-spacing: .03em;
}

.hbmg-el-year-btn:hover {
	border-color: #0f4f1d;
	color: #0f4f1d;
	transform: translateY(-1px);
}

.hbmg-el-year-btn.is-active {
	background: #0f4f1d;
	border-color: #0f4f1d;
	color: #fff;
	pointer-events: none;
}

/* Fade-out for filtered-out cards */
.hbmg-el-card.is-hidden {
	display: none;
}

.hbmg-el-card.is-visible {
	display: flex;
	animation: hbmgCardFadeIn .25s ease forwards;
}

@keyframes hbmgCardFadeIn {
	from { opacity: 0; transform: scale(.97); }
	to   { opacity: 1; transform: scale(1); }
}

/* Year badges on native template archive cards */
.hbmg-card-year-badges {
	position: absolute;
	bottom: 8px;
	left: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.hbmg-year-badge {
	padding: 2px 8px;
	background: rgba(15, 79, 29, .88);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .05em;
	border-radius: 20px;
}

.hbmg-card-year-meta {
	font-size: .78rem;
	color: rgba(255,255,255,.65);
	text-align: center;
	margin: 0;
}
