/* AYRAERYNA Main page (approved mockup): hero clip, Shop by category, New arrivals, full-width slider, Instagram strip.
   Loaded on the front page only, after chrome.css and shop.css (the product card itself lives in shop.css).
   Fonts: Outfit 400 / 500 / 600 only. Colours come from the brand tokens in brand.css (--ay-*).
   House rule: clips play by themselves, muted and looping, with NO pause button.
   Colours and text sizes chosen under Website > Main page (0.19.0) arrive as CSS variables on each section
   (includes/home.php, ay_home_style): --ay-h-c / --ay-h-s heading colour / size, --ay-t-c / --ay-t-s tile or slide
   title, --ay-b-c / --ay-b-bg / --ay-b-s button words, button colour, button size. A size is a number that multiplies
   the size as designed, on phones too. When a variable is not set, the fallback after the comma is the design. */

body.ay-home-page {
	--ay-sand: #EDEBE7;   /* the warm grey shown behind a photo while it loads */
	--ay-bnav-h: 0px;     /* height of TikTok Style Checkout's phone bottom bar (0 on a computer) */
}
.ay-home { display: block; overflow-x: clip; }

/* ---------------------------------------------------------------- shared: a photo with a clip laid over it */
.ay-vm { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; background: var(--ay-sand); }
.ay-vm > img,
.ay-vm > picture,
.ay-vm > picture > img,
.ay-vm__v { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
/* The clip stays invisible until it really plays, so a slow or refused clip never shows a black box. */
.ay-vm__v { opacity: 0; transition: opacity .4s ease; background: transparent; }
.ay-vm__v.is-on { opacity: 1; }
/* YouTube in place of a clip (0.17.0): the player is shaped like the video (16:9, or 9:16 for a Shorts link) and
   made just big enough to cover the box, so it is cropped like the clips, never shown with black bars. */
.ay-yt { position: absolute; inset: 0; display: block; overflow: hidden; container-type: size; opacity: 0; transition: opacity .5s ease; pointer-events: none; --ay-yt-r: 1.7778; }
.ay-yt--tall { --ay-yt-r: .5625; }
.ay-yt.is-on { opacity: 1; }
/* The hero's Desktop Video and Mobile Video (0.18.0): each shows on its own screen size only. A hidden one is never
   loaded: home.js starts a clip or a YouTube player only when it is on screen. 900px = AY_HOME_PHONE_MAX. */
@media (min-width: 901px) { .ay-vm > .ay-only-m { display: none; } }
@media (max-width: 900px) { .ay-vm > .ay-only-d { display: none; } }
.ay-yt iframe { position: absolute; top: 50%; left: 50%; display: block; width: 100%; height: 100%; border: 0; transform: translate(-50%, -50%); pointer-events: none; }
@supports (width: 1cqw) {
	.ay-yt iframe { width: max(100cqw, 100cqh * var(--ay-yt-r)); height: max(100cqh, 100cqw / var(--ay-yt-r)); }
}
@media (prefers-reduced-motion: reduce) {
	.ay-vm__v,
	.ay-yt { display: none; } /* the still photo stays, nothing moves */
}

/* ---------------------------------------------------------------- hero: hero + announcement bar = one full screen */
.ay-hero { position: relative; height: calc(100svh - var(--ann-h, 0px) - var(--ay-bnav-h)); min-height: 420px; overflow: hidden; background: var(--ay-sand); }
.ay-hero__media { position: absolute; inset: 0; }
.ay-hero .ay-vm > img,
.ay-hero .ay-vm__v { object-position: 50% 34%; }
.ay-hero__cta { position: absolute; left: 50%; bottom: 11%; z-index: 2; transform: translateX(-50%); white-space: nowrap; }

/* ---------------------------------------------------------------- the hero and slide buttons: staff's colours and size (0.19.0) */
.ay-home .ay-btn {
	min-height: calc(48px * max(1, var(--ay-b-s, 1)));    /* grows with Large text, never under 48px (easy to tap) */
	padding: 0 calc(32px * var(--ay-b-s, 1));
	font-size: calc(13px * var(--ay-b-s, 1));
}
.ay-home .ay-btn--own,
.ay-home .ay-btn--own:hover {
	background: var(--ay-b-bg, var(--ay-ink)); border-color: var(--ay-b-bg, var(--ay-ink)); color: var(--ay-b-c, #fff);
}
.ay-home .ay-btn--own:hover { opacity: .85; }              /* a chosen colour stays on hover; it only softens */

/* ---------------------------------------------------------------- Shop by category: centred title, four tiles edge to edge */
.ay-cats { background: #fff; }
.ay-cats__h,
.ay-ig__h {
	margin: 0; font-family: var(--ay-sans); font-size: calc(clamp(24px, 2.5vw, 34px) * var(--ay-h-s, 1)); font-weight: 600; line-height: 1.1;
	letter-spacing: .04em; text-align: center; text-transform: uppercase; color: var(--ay-h-c, var(--ay-ink));
}
.ay-cats__h { padding: clamp(40px, 5vw, 64px) 16px clamp(20px, 2.4vw, 32px); }
.ay-cats__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; background: #fff; }
.ay-cat { position: relative; display: block; overflow: hidden; background: var(--ay-sand); color: #fff; text-decoration: none; }
/* A still tile: the photo zooms a little on hover. A clip tile: the whole box zooms (the photo and the clip together). */
.ay-cat > img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 14%; transition: transform .6s ease; }
.ay-cat > .ay-vm { height: auto; aspect-ratio: 2 / 3; transition: transform .6s ease; }
.ay-cat .ay-vm > img,
.ay-cat .ay-vm__v { object-position: 50% 14%; }
@media (hover: hover) {
	.ay-cat:hover > img,
	.ay-cat:hover > .ay-vm { transform: scale(1.03); }
}
.ay-cat__t {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 70px 14px 26px;
	background: linear-gradient(180deg, rgba(17, 17, 17, 0), rgba(17, 17, 17, .55));
	font-size: calc(clamp(15px, 1.5vw, 20px) * var(--ay-t-s, 1)); font-weight: 400; letter-spacing: .16em; text-align: center; text-transform: uppercase; color: var(--ay-t-c, #fff);
}
.ay-cat:focus-visible { outline: 2px solid var(--ay-ink); outline-offset: -4px; }

/* ---------------------------------------------------------------- New arrivals: title left, "View all" right, then the shop card grid */
.ay-na { padding: 56px 0 52px; background: #fff; }
.ay-na__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 0 var(--ay-gut, 32px) 20px; }
.ay-na__h { margin: 0; font-family: var(--ay-sans); font-size: calc(clamp(22px, 2.1vw, 30px) * var(--ay-h-s, 1)); font-weight: 500; line-height: 1.15; letter-spacing: .02em; color: var(--ay-h-c, var(--ay-ink)); }
.ay-na__all {
	flex: none; font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ay-h-c, var(--ay-ink));
	text-decoration: underline; text-underline-offset: 5px;
}
.ay-na__all:hover { color: var(--ay-muted); }
.woocommerce ul.products.ay-na__grid {
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 2px; margin: 0; padding: 0; list-style: none; background: #fff;
}

/* ---------------------------------------------------------------- full-width slider: photo (or clip), centred title + button, thin bars */
.ay-sld { position: relative; background: var(--ay-sand); }
.ay-sld__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ay-sld__track::-webkit-scrollbar { display: none; }
.ay-sl { position: relative; flex: 0 0 100%; height: min(56.25vw, 100svh); overflow: hidden; scroll-snap-align: start; background: var(--ay-sand); }
.ay-sl__media { position: absolute; inset: 0; }
.ay-sl__copy {
	position: absolute; left: 50%; top: 50%; z-index: 2; display: grid; justify-items: center; gap: 24px;
	width: max-content; max-width: 90%; transform: translate(-50%, -50%); text-align: center;
}
.ay-sl__title { margin: 0; font-family: var(--ay-sans); font-size: calc(clamp(30px, 4vw, 56px) * var(--ay-t-s, 1)); font-weight: 500; line-height: 1.1; letter-spacing: .01em; color: var(--ay-t-c, var(--ay-ink)); }
.ay-sld__bars { position: absolute; left: 0; right: 0; bottom: 18px; z-index: 3; display: flex; justify-content: center; gap: 8px; }
.ay-sld__bar { position: relative; width: 52px; height: 14px; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.ay-sld__bar::after { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 3px; background: rgba(17, 17, 17, .28); transition: background-color .25s; }
.ay-sld__bar.on::after { background: var(--ay-ink); }
.ay-sld__bar:focus-visible { outline: 2px solid var(--ay-ink); outline-offset: 2px; }

/* ---------------------------------------------------------------- Instagram strip: handle, a line, six square photos */
.ay-ig { max-width: 1320px; margin-inline: auto; padding: 84px clamp(16px, 4vw, 56px) 90px; }
.ay-ig__sub { margin: 8px 0 0; font-size: calc(14px * var(--ay-h-s, 1)); font-weight: 400; letter-spacing: .18em; text-align: center; text-transform: uppercase; color: var(--ay-h-c, var(--ay-ink)); }
.ay-ig__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 30px; }
.ay-ig__t { position: relative; display: block; overflow: hidden; background: var(--ay-sand); color: #fff; }
.ay-ig__t > img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; transition: transform .6s ease; }
.ay-ig__over { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(17, 17, 17, .38); opacity: 0; transition: opacity .25s; }
.ay-ig__over svg { width: 26px; height: 26px; }
@media (hover: hover) {
	.ay-ig__t:hover > img { transform: scale(1.05); }
	.ay-ig__t:hover .ay-ig__over { opacity: 1; }
}
.ay-ig__t:focus-visible .ay-ig__over { opacity: 1; }

/* ---------------------------------------------------------------- less motion: no zooms */
@media (prefers-reduced-motion: reduce) {
	.ay-cat > img, .ay-cat > .ay-vm, .ay-ig__t > img { transition: none; transform: none !important; }
}

/* ---------------------------------------------------------------- phones and small tablets */
@media (max-width: 900px) {
	body.ay-home-page:has(.tsc-bottomnav) { --ay-bnav-h: 57px; } /* hero + bar + TSC's bottom bar = one screen (measured) */
	.ay-hero .ay-vm > img,
	.ay-hero .ay-vm__v { object-position: 50% 50%; }             /* a portrait clip on a portrait screen: only the sides are trimmed */
	.ay-hero__cta { bottom: 4%; }

	.ay-cats__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ay-cat__t { padding: 50px 10px 18px; font-size: calc(15px * var(--ay-t-s, 1)); }

	.ay-na { padding: 40px 0 36px; }
	.ay-na__head { padding: 0 16px 14px; }
	.woocommerce ul.products.ay-na__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 2px; }

	.ay-sl { height: auto; aspect-ratio: 2 / 3; }                 /* the portrait phone photo shows (the <picture> picks it) */
	.ay-sl__copy { top: auto; bottom: 44px; gap: 16px; transform: translateX(-50%); }
	.ay-sl__title { font-size: calc(28px * var(--ay-t-s, 1)); }
	.ay-sld__bars { bottom: 12px; }

	.ay-ig { padding-top: 56px; padding-bottom: 60px; }
	.ay-ig__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
}
