/*
 * FANTASYREALM - PUBLIC CHARACTER GALLERY
 *
 * Gallery-specific layout, filters and character cards.
 * The shared header, footer and application shell
 * are styled by their dedicated stylesheets.
 */

/* =========================================================
   PAGE AND HERO
========================================================= */

.gallery-page {
	color: #f5f0ff;
	font-family: "Inter", sans-serif;
}

.gallery-hero {
	position: relative;
	display: flex;
	align-items: flex-end;

	min-height: 310px;
	padding: 70px 5% 90px;

	border-bottom: 1px solid rgba(168, 85, 247, 0.2);

	background:
		linear-gradient(180deg,
			rgba(5, 4, 18, 0.24),
			rgba(5, 4, 18, 0.92)),
		url("../assets/backgrounds/gallery-galaxy.png") center 42% / cover no-repeat;
}

.gallery-hero::after {
	content: "";
	position: absolute;
	inset: 0;

	background: radial-gradient(circle at 78% 18%,
			rgba(168, 85, 247, 0.24),
			transparent 32%);

	pointer-events: none;
}

.gallery-hero-copy {
	position: relative;
	z-index: 1;
	width: min(760px, 100%);
}

.gallery-page .eyebrow {
	margin: 0 0 12px;

	color: #d8b4fe;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.28em;
}

.gallery-hero h1,
.gallery-heading h2,
.character-info h3 {
	font-family: "Cinzel", serif;
}

.gallery-hero h1 {
	margin: 0;

	color: #faf4ff;
	font-size: clamp(38px, 6vw, 70px);
	line-height: 1.15;

	text-shadow: 0 0 30px rgba(168, 85, 247, 0.4);
}

.gallery-hero-copy>p:last-child {
	margin: 18px 0 0;

	color: #ded5ec;
	font-size: 15px;
	line-height: 1.8;
}

/* =========================================================
   GALLERY CONTAINER
========================================================= */

.gallery-shell {
	box-sizing: border-box;

	position: relative;
	z-index: 2;

	width: min(1500px, calc(100% - 40px));
	margin: -36px auto 80px;
	padding: 32px;

	border: 1px solid rgba(168, 85, 247, 0.42);
	border-radius: 22px;

	background: linear-gradient(145deg,
			rgba(17, 12, 40, 0.96),
			rgba(8, 7, 26, 0.95));

	box-shadow:
		0 24px 65px rgba(0, 0, 0, 0.3),
		0 0 35px rgba(124, 58, 237, 0.11);
}

.gallery-topbar {
	margin-bottom: 24px;
}

.gallery-heading h2 {
	margin: 0 0 10px;

	font-size: clamp(25px, 4vw, 34px);
	font-weight: 600;
}

.gallery-description {
	margin: 0;

	color: #c9c0da;
	font-size: 13px;
	line-height: 1.7;
}

/* =========================================================
   FILTER PANEL
========================================================= */

.gallery-filters {
	display: grid;
	grid-template-columns:
		minmax(150px, 1.4fr) minmax(135px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) auto;

	align-items: end;
	gap: 14px;

	margin-bottom: 23px;
	padding: 22px;

	border: 1px solid rgba(196, 131, 255, 0.35);
	border-radius: 16px;

	background: rgba(7, 6, 22, 0.62);
}

.filter-field {
	display: flex;
	flex-direction: column;
	gap: 9px;
	min-width: 0;
}

.filter-field label {
	color: #d8b4fe;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.filter-field input,
.filter-field select {
	box-sizing: border-box;

	width: 100%;
	min-width: 0;
	height: 45px;
	padding: 0 13px;

	border: 1px solid rgba(168, 85, 247, 0.42);
	border-radius: 10px;

	background: #100c27;
	color: #fff;

	font-family: "Inter", sans-serif;
	font-size: 13px;

	color-scheme: dark;
}

.filter-field input::placeholder {
	color: #aaa0bf;
}

.filter-field input:focus-visible,
.filter-field select:focus-visible {
	outline: 2px solid rgba(216, 180, 254, 0.75);
	outline-offset: 2px;
}

.clear-filters {
	min-height: 45px;
	padding: 10px 18px;

	border: 1px solid rgba(216, 180, 254, 0.45);
	border-radius: 10px;

	background: rgba(124, 58, 237, 0.22);
	color: #f5e8ff;

	font-family: "Inter", sans-serif;
	font-size: 12px;
	font-weight: 600;

	white-space: nowrap;
	cursor: pointer;
}

.clear-filters:hover {
	border-color: #d8b4fe;
	background: rgba(124, 58, 237, 0.38);
}

.clear-filters:focus-visible {
	outline: 2px solid #edd5a8;
	outline-offset: 3px;
}

/* =========================================================
   GALLERY STATUS
========================================================= */

.gallery-count {
	margin: 0 0 20px;

	color: #c9c0da;
	font-size: 12px;
}

.empty-gallery {
	margin: 20px 0;
	padding: 34px 20px;

	border: 1px solid rgba(168, 85, 247, 0.27);
	border-radius: 14px;

	background: rgba(8, 7, 26, 0.65);
	color: #d8cee8;

	font-size: 14px;
	line-height: 1.7;
	text-align: center;
}

.gallery-page [hidden] {
	display: none !important;
}

/* =========================================================
   CHARACTER GRID
========================================================= */

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

.character-card {
	display: flex;
	flex-direction: column;

	min-width: 0;
	overflow: hidden;

	border: 1px solid rgba(168, 85, 247, 0.45);
	border-radius: 16px;

	background: linear-gradient(155deg,
			rgba(22, 15, 49, 0.97),
			rgba(6, 7, 22, 0.98));

	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);

	transition:
		transform 180ms ease,
		border-color 180ms ease,
		box-shadow 180ms ease;
}

/*
 * CHARACTER CARD - HOVER EFFECT
 *
 * The card moves upward as a single element.
 * The shadow follows the transformed card and creates
 * a subtle floating effect without a visible top gap.
 */

.character-card:hover {
	transform: translateY(-5px);

	border-color: rgba(216, 180, 254, 0.85);

	box-shadow:
		0 22px 45px rgba(0, 0, 0, 0.45),
		0 0 24px rgba(168, 85, 247, 0.18);
}

/* =========================================================
   CHARACTER IMAGE
========================================================= */

.character-stage {
	position: relative;
	display: grid;
	place-items: center;

	height: 270px;
	overflow: hidden;

	background:
		radial-gradient(ellipse at 50% 80%,
			rgba(168, 85, 247, 0.3),
			transparent 44%),
		linear-gradient(180deg,
			rgba(41, 25, 66, 0.22),
			rgba(8, 7, 24, 0.9));
}

.character-stage img {
	position: relative;
	z-index: 2;

	width: 100%;
	height: 100%;

	object-fit: cover;
	object-position: center top;
}

/*
 * CHARACTER STAGE - SEAMLESS BOTTOM FADE
 *
 * The overlay gradually darkens the artwork towards
 * the character information area.
 *
 * The final gradient color exactly matches the background
 * of the information section to avoid a visible seam.
 */
.character-stage::after {
	content: "";

	position: absolute;
	z-index: 3;

	inset: 0;

	background: linear-gradient(to bottom,
			transparent 45%,
			rgba(11, 9, 28, 0.45) 75%,
			#0b091c 100%);

	pointer-events: none;
}

/* =========================================================
   CHARACTER INFORMATION
========================================================= */

.character-info {
	display: flex;
	flex: 1;
	flex-direction: column;

	gap: 8px;
	padding: 19px;

	background: #0b091c;
}

.character-info h3 {
	margin: 0;

	overflow-wrap: anywhere;

	color: #faf4ff;
	font-size: 19px;
	line-height: 1.4;
}

.creator,
.character-gender,
.created-date {
	margin: 0;

	color: #bbb2cf;
	font-size: 12px;
	line-height: 1.6;
}

.view-button {
	display: inline-flex;
	justify-content: center;
	align-items: center;

	min-height: 42px;
	margin-top: auto;
	padding: 11px 13px;

	border: 1px solid rgba(233, 213, 255, 0.65);
	border-radius: 999px;

	background: linear-gradient(135deg,
			#6d28d9,
			#a855f7);

	color: #fff;

	font-size: 12px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;

	transition: box-shadow 180ms ease;
}

.view-button:hover {
	box-shadow: 0 0 24px rgba(168, 85, 247, 0.45);
}

.view-button:focus-visible {
	outline: 2px solid #edd5a8;
	outline-offset: 3px;
}

/* =========================================================
   PAGINATION
========================================================= */

.gallery-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;

	gap: 9px;
	margin-top: 36px;
}

.pagination-button {
	min-width: 42px;
	min-height: 42px;
	padding: 10px 13px;

	border: 1px solid rgba(196, 131, 255, 0.36);
	border-radius: 10px;

	background: rgba(10, 9, 28, 0.85);
	color: #eee8f8;

	font-family: "Inter", sans-serif;
	font-size: 13px;
	font-weight: 600;

	cursor: pointer;
}

.pagination-button:hover {
	border-color: #c084fc;
	background: rgba(124, 58, 237, 0.28);
}

.pagination-button.active {
	border-color: #d8b4fe;

	background: linear-gradient(135deg,
			#6d28d9,
			#a855f7);

	color: #fff;
}

.pagination-button:focus-visible {
	outline: 2px solid #edd5a8;
	outline-offset: 3px;
}

/* =========================================================
   RESPONSIVE DESIGN
========================================================= */

@media (max-width: 1200px) {
	.gallery-filters {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.clear-filters {
		grid-column: 1 / -1;
	}

	.gallery-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 850px) {
	.gallery-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.gallery-hero {
		min-height: 230px;
		padding: 48px 20px 65px;
	}

	.gallery-hero h1 {
		font-size: clamp(32px, 10vw, 48px);
	}

	.gallery-hero-copy>p:last-child {
		font-size: 13px;
	}

	.gallery-shell {
		width: calc(100% - 20px);
		margin-top: -20px;
		padding: 20px 15px;
		border-radius: 17px;
	}

	.gallery-filters {
		grid-template-columns: 1fr;
		padding: 16px;
	}

	.clear-filters {
		grid-column: auto;
		width: 100%;
	}

	.gallery-grid {
		gap: 12px;
	}

	.character-stage {
		height: 210px;
	}

	.character-info {
		padding: 13px;
	}

	.character-info h3 {
		font-size: 16px;
	}
}

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

	.character-stage {
		height: 300px;
	}
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

	.character-card,
	.view-button {
		transition: none;
	}

	.character-card:hover {
		transform: none;
	}
}


/*
 * CHARACTER CARD - TOP EDGE FIX
 *
 * Keeps the visual background and its gradient attached
 * to the card while preventing a thin uncovered strip
 * from appearing during hover transformations.
 */

.character-card {
	position: relative;
	isolation: isolate;
	background-clip: padding-box;
}

.character-card .character-stage {
	border-radius: 15px 15px 0 0;
}

/*
 * CHARACTER CARD - PREVENT SUBPIXEL SEAMS
 *
 * Slightly overlap the information panel with the stage.
 * This prevents a one-pixel gap during hover transforms.
 */
.character-card .character-info {
	position: relative;
	z-index: 4;

	margin-top: -2px;
	padding-top: 21px;
}