/*
 * TZIT Media Album — Frontend Stylesheet
 * Version: 1.0.0
 *
 * Table of Contents:
 *  1. CSS Custom Properties
 *  2. Base / Reset
 *  3. Hero
 *  4. Entry Header
 *  5. Photo Grid
 *  6. Video Grid
 *  7. Archive Grid / Cards
 *  8. Pagination
 *  9. Lightbox
 * 10. Utilities / Empty State
 * 11. Responsive
 */

/* ─────────────────────────────────────────────────────────────────────────────
   1. CSS Custom Properties
───────────────────────────────────────────────────────────────────────────── */
:root {
	--hbmg-primary:        #1a1a2e;
	--hbmg-accent:         #e94560;
	--hbmg-accent-hover:   #c73652;
	--hbmg-bg:             #f8f8f8;
	--hbmg-card-bg:        #ffffff;
	--hbmg-text:           #1a1a2e;
	--hbmg-text-muted:     #6b7280;
	--hbmg-border:         #e5e7eb;
	--hbmg-radius:         12px;
	--hbmg-radius-sm:      6px;
	--hbmg-shadow:         0 4px 24px rgba(0, 0, 0, .08);
	--hbmg-shadow-hover:   0 12px 40px rgba(0, 0, 0, .15);
	--hbmg-transition:     0.25s cubic-bezier(0.4, 0, 0.2, 1);
	--hbmg-cols:           3;
	--hbmg-gap:            16px;
	--hbmg-max-width:      1200px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   2. Base / Reset
───────────────────────────────────────────────────────────────────────────── */
.hbmg-single-wrap,
.hbmg-archive-wrap {
	max-width: var(--hbmg-max-width);
	margin: 0 auto;
	padding: 0 20px 60px;
}

.hbmg-gallery-section {
	margin-top: 40px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   3. Entry Header  (single post — no featured image shown)
───────────────────────────────────────────────────────────────────────────── */
.hbmg-entry-header {
	padding: 40px 0 20px;
	border-bottom: 3px solid var(--hbmg-accent);
	margin-bottom: 36px;
}

.hbmg-entry-title {
	font-size: clamp(1.6rem, 3vw, 2.4rem);
	font-weight: 800;
	margin: 0 0 14px;
	color: var(--hbmg-text);
	line-height: 1.2;
	letter-spacing: -.02em;
}

/* Meta row — count + year tags on one line */
.hbmg-entry-meta-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.hbmg-entry-meta {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: .9rem;
	color: var(--hbmg-text-muted);
}

/* Clickable year tags in the single post header */
.hbmg-entry-year-tag {
	display: inline-flex;
	align-items: center;
	padding: 3px 12px;
	border-radius: 20px;
	background: var(--hbmg-accent);
	color: #fff;
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-decoration: none;
	transition: background var(--hbmg-transition);
}

.hbmg-entry-year-tag:hover {
	background: var(--hbmg-accent-hover);
}

.hbmg-entry-content {
	margin-bottom: 32px;
	color: var(--hbmg-text);
	line-height: 1.7;
}

/* ─────────────────────────────────────────────────────────────────────────────
   5. Photo Grid
───────────────────────────────────────────────────────────────────────────── */
.hbmg-photo-grid {
	display: grid;
	grid-template-columns: repeat(var(--hbmg-cols, 3), 1fr);
	gap: var(--hbmg-gap);
}

.hbmg-photo-item {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: var(--hbmg-radius-sm);
	background: var(--hbmg-border);
	cursor: pointer;
	text-decoration: none;
	aspect-ratio: 1 / 1;
}

.hbmg-photo-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--hbmg-transition);
}

.hbmg-photo-item:hover img,
.hbmg-photo-item:focus img {
	transform: scale(1.07);
}

.hbmg-zoom-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0);
	color: #fff;
	opacity: 0;
	transition: opacity var(--hbmg-transition), background var(--hbmg-transition);
}

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

.hbmg-zoom-icon svg {
	filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
	width: 40px;
	height: 40px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   6. Video Grid
───────────────────────────────────────────────────────────────────────────── */
.hbmg-video-grid {
	display: grid;
	grid-template-columns: repeat(var(--hbmg-cols, 3), 1fr);
	gap: var(--hbmg-gap);
}

.hbmg-video-item {
	border-radius: var(--hbmg-radius-sm);
	overflow: hidden;
	background: #000;
	box-shadow: var(--hbmg-shadow);
	transition: box-shadow var(--hbmg-transition), transform var(--hbmg-transition);
}

.hbmg-video-item:hover {
	box-shadow: var(--hbmg-shadow-hover);
	transform: translateY(-2px);
}

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

.hbmg-video-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--hbmg-transition), opacity var(--hbmg-transition);
}

.hbmg-video-thumb:hover img {
	transform: scale(1.04);
	opacity: .85;
}

.hbmg-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	transition: transform var(--hbmg-transition), opacity var(--hbmg-transition);
	opacity: .9;
	pointer-events: none;
}

.hbmg-video-thumb:hover .hbmg-play-btn {
	transform: translate(-50%, -50%) scale(1.12);
	opacity: 1;
}

/* Active / loaded iframe */
.hbmg-video-player {
	aspect-ratio: 16 / 9;
}

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

/* ─────────────────────────────────────────────────────────────────────────────
   7. Archive Grid / Cards
───────────────────────────────────────────────────────────────────────────── */
.hbmg-archive-header {
	padding: 48px 0 32px;
}

.hbmg-archive-title {
	font-size: clamp(1.75rem, 4vw, 3rem);
	font-weight: 800;
	margin: 0 0 12px;
	color: var(--hbmg-text);
	letter-spacing: -.02em;
}

.hbmg-archive-description {
	color: var(--hbmg-text-muted);
	margin: 0;
	font-size: 1.05rem;
}

.hbmg-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
}

/* Card */
.hbmg-archive-card {
	border-radius: var(--hbmg-radius);
	overflow: hidden;
	background: var(--hbmg-card-bg);
	box-shadow: var(--hbmg-shadow);
	transition: box-shadow var(--hbmg-transition), transform var(--hbmg-transition);
}

.hbmg-archive-card:hover {
	box-shadow: var(--hbmg-shadow-hover);
	transform: translateY(-4px);
}

.hbmg-card-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.hbmg-card-thumb {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--hbmg-primary);
}

.hbmg-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--hbmg-transition);
}

.hbmg-archive-card:hover .hbmg-card-thumb img {
	transform: scale(1.06);
}

.hbmg-card-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--hbmg-primary) 0%, #16213e 100%);
	color: rgba(255,255,255,.25);
}

.hbmg-card-overlay {
	position: absolute;
	bottom: 0;
	right: 0;
	padding: 8px 12px;
	background: var(--hbmg-accent);
	color: #fff;
	border-radius: var(--hbmg-radius-sm) 0 0 0;
}

.hbmg-card-count {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .03em;
	white-space: nowrap;
}

.hbmg-card-body {
	padding: 20px;
}

.hbmg-card-title {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 8px;
	color: var(--hbmg-text);
	line-height: 1.3;
}

.hbmg-card-excerpt {
	font-size: .875rem;
	color: var(--hbmg-text-muted);
	margin: 0;
	line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────────────────────
   8. Pagination
───────────────────────────────────────────────────────────────────────────── */
.hbmg-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 48px;
	flex-wrap: wrap;
}

.hbmg-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: var(--hbmg-radius-sm);
	border: 1.5px solid var(--hbmg-border);
	color: var(--hbmg-text);
	text-decoration: none;
	font-size: .9rem;
	font-weight: 500;
	transition: background var(--hbmg-transition), color var(--hbmg-transition), border-color var(--hbmg-transition);
}

.hbmg-pagination .page-numbers:hover,
.hbmg-pagination .page-numbers:focus {
	background: var(--hbmg-accent);
	border-color: var(--hbmg-accent);
	color: #fff;
}

.hbmg-pagination .page-numbers.current {
	background: var(--hbmg-accent);
	border-color: var(--hbmg-accent);
	color: #fff;
	pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   9. Lightbox
───────────────────────────────────────────────────────────────────────────── */
.hbmg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

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

.hbmg-lightbox-inner {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: 90vw;
	max-height: 90vh;
	padding: 0 16px;
}

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

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

.hbmg-lightbox-caption {
	color: rgba(255,255,255,.8);
	font-size: .875rem;
	margin: 0;
	text-align: center;
	max-width: 600px;
}

/* Lightbox buttons */
.hbmg-lightbox-close,
.hbmg-lightbox-prev,
.hbmg-lightbox-next {
	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;
	transition: background var(--hbmg-transition);
	flex-shrink: 0;
}

.hbmg-lightbox-close:hover,
.hbmg-lightbox-prev:hover,
.hbmg-lightbox-next:hover {
	background: rgba(255,255,255,.28);
}

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

/* Fade-in animation */
.hbmg-lightbox.is-open {
	animation: hbmgFadeIn .2s ease forwards;
}

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

@keyframes hbmgFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes hbmgFadeOut {
	from { opacity: 1; }
	to   { opacity: 0; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   10. Utilities / Empty State
───────────────────────────────────────────────────────────────────────────── */
.hbmg-empty {
	text-align: center;
	color: var(--hbmg-text-muted);
	padding: 48px 24px;
	border: 2px dashed var(--hbmg-border);
	border-radius: var(--hbmg-radius);
	font-size: 1rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   11. Responsive
───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
	.hbmg-photo-grid,
	.hbmg-video-grid {
		--hbmg-cols: 2;
	}
}

@media (max-width: 640px) {
	.hbmg-photo-grid,
	.hbmg-video-grid {
		--hbmg-cols: 1;
	}

	.hbmg-hero-overlay {
		padding: 20px 16px 16px;
	}

	.hbmg-archive-grid {
		grid-template-columns: 1fr;
	}

	.hbmg-lightbox-inner {
		max-width: 95vw;
		padding: 0 8px;
		gap: 8px;
	}

	.hbmg-lightbox-img {
		max-width: 88vw;
		max-height: 72vh;
	}

	.hbmg-lightbox-prev,
	.hbmg-lightbox-next {
		width: 36px;
		height: 36px;
	}
}

/* ─────────────────────────────────────────────────────────────────────────────
   12. Year Taxonomy — Fallback Cards & Badges
───────────────────────────────────────────────────────────────────────────── */

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

.hbmg-card-year-fallback svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* Year badges overlaid on the thumb */
.hbmg-card-year-badges {
	position: absolute;
	bottom: 8px;
	left: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

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

/* Year meta line inside card body */
.hbmg-card-year-meta {
	font-size: .78rem;
	color: rgba(255,255,255,.65);
	text-align: center;
	margin: 2px 0 0;
}
