/**
 * Homepage V1 (Figma "VATALY — Homepage": Desktop 1440, Mobile 402).
 *
 * Loaded on the Custom Actions → Homepage page only (inc/homepage.php).
 * Layout, spacing, typography and colours come from Elementor controls; this
 * file holds only what Elementor (free) cannot do. Classes are homepage-*,
 * values come from the style.css :root tokens.
 *
 * Breakpoints: desktop ≥ 1024, tablet 768–1023 (not designed — follows the
 * CLP rules), mobile < 768.
 */

/* -------------------------------------------------------------------------
 * 01 Announcement bar — Konte's topbar (#topbar, printed on this page only by
 * inc/homepage.php); the message is Customizer → Topbar → Center → Custom
 * Text. Figma: one centred line, Body 12 Relaxed, padding 8/20, height hugs
 * the text (34px for one line, grows when it wraps), not sticky, desktop and
 * mobile alike. The id beats the Customizer's inline .topbar height.
 * Colours (stone surface, ink text) are not set here: css/global-colours.css
 * § Top bar maps every Konte topbar scheme onto the palette variables.
 * ---------------------------------------------------------------------- */

#topbar {
	height: auto;
	padding: var(--space_8) var(--space_20);
	font-family: var(--font2);
	font-size: 12px;
	font-weight: 300;
	line-height: 18px;
	text-align: center;
}

/* !important only on the left side: style.css sets .konte-container-fluid
 * margin-left / padding-left with !important site-wide. */
#topbar .konte-container-fluid {
	justify-content: center;
	margin: 0;
	margin-left: 0 !important;
	padding: 0;
	padding-left: 0 !important;
}

/* Only the centre item is designed; empty side columns would offset it. */
#topbar .topbar-left-items,
#topbar .topbar-right-items {
	display: none;
}

#topbar .topbar-center-items {
	flex: 1;
	justify-content: center;
}

#topbar .topbar-text,
#topbar a {
	color: inherit;
}

/* Konte hides the topbar below 768px unless its mobile switch is on; Figma
 * shows it on mobile too. */
@media (max-width: 767px) {
	#topbar {
		display: block;
	}

	#topbar .topbar-center-items {
		display: flex;
	}
}

/* -------------------------------------------------------------------------
 * 02 Hero — caption container (homepage-hero__caption): h1, sub copy
 * (homepage-hero__sub) and the CTA, an Elementor Button (paper fill, ink
 * border, inverted on hover — all Elementor controls). The theme drops its
 * focus outline; focus isn't designed, so a paper ring (it sits on the dark
 * scrim) keeps keyboard focus visible.
 * ---------------------------------------------------------------------- */

.homepage-hero .elementor-button:focus-visible {
	outline: 2px solid var(--bg_clr1);
	outline-offset: 2px;
}

/* The theme's paragraph margins would add to the caption's 16px gap. */
.homepage-hero__sub p:first-child {
	margin-top: 0;
}

.homepage-hero__sub p:last-child {
	margin-bottom: 0;
}

/* Figma 16 Nov scrim (desktop): ink 0 / 0 / 25 / 39 / 39 / 45 % at
 * 0 / 25 / 45 / 55 / 75 / 100 %. Elementor's overlay has two stops, so its
 * pseudo-element is repainted here; tablet (768–1024, not designed) keeps the
 * Elementor overlay, mobile has its own ramp below.
 * Four classes outrank Elementor's post CSS (.elementor-4414 .elementor-element
 * .elementor-element-<id>::before) without !important. */
@media (min-width: 1025px) {
	.elementor .elementor-element.homepage-hero.e-con::before {
		background-image: linear-gradient(
			180deg,
			transparent 0%,
			transparent 25%,
			color-mix(in srgb, var(--ink_text) 25%, transparent) 45%,
			color-mix(in srgb, var(--ink_text) 39%, transparent) 55%,
			color-mix(in srgb, var(--ink_text) 39%, transparent) 75%,
			color-mix(in srgb, var(--ink_text) 45%, transparent) 100%
		);
	}
}

/* Figma 16 Nov mobile scrim (402 × 710 hero): ink 0 / 0 / 30 / 50 / 68 / 80 %
 * at 0 / 60 / 70 / 77 / 90 / 100 %. Same selector as the desktop ramp. */
@media (max-width: 767.98px) {
	.elementor .elementor-element.homepage-hero.e-con::before {
		background-image: linear-gradient(
			180deg,
			transparent 0%,
			transparent 60%,
			color-mix(in srgb, var(--ink_text) 30%, transparent) 70%,
			color-mix(in srgb, var(--ink_text) 50%, transparent) 77%,
			color-mix(in srgb, var(--ink_text) 68%, transparent) 90%,
			color-mix(in srgb, var(--ink_text) 80%, transparent) 100%
		);
	}
}

/* -------------------------------------------------------------------------
 * 03 Shop Women / Shop Men — each tile is one Elementor container rendered
 * as <a> (class homepage-tile): Image + caption Heading (homepage-tile__caption).
 * Elementor sets the image's object-fit / object-position (the crop stays
 * editable); the ratio is fixed here so any image fills the Figma frame:
 * 717×598 (6:5) desktop and tablet, 402×502 (4:5) mobile.
 * ---------------------------------------------------------------------- */

.homepage-tile img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 6 / 5;
}

/* Hover (Figma annotation): caption underline; the link never recolours. */
.homepage-tile,
.homepage-tile:hover,
.homepage-tile:focus {
	color: inherit;
	text-decoration: none;
}

.homepage-tile:hover .homepage-tile__caption .elementor-heading-title {
	text-decoration: underline;
}

/* Focus ring around the whole tile, inside it so the 4px gap never clips it (as the CLP tiles). */
.homepage-tile:focus-visible {
	outline: 2px solid var(--ink_text);
	outline-offset: -2px;
}

/* -------------------------------------------------------------------------
 * 04 New Arrivals — [vataly_homepage_new_arrivals] prints the CLP New
 * Arrivals rail (css/CLP-landing.css: 4 cards per view at 1px sides and a
 * 2px gap, swipe with snap below 1024px) inside .homepage-new-arrivals.
 * Only the homepage's deltas live here: spacing comes from the Elementor
 * container around the shortcode, the header sits on the 72 / 24 margins,
 * the title is set as typed ("New Arrivals"), and the swipe row starts 24px
 * in (Figma 10:335).
 * ---------------------------------------------------------------------- */

.homepage-new-arrivals .vataly-clp-section {
	padding: 0;
}

.homepage-new-arrivals .vataly-clp-section__header {
	padding: 0 72px;
}

.homepage-new-arrivals .vataly-clp-section__title {
	text-transform: none;
}

/* Switched off in Custom Actions (or no products): the shortcode prints
   nothing, so its Elementor container drops out with its 96 / 48 margin.
   Kept in the editor so the block can still be found and moved. */
body:not(.elementor-editor-active) .homepage-new-arrivals-block:not(:has(.homepage-new-arrivals)) {
	display: none;
}

@media (max-width: 1023.98px) {
	.homepage-new-arrivals .vataly-clp-rail {
		scroll-padding-inline: var(--space_24);
	}

	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products {
		padding: 0 var(--space_24);
	}
}

/* -------------------------------------------------------------------------
 * 05 Editorial — text column + image (class homepage-editorial__image).
 * Elementor's Image widget has no ratio control; the Figma image is square
 * (746 × 746 desktop, 402 × 402 mobile), so any image is cropped to 1:1 with
 * the object-fit / object-position set in Elementor.
 * ---------------------------------------------------------------------- */

.homepage-editorial__image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
}

/* The theme's paragraph margins would add to the 24px column gap. */
.homepage-editorial__text .elementor-widget-text-editor p:first-child {
	margin-top: 0;
}

.homepage-editorial__text .elementor-widget-text-editor p:last-child {
	margin-bottom: 0;
}

@media (max-width: 767.98px) {
	.homepage-new-arrivals .vataly-clp-section__header {
		padding: 0 var(--space_24);
	}

	/* Figma rail is 365 high (block 411). The CLP's 4px scrollbar room
	   (CLP-landing.css) is counted into its 48 gap there; here the 96 spacer
	   follows, and touch scrollbars overlay, so drop it. */
	.homepage-new-arrivals .vataly-clp-rail {
		padding-bottom: 0;
	}

	.homepage-tile img {
		aspect-ratio: 4 / 5;
	}

	/* 04 New Arrivals card, homepage only (Figma 16 Nov Mob PLP Product Card
	 * 199 × 365): image 199 × 274, then name, price and the colour name —
	 * no colour suffix, swatch dots, "+N Colours", quick-add or heart. The
	 * shared PLP card (css/plp.css) is untouched; the .vataly-clp-rail class
	 * puts these one class above its mobile columns-4 rules. */
	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products li.product .product-inner {
		min-height: 365px;
	}

	/* Width stays the shared 0.1px, so the 274px image geometry is unchanged. */
	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products li.product .product-thumbnail {
		border-color: var(--b_clr);
	}

	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products li.product .product-summary {
		display: block;
		padding: var(--space_8) var(--space_4) 0;
	}

	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products li.product .woocommerce-loop-product__title,
	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products li.product .price,
	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products li.product .vataly-card-colour-name {
		display: block;
		margin: 0;
		padding: 0;
		overflow: hidden;
		font-family: var(--font2);
		font-weight: 300;
		font-size: 12px;
		line-height: 16px;
		letter-spacing: 0;
		color: var(--ink_text);
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products li.product .vataly-card-colour-name {
		margin-top: 6px;
	}

	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products li.product .vataly-card-title__colour,
	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products li.product .vataly-card-swatches,
	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products li.product .vataly-card-more-colours,
	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products li.product .vataly-size-trigger {
		display: none;
	}

	/* !important: style.css shows every listing heart with
	 * `a.wcboost-wishlist-button:not(…) { display: inline-flex !important }`. */
	.homepage-new-arrivals.woocommerce-archive .vataly-clp-rail ul.products li.product .wcboost-wishlist-button {
		display: none !important;
	}
}
