/*
Theme Name: Vyhrané Blocks
Theme URI: https://www.vyhrane.sk/
Author: iWESOME / Vyhrané
Description: Natívna Gutenberg Full Site Editing block téma pre Vyhrané a WooCommerce. Bez Elementoru, s editovateľnými šablónami, časťami a patterns.
Version: 0.2.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Text Domain: vyhrane-blocks
*/

:root {
	--vy-ink: #2d2b2c;
	--vy-muted: #6f696a;
	--vy-line: #e9e2dc;
	--vy-paper: #fffdf9;
	--vy-cream: #fbf5ec;
	--vy-sand: #ead7bb;
	--vy-blush: #efd0c8;
	--vy-sage: #dce8d7;
	--vy-yellow: #f3d36f;
	--vy-blue: #179dcc;
	--vy-blue-dark: #087ca6;
	--vy-purple: #a86fd1;
	--vy-purple-dark: #8354aa;
	--vy-white: #fff;
	--vy-radius-sm: 14px;
	--vy-radius: 22px;
	--vy-radius-lg: 34px;
	--vy-shadow-soft: 0 8px 30px rgba(45, 43, 44, .06);
	--vy-shadow: 0 16px 50px rgba(45, 43, 44, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; }
::selection { background: var(--vy-yellow); color: var(--vy-ink); }

.wp-site-blocks { overflow: clip; }
.wp-site-blocks > * { margin-block-start: 0; }

/* Shared helpers */
.vy-section { padding-block: clamp(3.5rem, 7vw, 7rem); }
.vy-section.is-tight { padding-block: clamp(2rem, 4vw, 4rem); }
.vy-kicker {
	margin: 0 0 .65rem;
	color: var(--vy-purple-dark);
	font-family: var(--wp--preset--font-family--rounded);
	font-size: .78rem;
	font-weight: 800;
	letter-spacing: .11em;
	text-transform: uppercase;
}
.vy-section-heading { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.vy-section-heading h1,
.vy-section-heading h2 { margin-top: 0; margin-bottom: .25em; }
.vy-section-heading--split {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 1.5rem;
}
.vy-text-link { font-weight: 800; text-decoration: none; white-space: nowrap; }

.wp-element-button,
.wp-block-button__link,
button,
input[type="submit"] {
	transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}
.wp-element-button:hover,
.wp-block-button__link:hover,
button:hover,
input[type="submit"]:hover { transform: translateY(-1px); }

/* Header */
.vy-site-header {
	position: relative;
	z-index: 30;
	background: color-mix(in srgb, var(--vy-paper) 94%, transparent);
	border-bottom: 1px solid var(--vy-line);
	backdrop-filter: blur(12px);
}
.vy-header-main { min-height: 86px; padding-block: .8rem; }
.vy-header-main .custom-logo { width: auto; max-height: 64px; }
.vy-header-actions { gap: .45rem; }
.vy-header-actions .wc-block-customer-account,
.vy-header-actions .wc-block-mini-cart { margin: 0; }
.vy-header-nav-row { padding-block: .7rem .8rem; border-top: 1px solid color-mix(in srgb, var(--vy-line) 65%, transparent); }
.vy-header-nav-row .wp-block-navigation { flex: 1 1 auto; }
.vy-header-nav-row .wp-block-search { width: min(300px, 26vw); }
.vy-header-nav-row .wp-block-search__inside-wrapper {
	border: 1px solid var(--vy-line);
	border-radius: 999px;
	background: var(--vy-white);
	padding: 3px 4px 3px 14px;
}
.vy-header-nav-row .wp-block-search__input { min-width: 0; border: 0; background: transparent; }
.vy-header-nav-row .wp-block-search__button { border-radius: 999px; margin: 0; }

/* Home hero */
.vy-home-hero { padding-block: clamp(3.2rem, 6vw, 6rem) clamp(2.7rem, 5vw, 5rem); }
.vy-home-hero__intro { max-width: 900px; margin-bottom: clamp(2.3rem, 5vw, 4.5rem); }
.vy-home-hero__intro h1 { margin: 0; font-size: clamp(2.65rem, 7vw, 5.8rem); max-width: 12ch; }
.vy-home-hero__intro > p:last-child { max-width: 690px; color: var(--vy-muted); font-size: clamp(1.05rem, 1rem + .35vw, 1.3rem); }

/* Dynamic category pattern */
.vy-category-grid {
	display: grid !important;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	grid-auto-rows: 180px;
	gap: clamp(12px, 2vw, 22px);
}
.vy-category-card {
	position: relative;
	isolation: isolate;
	grid-column: span 4;
	grid-row: span 2;
	min-height: 360px;
	margin: 0 !important;
	border-radius: var(--vy-radius-lg);
	overflow: hidden;
	background: var(--vy-cream);
	box-shadow: var(--vy-shadow-soft);
}
.vy-category-card.is-large { grid-column: span 8; grid-row: span 3; }
.vy-category-card.is-wide { grid-column: span 8; }
.vy-category-card.is-yellow { background: var(--vy-yellow); }
.vy-category-card.is-blush { background: var(--vy-blush); }
.vy-category-card.is-sand { background: var(--vy-sand); }
.vy-category-card.is-sage { background: var(--vy-sage); }
.vy-category-card.is-blue { background: #bde8f6; }
.vy-category-card.is-purple { background: #e3cef0; }
.vy-category-card__image {
	position: absolute;
	z-index: -1;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0 !important;
}
.vy-category-card__image a { display: block; width: 100%; height: 100%; }
.vy-category-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 450ms cubic-bezier(.2,.7,.2,1);
}
.vy-category-card::after {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0;
	background: linear-gradient(180deg, rgba(20,18,18,.02) 25%, rgba(20,18,18,.68) 100%);
	pointer-events: none;
}
.vy-category-card:not(:has(.vy-category-card__image))::after { background: linear-gradient(180deg, transparent 20%, rgba(45,43,44,.12)); }
.vy-category-card:hover .vy-category-card__image img { transform: scale(1.035); }
.vy-category-card__content {
	position: absolute;
	z-index: 3;
	inset: auto clamp(1.25rem, 2vw, 2rem) clamp(1.3rem, 2.2vw, 2rem);
	max-width: 36rem;
	margin: 0 !important;
	color: var(--vy-white);
	pointer-events: none;
}
.vy-category-card:not(:has(.vy-category-card__image)) .vy-category-card__content { color: var(--vy-ink); }
.vy-category-card__title { margin: 0 0 .25rem; font-size: clamp(1.45rem, 2.6vw, 2.4rem); }
.vy-category-card.is-large .vy-category-card__title { font-size: clamp(2rem, 4.2vw, 4rem); }
.vy-category-card__title a { color: inherit; pointer-events: auto; }
.vy-category-card__description { margin: 0; font-size: .98rem; opacity: .94; }
.vy-category-card__arrow {
	position: absolute;
	z-index: 4;
	right: 1.15rem;
	top: 1.15rem;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--vy-white) 88%, transparent);
	color: var(--vy-ink);
	font-size: 1.35rem;
	box-shadow: var(--vy-shadow-soft);
}

/* Product Collection */
.vy-products-section { background: var(--vy-cream); }
.vy-product-collection .wc-block-product,
.wc-block-product-template .wc-block-product {
	padding: 0;
	border: 0;
	background: transparent;
}
.vy-product-collection .wc-block-components-product-image img,
.wc-block-product-template .wc-block-components-product-image img {
	border-radius: var(--vy-radius);
	background: var(--vy-white);
	aspect-ratio: 1 / 1;
	object-fit: cover;
}
.vy-product-collection .wp-block-post-title,
.wc-block-product-template .wp-block-post-title {
	margin: .9rem 0 .25rem;
	font-size: clamp(1.05rem, 1rem + .2vw, 1.22rem);
}
.vy-product-collection .wc-block-components-product-price,
.wc-block-product-template .wc-block-components-product-price { font-weight: 800; }

/* Articles */
.vy-post-grid .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(1.25rem, 3vw, 2.25rem);
}
.vy-post-card {
	height: 100%;
	padding: clamp(1rem, 2vw, 1.4rem);
	border: 1px solid var(--vy-line);
	border-radius: var(--vy-radius);
	background: var(--vy-white);
	box-shadow: var(--vy-shadow-soft);
}
.vy-post-card .wp-block-post-featured-image { margin: 0 0 1.25rem; }
.vy-post-card .wp-block-post-featured-image img { aspect-ratio: 16/10; object-fit: cover; border-radius: calc(var(--vy-radius) - 7px); }
.vy-post-card .wp-block-post-title { font-size: clamp(1.35rem, 2vw, 1.85rem); }
.vy-post-card .wp-block-post-date { color: var(--vy-muted); font-size: .85rem; }

/* Senses */
.vy-senses-section { background: var(--vy-paper); }
.vy-senses-layout { align-items: stretch !important; gap: clamp(2rem, 5vw, 5rem) !important; }
.vy-senses-copy { display: flex; flex-direction: column; justify-content: center; }
.vy-senses-grid {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0,1fr));
	gap: 1rem;
	margin-top: 2rem !important;
}
.vy-sense-card {
	padding: 1.3rem;
	border-radius: var(--vy-radius);
	background: var(--vy-cream);
	border: 1px solid color-mix(in srgb, var(--vy-line) 70%, transparent);
}
.vy-sense-card:nth-child(2) { background: #f5e8f8; }
.vy-sense-card:nth-child(3) { background: #edf4e8; }
.vy-sense-card:nth-child(4) { background: #e5f5fb; }
.vy-sense-icon { margin: 0 0 .6rem; font-size: 2rem; line-height: 1; }
.vy-sense-card h3 { margin: 0 0 .3rem; font-size: 1.25rem; }
.vy-sense-card p:last-child { margin-bottom: 0; color: var(--vy-muted); font-size: .94rem; }
.vy-senses-visual { position: relative; min-height: 560px; margin: 0 !important; border-radius: var(--vy-radius-lg); overflow: hidden; background: linear-gradient(145deg,var(--vy-blush),var(--vy-yellow) 48%,var(--vy-sage)); }
.vy-senses-visual img { width: 100%; height: 100%; min-height: 560px; object-fit: cover; }
.vy-senses-visual::after { content:""; position:absolute; inset:0; box-shadow: inset 0 0 0 1px rgba(45,43,44,.05); pointer-events:none; }

/* Newsletter */
.vy-newsletter-section { padding-block: clamp(3rem,6vw,6rem); }
.vy-newsletter {
	padding: clamp(2rem, 5vw, 4rem);
	border-radius: var(--vy-radius-lg);
	background: var(--vy-ink);
	color: var(--vy-white);
	box-shadow: var(--vy-shadow);
}
.vy-newsletter .vy-kicker { color: var(--vy-yellow); }
.vy-newsletter h2 { max-width: 14ch; margin-bottom: .4em; }
.vy-newsletter p { color: color-mix(in srgb, var(--vy-white) 80%, transparent); }
.vy-newsletter .wp-block-shortcode { margin: 0; }
.vy-newsletter-placeholder {
	padding: 1rem 1.2rem;
	border: 1px dashed rgba(255,255,255,.45);
	border-radius: var(--vy-radius-sm);
	color: rgba(255,255,255,.82);
	font-size: .9rem;
}

/* Generic content */
.vy-main { min-height: 50vh; padding-block: clamp(3rem, 6vw, 6rem); }
.vy-page-header { margin-bottom: clamp(2rem,4vw,3.5rem); }
.vy-page-header .wp-block-post-title,
.vy-page-header .wp-block-query-title { font-size: clamp(2.5rem, 6vw, 5.1rem); }
.vy-article-meta { color: var(--vy-muted); font-size: .9rem; }
.vy-article-featured img { border-radius: var(--vy-radius-lg); }
.vy-content > * + * { margin-block-start: 1.35rem; }
.vy-content :where(img) { border-radius: var(--vy-radius); }

/* WooCommerce block surfaces. Avoid deep plugin-internal selectors on purpose. */
.woocommerce-page .wp-site-blocks main,
.single-product .wp-site-blocks main,
.post-type-archive-product .wp-site-blocks main,
.tax-product_cat .wp-site-blocks main { min-height: 50vh; }
.wc-block-grid__product-image img,
.wp-block-woocommerce-product-image img,
.wc-block-components-product-image img { border-radius: var(--vy-radius); }
.wc-block-cart,
.wc-block-checkout { margin-block: clamp(1.5rem,3vw,3rem); }
.wc-block-components-text-input input,
.wc-block-components-combobox .wc-block-components-combobox-control input,
.woocommerce input.input-text,
.woocommerce textarea,
.woocommerce select {
	border-radius: var(--vy-radius-sm) !important;
	border-color: var(--vy-line) !important;
}

/* Footer */
.vy-site-footer { margin-top: clamp(2rem,5vw,5rem); padding-block: clamp(3rem,6vw,5rem) 1.5rem; background: var(--vy-cream); border-top: 1px solid var(--vy-line); }
.vy-footer-grid { gap: clamp(2rem,4vw,4rem) !important; }
.vy-footer-brand .custom-logo { width: auto; max-height: 72px; }
.vy-footer-heading { margin-bottom: .8rem; font-size: 1rem; }
.vy-footer-links { display: flex; flex-direction: column; gap: .45rem; }
.vy-footer-links a { color: var(--vy-muted); }
.vy-footer-bottom { margin-top: 3rem !important; padding-top: 1.25rem; border-top: 1px solid var(--vy-line); color: var(--vy-muted); font-size: .82rem; }

/* Responsive */
@media (max-width: 980px) {
	.vy-header-nav-row { align-items: center !important; }
	.vy-header-nav-row .wp-block-search { display: none; }
	.vy-category-grid { grid-auto-rows: 160px; }
	.vy-category-card,
	.vy-category-card.is-large,
	.vy-category-card.is-wide { grid-column: span 6; grid-row: span 2; min-height: 320px; }
	.vy-category-card:first-child { grid-column: span 12; grid-row: span 3; }
	.vy-senses-layout { flex-direction: column; }
	.vy-senses-layout > .wp-block-column { flex-basis: 100% !important; }
	.vy-senses-visual,
	.vy-senses-visual img { min-height: 420px; }
}

@media (max-width: 700px) {
	.vy-header-main { min-height: 74px; }
	.vy-header-main .custom-logo { max-height: 52px; max-width: 190px; }
	.vy-header-nav-row { padding-block: .45rem .6rem; }
	.vy-header-nav-row .wp-block-navigation__responsive-container-open { display: flex; }
	.vy-section-heading--split { align-items: flex-start; flex-direction: column; }
	.vy-category-grid { display: grid !important; grid-template-columns: 1fr; grid-auto-rows: auto; }
	.vy-category-card,
	.vy-category-card.is-large,
	.vy-category-card.is-wide,
	.vy-category-card:first-child { grid-column: 1; grid-row: auto; min-height: 330px; }
	.vy-post-grid .wp-block-post-template { grid-template-columns: 1fr; }
	.vy-senses-grid { grid-template-columns: 1fr; }
	.vy-senses-visual,
	.vy-senses-visual img { min-height: 360px; }
	.vy-footer-grid { display: grid !important; grid-template-columns: 1fr 1fr; }
	.vy-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
	.vy-header-actions .wc-block-customer-account { display: none; }
	.vy-category-card,
	.vy-category-card.is-large,
	.vy-category-card.is-wide,
	.vy-category-card:first-child { min-height: 300px; }
	.vy-footer-grid { grid-template-columns: 1fr; }
	.vy-footer-brand { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
