/* ==========================================================================
   PESWACOIN BRAND SCHEME (Settings → Peswacoin → Brand colours)
   60-30-10: white 60%, yellow #FFD100 30%, navy #01008C 10%, black text.
   Loaded after the design tokens on the website, the member app and the
   Peswacoin admin. The main colours (yellow, backgrounds, text) come from
   the scheme's Peswacoin Design values; this file adds what those don't
   cover. `html:root` outranks the tokens wherever this file is loaded.
   Readability rules: yellow is never text on white (navy instead), and
   anything on yellow is black or navy, never white or yellow.
   ========================================================================== */

/* Both modes ---------------------------------------------------------------- */
html:root {
    --psw-gold-300: 255 236 153;
    --psw-gold-700: 179 143 0;
    --psw-on-gold: 0 0 0;
    --psw-navy: 1 0 140;
    --psw-shadow-gold: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 6px 18px -6px rgba(230, 184, 0, 0.55);
}

/* Light (opens first) ------------------------------------------------------- */
html:root[data-psw-theme='light'] {
    --psw-line: rgba(1, 0, 140, 0.08);
    --psw-line-strong: rgba(1, 0, 140, 0.15);
    --psw-ink-2: 62 62 88;
    --psw-ink-3: 108 108 132;
    --psw-surface-2: 240 240 248;
    --psw-surface-3: 229 229 242;
    --psw-gold-wash: rgba(255, 209, 0, 0.22);
    --psw-warn: 196 88 0;
    --psw-info: 1 0 140;
    --psw-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --psw-shadow-card: 0 1px 2px rgba(1, 0, 60, 0.06), 0 10px 30px -12px rgba(1, 0, 60, 0.14);
    --psw-shadow-hero: 0 2px 4px rgba(1, 0, 60, 0.06), 0 24px 50px -20px rgba(1, 0, 60, 0.22);
    --psw-shadow-pop: 0 0 0 1px rgba(1, 0, 60, 0.06), 0 24px 64px -12px rgba(1, 0, 60, 0.28);
    --psw-glow: none;
    --psw-product-shadow: drop-shadow(0 12px 22px rgba(1, 0, 140, 0.16));
    --psw-product-shadow-hover: drop-shadow(0 16px 30px rgba(1, 0, 140, 0.24));
    --psw-product-shadow-sm: drop-shadow(0 3px 8px rgba(1, 0, 140, 0.18));
    --psw-backdrop: rgba(1, 0, 40, 0.35);
}

/* Dark (navy) --------------------------------------------------------------- */
html:root[data-psw-theme='dark'] {
    --psw-line: rgba(255, 255, 255, 0.08);
    --psw-line-strong: rgba(255, 255, 255, 0.14);
    --psw-ink-2: 186 188 220;
    --psw-ink-3: 128 130 175;
    --psw-surface-2: 18 18 72;
    --psw-surface-3: 27 27 92;
    --psw-gold-wash: rgba(255, 209, 0, 0.12);
    --psw-warn: 255 145 77;
    --psw-info: 140 160 255;
    --psw-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --psw-glow: radial-gradient(120% 80% at 100% 0%, rgba(255, 209, 0, 0.14) 0%, transparent 55%);
    --psw-product-shadow: drop-shadow(0 14px 28px rgba(255, 209, 0, 0.2));
    --psw-product-shadow-hover: drop-shadow(0 18px 36px rgba(255, 209, 0, 0.32));
    --psw-product-shadow-sm: drop-shadow(0 4px 10px rgba(255, 209, 0, 0.22));
    --psw-backdrop: rgba(2, 2, 20, 0.7);
}

/* Highlighted words in headings: navy on white, never yellow. */
html[data-psw-theme='light'] :is(h1, h2) em {
    background: none !important;
    -webkit-text-fill-color: rgb(1 0 140) !important;
    color: rgb(1 0 140) !important;
}

/* Brand areas (light mode) ---------------------------------------------------
   Inside a yellow area every accent turns navy; inside a navy area text turns
   white and accents stay yellow. */
html[data-psw-theme='light'] :is(.psw-hero, .psw-hero2, .psw-closing, .psw-section:has(.psw-products), [data-psw-area='topbar'], [data-psw-area='vault-hero'], [data-psw-area='spot-card']) {
    background: rgb(255 209 0) !important;
    --psw-surface: 255 209 0;
    --psw-surface-2: 255 226 92;
    --psw-surface-3: 255 236 153;
    --psw-ink: 0 0 0;
    --psw-ink-2: 38 34 0;
    --psw-ink-3: 74 64 0;
    --psw-line: rgba(0, 0, 0, 0.12);
    --psw-line-strong: rgba(0, 0, 0, 0.2);
    --psw-gold-300: 60 60 200;
    --psw-gold-400: 20 20 170;
    --psw-gold-500: 1 0 140;
    --psw-gold-600: 1 0 110;
    --psw-gold-text: 1 0 140;
    --psw-gold-wash: rgba(1, 0, 140, 0.1);
    --psw-on-gold: 255 255 255;
    --psw-glow: none;
    --psw-shadow-gold: 0 6px 18px -8px rgba(1, 0, 140, 0.6);
    --pd-btn-bg: rgb(1 0 140);
    --pa-btn-bg: linear-gradient(rgb(1 0 140), rgb(1 0 140));
}
html[data-psw-theme='light'] :is(.psw-hero, .psw-hero2, .psw-closing)::before,
html[data-psw-theme='light'] :is(.psw-hero, .psw-hero2, .psw-closing)::after { opacity: 0 !important; }
html[data-psw-theme='light'] :is(.psw-hero, .psw-hero2, .psw-closing, .psw-section:has(.psw-products)) :is(h1, h2) { color: #000 !important; }
/* Cards on a yellow band stay white, so products read clearly. */
html[data-psw-theme='light'] .psw-section:has(.psw-products) .psw-product { --psw-surface: 255 255 255; background: #fff; }
/* The header sits over the yellow hero: its buttons are navy too. */
html[data-psw-theme='light'] .psw-header { --pd-btn-bg: rgb(1 0 140); }
html[data-psw-theme='light'] :is(.psw-header, .psw-hero, .psw-hero2, .psw-closing, .psw-section:has(.psw-products)) .wp-block-button:not(.is-style-outline) > .wp-block-button__link { color: #fff !important; }
html[data-psw-theme='light'] :is(.psw-header, .psw-hero, .psw-hero2, .psw-closing) .wp-block-button.is-style-outline > .wp-block-button__link { background: rgba(255, 255, 255, 0.6) !important; color: rgb(1 0 140) !important; border-color: rgba(1, 0, 140, 0.35) !important; }
html[data-psw-theme='light'] :is([data-psw-area='topbar'], [data-psw-area='vault-hero'], [data-psw-area='spot-card']) .psw-gold-metal { color: #fff !important; }

html[data-psw-theme='light'] :is(.psw-ticker, .psw-marquee, .psw-footer, [data-psw-area='ticker'], [data-psw-area='activity-card'], [data-psw-area='account-card']) {
    background: rgb(1 0 140) !important;
    color: #fff;
    --psw-canvas: 1 0 140;
    --psw-surface: 1 0 140;
    --psw-surface-2: 20 20 160;
    --psw-ink: 255 255 255;
    --psw-ink-2: 205 206 235;
    --psw-ink-3: 160 162 210;
    --psw-line: rgba(255, 255, 255, 0.14);
    --psw-line-strong: rgba(255, 255, 255, 0.22);
    --psw-gold-text: 255 209 0;
    --psw-gold-wash: rgba(255, 209, 0, 0.16);
}
html[data-psw-theme='light'] :is(.psw-ticker, .psw-marquee, .psw-footer) :is(a, p, li, span, h2, h3, h4) { border-color: rgba(255, 255, 255, 0.14); }

/* Navigation: the open page is navy with white text (white sidebar). */
html[data-psw-theme='light'] :is([data-psw-area='sidebar'], [data-psw-area='admin-sidebar']) a[aria-current='page'] { color: #fff !important; }
html[data-psw-theme='light'] :is([data-psw-area='sidebar'], [data-psw-area='admin-sidebar']) a[aria-current='page'] svg { color: #fff !important; }
html[data-psw-theme='light'] [data-psw-area='sidebar'] a[aria-current='page'] > .psw-bg-gold-wash,
html[data-psw-theme='light'] [data-psw-area='admin-sidebar'] a[aria-current='page'] { background: rgb(1 0 140) !important; }
html[data-psw-theme='light'] [data-psw-area='bottom-nav'] a[aria-current='page'] { color: rgb(1 0 140) !important; }
html[data-psw-theme='light'] [data-psw-area='bottom-nav'] a[aria-current='page'] .psw-bg-gold { background: rgb(1 0 140) !important; }

/* The client's logo (assets/brand/peswacoin) -------------------------------- */
/* Website header and footer: the wordmark replaces the coin and name. */
.psw-brand > img { display: none !important; }
/* The name stays for screen readers; the logo image says the same visually. */
html .psw-brand > .psw-brand__name { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
.psw-brand {
    width: 196px;
    height: 26px;
    background: url('../brand/peswacoin/peswacoin-wordmark-navy.svg') left center / contain no-repeat;
}
html[data-psw-theme='dark'] .psw-brand { background-image: url('../brand/peswacoin/peswacoin-wordmark-yellow.svg'); }
/* Navy footer: the full logo, yellow with a white tagline. */
html .psw-footer .psw-brand { width: 220px; height: 44px; background-image: url('../brand/peswacoin/peswacoin-logo-on-dark.svg'); }
html[data-psw-theme='dark'] .psw-footer .psw-brand { background-image: url('../brand/peswacoin/peswacoin-logo-on-dark.svg'); }
/* The giant footer word becomes the wordmark itself. */
.psw-footer__giant > span { visibility: hidden; }
.psw-footer__giant { position: relative; }
.psw-footer__giant::after {
    content: '';
    position: absolute;
    inset: 8% 0;
    background: url('../brand/peswacoin/peswacoin-wordmark-yellow.svg') center / contain no-repeat;
    opacity: 1;
}
@media (max-width: 781px) {
    .psw-header .psw-brand { width: 150px; height: 20px; }
}

/* More navy in the app (towards 10%): headings, and the secondary buttons on the vault card. */
html[data-psw-theme='light'] #peswacoin-app-root main :is(h2, h3) { color: rgb(1 0 140); }
html[data-psw-theme='light'] [data-psw-area='vault-hero'] .psw-app-btn:not(.psw-gold-metal) {
    background: transparent !important;
    color: rgb(1 0 140) !important;
    box-shadow: inset 0 0 0 1.5px rgb(1 0 140) !important;
}
html[data-psw-theme='light'] #peswacoin-app-root .psw-app-btn[class*='psw-bg-surface-2']:not(.psw-gold-metal) {
    background: rgb(1 0 140 / 0.07) !important;
    color: rgb(1 0 140) !important;
}

/* Navy cards in the app (towards 10% navy): Recent activity and the account card. */
html[data-psw-theme='light'] :is([data-psw-area='activity-card'], [data-psw-area='account-card']) { border-color: rgb(1 0 140) !important; }
@media (max-width: 1023px) {
    /* The narrow sidebar shows only the avatar: no navy box there. */
    html[data-psw-theme='light'] [data-psw-area='account-card'] { background: transparent !important; }
}

/* The verify page's own header (distraction-free layout): the full logo with its tagline. */
.psw-focus-brand > img { display: none !important; }
html .psw-focus-brand > span { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
.psw-focus-brand { width: 230px; height: 46px; background: url('../brand/peswacoin/peswacoin-logo-navy.svg') center / contain no-repeat; }
html[data-psw-theme='dark'] .psw-focus-brand { background-image: url('../brand/peswacoin/peswacoin-logo-on-dark.svg'); }
