/**
 * Naya Laptop — i18n + theme UI extensions.
 *
 * Covers:
 *   1. nl-hero overrides: white background in Light theme, dark card stays.
 *   2. Language switcher (.nl-lang-switcher).
 *   3. Theme switcher (.nl-theme-switcher).
 *   4. RTL logical-property overrides for dir="rtl".
 *   5. Active filter chips (.filter-chips).
 *
 * Loaded after site.css and commerce.css on every page via naya_head().
 * Does NOT override palette tokens — all colours come from existing vars.
 */

/* ============================================================
   1. NL-HERO — theme-matched translucent copy surfaces
   ============================================================
   Owner feedback: "для світлої теми херо секцію зробити білою
   а не синьою а тексти навпаки чорними або темно синіми".

   The copy panel uses a 67% theme-matched surface in both themes,
   letting the hero photo show through without changing text colors.
   ============================================================ */

.nl-hero {
    background: var(--white);
}

/* The shot covers the full section height as a positioned backdrop;
   on narrow screens it collapses to a top banner. */
.nl-hero-shot {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.nl-hero-shot picture,
.nl-hero-shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* Copy lives above the shot */
.nl-hero { position: relative; }
.nl-hero-grid { position: relative; z-index: 1; }

/* Light: copy panel — white card with subtle shadow */
.nl-hero-grid > div {
    padding: 44px 48px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--white) 67%, transparent);
    box-shadow: var(--shadow-card);
    max-width: 640px;
}

/* The light theme uses a white copy card, so dark-band text roles use the
   storefront's measured light-surface colors instead. */
:root:not([data-theme="dark"]) .nl-hero h1 {
    color: var(--ink);
}

:root:not([data-theme="dark"]) .nl-hero .nl-hero-lead {
    color: var(--muted-strong);
}

:root:not([data-theme="dark"]) .nl-hero .nl-hero-facts li {
    border-color: var(--line-strong);
    color: var(--muted-strong);
}

:root:not([data-theme="dark"]) .nl-hero .nl-eyebrow {
    color: var(--brand);
}

:root:not([data-theme="dark"]) .nl-hero .nl-hero-note {
    color: var(--muted-2);
}

:root:not([data-theme="dark"]) .nl-hero .nl-btn-band {
    border-color: var(--brand);
    background: transparent;
    color: var(--brand);
}

:root:not([data-theme="dark"]) .nl-hero .nl-btn-band:hover {
    border-color: var(--brand-dark);
    background: color-mix(in srgb, var(--brand) 8%, transparent);
    color: var(--brand-dark);
}

@media (max-width: 992px) {
    .nl-hero-grid { padding-block: 48px 16px; }
    .nl-hero-grid > div { padding: 24px 28px; }
}

/* Dark: the wash covers the photo so no white card needed */
:root[data-theme="dark"] .nl-hero {
    background: var(--paper);
}
:root[data-theme="dark"] .nl-hero-shot::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--band-wash-strong) 0 40%, var(--band-wash-mid) 65%, var(--band-wash-soft) 100%);
    content: "";
}
:root[data-theme="dark"] .nl-hero-grid > div {
    background: color-mix(in srgb, var(--paper) 67%, transparent);
    box-shadow: none;
}
:root[data-theme="dark"] .nl-hero-grid h1,
:root[data-theme="dark"] .nl-hero-grid .nl-eyebrow,
:root[data-theme="dark"] .nl-hero-grid .nl-hero-lead,
:root[data-theme="dark"] .nl-hero-grid .nl-hero-facts li {
    color: var(--on-dark);
}
:root[data-theme="dark"] .nl-hero-grid .nl-hero-note {
    color: var(--on-dark);
    opacity: .75;
}

/* Narrow: no card frame — full-width copy below the photo */
@media (max-width: 776px) {
    .nl-hero-grid { padding-block: 24px 16px; }
    .nl-hero-shot {
        position: relative;
        inset: auto;
        height: 320px;
    }
    .nl-hero-grid > div {
        padding: 20px 20px 16px;
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
    }
    :root[data-theme="dark"] .nl-hero-shot::after {
        background: linear-gradient(180deg, transparent 30%, var(--band-wash-strong));
    }
}

/* ============================================================
   2. LANGUAGE SWITCHER  .nl-lang-switcher
   ============================================================ */

.nl-lang-switcher,
.nl-theme-switcher {
    position: relative;
    display: flex;
    align-items: center;
    max-height: 50px;
}

.nl-lang-switcher > summary,
.nl-theme-switcher > summary {
    display: none;
}

.nl-lang-trigger,
.nl-theme-trigger {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
}

.nl-lang-trigger::-webkit-details-marker,
.nl-theme-trigger::-webkit-details-marker {
    display: none;
}

.nl-lang-options,
.nl-theme-options {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
}

.nl-lang-options a,
.nl-lang-options span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 6px;
    border-radius: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .05em;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
}

.nl-lang-switcher a:hover {
    background: var(--soft);
    color: var(--ink);
}

.nl-lang-switcher span[aria-current="true"] {
    background: var(--brand);
    color: var(--on-brand);
}

/* ============================================================
   3. THEME SWITCHER  .nl-theme-switcher
   ============================================================ */

.nl-theme-options button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 5px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .04em;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
}

.nl-theme-options button:hover {
    background: var(--soft);
    color: var(--ink);
}

.nl-theme-options button.is-active {
    background: var(--brand);
    color: var(--on-brand);
}

.nl-theme-options button:focus-visible,
.nl-lang-trigger:focus-visible,
.nl-theme-trigger:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
}

/* ============================================================
   4. RTL LOGICAL PROPERTIES
   ============================================================
   Elements in the storefront that use physical left/right
   properties need mirroring under dir="rtl". We patch only
   the cases that cannot be fixed by switching to logical props
   in the existing stylesheets without touching them.
   New code in layout.php already uses logical props; these
   rules correct the older site.css declarations.
   ============================================================ */

[dir="rtl"] .nl-header-inner,
[dir="rtl"] .nl-footer-grid,
[dir="rtl"] .nl-nav-inner {
    direction: rtl;
}

[dir="rtl"] .nl-brand {
    flex-direction: row-reverse;
}

/* Pager previous/next swap */
[dir="rtl"] .nl-hero-grid > div {
    text-align: start;
}

/* FAQ toggle pip */
[dir="rtl"] .faq-toggle::before,
[dir="rtl"] .faq-toggle::after {
    inset-inline-start: 6px;
    inset-inline-end: auto;
}

/* Contact card art flips to the left */
[dir="rtl"] .contact-card-art {
    inset: 0 auto 0 0;
}
[dir="rtl"] .contact-card::after {
    background: linear-gradient(270deg, var(--band-wash-strong) 0 42%, var(--band-wash-mid) 60%, var(--band-wash-soft) 100%);
}

/* Art-tag physical position */
[dir="rtl"] .art-tag {
    right: 22px;
    left: auto;
}
[dir="rtl"] .art-caption {
    right: 18px;
    left: 18px;
}

/* Skip link */
[dir="rtl"] .skip-link {
    left: auto;
    right: 12px;
}

/* ============================================================
   5. ACTIVE FILTER CHIPS  .filter-chips
   ============================================================ */

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.filter-chips-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: var(--soft);
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
}

.filter-chip:hover {
    background: var(--tint);
    border-color: var(--brand);
    color: var(--brand);
}

.filter-chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--line-strong);
    color: var(--muted-strong);
    font-size: 10px;
    line-height: 1;
    transition: background .15s ease;
}

.filter-chip:hover .filter-chip-x {
    background: var(--brand);
    color: var(--on-brand);
}

.filter-chips-clear {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.filter-chips-clear:hover {
    background: var(--soft);
    color: var(--ink);
    border-color: var(--muted);
}

/* ============================================================
   6. NL-HEADER controls row (lang + theme switchers)
   ============================================================ */

/* Inject the switchers into the quick-nav area */
.nl-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 992px) {
    .nl-controls { gap: 6px; }
    .nl-lang-switcher > summary,
    .nl-theme-switcher > summary { display: inline-flex; }
    .nl-lang-switcher[open] > .nl-lang-trigger,
    .nl-theme-switcher[open] > .nl-theme-trigger { color: var(--brand); }
    .nl-lang-switcher > .nl-lang-options,
    .nl-theme-switcher > .nl-theme-options { display: none; }
    .nl-lang-switcher[open] > .nl-lang-options,
    .nl-theme-switcher[open] > .nl-theme-options {
        display: flex;
        position: absolute;
        z-index: 60;
        top: calc(100% + 6px);
        inset-inline-end: 0;
        box-shadow: var(--shadow-card);
    }
    .nl-theme-switcher[open] > .nl-theme-options { inset-inline-end: 0; }
}

@media (max-width: 480px) {
    .nl-lang-options a,
    .nl-lang-options span,
    .nl-theme-options button {
        min-width: 44px;
        min-height: 44px;
        padding-inline: 4px;
        font-size: 10px;
    }
}
