/*
Theme Name: eKilts
Theme URI: https://example.com/ekilts
Author: eKilts
Author URI: https://example.com
Description: A heritage-styled block theme (Full Site Editing) for Highland dress and kiltmaking, built for WooCommerce. Colors, type, and spacing live in theme.json and are fully editable in the Site Editor; this stylesheet covers what block markup alone can't express — sticky header, media-slot placeholders, product-card layout, and section rhythm.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ekilts
Tags: block-theme, full-site-editing, e-commerce, custom-logo, editor-style, footer-widgets

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

/* -------------------------------------------------------------------------
   0. Base
------------------------------------------------------------------------- */
/* Root cause of the width+padding overflow bugs found in testing: several
   rules below combine width:100% (or max-width) with horizontal padding.
   Without border-box, padding is added on top of that width instead of
   being subtracted from it, overflowing the parent by exactly the padding
   amount. This reset makes width/max-width include padding and border
   everywhere, which is what every such rule in this file assumes. */
*, *::before, *::after {
	box-sizing: border-box;
}

/* Root-only, not body: setting overflow-x on body too would implicitly
   turn its overflow-y into its own scroll container (per the CSS overflow
   spec's paired-axis rule), which breaks position:sticky on the header. */
html {
	overflow-x: hidden;
}
body {
	max-width: 100vw;
}
.ek-skip-link {
	position: absolute;
	top: -100px;
	left: 0;
	z-index: 999999;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--cream);
	padding: 14px 20px;
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-weight: 700;
	text-decoration: none;
}
.ek-skip-link:focus {
	top: 0;
}

a {
	transition: color .15s ease;
}

/* -------------------------------------------------------------------------
   0b. Layout safety net
   Every flex/grid container below is driven entirely by these rules, not
   by WordPress's block-supports-generated layout CSS (the "layout":{...}
   JSON attributes on Group/Columns blocks). That generated CSS isn't
   reliably present for hand-authored template/pattern files, so nothing
   here depends on it — these rules are self-sufficient regardless of
   whether WordPress's own layout styles also load.
------------------------------------------------------------------------- */

/* Columns block: force flex row + wrap, don't rely on core CSS alone. */
.ek-usps-grid,
.ek-promo-tiles-grid,
.ek-footer-columns,
.ek-shop-columns,
.ek-product-layout,
.ek-spotlight-grid,
.ek-builder-teaser-grid {
	display: flex !important;
	flex-wrap: wrap !important;
}
.ek-usps-grid > .wp-block-column,
.ek-promo-tiles-grid > .wp-block-column,
.ek-footer-columns > .wp-block-column,
.ek-shop-columns > .wp-block-column,
.ek-product-layout > .wp-block-column,
.ek-spotlight-grid > .wp-block-column,
.ek-builder-teaser-grid > .wp-block-column {
	flex: 1 1 0%;
	min-width: 0;
}
/* .ek-builder-teaser has a full-bleed dark background (see below); this
   grid is its only child, so it alone needs the max-width constraint. */
.ek-builder-teaser-grid {
	max-width: var(--wp--style--global--wide-size);
	margin-left: auto;
	margin-right: auto;
	padding-left: clamp(20px, 4vw, 40px);
	padding-right: clamp(20px, 4vw, 40px);
	box-sizing: border-box;
}

/* Category tiles: a fixed 5-column grid handles gap math correctly,
   where an even flex-basis percentage would overflow once gaps are
   added (5 * 20% + 4 gaps > 100%, forcing the 5th tile to wrap alone). */
.ek-category-tiles-grid {
	display: grid !important;
}

/* Section width: same reasoning as the flex/grid rules above -- don't
   trust the "constrained" layout attribute to reliably produce max-width
   + centering. These sections sit on the plain cream background, so a
   simple constrained wrapper is all they need (sections with their own
   full-bleed background color have a separate inner wrapper instead --
   see .ek-newsletter-inner, .ek-footer-columns, .ek-builder-teaser-grid,
   .ek-get-featured-grid, and the hero/trust-strip rules further down).
   .ek-hero is deliberately not here -- it's full-bleed, see below.
   .ek-statement is deliberately not here -- it's a narrow reading-width
   block, see below. */
.ek-usps,
.ek-promo-tiles,
.ek-category-tiles,
.ek-product-section,
.ek-spotlight,
.ek-social-proof,
.ek-journal {
	max-width: var(--wp--style--global--wide-size);
	margin-left: auto;
	margin-right: auto;
	padding-left: clamp(20px, 4vw, 40px);
	padding-right: clamp(20px, 4vw, 40px);
	box-sizing: border-box;
}

/* Founding / heritage statements: short centered text, narrower than the
   site's default wide section -- not the same treatment as the grid/tile
   sections above. */
.ek-statement {
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
	padding-left: clamp(20px, 4vw, 40px);
	padding-right: clamp(20px, 4vw, 40px);
	box-sizing: border-box;
}

/* Trust strip: full-bleed background (like the announcement bar), plain
   centered flex content -- no inner max-width wrapper needed since
   centered text/flex items don't stretch to the section's own edges. */
.ek-trust-strip {
	max-width: none;
}

/* <main> wrapper used by every non-front-page template (blog, page, 404,
   search, shop, single product) -- same explicit-width reasoning. */
.ek-main {
	max-width: var(--wp--style--global--wide-size);
	margin-left: auto;
	margin-right: auto;
	padding-left: clamp(20px, 4vw, 40px);
	padding-right: clamp(20px, 4vw, 40px);
	box-sizing: border-box;
}

/* Header rows */
.ek-announcement,
.ek-header-row--top,
.ek-header-row--nav,
.ek-header-side,
.ek-header-brand {
	display: flex !important;
	align-items: center;
}
.ek-announcement { justify-content: center; flex-wrap: wrap; }
.ek-announcement-text { min-width: 0; }
.ek-header-row--top { justify-content: space-between; flex-wrap: nowrap; gap: 16px; }
.ek-header-row--nav { justify-content: center; }
.ek-header-row--nav > * { min-width: 0; }
.ek-header-side { flex: 1; gap: 18px; min-width: 0; }
.ek-header-brand { flex: 0 0 auto; justify-content: center; }
.ek-header-side--end { justify-content: flex-end; }

/* Trust strip */
.ek-trust-strip {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
}

/* Section heading + "View all" rows */
.ek-product-section-head {
	display: flex !important;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}

/* Product / journal cards: vertical stack with real gap regardless of blockGap support */
.ek-product-card,
.ek-journal-card {
	display: flex !important;
	flex-direction: column;
}
.ek-product-card > *,
.ek-journal-card > * {
	margin-top: var(--wp--preset--spacing--10);
}
.ek-product-card > *:first-child,
.ek-journal-card > *:first-child {
	margin-top: 0;
}

/* Newsletter + footer bottom rows */
.ek-newsletter-inner,
.ek-footer-bottom {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
}

/* Grid galleries (social proof / get featured) */
.ek-social-proof-grid,
.ek-get-featured-grid {
	display: grid !important;
}

/* Shop toolbar */
.ek-shop-toolbar {
	display: flex !important;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

/* Post meta row */
.ek-post-meta {
	display: flex !important;
	align-items: center;
}

/*
 * Media-slot tiles with an overlaid, bottom-aligned caption (promo tiles,
 * category tiles, the new-arrivals spotlight image). These need a fixed
 * height, a flex column that pins the caption to the bottom, and the
 * caption's background handled as a gradient overlay — all set directly
 * here rather than trusting the "verticalAlignment" block attribute.
 */
.ek-promo-tile,
.ek-category-tile,
.ek-spotlight-media {
	display: flex !important;
	flex-direction: column !important;
	justify-content: flex-end !important;
	position: relative;
}

/* -------------------------------------------------------------------------
   1. Announcement bar + header
------------------------------------------------------------------------- */
.ek-announcement {
	background: var(--wp--preset--color--green-dark);
	color: var(--wp--preset--color--cream);
	min-height: 38px;
	padding: 8px 20px;
}
.ek-announcement-text {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: .12em;
	text-transform: uppercase;
	margin: 0;
	text-align: center;
}

.ek-site-header {
	position: sticky;
	top: 0;
	z-index: 500;
	background: var(--wp--preset--color--cream);
	border-bottom: 1px solid var(--wp--preset--color--border);
	max-width: none !important;
	padding-left: 0;
	padding-right: 0;
}
.ek-header-row {
	max-width: var(--wp--style--global--wide-size);
	margin: 0 auto;
	padding: 14px clamp(20px, 4vw, 40px);
	width: 100%;
}
.ek-header-row--top {
	gap: 16px;
}
.ek-header-side {
	flex: 1;
	gap: 18px;
}
.ek-header-side--end {
	justify-content: flex-end;
}
.ek-header-brand {
	flex: 0 0 auto;
}
.ek-site-title a {
	font-family: var(--wp--preset--font-family--cinzel);
	font-size: 1.6rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
}
.ek-header-icon-link {
	color: var(--wp--preset--color--ink);
}
.ek-header-row--nav {
	padding-top: 0;
	padding-bottom: 14px;
	border-top: 1px solid var(--wp--preset--color--border);
	padding-top: 12px;
}

.ek-primary-nav {
	flex-wrap: wrap !important;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}
.ek-primary-nav .wp-block-navigation-item > a,
.ek-primary-nav .wp-block-navigation-submenu > .wp-block-navigation-item__content {
	padding: 6px 4px;
	color: var(--wp--preset--color--ink);
}
.ek-primary-nav .wp-block-navigation-item > a:hover,
.ek-primary-nav .wp-block-navigation-submenu > .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--burgundy);
}
.ek-primary-nav .wp-block-navigation__submenu-container {
	background: var(--wp--preset--color--cream);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0;
	padding: 8px 0;
}
.ek-primary-nav .wp-block-navigation__submenu-container a {
	padding: 10px 20px;
}

/* Search block, icon-only toggle mode */
.ek-header-search .wp-block-search__button {
	background: none;
	border: none;
	color: var(--wp--preset--color--ink);
	padding: 4px;
}
.ek-header-search .wp-block-search__button svg {
	fill: currentColor;
}

/* WooCommerce header blocks (Mini Cart / Customer Account) */
.wc-block-mini-cart__button,
.wp-block-woocommerce-customer-account a {
	color: var(--wp--preset--color--ink) !important;
}
.wc-block-mini-cart__badge {
	background: var(--wp--preset--color--burgundy) !important;
}

/* -------------------------------------------------------------------------
   2. Section rhythm + shared components
------------------------------------------------------------------------- */
.ek-usps,
.ek-statement,
.ek-promo-tiles,
.ek-category-tiles,
.ek-product-section,
.ek-builder-teaser,
.ek-spotlight,
.ek-social-proof,
.ek-journal,
.ek-get-featured {
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: 0;
}

.ek-eyebrow {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: .28em;
	text-transform: uppercase;
	color: var(--wp--preset--color--burgundy);
	margin: 0 0 .5em;
}

.ek-media-slot {
	background: var(--wp--preset--color--cream-2);
	background-image: repeating-linear-gradient(45deg, rgba(33,28,21,.04) 0, rgba(33,28,21,.04) 1px, transparent 1px, transparent 14px);
	position: relative;
	overflow: hidden;
}
.ek-media-slot-label {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--stone);
	text-align: center;
	/* Positioned independently of the parent's flex/flow state so it
	   always centers over the placeholder box, whether or not the parent
	   Group's own layout attributes render correctly. */
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 320px;
	margin: 0 auto;
	padding: 20px;
}

/* The hero's overlaid copy block is much taller than other media-slot
   captions (headline + paragraph + buttons), so a dead-centered label
   would sit directly behind it. Anchor it to the top edge instead --
   purely a placeholder concern, since this label is gone the moment a
   real photo replaces the block. */
.ek-hero-media .ek-media-slot-label {
	align-items: flex-start;
	padding-top: var(--wp--preset--spacing--30);
}

.ek-view-all a {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--burgundy);
	text-decoration: none;
}

/* -------------------------------------------------------------------------
   3. Hero -- full-bleed, image behind an overlaid, left-aligned copy block
------------------------------------------------------------------------- */
.ek-hero {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 640px;
	overflow: hidden;
	/* Deliberately no max-width/padding here -- unlike every other section,
	   this one is meant to bleed to the browser edges. */
}
.ek-hero-media {
	position: absolute;
	inset: 0;
	z-index: 0;
}
/* Dark gradient so the overlaid text stays legible against any photo,
   heavier on the left where the copy sits. */
.ek-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(90deg, rgba(18,25,20,.88) 0%, rgba(18,25,20,.6) 45%, rgba(18,25,20,.1) 75%);
	pointer-events: none;
}
.ek-hero-inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: var(--wp--style--global--wide-size);
	margin: 0 auto;
	padding: var(--wp--preset--spacing--60) clamp(20px, 4vw, 40px);
	box-sizing: border-box;
}
.ek-hero-copy {
	max-width: 620px;
	color: var(--wp--preset--color--cream);
}
.ek-hero-copy .ek-eyebrow {
	color: var(--wp--preset--color--gold);
}
.ek-hero-copy h1 {
	color: var(--wp--preset--color--cream);
}
.ek-hero-copy .wp-block-buttons {
	margin-top: var(--wp--preset--spacing--20);
}
.ek-hero-lede {
	color: rgba(246, 241, 228, .82);
}

/* -------------------------------------------------------------------------
   4. Trust strip
------------------------------------------------------------------------- */
.ek-trust-strip {
	background: var(--wp--preset--color--cream-2);
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	gap: var(--wp--preset--spacing--30);
}
.ek-trust-item,
.ek-trust-sep {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: .04em;
	margin: 0;
}
.ek-trust-sep {
	opacity: .4;
}

/* -------------------------------------------------------------------------
   5. Founding / heritage statements
------------------------------------------------------------------------- */
.ek-statement {
	text-align: center;
	padding-bottom: var(--wp--preset--spacing--20);
}
.ek-statement p {
	color: var(--wp--preset--color--stone);
}

/* -------------------------------------------------------------------------
   6. USP icon row
------------------------------------------------------------------------- */
.ek-usps-grid {
	gap: var(--wp--preset--spacing--40);
}
.ek-usp {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--10);
}
.ek-usp-icon {
	width: 40px;
	height: 40px;
	color: var(--wp--preset--color--green);
}
.ek-usp-label {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	margin: 0;
}

/* -------------------------------------------------------------------------
   7. Promo tiles / category tiles / clickable cards
------------------------------------------------------------------------- */
.ek-clickable-card {
	cursor: pointer;
}

.ek-promo-tile,
.ek-category-tile {
	color: var(--wp--preset--color--white);
}
.ek-promo-tile::after,
.ek-category-tile::after,
.ek-spotlight-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(18,37,28,0) 40%, rgba(18,37,28,.82) 100%);
	pointer-events: none;
}
.ek-promo-tile-caption,
.ek-category-tile-name,
.ek-spotlight-caption {
	position: relative;
	z-index: 2;
	width: 100%;
	padding: var(--wp--preset--spacing--30);
}
.ek-promo-tile-caption h3,
.ek-spotlight-caption h3 {
	color: var(--wp--preset--color--white);
	margin: 0 0 .35em;
}
.ek-promo-tile-cta a {
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-decoration: none;
}
.ek-category-tile-name {
	margin: 0;
	text-align: center;
}
.ek-category-tile-name a {
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--cinzel);
	font-size: var(--wp--preset--font-size--large);
	text-transform: uppercase;
	text-decoration: none;
}
.ek-category-tiles-grid {
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--20);
}

/* -------------------------------------------------------------------------
   8. Product cards (shared by all Product Collection sections)
------------------------------------------------------------------------- */
.ek-product-section-head {
	border-bottom: 2px solid var(--wp--preset--color--ink);
	padding-bottom: var(--wp--preset--spacing--20);
	margin-bottom: var(--wp--preset--spacing--30);
}
.ek-product-section-head h2 {
	margin: 0;
}

.ek-product-collection .wc-block-product-collection__responsive-grid,
.wp-block-woocommerce-product-collection ul.wc-block-product-template {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--30);
	list-style: none;
	margin: 0;
	padding: 0;
}
.ek-product-collection--compact .wc-block-product-template,
.ek-product-collection--compact ul.wc-block-product-template {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--20);
}
.ek-shop-grid .wc-block-product-template,
.ek-shop-grid ul.wc-block-product-template {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ek-product-card {
	gap: var(--wp--preset--spacing--10);
}
.ek-product-card-media {
	position: relative;
	background: var(--wp--preset--color--cream-2);
	aspect-ratio: 3 / 4;
	overflow: hidden;
	width: 100%;
}
/*
 * The Product Image block nests the <img> two levels deep
 * (.wp-block-woocommerce-product-image > a > img), and neither of those
 * WooCommerce-rendered wrappers has an explicit height. A percentage
 * height only resolves against an ancestor with a definite height, so
 * `height: 100%` on the img alone is silently ignored -- the browser
 * falls back to the image's own intrinsic aspect ratio, which is why
 * product photos were rendering far shorter than this card's aspect-ratio
 * box (filling its width but leaving a gap of bare background below).
 * Restoring an explicit height down the chain fixes that. The img rule
 * also needs !important: WooCommerce Blocks ships its own default
 * `width: auto; height: auto` for this image at equal selector
 * specificity, and depending on enqueue order that can win the cascade.
 */
.ek-product-card-media .wp-block-woocommerce-product-image,
.ek-product-card-media .wp-block-woocommerce-product-image > a {
	display: block;
	height: 100%;
}
.ek-product-card-media img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
}
.ek-product-card .wc-block-components-product-sale-badge,
.ek-product-card .wp-block-woocommerce-product-sale-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	background: var(--wp--preset--color--burgundy) !important;
	color: var(--wp--preset--color--white) !important;
	border-radius: 0 !important;
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	padding: 5px 10px;
}
.ek-product-card .wp-block-woocommerce-product-title,
.ek-product-card h3,
.ek-product-card p.wc-block-components-product-title {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	margin: 0;
}
.ek-product-card .wc-block-components-product-price,
.ek-product-card .price {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--medium);
}
.ek-product-card .wc-block-components-product-rating {
	color: var(--wp--preset--color--burgundy);
}
.ek-product-card-button.wp-block-button .wp-block-button__link,
.ek-product-card-button .wc-block-components-product-button__button {
	width: 100%;
	text-align: center;
	background: transparent !important;
	color: var(--wp--preset--color--ink) !important;
	border: 1.5px solid var(--wp--preset--color--ink) !important;
	font-size: var(--wp--preset--font-size--x-small);
	padding: .7em 1em;
}
.ek-product-card-button.wp-block-button .wp-block-button__link:hover,
.ek-product-card-button .wc-block-components-product-button__button:hover {
	background: var(--wp--preset--color--ink) !important;
	color: var(--wp--preset--color--cream) !important;
}

/* -------------------------------------------------------------------------
   9. Kilt builder teaser (dark section)
------------------------------------------------------------------------- */
.ek-builder-teaser {
	background: var(--wp--preset--color--green-dark);
	color: var(--wp--preset--color--cream);
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--60);
	margin-top: var(--wp--preset--spacing--60);
}
.ek-builder-teaser h2,
.ek-builder-teaser p,
.ek-builder-teaser li {
	color: var(--wp--preset--color--cream);
}
.ek-builder-teaser .ek-eyebrow {
	color: var(--wp--preset--color--gold);
}
.ek-builder-teaser-list li {
	border-bottom: 1px solid rgba(246,241,228,.18);
	padding: .5em 0;
}
.ek-builder-teaser-media {
	background: rgba(246,241,228,.06);
}
.ek-builder-teaser-media .ek-media-slot-label {
	color: rgba(246,241,228,.7);
}
.is-style-outline-light .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--cream);
	border: 1.5px solid rgba(246,241,228,.5);
}
.is-style-outline-light .wp-block-button__link:hover {
	background: rgba(246,241,228,.1);
	border-color: var(--wp--preset--color--cream);
}
.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--ink);
	border: 1.5px solid var(--wp--preset--color--ink);
}
.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--cream);
}

/* -------------------------------------------------------------------------
   10. New arrivals spotlight
------------------------------------------------------------------------- */
.ek-spotlight-media {
	min-height: 480px;
}
.ek-spotlight-caption {
	margin-top: auto;
}
.ek-spotlight-caption .wp-block-button__link {
	background: var(--wp--preset--color--burgundy);
}

/* -------------------------------------------------------------------------
   11. Social proof / get featured grids
------------------------------------------------------------------------- */
.ek-social-proof,
.ek-get-featured {
	text-align: center;
}
.ek-social-proof-sub,
.ek-get-featured-sub {
	color: var(--wp--preset--color--stone);
	max-width: 560px;
	margin: 0 auto var(--wp--preset--spacing--30);
}
.ek-social-proof-grid,
.ek-get-featured-grid {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--10);
}
/* .ek-get-featured has a full-bleed dark background (see below); its
   heading/subtext/grid need their own max-width since the section itself
   is intentionally not constrained. */
.ek-get-featured h2,
.ek-get-featured-sub,
.ek-get-featured-grid {
	max-width: var(--wp--style--global--wide-size);
	margin-left: auto;
	margin-right: auto;
}
.ek-get-featured h2,
.ek-get-featured-sub,
.ek-get-featured-grid {
	padding-left: clamp(20px, 4vw, 40px);
	padding-right: clamp(20px, 4vw, 40px);
	box-sizing: border-box;
}
.ek-social-proof-tile {
	aspect-ratio: 1 / 1;
}
.ek-get-featured {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--cream);
	margin-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--60);
}
.ek-get-featured h2,
.ek-get-featured-sub {
	color: var(--wp--preset--color--cream);
}
.ek-get-featured-tile {
	aspect-ratio: 3 / 4;
	background: rgba(246,241,228,.06);
	display: flex !important;
	flex-direction: column !important;
	justify-content: flex-end !important;
	position: relative;
}
.ek-get-featured-handle {
	position: relative;
	z-index: 2;
	margin: 0 0 12px;
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	color: var(--wp--preset--color--cream);
}

/* -------------------------------------------------------------------------
   12. Journal / blog cards
------------------------------------------------------------------------- */
.ek-journal {
	padding-bottom: var(--wp--preset--spacing--60);
}
.ek-journal-grid,
.ek-blog-query .wp-block-post-template,
.ek-search-query .wp-block-post-template {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--30);
	list-style: none;
	padding: 0;
}
.ek-journal-card {
	gap: var(--wp--preset--spacing--10);
}
.ek-journal-card-media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--wp--preset--color--cream-2);
}
/* Same broken percentage-height chain as .ek-product-card-media above:
   isLink wraps the Post Featured Image block's <img> in a
   .wp-block-post-featured-image figure and an <a>, neither of which has
   an explicit height, so `height: 100%` on the img never resolved. */
.ek-journal-card-media .wp-block-post-featured-image,
.ek-journal-card-media .wp-block-post-featured-image > a {
	display: block;
	height: 100%;
}
.ek-journal-card-media img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
}
.ek-journal-card-date {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--stone);
}
.ek-pagination {
	justify-content: center;
	gap: var(--wp--preset--spacing--10);
	margin-top: var(--wp--preset--spacing--40);
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-weight: 700;
}

/* -------------------------------------------------------------------------
   13. Newsletter + footer
------------------------------------------------------------------------- */
.ek-newsletter {
	background: var(--wp--preset--color--burgundy);
	color: var(--wp--preset--color--white);
	max-width: none !important;
	padding-left: 0;
	padding-right: 0;
}
.ek-newsletter-inner {
	max-width: var(--wp--style--global--wide-size);
	margin: 0 auto;
	padding: var(--wp--preset--spacing--50) clamp(20px, 4vw, 40px);
	gap: var(--wp--preset--spacing--40);
}
.ek-newsletter h3,
.ek-newsletter p {
	color: var(--wp--preset--color--white);
	margin: 0;
}
.ek-newsletter-copy p {
	margin-top: .4em;
	opacity: .9;
}
.ekilts-newsletter-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
}
.ekilts-newsletter-form input[type="email"] {
	background: var(--wp--preset--color--white);
	border: none;
	padding: 16px 18px;
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--medium);
	min-width: 280px;
}
.ekilts-newsletter-form button {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
	border: none;
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	font-size: var(--wp--preset--font-size--small);
	padding: 16px 26px;
	cursor: pointer;
}
.ekilts-newsletter-form button:hover {
	background: var(--wp--preset--color--green-dark);
}
.ekilts-newsletter-msg {
	flex-basis: 100%;
	font-size: var(--wp--preset--font-size--x-small);
	margin-top: 8px;
}

.ek-site-footer {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--stone);
	max-width: none !important;
	padding-left: 0;
	padding-right: 0;
	padding-top: var(--wp--preset--spacing--60);
}
.ek-footer-columns {
	max-width: var(--wp--style--global--wide-size);
	margin: 0 auto;
	padding: 0 clamp(20px, 4vw, 40px);
	gap: var(--wp--preset--spacing--40);
}
.ek-footer-columns h6 {
	color: var(--wp--preset--color--cream);
	margin-bottom: .75em;
}
.ek-footer-columns a {
	color: var(--wp--preset--color--stone);
	text-decoration: none;
	font-size: var(--wp--preset--font-size--small);
}
.ek-footer-columns a:hover {
	color: var(--wp--preset--color--cream);
}
.ek-footer-columns li {
	margin-bottom: .6em;
}
.ek-footer-brand-col p {
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--small);
}
.ek-footer-title a {
	color: var(--wp--preset--color--cream) !important;
	font-family: var(--wp--preset--font-family--cinzel);
	text-decoration: none;
}
.ek-footer-social .wp-social-link a {
	background: transparent;
}
.ek-footer-social .wp-social-link svg {
	fill: var(--wp--preset--color--cream);
}
.ek-footer-rule {
	max-width: var(--wp--style--global--wide-size);
	margin: var(--wp--preset--spacing--40) auto 0;
	border-color: rgba(246,241,228,.14);
}
.ek-footer-bottom {
	max-width: var(--wp--style--global--wide-size);
	margin: 0 auto;
	padding: var(--wp--preset--spacing--20) clamp(20px, 4vw, 40px) var(--wp--preset--spacing--40);
}
.ek-footer-copyright,
.ek-footer-legal {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: .04em;
	margin: 0;
}
.ek-footer-legal a {
	color: var(--wp--preset--color--stone);
}

/* -------------------------------------------------------------------------
   14. Generic page / blog / 404 / search
------------------------------------------------------------------------- */
.ek-page-header {
	text-align: center;
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--20);
}
.ek-page-header-sub {
	color: var(--wp--preset--color--stone);
}
.ek-post-meta {
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--small);
	gap: var(--wp--preset--spacing--10);
	margin-top: var(--wp--preset--spacing--50);
}
.ek-post-featured-image {
	margin: var(--wp--preset--spacing--30) 0;
	aspect-ratio: 16 / 8;
	overflow: hidden;
}
.ek-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.ek-404 {
	text-align: center;
	padding-top: var(--wp--preset--spacing--70);
	padding-bottom: var(--wp--preset--spacing--70);
}
.ek-404 .wp-block-search {
	max-width: 420px;
	margin: var(--wp--preset--spacing--40) auto 0;
}

/* -------------------------------------------------------------------------
   15. Shop archive
------------------------------------------------------------------------- */
.ek-shop-header {
	background: var(--wp--preset--color--cream-2);
	border-bottom: 1px solid var(--wp--preset--color--border);
	max-width: none !important;
	padding: var(--wp--preset--spacing--50) clamp(20px, 4vw, 40px) var(--wp--preset--spacing--40);
}
.ek-shop-header .wp-block-woocommerce-breadcrumbs {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--stone);
}
.ek-shop-columns {
	gap: var(--wp--preset--spacing--50);
	align-items: flex-start;
}
.ek-shop-sidebar {
	position: sticky;
	top: 140px;
}
.ek-shop-sidebar h6 {
	border-bottom: 1.5px solid var(--wp--preset--color--ink);
	padding-bottom: .5em;
}
.ek-sidebar-hint {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--stone);
}
.ek-shop-toolbar {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding-bottom: var(--wp--preset--spacing--20);
	margin-bottom: var(--wp--preset--spacing--30);
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: .08em;
}

/* -------------------------------------------------------------------------
   16. Single product
------------------------------------------------------------------------- */
.ek-product-page {
	padding-top: var(--wp--preset--spacing--30);
	padding-bottom: var(--wp--preset--spacing--60);
}
.ek-breadcrumb {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--stone);
	display: block;
	margin-bottom: var(--wp--preset--spacing--30);
}
.ek-product-layout {
	gap: var(--wp--preset--spacing--50);
}
.ek-product-gallery-col .wc-block-product-gallery {
	background: var(--wp--preset--color--cream-2);
}
.ek-product-summary-col {
	position: sticky;
	top: 140px;
}
.ek-product-summary-meta {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--burgundy);
	margin-bottom: var(--wp--preset--spacing--10);
}
.ek-product-title {
	margin: 0 0 .3em;
}
.ek-product-summary-rating {
	margin-bottom: var(--wp--preset--spacing--10);
}
.ek-product-summary-price {
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	margin-bottom: var(--wp--preset--spacing--20);
}
.ek-product-summary-excerpt {
	color: var(--wp--preset--color--stone);
	margin-bottom: var(--wp--preset--spacing--30);
}
.ek-add-to-cart-form .single_add_to_cart_button,
.ek-add-to-cart-form button[type="submit"] {
	width: 100%;
	background: var(--wp--preset--color--burgundy) !important;
	color: var(--wp--preset--color--white) !important;
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	padding: 1.1em !important;
	border: none !important;
}
.ek-add-to-cart-form .single_add_to_cart_button:hover,
.ek-add-to-cart-form button[type="submit"]:hover {
	background: var(--wp--preset--color--burgundy-dark) !important;
}

.ek-product-accordion {
	margin-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--border);
}
.ek-accordion-item {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: var(--wp--preset--spacing--20) 0;
}
.ek-accordion-item summary {
	font-family: var(--wp--preset--font-family--source-sans-3);
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	font-size: var(--wp--preset--font-size--small);
	cursor: pointer;
}
.ek-accordion-item[open] summary {
	margin-bottom: var(--wp--preset--spacing--10);
}
.ek-accordion-item p {
	color: var(--wp--preset--color--stone);
}

.ek-related-products {
	margin-top: var(--wp--preset--spacing--70);
	padding-top: var(--wp--preset--spacing--60);
	border-top: 1px solid var(--wp--preset--color--border);
}
.ek-related-products h2 {
	margin-bottom: var(--wp--preset--spacing--30);
}

.ek-product-reviews {
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
	margin-top: var(--wp--preset--spacing--60);
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--60);
	border-top: 1px solid var(--wp--preset--color--border);
}

/* Narrow reading-width content (blog post body, static pages, comments) --
   nested inside .ek-main (1400px), so needs its own explicit width rather
   than inheriting the section-level wide constraint. */
.ek-article {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}

/* 404 page: narrower centered column than the site's default 1400px main. */
.ek-main.ek-404 {
	max-width: 640px;
}

/* "Page (Full Width)" custom template: intentionally edge-to-edge, so it
   opts out of the .ek-main constraint entirely. */
.ek-main.ek-main--full {
	max-width: none;
	padding-left: 0;
	padding-right: 0;
}

/* -------------------------------------------------------------------------
   17. Responsive
------------------------------------------------------------------------- */
@media (max-width: 960px) {
	/* Grid-based containers */
	.ek-product-collection .wc-block-product-template,
	.wp-block-woocommerce-product-collection ul.wc-block-product-template,
	.ek-shop-grid .wc-block-product-template,
	.ek-shop-grid ul.wc-block-product-template,
	.ek-journal-grid,
	.ek-blog-query .wp-block-post-template,
	.ek-search-query .wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
	.ek-social-proof-grid,
	.ek-get-featured-grid,
	.ek-category-tiles-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
	/* Flex-based containers (see the layout safety net at the top of this
	   file) -- stack to a single column by switching flex-direction, not
	   grid-template-columns, which does nothing on a flex container. */
	.ek-shop-columns,
	.ek-product-layout {
		flex-direction: column !important;
	}
	.ek-shop-sidebar {
		position: static;
	}
	.ek-product-summary-col {
		position: static;
	}
}

@media (max-width: 600px) {
	.ek-header-row--top {
		flex-wrap: wrap;
	}
	.ek-hero {
		/* min-height, not a fixed height -- the copy (wrapped heading,
		   lede, stacked buttons) is often taller than the desktop hero on
		   a narrow screen, and this needs to grow to fit it rather than
		   force overlap. Vertical centering already comes from .ek-hero's
		   base display:flex/align-items:center -- no override needed. */
		min-height: 420px;
	}
	.ek-hero::after {
		/* Text wraps full-width on mobile rather than sitting in a left
		   column, so a bottom-heavy gradient reads better than the
		   desktop's left-to-right one. */
		background: linear-gradient(180deg, rgba(18,25,20,.15) 0%, rgba(18,25,20,.55) 55%, rgba(18,25,20,.9) 100%);
	}
	/* Grid-based containers */
	.ek-product-collection .wc-block-product-template,
	.wp-block-woocommerce-product-collection ul.wc-block-product-template,
	.ek-shop-grid .wc-block-product-template,
	.ek-shop-grid ul.wc-block-product-template,
	.ek-journal-grid,
	.ek-blog-query .wp-block-post-template,
	.ek-search-query .wp-block-post-template,
	.ek-category-tiles-grid {
		grid-template-columns: 1fr !important;
	}
	.ek-social-proof-grid,
	.ek-get-featured-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
	/* Flex-based containers */
	.ek-usps-grid,
	.ek-promo-tiles-grid,
	.ek-footer-columns {
		flex-direction: column !important;
	}
	.ek-footer-brand-col {
		flex-basis: auto !important;
	}

	/* Explicit fallback for theme.json's fluid typography: don't rely on
	   its generated clamp() to reliably reduce heading size on narrow
	   viewports -- shrink it directly so a single long word in a heading
	   (e.g. "HANDCRAFTED") can't force horizontal overflow on its own. */
	h1 { font-size: 2.25rem !important; }
	h2 { font-size: 1.75rem !important; }
	h3 { font-size: 1.5rem !important; }
}

/* -------------------------------------------------------------------------
   18. Reduced motion
------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
