/* ==========================================================================
   GNEP Africa: modern style layer (since 3 December 2026)
   Loaded last on every page. It changes only the look, never the content:
   typography, rounded cards, soft shadows, hover motion, frosted header,
   warm page background. Remove the <link> to this file to return to the
   previous look. Motion is switched off for visitors who ask for reduced motion.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --gm-ink: #0B2516;
    --gm-ink-2: #123321;
    --gm-green: #15803D;
    --gm-mint: #86EFAC;
    --gm-sand: #F6F3EC;
    --gm-paper: #FFFFFF;
    --gm-muted: #4B5D53;
    --gm-line: rgba(11, 37, 22, 0.10);
    --gm-radius: 20px;
    --gm-radius-lg: 32px;
    --gm-shadow: 0 24px 44px -28px rgba(11, 37, 22, 0.45);
    --gm-ease: cubic-bezier(.2, .7, .2, 1);
    --gm-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --gm-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --dd-font-stack: var(--gm-sans);
}

/* ---------- Typography ---------- */
body {
    font-family: var(--gm-sans);
    background-color: var(--gm-sand);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
/* article pages keep their solid-white editorial canvas */
body.gnep-article-page { background-color: var(--gm-paper); }
main h1, main h2, main h3,
main .display-1, main .display-2, main .display-3, main .display-4, main .display-5, main .display-6,
.dd-hero__title {
    font-family: var(--gm-serif);
    font-weight: 600 !important;
    letter-spacing: -0.02em;
    text-transform: none;
}
.dd-hero__title { line-height: 1.02; }
main h4, main h5, main h6 { font-family: var(--gm-sans); letter-spacing: -0.01em; }
/* keep the paper (journal) layout and small UI labels as they are */
.gnep-journal h1, .gnep-journal h2, .gnep-journal h3, .gnep-journal .gjm-title,
.dd-sleeve__title, .dd-footer h2, .dd-footer h3 { font-family: inherit; letter-spacing: normal; }
.dd-eyebrow, .gnep-section-tag { letter-spacing: 0.14em; }
.dd-hero__h1 .dd-eyebrow { font-family: var(--gm-sans); font-weight: 700 !important; letter-spacing: 0.14em; }

/* ---------- Header: frosted glass ---------- */
.dd-header {
    background-color: rgba(255, 255, 255, 0.82) !important;
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    transition: box-shadow .3s var(--gm-ease), background-color .3s;
}
.dd-header.gm-scrolled {
    background-color: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 10px 30px -18px rgba(11, 37, 22, 0.35);
}
/* menu underline: the site's own full-width bar in gnep-giz.css is the only one (a second animated line was removed 5 Dec 2026) */

/* ---------- Buttons: pill shape + lift ---------- */
.btn, .dd-btn-donate, .dd-filter-pill { border-radius: 999px !important; }
.btn { transition: transform .25s var(--gm-ease), box-shadow .25s, background-color .25s, color .25s; }
.btn:not(.btn-link):hover { transform: translateY(-2px); box-shadow: 0 12px 22px -14px rgba(11, 37, 22, 0.6); }
.btn-lg { padding: 0.8rem 1.6rem; }
.dd-action-btn__circle { transition: transform .3s var(--gm-ease); }
.dd-action-btn:hover .dd-action-btn__circle { transform: translateX(4px); }

/* ---------- Cards: rounded, soft border, lift on hover ---------- */
.card, .dd-teaser-card, .dd-box, .gallery-card, .article-sidebar-box, .article-sidebar-card,
.gnep-aud-box, .gnep-aud-module, .recommendation-item, .article-quote-box, .gnep-callout,
.pdf-download-banner, .dd-accordion__item, .accordion-item, .kh-newsletter-box, .gallery-cta-banner {
    border-radius: var(--gm-radius) !important;
}
.card, .dd-teaser-card, .gallery-card, .article-sidebar-box, .article-sidebar-card, .gnep-aud-box, .dd-box {
    border: 1px solid var(--gm-line) !important;
    overflow: hidden;
    transition: transform .4s var(--gm-ease), box-shadow .4s var(--gm-ease);
}
.card, .dd-teaser-card, .gallery-card, .article-sidebar-card { background-color: var(--gm-paper); }
@media (hover: hover) {
    .card:hover, .dd-teaser-card:hover, .gallery-card:hover, .dd-box:hover {
        transform: translateY(-5px);
        box-shadow: var(--gm-shadow);
    }
}
/* photos inside cards zoom gently */
.card-img-top, .dd-teaser-card__media img, .gallery-img-container img, .np-card-img, .work-img {
    transition: transform .9s var(--gm-ease);
}
.card-img-top, .np-card-img { border-radius: 0 !important; }
/* card photos keep the 16:10 shape even if an <img> carries width/height attributes */
.np-card-img { height: auto !important; aspect-ratio: 16 / 10; object-fit: cover; }
.dd-teaser-card__media, .gallery-img-container { overflow: hidden; }
@media (hover: hover) {
    .card:hover .card-img-top, .card:hover .np-card-img,
    .dd-teaser-card:hover .dd-teaser-card__media img,
    .gallery-card:hover .gallery-img-container img { transform: scale(1.06); }
}
.rounded-4 { border-radius: var(--gm-radius) !important; }

/* ---------- Images in articles ---------- */
.article-figure img, .dd-article-hero-media img, .article-body-content img:not(.gjm-logo):not(.gjm-cover) {
    border-radius: 16px;
}

/* ---------- Page banners: rounded lower edge ---------- */
.dd-hero, body:not(.gnep-article-page) .bg-project, .bg-about, .bg-contact {
    border-radius: 0 0 var(--gm-radius-lg) var(--gm-radius-lg);
    overflow: hidden;
}
.dd-hero__scrim {
    background:
        linear-gradient(180deg, rgba(11, 37, 22, 0.30) 0%, rgba(11, 37, 22, 0.40) 45%, rgba(11, 37, 22, 0.86) 100%),
        radial-gradient(80% 60% at 0% 100%, rgba(21, 128, 61, 0.45), transparent 60%);
}
.dd-hero__media img { animation-duration: 14s; }

/* ---------- Sections ---------- */
.bg-warning-subtle { background-color: #EAF3E6 !important; }
.bg-white { background-color: var(--gm-paper) !important; }
.bg-dark { background-color: var(--gm-ink) !important; }
.bg-light { background-color: #EFEBE1 !important; }

/* ---------- Footer ---------- */
.dd-footer {
    background-color: var(--gm-paper) !important;
    border-top: 0;
    border-radius: var(--gm-radius-lg) var(--gm-radius-lg) 0 0;
    box-shadow: 0 -12px 40px -30px rgba(11, 37, 22, 0.35);
}
.dd-footer a { transition: color .2s; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 14px; border-color: rgba(11, 37, 22, 0.18); padding: 0.7rem 0.95rem; }
.form-control:focus, .form-select:focus { border-color: var(--gm-green); box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.15); }

/* ---------- Editorial reading: articles, briefs, papers (since 3 December 2026) ----------
   One rule set for every page that uses .article-body-content (all Knowledge Hub
   publications) and the publication.html template. Body paragraphs are justified
   from tablet width up, with hyphenation to keep word gaps even; phones keep left
   alignment. Headings, captions, tables, lists, references and metadata stay left. */
.article-body-content, #publication-detail-container { overflow-wrap: break-word; }
.article-body-content h2, .article-body-content h3, .article-body-content h4,
.article-body-content h5, .article-body-content h6,
.article-body-content figcaption, .article-body-content .figure-caption,
.article-body-content td, .article-body-content th, .article-body-content li,
.article-body-content .article-reference, .article-body-content .small,
.article-body-content .text-muted { text-align: left; }
.gnep-article-page .article-body-content h3 { font-size: clamp(1.2rem, 1.9vw, 1.4rem); line-height: 1.3; }
.gnep-article-page .article-body-content h4 { font-size: 1.1rem; line-height: 1.35; }
.gnep-article-page .article-body-content h2 + p, .gnep-article-page .article-body-content h3 + p { margin-top: 0; }
.gnep-article-page .article-body-content blockquote {
    margin: 1.75rem 0; padding: 0.9rem 1.25rem; border-left: 4px solid var(--gm-green);
    background: #F3F8F1; border-radius: 0 12px 12px 0; font-size: 1.05em; color: #1F2A24;
}
.gnep-article-page .article-body-content blockquote p:last-child { margin-bottom: 0; }
.article-body-content .article-reference { line-height: 1.55; padding-left: 1.6em; text-indent: -1.6em; }
@media (min-width: 768px) {
    .article-body-content p:not(.small):not(.text-muted):not(.text-center):not(.figure-caption):not(.article-reference):not([class*="gjm-"]):not([class*="gbm-"]),
    .article-body-content blockquote p,
    #publication-detail-container p:not(.small):not(.text-muted):not(.text-center) {
        text-align: justify;
        text-align-last: left;
        -webkit-hyphens: auto;
        hyphens: auto;
        hyphenate-limit-chars: 7 3 3;
        word-spacing: -0.01em;
    }
    /* paragraphs inside tables, captions, key-fact boxes and banners are labels, not prose */
    .article-body-content td p, .article-body-content th p, .article-body-content figure p,
    .article-body-content .article-key-fact p, .article-body-content .pdf-download-banner p,
    .article-body-content .gjm-center p, .article-body-content .gnep-journal-mast p:not(.gjm-abstract),
    .article-body-content .gnep-brief-mast p { text-align: left !important; hyphens: manual !important; }
    .gnep-article-page .article-body-content .gnep-journal .gjm-abstract { text-align: justify; text-align-last: left; -webkit-hyphens: auto; hyphens: auto; }
}

/* ---------- Scroll reveal (added by js/gnep-modern.js, only below the fold) ---------- */
.gm-reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--gm-ease), transform .9s var(--gm-ease); }
.gm-reveal.gm-in { opacity: 1; transform: none; }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 3px solid var(--gm-green); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
    .gm-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .btn:hover, .card:hover, .dd-teaser-card:hover, .gallery-card:hover, .dd-box:hover { transform: none !important; }
    .card-img-top, .dd-teaser-card__media img, .gallery-img-container img, .np-card-img { transition: none !important; }
}
@media print {
    body { background: #fff !important; }
    .gm-reveal { opacity: 1 !important; transform: none !important; }
}

/* Homepage: solid white background throughout (no sand / beige bands). */
body.page-home,
body.page-home .bg-light { background-color: #fff !important; }
