/* RFOS v4.1.1 — stable light/dark, navigation and publication contract. */

/* Restore the protected header grid instead of forcing it into a fragile flex row. */
.rfos-site-header .header-inner{display:grid!important;grid-template-columns:minmax(285px,1fr) auto!important;align-items:center!important;gap:14px!important;min-height:82px!important}
.rfos-site-header .brand{min-width:0!important}
.rfos-site-header .logo-area{display:flex!important;align-items:center!important;gap:12px!important}
.rfos-site-header .brand-emblem{width:76px!important;height:76px!important;flex:0 0 76px!important;object-fit:contain!important}
.rfos-site-header .brand-title-image{width:min(540px,48vw)!important;height:auto!important;max-height:62px!important;object-fit:contain!important;object-position:left center!important}
.rfos-site-header nav{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:4px!important;flex-wrap:nowrap!important;white-space:nowrap!important}
.rfos-site-header nav a{font-size:clamp(.92rem,1vw,1.05rem)!important}
.rfos-site-header nav .language-toggle{position:static!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:.45rem!important;width:auto!important;height:auto!important;margin-left:4px!important;padding:.62rem .72rem!important;border:1px solid rgba(255,255,255,.7)!important;border-radius:10px!important;transform:none!important}
.rfos-site-header nav .language-globe,.rfos-site-header nav .language-button-text{display:inline!important}

/* Dark mode: every ordinary surface and control retains readable contrast. */
html[data-rfos-theme="dark"] :is(.connect-links,.social-links,.social-grid,.v3-checkline,.consent-line,.privacy-consent,.mission-vision-card,.mission-panel,.value-card,.journey-card,.about-cta,.link-card,.contact-links,.footer-links){background:var(--rfos-surface)!important;color:var(--rfos-text)!important;border-color:var(--rfos-line)!important}
html[data-rfos-theme="dark"] :is(.connect-links a,.social-links a,.social-grid a,.contact-links a,.footer-links a){background:var(--rfos-surface-2)!important;color:#f6f8fc!important;border-color:#6d86a7!important}
html[data-rfos-theme="dark"] :is(.section-label,.eyebrow,.badge,.pill,.tag){background:#dce8fa!important;color:#073b8f!important;border-color:#9db5d5!important}
html[data-rfos-theme="dark"] :is(.mission-card,.mission-card p,.mission-card h2,.mission-card h3,.value-card,.value-card p,.value-card h3,.journey-card,.journey-card p,.about-card,.about-card p){color:#f6f8fc!important}
html[data-rfos-theme="dark"] :is(.purpose-card,.purpose-card p,.purpose-card h2,.founder-link,.founder-link p,.founder-link h2,.journey-item,.journey-item p,.v3-section,.v3-section p){color:#f6f8fc!important}
html[data-rfos-theme="dark"] :is(.about-cta a,.cta-button,.message-button,.mission-link,.read-message,.read-mission,.rfos-primary-action){background:#d6aa24!important;color:#071b3e!important;border-color:#f0cb55!important;text-shadow:none!important}
html[data-rfos-theme="dark"] :is(.v3-checkline span,.consent-line span,.privacy-consent span){color:#f6f8fc!important}
html[data-rfos-theme="dark"] :is(.privacy-note,.safety-note,.notice){background:#2e2a1d!important;color:#fff7dd!important;border-color:#d6aa24!important}
html[data-rfos-theme="dark"] :is(.privacy-note,.safety-note,.notice) *{color:#fff7dd!important}
html[data-rfos-theme="dark"] :is(h1,h2,h3,h4,strong){text-shadow:none}
html[data-rfos-theme="dark"] :is(.core-values-title,.section-title){color:#f0c94f!important}
html[data-rfos-theme="dark"] :is(.purpose-card,.founder-link,.journey,.journey-item,.values-section){background:var(--rfos-surface)!important;border-color:var(--rfos-line)!important}
html[data-rfos-theme="dark"] .section-label{background:#e8eef8!important;color:#073b8f!important;opacity:1!important}

/* Gold remains RFOS gold and always uses navy text on filled gold controls. */
:is(.about-cta a,.cta-button,.message-button,.mission-link,.read-message,.read-mission)[style],
:is(.about-cta a,.cta-button,.message-button,.mission-link,.read-message,.read-mission){color:#071b3e!important;text-shadow:none!important}
.section-label{background:#eef2f8!important;color:#073b8f!important;opacity:1!important}

/* Preserve each Awareness publication as its own original article card. */
.rfos-publication.rfos-awareness,.rfos-awareness{display:block!important;background:var(--rfos-surface)!important;color:var(--rfos-text)!important;border:1px solid var(--rfos-line)!important;border-top:5px solid var(--rfos-blue)!important;border-radius:20px!important;padding:clamp(1rem,2.2vw,1.7rem)!important;margin:0 0 24px!important;box-shadow:var(--rfos-shadow)!important;overflow:hidden!important}
.rfos-awareness-boxes{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:18px!important;margin-top:1rem!important}
.rfos-awareness-box{min-width:0!important;height:auto!important;justify-content:flex-start!important;text-align:center!important}
.rfos-awareness>h2,.rfos-awareness-box h3,.rfos-awareness-box p{max-width:100%!important;overflow-wrap:anywhere!important;word-break:normal!important}

/* Challenge NEXT must be explicit, tappable and visible after an answer. */
#rfosNextQuestion:not([hidden]){display:block!important;width:100%!important;min-height:54px!important;margin-top:1rem!important;touch-action:manipulation!important;visibility:visible!important;opacity:1!important}

@media(max-width:720px){
  .rfos-site-header .header-inner{grid-template-columns:minmax(0,1fr) auto!important;min-height:86px!important;padding:8px 12px!important}
  .rfos-site-header .brand-emblem{width:62px!important;height:62px!important;flex-basis:62px!important}
  .rfos-site-header .brand-title-image{width:min(100%,520px)!important;max-height:56px!important}
  .rfos-site-header .menu-toggle{display:flex!important;position:relative!important;grid-column:2!important;grid-row:1!important;width:58px!important;height:58px!important;z-index:10002!important}
  .rfos-site-header nav{display:none!important;position:absolute!important;top:100%!important;left:0!important;right:0!important;z-index:10001!important;flex-direction:column!important;align-items:stretch!important;gap:4px!important;padding:14px!important;background:linear-gradient(145deg,#062f7c,#0b45bd)!important;box-shadow:0 18px 38px rgba(0,0,0,.3)!important;white-space:normal!important}
  .rfos-site-header nav.open{display:flex!important}
  .rfos-site-header nav a{display:block!important;width:100%!important;box-sizing:border-box!important;font-size:1.08rem!important;padding:.8rem 1rem!important}
  .rfos-site-header nav .language-toggle{display:flex!important;width:100%!important;margin:2px 0 0!important;font-size:1.05rem!important;padding:.78rem 1rem!important}
  .rfos-awareness-boxes{grid-template-columns:1fr!important}
}
