/* ============================================================
   Additives — site-specific styling for the /additives encyclopedia
   section. Loaded automatically by lib/CustomAssets.php from
   content/custom/css/. Lives in content/ (not template/) because
   it's specific to this site's additives content; the CMS template
   in template/css/ stays generic.

   Covers:
     - .enc-add-risk*         — the risk panel at the top of L3 pages
     - .enc-add-scanner-cta   — the Food Insight cross-link card
     - .enc-add-class-explainer — generic-class explainer block
     - .enc-add-source        — Wikipedia attribution footer
     - .enc-l2 .page-content  — L2 long-form intro typography
   ============================================================ */

.enc-add-risk {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--background-alt);
    margin: 0.5rem 0 1.5rem;
}

.enc-add-risk-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    line-height: 0;
    margin-top: 0.15rem;
}

.enc-add-risk-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.enc-add-risk-body { flex: 1; min-width: 0; }

.enc-add-risk-label {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
    margin-bottom: 0.3rem;
}

.enc-add-risk-text {
    margin: 0.25rem 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-color);
}

.enc-add-risk-meta {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.enc-add-risk-high {
    border-color: #b91c1c;
    background: rgba(185, 28, 28, 0.08);
}
.enc-add-risk-high .enc-add-risk-icon,
.enc-add-risk-high .enc-add-risk-label { color: #b91c1c; }

.enc-add-risk-medium {
    border-color: #b45309;
    background: rgba(180, 83, 9, 0.08);
}
.enc-add-risk-medium .enc-add-risk-icon,
.enc-add-risk-medium .enc-add-risk-label { color: #b45309; }

.enc-add-risk-low {
    border-color: #ca8a04;
    background: rgba(202, 138, 4, 0.08);
}
.enc-add-risk-low .enc-add-risk-icon,
.enc-add-risk-low .enc-add-risk-label { color: #ca8a04; }

.enc-add-risk-none {
    border-color: #15803d;
    background: rgba(21, 128, 61, 0.07);
}
.enc-add-risk-none .enc-add-risk-icon,
.enc-add-risk-none .enc-add-risk-label { color: #15803d; }

[data-theme="dark"] .enc-add-risk-high   { background: rgba(248, 113, 113, 0.12); }
[data-theme="dark"] .enc-add-risk-medium { background: rgba(251, 146, 60, 0.12); }
[data-theme="dark"] .enc-add-risk-low    { background: rgba(250, 204, 21, 0.12); }
[data-theme="dark"] .enc-add-risk-none   { background: rgba(74, 222, 128, 0.10); }
[data-theme="dark"] .enc-add-risk-high   .enc-add-risk-icon,
[data-theme="dark"] .enc-add-risk-high   .enc-add-risk-label { color: #fca5a5; }
[data-theme="dark"] .enc-add-risk-medium .enc-add-risk-icon,
[data-theme="dark"] .enc-add-risk-medium .enc-add-risk-label { color: #fdba74; }
[data-theme="dark"] .enc-add-risk-low    .enc-add-risk-icon,
[data-theme="dark"] .enc-add-risk-low    .enc-add-risk-label { color: #fde047; }
[data-theme="dark"] .enc-add-risk-none   .enc-add-risk-icon,
[data-theme="dark"] .enc-add-risk-none   .enc-add-risk-label { color: #86efac; }

/* Class explainer is rendered as a normal section. No additional chrome. */

/* Scanner CTA card. Sits at bottom of L3 page above the source attribution. */
.enc-add-scanner-cta {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    background: var(--card-bg);
    margin: 2rem 0 1rem;
}

.enc-add-scanner-cta-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    color: var(--primary-color);
    margin-top: 0.2rem;
}

.enc-add-scanner-cta-icon svg { width: 28px; height: 28px; display: block; }

.enc-add-scanner-cta-body { flex: 1; min-width: 0; }

.enc-add-scanner-cta-title {
    font-size: 1.15rem;
    margin: 0 0 0.4rem;
    line-height: 1.3;
    color: var(--text-color);
}

.enc-add-scanner-cta-text {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-light);
}

.enc-add-scanner-cta-button {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.4rem;
    transition: filter 0.15s ease;
}

.enc-add-scanner-cta-button:hover,
.enc-add-scanner-cta-button:focus { filter: brightness(0.92); color: #fff; }

/* Source attribution. Small print, no big section heading. */
.enc-add-source {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 1.5rem 0 0.5rem;
}

/* ============================================================
   L2 additives intro. Readability tweaks for the long FAQ-style
   landing copy on /additives. Site-specific because the additives
   L2 has substantive body_html; other L2 pages on this site do not.
   ============================================================ */
.enc-l2 .page-content .enc-l2-lede {
    font-size: 1.1rem;
    line-height: 1.55;
    color: var(--text-color);
    margin: 0 0 1.5rem;
}

.enc-l2 .page-content h2 {
    font-size: 1.35rem;
    margin: 1.75rem 0 0.6rem;
    color: var(--text-color);
}

.enc-l2 .page-content p,
.enc-l2 .page-content ul {
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0.6rem 0;
}

.enc-l2 .page-content ul { padding-left: 1.4rem; }
.enc-l2 .page-content ul li { margin: 0.35rem 0; }

.enc-l2 .page-content .enc-l2-cta {
    padding: 1rem 1.1rem;
    background: var(--background-alt);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1.5rem 0;
}
