/**
 * Lynnify — layout and components.
 *
 * Everything expressible in theme.json lives there instead. This file covers
 * the header, footer, breadcrumbs and the handful of composed components that
 * block markup alone cannot describe.
 *
 * Direction-neutral throughout: margin-inline, inset-inline and text-align:
 * start/end mean the Arabic layout mirrors without a second stylesheet.
 */

/* ==========================================================================
   1. Announcement bar
   ========================================================================== */

.lyn-announce {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: var(--wp--custom--tracking--wide);
	text-transform: uppercase;
	text-align: center;
	padding-block: 0.7em;
	padding-inline: var(--wp--preset--spacing--40);
}

.lyn-announce a {
	color: inherit;
	text-underline-offset: 3px;
}

/* ==========================================================================
   2. Site header
   ========================================================================== */

.lyn-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: color-mix(in srgb, var(--wp--preset--color--base) 88%, transparent);
	backdrop-filter: saturate(180%) blur(14px);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color var(--wp--custom--transition--base),
		background-color var(--wp--custom--transition--base);
}

/* Browsers without backdrop-filter get a solid bar rather than a smeared one. */
@supports not (backdrop-filter: blur(1px)) {
	.lyn-header {
		background: var(--wp--preset--color--base);
	}
}

.lyn-header.is-stuck {
	border-bottom-color: var(--wp--preset--color--line);
	box-shadow: var(--wp--preset--shadow--soft);
}

.lyn-header__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
	min-height: 72px;
}

.lyn-header__start {
	justify-self: start;
}

.lyn-header__center {
	justify-self: center;
}

.lyn-header__end {
	justify-self: end;
}

.lyn-header__start,
.lyn-header__end {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
}

/* Navigation ------------------------------------------------------------- */

.lyn-nav .wp-block-navigation__container {
	gap: clamp(1rem, 2vw, 2rem);
}

.lyn-nav .wp-block-navigation-item__content {
	position: relative;
	padding-block: 0.35em;
}

/* Underline grows from the leading edge — mirrors automatically in RTL. */
.lyn-nav .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	bottom: 0;
	width: 100%;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: inline-start;
	transition: transform var(--wp--custom--transition--base);
}

.lyn-nav .wp-block-navigation-item__content:hover::after,
.lyn-nav .wp-block-navigation-item__content:focus-visible::after,
.lyn-nav .current-menu-item > .wp-block-navigation-item__content::after {
	transform: scaleX(1);
}

/* Header icon buttons ---------------------------------------------------- */

.lyn-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--ink);
	border-radius: var(--wp--custom--radius--pill);
	cursor: pointer;
	position: relative;
	text-decoration: none;
	transition: background-color var(--wp--custom--transition--fast);
}

.lyn-iconbtn:hover,
.lyn-iconbtn:focus-visible {
	background: var(--wp--preset--color--surface);
}

.lyn-iconbtn svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Cart count bubble */
.lyn-cart-count {
	position: absolute;
	top: 2px;
	inset-inline-end: 2px;
	min-width: 18px;
	height: 18px;
	padding-inline: 5px;
	display: grid;
	place-items: center;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--base);
	border-radius: var(--wp--custom--radius--pill);
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.lyn-cart-count[data-count="0"] {
	display: none;
}

/* Mobile ----------------------------------------------------------------- */

@media (max-width: 781px) {
	.lyn-header__inner {
		min-height: 60px;
		gap: var(--wp--preset--spacing--20);
	}

	/* The Navigation block collapses to its own overlay button below this
	   width, so the three columns become nav / logo / actions. */
	.lyn-header__end .wp-block-search__button {
		padding-inline: 0.75em;
	}
}

/* ==========================================================================
   3. Breadcrumbs
   ========================================================================== */

.lyn-breadcrumbs {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--muted);
}

.lyn-breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lyn-breadcrumbs__item + .lyn-breadcrumbs__item::before {
	content: "/";
	margin-inline-end: 0.5em;
	color: var(--wp--preset--color--sand-deep);
}

.lyn-breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.lyn-breadcrumbs a:hover {
	color: var(--wp--preset--color--ink);
	text-decoration: underline;
}

.lyn-breadcrumbs__item[aria-current="page"] {
	color: var(--wp--preset--color--ink);
}

/* ==========================================================================
   4. Section furniture
   ========================================================================== */

.lyn-section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--40);
	margin-block-end: var(--wp--preset--spacing--60);
}

.lyn-section-head__link {
	font-size: var(--wp--preset--font-size--x-small);
	text-transform: uppercase;
	letter-spacing: var(--wp--custom--tracking--wide);
	white-space: nowrap;
}

/* ==========================================================================
   5. Category tiles
   ========================================================================== */

.lyn-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
	gap: var(--wp--preset--spacing--40);
}

.lyn-tile {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--lg);
	aspect-ratio: 1 / 1;
	text-decoration: none;
	background: var(--wp--preset--color--surface);
	isolation: isolate;
}

.lyn-tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 600ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.lyn-tile:hover img,
.lyn-tile:focus-visible img {
	transform: scale(1.05);
}

.lyn-tile::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--wp--preset--gradient--ink-veil);
	z-index: 1;
}

.lyn-tile__label {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	z-index: 2;
	padding: var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--base);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
}

.lyn-tile__count {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--x-small);
	opacity: 0.85;
	font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   6. Testimonials
   ========================================================================== */

.lyn-quote-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--lg);
	padding: var(--wp--preset--spacing--50);
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
	height: 100%;
}

.lyn-stars {
	display: inline-flex;
	gap: 2px;
	color: var(--wp--preset--color--sand-deep);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 2px;
}

.lyn-quote-card__body {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
	color: var(--wp--preset--color--ink);
	margin: 0;
}

.lyn-quote-card__author {
	font-size: var(--wp--preset--font-size--x-small);
	text-transform: uppercase;
	letter-spacing: var(--wp--custom--tracking--wide);
	color: var(--wp--preset--color--muted);
	margin-block-start: auto;
}

/* ==========================================================================
   7. Trust bar
   ========================================================================== */

.lyn-trust {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
	gap: var(--wp--preset--spacing--50);
	text-align: center;
}

.lyn-trust__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
}

.lyn-trust__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--ink);
}

.lyn-trust__text {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	max-width: 28ch;
	margin: 0;
}

/* ==========================================================================
   8. Icons
   ========================================================================== */

.lyn-icon {
	width: 28px;
	height: 28px;
	stroke: var(--wp--preset--color--taupe);
	stroke-width: 1.25;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ==========================================================================
   9. Footer
   ========================================================================== */

.lyn-footer {
	background: var(--wp--preset--color--surface);
	border-top: 1px solid var(--wp--preset--color--line);
}

.lyn-footer__cols {
	display: grid;
	grid-template-columns: 1.4fr repeat(3, 1fr);
	gap: var(--wp--preset--spacing--60);
}

@media (max-width: 900px) {
	.lyn-footer__cols {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 540px) {
	.lyn-footer__cols {
		grid-template-columns: 1fr;
	}
}

.lyn-footer__heading {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: var(--wp--custom--tracking--wider);
	color: var(--wp--preset--color--ink);
	margin-block-end: var(--wp--preset--spacing--30);
}

.lyn-footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.6em;
}

.lyn-footer a {
	color: var(--wp--preset--color--taupe);
	text-decoration: none;
	font-size: var(--wp--preset--font-size--small);
}

.lyn-footer a:hover,
.lyn-footer a:focus-visible {
	color: var(--wp--preset--color--ink);
	text-decoration: underline;
}

.lyn-footer__bottom {
	border-top: 1px solid var(--wp--preset--color--line);
	padding-block: var(--wp--preset--spacing--40);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--muted);
}

/* Payment marks — inert images, not links. */
.lyn-payments {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.lyn-payments svg {
	height: 22px;
	width: auto;
	border-radius: 3px;
}

/* ==========================================================================
   10. Editorial content
   ========================================================================== */

.lyn-prose > * + * {
	margin-block-start: var(--wp--preset--spacing--40);
}

.lyn-prose h2,
.lyn-prose h3 {
	margin-block-start: var(--wp--preset--spacing--60);
}

.lyn-prose img {
	border-radius: var(--wp--custom--radius--md);
}

/* ==========================================================================
   11. Post cards
   ========================================================================== */

.lyn-post-card {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
	height: 100%;
}

.lyn-post-card .wp-block-post-featured-image img {
	border-radius: var(--wp--custom--radius--md);
	aspect-ratio: 4 / 3;
	object-fit: cover;
	width: 100%;
}

/* ==========================================================================
   12. 404 and empty states
   ========================================================================== */

.lyn-empty {
	text-align: center;
	padding-block: var(--wp--preset--spacing--80);
	max-width: 52ch;
	margin-inline: auto;
}

/* ==========================================================================
   13. Motion — entrance reveal, applied only when JS confirms support
   ========================================================================== */

.lyn-reveal {
	opacity: 0;
	transform: translateY(16px);
}

.lyn-reveal.is-visible {
	opacity: 1;
	transform: none;
	transition: opacity 600ms cubic-bezier(0.2, 0.7, 0.3, 1),
		transform 600ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* No JS, or reduced motion: content must never stay invisible. */
.no-js .lyn-reveal,
html:not(.js) .lyn-reveal {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.lyn-reveal {
		opacity: 1;
		transform: none;
	}
}

/* ==========================================================================
   14. Social links
   Hand-rolled rather than core/social-links, which pulls in ~12 KB of
   brand-colour CSS on every page for four icons.
   ========================================================================== */

.lyn-social {
	list-style: none;
	margin: var(--wp--preset--spacing--40) 0 0;
	padding: 0;
	display: flex;
	gap: var(--wp--preset--spacing--20);
}

.lyn-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--ink);
	transition: background-color var(--wp--custom--transition--fast),
		color var(--wp--custom--transition--fast);
}

.lyn-social a:hover,
.lyn-social a:focus-visible {
	background: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--ink);
}

.lyn-social svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ==========================================================================
   15. Quantity steppers (added by assets/js/theme.js)
   ========================================================================== */

.lyn-qty-step {
	width: 34px;
	height: 100%;
	min-height: 42px;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--taupe);
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	transition: color var(--wp--custom--transition--fast);
}

.lyn-qty-step:hover,
.lyn-qty-step:focus-visible {
	color: var(--wp--preset--color--ink);
}
