/* ==========================================================================
   WE Coffee — Frontend Layout (wzorce blokowe / landing pages)
   Ładowany tylko na stronach z szablonem WE Coffee.
   ========================================================================== */

/* ---- Astra Overrides dla Szablonów ---- */
.page-template-template-home-php .ast-container,
.page-template-template-landing-php .ast-container {
	max-width: 100% !important;
	padding: 0 !important;
}

.page-template-template-home-php .site-content,
.page-template-template-landing-php .site-content {
	padding: 0 !important;
}

.page-template-template-home-php .ast-article-single,
.page-template-template-landing-php .ast-article-single {
	margin: 0 !important;
}

.page-template-template-home-php .entry-header,
.page-template-template-landing-php .entry-header {
	display: none !important;
}

/* ---- Layout wrapper ---- */

.wecoffee-layout {
	margin-inline: auto;
	max-width: 100%;
}

.wecoffee-layout--home .wecoffee-layout__content,
.wecoffee-layout--landing .wecoffee-layout__content,
.alignfull {
	width: 100vw !important;
	position: relative !important;
	left: 50% !important;
	right: 50% !important;
	margin-left: -50vw !important;
	margin-right: -50vw !important;
	max-width: 100vw !important;
}

.wecoffee-layout--content .wecoffee-layout__content,
.wecoffee-layout--content .wecoffee-page-heading {
	margin-inline: auto;
	max-width: min(100% - 2rem, var(--wecoffee-narrow-width, 48rem));
}

/* ---- Page heading ---- */

.wecoffee-page-heading {
	padding-block: var(--wecoffee-space-2xl) var(--wecoffee-space-xl);
}

.wecoffee-page-heading__title {
	margin: 0;
}

/* ---- Sekcje ---- */

.wecoffee-section {
	margin-block: 0;
	padding-block: var(--wecoffee-section-gap);
	padding-inline: max(1rem, calc((100vw - var(--wecoffee-content-width, 75rem)) / 2));
}

.wecoffee-section > :where(*) {
	margin-inline: auto;
	max-width: min(100% - 2rem, var(--wecoffee-content-width, 75rem));
}

/* The homepage's first section is a full-screen carousel hero, not a padded content section. */
body.home .wecoffee-layout__content > .wecoffee-section:first-child {
	padding-block: 0;
}

/* Alternating section backgrounds */
.wecoffee-section:nth-child(even) {
	background-color: var(--wecoffee-color-surface-alt);
}

/* ---- Section heading ---- */

.wecoffee-section-heading {
	display: grid;
	gap: var(--wecoffee-space-xs);
	margin-bottom: var(--wecoffee-space-xl);
	max-width: var(--wecoffee-narrow-width, 48rem);
}

.wecoffee-section-heading h2 {
	margin-bottom: 0;
}

.wecoffee-section-heading p {
	color: var(--wecoffee-color-text-muted);
	font-size: var(--wecoffee-text-body);
	max-width: 36rem;
}

/* ==========================================================================
   HERO
   ========================================================================== */

.wecoffee-hero.wp-block-cover {
	align-items: flex-end;
	min-height: clamp(32rem, 70vh, 44rem);
	padding: var(--wecoffee-space-2xl) max(1rem, calc((100vw - var(--wecoffee-content-width, 75rem)) / 2));
}

.wecoffee-hero:not(.wecoffee-hero--editorial) .wp-block-cover__background {
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.2) 0%,
		rgba(0, 0, 0, 0.65) 100%
	);
}

.wecoffee-hero__content {
	display: grid;
	gap: var(--wecoffee-space-md);
	margin: 0;
	max-width: 48rem;
}

.wecoffee-hero__eyebrow {
	font-family: var(--wecoffee-font-body);
	font-size: var(--wecoffee-text-caption);
	font-weight: 600;
	letter-spacing: 0.12em;
	margin: 0;
	text-transform: uppercase;
	color: var(--wecoffee-color-secondary);
}

.wecoffee-hero h1 {
	font-size: var(--wecoffee-text-hero);
	line-height: 0.95;
	letter-spacing: -0.02em;
	margin: 0;
	color: var(--wecoffee-color-white);
}

.wecoffee-hero .has-large-font-size {
	font-size: clamp(1rem, 1.5vw, 1.25rem);
	line-height: 1.5;
	max-width: 36rem;
	opacity: 0.9;
}

/* Hero buttons */
.wecoffee-hero .wp-block-buttons {
	margin-top: var(--wecoffee-space-sm);
}

.wecoffee-hero .wp-block-button__link {
	border-color: var(--wecoffee-color-white);
}

.wecoffee-hero .is-style-outline .wp-block-button__link {
	color: var(--wecoffee-color-white);
	border-color: rgba(255, 255, 255, 0.5);
	background: transparent;
}

.wecoffee-hero .is-style-outline .wp-block-button__link:hover {
	background: var(--wecoffee-color-white);
	color: var(--wecoffee-color-primary);
	border-color: var(--wecoffee-color-white);
}

/* ---- Full-screen editorial hero ---- */

.wecoffee-hero--editorial.wp-block-cover {
	align-items: stretch;
	background-color: var(--wecoffee-color-charcoal);
	min-height: 100svh;
	padding: 0;
}

.wecoffee-hero--editorial.wp-block-cover .wp-block-cover__image-background {
	transform: scale(1.06) !important;
	transform-origin: center;
	transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

.wecoffee-hero--editorial.wp-block-cover:hover .wp-block-cover__image-background {
	transform: scale(1) !important;
}

.wecoffee-hero--editorial .wp-block-cover__inner-container {
	align-self: stretch;
	display: flex;
	width: 100%;
}

.wecoffee-hero--editorial .wecoffee-hero__content {
	display: flex;
	flex-direction: column;
	height: 100%;
	justify-content: flex-end;
	max-width: none;
	padding:
		clamp(8.125rem, 17svh, 12.5rem)
		max(1.5rem, calc((100vw - var(--wecoffee-content-width, 75rem)) / 2))
		clamp(1.875rem, 5svh, 3.75rem);
	width: 100%;
}

.wecoffee-hero--editorial .wecoffee-hero__eyebrow {
	align-items: center;
	color: var(--wecoffee-color-cream);
	display: flex;
	gap: var(--wecoffee-space-sm);
	margin: 0 0 var(--wecoffee-space-lg);
}

.wecoffee-hero--editorial .wecoffee-hero__eyebrow::before {
	background: currentColor;
	content: '';
	height: 1px;
	width: 2.625rem;
}

.wecoffee-hero--editorial .wecoffee-hero__title {
	color: var(--wecoffee-color-white);
	font-family: var(--wecoffee-font-heading, 'Playfair Display', Georgia, 'Times New Roman', serif);
	font-size: var(--wecoffee-text-display);
	font-weight: 400;
	letter-spacing: -0.065em;
	line-height: 0.82;
	max-width: var(--wecoffee-content-width);
	text-wrap: balance;
}

.wecoffee-hero--editorial .wecoffee-hero__title em {
	display: inline-block;
	margin-left: clamp(0rem, 8vw, 8.125rem);
}

.wecoffee-hero--editorial .wecoffee-hero__bottom {
	align-items: end;
	border-top: 1px solid rgba(255, 255, 255, 0.28);
	display: grid;
	gap: var(--wecoffee-space-xl);
	grid-template-columns: minmax(0, 27.5rem) minmax(22rem, 34rem);
	margin-top: clamp(1.5rem, 4svh, 3.375rem);
	padding-top: var(--wecoffee-space-lg);
}

.wecoffee-hero--editorial .wecoffee-hero__description {
	color: var(--wecoffee-color-cream);
	font-size: clamp(0.875rem, 1.1vw, 1.0625rem);
	line-height: 1.55;
	margin: 0;
	max-width: 27.5rem;
}

.wecoffee-hero--editorial .wecoffee-hero__actions {
	display: grid;
	gap: var(--wecoffee-space-sm);
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0;
	width: 100%;
}

.wecoffee-hero--editorial .wecoffee-hero__actions .wp-block-button {
	margin: 0;
	width: 100%;
}

.wecoffee-hero--editorial .wp-block-button__link {
	border-color: var(--wecoffee-color-primary) !important;
	justify-content: space-between;
	min-height: 3.75rem;
	padding-inline: var(--wecoffee-space-lg);
	transition:
		background-color var(--wecoffee-transition),
		border-color var(--wecoffee-transition),
		color var(--wecoffee-transition),
		transform var(--wecoffee-transition);
	width: 100%;
}

.wecoffee-hero--editorial .wp-block-button__link:hover,
.wecoffee-hero--editorial .wp-block-button__link:focus-visible {
	background-color: transparent !important;
	border-color: var(--wecoffee-color-white) !important;
	color: var(--wecoffee-color-white) !important;
	transform: translateY(-3px);
}

.wecoffee-hero--editorial .wecoffee-hero__side-label {
	color: var(--wecoffee-color-cream);
	font-size: var(--wecoffee-text-caption);
	letter-spacing: 0.22em;
	margin: 0;
	position: absolute;
	right: var(--wecoffee-space-lg);
	top: 50%;
	transform: translateY(-50%) rotate(90deg);
	transform-origin: center;
	text-transform: uppercase;
}

@media (max-width: 900px) {
	.wecoffee-hero--editorial .wecoffee-hero__content {
		padding-inline: var(--wecoffee-space-lg);
	}

	.wecoffee-hero--editorial .wecoffee-hero__title {
		font-size: clamp(3.25rem, 13vw, 6.5rem);
		line-height: 0.9;
	}

	.wecoffee-hero--editorial .wecoffee-hero__title em {
		margin-left: 0;
	}

	.wecoffee-hero--editorial .wecoffee-hero__bottom {
		grid-template-columns: 1fr;
	}

	.wecoffee-hero--editorial .wecoffee-hero__side-label {
		display: none;
	}
}

@media (max-width: 640px) {
	.wecoffee-hero--editorial .wecoffee-hero__content {
		padding:
			max(6.25rem, 14svh)
			var(--wecoffee-space-md)
			var(--wecoffee-space-lg);
	}

	.wecoffee-hero--editorial .wecoffee-hero__eyebrow {
		margin-bottom: var(--wecoffee-space-md);
	}

	.wecoffee-hero--editorial .wecoffee-hero__eyebrow::before {
		width: 1.75rem;
	}

	.wecoffee-hero--editorial .wecoffee-hero__bottom {
		gap: var(--wecoffee-space-lg);
		margin-top: var(--wecoffee-space-lg);
		padding-top: var(--wecoffee-space-md);
	}

	.wecoffee-hero--editorial .wecoffee-hero__actions {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wecoffee-hero--editorial.wp-block-cover .wp-block-cover__image-background,
	.wecoffee-hero--editorial .wp-block-button__link {
		transition: none;
	}
}

/* ---- Hero facts bar ---- */

.wecoffee-hero-facts {
	border-bottom: 1px solid var(--wecoffee-color-border);
	padding: var(--wecoffee-space-sm) max(1rem, calc((100vw - var(--wecoffee-content-width, 75rem)) / 2));
	background-color: var(--wecoffee-color-surface);
}

.wecoffee-hero-facts .wp-block-columns {
	gap: var(--wecoffee-space-md);
	margin: 0;
}

.wecoffee-hero-facts .wp-block-column p {
	font-size: var(--wecoffee-text-small);
	margin: 0;
	text-align: center;
	color: var(--wecoffee-color-text-muted);
}

/* ==========================================================================
   CARDS (Benefits, Features, etc.)
   ========================================================================== */

.wecoffee-cards {
	gap: var(--wecoffee-space-lg);
}

.wecoffee-card {
	background-color: var(--wecoffee-color-surface);
	border: 1px solid var(--wecoffee-color-border);
	border-radius: var(--wecoffee-radius-lg);
	height: 100%;
	padding: var(--wecoffee-space-lg);
	transition: box-shadow var(--wecoffee-transition-slow);
}

.wecoffee-card:hover {
	box-shadow: var(--wecoffee-shadow-md);
}

.wecoffee-card > :first-child,
.wecoffee-media-placeholder > :first-child {
	margin-top: 0;
}

.wecoffee-card > :last-child,
.wecoffee-media-placeholder > :last-child {
	margin-bottom: 0;
}

/* ---- Media placeholder ---- */

.wecoffee-media-placeholder {
	align-items: center;
	background: var(--wecoffee-color-surface-alt);
	border: 1px dashed var(--wecoffee-color-border);
	border-radius: var(--wecoffee-radius-lg);
	display: flex;
	justify-content: center;
	min-height: 18rem;
	padding: var(--wecoffee-space-xl);
}

/* ==========================================================================
   PRODUCTS COLLECTION (Gutenberg block)
   ========================================================================== */

.wecoffee-products .wc-block-product-template {
	display: grid !important;
	grid-template-columns: repeat(2, 1fr) !important;
	gap: var(--wecoffee-space-xl) !important;
}

@media (min-width: 1024px) {
	.wecoffee-products .wc-block-product-template {
		grid-template-columns: repeat(4, 1fr) !important;
	}
}

.wecoffee-products .wc-block-product-template > * {
	max-width: 100% !important;
	width: 100% !important;
	flex: none !important;
	margin: 0 !important;
	background-color: var(--wecoffee-color-surface);
	border-radius: var(--wecoffee-radius-lg);
	overflow: hidden;
	transition: box-shadow var(--wecoffee-transition-slow);
	display: flex !important;
	flex-direction: column;
}

.wecoffee-products .wc-block-product-template > *:hover {
	box-shadow: var(--wecoffee-shadow-md);
}

/* Padding wewnętrzny — wszystkie elementy bloku Product Collection po obrazku */
.wecoffee-products .wc-block-product-template > * > *:not(.wc-block-product-image):not(.woocommerce-product-gallery) {
	padding-left: 1rem !important;
	padding-right: 1rem !important;
}

/* Tytuł */
.wecoffee-products h2.wc-block-components-product-title,
.wecoffee-products .wp-block-post-title {
	padding: 1rem 1rem 0.25rem !important;
	margin: 0 !important;
}

/* Cena */
.wecoffee-products .price,
.wecoffee-products .wc-block-components-product-price {
	padding: 0 1rem 0.75rem !important;
	margin: 0 !important;
}

/* Przycisk */
.wecoffee-products .wc-block-grid__product-add-to-cart,
.wecoffee-products .wc-block-components-product-button,
.wecoffee-products .wp-block-woocommerce-product-button {
	padding: 0 1rem 1rem !important;
	margin: 0 !important;
	margin-top: auto !important;
}

.wecoffee-products .wc-block-grid__product-add-to-cart .button,
.wecoffee-products .wc-block-components-product-button .button,
.wecoffee-products .wp-block-woocommerce-product-button a,
.wecoffee-products .wp-block-woocommerce-product-button button {
	width: 100% !important;
	margin: 0 !important;
}

.wecoffee-products .wc-block-components-product-sale-badge {
	background: var(--wecoffee-color-secondary);
	color: var(--wecoffee-color-white);
	border-radius: var(--wecoffee-radius-sm);
}

/* ==========================================================================
   FAQ
   ========================================================================== */

.wecoffee-faq__item {
	border-bottom: 1px solid var(--wecoffee-color-border);
	padding-block: var(--wecoffee-space-md);
}

.wecoffee-faq__item:first-child {
	border-top: 1px solid var(--wecoffee-color-border);
}

.wecoffee-faq__item summary {
	cursor: pointer;
	font-family: var(--wecoffee-font-heading);
	font-weight: 600;
	font-size: var(--wecoffee-text-h4);
	color: var(--wecoffee-color-primary);
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--wecoffee-space-md);
	padding: var(--wecoffee-space-xs) 0;
}

.wecoffee-faq__item summary::-webkit-details-marker {
	display: none;
}

.wecoffee-faq__item summary::after {
	content: '+';
	font-family: var(--wecoffee-font-body);
	font-size: 1.25rem;
	font-weight: 300;
	flex-shrink: 0;
	transition: transform var(--wecoffee-transition);
	color: var(--wecoffee-color-text-muted);
}

.wecoffee-faq__item[open] summary::after {
	content: '−';
}

.wecoffee-faq__item > :not(summary) {
	padding-top: var(--wecoffee-space-xs);
	color: var(--wecoffee-color-text);
	line-height: 1.6;
}

/* ==========================================================================
   FOCUS & ACCESSIBILITY
   ========================================================================== */

.wecoffee-layout :is(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wecoffee-color-secondary);
	outline-offset: 3px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
	.wecoffee-section {
		padding-inline: var(--wecoffee-space-md);
	}

	.wecoffee-media-placeholder {
		min-height: 12rem;
	}

	.wecoffee-hero-facts .wp-block-column p {
		text-align: left;
	}
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

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