/* ===========================================================================
   AGL Surfaces — Partner Portal
   Consumes the foundations token layer. Architectural Noir throughout:
   warm near-black grounds, Cormorant display, Archivo UI, champagne-gold,
   hairline rules, zero border-radius. Mirrors the .pp- partners page voice
   with a distinct .ppx- namespace.
   ========================================================================= */

.ppx {
	background: var(--agl-noir-950);
	color: var(--agl-ivory);
	min-height: 70vh;
}

/* Shared link + alert ----------------------------------------------------- */
.ppx-link {
	color: var(--agl-gold);
	text-decoration: none;
	border-bottom: 1px solid var(--agl-hairline-gold);
	transition: color .2s ease, border-color .2s ease;
}
.ppx-link:hover { color: var(--agl-gold-deep); border-color: var(--agl-gold-deep); }

.ppx-alert {
	margin: 20px 0 4px;
	padding: 12px 16px;
	border: 1px solid rgba(176, 122, 106, .5); /* --agl-error tint */
	background: rgba(176, 122, 106, .08);
	color: var(--agl-ivory);
	font-family: var(--agl-body);
	font-size: var(--agl-t-body);
	line-height: 1.5;
}

/* ── GATE (login / no-access) ───────────────────────────────────────────── */
.ppx-gate {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(64px, 12vw, 160px) var(--agl-section-x-mobile);
}
@media (min-width: 700px) { .ppx-gate { padding-left: var(--agl-section-x); padding-right: var(--agl-section-x); } }

.ppx-gate-card {
	width: 100%;
	max-width: 432px;
	background: var(--agl-noir-850);
	border: 1px solid var(--agl-hairline);
	border-top: 2px solid var(--agl-gold);
	padding: clamp(28px, 5vw, 44px);
}

.ppx-gate-title {
	font-family: var(--agl-display);
	font-weight: 500;
	font-size: var(--agl-t-section);
	line-height: 1.05;
	margin: 10px 0 8px;
	color: var(--agl-ivory);
}
.ppx-gate-lead {
	font-family: var(--agl-body);
	font-weight: 300;
	font-size: var(--agl-t-lead);
	line-height: 1.55;
	color: var(--agl-stone-300);
	margin: 0 0 8px;
}
.ppx-gate-foot {
	margin-top: 24px;
	padding-top: 18px;
	border-top: 1px solid var(--agl-hairline-soft);
	font-family: var(--agl-body);
	font-size: var(--agl-t-caption);
	color: var(--agl-stone-500);
}

/* Login form -------------------------------------------------------------- */
.ppx-login { margin-top: 24px; }
.ppx-field { display: block; margin-bottom: 16px; }
.ppx-field-label {
	display: block;
	font-family: var(--agl-body);
	font-size: var(--agl-t-label);
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--agl-stone-500);
	margin-bottom: 7px;
}
.ppx-field input[type="text"],
.ppx-field input[type="password"] {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	background: var(--agl-noir-950);
	border: 1px solid var(--agl-hairline);
	border-radius: 0;
	color: var(--agl-ivory);
	font-family: var(--agl-body);
	font-size: var(--agl-t-body);
	transition: border-color .2s ease;
}
.ppx-field input:focus {
	outline: none;
	border-color: var(--agl-gold);
}

.ppx-login-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 6px 0 22px;
	font-family: var(--agl-body);
	font-size: var(--agl-t-caption);
}
.ppx-remember {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--agl-stone-300);
	cursor: pointer;
}
.ppx-remember input { accent-color: var(--agl-gold); }

.ppx-login-btn { width: 100%; justify-content: center; }

/* ── LIBRARY HEAD ───────────────────────────────────────────────────────── */
.ppx-head {
	border-bottom: 1px solid var(--agl-hairline);
	padding: clamp(40px, 7vw, 88px) var(--agl-section-x-mobile) clamp(24px, 4vw, 40px);
}
@media (min-width: 700px) { .ppx-head { padding-left: var(--agl-section-x); padding-right: var(--agl-section-x); } }
.ppx-head-in {
	max-width: var(--agl-container-wide);
	margin: 0 auto;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}
.ppx-head-title {
	font-family: var(--agl-display);
	font-weight: 500;
	font-size: var(--agl-t-display);
	line-height: 1;
	margin: 8px 0 6px;
}
.ppx-head-sub {
	font-family: var(--agl-body);
	font-size: var(--agl-t-body);
	color: var(--agl-stone-300);
	margin: 0;
}
.ppx-head-sub strong { color: var(--agl-ivory); font-weight: 500; }
.ppx-signout { font-size: var(--agl-t-caption); white-space: nowrap; }

/* ── LIBRARY BODY ───────────────────────────────────────────────────────── */
.ppx-lib { padding: clamp(28px, 5vw, 56px) var(--agl-section-x-mobile) var(--agl-section-y-md); }
@media (min-width: 700px) { .ppx-lib { padding-left: var(--agl-section-x); padding-right: var(--agl-section-x); } }
.ppx-lib-in { max-width: var(--agl-container-wide); margin: 0 auto; }

/* Filters */
.ppx-filters { margin-bottom: 32px; }
.ppx-filter-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}
.ppx-filter-cats { padding-top: 12px; border-top: 1px solid var(--agl-hairline-soft); }
.ppx-chip {
	font-family: var(--agl-body);
	font-size: var(--agl-t-label);
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--agl-stone-300);
	background: transparent;
	border: 1px solid var(--agl-hairline);
	border-radius: 0;
	padding: 9px 16px;
	cursor: pointer;
	transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.ppx-chip:hover { color: var(--agl-ivory); border-color: var(--agl-stone-500); }
.ppx-chip.is-active {
	color: var(--agl-noir-950);
	background: var(--agl-gold);
	border-color: var(--agl-gold);
}

/* Card grid */
.ppx-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1px;
	background: var(--agl-hairline);
	border: 1px solid var(--agl-hairline);
}
.ppx-card {
	background: var(--agl-noir-900);
	display: flex;
	flex-direction: column;
}
.ppx-card[hidden] { display: none; }

.ppx-card-media {
	position: relative;
	aspect-ratio: 4 / 3;
	background-color: var(--agl-noir-800);
	background-size: cover;
	background-position: center;
}
.ppx-card-co {
	position: absolute;
	top: 12px;
	left: 12px;
	font-family: var(--agl-body);
	font-size: 10px;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--agl-ivory);
	background: rgba(11, 11, 10, .66);
	padding: 5px 10px;
}

.ppx-card-body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.ppx-card-cat {
	font-family: var(--agl-body);
	font-size: var(--agl-t-label);
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--agl-gold);
	margin-bottom: 8px;
}
.ppx-card-title {
	font-family: var(--agl-display);
	font-weight: 600;
	font-size: var(--agl-t-sub);
	line-height: 1.1;
	margin: 0 0 8px;
	color: var(--agl-ivory);
}
.ppx-card-sum {
	font-family: var(--agl-body);
	font-size: var(--agl-t-caption);
	line-height: 1.5;
	color: var(--agl-stone-300);
	margin: 0 0 14px;
}
.ppx-muted { color: var(--agl-stone-500); }

/* Download rows */
.ppx-dl-list { list-style: none; margin: auto 0 0; padding: 14px 0 0; border-top: 1px solid var(--agl-hairline-soft); }
.ppx-dl {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--agl-hairline-soft);
}
.ppx-dl:last-child { border-bottom: 0; }
.ppx-dl-info { min-width: 0; }
.ppx-dl-label {
	display: block;
	font-family: var(--agl-body);
	font-size: var(--agl-t-body);
	color: var(--agl-ivory);
	font-weight: 500;
}
.ppx-dl-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 3px;
	font-family: var(--agl-body);
	font-size: 11px;
	color: var(--agl-stone-500);
}
.ppx-tag {
	font-size: 9px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--agl-stone-300);
	border: 1px solid var(--agl-hairline);
	padding: 2px 7px;
}
.ppx-dl-btn {
	flex: none;
	font-family: var(--agl-body);
	font-size: var(--agl-t-label);
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--agl-gold);
	border: 1px solid var(--agl-hairline-gold);
	padding: 8px 16px;
	text-decoration: none;
	transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.ppx-dl-btn:hover { color: var(--agl-noir-950); background: var(--agl-gold); border-color: var(--agl-gold); }
.ppx-dl-btn.is-disabled {
	color: var(--agl-stone-700);
	border-color: var(--agl-hairline-soft);
	cursor: default;
	pointer-events: none;
}

/* Empty / no-results */
.ppx-empty, .ppx-noresults {
	border: 1px solid var(--agl-hairline);
	padding: clamp(32px, 6vw, 64px);
	text-align: center;
	color: var(--agl-stone-300);
	font-family: var(--agl-body);
}
.ppx-empty h2 {
	font-family: var(--agl-display);
	font-weight: 500;
	font-size: var(--agl-t-sub);
	color: var(--agl-ivory);
	margin: 0 0 10px;
}
.ppx-empty p, .ppx-noresults p { font-size: var(--agl-t-body); line-height: 1.55; margin: 0; }
.ppx-noresults { margin-top: 1px; }

/* Accessibility / motion floor */
.ppx :focus-visible { outline: 2px solid var(--agl-gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	.ppx-link, .ppx-chip, .ppx-dl-btn, .ppx-field input { transition: none; }
}

/* ── Search + result count (added with the scale-up to a large library) ───── */
.ppx-searchbar {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--agl-hairline-soft);
}
.ppx-search {
	flex: 1 1 auto;
	max-width: 380px;
	box-sizing: border-box;
	padding: 10px 14px;
	background: var(--agl-noir-950);
	border: 1px solid var(--agl-hairline);
	border-radius: 0;
	color: var(--agl-ivory);
	font-family: var(--agl-body);
	font-size: var(--agl-t-body);
	transition: border-color .2s ease;
}
.ppx-search::placeholder { color: var(--agl-stone-500); }
.ppx-search:focus { outline: none; border-color: var(--agl-gold); }
.ppx-count {
	font-family: var(--agl-body);
	font-size: var(--agl-t-label);
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--agl-stone-500);
	white-space: nowrap;
}

/* Empty thumbnail (no featured image yet) keeps the noir panel tone. */
.ppx-card-media--empty {
	background:
		radial-gradient(120% 120% at 30% 20%, var(--agl-noir-800), var(--agl-noir-900));
}

@media (prefers-reduced-motion: reduce) {
	.ppx-search { transition: none; }
}
