/* Category / listing pages: banner, TCG hub row, format chips, sorting, empty state.
   Loaded after jokercity.css (shared tokens + components) and before preset.css. */

/* Category banner (base design, no art) --------------------------------- */
.jc-banner {
	position: relative;
	background: var(--jc-wash);
	border-bottom: 1px solid var(--jc-line);
	overflow: hidden;
}
.jc-banner__inner {
	position: relative;
	z-index: 1;
	min-height: 120px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding-top: 28px; padding-bottom: 28px;
}
.jc-banner__title {
	margin: 0;
	font-size: clamp(1.9rem, 1.4rem + 2vw, 3.2rem);
	font-weight: 800;
	line-height: 1.05;
}
.jc-banner__word { white-space: nowrap; }   /* wrap between words, never at "Yu-Gi-" */
.jc-banner__lead { margin: 10px 0 0; max-width: 60ch; color: var(--jc-ink-2); font-size: 1.05rem; text-wrap: pretty; }
.jc-banner__meta { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--jc-muted); }
.jc-banner--hub { background: var(--jc-ink); border-bottom: 0; }
.jc-banner--hub::after {
	content: ""; position: absolute; inset: 0;
	background: url("../../art/hero-cards.svg") no-repeat right -60px center / auto 150%;
	opacity: .55;
}
.jc-banner--hub .jc-banner__title { color: #fff; }
.jc-banner--hub .jc-banner__lead { color: #d8dade; }
.jc-banner--hub .jc-banner__meta { color: #aeb2ba; }
@media (max-width: 767px) {
	.jc-banner__inner { min-height: 96px; padding-top: 20px; padding-bottom: 20px; }
	.jc-banner--hub::after { opacity: .22; background-position: right -170px bottom -24px; background-size: auto 115%; }
}

/* Content area spacing on catalog pages */
.jc-catalog .site-content { padding-top: 0; }
.jc-catalog .site-main { margin-bottom: 48px; }
.jc-catalog .hentry, .jc-catalog article.page { margin-bottom: 0; }
.jc-catalog .entry-content > .woocommerce { margin-top: 8px; }

/* TCG hub game row ------------------------------------------------------ */
.jc-hub__heading { font-size: 1.15rem; font-weight: 700; margin: 18px 0 12px; }
.jc-hub__heading--products { margin-top: 32px; }
/* Phones: the twelve games become a two-row strip that scrolls sideways, so
   the product grid still starts in the first viewport. The third column
   peeks in as the scroll cue; the strip bleeds to the screen edges. */
@media (max-width: 639px) {
	.jc-hub .jc-tiles--compact {
		grid-template-columns: none;
		grid-template-rows: repeat(2, auto);
		grid-auto-flow: column;
		grid-auto-columns: minmax(128px, 42%);
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: var(--jc-gutter);
		scrollbar-width: thin;
		scrollbar-color: #c9ccd3 transparent;
		margin: -6px calc(-1 * var(--jc-gutter)) 0;
		padding: 6px var(--jc-gutter) 10px; /* room for the hover lift and focus ring */
	}
	.jc-hub .jc-tile { scroll-snap-align: start; }
	.jc-hub__heading--products { margin-top: 20px; }
	/* "Vse igre" (0.7.15): the strip opens into a two-column list of every game */
	.jc-hub.is-open .jc-tiles--compact {
		grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-flow: row;
		overflow: visible; margin: 0; padding: 0;
	}
}
.jc-hub__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jc-hub__all {
	min-height: var(--jc-target, 44px); padding: 0 14px; border: 1px solid currentColor; border-radius: 999px;
	background: transparent; color: inherit; font: 700 14px/1 var(--jc-font, inherit); cursor: pointer; white-space: nowrap;
}
.jc-hub__all:focus-visible { outline: 3px solid var(--jc-p-focus, var(--jc-ink)); outline-offset: 2px; }
@media (min-width: 640px) { .jc-hub__all { display: none; } }

/* Chips + sorting ------------------------------------------------------- */
.jc-chips ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 14px 0 0; padding: 0; }
.jc-chips a {
	display: inline-flex; align-items: center; min-height: var(--jc-target); padding: 0 16px;
	border: 1px solid #c9ccd3; border-radius: 8px; background: var(--jc-paper);
	color: var(--jc-ink); text-decoration: none !important; font-weight: 600; font-size: 15px;
}
.jc-tile a, .jc-tile a * { text-decoration: none !important; }
.jc-chips a:hover { border-color: var(--jc-ink); }
.jc-chips a[aria-current="page"] { background: var(--jc-ink); border-color: var(--jc-ink); color: #fff; }

.storefront-sorting::before, .storefront-sorting::after { display: none; } /* Storefront clearfix would count as a flex item and indent the row */
.storefront-sorting {
	display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
	margin: 14px 0 20px !important; padding: 0 0 14px !important;
	border-bottom: 1px solid var(--jc-line);
	font-size: 14px;
}
.storefront-sorting .woocommerce-ordering, .storefront-sorting .woocommerce-result-count { float: none !important; margin: 0 !important; }
.storefront-sorting > :empty { display: none; }
.storefront-sorting .woocommerce-pagination { display: none; }
.storefront-sorting .woocommerce-result-count { color: var(--jc-muted); padding: 0; }
.woocommerce-ordering select {
	min-height: var(--jc-target); padding: 0 36px 0 12px; border: 1px solid #c9ccd3; border-radius: 8px;
	background-color: var(--jc-paper); font: 600 14px var(--jc-font); color: var(--jc-ink);
}
/* sorting row after the grid only carries pagination */
.site-main ul.products + .storefront-sorting { border-bottom: 0; border-top: 0; justify-content: center; margin-top: 8px !important; }
.site-main ul.products + .storefront-sorting .woocommerce-ordering,
.site-main ul.products + .storefront-sorting .woocommerce-result-count { display: none; }
.site-main ul.products + .storefront-sorting .woocommerce-pagination { display: block; }

/* Empty state: a quiet wash panel, then (on card-game pages) the games that have stock */
.jc-empty { border-radius: var(--jc-radius); padding: 32px clamp(16px, 4vw, 40px); margin: 16px 0 8px; text-align: center; background: var(--jc-wash); }
.jc-empty__title { font-size: 1.25rem; font-weight: 800; line-height: 1.3; margin: 0 0 6px; text-wrap: balance; }
.jc-empty__text { margin: 0 auto; max-width: 60ch; color: var(--jc-ink-2); text-wrap: pretty; }
.jc-empty__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 20px 0 0; }
.jc-empty__actions .button { display: inline-flex; align-items: center; min-height: 44px; background: var(--jc-ink); color: #fff; border: 1px solid var(--jc-ink); font-weight: 700; }
.jc-empty__actions .button:hover { background: #000; color: #fff; }
.jc-hub--empty { margin-bottom: 32px; }
.jc-hub--empty .jc-hub__heading { margin-top: 32px; }
.button, .wp-element-button { border-radius: 8px; }
.jc-button-ghost { background: transparent !important; color: var(--jc-ink) !important; border: 1px solid var(--jc-ink) !important; }
.jc-button-ghost:hover { background: var(--jc-paper) !important; }

/* Our banner replaces the archive title; an empty products header kept Storefront's ~68px padding */
.jc-catalog .woocommerce-products-header:not(:has(*)) { display: none; }

/* Phone: format chips in one row that scrolls sideways (0.6.4, fresh-eyes critique: Magic's 8 chips took
   4 rows before the first product). The row bleeds to the screen edges so a cut chip signals more. */
@media (max-width: 767px) {
	.jc-chips ul {
		flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
		margin-left: calc(-1 * var(--jc-gutter, 16px)); margin-right: calc(-1 * var(--jc-gutter, 16px));
		padding: 0 var(--jc-gutter, 16px) 2px;
	}
	.jc-chips ul::-webkit-scrollbar { display: none; }
	.jc-chips li { flex: none; scroll-snap-align: start; }
	.jc-chips a { white-space: nowrap; }
}

/* Search results: heading in the shared display style, left-aligned, no empty gap under it (0.6.4) */
.search-results .woocommerce-products-header,
.search-no-results .woocommerce-products-header { margin: 0 0 8px; padding: 0; text-align: left; }
.search-results .woocommerce-products-header__title,
.search-no-results .woocommerce-products-header__title {
	margin: 4px 0 0; text-align: left; font-weight: 800; letter-spacing: -.02em;
	font-size: clamp(28px, 3.2vw, 40px); line-height: 1.1;
}

/* TCG hub, products in the first viewport (0.7.2, review: at 1440×900 only ~30px of the first
   cards showed): a shorter sign (preset.css), tighter game tiles and the products heading close to
   the sort row. Names stay whole (a one-line name + count cut "Magic: The …" at 1440). Games with
   nothing in stock come last (jc_hub_game_order()) with a hollow dot: "Kmalu", not a dead end. */
@media (min-width: 1100px) {
	.jc-hub .jc-tiles--compact .jc-tile__body { padding: 8px 12px 9px; gap: 0; }
}
.jc-tiles--compact .jc-tile--empty .jc-tile__name::before { background: transparent; box-shadow: inset 0 0 0 2px var(--jc-tile-accent, var(--jc-ink)); }
.jc-hub__heading--products { margin-top: 24px; margin-bottom: 0; }
.jc-hub__heading--products + .storefront-sorting { margin-top: 8px !important; }
/* Phones: the hub's lead repeats what the game list below says; dropping it lifts the products. */
@media (max-width: 767px) { .term-karte-tcg .jc-banner__lead { display: none; } }
/* Phones: the banner already gives the count ("129 izdelkov"); the sort row keeps only the select. */
@media (max-width: 767px) { .jc-catalog .storefront-sorting .woocommerce-result-count { display: none; } }

/* Search with no results (loop pass 1): a plain left-aligned message under the heading, then the
   shared search field and aisles (jc_find_more), so the shopper can retry without scrolling up. */
.jc-empty--search { text-align: left; background: none; padding: 0; margin: 4px 0 0; max-width: 40em; }
.jc-empty--search .jc-empty__text { margin: 0; }

/* Search results: field under the heading (0.7.15) */
.jc-search-again { margin: 4px 0 16px; }
