/**
 * Feeling For You – Poem Manager
 * Public gallery stylesheet — premium romantic design system.
 */

.ffy-gallery {
	--ffy-primary: #E91E63;
	--ffy-secondary: #FF5E8A;
	--ffy-accent: #FF8FAB;
	--ffy-soft-rose: #FDE2E4;
	--ffy-light-pink: #FFF0F5;
	--ffy-lavender: #F8F1FF;
	--ffy-cream: #FFF8F2;
	--ffy-ink: #3A2233;
	--ffy-ink-soft: #7A5C6E;
	--ffy-white: #FFFFFF;
	--ffy-radius-lg: 24px;
	--ffy-radius-md: 16px;
	--ffy-radius-sm: 10px;
	--ffy-shadow-soft: 0 10px 30px rgba(233, 30, 99, 0.12);
	--ffy-shadow-lift: 0 20px 45px rgba(233, 30, 99, 0.22);
	--ffy-gradient-primary: linear-gradient(135deg, var(--ffy-primary) 0%, var(--ffy-secondary) 100%);
	--ffy-gradient-bg: linear-gradient(180deg, var(--ffy-cream) 0%, var(--ffy-light-pink) 45%, var(--ffy-lavender) 100%);
	--ffy-font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
	--ffy-font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

	box-sizing: border-box;
	background: var(--ffy-gradient-bg);
	border-radius: 28px;
	padding: 32px 24px 48px;
	font-family: var(--ffy-font-body);
	color: var(--ffy-ink);
	position: relative;
	isolation: isolate;
}

.ffy-gallery *,
.ffy-gallery *::before,
.ffy-gallery *::after {
	box-sizing: border-box;
}

.ffy-gallery__toolbar {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin-bottom: 28px;
	align-items: center;
}

/* Search */
.ffy-search {
	position: relative;
	width: 100%;
	max-width: 480px;
}

.ffy-search__icon {
	position: absolute;
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
	opacity: 0.55;
	font-size: 16px;
	pointer-events: none;
}

.ffy-search__input {
	width: 100%;
	padding: 14px 20px 14px 46px;
	border-radius: 999px;
	border: 2px solid transparent;
	background: var(--ffy-white);
	box-shadow: var(--ffy-shadow-soft);
	font-family: var(--ffy-font-body);
	font-size: 15px;
	color: var(--ffy-ink);
	transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.ffy-search__input:focus {
	outline: none;
	border-color: var(--ffy-accent);
	box-shadow: 0 0 0 4px rgba(255, 143, 171, 0.25), var(--ffy-shadow-soft);
	transform: translateY(-1px);
}

.ffy-search__input::placeholder {
	color: var(--ffy-ink-soft);
	opacity: 0.7;
}

/* Category tabs */
.ffy-tabs {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	max-width: 100%;
	padding: 6px 4px;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.ffy-tabs::-webkit-scrollbar {
	height: 6px;
}

.ffy-tabs::-webkit-scrollbar-thumb {
	background: var(--ffy-accent);
	border-radius: 999px;
}

.ffy-tab {
	flex: 0 0 auto;
	padding: 10px 22px;
	border-radius: 999px;
	border: none;
	background: var(--ffy-white);
	color: var(--ffy-ink);
	font-family: var(--ffy-font-body);
	font-weight: 500;
	font-size: 14px;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(233, 30, 99, 0.08);
	transition: transform 0.2s ease, background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
	white-space: nowrap;
}

.ffy-tab:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(233, 30, 99, 0.18);
}

.ffy-tab.is-active {
	background: var(--ffy-gradient-primary);
	color: var(--ffy-white);
	box-shadow: 0 10px 24px rgba(233, 30, 99, 0.35);
}

.ffy-gallery__status {
	min-height: 4px;
}

/* Grid */
.ffy-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
	margin-bottom: 32px;
	transition: opacity 0.25s ease;
}

.ffy-grid.is-loading {
	opacity: 0.45;
	pointer-events: none;
}

/* Cards */
.ffy-card {
	background: rgba(255, 255, 255, 0.75);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: var(--ffy-radius-lg);
	box-shadow: var(--ffy-shadow-soft);
	overflow: hidden;
	cursor: pointer;
	position: relative;
	display: flex;
	flex-direction: column;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
	border: 1px solid rgba(255, 255, 255, 0.6);
	animation: ffy-card-in 0.5s ease both;
}

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

.ffy-card:hover,
.ffy-card:focus-visible {
	transform: translateY(-8px) scale(1.015);
	box-shadow: var(--ffy-shadow-lift);
	outline: none;
}

.ffy-card:focus-visible {
	outline: 3px solid var(--ffy-accent);
	outline-offset: 2px;
}

.ffy-card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.ffy-card__image-trigger {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	border: none;
	background: none;
	cursor: zoom-in;
	font: inherit;
	color: inherit;
}

.ffy-card__image-trigger:focus-visible {
	outline: 3px solid var(--ffy-accent);
	outline-offset: -3px;
}

.ffy-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.ffy-card:hover .ffy-card__image {
	transform: scale(1.08);
}

.ffy-card__image--placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ffy-gradient-primary);
	color: var(--ffy-white);
	font-size: 42px;
}

.ffy-card__glow {
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 50% 100%, rgba(233, 30, 99, 0.35), transparent 70%);
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
}

.ffy-card:hover .ffy-card__glow {
	opacity: 1;
}

.ffy-card__body {
	padding: 20px 22px 22px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.ffy-card__category {
	display: inline-block;
	align-self: flex-start;
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--ffy-primary);
	background: var(--ffy-soft-rose);
	padding: 4px 12px;
	border-radius: 999px;
}

.ffy-card__title {
	font-family: var(--ffy-font-heading);
	font-size: 21px;
	font-weight: 700;
	margin: 4px 0 0;
	line-height: 1.3;
	color: var(--ffy-ink);
}

.ffy-card__author {
	font-size: 13px;
	color: var(--ffy-ink-soft);
	font-style: italic;
	margin: 0;
}

.ffy-card__excerpt {
	font-size: 14px;
	line-height: 1.6;
	color: var(--ffy-ink-soft);
	margin: 4px 0 0;
	flex: 1;
}

.ffy-card__meta {
	display: flex;
	gap: 18px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid rgba(233, 30, 99, 0.12);
}

.ffy-card__stat {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--ffy-ink-soft);
	font-weight: 500;
}

.ffy-heart-icon,
.ffy-eye-icon {
	color: var(--ffy-primary);
	font-size: 14px;
	display: inline-block;
	transition: transform 0.3s ease;
}

.ffy-card__stat--likes.is-pulsing .ffy-heart-icon,
.ffy-like-btn.is-pulsing .ffy-heart-icon {
	animation: ffy-heart-pop 0.5s ease;
}

@keyframes ffy-heart-pop {
	0% { transform: scale(1); }
	35% { transform: scale(1.5); }
	60% { transform: scale(0.9); }
	100% { transform: scale(1); }
}

/* Empty state */
.ffy-empty-state {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	color: var(--ffy-ink-soft);
}

.ffy-empty-state__icon {
	display: block;
	font-size: 40px;
	color: var(--ffy-accent);
	margin-bottom: 12px;
}

/* Loading skeleton */
.ffy-skeleton-card {
	border-radius: var(--ffy-radius-lg);
	overflow: hidden;
	background: var(--ffy-white);
	box-shadow: var(--ffy-shadow-soft);
}

.ffy-skeleton-card__media,
.ffy-skeleton-card__line {
	background: linear-gradient(90deg, var(--ffy-light-pink) 25%, var(--ffy-soft-rose) 37%, var(--ffy-light-pink) 63%);
	background-size: 400% 100%;
	animation: ffy-shimmer 1.4s ease infinite;
}

.ffy-skeleton-card__media {
	aspect-ratio: 4 / 3;
}

.ffy-skeleton-card__line {
	height: 12px;
	border-radius: 6px;
	margin: 18px 22px;
}

.ffy-skeleton-card__line--short {
	width: 55%;
}

@keyframes ffy-shimmer {
	0% { background-position: 100% 0; }
	100% { background-position: -100% 0; }
}

/* Pagination */
.ffy-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	margin-top: 8px;
}

.ffy-page-btn {
	border: none;
	background: var(--ffy-gradient-primary);
	color: var(--ffy-white);
	padding: 10px 22px;
	border-radius: 999px;
	font-family: var(--ffy-font-body);
	font-weight: 500;
	font-size: 14px;
	cursor: pointer;
	box-shadow: 0 8px 20px rgba(233, 30, 99, 0.25);
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.ffy-page-btn:hover:not(:disabled) {
	transform: translateY(-2px) scale(1.03);
	box-shadow: 0 12px 26px rgba(233, 30, 99, 0.32);
}

.ffy-page-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	box-shadow: none;
}

.ffy-page-status {
	font-size: 13px;
	color: var(--ffy-ink-soft);
	font-weight: 500;
}

/* Responsive */
@media (min-width: 640px) {
	.ffy-gallery__toolbar {
		flex-direction: row;
		justify-content: space-between;
	}

	.ffy-search {
		flex: 0 0 320px;
	}

	.ffy-tabs {
		flex: 1;
		justify-content: flex-end;
	}
}

@media (max-width: 480px) {
	.ffy-gallery {
		padding: 22px 14px 36px;
		border-radius: 20px;
	}

	.ffy-grid {
		grid-template-columns: 1fr;
	}
}
