/* StudRips "Cards For Sale" page. Mobile-first: the unprefixed rules ARE the
   phone layout, min-width queries only add room. Uses the site's design
   tokens (--bg-panel, --border, --red/--yellow/--blue, Anton + Archivo)
   from custom-studrips.css, with fallbacks so the page never renders
   unstyled if a token is missing. Everything is scoped under .sf. */

.sf {
	max-width: 1180px;
	margin: 0 auto;
	padding: 16px 16px 40px;
	color: var(--text, #f3ede4);
	font-family: var(--font-body, 'Archivo', -apple-system, sans-serif);
}

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

/* ---- hero ---- */

.sf-hero {
	margin: 4px 0 18px;
}

.sf .sf-hero__title {
	margin: 0 0 8px;
	font-family: var(--font-display, 'Anton', Impact, sans-serif);
	font-size: 2.1rem;
	line-height: 1.05;
	letter-spacing: 0.01em;
	color: var(--text, #f3ede4);
}

.sf .sf-hero__sub {
	margin: 0;
	max-width: 62ch;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--text-muted, #a99cc4);
}

.sf .sf-hero__disclosure {
	margin: 14px 0 0;
	max-width: 62ch;
	padding-left: 12px;
	border-left: 3px solid var(--yellow, #ffd23f);
	font-size: 0.88rem;
	line-height: 1.5;
	color: var(--text-muted, #a99cc4);
}

.sf .sf-hero__disclosure strong {
	color: var(--text, #f3ede4);
}

.sf .sf-hero__updated {
	margin: 8px 0 0;
	font-size: 0.8rem;
	color: var(--text-dim, #766b8c);
}

/* ---- controls (only shown when JS is running) ---- */

.sf-controls {
	display: none;
}

.sf-js .sf-controls {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 14px;
	padding: 14px;
	border: 1px solid var(--border, #322b3b);
	border-radius: 14px;
	background: var(--bg-panel, #1c1822);
}

.sf-field {
	min-width: 0;
}

.sf-field--search {
	grid-column: 1 / -1;
}

.sf .sf-label {
	display: block;
	margin: 0 0 4px;
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text-dim, #766b8c);
}

/* 16px text + 44px height: no iOS zoom-on-focus, comfortable thumb targets */
.sf .sf-input {
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid var(--border, #322b3b);
	border-radius: 10px;
	background: var(--bg, #131019);
	color: var(--text, #f3ede4);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.2;
	appearance: none;
	-webkit-appearance: none;
}

.sf .sf-input::placeholder {
	color: var(--text-dim, #766b8c);
}

.sf .sf-input:focus {
	outline: none;
	border-color: var(--blue, #3f8cff);
	box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.25);
}

.sf select.sf-input {
	padding-right: 32px;
	background-image: linear-gradient(45deg, transparent 50%, var(--text-muted, #a99cc4) 50%),
	                  linear-gradient(135deg, var(--text-muted, #a99cc4) 50%, transparent 50%);
	background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

.sf-chips {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 8px;
	padding-top: 2px;
}

.sf-chip {
	position: relative;
	cursor: pointer;
}

.sf-chip input {
	position: absolute;
	opacity: 0;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.sf-chip > span {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding: 0 13px;
	border: 1px solid var(--border, #322b3b);
	border-radius: 999px;
	background: var(--bg, #131019);
	color: var(--text-muted, #a99cc4);
	font-size: 0.82rem;
	font-weight: 700;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sf-chip input:checked + span {
	border-color: var(--yellow, #ffd23f);
	background: rgba(255, 210, 63, 0.14);
	color: var(--yellow, #ffd23f);
}

.sf-chip > span small {
	margin-left: 5px;
	font-size: 0.72rem;
	font-weight: 700;
	opacity: 0.6;
}

.sf-chip--sport input:checked + span {
	border-color: var(--blue, #3f8cff);
	background: rgba(63, 140, 255, 0.16);
	color: #8db9ff;
}

.sf-ico {
	display: inline-block;
	margin-right: 6px;
	font-style: normal;
	font-size: 1rem;
	line-height: 1;
	font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

.sf-ico:empty {
	display: none;
}

.sf-chip input:focus-visible + span {
	box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.35);
}

.sf .sf-count {
	scroll-margin-top: 12px;
	margin: 0 0 14px;
	font-size: 0.85rem;
	color: var(--text-muted, #a99cc4);
}

.sf .sf-count:focus {
	outline: none;
}

.sf .sf-count strong {
	color: var(--text, #f3ede4);
}

/* ---- grid ---- */

.sf .sf-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sf .sf-card {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
	min-width: 0;
}

.sf .sf-card[hidden] {
	display: none;
}

.sf .sf-grid[hidden] {
	display: none;
}

.sf .sf-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid var(--border, #322b3b);
	border-radius: 14px;
	background: var(--bg-panel, #1c1822);
	overflow: hidden;
	color: var(--text, #f3ede4);
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sf .sf-card__link:focus-visible {
	outline: none;
	border-color: var(--blue, #3f8cff);
	box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.35);
}

.sf-card__media {
	position: relative;
	aspect-ratio: 4 / 5;
	background: #100e15;
	overflow: hidden;
}

.sf .sf-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: contain;
}

.sf-card__badges {
	position: absolute;
	top: 8px;
	left: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.sf-badge {
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	line-height: 1.3;
}

.sf-badge--rc {
	background: var(--red, #ff3b4e);
	color: #fff;
}

.sf-badge--auto {
	background: var(--yellow, #ffd23f);
	color: #1a1500;
}

.sf-badge--num {
	background: var(--text, #f3ede4);
	color: var(--bg, #131019);
}

.sf-badge--auction {
	background: var(--blue, #3f8cff);
	color: #fff;
}

.sf-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 10px 12px 12px;
}

.sf .sf-card__title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0 0 4px;
	font-family: var(--font-body, 'Archivo', sans-serif);
	font-size: 0.86rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: var(--text, #f3ede4);
}

.sf .sf-card__sub {
	margin: 0 0 6px;
	font-size: 0.74rem;
	line-height: 1.3;
	color: var(--text-dim, #766b8c);
}

.sf-card__foot {
	margin-top: auto;
}

.sf-card__row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 8px;
	padding-top: 6px;
}

.sf .sf-card__price {
	font-family: var(--font-display, 'Anton', Impact, sans-serif);
	font-size: 1.35rem;
	line-height: 1;
	letter-spacing: 0.01em;
	color: var(--text, #f3ede4);
}

.sf-card__cond {
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--text-dim, #766b8c);
}

.sf-card__cond--graded {
	color: var(--yellow, #ffd23f);
}

.sf .sf-card__note {
	margin: 4px 0 0;
	font-size: 0.72rem;
	line-height: 1.3;
	color: var(--text-muted, #a99cc4);
}

.sf-card__cta {
	display: block;
	margin-top: 10px;
	padding: 10px 0;
	border-radius: 9px;
	background: rgba(63, 140, 255, 0.14);
	color: var(--blue, #3f8cff);
	font-size: 0.8rem;
	font-weight: 800;
	text-align: center;
	letter-spacing: 0.02em;
}

/* ---- pager: First / Prev / numbers / Next / Last + cards per page ---- */

.sf .sf-input--sm {
	width: auto;
	min-width: 76px;
	min-height: 40px;
	padding-top: 8px;
	padding-bottom: 8px;
	font-size: 0.95rem;
}

.sf-pager {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 26px 0 0;
}

.sf-pager[hidden] {
	display: none;
}

/* phone: "Page 2 of 5" on its own line, then four big tap targets in a row */
.sf-pager__row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.sf-pager__status {
	flex: 0 0 100%;
	text-align: center;
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--text-muted, #a99cc4);
}

.sf-pager__pages {
	display: none;
}

.sf .sf-pg {
	flex: 1 1 0;
	min-width: 48px;
	min-height: 46px;
	padding: 0 14px;
	margin: 0;
	border: 1px solid var(--border, #322b3b);
	border-radius: 10px;
	background: var(--bg-panel, #1c1822);
	color: var(--text, #f3ede4);
	font-family: inherit;
	font-size: 0.92rem;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sf .sf-pg--edge {
	flex: 0 0 52px;
	padding: 0;
}

/* "First" / "Last" are just « » on a phone, with words on wider screens */
.sf-pg__txt {
	display: none;
}

.sf .sf-pg:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.sf .sf-pg:focus-visible {
	outline: none;
	border-color: var(--blue, #3f8cff);
	box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.35);
}

.sf .sf-pg[aria-current="page"] {
	border-color: var(--yellow, #ffd23f);
	background: rgba(255, 210, 63, 0.14);
	color: var(--yellow, #ffd23f);
	cursor: default;
}

.sf-pager__size {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.sf .sf-pager__sizelabel {
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text-dim, #766b8c);
}

.sf-pager__gap {
	align-self: center;
	padding: 0 2px;
	color: var(--text-dim, #766b8c);
}

/* ---- empty / no-match / footer ---- */

.sf-none,
.sf-empty {
	padding: 40px 12px;
	text-align: center;
	color: var(--text-muted, #a99cc4);
}

.sf-none[hidden] {
	display: none;
}

.sf-none p,
.sf-empty p {
	margin: 0 0 16px;
}

.sf .sf-btn {
	display: inline-block;
	min-height: 44px;
	padding: 12px 22px;
	border: 0;
	border-radius: 10px;
	background: var(--red, #ff3b4e);
	color: #fff;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 800;
	text-decoration: none;
	cursor: pointer;
}

.sf .sf-foot {
	max-width: 70ch;
	margin: 28px 0 0;
	font-size: 0.78rem;
	line-height: 1.5;
	color: var(--text-dim, #766b8c);
}

.sf .sf-foot a {
	color: var(--text-muted, #a99cc4);
	text-decoration: underline;
}

/* ---- wider screens: add room, never take it away ---- */

@media (min-width: 720px) {
	.sf-pager {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
	}

	.sf-pager__row {
		flex-wrap: nowrap;
		justify-content: flex-start;
		gap: 6px;
	}

	.sf-pager__status {
		display: none;
	}

	.sf-pager__pages {
		display: flex;
		gap: 6px;
	}

	.sf .sf-pg,
	.sf .sf-pg--edge {
		flex: 0 0 auto;
		min-width: 44px;
		padding: 0 16px;
	}

	.sf .sf-pg--num {
		padding: 0 12px;
	}

	.sf-pg__txt {
		display: inline;
	}

	.sf .sf-pg:not(:disabled):not([aria-current="page"]):hover {
		border-color: var(--text-dim, #766b8c);
		background: var(--bg-panel-2, #221d2a);
	}

	.sf {
		padding: 24px 40px 56px;
	}

	.sf .sf-hero__title {
		font-size: 3rem;
	}

	.sf-hero {
		margin-bottom: 24px;
	}

	.sf-js .sf-controls {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-end;
		gap: 12px;
		padding: 16px;
	}

	.sf-field {
		flex: 1 1 170px;
	}

	.sf-field--search {
		flex: 2 1 300px;
	}

	.sf-chips {
		flex: 1 1 100%;
	}

	.sf .sf-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 18px;
	}

	.sf .sf-card__title {
		font-size: 0.92rem;
	}

	.sf .sf-card__price {
		font-size: 1.5rem;
	}

	.sf .sf-card__link:hover {
		transform: translateY(-4px);
	}

	.sf .sf-card:nth-child(3n+1) .sf-card__link:hover { border-color: rgba(255, 59, 78, 0.45); box-shadow: 0 18px 36px -16px rgba(255, 59, 78, 0.35); }
	.sf .sf-card:nth-child(3n+2) .sf-card__link:hover { border-color: rgba(255, 210, 63, 0.45); box-shadow: 0 18px 36px -16px rgba(255, 210, 63, 0.3); }
	.sf .sf-card:nth-child(3n+3) .sf-card__link:hover { border-color: rgba(63, 140, 255, 0.45); box-shadow: 0 18px 36px -16px rgba(63, 140, 255, 0.35); }
}

@media (min-width: 1080px) {
	.sf .sf-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sf .sf-card__link,
	.sf-chip > span {
		transition: none;
	}

	.sf .sf-card__link:hover {
		transform: none;
	}
}

/* ---- Rip link (confirmed cards only) ----
   A sibling of the card link, floated over the photo's top-right corner so it
   does not change the card layout. Badges (RC / Auto) sit top-left. */
.sf .sf-card__rip {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 9px;
	border-radius: 999px;
	background: rgba(16, 14, 21, 0.92);
	border: 1px solid rgba(255, 255, 255, 0.22);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	line-height: 1.3;
	text-decoration: none;
}

.sf .sf-card__rip span {
	color: var(--red, #ff3b4e);
	font-size: 0.6rem;
}

.sf .sf-card__rip:hover,
.sf .sf-card__rip:focus-visible {
	background: var(--red, #ff3b4e);
	border-color: var(--red, #ff3b4e);
	color: #fff;
	outline: none;
}

.sf .sf-card__rip:hover span,
.sf .sf-card__rip:focus-visible span {
	color: #fff;
}

/* "Showing cards from the rip: ..." bar (?rip=POST_ID) */
.sf .sf-ripbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin: 0 0 12px;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--bg-panel, #1c1822);
	border: 1px solid var(--border, #322b3b);
	border-left: 4px solid var(--red, #ff3b4e);
	font-size: 0.9rem;
}

.sf .sf-ripbar[hidden] {
	display: none;
}

.sf .sf-ripbar__link {
	font-weight: 800;
	color: var(--blue, #3f8cff);
}

.sf .sf-ripbar__clear {
	margin-left: auto;
	padding: 6px 12px;
	border-radius: 8px;
	border: 1px solid var(--border, #322b3b);
	background: transparent;
	color: var(--text, #f3ede4);
	font: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	cursor: pointer;
}

.sf .sf-ripbar__clear:hover {
	border-color: var(--yellow, #ffd23f);
}
