/* ==========================================================================
   Incoming — the archive at /incoming and single-incoming.php.

   The card (.pm-card) is shared infrastructure from components.css; this
   file holds the import-status box on the detail page, and the archive's
   dedicated hero, the two pieces of UI unique to this post type.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero — ported from the approved design's components/incoming/IncomingHero
   and components/incoming/Beams. Centred, not left-aligned like every other
   archive's .pm-page-hero, because this page opens with a status legend
   rather than a one-line pitch.
   -------------------------------------------------------------------------- */

.pm-incoming-hero {
	position: relative;
	overflow: hidden;
	border-bottom: 1px solid var(--border);
	background-color: var(--bg-base);
}

/* Animated beams — a vanilla-CSS port of Beams.tsx. Framer Motion's spring
   engine isn't needed for this: every beam's position and timing is a fixed
   formula (no Math.random()), so a plain CSS keyframe animation with
   per-beam inline custom timing reproduces it exactly, with no JS at all. */
.pm-incoming-hero__beams {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}

.pm-incoming-hero__beam {
	position: absolute;
	top: 50%;
	width: 1px;
	background-image: linear-gradient(to bottom, transparent, rgba(0, 212, 255, 0.15), transparent);
	animation-name: pm-beam-fall;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}

.pm-incoming-hero__beam--wide {
	width: 2px;
}

/* Matches Beams.tsx's "hidden sm:block" on the last five beams — roughly
   half the density on a phone that never scrolls this far sideways anyway. */
.pm-incoming-hero__beam--desktop {
	display: none;
}

@media (min-width: 640px) {
	.pm-incoming-hero__beam--desktop {
		display: block;
	}
}

@keyframes pm-beam-fall {
	0% {
		transform: translateY(-100px) rotate(35deg);
		opacity: 0;
	}
	50% {
		opacity: 0.6;
	}
	100% {
		transform: translateY(100px) rotate(35deg);
		opacity: 0;
	}
}

/* Soft accent bloom behind the heading, matching every other page hero. */
.pm-incoming-hero__glow {
	position: absolute;
	top: 0;
	left: 50%;
	z-index: 0;
	width: 18rem;
	height: 18rem;
	transform: translateX(-50%);
	border-radius: 50%;
	background-color: var(--accent-glow);
	filter: blur(64px);
	pointer-events: none;
}

.pm-incoming-hero__inner {
	position: relative;
	z-index: 1;
	padding-block: 6rem 3rem;
	text-align: center;
}

.pm-incoming-hero__heading {
	font-size: clamp(3rem, 9vw, 5rem);
	line-height: 0.95;
}

.pm-incoming-hero__accent {
	color: var(--accent-text);
}

.pm-incoming-hero__sub {
	margin: 1.25rem auto 0;
	max-width: 34rem;
	font-size: 1.0625rem;
	color: var(--text-secondary);
}

.pm-incoming-hero__ctas {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
	margin-top: 2rem;
}

.pm-incoming-hero__legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
	margin: 2.5rem auto 0;
}

.pm-incoming-hero__legend-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.875rem;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background-color: var(--bg-elevated);
	text-align: left;
}

/* Border and dot colour per status — the same amber/cyan/purple tokens as
   .pm-arrival--in-transit etc. below, so the legend and the detail-page
   status box always agree. */
.pm-incoming-hero__legend-item--in-transit {
	border-color: rgba(245, 158, 11, 0.2);
}

.pm-incoming-hero__legend-item--clearing {
	border-color: rgba(0, 212, 255, 0.2);
}

.pm-incoming-hero__legend-item--reserved {
	border-color: rgba(168, 85, 247, 0.2);
}

.pm-incoming-hero__dot {
	flex-shrink: 0;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
}

.pm-incoming-hero__legend-item--in-transit .pm-incoming-hero__dot {
	background-color: #f59e0b;
}

.pm-incoming-hero__legend-item--clearing .pm-incoming-hero__dot {
	background-color: var(--accent);
}

.pm-incoming-hero__legend-item--reserved .pm-incoming-hero__dot {
	background-color: #a855f7;
}

.pm-incoming-hero__legend-text {
	font-size: 0.8125rem;
}

.pm-incoming-hero__legend-text strong {
	font-family: var(--font-display);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--text-primary);
}

@media (min-width: 1024px) {
	.pm-incoming-hero__inner {
		padding-block: 8rem 4rem;
	}
}

/* The grid/empty-state block that follows the new section heading below the
   hero — scoped to this page so it doesn't nudge .pm-grid or .pm-empty on
   the archives that don't have a heading above them. */
.pm-incoming-archive > .pm-grid,
.pm-incoming-archive > .pm-empty {
	margin-top: 2.5rem;
}

.pm-arrival {
	margin-top: 1.25rem;
	padding: 1.25rem;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background-color: var(--bg-elevated);
}

/* Border and wash pick up the same status colour as the badge above them —
   pm_status_config() in inc/template-tags.php is the one place that maps a
   status to a colour, so this only borrows it, never redeclares it. */
.pm-arrival--in-transit {
	border-color: rgba(245, 158, 11, 0.4);
	background-color: rgba(245, 158, 11, 0.08);
}

.pm-arrival--clearing {
	border-color: rgba(0, 212, 255, 0.4);
	background-color: var(--accent-glow);
}

.pm-arrival--reserved {
	border-color: rgba(168, 85, 247, 0.4);
	background-color: rgba(168, 85, 247, 0.08);
}

.pm-arrival__head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-display);
	font-size: 0.875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--text-primary);
}

.pm-arrival--in-transit .pm-arrival__head {
	color: var(--amber-text);
}

.pm-arrival--clearing .pm-arrival__head {
	color: var(--accent-text);
}

.pm-arrival--reserved .pm-arrival__head {
	color: var(--purple-text);
}

.pm-arrival__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
}

.pm-arrival__label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-secondary);
}

.pm-arrival__value {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	margin-top: 0.375rem;
	font-family: var(--font-display);
	font-size: 1.0625rem;
	font-weight: 700;
	color: var(--text-primary);
}
