/**
 * Studio Poda Widgets — front-end styles.
 *
 * Scoped under .poda-ticker-* / .poda-rail-* / .poda-grid-* so nothing
 * leaks into the theme or the editor. Values are the PODA-BIBLE §1.4
 * tokens; motion language mirrors the site's ticker + cover rail
 * (duplicated set, linear drift, scroll-snap rail, hidden scrollbar)
 * and the work grid's MW filter transitions.
 */

/* ============ Ticker Band ============ */

.poda-ticker {
	--poda-ink: #12100d;
	--poda-yellow: #ffc400;
	--poda-palm: #0e7a3d;
	--poda-mint: #7ed3b2;
	--poda-cream: #fff3d6;
	position: relative;
	overflow: hidden;
	font-family: "Fraunces", Georgia, serif;
}

.poda-ticker--palm {
	background: var(--poda-palm);
	color: var(--poda-mint);
	--poda-tab-bg: var(--poda-yellow);
	--poda-tab-color: var(--poda-ink);
}

.poda-ticker--ink-on-yellow {
	background: var(--poda-yellow);
	color: var(--poda-ink);
	--poda-tab-bg: var(--poda-ink);
	--poda-tab-color: var(--poda-yellow);
}

.poda-ticker--yellow-on-ink {
	background: var(--poda-ink);
	color: var(--poda-yellow);
	--poda-tab-bg: var(--poda-palm);
	--poda-tab-color: var(--poda-mint);
}

.poda-ticker__tab {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	padding: 0 14px;
	background: var(--poda-tab-bg);
	color: var(--poda-tab-color);
	font-family: "Space Mono", monospace;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.poda-ticker__row {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 64px;
	overflow: hidden;
}

.poda-ticker__track {
	display: flex;
	width: max-content;
	animation: poda-ticker-scroll var(--poda-ticker-duration, 46s) linear infinite;
}

.poda-ticker--pause:hover .poda-ticker__track {
	animation-play-state: paused;
}

.poda-ticker__set {
	display: flex;
	align-items: center;
	gap: 34px;
	padding-right: 34px;
	white-space: nowrap;
	font-weight: 600;
	font-size: 26px;
	line-height: 1;
}

.poda-ticker__sep {
	font-size: 18px;
	opacity: 0.8;
}

.poda-ticker__link {
	color: inherit;
	text-decoration: none;
}

.poda-ticker__link:hover,
.poda-ticker__link:focus {
	text-decoration: underline;
}

@keyframes poda-ticker-scroll {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.poda-ticker__track {
		animation: none;
	}

	.poda-ticker__row {
		overflow-x: auto;
	}
}

/* ============ Cover Rail ============ */

.poda-rail {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	padding: 6px 2px 14px;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.poda-rail::-webkit-scrollbar {
	display: none;
}

.poda-rail__card {
	flex: 0 0 auto;
	width: min(320px, 76vw);
	margin: 0;
	scroll-snap-align: start;
}

.poda-rail__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.poda-rail__cover {
	display: block;
}

.poda-rail__img {
	display: block;
	width: 100%;
	height: auto; /* the cover's own aspect ratio is preserved */
}

.poda-rail__caption {
	display: block;
	padding-top: 10px;
}

.poda-rail__name {
	display: block;
	font-family: "Fraunces", Georgia, serif;
	font-weight: 600;
	font-size: 20px;
	line-height: 1.15;
}

.poda-rail__meta {
	display: block;
	margin-top: 4px;
	font-family: "Space Mono", monospace;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.75;
}

/* ============ Work Grid ([poda_grid]) ============ */
/* Mirrors the design package's work screen: CSS-column masonry of
 * full-bleed cover cards (aspect from the bible's --r per project),
 * bottom scrim, overlaid caption (name Fraunces 600, client line,
 * city · year mono micro-line), chips on the yellow flood (ink
 * outline, ink slab when selected). */

.poda-grid__chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-bottom: 22px;
}

.poda-grid__chip {
	font-family: "Archivo", sans-serif;
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	line-height: 1.25;
	color: #12100d;
	background: transparent;
	border: 1.5px solid rgba(18, 16, 13, 0.55);
	border-radius: 3px;
	padding: 10px 18px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.poda-grid__chip:hover {
	background: rgba(18, 16, 13, 0.08);
}

.poda-grid__chip.is-selected {
	background: #12100d;
	color: #ffc400;
	border-color: #12100d;
}

.poda-grid__count {
	font-family: "Space Mono", monospace;
	font-size: 0.82em;
	opacity: 0.65;
}

.poda-grid__cards {
	columns: 4;
	column-gap: 10px;
}

.poda-grid__card {
	display: block;
	position: relative;
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	margin-bottom: 10px;
	border-radius: 18px;
	overflow: hidden;
	background: #1b1712;
	aspect-ratio: 1 / var(--r, 1.33);
	color: #fff3d6;
	text-decoration: none;
}

.poda-grid__card[hidden] {
	display: none;
}

.poda-grid__cover,
.poda-grid__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.poda-grid__img {
	display: block;
	transition: transform 0.35s ease-out;
}

.poda-grid__card:hover .poda-grid__img,
.poda-grid__card:focus-visible .poda-grid__img {
	transform: scale(1.03);
}

.poda-grid__scrim {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 46%;
	background: linear-gradient(to top, rgba(10, 8, 5, 0.8) 0%, rgba(10, 8, 5, 0.38) 55%, rgba(10, 8, 5, 0) 100%);
	pointer-events: none;
}

.poda-grid__caption {
	position: absolute;
	left: 18px;
	right: 16px;
	bottom: 16px;
	z-index: 2;
}

.poda-grid__name {
	display: block;
	font-family: "Fraunces", Georgia, serif;
	font-weight: 600;
	font-size: 22px;
	line-height: 1.08;
	color: #fff3d6;
}

.poda-grid__client {
	display: block;
	margin-top: 5px;
	font-family: "Archivo", sans-serif;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.5;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: rgba(255, 243, 214, 0.85);
}

.poda-grid__place {
	display: block;
	margin-top: 3px;
	font-family: "Space Mono", monospace;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: rgba(255, 243, 214, 0.62);
}

@media (max-width: 1100px) {
	.poda-grid__cards {
		columns: 3;
	}
}

@media (max-width: 820px) {
	.poda-grid__cards {
		columns: 2;
	}
}

@media (max-width: 560px) {
	.poda-grid__cards {
		columns: 1;
	}

	.poda-grid__card {
		border-radius: 16px;
		margin-bottom: 12px;
	}

	.poda-grid__caption {
		left: 16px;
		bottom: 14px;
	}

	.poda-grid__name {
		font-size: 25px;
	}

	.poda-grid__chip {
		font-size: 15px;
		padding: 10px 14px;
	}
}

/* — MW motion (port of the design package's filter transitions):
 * outgoing fade/shrink 150ms, incoming rise + fade with a capped
 * 40ms stagger, staying cards dip softly. Transform/opacity only. */

.poda-grid__card.poda-mw-pre {
	opacity: 0;
}

.poda-grid__card[hidden].poda-mw-exiting {
	display: block;
	animation: poda-mw-out 150ms ease-in forwards;
}

.poda-grid__card.poda-mw-in {
	animation: poda-mw-in 340ms cubic-bezier(0.22, 0.61, 0.21, 1) backwards;
}

.poda-grid__card.poda-mw-in-soft {
	animation: poda-mw-in-soft 260ms ease-out backwards;
}

@keyframes poda-mw-out {
	to {
		opacity: 0;
		transform: translateY(6px) scale(0.96);
	}
}

@keyframes poda-mw-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.985);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes poda-mw-in-soft {
	from {
		opacity: 0.45;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.poda-grid__card.poda-mw-exiting,
	.poda-grid__card.poda-mw-in,
	.poda-grid__card.poda-mw-in-soft {
		animation: none;
	}

	.poda-grid__img {
		transition: none;
	}
}
