/* Shared brand tokens update navigation, cards, articles, forms and product widgets. */
:root {
    --bph-ocean: #075b9e;
    --bph-ocean-hover: #06467b;
    --bph-navy: #07366a;
    --bph-aqua: #00bfe5;
    --bph-sun: #ff9900;
    --bph-sun-hover: #ffb533;
    --bph-on-sun: #07366a;

    --color-primary: var(--bph-ocean);
    --color-primary-hover: var(--bph-ocean-hover);
    --color-primary-dark: var(--bph-navy);
    --color-primary-light: #e6f5fc;
    --color-primary-rgb: 7, 91, 158;
    /* Dark orange keeps accent text readable; solid CTAs use the logo's bright orange. */
    --color-accent: #ad5000;
    --color-accent-hover: #873e00;
    --color-accent-light: #fff3df;
    --color-success: #16713f;
    --color-success-light: #e9f6ed;
    --color-warning: #945600;
    --color-warning-light: #fff3d6;
    --color-error: #c83232;
    --color-error-light: #fff0ef;
    --color-info: #075b9e;
    --color-info-light: #e6f5fc;

    --color-text: #12304b;
    --color-text-secondary: #405970;
    --color-text-muted: #587087;
    --color-text-subtle: #61768a;
    --color-bg: #f5fafe;
    --color-bg-alt: #eaf5fc;
    --color-surface: #ffffff;
    --color-surface-raised: #ffffff;
    --color-surface-hover: #edf7fd;
    --color-border: #d3e4f0;
    --color-border-subtle: #e2eef6;
    --color-border-strong: #a8c9e0;
    --color-overlay: rgba(7, 36, 65, 0.55);
    --shadow-primary: 0 4px 14px rgba(7, 91, 158, 0.2);
    --shadow-accent: 0 4px 14px rgba(255, 153, 0, 0.22);

    --acms-primary-rgb: var(--color-primary-rgb);
    --acms-price-color: var(--color-accent);
    --acms-price-original: var(--color-text-muted);
    --acms-amazon-orange: var(--bph-sun);
    --acms-amazon-orange-hover: var(--bph-sun-hover);
    --acms-star-active: #a86100;
    --acms-star-inactive: #a8c9e0;
}

/* Preserve the existing theme toggle with a matching deep-ocean palette. */
[data-theme="dark"] {
    --color-primary: #67d5f5;
    --color-primary-hover: #a5eaff;
    --color-primary-dark: #35bce8;
    --color-primary-light: rgba(0, 191, 229, 0.14);
    --color-primary-rgb: 103, 213, 245;
    --color-accent: #ffb533;
    --color-accent-hover: #ffd080;
    --color-accent-light: rgba(255, 153, 0, 0.14);
    --color-success: #79dba3;
    --color-success-light: rgba(121, 219, 163, 0.12);
    --color-warning: #ffcb70;
    --color-warning-light: rgba(255, 203, 112, 0.12);
    --color-error: #ff9995;
    --color-error-light: rgba(255, 153, 149, 0.12);
    --color-info: #67d5f5;
    --color-info-light: rgba(103, 213, 245, 0.12);
    --color-text: #ecf7ff;
    --color-text-secondary: #c5dbea;
    --color-text-muted: #a0bdd1;
    --color-text-subtle: #91aec3;
    --color-bg: #071a2c;
    --color-bg-alt: #0b243b;
    --color-surface: #102e48;
    --color-surface-raised: #173a57;
    --color-surface-hover: #1b4261;
    --color-border: #2b526f;
    --color-border-subtle: #20445f;
    --color-border-strong: #527b98;
    --color-overlay: rgba(3, 15, 27, 0.7);
    --shadow-primary: 0 4px 14px rgba(0, 191, 229, 0.18);
    --shadow-accent: 0 4px 14px rgba(255, 153, 0, 0.18);
    --acms-star-active: #ffcb70;
    --acms-star-inactive: #527b98;
}

/* Solid blue actions retain readable white labels in both themes. */
.btn--primary,
.acms-btn--primary {
    color: #ffffff;
    background-color: var(--bph-ocean);
    border-color: var(--bph-ocean);
}

.btn--primary:hover,
.acms-btn--primary:hover {
    color: #ffffff;
    background-color: var(--bph-ocean-hover);
    border-color: var(--bph-ocean-hover);
}

/* Sunshine orange highlights the main action and purchase links. */
.header__cta,
.mobile-nav__cta,
.btn--accent,
.acms-btn--amazon {
    color: var(--bph-on-sun);
    background: var(--bph-sun);
    border-color: var(--bph-sun);
    box-shadow: var(--shadow-accent);
}

.header__cta:hover,
.mobile-nav__cta:hover,
.btn--accent:hover,
.acms-btn--amazon:hover {
    color: var(--bph-on-sun);
    background: var(--bph-sun-hover);
    border-color: var(--bph-sun-hover);
}

.site-header {
    border-bottom-color: var(--color-border-strong);
    box-shadow: 0 2px 12px rgba(7, 54, 106, 0.06);
}

/* A thin water-color edge ties the footer back to the pool illustration. */
.site-footer {
    --color-text: #edf8ff;
    --color-text-secondary: #d2e8f7;
    --color-text-muted: #bad6e9;
    --color-text-subtle: #bad6e9;
    --color-primary: #83e4ff;
    --color-primary-hover: #c2f3ff;
    --color-border-subtle: #31597e;
    --color-bg-alt: #164d7d;
    --color-surface-raised: #164d7d;
    --color-surface: #07366a;
    --color-surface-hover: #164d7d;
    background-color: #07366a;
    border-top: 3px solid var(--bph-aqua);
    color: var(--color-text);
}

.site-footer .footer__logo-icon {
    background: var(--bph-ocean);
}

/* Clear keyboard navigation uses the same ocean color as active links. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
}

::selection {
    background-color: var(--color-primary-light);
    color: var(--color-text);
}

/* White labels on filled controls need a darker blue than dark-mode text links. */
[data-theme="dark"] :is(
    .icon-badge, .social-link--fill:hover, .page-numbers.current,
    .section-header-v2__link:hover, .load-more__btn:hover:not(:disabled),
    .skip-link, .cat1-header__icon, .cat2-tabs__nav:hover,
    .cat2-tab-pill.is-active, .cat2-tab-chip.is-active,
    .load-more__btn--secondary:hover, .related-content__link:hover,
    .related-slider__arrow:hover, .cat-dir__filter-btn.is-active,
    .no-results__search .ai-input__icon, .no-results__search .ai-input__send,
    .pagination__item--current, .contact-featured__main-icon,
    .contact-social-link:hover, .contact-featured__item-icon,
    .comment-form__compact-btn, .comment-form__submit,
    .comment--featured .comment__avatar--initial, .comment__reply-form-submit,
    .cat-header--centered .cat-child:hover .cat-child__icon,
    .popular-post:hover .popular-post__number,
    .sidebar-category:hover .sidebar-category__count, .sidebar-tag:hover,
    .toc-expandable__icon, .toc-expandable__link:hover .toc-expandable__number,
    .toc-expandable__link.is-active .toc-expandable__number,
    .toc-bubble__trigger, .toc-bubble__link.is-active, .toc-bubble__back-top:hover
) {
    background: var(--bph-ocean);
    color: #ffffff;
}
