/*
 * Malqeta accessibility correction layer.
 *
 * This file is intentionally loaded last. It fixes shared contrast, focus and
 * target-size primitives without changing the brand palette used for borders,
 * ornaments or photography. Text golds are split by background: dark gold on
 * paper and light gold on charcoal.
 */

:root {
  --mlq-readable-gold-on-light: #735115;
  --mlq-readable-gold-on-dark: #d9b66f;
  --mlq-readable-ink: #2d281f;
  --mlq-readable-muted-on-dark: #bdb7ae;
}

/* A clear focus indicator survives page-level rules that remove outlines. */
:where(a, button, input, select, textarea, summary, [role='button'], [tabindex]):focus-visible {
  outline: 3px solid var(--mlq-readable-gold-on-light) !important;
  outline-offset: 3px !important;
}

:where(footer, .sm-page, .coll-reviews-section, .review-section, .newsletter-section)
  :where(a, button, input, select, textarea, summary, [role='button'], [tabindex]):focus-visible {
  outline-color: var(--mlq-readable-gold-on-dark) !important;
}

/* Light navigation: dark controls and text on white/linen. */
nav.nav-light .nav-links a,
nav.nav-light .lang-toggle,
nav.nav-light .cart-btn,
nav.nav-light .zone-indicator,
nav.nav-light .zi-name,
nav.nav-light .zi-code,
nav.nav-light .zi-caret {
  color: var(--mlq-readable-ink) !important;
}

nav.nav-light .nav-eyebrow-text {
  color: var(--mlq-readable-gold-on-light) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Atarah product pages have a paper header, not a photographic hero. */
body.malqeta-atarah-product #nav {
  background: rgba(255, 255, 255, 0.97);
}

body.malqeta-atarah-product #nav .nav-logo-img {
  filter: brightness(0) !important;
}

body.malqeta-atarah-product #nav :where(.nav-links a, .lang-toggle, .cart-btn, .zone-indicator, .zi-name, .zi-code, .zi-caret) {
  color: var(--mlq-readable-ink) !important;
}

body.malqeta-atarah-product #nav :where(.lang-toggle, .cart-btn, .zone-indicator, .nav-hamburger) {
  background: #fff !important;
  border-color: rgba(45, 40, 31, 0.44) !important;
}

body.malqeta-atarah-product #nav .nav-hamburger span {
  background: var(--mlq-readable-ink) !important;
}

body.malqeta-atarah-product #nav .nav-eyebrow-text {
  color: var(--mlq-readable-gold-on-light) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* The Atarot index uses the same paper hero as its product pages. */
body.page-template-page-atarot #nav,
body.page-template-page-atarot-he #nav {
  background: rgba(255, 255, 255, 0.97);
}

body.page-template-page-atarot #nav .nav-logo-img,
body.page-template-page-atarot-he #nav .nav-logo-img {
  filter: brightness(0) !important;
}

body.page-template-page-atarot #nav :where(.nav-links a, .lang-toggle, .cart-btn, .zone-indicator, .zi-name, .zi-code, .zi-caret),
body.page-template-page-atarot-he #nav :where(.nav-links a, .lang-toggle, .cart-btn, .zone-indicator, .zi-name, .zi-code, .zi-caret) {
  color: var(--mlq-readable-ink) !important;
}

body.page-template-page-atarot #nav :where(.lang-toggle, .cart-btn, .zone-indicator, .nav-hamburger),
body.page-template-page-atarot-he #nav :where(.lang-toggle, .cart-btn, .zone-indicator, .nav-hamburger) {
  background: #fff !important;
  border-color: rgba(45, 40, 31, 0.44) !important;
}

body.page-template-page-atarot #nav .nav-hamburger span,
body.page-template-page-atarot-he #nav .nav-hamburger span {
  background: var(--mlq-readable-ink) !important;
}

body.page-template-page-atarot #nav .nav-eyebrow-text,
body.page-template-page-atarot-he #nav .nav-eyebrow-text,
.atarot-page .collection-hero-merged .hero-hebrew {
  color: var(--mlq-readable-gold-on-light) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Product collection purchase panels are paper on mobile and desktop. */
.commerce-entry-hero .merged-left,
.commerce-entry-hero .merged-left h1,
.commerce-entry-hero .merged-left .hero-collection-title,
.commerce-entry-hero .merged-left .hero-desc,
.commerce-entry-hero .merged-left .detail-pills .pill {
  color: var(--mlq-readable-ink) !important;
  text-shadow: none !important;
}

.commerce-entry-hero .merged-left .eyebrow-text,
.commerce-entry-hero .merged-left .hero-hebrew,
.commerce-entry-hero .merged-left .hero-price,
.commerce-entry-hero .merged-left .price-usd-live {
  color: var(--mlq-readable-gold-on-light) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Light editorial and policy surfaces. */
:where(.policy-page, .a11y-statement) :where(
  .policy-eyebrow,
  a,
  .policy-shipping-table th
) {
  color: var(--mlq-readable-gold-on-light) !important;
  opacity: 1 !important;
}

.a11y-statement a { color: var(--mlq-readable-gold-on-light) !important; }

body.home.malqeta-he :where(.section-title em, .story-intro em, .mission-body em) {
  color: var(--mlq-readable-gold-on-light) !important;
  opacity: 1 !important;
}

/* /he/ is a dedicated page rather than WordPress's configured front page, so
   it does not always receive the `home` body class. */
body.malqeta-he :where(.section-title em, .story-body em, .story-intro em, .mission-body em) {
  color: var(--mlq-readable-gold-on-light) !important;
  opacity: 1 !important;
}

/* Legal names are emphasis, not decoration; keep them at body-text contrast. */
.a11y-statement em { color: inherit !important; }

body.home.malqeta-he :where(.story-intro, .story-intro strong, .mission-body, .mission-body strong) {
  color: var(--mlq-readable-ink) !important;
  opacity: 1 !important;
}

:where(.reviews-hero-eyebrow, .review-hero-eyebrow, .review-occasion,
       .reviews-cta-eyebrow, .review-product,
       .giving-eyebrow-text, .giving-title em, .giving-pledge-percent,
       .giving-section em, .giving-quote, .giving-cta a,
       .story-craft-title em, .about-hero-title em,
       .grid-eyebrow-text, .grid-note, .product-grid-note,
       .cart-empty a) {
  color: var(--mlq-readable-gold-on-light) !important;
  opacity: 1 !important;
}

.giving-cta a:hover,
.giving-cta a:focus-visible {
  color: #fff !important;
  background: var(--mlq-readable-gold-on-light) !important;
}

.story-moment.is-current .story-moment-meta span:first-child,
.about-page[dir='rtl'] .story-moment.is-current .story-moment-meta span:first-child {
  color: var(--mlq-readable-gold-on-light) !important;
}

/* This eyebrow sits on the black reviews CTA, unlike the light reviews hero. */
.reviews-cta .reviews-cta-eyebrow {
  color: var(--mlq-readable-gold-on-dark) !important;
}

/* Dark collection-proof and craft panels. */
:where(.coll-reviews-section, .craft-section, .craft-story) .coll-reviews-link,
.coll-reviews-link {
  color: var(--mlq-readable-gold-on-dark) !important;
  opacity: 1 !important;
}

:where(.coll-reviews-section, .craft-section, .craft-story) :where(.coll-rv-meta, .craft-fact-label),
.coll-rv-meta,
.craft-fact-label {
  color: var(--mlq-readable-muted-on-dark) !important;
  opacity: 1 !important;
}

/* Color Intelligence: no muted-on-black copy below AA contrast. */
.sm-page :where(.sm-eyebrow, .sm-beta, .sm-step, .sm-status, .sm-scanning, .sm-browse) {
  color: var(--mlq-readable-gold-on-dark) !important;
  opacity: 1 !important;
}

.sm-page :where(.sm-title, .sm-desc, .sm-step-hint, .sm-privacy,
                .sm-upload-label, .sm-upload-sub, .sm-formats,
                .sm-tap-btn, .sm-tap-sub) {
  color: #fdf5e0 !important;
}

.sm-page :where(.sm-drop.disabled, .sm-tap-btn.disabled) {
  color: var(--mlq-readable-muted-on-dark) !important;
  opacity: 1 !important;
}

/* Region chooser notes are functional purchasing text, not decoration. */
.zone-overlay .zo-currency,
.zone-overlay .zo-note {
  color: #42382c !important;
  opacity: 1 !important;
}

/* Footer copy: parent opacity used to reduce real text below 4.5:1. */
footer .footer-link-soon {
  color: var(--mlq-readable-muted-on-dark) !important;
  opacity: 1 !important;
}

footer .footer-soon-tag,
footer :where(.footer-col-title, .footer-logo-sub, .footer-location, .footer-location-bottom) {
  color: var(--mlq-readable-gold-on-dark) !important;
  opacity: 1 !important;
}

footer .footer-soon-tag {
  min-block-size: 20px;
  display: inline-flex;
  align-items: center;
  font-size: 9px !important;
  font-weight: 650;
}

footer .footer-made { color: var(--mlq-readable-muted-on-dark) !important; }

footer .footer-col-contact li > a {
  display: inline-flex;
  min-inline-size: 44px;
  min-block-size: 44px;
  align-items: center;
  opacity: 1 !important;
}

/* Review rating: the visual star is also the full keyboard/touch target. */
.stars-input {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}

.stars-input input[type='radio'] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stars-input label,
.f-stars-input label {
  inline-size: 44px;
  block-size: 44px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.stars-input label::before { content: '\2605'; font-size: 28px; color: var(--mlq-readable-gold-on-light); }
.stars-input input:checked ~ label::before,
.stars-input label:hover::before { color: var(--mlq-readable-gold-on-light); }
.stars-input input:focus-visible + label,
.f-stars-input input:focus-visible + label {
  outline: 3px solid var(--mlq-readable-gold-on-light) !important;
  outline-offset: 2px !important;
}

/* The accessibility dialog is inert while closed and fully operable when open. */
.a11y-close,
.a11y-fontctl button,
.a11y-toggle,
.a11y-reset,
.a11y-link {
  min-block-size: 44px;
}

.a11y-close { inline-size: 44px !important; block-size: 44px !important; }
.a11y-toggle.on { color: #fff !important; background: var(--mlq-readable-gold-on-light) !important; border-color: var(--mlq-readable-gold-on-light) !important; }
.a11y-link:hover,
.a11y-link:focus-visible { color: var(--mlq-readable-gold-on-light) !important; }

/* Forms and login controls: readable type plus a dependable touch rectangle. */
.review-form :where(.form-input, .form-select, .form-textarea),
:where(.f-input, .f-select, .f-textarea),
.woocommerce :where(input:not([type='hidden']):not([type='radio']), select, textarea) {
  min-block-size: 44px !important;
  font-size: 16px !important;
}

.review-form :where(.form-input, .form-select, .form-textarea) {
  inline-size: 100%;
  padding: 11px 13px;
  color: var(--mlq-readable-ink);
  background: #fff;
  border: 1px solid rgba(45, 40, 31, 0.38);
  border-radius: 2px;
}

.review-form .form-textarea { min-block-size: 132px !important; resize: vertical; }

:where(.btn-submit, .btn-discover-cta, .btn-f-submit, .btn-share),
.woocommerce :where(.button, button),
.sm-help {
  min-block-size: 44px !important;
}

.review-form .btn-submit {
  min-block-size: 50px !important;
  padding: 12px 20px;
}

.sm-help {
  inline-size: 44px !important;
  block-size: 44px !important;
}

.woocommerce .password-input { position: relative; display: block; }
.woocommerce button.show-password-input {
  inline-size: 44px !important;
  block-size: 44px !important;
  min-inline-size: 44px !important;
  min-block-size: 44px !important;
  padding: 0 !important;
  inset-inline-end: 0 !important;
  top: 50% !important;
  transform: translateY(-50%);
}

.woocommerce input[type='checkbox'] {
  inline-size: 24px !important;
  block-size: 24px !important;
}

/* WCAG 2.2's 24px floor is exceeded without relying on spacing exceptions. */
.lang-toggle,
.zone-indicator,
.cart-btn,
.nav-hamburger {
  min-block-size: 44px !important;
}

/* These two page-level controls previously sat on top of the real header. */
.sm-page { padding-block-start: calc(var(--nav-h, 132px) + 76px) !important; }
.sm-nav-corner {
  top: calc(var(--nav-h, 132px) + 12px) !important;
  min-block-size: 44px;
  display: inline-flex;
  align-items: center;
}

/* Hero controls sit on unpredictable photography: give them a stable field. */
nav:not(.nav-light):not(.scrolled) :where(.lang-toggle, .zone-indicator, .cart-btn, .nav-hamburger) {
  background: rgba(13, 11, 9, 0.78) !important;
  border-color: rgba(253, 245, 224, 0.75) !important;
  color: #fdf5e0 !important;
}

/* The wordmark artwork is transparent. On photography/dark heroes use its
 * light treatment directly; painting an opaque paper rectangle behind it made
 * the mobile brand mark read as a pasted-on square. Paper/scrolled headers keep
 * the existing dark-ink treatment below. */
html:not(.a11y-invert) body:not(.malqeta-atarah-product):not(.page-template-page-atarot):not(.page-template-page-atarot-he) nav:not(.nav-light):not(.scrolled) .nav-logo {
  position: relative;
}

html:not(.a11y-invert) body:not(.malqeta-atarah-product):not(.page-template-page-atarot):not(.page-template-page-atarot-he) nav:not(.nav-light):not(.scrolled) .nav-logo-img {
  filter: brightness(0) invert(1) sepia(7%) saturate(112%) brightness(103%) !important;
}

html:not(.a11y-invert) .nav-logo::before {
  content: none !important;
}

/* Atarah and Atarot use a pale paper header: keep the mobile cart glyph in the
 * same dark ink as the logo rather than inheriting the photo-header treatment. */
body.malqeta-atarah-product #nav .cart-btn::before,
body.page-template-page-atarot #nav .cart-btn::before,
body.page-template-page-atarot-he #nav .cart-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c4f3d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z'/%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cpath d='M16 10a4 4 0 01-8 0'/%3E%3C/svg%3E") !important;
}

/* Hebrew is not uppercased or widely tracked. */
body.malqeta-he :where(
  .nav-eyebrow-text, .eyebrow-text, .policy-eyebrow,
  .reviews-hero-eyebrow, .review-hero-eyebrow, .reviews-cta-eyebrow,
  .giving-eyebrow-text, .grid-eyebrow-text, .craft-fact-label,
  .coll-reviews-link, .footer-soon-tag
) {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* Hebrew typography never uses Latin all-caps or tracked-out letters. */
body.malqeta-he :where(h1, h2, h3, h4, p, a, button, label, legend,
                       summary, li, dt, dd, span) {
  letter-spacing: normal !important;
  text-transform: none !important;
}

/* Keep Style Match's redundant page controls below the real mobile header. */
@media (max-width: 600px) {
  body.malqeta-he .nav-eyebrow-text {
    font-size: 10px !important;
  }

  .lang-toggle,
  .zone-indicator,
  .cart-btn,
  .nav-hamburger {
    min-inline-size: 44px !important;
    min-block-size: 44px !important;
    inline-size: 44px !important;
    block-size: 44px !important;
  }

}

@media (max-width: 380px) {
  nav,
  nav.scrolled { padding-inline: 8px !important; }
  .nav-left,
  .nav-right { gap: 4px !important; }
  .nav-logo-img,
  nav.scrolled .nav-logo-img { block-size: 28px !important; max-inline-size: none !important; }
}

@media (prefers-contrast: more) {
  :root { --mlq-readable-gold-on-light: #684813; --mlq-readable-gold-on-dark: #f1d798; }
}
