/*
Theme Name: Nature By Atis
Theme URI: https://naturebyatis.com
Author: Nature By Atis
Description: Lightweight block theme for the Nature By Atis store (WooCommerce). Brand system v1.0.
Version: 0.7.2
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 8.2
License: Proprietary (fonts: SIL OFL 1.1, see assets/fonts)
Text Domain: nature-by-atis
*/

/* Most styling lives in theme.json. This file holds only what theme.json cannot express. */

/* ---- Accessibility -------------------------------------------------------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--forest);
	outline-offset: 3px;
	border-radius: 2px;
}
.nba-footer :where(a, button):focus-visible,
.nba-story :where(a, button):focus-visible {
	outline-color: var(--wp--preset--color--ivory);
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.screen-reader-text {
	border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; width: 1px; word-wrap: normal !important;
}

/* Outline button style (also used in raw-HTML sections, where core's block style CSS isn't loaded) */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent; color: var(--wp--preset--color--forest); border: 1px solid currentColor;
	padding: calc(0.85rem - 1px) calc(1.6rem - 1px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--forest); color: var(--wp--preset--color--ivory); }

/* ---- Language switcher (SQ / EN) ------------------------------------------- */
.nba-lang__list { display: flex; align-items: center; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.nba-lang__item { font-size: var(--wp--preset--font-size--x-small); font-weight: 600; letter-spacing: .1em; line-height: 1; }
.nba-lang abbr { text-decoration: none; cursor: inherit; }
.nba-lang a { display: inline-block; padding: .55rem .15rem; color: var(--wp--preset--color--forest); text-decoration: none; }
.nba-lang .is-current a { box-shadow: inset 0 -1px 0 currentColor; }
.nba-lang .is-unavailable > span { display: inline-block; padding: .55rem .15rem; color: var(--wp--preset--color--deep-gold); cursor: help; }
.nba-lang__sep { width: 1px; height: .9rem; background: var(--wp--preset--color--stone); }
@media (max-width: 599.98px) {
	/* On phones show only the other language (keeps the header within 375px) */
	.nba-lang .is-current, .nba-lang__sep { display: none; }
}

/* ---- Logo ------------------------------------------------------------------ */
.nba-logo { display: inline-block; line-height: 0; text-decoration: none; }
.nba-logo svg { display: block; width: auto; }
.nba-logo--header svg { height: 44px; }
.nba-logo--footer svg { height: 64px; }
@media (max-width: 1024px) { .nba-logo--header svg { height: 34px; } }
@media (max-width: 480px)  { .nba-logo--header svg { height: 28px; } } /* approved minimum */

/* ---- Page frame: header / main / footer sit flush (no root block gap between them) */
.wp-site-blocks > header + *,
.wp-site-blocks > footer { margin-block-start: 0; }

/* ---- Header ---------------------------------------------------------------- */
.nba-header { position: relative; z-index: 20; }
.nba-header .nba-header__inner { min-height: 76px; }
.nba-header .wp-block-navigation a { text-decoration: none; }
.nba-header .wp-block-navigation a:hover,
.nba-header .wp-block-navigation .current-menu-item > a { text-decoration: underline; text-underline-offset: 0.35em; text-decoration-thickness: 1px; }
.nba-header .wc-block-mini-cart__button,
.nba-header .wc-block-customer-account__account-icon { color: var(--wp--preset--color--forest); }
.nba-header .wc-block-mini-cart__badge { background: var(--wp--preset--color--forest); color: var(--wp--preset--color--ivory); }
/* "My selection" header link (replaces the WooCommerce mini-cart while ordering is closed, inc/selection.php) */
.nba-selection-link { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--wp--preset--color--forest); text-decoration: none; }
.nba-selection-link:hover { color: var(--wp--preset--color--deep-gold); }
.nba-selection-count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; font-size: 11px; line-height: 18px; font-weight: 600; text-align: center; background: var(--wp--preset--color--forest); color: var(--wp--preset--color--ivory); }
.nba-selection-count[hidden] { display: none; }
/* Small screens (<900px): the overlay (hamburger) menu is used. Core switches only below 600px, so
   600-899px is forced here; the account icon moves into the menu as "My account". */
@media (min-width: 900px) { .wp-block-navigation .nba-mobile-only { display: none; } }
@media (max-width: 899.98px) {
	.nba-header .nba-desktop-only { display: none; }
	.nba-header .wp-block-navigation__responsive-container-open { display: flex; padding: 10px; margin: -10px 0; } /* 44px tap target */
	.nba-header .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
}
@media (max-width: 599.98px) {
	.nba-header .nba-header__actions { gap: 0.125rem; }
	.nba-header .wc-block-mini-cart__button { padding: 8px 6px 8px 0; } /* fits 360px phones (even with a 15px scrollbar), incl. the count badge */
	.nba-header .nba-lang a, .nba-header .nba-lang .is-unavailable > span { padding-inline: 0; }
	.nba-header .nba-header__inner { gap: .5rem; }
	.nba-header .wp-block-navigation__responsive-container-open { padding: 9px; margin: -9px 0; } /* 42px target */
}
/* 900-1024px: full menu, tightened to stay on one line */
@media (min-width: 900px) and (max-width: 1024px) {
	.nba-header .wp-block-navigation__container { gap: .9rem !important; flex-wrap: nowrap; }
	.nba-header .wp-block-navigation-item { font-size: var(--wp--preset--font-size--x-small); white-space: nowrap; }
	.nba-header .nba-header__actions { gap: .75rem; }
}
/* mobile overlay menu */
.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--ivory) !important;
	color: var(--wp--preset--color--forest) !important;
	padding: clamp(1rem, 4vw, 2rem);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--large); letter-spacing: 0; }
.nba-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.nba-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { align-items: flex-start; }

/* ---- Footer ---------------------------------------------------------------- */
.nba-footer a { text-decoration: none; }
.nba-footer a:hover { text-decoration: underline; color: var(--wp--preset--color--ivory); }
.nba-footer h2 {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
	color: var(--wp--preset--color--stone); /* 5.45:1 on forest; muted gold (4.26:1) fails for small text */
	margin: 0 0 0.9rem;
}
.nba-footer ul { list-style: none; padding: 0; margin: 0; }
.nba-footer li + li { margin-top: 0.5rem; }
/* "Cookie settings" is a button (it opens a dialog) styled exactly like the footer links */
.nba-footer .nba-cookie-settings {
	appearance: none; background: none; border: 0; padding: 0; margin: 0;
	font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.nba-footer .nba-cookie-settings:hover { text-decoration: underline; color: var(--wp--preset--color--ivory); }
.nba-footer .nba-cookie-settings[hidden] { display: none; }

/* ---- Placeholder marking (local/dev content only) --------------------------- */
.nba-placeholder-note {
	border: 1px dashed var(--wp--preset--color--deep-gold);
	color: var(--wp--preset--color--deep-gold);
	padding: 0.5rem 0.75rem; font-size: var(--wp--preset--font-size--x-small); letter-spacing: 0.04em;
}

/* ---- WooCommerce touches ------------------------------------------------------ */
/* Cart/checkout line items: no product descriptions (not needed there, and Store-API text isn't language-switched) */
.wc-block-components-product-metadata__description { display: none; }
.nba-crumb-sep { margin-inline: .35em; }
.woocommerce-ordering, .wc-block-catalog-sorting { max-width: 100%; }
@media (max-width: 599px) {
	.wp-block-group:has(> .wc-block-catalog-sorting) { flex-wrap: wrap; } /* count + sorting row wraps on phones */
	select.orderby { width: 100%; }
	.wc-block-catalog-sorting, .woocommerce-ordering { flex-basis: 100%; }
}
/* Closed mini-cart drawer is aria-hidden; make it non-focusable too (WCAG aria-hidden-focus). */
.wc-block-mini-cart__drawer[aria-hidden="true"] { visibility: hidden; }
/* Product tabs: WooCommerce dims inactive tabs to ~4:1 contrast. Keep full forest; mark the active tab instead. */
.woocommerce-tabs ul.tabs li, .wc-tabs li { opacity: 1 !important; } /* WooCommerce dims the <li> to 0.65 */
.woocommerce-tabs ul.tabs li a, .wc-tabs li a { color: var(--wp--preset--color--forest) !important; }
/* WCAG 2.2 target size: WooCommerce's show-password toggle is 22px */
.show-password-input { min-width: 24px; min-height: 24px; }
.woocommerce-tabs ul.tabs li.active a, .wc-tabs li.active a { text-decoration: underline; text-underline-offset: 0.35em; }
/* Native selects (e.g. shop sorting) in the brand typography */
select, .woocommerce-ordering select {
	font: inherit; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--forest);
	background-color: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--stone);
	border-radius: 2px; padding: 0.55rem 2rem 0.55rem 0.75rem; max-width: 100%;
}
.wc-block-components-product-price, .wc-block-grid__product-price { color: var(--wp--preset--color--forest); }
.wc-block-components-notice-banner { border-radius: 2px; }
/* Discreet bilingual disclosure for illustrative product imagery (D-052) */
.nba-disclosure { margin: .6rem 0 0; font-size: .75rem; letter-spacing: .02em; color: #5b6a60; text-transform: none; font-weight: 400; }
.nba-footer .nba-disclosure { color: var(--wp--preset--color--stone); margin: 0; }
