/* ITEMPLS light-theme experiment — two light skins, one implementation.
 *
 * The storefront ships dark. This file adds two LIGHT skins as token
 * overrides on <html data-it-skin>, so the same markup, the same cards and
 * the same Fast Variant Buying logic render three ways and can be screenshot
 * against each other on identical pages:
 *
 *   (nothing)     the current dark V3, untouched — the baseline
 *   light-pure    white page, white cards, hairline grey structure
 *   light-soft    very light grey page, white cards, soft borders and shadow
 *
 * NOTHING HERE CHANGES INFORMATION ARCHITECTURE. No selector below alters
 * which control exists, what it does, or which variation it resolves to.
 *
 * WHAT THE LIGHT SKINS DELIBERATELY CARRY BEYOND COLOUR
 *
 * The brief asks for the light test and the approved compact direction
 * together, so the light skins also drop the media well (item art sits
 * directly on the card) and close the gap the card used to leave between the
 * title and the price. That means a light screenshot differs from the dark
 * one in three ways at once, by instruction — it is a comparison of
 * directions, not an isolated colour swap.
 */

/* ============================================================ A: PURE ==== */

html[data-it-skin="light-pure"] {
	--it-bg:            #ffffff;
	--it-surface:       #ffffff;
	--it-surface-2:     #f7f8f9;
	--it-surface-3:     #f2f4f6;
	--it-line:          #e3e6ea;
	--it-line-strong:   #cfd4da;

	--it-text:          #14181d;
	--it-text-muted:    #5a636e;
	--it-text-faint:    #8b939d;
	--it-text-on-accent:#1a1205;

	/* The accent does not move: it is the brand, and it is the only thing
	 * allowed to mean "this is selected" or "this buys". */
	--it-accent:        #e08a06;
	--it-accent-hover:  #c97a03;
	--it-accent-press:  #a96500;
	--it-accent-soft:   rgba(224, 138, 6, 0.10);
	--it-accent-line:   rgba(224, 138, 6, 0.42);

	--it-ladder:        #e08a06;
	--it-ladder-soft:   rgba(224, 138, 6, 0.10);
	--it-ladder-line:   rgba(224, 138, 6, 0.42);
	--it-nonladder:     #1f66b5;
	--it-nonladder-soft:rgba(31, 102, 181, 0.09);
	--it-nonladder-line:rgba(31, 102, 181, 0.38);

	--it-ok:            #0f7a5a;
	--it-ok-soft:       rgba(15, 122, 90, 0.10);
	--it-warn:          #a86a00;
	--it-danger:        #b4342f;
	--it-danger-soft:   rgba(180, 52, 47, 0.10);

	--it-shadow:    0 1px 1px rgba(20,24,29,.04);
	--it-shadow-lg: 0 10px 34px rgba(20,24,29,.14);

	/* The well becomes the card. */
	--it-well:      #ffffff;
	--it-well-hi:   #ffffff;
	--it-well-lo:   #ffffff;
	--it-well-ink:  #6b7280;
	--it-well-pad:  0%;
}

/* ==================================================== B: SOFT NEUTRAL ==== */

html[data-it-skin="light-soft"] {
	--it-bg:            #f3f4f6;
	--it-surface:       #ffffff;
	--it-surface-2:     #fafbfc;
	--it-surface-3:     #f1f3f5;
	--it-line:          #e5e7eb;
	--it-line-strong:   #cbd1d8;

	--it-text:          #16191e;
	--it-text-muted:    #545c67;
	--it-text-faint:    #858d97;
	--it-text-on-accent:#1a1205;

	--it-accent:        #e08a06;
	--it-accent-hover:  #c97a03;
	--it-accent-press:  #a96500;
	--it-accent-soft:   rgba(224, 138, 6, 0.11);
	--it-accent-line:   rgba(224, 138, 6, 0.44);

	--it-ladder:        #e08a06;
	--it-ladder-soft:   rgba(224, 138, 6, 0.11);
	--it-ladder-line:   rgba(224, 138, 6, 0.44);
	--it-nonladder:     #1f66b5;
	--it-nonladder-soft:rgba(31, 102, 181, 0.10);
	--it-nonladder-line:rgba(31, 102, 181, 0.40);

	--it-ok:            #0f7a5a;
	--it-ok-soft:       rgba(15, 122, 90, 0.10);
	--it-warn:          #a86a00;
	--it-danger:        #b4342f;
	--it-danger-soft:   rgba(180, 52, 47, 0.10);

	--it-shadow:    0 1px 2px rgba(22,25,30,.05), 0 6px 18px -10px rgba(22,25,30,.18);
	--it-shadow-lg: 0 12px 38px rgba(22,25,30,.16);

	--it-well:      #ffffff;
	--it-well-hi:   #ffffff;
	--it-well-lo:   #ffffff;
	--it-well-ink:  #6b7280;
	--it-well-pad:  0%;
}

/* ================================================ shared light behaviour == */

html[data-it-skin^="light-"] body {
	background: var(--it-bg);
	color: var(--it-text);
}

/* The page chrome is a dark band in the dark skin; here it becomes a white
 * surface with a hairline under it, so the catalogue is the darkest thing on
 * the page rather than the header. */
html[data-it-skin^="light-"] .it-header,
html[data-it-skin^="light-"] .it-nav,
html[data-it-skin^="light-"] .it-subnav {
	background: var(--it-surface) !important;
	border-color: var(--it-line) !important;
}
/* The wordmark is drawn for a dark ground. The header's was inverted; the
 * footer's was not, so the brand sat white-on-white and read as absent --
 * which is exactly what "the brand is too faint" was describing. */
html[data-it-skin^="light-"] .it-brand__mark,
html[data-it-skin^="light-"] .it-footer__brand img {
	filter: invert(1) hue-rotate(180deg) saturate(1.15) brightness(.82);
}
html[data-it-skin^="light-"] .it-footer__brand p {
	color: var(--it-text-muted);
}

/* --- the card: one continuous block ------------------------------------- */

html[data-it-skin^="light-"] body ul.products li.product {
	background: var(--it-surface);
	border: 1px solid var(--it-line);
	box-shadow: var(--it-shadow);
}

/* THE WELL GOES. Item art sits on the card, which is the whole point of the
 * transparency work: a card should be CARD -> ITEM ART, not CARD -> BEIGE
 * RECTANGLE -> ITEM ART. The media box keeps a fixed, much smaller height
 * instead of a 75% padding plinth. */
html[data-it-skin^="light-"] body ul.products li.product .it-card__media {
	background: transparent !important;
	border-bottom: 0 !important;
	height: 86px !important;
	padding-top: 0 !important;
	aspect-ratio: auto !important;
	display: flex;
	align-items: center;
	justify-content: center;
}
/* One art box for every item, whatever the source bitmap measures: with
 * width/height auto a 38px sprite drew at 23px next to a 147px capture
 * drawing at 78px, and a row of cards looked broken. */
html[data-it-skin^="light-"] body ul.products li.product .it-card__media img {
	position: static !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100%;
	padding: 4px !important;
	mix-blend-mode: normal !important;
	object-fit: contain;
}
/* A sprite is upscaled, so nearest-neighbour keeps it crisp and reads as
 * pixel art. The larger photographic captures keep smooth resampling. */
html[data-it-skin^="light-"] body ul.products li.product .it-card__media img.it-art--sprite {
	image-rendering: pixelated;
}
html[data-it-skin^="light-"] body ul.products li.product .it-card__noimg {
	position: static !important;
	color: var(--it-text-faint);
}

/* The gap between the title and the price is what made short cards look
 * broken next to tall ones: the foot was pushed to the bottom of a stretched
 * card. Let the block end where its content ends. */
html[data-it-skin^="light-"] body ul.products li.product .it-card__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 0 10px 10px;
}
html[data-it-skin^="light-"] body ul.products li.product .it-card__foot {
	margin-top: 6px !important;
	border-top: 1px solid var(--it-line);
	padding-top: 8px;
}
html[data-it-skin^="light-"] body ul.products li.product .it-fb {
	border-top: 1px solid var(--it-line);
}

/* Rows of cards size to their own content rather than to the tallest card in
 * the grid, so a two-roll card is a two-roll card. */
html[data-it-skin^="light-"] body ul.products {
	align-items: start;
}
html[data-it-skin^="light-"] body ul.products li.product {
	align-self: start;
}

/* --- controls ----------------------------------------------------------- */

html[data-it-skin^="light-"] .it-fb__lab { border-color: transparent; }
html[data-it-skin^="light-"] .it-fb__roll:hover .it-fb__lab {
	border-color: var(--it-line-strong);
	background: var(--it-surface-2);
}
html[data-it-skin^="light-"] .it-fb__roll[data-selected="true"] .it-fb__lab {
	border-color: var(--it-accent);
	background: var(--it-accent-soft);
}
html[data-it-skin^="light-"] .it-fb__roll[data-requestable="true"] .it-fb__price .na {
	color: var(--it-text-faint);
}
html[data-it-skin^="light-"] .it-btn--ghost,
html[data-it-skin^="light-"] .it-view {
	border-color: var(--it-line-strong);
	color: var(--it-text-muted);
	background: var(--it-surface);
}
html[data-it-skin^="light-"] .it-btn--request {
	background: var(--it-surface-3);
	border-color: var(--it-line-strong);
	color: var(--it-text);
}
html[data-it-skin^="light-"] input,
html[data-it-skin^="light-"] select,
html[data-it-skin^="light-"] textarea {
	background: var(--it-surface);
	color: var(--it-text);
	border-color: var(--it-line-strong);
}

/* The hover tooltip keeps a dark plate: it shows a game screenshot, which is
 * itself dark, and a white plate around it would glare. */
html[data-it-skin^="light-"] .it-peek,
html[data-it-skin^="light-"] .it-peek__box {
	background: #12161d;
	border-color: #2a323f;
	color: #eef2f7;
}

/* Unavailable has to stay legible on white: grey text on white is weaker
 * than grey text on near-black, so it gains a hairline instead of relying on
 * dimness alone. */
html[data-it-skin^="light-"] .it-fb__roll[data-sellable="false"] .it-fb__lab {
	opacity: 1;
	background: repeating-linear-gradient(135deg,
		transparent 0 6px, rgba(20,24,29,.035) 6px 12px);
	color: var(--it-text-faint);
}
html[data-it-skin^="light-"] .it-fb__roll[data-sellable="false"] .it-fb__name {
	color: var(--it-text-faint);
}

/* The staging banner and the mode bar keep their meaning. */
html[data-it-skin^="light-"] .it-gate {
	background: var(--it-accent-soft);
	border-color: var(--it-accent-line);
	color: var(--it-text);
}

/* ------------------------------------------------------------ switcher --- */

.it-skinbar {
	position: fixed;
	right: 14px;
	bottom: 14px;
	z-index: 9998;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 7px 9px;
	border-radius: 999px;
	background: rgba(12, 15, 20, .92);
	border: 1px solid rgba(255, 255, 255, .16);
	box-shadow: 0 8px 28px rgba(0, 0, 0, .4);
	font-size: 12px;
	backdrop-filter: blur(4px);
}
.it-skinbar__l {
	color: rgba(255, 255, 255, .5);
	font-family: var(--it-font-mono);
	text-transform: uppercase;
	letter-spacing: .1em;
	font-size: 10px;
	padding-left: 4px;
}
.it-skinbar__b {
	color: rgba(255, 255, 255, .78);
	text-decoration: none;
	padding: 5px 10px;
	border-radius: 999px;
	white-space: nowrap;
}
.it-skinbar__b:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.it-skinbar__b[aria-current="true"] {
	background: var(--it-accent);
	color: #1a1205;
	font-weight: 600;
}

/* --- contrast corrections the light ground exposes ---------------------- */

/* A disabled Add at 45% opacity reads fine as dim amber on near-black. On
 * white it almost disappears, and "no roll chosen yet" starts looking like
 * "this card is broken". It keeps its outline and its label instead. */
html[data-it-skin^="light-"] body ul.products li.product .it-fb__add[disabled],
html[data-it-skin^="light-"] .it-fb__add[disabled] {
	opacity: 1;
	background: var(--it-accent-soft) !important;
	color: var(--it-accent) !important;
	border: 1px solid var(--it-accent-line) !important;
}
html[data-it-skin^="light-"] body ul.products li.product .it-fb__add:not([disabled]) {
	background: var(--it-accent) !important;
	color: var(--it-text-on-accent) !important;
	border: 1px solid var(--it-accent-press) !important;
}

/* The "Stats" affordance is a dark pill designed to sit on a light well. The
 * well is gone, so on a white card it became the heaviest thing on screen. */
html[data-it-skin^="light-"] .it-card__stats {
	background: rgba(20, 24, 29, .06) !important;
	color: var(--it-text-muted) !important;
	border: 1px solid var(--it-line) !important;
	backdrop-filter: none;
}
html[data-it-skin^="light-"] li.product:hover .it-card__stats {
	background: var(--it-accent-soft) !important;
	color: var(--it-accent) !important;
	border-color: var(--it-accent-line) !important;
}

/* The price is the number a scanner is looking for; on white it can afford
 * to be the darkest thing in the row. */
html[data-it-skin^="light-"] .it-p {
	color: var(--it-text);
}
html[data-it-skin^="light-"] .it-p .from {
	color: var(--it-text-faint);
}

/* --- amber as text, on a light ground ----------------------------------- */

/* The brand amber is #e08a06. On near-black it is 8.88:1 and reads as text.
 * On white it is 2.69:1 -- below even the 3.0 large-text floor -- so on the
 * light skins it stays a FILL (the Add label on amber is 6.89:1) and anywhere
 * amber carries meaning as TEXT it uses a darker tone of the same hue:
 * #8f5602 is 6.00:1 on white and 5.45:1 on the soft grey page. */
/* NOT the token: --it-ladder drives fills as well as text, and darkening it
 * turned the homepage's "Shop Ladder" button into mud. Fills keep the brand
 * amber; only the text roles below take the darker tone. */
html[data-it-skin^="light-"] .it-p--ladder,
html[data-it-skin^="light-"] .it-fb__more,
html[data-it-skin^="light-"] .it-sr__gh a:hover,
html[data-it-skin^="light-"] .it-views__b[aria-pressed="true"],
html[data-it-skin^="light-"] .it-tools__chk:hover,
html[data-it-skin^="light-"] li.product:hover .it-card__stats,
html[data-it-skin^="light-"] .it-fb__add[disabled] {
	color: #8f5602 !important;
}

/* ================================================== pale item separation == */

/* A fifth of the catalogue's art is light enough to compete with a white card
 * -- Sandstorm Trek Ethereal is cream at 1.5:1 against it, and no lightness
 * test catches that because not one of its pixels is near-white. The fix is
 * local and follows the item's own silhouette: drop-shadow works on the alpha
 * channel, so a transparent PNG gets a soft edge and nothing gets a rectangle.
 *
 * Two shadows: a tight one that acts as a rim, and a soft offset one that
 * lifts the item off the card. Both are weak on purpose -- this runs on 180
 * assets and has to be invisible until you need it. */
html[data-it-skin^="light-"] body ul.products li.product .it-card__media img.it-art--pale,
html[data-it-skin^="light-"] .it-card__media img.it-art--pale {
	filter:
		drop-shadow(0 0 0.5px rgba(22, 25, 30, .45))
		drop-shadow(0 1px 2px rgba(22, 25, 30, .22));
}

/* ============================================ predictable card regions ==== */

/* The complaint was ragged cards with voids in them. The answer is not to
 * stretch every card to the tallest -- that is what made the voids -- but to
 * make the parts ABOVE the roll list identical on every card, so names,
 * prices and CTAs line up across a row and only the roll list varies.
 *
 *   art        fixed 86px
 *   name       two lines, always
 *   type       one line, always
 *   price      one row, always
 *   rolls      four rows of space, then "Show all N"
 *   add        one row
 */
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-card__body {
	--it-fb-row: 23px;
}
html:not([data-it-view="list"])[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .woocommerce-loop-product__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.5em;
}
html:not([data-it-view="list"])[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-card__type {
	min-height: 1.15em;
}
/* The roll list is NOT padded out to a fixed number of rows. Reserving four
 * rows' worth of space aligns every Add button and puts two rows of nothing
 * inside every two-roll card, which is the void this card was supposed to
 * lose. Instead the list is CAPPED at four visible rolls, so heights cluster
 * into a few values instead of spreading across six. */
html:not([data-it-view="list"])[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-fb__rolls {
	align-content: start;
}

/* ====================================================== mobile list ======= */

/* Desktop list rows are 66px. Mobile was 128-161 because the template stacked
 * name, type, specification count, rolls and the price row, each on its own
 * line. The category is already in the page title, so the type line goes; the
 * specification count and the price share a line; and the buy controls sit
 * beside the name rather than under everything. */
@media (max-width: 760px) {
	html[data-it-skin^="light-"] body ul.products li.product .it-card__type {
		display: none;
	}
	html[data-it-skin^="light-"] body ul.products li.product.it-card--norolls .it-card__spec {
		font-size: var(--it-fs-xs);
	}
}

/* The product gallery now shows the transparent derivative, so the multiply
 * blend the dark theme used to knock a baked white background out of the art
 * has nothing left to do -- and on anything but a pure white surface it would
 * darken the item instead. */
html[data-it-skin^="light-"] .it-gallery img,
html[data-it-skin^="light-"] .woocommerce-product-gallery img,
html[data-it-skin^="light-"] .it-gallery__main img {
	mix-blend-mode: normal !important;
}

/* ================================================ card polish (V3.1) ===== */

/* The density pass went one step too far: 150px cards with 86px art read as
 * widgets rather than as the things being sold. These are bigger in every
 * dimension that carries meaning -- art, name, price, the button -- and still
 * far denser than the 212px V2 card they replaced. */
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product {
	border: 1px solid var(--it-line-strong);
	border-radius: 10px;
	box-shadow: 0 1px 2px rgba(22, 25, 30, .04);
	transition: box-shadow .15s ease, border-color .15s ease;
}
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product:hover {
	border-color: var(--it-accent-line);
	box-shadow: 0 2px 4px rgba(22, 25, 30, .06), 0 12px 26px -16px rgba(22, 25, 30, .35);
}
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-card__media {
	height: 104px !important;
	padding-top: 10px !important;
}
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-card__body {
	padding: 0 12px 12px;
	gap: 3px;
}
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .woocommerce-loop-product__title {
	font-size: 15.5px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	color: var(--it-text);
}
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-p {
	font-size: 15px;
	font-weight: 700;
}
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-p .from {
	font-size: 10.5px;
	font-weight: 500;
}
/* One action, full width, and big enough to hit without aiming. */
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-card__actions {
	display: flex;
	gap: 6px;
}
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-card__actions .it-btn {
	min-height: 40px;
}
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-choose,
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-add {
	flex: 1 1 auto;
	justify-content: center;
}
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-fb__add,
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-fb__req {
	min-height: 40px;
	flex: 1 1 auto;
	justify-content: center;
}

/* ========================================= one card height, one row ====== */

/* A six-roll product must not be twice the height of the two-roll product
 * beside it. Collapsed, the picker shows exactly the roll the card has
 * selected -- so every card in a row is the same height -- and "Show all N"
 * opens the rest in place. */
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) .it-fb:not([data-expanded]) .it-fb__roll:not([data-selected="true"]) {
	display: none;
}
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) .it-fb__legend {
	display: none;
}
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) .it-fb__more {
	margin-top: 2px;
	font-size: var(--it-fs-xs);
	color: var(--it-accent);
}
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) .it-fb[data-expanded] .it-fb__rolls {
	max-height: 168px;
	overflow-y: auto;
}

/* The list view is for comparing, so it keeps several rows open. */
html[data-it-skin^="light-"] body ul.products.it-view--list .it-fb:not([data-expanded]) .it-fb__roll[data-extra] {
	display: none;
}

/* ================================================ homepage compaction ==== */

.it-hero h1 { margin-bottom: 10px; }
.it-hero__sub { margin-bottom: 16px; }
.it-hero__strip { margin-top: 16px; }

/* Four steps in a row, stated once, not a section of their own. */
html[data-it-skin^="light-"] .it-steps {
	gap: var(--it-s4);
}
html[data-it-skin^="light-"] .it-step {
	padding: 12px 14px;
}
html[data-it-skin^="light-"] .it-step__d {
	font-size: var(--it-fs-xs);
	line-height: 1.5;
}

/* On a 844px phone the first product began at y=853 -- nine pixels below the
 * fold, which is the same as not being there. The hero keeps its message and
 * loses its padding, and the trust strip becomes one wrapped line. */
@media (max-width: 760px) {
	.it-hero__inner { padding-block: var(--it-s5) var(--it-s4); }
	.it-hero h1 { font-size: clamp(26px, 8vw, 34px); line-height: 1.12; }
	.it-hero__sub { font-size: var(--it-fs-sm); margin-bottom: 14px; }
	.it-hero__cta { gap: 8px; }
	.it-hero__cta .it-btn { min-width: 0; flex: 1 1 auto; }
	.it-hero__strip {
		margin-top: 12px;
		display: flex;
		flex-wrap: wrap;
		gap: 6px 14px;
		font-size: var(--it-fs-xs);
	}
	.it-homegate { margin-block: var(--it-s3); }
	html[data-it-skin^="light-"] .it-section__head { margin-bottom: 10px; }
}

/* The last two card heights on the homepage came from text, not variants:
 * "UNIQUE THROWING WEAPON" wraps to two lines where "CHARM" is one, and a
 * "from" price put the word on its own line above the figure. Both are
 * pinned so the card's meta region is one predictable block. */
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-card__type {
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 1.15em;
}
/* Do NOT set `display` on .it-p.
 *
 * A card renders three of them -- a ladder price, a non-ladder price and a
 * "from" price -- and the storefront shows one by hiding the other two with
 * `display`. Setting `display: flex` here outranked that, so every card
 * stacked all three and grew 45px. The "from" is inlined on the span itself,
 * which is the only part that needed changing. */
html[data-it-skin^="light-"] body ul.products:not(.it-view--list) li.product .it-p .from {
	display: inline;
	margin-right: 4px;
}
