/* Shared appearance controls and original brand artwork. */
.theme-toggle {
    display: inline-grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line, #dce7e0);
    border-radius: 50% !important;
    color: var(--ink, #18352d);
    background: var(--paper, #fbfcfa);
    font-size: 1.05rem;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
.theme-toggle:is(:hover, :focus-visible) {
    background: #f4c95d;
    border-color: #f4c95d;
    color: #0c4a36;
}
.theme-toggle:focus-visible { outline: 3px solid #f4c95d; outline-offset: 3px; }
.public-header-actions { justify-self: end; }
.drawer-brand { display: block; border-radius: .5rem; background: #fbfcfa; }
.drawer-logo { display: block; width: 200px; max-width: 100%; height: 65px; object-fit: contain; }
.footer-original-logo { display: inline-block; max-width: 100%; padding: 0 .6rem; border-radius: .6rem; background: #fbfcfa; }
.footer-original-logo img { display: block; width: 215px; max-width: 100%; height: auto; }
.mobile-public-menu .mobile-nav-links > a { grid-template-columns: minmax(0, 1fr); padding: 1rem; }
.mobile-public-menu .mobile-menu-cta { grid-template-columns: minmax(0, 1fr); }
.auth-theme-control { position: absolute; top: 1rem; right: 1rem; z-index: 10; }
/* These icon controls are exceptions to the site's square-button rule. */
html body :is(.share-button, .sponsored-social-links a) { border-radius: 50% !important; }

html[data-theme="dark"] {
    --ink: #f5f8f6;
    --green: #62d5a5;
    --mint: #1c3429;
    --paper: #101d17;
    --line: #344d3f;
    --muted: #e3ece7;
    --surface: #1b2d23;
    --raised: #243b2e;
    --bs-body-bg: #101d17;
    --bs-body-color: #f5f8f6;
    --bs-secondary-color: #e3ece7;
    --bs-secondary-bg: #1b2d23;
    --bs-tertiary-bg: #243b2e;
    --bs-emphasis-color: #f0f6f2;
    --bs-border-color: #344d3f;
    --bs-link-color: #62d5a5;
    --bs-link-hover-color: #f4c95d;
    color-scheme: dark;
}
html[data-theme="dark"] body { color: var(--ink); background: var(--paper); }
html[data-theme="dark"] .site-header { background: rgba(16,29,23,.96); border-color: var(--line); }
html[data-theme="dark"] .site-header .navbar-brand { padding-inline: .45rem; border-radius: .5rem; background: #fbfcfa; }
html[data-theme="dark"] .home-hero {
    background: linear-gradient(115deg, rgba(8,25,18,.76), rgba(8,25,18,.58)), url('../images/hero_home.jpg') center/cover;
}
html[data-theme="dark"] :is(.about-section, .partners-section, .sponsored-section) { background: var(--paper); border-color: var(--line); }
html[data-theme="dark"] :is(.page-intro, .comment-section, .newsletter-section) { background-color: var(--mint); border-color: var(--line); }
html[data-theme="dark"] .page-intro-illustrated { background-repeat: no-repeat; background-size: cover; }
html[data-theme="dark"] .opportunities-intro {
    background-image: linear-gradient(90deg, rgba(8,25,18,.74), rgba(8,25,18,.48) 45%, rgba(8,25,18,.12) 82%), url('../images/hero_emploi.jpg');
    background-position: center, center 52%;
}
html[data-theme="dark"] .activities-intro {
    background-image: linear-gradient(90deg, rgba(8,25,18,.74), rgba(8,25,18,.48) 45%, rgba(8,25,18,.12) 82%), url('../images/hero_activite.jpg');
    background-position: center, center 54%;
}
html[data-theme="dark"] .organizations-intro {
    background-image: linear-gradient(90deg, rgba(8,25,18,.74), rgba(8,25,18,.48) 45%, rgba(8,25,18,.12) 82%), url('../images/hero_organisation.jpg');
    background-position: center, center 54%;
}
html[data-theme="dark"] .advertise-intro.page-intro-illustrated {
    background-image: linear-gradient(90deg, rgba(8,25,18,.74), rgba(8,25,18,.48) 45%, rgba(8,25,18,.12) 82%), url('../images/advertise-hero.webp');
    background-position: center, center 55%;
}
html[data-theme="dark"] :is(
    .content-card, .opportunity-card, .filter-bar, .newsletter-form, .comment-form-card, .info-panel,
    .mobile-public-menu, .mobile-public-menu .offcanvas-header, .mobile-menu-footer,
    .mobile-nav-links > a, .global-search-form, .search-guidance, .search-result-card,
    .saved-publication-card, .related-publication-card, .saved-search-card,
    .organization-directory-card, .organization-profile-facts, .advertise-form-panel,
    .advertise-info-card, .sponsored-card, .sponsored-modal-visual,
    .advertise-plan-overview > div, .advertise-payment-box, .advertiser-payment-instructions,
    .advertiser-proof-form, .advertisement-payment-summary, .current-document,
    .opportunity-document-card, .admin-sidebar, .admin-panel, .admin-stat-card,
    .admin-comment-card, .admin-topbar, .auth-form-area, .auth-form-wrap,
    .quill-editor-shell .ql-toolbar, .quill-editor-shell .ql-editor, .quill-editor-shell .ql-tooltip,
    .contact-card
) { background: var(--surface); border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .quill-editor-shell { border-color: var(--line); }
html[data-theme="dark"] .quill-editor-shell .ql-stroke { stroke: var(--ink); }
html[data-theme="dark"] .quill-editor-shell .ql-fill { fill: var(--ink); }
html[data-theme="dark"] .quill-editor-shell .ql-picker { color: var(--ink); }
html[data-theme="dark"] .quill-editor-shell .ql-toolbar button { background: transparent; color: var(--ink); }
html[data-theme="dark"] .quill-editor-shell .ql-editor.ql-blank::before { color: var(--muted); }
html[data-theme="dark"] .quill-editor-shell :is(.ql-picker-options, .quill-table-actions) { background: var(--surface); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .contact-heading > p { color: var(--muted); }
html[data-theme="dark"] .contact-card-icon { background: var(--raised); border: 1px solid var(--line); }
html[data-theme="dark"] :is(.admin-body, .auth-page) { background: var(--paper); }
html[data-theme="dark"] :is(.mobile-header-icon, .mobile-menu-trigger, .mobile-menu-close, .favorite-button, .share-button) {
    color: var(--ink); background: var(--raised); border-color: var(--line);
}
html[data-theme="dark"] :is(.home-hero p, .about-lead, .card-meta-row, .result-kind,
    .content-card p, .opportunity-card p, .search-result-card p, .saved-publication-card p,
    .organization-directory-card p, .organization-profile-facts span, .admin-comment-card > p,
    .auth-heading p, .auth-help, .auth-links, .admin-user, .admin-list p) { color: var(--muted); }
html[data-theme="dark"] .page-intro p:not(.eyebrow) { color: var(--muted); }
html[data-theme="dark"] .page-intro-illustrated :is(h1, p, .eyebrow) { text-shadow: 0 2px 14px rgba(0,0,0,.78); }
html[data-theme="dark"] :is(.content-image, .opportunity-card-image, .detail-hero-image, .sponsored-media img) {
    filter: brightness(1.08) contrast(1.03) saturate(1.04);
}
html[data-theme="dark"] :is(.mobile-nav-links a, .mobile-nav-links strong, .content-card h3 a,
    .opportunity-card h3 a, .related-publication-card h3 a, .search-result-card h3 a,
    .saved-publication-card h3 a, .saved-search-card h3 a, .organization-directory-card h3,
    .admin-nav a, .admin-brand, .auth-mobile-brand, .auth-form label, .auth-heading h2,
    .organization-directory-name, .organization-profile-facts strong) { color: var(--ink); }
html[data-theme="dark"] :is(.admin-nav a.active, .admin-nav a:hover, .mobile-nav-links > a.active) {
    background: var(--mint); color: var(--green); border-color: var(--green);
}
html[data-theme="dark"] :is(.newsletter-input-group input, .form-control, .form-select, .auth-input input, .auth-input) {
    color: var(--ink); background-color: var(--raised); border-color: var(--line);
}
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: var(--muted); opacity: 1; }
html[data-theme="dark"] :is(.btn-primary, .mobile-menu-cta .btn) { color: #10261b; }
html[data-theme="dark"] :is(.btn-outline-dark, .btn-light, .btn-outline-secondary) {
    color: var(--ink); border-color: var(--line); background-color: var(--surface);
}
html[data-theme="dark"] .text-muted { color: var(--muted) !important; }
html[data-theme="dark"] .text-dark { color: var(--ink) !important; }
html[data-theme="dark"] :is(.bg-white, .bg-light) { background-color: var(--surface) !important; }
html[data-theme="dark"] :is(.sponsored-placeholder, .opportunity-document-card > span, .sponsored-social-links a) {
    background: var(--raised); color: var(--green); border-color: var(--line);
}
html[data-theme="dark"] .newsletter-notice-success { color: var(--green); }
html[data-theme="dark"] .newsletter-notice-error { color: #ffb4a8; }
html[data-theme="dark"] :is(.tag, .opportunity-type, .verified-organization, .opportunity-org) { color: var(--green); }
html[data-theme="dark"] :is(.detail-copy, .rich-content, .info-panel dd, .admin-table tbody td) { color: var(--ink); }
html[data-theme="dark"] .admin-table thead th { background: var(--raised); color: var(--muted); border-color: var(--line); }
html[data-theme="dark"] .rich-content blockquote { background: var(--mint); border-color: var(--green); color: var(--ink); }
html[data-theme="dark"] .back-to-top { color: #10261b; }
html[data-theme="dark"] .favorite-button.is-saved { color: #10261b; background: var(--green); border-color: var(--green); }
html[data-theme="dark"] :is(.btn, .theme-toggle, .mobile-menu-trigger, .mobile-menu-close,
    .mobile-header-icon, .favorite-button, .share-button, .sponsored-open):not(:disabled):not(.disabled):is(:hover, :focus-visible) {
    background: #f4c95d; border-color: #f4c95d; color: #0c4a36;
}
/* Uniform readable copy, including rich content with author-supplied colours. */
html[data-theme="dark"] body :is(
    h1, h2, h3, h4, h5, h6, p, a, label, legend, small, span, strong, b, em,
    dt, dd, li, th, td, caption, summary, blockquote, figcaption,
    input, textarea, select, button,
    .detail-copy, .rich-content, .sponsored-copy, .advertisement-review-description,
    .activity-card-footer, .advertiser-ad-facts, .advertisement-payment-summary,
    .current-document, .partner-item, .auth-alert, .comment-alert, .share-feedback,
    .sponsored-disclosure, .newsletter-notice, .text-muted, .text-secondary, .text-dark, .text-body
) { color: var(--ink) !important; }
html[data-theme="dark"] :is(.nav-link-disabled, .nav-link-disabled small, .footer-link-disabled),
html[data-theme="dark"] .mobile-nav-disabled :is(strong, small, b) { color: var(--muted) !important; }
html[data-theme="dark"] .rich-content [style*="color"] { color: var(--ink) !important; }
html[data-theme="dark"] body :is(.text-white-50, .text-body-secondary, .text-body-tertiary) {
    color: var(--muted) !important;
}
html[data-theme="dark"] body :is(.auth-input > i, .password-toggle i, .admin-nav i, .admin-sidebar-footer i) { color: var(--ink); }
html[data-theme="dark"] body :is(
    .form-panel, .publish-panel, .dashboard-welcome, .admin-stat, .admin-user b,
    .category-pill, .action-btn, .delete-icon, .duration-pill, .card-view-count,
    .organization-directory-stats span, .auth-alert, .comment-alert,
    .admin-stat-icon, .status-pill, .admin-list em.draft, .partner-logo
) { background: var(--raised); border-color: var(--line); }
html[data-theme="dark"] body :is(.btn-primary, .kreatis-footer-cta-button, .favorite-button.is-saved) {
    color: #fff !important; background: #087957; border-color: #087957;
}
html[data-theme="dark"] .public-publish-menu .public-publish-button { color: #fff !important; }
html[data-theme="dark"] .public-publish-menu .dropdown-menu {
    background: var(--surface); border-color: var(--line);
}
html[data-theme="dark"] .public-publish-menu .dropdown-item,
html[data-theme="dark"] .public-publish-menu .dropdown-item i { color: #fff !important; }
html[data-theme="dark"] .public-publish-menu .dropdown-item:is(:hover, :focus) { background: var(--raised); }
/* Yellow interactions keep dark lettering for contrast against the light fill. */
html[data-theme="dark"] body :is(
    .btn, .theme-toggle, .mobile-menu-trigger, .mobile-menu-close, .mobile-header-icon,
    .favorite-button, .share-button, .sponsored-open, .action-btn,
    .kreatis-footer-cta-button, .opportunity-pdf-button, .back-to-top
):not(:disabled):not(.disabled):is(:hover, :focus-visible) {
    color: #0c4a36 !important; background-color: #f4c95d; border-color: #f4c95d;
}
html[data-theme="dark"] body :is(
    .btn, .theme-toggle, .mobile-menu-trigger, .mobile-menu-close, .mobile-header-icon,
    .favorite-button, .share-button, .sponsored-open, .action-btn,
    .kreatis-footer-cta-button, .opportunity-pdf-button, .back-to-top
):not(:disabled):not(.disabled):is(:hover, :focus-visible) :is(span, strong, b, i) {
    color: #0c4a36 !important;
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    .site-header .public-desktop-nav { gap: .6rem; font-size: .84rem; }
    .site-header .nav-icon-link span { display: none; }
    html .site-header .navbar { grid-template-columns: minmax(145px,1fr) auto auto; gap: 1rem; }
}
@media (max-width: 575.98px) {
    .container.section-space > .row.g-5 { --bs-gutter-x: 1.5rem; }
    html .site-header .navbar-brand { margin: 0; }
    .site-header .site-logo { width: 138px; height: 45px; max-width: 100%; object-fit: contain; }
    .site-header .mobile-header-actions { gap: .35rem; }
    .site-header :is(.theme-toggle, .mobile-header-icon, .mobile-menu-trigger) {
        width: 38px; height: 38px; min-height: 38px; flex: 0 0 38px; padding: 0;
    }
}
@media (max-width: 767.98px) {
    html[data-theme="dark"] :is(.opportunities-intro, .activities-intro, .organizations-intro, .advertise-intro.page-intro-illustrated) {
        background-image: linear-gradient(90deg, rgba(8,25,18,.72), rgba(8,25,18,.42)), var(--page-intro-image);
    }
    html[data-theme="dark"] .opportunities-intro {
        --page-intro-image: url('../images/hero_emploi.jpg');
        background-position: center, 67% center;
    }
    html[data-theme="dark"] .activities-intro {
        --page-intro-image: url('../images/hero_activite.jpg');
        background-position: center, 65% center;
    }
    html[data-theme="dark"] .organizations-intro {
        --page-intro-image: url('../images/hero_organisation.jpg');
        background-position: center, 66% center;
    }
    html[data-theme="dark"] .advertise-intro.page-intro-illustrated {
        --page-intro-image: url('../images/advertise-hero.webp');
        background-position: center, 68% center;
    }
}
@media (max-width: 359.98px) {
    .site-header .site-logo { width: 104px; }
    .site-header .mobile-header-actions { gap: .2rem; }
    .site-header :is(.theme-toggle, .mobile-header-icon, .mobile-menu-trigger) { width: 35px; height: 35px; min-height: 35px; flex-basis: 35px; }
}
@media (prefers-reduced-motion: reduce) { .theme-toggle { transition: none; } }
