/* Homepage: hero and sections. (Tiles are shared, in jokercity.css.)
   Loaded after jokercity.css (shared tokens + components) and before preset.css. */

/* Homepage -------------------------------------------------------------- */
.home .site-content { padding-top: 0; }
.home .site-main { margin-bottom: 0; }
.home .hentry { margin-bottom: 0; }
.home .entry-header { display: none; }
.home .entry-content > * { margin-top: 0; }

.jc-hero {
	position: relative;
	width: 100vw;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	max-width: none !important;
	background: var(--jc-ink);
	color: #fff;
	overflow: hidden;
	min-height: clamp(400px, 46vw, 560px);
	display: flex;
	align-items: center;
	padding: 48px var(--jc-gutter) !important;
	box-sizing: border-box;
}
/* Faint ambient light from the stage, full bleed (the stage art itself fades out at its edges). */
.jc-hero::before {
	content: ""; position: absolute; inset: 0;
	background: radial-gradient(48% 70% at 74% 78%, rgba(255, 244, 224, .07), rgba(255, 244, 224, 0) 70%);
}
.jc-hero > * {
	position: relative; z-index: 1;
	width: 100%;
	max-width: calc(var(--jc-max) - 2 * var(--jc-gutter)) !important;
	margin-left: auto !important; margin-right: auto !important;
}
.jc-hero > *:not(.jc-hero__actions) {
	box-sizing: border-box;
	padding-right: calc((min(100vw, var(--jc-max)) - 2 * var(--jc-gutter)) * .46);
}

/* The display cabinet ([jc_hero_showcase], inc/home.php + views/scene.css): drawn cabinet,
   real products and the cabinet's glass/shelf lips over them, in one box with the art's aspect
   ratio, so every product stays on its shelf at every width. It lives in the group's inner
   container (the content column), stretched to the hero's height so the cabinet can stand on
   the hero's bottom edge (-48px = hero padding). Desktop: right half; z-index -1 keeps it under
   the text in the column. */
.jc-hero > .wp-block-group__inner-container { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.jc-hero .jc-stage {
	position: absolute; z-index: -1; bottom: -40px; right: -2%;
	width: 52%; aspect-ratio: 1000 / 760;
	max-width: none !important; margin: 0 !important; padding: 0;
}
/* 0.7.24: the wider column (owner request 1, up to 2200px) made the cabinet taller than the hero at
   1920 (727px in 560px), so its top and the price tags of the top shelf ran under the header (user).
   Never taller than the hero's minimum height less 24px of headroom. */
@media (min-width: 768px) {
	.jc-hero .jc-stage { max-width: calc((clamp(400px, 46vw, 560px) - 24px) * 1000 / 760) !important; }
}
.jc-hero .jc-stage .jc-scene { inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.jc-hero__store { margin: 20px 0 0 !important; font-size: 15px; color: #d6d8dd; }
.hentry .entry-content .jc-hero__store a { color: #d6d8dd; text-decoration: underline; text-underline-offset: 3px; }
.hentry .entry-content .jc-hero__store a:hover { color: #fff; }
.jc-hero .jc-hero__title {
	color: #fff; font-size: clamp(2.2rem, 1.4rem + 3.2vw, 4.4rem); line-height: 1.02; font-weight: 800;
	margin: 0 !important; letter-spacing: -0.025em;
}
.jc-hero__lead { color: #d6d8dd; font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem); max-width: 34em; margin-bottom: 28px !important; text-wrap: pretty; }
.jc-hero .jc-hero__title { text-wrap: balance; }
.jc-hero__actions { gap: 12px !important; }
/* The column is a flex box (see the stage), so margins no longer collapse: the gaps come from
   the lead's 24px top and 28px bottom alone, as they did before. */
.jc-hero .jc-hero__actions { margin-top: 0 !important; }
.hentry .jc-hero .wp-block-button { margin: 0; } /* Storefront adds 1.4em under each button */
/* .hentry prefix: Storefront's `.hentry .entry-content .wp-block-button .wp-block-button__link`
   (radius 0, its own padding) otherwise wins. 19px bold = WCAG large text, so white on
   Joker Red (4.4:1) passes; at 16px it would not. */
.hentry .jc-hero .wp-block-button .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 52px; padding: 12px 24px; box-sizing: border-box;
	font-size: 1.1875rem; font-weight: 700; line-height: 1.2;
	border-radius: 8px; border: 2px solid transparent;
	transition: background-color .15s ease, border-color .15s ease;
}
.hentry .jc-hero .jc-btn-primary .wp-block-button__link { background: var(--jc-brand); color: #fff; }
.hentry .jc-hero .jc-btn-primary .wp-block-button__link:hover { background: #c81d30; color: #fff; }
.hentry .jc-hero .jc-btn-secondary .wp-block-button__link { color: #fff; border-color: rgba(255, 255, 255, .7); background: transparent; }
.hentry .jc-hero .jc-btn-secondary .wp-block-button__link:hover { border-color: #fff; background: rgba(255, 255, 255, .08); color: #fff; }
/* 900–1199px (0.7.3): at 52% the cabinet was ~350px wide and its products read small beside a
   four-line title. Here it takes 60% and reaches past the column edge into the hero's own gutter
   (its art fades out at the sides); the text keeps the left half. */
@media (min-width: 900px) and (max-width: 1199px) {
	.jc-hero .jc-stage { width: 60%; right: -5%; }
	.jc-hero > *:not(.jc-hero__actions) { padding-right: calc((min(100vw, var(--jc-max)) - 2 * var(--jc-gutter)) * .5); }
	.jc-hero .jc-hero__title { font-size: clamp(2.2rem, 1rem + 3.2vw, 3.4rem); }
}
@media (max-width: 899px) {
	/* Phones: the hero must leave the start of "Igre s kartami" in the first viewport. */
	/* The stage becomes a short ledge under the store line: three products in a row. */
	.jc-hero { min-height: 0; padding-top: 32px !important; padding-bottom: calc(min(100vw, 640px) * .45 + 4px) !important; align-items: flex-start; }
	.jc-hero::before { background: radial-gradient(70% 30% at 50% 100%, rgba(255, 244, 224, .07), rgba(255, 244, 224, 0) 70%); }
	.jc-hero > *:not(.jc-hero__actions) { padding-right: 0; }
	.jc-hero > .wp-block-group__inner-container { justify-content: flex-start; }
	.jc-hero .jc-stage { right: auto; left: 50%; transform: translateX(-50%); bottom: calc(-1 * (min(100vw, 640px) * .45 + 4px)); width: min(100vw, 640px); aspect-ratio: 800 / 360; }
	.jc-hero .jc-piece { left: var(--mx); bottom: var(--my); width: var(--mw); height: var(--mh); --_po: var(--mpo); --_pf: var(--mpf); --_tilt: var(--mtilt); --_dh: var(--mdh); }
	.jc-hero .jc-piece--desktop { display: none; }
}
@media (max-width: 599px) {
	.jc-hero__lead { margin-bottom: 24px !important; }
	/* One row when both fit (0.7.2: "Manga" is short, so the game tiles rise into the first
	   screen); on narrower phones they wrap and each fills its row. */
	.hentry .jc-hero .wp-block-button { flex: 1 1 auto; }
	.hentry .jc-hero .wp-block-button .wp-block-button__link { width: 100%; padding-left: 16px; padding-right: 16px; }
}

/* 0.7 (user: the homepage "looks a bit dead" next to the category pages): the page stands on a
   warm wall tone so white tiles and cards read as objects, and the product grid sits on an ink
   band like the hero, so the page alternates ink → wall → ink → wall → footer. */
.home .site-content { background: var(--jc-wall, #f2efe9); }
.jc-section { padding: clamp(32px, 4vw, 56px) 0 0; }
.jc-section:has(ul.products) {
	margin-top: clamp(40px, 5vw, 64px) !important;
	padding: clamp(36px, 4.5vw, 60px) 0;
	background: var(--jc-ink); color: #fff;
	box-shadow: 0 0 0 100vmax var(--jc-ink); clip-path: inset(0 -100vmax);
}
.jc-section:has(ul.products) .jc-section__title { color: #fff; }
.hentry .entry-content .jc-section:has(ul.products) .jc-section__more a { color: #fff; }
.jc-section:has(ul.products) ul.products li.product { border-color: transparent; }
.jc-section:has(ul.products) + .jc-section { padding-top: clamp(40px, 5vw, 64px); }
.jc-section:last-child { padding-bottom: clamp(40px, 5vw, 72px); }
.jc-section > * { max-width: none !important; }
.jc-section__title { font-size: clamp(1.4rem, 1.2rem + .8vw, 2rem); font-weight: 800; margin: 0 0 16px !important; }
.jc-section__more { margin-top: 16px !important; font-weight: 700; }
/* Storefront puts 2.29em above a product grid that follows an h2 on the full-width homepage;
   every section uses the title's own 16px instead. (Selector matches Storefront's specificity.) */
.home.page-template-template-fullwidth .hentry .jc-section h2 + .woocommerce { margin-top: 0; }
.jc-section .woocommerce ul.products { margin-bottom: 0 !important; } /* shared ul.products sets 24px !important */
/* inline-block + padding: a 24px+ target (WCAG 2.2 target size). Ink underline: the hero
   button is this screen's one Joker Red element. */
.jc-section__more a { display: inline-block; padding: 6px 0 4px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.jc-section__more a:hover { text-decoration-thickness: 3px; }

/* 768–1099px (0.7.15, review): the shared grid has three columns there, so the four new products
   stood as three plus one orphan. Four items take a 2×2 grid instead. */
@media (min-width: 768px) and (max-width: 1099px) {
	.jc-section ul.products:has(> li.product:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
