/*
Theme Name: Vitrine
Description: Reusable block theme for small online shops. Semantic design tokens; client branding lives in a child theme.
Version: 0.1.0
Requires at least: 7.0
Requires PHP: 8.3
Text Domain: vitrine
License: GPL-2.0-or-later
*/

/* Product imagery: one ratio everywhere (4:5), the bottle is the subject. */
.wp-block-woocommerce-product-image-gallery .woocommerce-product-gallery__image img,
.wp-block-woocommerce-product-image img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; height: auto; border-radius: var(--wp--custom--radius--card); }
.vitrine-product__info { position: sticky; top: 96px; align-self: flex-start; }
@media (max-width: 781px) { .vitrine-product__info { position: static; } }
/* Product grid: four across on desktop, two on a phone. */
@media (max-width: 639px) {
	.wp-block-woocommerce-product-template.is-flex-container { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.wp-block-woocommerce-product-template.is-flex-container > li { width: auto !important; margin: 0 !important; }
}

/* Hero: the words sit in a solid box on the calm side; never a scrim over the photograph. */
.vitrine-hero .vitrine-hero__box { max-width: 560px; margin-left: auto; }
@media (max-width: 781px) { .vitrine-hero .vitrine-hero__box { max-width: none; } }
/* Name/value rows: one rule closing each row. */
.vitrine-rows table { border-collapse: collapse; width: 100%; }
.vitrine-rows td { border: 0; border-bottom: 1px solid var(--wp--custom--line); padding: 12px 0; font-size: var(--wp--preset--font-size--small); }
.vitrine-rows td:last-child { text-align: right; color: var(--wp--preset--color--muted); }
.vitrine-statement { max-width: 22em; line-height: 1.16; }
.vitrine-faq h3 { margin-top: var(--wp--preset--spacing--50); }
.vitrine-faq > p { padding-bottom: var(--wp--preset--spacing--50); border-bottom: 1px solid var(--wp--custom--line); }
.vitrine-close-word { font-size: clamp(56px, 14vw, 200px); line-height: 1; letter-spacing: -0.04em; margin-top: var(--wp--preset--spacing--80); white-space: nowrap; overflow: hidden; }
.wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: var(--wp--preset--color--contrast); border: 1px solid currentColor; }
.vitrine-card-image img { border-radius: var(--wp--custom--radius--card); }
/* Product names in grids read as interface text, not display headings. */
.wp-block-woocommerce-product-template .wp-block-post-title,
.wp-block-post-template .wp-block-post-title { font-family: var(--wp--preset--font-family--text); font-weight: 500; letter-spacing: 0; line-height: 1.35; }
/* Shop filters: plain links shown as chips; no JavaScript. */
.vitrine-filters { gap: var(--wp--preset--spacing--60); margin-block: var(--wp--preset--spacing--50); }
.vitrine-chips ul, ul.vitrine-chips, .vitrine-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.vitrine-chips a, .vitrine-chips.wp-block-tag-cloud a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--wp--custom--line); border-radius: 999px; text-decoration: none; font-size: 14px !important; }
.vitrine-chips a:hover { border-color: var(--wp--preset--color--contrast); }
/* A statement starts on the content's left line, like every heading. */
.is-layout-constrained > .vitrine-statement { margin-left: 0 !important; }
/* Brand band: every word in the band's own text colour; rules follow it. */
.vitrine-band { --wp--custom--line: color-mix(in srgb, currentColor 28%, transparent); }
.vitrine-band .vitrine-rows td:last-child { color: inherit; }
/* Category cards: two across on a phone instead of one tall column. */
@media (max-width: 781px) {
	.wp-block-columns:has(> .wp-block-column > .vitrine-card-image) { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
	.wp-block-columns:has(> .wp-block-column > .vitrine-card-image) > .wp-block-column { flex-basis: auto !important; }
}

/* Accessibility fixes for WooCommerce components (found by axe in T16). */
/* The closed mini-cart drawer is aria-hidden but keeps focusable links: take it out of the tab order. */
.wc-block-components-drawer__screen-overlay--is-hidden { visibility: hidden; }
/* Grey helper text in the checkout needs 4.5:1 on our ground. */
.wc-block-components-shipping-rates-control .wc-block-components-shipping-rates-control__no-shipping-address-message,
.wc-block-components-checkout-step .wc-block-components-checkout-step__description { color: var(--wp--preset--color--muted) !important; }

/* Web Interface Guidelines review (T16). */
:where(h1, h2, h3) { text-wrap: balance; }
:where(p) { text-wrap: pretty; }
.vitrine-rows td, .wc-block-components-product-price, .wc-block-components-totals-item__value { font-variant-numeric: tabular-nums; }
:where(a, button, .wp-element-button) { touch-action: manipulation; }
html { scroll-padding-top: 96px; } /* focused or targeted elements never hide under the sticky header */
/* Focus ring lives here, not in theme.json "css": a child theme's theme.json css replaces the parent's. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: var(--wp--custom--focus--width, 2px) solid var(--wp--preset--color--accent); outline-offset: 2px; }
/* WooCommerce "coming soon" mode replaces the theme's font families on every page (even for
   logged-in previewers). A child theme sets settings.custom.fontDisplay / fontText in theme.json;
   those custom properties are not touched, so they become the source of the font presets. */
body {
	--wp--preset--font-family--display: var(--wp--custom--font-display, Georgia, serif);
	--wp--preset--font-family--text: var(--wp--custom--font-text, system-ui, sans-serif);
}
