/* =============================================================================
   JOURNAL GRID — Pace Gallery editorial aesthetic + AGL filter UX
   ============================================================================= */

/* ── Keyframes ────────────────────────────────────────────────────────────── */

@keyframes gz-card-in {
	from {
		opacity: 0;
		transform: translateY(28px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

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

@keyframes gz-filter-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes gz-dropdown-in {
	from { opacity: 0; transform: translateY(-6px) scaleY(0.96); }
	to   { opacity: 1; transform: translateY(0) scaleY(1); }
}

/* ── Archive page wrapper ─────────────────────────────────────────────────── */

.gz-journal-archive-wrap {
	padding-top: clamp(32px, 4vw, 64px);
	padding-bottom: clamp(60px, 8vw, 120px);
}

.gz-journal-archive__header {
	margin-bottom: clamp(28px, 3vw, 48px);
}

.gz-journal-archive__title {
	font-size: clamp(28px, 4.5vw, 56px);
	font-weight: 300;
	letter-spacing: -0.02em;
	line-height: 1.05;
	margin: 0 0 10px;
}

.gz-journal-archive__desc {
	font-size: 15px;
	color: #777;
	max-width: 58ch;
	margin: 0;
	line-height: 1.6;
}

/* ── Base wrapper ─────────────────────────────────────────────────────────── */

.gz-journal {
	position: relative;
}

/* ── Filter bar wrapper (single row: tabs left + artist picker right) ─────── */

.gz-journal__filter-bar {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 0 16px;
	border-bottom: 1px solid #e8e8e8;
	margin-bottom: 40px;
}

/* ── Filter — shared ─────────────────────────────────────────────────────── */

.gz-journal__filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

/* ── Filter — CATEGORY PILLS (left side of bar) ──────────────────────────── */

.gz-journal__filter--tabs {
	flex: 1;
	gap: 5px 3px;
	border-bottom: none; /* bar handles the bottom border */
	padding-bottom: 0;
	margin-bottom: 0;
}

.gz-journal__filter-tab {
	display: inline-flex;
	align-items: center;
	padding: 7px 16px;
	border: 1px solid transparent;
	background: transparent;
	border-radius: 40px;
	cursor: pointer;
	font-size: 11.5px;
	font-family: inherit;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: #999;
	line-height: 1;
	white-space: nowrap;
	/* Smooth fill transition — matches Pace active-pill feel */
	transition:
		color 0.22s ease,
		border-color 0.22s ease,
		background-color 0.22s ease,
		transform 0.15s ease;
	position: relative;
	margin-bottom: -1px;
	will-change: transform;
}

.gz-journal__filter-tab:hover {
	color: #222;
	border-color: #d0d0d0;
	transform: translateY(-1px);
}

.gz-journal__filter-tab:active {
	transform: scale(0.97);
}

.gz-journal__filter-tab.is-active {
	background-color: #111;
	color: #fff;
	border-color: #111;
}

/* ── Filter — ARTIST TOGGLE PANEL (right side of bar, Pace style) ────────── */

.gz-journal__filter--dropdown {
	flex-shrink: 0;
	margin: 0;
	padding-bottom: 1px; /* subtle optical alignment with pill text */
}

/* Container: position relative so the panel anchors to it */
.gz-journal__artist-picker {
	position: relative;
	display: inline-block;
}

/* Toggle button — Pace-style: plain text + chevron, no box/pill */
.gz-journal__artist-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	/* Hard-reset all theme button styles */
	background: none !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	/* Our own underline */
	border-bottom: 1.5px solid #bbb !important;
	padding: 6px 0 !important;
	margin: 0;
	font-size: 11.5px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	font-family: inherit;
	color: #555;
	font-weight: 500;
	white-space: nowrap;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.gz-journal__artist-toggle:hover {
	color: #111;
	border-bottom-color: #111 !important;
}

.gz-journal__artist-toggle[aria-expanded="true"] {
	color: #111;
	border-bottom-color: #111 !important;
}

/* Chevron rotates when open */
.gz-journal__artist-chevron {
	width: 11px;
	height: 7px;
	transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
	flex-shrink: 0;
}

.gz-journal__artist-picker.is-open .gz-journal__artist-chevron {
	transform: rotate(180deg);
}

/* Dropdown panel */
.gz-journal__artist-panel {
	position: absolute;
	top: calc(100% + 2px);
	left: 0;
	min-width: 220px;
	max-height: 320px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #e0e0e0;
	padding: 6px 0;
	z-index: 200;
	box-shadow: 0 6px 28px rgba(0, 0, 0, 0.09);
	transform-origin: top left;
	animation: gz-dropdown-in 0.22s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.gz-journal__artist-panel[hidden] {
	display: none;
}

/* Individual options */
.gz-journal__artist-opt {
	display: block;
	width: 100%;
	padding: 10px 20px;
	text-align: left;
	background: none;
	border: none;
	font-size: 13px;
	font-family: inherit;
	color: #666;
	cursor: pointer;
	letter-spacing: 0.02em;
	line-height: 1.3;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.gz-journal__artist-opt:hover {
	color: #111;
	background-color: #f6f6f6;
}

.gz-journal__artist-opt.is-active {
	color: #111;
	font-weight: 500;
}

/* ── POSTS CONTAINER ─────────────────────────────────────────────────────── */

.gz-journal__posts-wrap {
	margin-top: clamp(28px, 3vw, 48px);
	/* Fade container during filter switch */
	transition: opacity 0.18s ease;
	/* Allow card lift to visually overflow the container */
	overflow: visible;
}

.gz-journal__posts-wrap.is-switching {
	opacity: 0;
	pointer-events: none;
}

/* Legacy loading state (still used for append) */
.gz-journal__posts.is-loading {
	opacity: 0.25;
	pointer-events: none;
	transition: opacity 0.12s ease;
}

/* ── GRID layout ──────────────────────────────────────────────────────────── */

.gz-journal__grid {
	display: grid;
	gap: 52px 28px;
	width: 100%;
	/* Prevent card lift being clipped — add edge padding then pull back with margin */
	padding: 8px 6px;
	margin: -8px -6px;
	overflow: visible;
}

.gz-journal__cols-2 { grid-template-columns: repeat(2, 1fr); }
.gz-journal__cols-3 { grid-template-columns: repeat(3, 1fr); }
.gz-journal__cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Filter bar stacks on small screens */
@media (max-width: 600px) {
	.gz-journal__filter-bar {
		flex-wrap: wrap;
		gap: 12px 0;
	}
	.gz-journal__filter--tabs {
		width: 100%;
	}
	.gz-journal__filter--dropdown {
		width: 100%;
		padding-bottom: 8px;
	}
}

@media (max-width: 600px) {
	.gz-journal__cols-2,
	.gz-journal__cols-3,
	.gz-journal__cols-4 { grid-template-columns: 1fr; }
}

@media (min-width: 601px) and (max-width: 900px) {
	.gz-journal__cols-3,
	.gz-journal__cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 901px) and (max-width: 1140px) {
	.gz-journal__cols-4 { grid-template-columns: repeat(3, 1fr); }
}

/* ── FEATURED first card (Pace hero — image left, text right) ────────────── */

.gz-journal__grid .gz-journal__card--featured {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: 0 52px;
	align-items: end;
	padding-bottom: 52px;
	border-bottom: 1px solid #e8e8e8;
}

.gz-journal__grid .gz-journal__card--featured .gz-journal__card-image {
	aspect-ratio: 16 / 9;
	margin-bottom: 0;
}

.gz-journal__grid .gz-journal__card--featured .gz-journal__card-body {
	padding-bottom: 6px;
}

.gz-journal__grid .gz-journal__card--featured .gz-journal__card-cat {
	font-size: 10px;
	letter-spacing: 0.14em;
}

.gz-journal__grid .gz-journal__card--featured .gz-journal__card-title {
	font-size: clamp(22px, 2.8vw, 42px);
	font-weight: 300;
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin-bottom: 16px;
}

.gz-journal__grid .gz-journal__card--featured .gz-journal__card-meta {
	margin-top: 0;
}

/* Featured card: no vertical lift on hover (too large) */
.gz-journal__grid .gz-journal__card--featured {
	transform: none !important;
}

@media (max-width: 700px) {
	.gz-journal__grid .gz-journal__card--featured {
		grid-template-columns: 1fr;
		gap: 20px 0;
	}
}

/* ── CARD (regular grid item) ─────────────────────────────────────────────── */

.gz-journal__card {
	display: flex;
	flex-direction: column;
	/* Pace-style card lift */
	transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

.gz-journal__card:hover {
	transform: translateY(-5px);
}

/* Stagger entrance animation (class added by JS per card) */
.gz-journal__card.gz-j-animate,
.gz-journal__item.gz-j-animate {
	animation: gz-card-in 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── CARD IMAGE (with Pace-style overlay on hover) ────────────────────────── */

.gz-journal__card-image {
	display: block;
	overflow: hidden;
	aspect-ratio: var(--gz-j-ratio, 4/3);
	margin-bottom: 18px;
	text-decoration: none;
	flex-shrink: 0;
	position: relative; /* needed for ::after overlay */
}

/* Dim overlay — appears on hover, mimics Pace hover feel */
.gz-journal__card-image::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.09);
	opacity: 0;
	transition: opacity 0.45s ease;
	pointer-events: none;
}

.gz-journal__card:hover .gz-journal__card-image::after {
	opacity: 1;
}

.gz-journal__card-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* Slightly slower zoom than before — more editorial */
	transition: transform 0.75s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

.gz-journal__card:hover .gz-journal__card-image img {
	transform: scale(1.04);
}

/* Featured card image also zooms, but no overlay darkening */
.gz-journal__grid .gz-journal__card--featured .gz-journal__card-image::after {
	display: none;
}

/* ── CARD BODY ────────────────────────────────────────────────────────────── */

.gz-journal__card-body {
	display: flex;
	flex-direction: column;
	flex: 1;
}

/* Category label */
.gz-journal__card-cat {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.13em;
	color: #999;
	font-weight: 500;
	margin-bottom: 10px;
	transition: color 0.2s ease;
}

.gz-journal__card-cat a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.gz-journal__card:hover .gz-journal__card-cat,
.gz-journal__card-cat a:hover { color: #444; }

/* Title */
.gz-journal__card-title {
	font-size: clamp(15px, 1.35vw, 18px);
	line-height: 1.35;
	margin: 0 0 12px;
	font-weight: 400;
	letter-spacing: -0.005em;
}

.gz-journal__card-title a {
	color: inherit;
	text-decoration: none;
	/* Underline draw from left — Pace gallery staple */
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 0 1px;
	background-repeat: no-repeat;
	background-position: 0 100%;
	transition: background-size 0.38s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.gz-journal__card:hover .gz-journal__card-title a {
	background-size: 100% 1px;
}

/* Excerpt */
.gz-journal__card-excerpt {
	font-size: 13px;
	line-height: 1.65;
	color: #666;
	margin: 0 0 14px;
}

/* Meta row */
.gz-journal__card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	font-size: 11px;
	color: #bbb;
	letter-spacing: 0.04em;
	margin-top: auto;
	padding-top: 4px;
}

/* ── LIST layout (AGL / Pace list style) ──────────────────────────────────── */

.gz-journal__list {
	width: 100%;
}

.gz-journal__item {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 28px;
	padding-bottom: 28px;
	border-bottom: 1px solid #e8e8e8;
	/* Subtle transition on hover */
	transition: padding-left 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.gz-journal__item:first-child { border-top: 1px solid #e8e8e8; }

.gz-journal__item:hover {
	padding-left: 6px;
}

.gz-journal__item-cat {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: #aaa;
	font-weight: 500;
	transition: color 0.2s;
}

.gz-journal__item-cat a { color: inherit; text-decoration: none; }
.gz-journal__item:hover .gz-journal__item-cat { color: #555; }

.gz-journal__item-title {
	font-size: clamp(20px, 2.4vw, 30px);
	font-weight: 300;
	letter-spacing: -0.02em;
	line-height: 1.2;
	margin: 0;
}

.gz-journal__item-title a {
	color: inherit;
	text-decoration: none;
	transition: opacity 0.22s ease;
}

.gz-journal__item:hover .gz-journal__item-title a { opacity: 0.5; }

.gz-journal__item-excerpt {
	font-size: 14px;
	line-height: 1.65;
	color: #666;
	margin: 0;
	max-width: 58ch;
}

.gz-journal__item-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-top: 2px;
}

.gz-journal__item-date,
.gz-journal__item-author {
	font-size: 11px;
	color: #bbb;
	letter-spacing: 0.04em;
}

/* ── LOAD MORE ────────────────────────────────────────────────────────────── */

.gz-journal__pagination {
	text-align: center;
	margin-top: 60px;
}

.gz-journal__load-more {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	padding: 14px 52px;
	border: 1px solid #111;
	background: transparent;
	color: #111;
	font-size: 11px;
	font-family: inherit;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	font-weight: 500;
	transition:
		background-color 0.28s ease,
		color 0.28s ease,
		transform 0.18s ease;
	will-change: transform;
}

.gz-journal__load-more:hover {
	background-color: #111;
	color: #fff;
	transform: translateY(-2px);
}

.gz-journal__load-more:active {
	transform: scale(0.98);
}

.gz-journal__load-more:disabled {
	opacity: 0.3;
	pointer-events: none;
}

.gz-journal__load-more-spinner {
	display: none;
	width: 13px;
	height: 13px;
	border: 1.5px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: gz-journal-spin 0.55s linear infinite;
	flex-shrink: 0;
}

.gz-journal__load-more.is-loading .gz-journal__load-more-text { opacity: 0.4; }
.gz-journal__load-more.is-loading .gz-journal__load-more-spinner { display: inline-block; }

/* ── Empty state ──────────────────────────────────────────────────────────── */

.gz-journal__no-posts {
	color: #bbb;
	font-size: 14px;
	padding: 60px 0;
	text-align: center;
	grid-column: 1 / -1;
	letter-spacing: 0.04em;
	animation: gz-filter-in 0.4s ease both;
}
