/*
 * 9Yaards components — the reusable visual vocabulary shared across every page.
 * Consumes tokens.css. Photography-led, minimal chrome, restrained borders/shadows.
 */

/* ---------------------------------------------------------------- Section heads */
.section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--sp-4);
	margin-bottom: var(--sp-6);
}
.section-head__titles { max-width: 60ch; }
.section-head h2 { margin: var(--sp-1) 0 0; }
.section-head__link {
	font-family: var(--font-head);
	font-size: var(--fs-100);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	color: var(--c-ink);
	white-space: nowrap;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
}
.section-head--center { flex-direction: column; align-items: center; text-align: center; }

/* ---------------------------------------------------------------- Forms */
input[type="text"], input[type="email"], input[type="search"], input[type="password"],
input[type="tel"], input[type="number"], select, textarea {
	width: 100%;
	padding: var(--sp-3) var(--sp-4);
	font: inherit;
	color: var(--c-ink);
	background: var(--c-bg);
	border: 1px solid var(--c-line);
	border-radius: var(--radius-sm);
	transition: border-color var(--dur) var(--ease);
}
input:focus, select:focus, textarea:focus { border-color: var(--c-ink); outline: none; }
label { font-family: var(--font-head); font-size: var(--fs-200); }

/* ---------------------------------------------------------------- Badges */
.badge {
	display: inline-flex;
	align-items: center;
	font-family: var(--font-head);
	font-size: var(--fs-100);
	letter-spacing: var(--tracking-caps);
	text-transform: uppercase;
	padding: 3px var(--sp-2);
	border-radius: var(--radius-sm);
	line-height: 1.4;
}
.badge--sale { background: var(--c-ink); color: #fff; }
.badge--soft { background: var(--c-primary-soft); color: var(--c-primary-dk); }
.badge--out  { background: var(--c-surface-2); color: var(--c-ink-soft); }

/* ---------------------------------------------------------------- Product card
   ONE component, used on home / shop / archives / related / search. */
.product-card { position: relative; display: flex; flex-direction: column; }
.product-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--c-surface);
	aspect-ratio: 3 / 4;
}
.product-card__media img {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform 600ms var(--ease), opacity var(--dur) var(--ease);
}
.product-card__img--secondary {
	position: absolute; inset: 0;
	opacity: 0;
}
/* Subtle second-image reveal on hover (only when a second image exists). */
@media (hover: hover) {
	.product-card:hover .product-card__img--primary { opacity: 0; }
	.product-card:hover .product-card__img--secondary { opacity: 1; }
	.product-card:hover .product-card__media img { transform: scale(1.03); }
}
.product-card__badges { position: absolute; top: var(--sp-3); left: var(--sp-3); display: flex; gap: var(--sp-2); z-index: 2; }
.product-card__wish {
	position: absolute; top: var(--sp-2); right: var(--sp-2); z-index: 2;
	width: 38px; height: 38px; display: grid; place-items: center;
	background: color-mix(in srgb, var(--c-bg) 82%, transparent);
	border: 0; border-radius: 999px; color: var(--c-ink);
	opacity: 0; transform: translateY(-4px);
	transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.product-card:hover .product-card__wish,
.product-card__wish:focus-visible,
.product-card__wish.is-active { opacity: 1; transform: none; }
.product-card__wish.is-active { color: var(--c-primary); }
.product-card__wish svg { width: 18px; height: 18px; }

.product-card__body { padding: var(--sp-3) 0 0; text-align: center; }
.product-card__addcart {
	display: block; margin-top: var(--sp-3);
	background: var(--c-ink); color: #fff; text-align: center;
	padding: var(--sp-3) var(--sp-4);
	font-family: var(--font-body); font-size: var(--fs-100);
	text-transform: uppercase; letter-spacing: var(--tracking-caps);
	transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.product-card__addcart:hover, .product-card__addcart.added { background: var(--c-primary); color: #fff; }
.product-card__addcart.loading { opacity: 0.6; }
.product-card__eyebrow {
	font-family: var(--font-head); font-size: var(--fs-100);
	letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--c-muted);
	margin-bottom: 2px;
}
.product-card__title {
	font-family: var(--font-body); font-size: var(--fs-300); font-weight: 400;
	line-height: var(--lh-snug); margin: 0 0 var(--sp-1); color: var(--c-ink);
}
.product-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.product-card__price { font-size: var(--fs-200); color: var(--c-ink-soft); }
.product-card__price del { color: var(--c-muted); margin-right: var(--sp-2); }
.product-card__price ins { color: var(--c-sale); text-decoration: none; font-weight: 600; }

/* ---------------------------------------------------------------- Homepage (faithful to live) */
.home-section { padding-block: var(--sp-7); }
.home-section--navy { background: var(--c-navy); color: #fff; }
.home-section--terracotta { background: var(--c-primary); color: #fff; }
.home-section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.home-section__head--center { flex-direction: column; align-items: center; text-align: center; }
.home-section__head h2 { font-size: var(--fs-600); margin: 0; color: var(--c-primary); letter-spacing: 0.01em; }
.home-section--navy .home-section__head h2 { color: var(--c-gold); }
.home-section--terracotta .home-section__head h2 { color: #fff; }
.home-section__head p { color: var(--c-ink-soft); margin: var(--sp-2) 0 0; font-size: var(--fs-400); }
.home-section--navy .home-section__head p, .home-section--terracotta .home-section__head p { color: rgba(255,255,255,0.85); }
.home-section__cta { text-align: center; margin-top: var(--sp-6); }

/* Product cards on dark grounds render as white boxes with centred meta (like live). */
.home-section--navy .product-card, .home-section--terracotta .product-card { background: #fff; border-radius: var(--radius); overflow: hidden; }
.home-section--navy .product-card__media, .home-section--terracotta .product-card__media { border-radius: 0; }
.home-section--navy .product-card__body, .home-section--terracotta .product-card__body { padding: var(--sp-3) var(--sp-3) var(--sp-4); text-align: center; }

/* Product carousel — mirrors the live sliders. CSS scroll-snap works without JS; the
   round prev/next arrows are a JS enhancement, shown only when the track overflows. */
.product-carousel { position: relative; }
.product-carousel__track {
	display: grid; grid-auto-flow: column; grid-auto-columns: 78%;
	gap: var(--sp-4); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch; padding-bottom: var(--sp-2); scrollbar-width: none;
}
.product-carousel__track::-webkit-scrollbar { display: none; }
.product-carousel__cell { scroll-snap-align: start; min-width: 0; }
@media (min-width: 700px) { .product-carousel__track { grid-auto-columns: 42%; } }
@media (min-width: 1024px) { .product-carousel__track { grid-auto-columns: calc((100% - var(--sp-5) * 3) / 4); gap: var(--sp-5); } }
.product-carousel__arrow {
	position: absolute; top: 38%; transform: translateY(-50%); z-index: 3;
	width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--c-line);
	background: #fff; color: var(--c-ink); align-items: center; justify-content: center;
	cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.14); display: none;
}
.product-carousel__arrow svg { width: 20px; height: 20px; }
.product-carousel__arrow--prev { left: -18px; }
.product-carousel__arrow--next { right: -18px; }
.product-carousel__arrow:disabled { opacity: 0.3; cursor: default; }
@media (min-width: 1024px) { .product-carousel__arrow:not([hidden]) { display: inline-flex; } }

/* Scroll-reveal — sections fade + rise into view as on the live store. Gated on both
   JS (body.reveal-ready) and motion preference, so content is always visible without JS
   and never animates for reduced-motion users. */
@media (prefers-reduced-motion: no-preference) {
	.reveal-ready .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); will-change: opacity, transform; }
	.reveal-ready .reveal.is-revealed { opacity: 1; transform: none; }
}

/* All-collections index — 4-up grid of tiles (image + name), like the live /collections */
.collections-header { text-align: center; margin-bottom: var(--sp-7); }
.collections-header h1 { font-size: var(--fs-600); color: var(--c-ink); margin: 0; }
.collections-intro { max-width: 60ch; margin: var(--sp-3) auto 0; color: var(--c-ink-soft); }
.collections-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-6) var(--sp-4); }
@media (min-width: 700px) { .collections-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .collections-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-7) var(--sp-5); } }
.collection-tile { display: block; text-align: center; }
.collection-tile__media { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: #f2eee7; }
.collection-tile__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease); }
.collection-tile:hover .collection-tile__media img { transform: scale(1.04); }
.collection-tile__name { display: block; font-family: var(--font-head); font-weight: 500; font-size: var(--fs-300); letter-spacing: 0.01em; color: var(--c-ink); margin-top: var(--sp-3); }
.collection-tile:hover .collection-tile__name { color: var(--c-primary); }

/* Hero — portrait banner + text/paragraph/CTA + wide banner, on terracotta */
.home-hero { background: var(--c-primary); color: #fff; padding-block: var(--sp-4) var(--sp-6); }
.home-hero__grid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .home-hero__grid { grid-template-columns: 5fr 6fr; } }
.home-hero__portrait { display: block; overflow: hidden; aspect-ratio: 4 / 5; }
.home-hero__portrait img { width: 100%; height: 100%; object-fit: cover; }
.home-hero__content { display: flex; flex-direction: column; gap: var(--sp-4); }
.home-hero__content h1 { color: #fff; font-size: clamp(1.75rem, 3.4vw, 2.75rem); margin: 0; }
.home-hero__content p { color: rgba(255,255,255,0.9); font-size: var(--fs-400); line-height: var(--lh-body); margin: 0; max-width: 50ch; }
.home-hero__wide { display: block; overflow: hidden; aspect-ratio: 3 / 2; margin-top: var(--sp-2); }
.home-hero__wide img { width: 100%; height: 100%; object-fit: cover; }
.btn--onprimary { align-self: flex-start; background: transparent; border-color: #fff; color: #fff; }
.btn--onprimary:hover { background: #fff; color: var(--c-primary); border-color: #fff; }

/* Promo banner — full-width image, left-aligned overlay (eyebrow + title + CTA) */
.promo-banner__link { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 6; background: var(--c-surface); }
.promo-banner__link img { width: 100%; height: 100%; object-fit: cover; }
.promo-banner__overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: var(--sp-3); text-align: left; padding: 0 clamp(1.5rem, 6vw, 6rem); }
.promo-banner__overlay .eyebrow { color: rgba(255,255,255,0.85); }
.promo-banner__title { font-family: var(--font-head); font-weight: var(--fw-head); font-size: clamp(1.5rem, 3vw, 2.5rem); color: #fff; text-shadow: 0 1px 16px rgba(0,0,0,0.4); max-width: 18ch; }

/* Split banner — Dusk to Night (navy text panel + image) */
.split-banner { display: grid; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 900px) { .split-banner { grid-template-columns: 1fr 1.2fr; } }
.split-banner__body { display: flex; flex-direction: column; justify-content: center; gap: var(--sp-3); padding: var(--sp-8) var(--gutter); }
.split-banner--navy .split-banner__body { background: var(--c-navy); color: #fff; }
.split-banner--navy .split-banner__body h2 { color: var(--c-gold); font-size: var(--fs-700); margin: 0; }
.split-banner--navy .split-banner__body p { color: rgba(255,255,255,0.85); margin: 0 0 var(--sp-2); font-size: var(--fs-400); }
.split-banner--navy .split-banner__body .btn { align-self: flex-start; }
.split-banner__media { overflow: hidden; aspect-ratio: 3 / 2; background: var(--c-surface); }
.split-banner__media img { width: 100%; height: 100%; object-fit: cover; }

/* Testimonials — on terracotta ground, centred, gold stars */
.testimonials { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
@media (min-width: 800px) { .testimonials { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.testimonial { margin: 0; text-align: center; color: #fff; }
.testimonial__stars { color: var(--c-gold); letter-spacing: 2px; margin-bottom: var(--sp-3); }
.testimonial blockquote { margin: 0 0 var(--sp-3); font-size: var(--fs-300); line-height: var(--lh-body); color: #fff; }
.testimonial figcaption { font-family: var(--font-head); font-weight: var(--fw-head); font-size: var(--fs-200); color: #fff; opacity: 0.9; }

/* ---------------------------------------------------------------- Craft chips (shop by craft) */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
	display: inline-flex; align-items: center;
	padding: var(--sp-2) var(--sp-4);
	border: 1px solid var(--c-line); border-radius: 999px;
	font-family: var(--font-head); font-size: var(--fs-200); color: var(--c-ink);
	transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip:hover, .chip[aria-current="true"] { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }

/* ---------------------------------------------------------------- Editorial split (craft story) */
.split { display: grid; gap: var(--sp-6); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: var(--sp-8); } .split--reverse .split__media { order: 2; } }
.split__media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--c-surface); }
.split__media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- Journal cards */
.journal-grid { display: grid; gap: var(--sp-6) var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 700px) { .journal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.journal-card__media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2; background: var(--c-surface); margin-bottom: var(--sp-3); }
.journal-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.journal-card:hover .journal-card__media img { transform: scale(1.03); }
.journal-card__tag { font-size: var(--fs-100); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--c-muted); }
.journal-card h3 { font-size: var(--fs-400); margin: var(--sp-1) 0 var(--sp-2); }
.journal-card p { font-size: var(--fs-300); color: var(--c-ink-soft); margin: 0; }

/* ---------------------------------------------------------------- Newsletter band (maroon, full-width) */
.newsletter { background: var(--c-maroon); color: #fff; padding-block: var(--sp-8); }
.newsletter__inner { text-align: center; }
.newsletter h2 { color: #fff; text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--fs-600); margin: 0 0 var(--sp-2); }
.newsletter p { color: rgba(255,255,255,0.82); margin: 0; }
.newsletter form { display: flex; gap: 0; max-width: 460px; margin: var(--sp-5) auto 0; }
.newsletter input[type="email"] { background: #fff; border: 0; border-radius: 0; color: var(--c-ink); }
.newsletter input::placeholder { color: var(--c-muted); }
.newsletter .btn { border-radius: 0; white-space: nowrap; }
