/* ============================================================
   DESNORA ARTICLE THEME - article-theme.css
   Loaded only on blog-post.php and blog-post-N.php (see includes/header.php).
   html.art-themed[data-theme="dark"|"light"] is set by the inline head script.
   Dark mode = the site's normal look. Everything below for light mode is
   scoped to html[data-theme="light"], so no other page is affected.
   ============================================================ */

/* ---------- theme toggle (both modes) ---------- */
.art-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.4rem;
}

.art-hero-top .ph-crumbs {
    margin-bottom: 0;
}

.art-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem 0.45rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font: 600 0.82rem 'Inter', sans-serif;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.art-theme-toggle:hover {
    border-color: rgba(37, 244, 238, 0.55);
    transform: translateY(-1px);
}

.art-theme-toggle:focus-visible {
    outline: 2px solid #25F4EE;
    outline-offset: 3px;
}

.art-theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* In dark mode show the sun ("switch to light"); in light mode show the moon */
.art-tt-moon,
.art-tt-to-dark {
    display: none;
}

html[data-theme="light"] .art-tt-sun,
html[data-theme="light"] .art-tt-to-light {
    display: none;
}

html[data-theme="light"] .art-tt-moon,
html[data-theme="light"] .art-tt-to-dark {
    display: inline;
}

.art-tt-sun {
    color: #FFC24B;
}

/* smooth switch only while toggling (never on first paint) */
html.theme-anim body,
html.theme-anim body *,
html.theme-anim body *::before,
html.theme-anim body *::after {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, fill 0.35s ease, stroke 0.35s ease !important;
}

@media (prefers-reduced-motion: reduce) {
    html.theme-anim body,
    html.theme-anim body *,
    html.theme-anim body *::before,
    html.theme-anim body *::after {
        transition: none !important;
    }

    .art-theme-toggle,
    .art-theme-toggle:hover {
        transition: none;
        transform: none;
    }
}

/* Mobile menu fix (article pages only): the menu lives inside the navbar's stacking
   context (z-index 1000, created by its backdrop-filter), so an overlay at 1004 was
   drawn on top of the open menu. Keep the overlay just below the navbar. */
html.art-themed .nav-overlay {
    z-index: 999;
}

/* =================== LIGHT MODE =================== */
html[data-theme="light"] {
    color-scheme: light;
    /* shared site tokens, re-pointed for light */
    --primary-dark: #ffffff;
    --primary-green: #0a7c84;   /* darker cyan: 5.1:1 on white */
    --accent-green: #d1103a;    /* darker pink: 5.4:1 on white */
    --text-light: #4b4b57;      /* body text: 8.4:1 on the page bg */
    --text-white: #16161d;
    --white: #111118;           /* used for headings and <strong> */
    --bg-dark: #f6f6f9;         /* page background */
    --bg-card: #ffffff;
    --shadow-sm: 0 2px 10px rgba(17, 17, 24, 0.06);
    --shadow-md: 0 10px 30px -12px rgba(17, 17, 24, 0.18);
    --shadow-lg: 0 20px 40px -18px rgba(17, 17, 24, 0.22);
    /* header tokens (css/headers.css) */
    --hdr-base: #f6f6f9;
    --hdr-muted: #55555f;
    --hdr-cyan: #0a7c84;
    --hdr-pink: #d1103a;
    --hdr-glows:
        radial-gradient(ellipse 55% 60% at 88% 0%, rgba(37, 244, 238, 0.18), transparent 70%),
        radial-gradient(ellipse 50% 60% at 6% 100%, rgba(254, 44, 85, 0.12), transparent 70%);
    --hdr-grid:
        linear-gradient(rgba(17, 17, 24, 0.05) 1px, transparent 1px) 0 0 / 64px 64px,
        linear-gradient(90deg, rgba(17, 17, 24, 0.05) 1px, transparent 1px) 0 0 / 64px 64px;
}

html[data-theme="light"] body {
    background-color: var(--bg-dark);
    background-image: none;
    color: var(--text-light);
}

html[data-theme="light"] ::selection {
    background: rgba(37, 244, 238, 0.35);
    color: #111118;
}

html[data-theme="light"] a {
    color: var(--primary-green);
}

/* ---------- toggle ---------- */
html[data-theme="light"] .art-theme-toggle {
    color: #111118;
    background: #ffffff;
    border-color: rgba(17, 17, 24, 0.14);
    box-shadow: 0 4px 14px -6px rgba(17, 17, 24, 0.25);
}

html[data-theme="light"] .art-theme-toggle:hover {
    border-color: rgba(10, 124, 132, 0.6);
}

html[data-theme="light"] .art-theme-toggle:focus-visible {
    outline-color: #0a7c84;
}

/* ---------- navbar ---------- */
html[data-theme="light"] .navbar,
html[data-theme="light"] .navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(17, 17, 24, 0.08);
    box-shadow: 0 6px 24px -14px rgba(17, 17, 24, 0.25);
}

html[data-theme="light"] .nav-link {
    color: #1f1f27;
}

html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active {
    color: var(--accent-green);
}

html[data-theme="light"] .dropdown-menu {
    background-color: #ffffff;
    border: 1px solid rgba(17, 17, 24, 0.08);
    box-shadow: 0 18px 40px -16px rgba(17, 17, 24, 0.25);
}

html[data-theme="light"] .dropdown-menu li a {
    color: #3a3a44;
}

html[data-theme="light"] .dropdown-menu li a:hover {
    color: var(--accent-green);
    background-color: rgba(254, 44, 85, 0.06);
}

html[data-theme="light"] .menu-toggle span {
    background-color: #111118;
}

html[data-theme="light"] .nav-overlay {
    background: rgba(17, 17, 24, 0.45);
}

@media (max-width: 768px) {
    html[data-theme="light"] .nav-menu {
        background-color: #ffffff;
        box-shadow: -15px 0 35px rgba(17, 17, 24, 0.18);
    }

    html[data-theme="light"] .nav-menu-header,
    html[data-theme="light"] .nav-cta-item {
        border-color: rgba(17, 17, 24, 0.08);
    }

    html[data-theme="light"] .nav-menu .nav-link {
        color: #1f1f27;
    }

    html[data-theme="light"] .nav-menu .nav-link.active {
        background: rgba(254, 44, 85, 0.07);
        color: var(--accent-green);
    }

    html[data-theme="light"] .nav-close-btn,
    html[data-theme="light"] .nav-menu-title {
        color: #4b4b57;
    }

    html[data-theme="light"] .dropdown-menu {
        background: rgba(17, 17, 24, 0.03);
        border: 0;
        box-shadow: none;
    }
}

/* ---------- article hero ---------- */
html[data-theme="light"] .art-hero {
    background:
        linear-gradient(180deg, transparent 60%, var(--bg-dark) 100%),
        var(--hdr-glows),
        var(--hdr-base);
}

html[data-theme="light"] .ph-eyebrow {
    color: #111118;
    background: #ffffff;
    border-color: rgba(17, 17, 24, 0.12);
    box-shadow: 0 4px 14px -8px rgba(17, 17, 24, 0.25);
}

html[data-theme="light"] .ph-eyebrow i {
    background: #0a7c84;
    box-shadow: 0 0 0 4px rgba(10, 124, 132, 0.15);
}

html[data-theme="light"] .ph-crumbs {
    color: #6b6b75;
}

html[data-theme="light"] .ph-crumbs a {
    color: #3a3a44;
}

html[data-theme="light"] .ph-crumbs a:hover {
    color: var(--hdr-cyan);
}

html[data-theme="light"] .art-title {
    color: #111118;
    -webkit-text-fill-color: #111118;
}

html[data-theme="light"] .art-meta {
    color: #5b5b66;
}

html[data-theme="light"] .art-meta > i {
    background: rgba(17, 17, 24, 0.3);
}

html[data-theme="light"] .art-author {
    color: #111118;
}

html[data-theme="light"] .art-figure {
    background: #ffffff;
    border-color: rgba(17, 17, 24, 0.08);
    box-shadow: 0 30px 60px -30px rgba(17, 17, 24, 0.35);
}

/* ---------- article body ---------- */
html[data-theme="light"] article.art-body p,
html[data-theme="light"] .container.art-body p,
html[data-theme="light"] .blog-post-content p {
    color: #3a3a44;
}

html[data-theme="light"] article.art-body h2,
html[data-theme="light"] .container.art-body h2 {
    color: #111118;
    -webkit-text-fill-color: #111118;
}

html[data-theme="light"] article.art-body h3,
html[data-theme="light"] .container.art-body h3 {
    color: #0a7c84;
    -webkit-text-fill-color: #0a7c84;
}

html[data-theme="light"] .blog-post-content h1,
html[data-theme="light"] .blog-post-content h4,
html[data-theme="light"] .blog-post-content h5,
html[data-theme="light"] .blog-post-content h6 {
    color: #111118;
}

html[data-theme="light"] article.art-body ul,
html[data-theme="light"] article.art-body ol,
html[data-theme="light"] .container.art-body ul,
html[data-theme="light"] .container.art-body ol {
    color: #3a3a44;
}

html[data-theme="light"] article.art-body strong,
html[data-theme="light"] .container.art-body strong,
html[data-theme="light"] .blog-post-content strong {
    color: #111118;
}

html[data-theme="light"] article.art-body blockquote,
html[data-theme="light"] .container.art-body blockquote,
html[data-theme="light"] .blog-post-content blockquote {
    background: linear-gradient(90deg, rgba(10, 124, 132, 0.07), #ffffff);
    border-left-color: #0a7c84;
    color: #2a2a33;
    box-shadow: 0 6px 20px -14px rgba(17, 17, 24, 0.25);
}

html[data-theme="light"] article.art-body img,
html[data-theme="light"] .container.art-body img,
html[data-theme="light"] .blog-post-content img {
    border-color: rgba(17, 17, 24, 0.08);
    box-shadow: 0 16px 40px -24px rgba(17, 17, 24, 0.35);
}

html[data-theme="light"] .art-body a:not(.btn):not(.tools-box-item):not(.tools-box-all) {
    color: #0a7c84;
    text-decoration-color: rgba(10, 124, 132, 0.4);
}

html[data-theme="light"] .art-body a:not(.btn):not(.tools-box-item):not(.tools-box-all):hover {
    color: #d1103a;
}

/* tables, code (both used or likely in DB articles) */
html[data-theme="light"] .art-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: #ffffff;
    border: 1px solid rgba(17, 17, 24, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px -20px rgba(17, 17, 24, 0.25);
}

html[data-theme="light"] .art-body th,
html[data-theme="light"] .art-body td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(17, 17, 24, 0.08);
    color: #3a3a44;
    text-align: left;
}

html[data-theme="light"] .art-body th {
    background: #f1f1f5;
    color: #111118;
    font-weight: 700;
}

html[data-theme="light"] .art-body code {
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    background: #eef0f4;
    color: #b0103a;
    font-size: 0.92em;
}

html[data-theme="light"] .art-body pre {
    padding: 1.1rem 1.25rem;
    border-radius: 12px;
    background: #f1f2f6;
    border: 1px solid rgba(17, 17, 24, 0.08);
    overflow-x: auto;
}

html[data-theme="light"] .art-body pre code {
    padding: 0;
    background: none;
    color: #1f1f27;
}

html[data-theme="light"] .art-body hr {
    border: 0;
    border-top: 1px solid rgba(17, 17, 24, 0.1);
}

/* DB article boxes (table of contents, keep reading) use var(--bg-card) inline */
html[data-theme="light"] .article-toc,
html[data-theme="light"] .related-reading {
    border-color: rgba(17, 17, 24, 0.1) !important;
    box-shadow: 0 10px 30px -22px rgba(17, 17, 24, 0.3);
}

html[data-theme="light"] .related-reading {
    border-left-color: #d1103a !important;
}

/* DB article audit box + back link */
html[data-theme="light"] .blog-audit-box {
    border-color: rgba(17, 17, 24, 0.1) !important;
    box-shadow: 0 16px 40px -24px rgba(17, 17, 24, 0.3) !important;
}

html[data-theme="light"] .btn-secondary {
    color: #3a3a44 !important;
    border-color: rgba(17, 17, 24, 0.18) !important;
}

/* ---------- tools box (includes/tool-links.php) ---------- */
html[data-theme="light"] .tool-inline-link:not(.btn) {
    color: #0a7c84;
    -webkit-text-fill-color: #0a7c84;
    border-bottom-color: rgba(10, 124, 132, 0.45);
}

html[data-theme="light"] .tool-inline-link:not(.btn):hover {
    color: #d1103a;
    -webkit-text-fill-color: #d1103a;
    border-bottom-color: #d1103a;
}

html[data-theme="light"] .tools-box {
    background:
        linear-gradient(160deg, #ffffff, #fbfbfd) padding-box,
        linear-gradient(135deg, rgba(254, 44, 85, 0.45), rgba(17, 17, 24, 0.06) 45%, rgba(10, 124, 132, 0.45)) border-box;
    box-shadow: 0 16px 40px -26px rgba(17, 17, 24, 0.3);
}

html[data-theme="light"] .tools-box-kicker {
    color: #0a7c84;
}

html[data-theme="light"] .tools-box .tools-box-title,
html[data-theme="light"] .tools-box-item strong {
    color: #111118;
}

html[data-theme="light"] .tools-box a.tools-box-all:not(.btn) {
    color: #d1103a;
}

html[data-theme="light"] .tools-box a.tools-box-all:not(.btn):hover {
    color: #111118;
}

html[data-theme="light"] .tools-box a.tools-box-item:not(.btn) {
    background: #f7f7fa;
    border-color: rgba(17, 17, 24, 0.08);
}

html[data-theme="light"] .tools-box a.tools-box-item:not(.btn):hover {
    background: rgba(10, 124, 132, 0.06);
    border-color: rgba(10, 124, 132, 0.45);
}

html[data-theme="light"] .tools-box-item span {
    color: #5b5b66;
}

/* ---------- comments (css/comments.css) ---------- */
html[data-theme="light"] .cm-section {
    border-top-color: rgba(17, 17, 24, 0.07);
}

html[data-theme="light"] .cm-title,
html[data-theme="light"] .cm-form h3,
html[data-theme="light"] .cm-meta b {
    color: #111118;
    -webkit-text-fill-color: #111118;
}

html[data-theme="light"] .cm-empty,
html[data-theme="light"] .cm-form-note,
html[data-theme="light"] .cm-hint,
html[data-theme="light"] .cm-meta time,
html[data-theme="light"] .cm-field span small {
    color: #5b5b66;
}

html[data-theme="light"] .cm-item {
    background: #ffffff;
    border-color: rgba(17, 17, 24, 0.08);
    box-shadow: 0 10px 30px -22px rgba(17, 17, 24, 0.3);
}

html[data-theme="light"] .cm-body p {
    color: #3a3a44;
}

html[data-theme="light"] .cm-form {
    background: #ffffff;
    box-shadow: 0 24px 60px -30px rgba(17, 17, 24, 0.35);
}

html[data-theme="light"] .cm-form::before {
    background: linear-gradient(135deg, rgba(254, 44, 85, 0.6), rgba(17, 17, 24, 0.06) 45%, rgba(10, 124, 132, 0.6));
}

html[data-theme="light"] .cm-field span {
    color: #3a3a44;
}

html[data-theme="light"] .cm-field span i {
    color: #d1103a;
}

html[data-theme="light"] .cm-field input,
html[data-theme="light"] .cm-field textarea {
    background: #f7f7fa;
    border-color: rgba(17, 17, 24, 0.14);
    color: #111118;
}

html[data-theme="light"] .cm-field input::placeholder,
html[data-theme="light"] .cm-field textarea::placeholder {
    color: #8a8a94;
}

html[data-theme="light"] .cm-field input:focus,
html[data-theme="light"] .cm-field textarea:focus {
    background: #ffffff;
    border-color: #0a7c84;
    box-shadow: 0 0 0 4px rgba(10, 124, 132, 0.15);
}

html[data-theme="light"] .cm-notice-ok {
    color: #0b4f54;
    background: rgba(10, 124, 132, 0.08);
    border-color: rgba(10, 124, 132, 0.35);
}

html[data-theme="light"] .cm-notice-err {
    color: #8a0a26;
    background: rgba(209, 16, 58, 0.06);
    border-color: rgba(209, 16, 58, 0.35);
}

/* replies */
html[data-theme="light"] .cm-replies {
    border-left-color: rgba(10, 124, 132, 0.3);
}

html[data-theme="light"] .cm-item-reply {
    background: #fafafc;
}

html[data-theme="light"] .cm-item-team {
    border-color: rgba(10, 124, 132, 0.45);
}

html[data-theme="light"] .cm-reply-label,
html[data-theme="light"] .cm-reply-btn {
    color: #0a7c84;
}

html[data-theme="light"] .cm-cancel {
    color: #5b5b66;
}

html[data-theme="light"] .cm-cancel:hover {
    color: #111118;
}

html[data-theme="light"] .cm-reply-btn:focus-visible,
html[data-theme="light"] .cm-cancel:focus-visible {
    outline-color: #0a7c84;
}

/* ---------- footer ---------- */
html[data-theme="light"] .footer {
    background-color: #ffffff;
    border-top: 1px solid rgba(17, 17, 24, 0.08);
    color: #4b4b57;
}

html[data-theme="light"] .footer-top,
html[data-theme="light"] .footer-bottom,
html[data-theme="light"] .footer-bottom-bar {
    border-color: rgba(17, 17, 24, 0.08);
}

html[data-theme="light"] .footer-nav-col h4,
html[data-theme="light"] .footer-col h3,
html[data-theme="light"] .footer-contact-info {
    color: #111118;
}

html[data-theme="light"] .footer-tagline,
html[data-theme="light"] .footer-powered,
html[data-theme="light"] .footer-nav-list a,
html[data-theme="light"] .footer-links a,
html[data-theme="light"] .footer-social-link,
html[data-theme="light"] .footer-copyright,
html[data-theme="light"] .footer-legal-links a {
    color: #4b4b57;
}

html[data-theme="light"] .footer-nav-list a:hover,
html[data-theme="light"] .footer-links a:hover,
html[data-theme="light"] .footer-social-link:hover,
html[data-theme="light"] .footer-legal-links a:hover {
    color: #d1103a;
}

html[data-theme="light"] .footer-social-link,
html[data-theme="light"] .footer-badge {
    border-color: rgba(17, 17, 24, 0.12);
    background: #f7f7fa;
}

html[data-theme="light"] .newsletter-input {
    background: #f7f7fa;
    border-color: rgba(17, 17, 24, 0.14);
    color: #111118;
}

@media (max-width: 640px) {
    .art-theme-toggle {
        padding: 0.4rem 0.75rem 0.4rem 0.5rem;
    }
}
