/*
Theme Name: AffiliateCMS Child
Theme URI: https://lat.vn/
Description: Child theme for AffiliateCMS Theme. Add your custom styles and overrides here.
Author: AffiliateCMS Team
Author URI: https://lat.vn/
Template: affiliateCMS-theme
Version: 1.0.2
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: affiliatecms-child
*/

/* ==========================================================================
   Custom Styles - Add your overrides below
   ========================================================================== */

/* ==========================================================================
   Desk & Bench brand tokens, "Plywood & Ink" (brand sheet option A)
   Single source of truth; overrides the parent core/tokens.css (same :root and
   [data-theme="dark"] selectors, loaded later). Image colors in
   inc/featured-image.php copy these values; change both together.
   Contrast (WCAG AA, approx.):
   light  #1D3B5C on #F7F6F2 10.6, white on #1D3B5C 11.46, #1B1F24 on #F7F6F2 15.31
          #8A5F27 on #F7F6F2 5.18 (wood text), #1B1F24 on #B5833F 4.95 (wood button)
   dark   #8FB1DE on #0C0E12 8.75 (on #1A1D24 7.64), #D4A464 on #0C0E12 8.55
   The plain wood #B5833F (3.09 on paper) is for fills and rules, never small text.
   ========================================================================== */
:root {
    --dnb-ink: #1D3B5C;
    --dnb-wood: #B5833F;
    --dnb-wood-text: #8A5F27;
    --dnb-paper: #F7F6F2;
    --dnb-text: #1B1F24;

    --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Zilla Slab', Rockwell, 'Roboto Slab', Georgia, serif;

    --color-primary: #1D3B5C;
    --color-primary-hover: #152C45;
    --color-primary-dark: #102236;
    --color-primary-light: #E6ECF2;
    --color-primary-rgb: 29, 59, 92;
    --shadow-primary: 0 4px 14px rgba(29, 59, 92, 0.22);

    --color-accent: #B5833F;
    --color-accent-rgb: 181, 131, 63;
    --color-accent-hover: #C49455;
    --color-accent-light: #F5ECDD;
    --shadow-accent: 0 4px 14px rgba(181, 131, 63, 0.25);

    --color-text: #1B1F24;
    --color-bg: #F7F6F2;
    --color-bg-alt: #EFEDE6;
    --color-border: #E2DFD6;
    --color-border-subtle: #ECE9E1;
    --color-border-strong: #CFCBC0;

    /* Header ground, text on filled primary / accent surfaces */
    --dnb-header-bg: var(--dnb-paper);
    --dnb-on-primary: #FFFFFF;
    --dnb-on-accent: #1B1F24;
    --dnb-accent-text: var(--dnb-wood-text);
}

[data-theme="dark"] {
    --color-primary: #8FB1DE;
    --color-primary-hover: #A9C4E7;
    --color-primary-dark: #1D3B5C;
    --color-primary-light: rgba(143, 177, 222, 0.15);
    --color-primary-rgb: 143, 177, 222;
    --shadow-primary: 0 4px 14px rgba(143, 177, 222, 0.25);

    --color-accent: #D4A464;
    --color-accent-rgb: 212, 164, 100;
    --color-accent-hover: #E0B87F;
    --color-accent-light: rgba(212, 164, 100, 0.15);
    --shadow-accent: 0 4px 14px rgba(212, 164, 100, 0.25);

    /* Parent dark neutrals stay (bg #0C0E12, surface #1A1D24) */
    --color-text: #F5F5F5;
    --color-bg: #0C0E12;
    --color-bg-alt: #12151A;
    --color-border: #2D323C;
    --color-border-subtle: #23272F;
    --color-border-strong: #3D4450;

    --dnb-header-bg: var(--color-surface);
    --dnb-on-primary: #0C0E12;
    --dnb-on-accent: #0C0E12;
    --dnb-accent-text: #D4A464;
}

/* Headings: Zilla Slab (body text follows --font-sans = Source Sans 3) */
h1, h2, h3, h4, h5, h6,
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    font-family: var(--font-heading);
    letter-spacing: 0;
}

/* Header: paper ground and slab wordmark as on the brand sheet */
.site-header {
    background-color: var(--dnb-header-bg);
}

.site-logo__text {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0;
}

.header__menu > .menu-item > a:hover,
.header__menu > .menu-item.current-menu-item > a {
    color: var(--color-primary);
    background-color: rgba(var(--color-primary-rgb), 0.08);
}

/* Links in content: ink, underline in wood */
.post-content a:not([class]):not([target="_blank"]),
.post-content a[target="_blank"]:not([class]) {
    text-decoration-color: rgba(var(--color-accent-rgb), 0.6);
}

/* Buttons: text color per fill (class doubled, no !important) */
.btn.btn--primary,
.btn.btn--primary:hover,
.acms-btn.acms-btn--primary {
    color: var(--dnb-on-primary);
}

.btn.btn--accent,
.btn.btn--accent:hover {
    color: var(--dnb-on-accent);
}

/* Wood as text needs the darker shade on light ground */
.text-accent,
.verified-badge.verified-badge--admin,
.post-content code:not([class*="language-"]):not(pre code) {
    color: var(--dnb-accent-text);
}

/* Dark mode: swap the ink-coloured logo PNG for the paper-coloured SVG */
[data-theme="dark"] .custom-logo,
[data-theme="dark"] .footer__logo-img {
	content: url("assets/brand/logo-dark.svg");
}
