/* Rotary PPO appearance roles. The brand blue and gold stay unchanged. */
:root {
  color-scheme: light;
  --ppo-page: #ffffff;
  --ppo-panel: #ffffff;
  --ppo-alt: #f4f7fb;
  --ppo-text: #172b49;
  --ppo-muted: #526274;
  --ppo-heading: #00246c;
  --ppo-link: #005daa;
  --ppo-line: #dce4ef;
  --ppo-field: #ffffff;
  --ppo-field-border: #8c9aab;
  --ppo-button: #00246c;
  --ppo-button-hover: #005daa;
  --ppo-button-text: #ffffff;
  --ppo-focus: #a34c00;
  --ppo-error: #b3261e;
  --ppo-image-bg: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-rotary-theme="light"]) {
    color-scheme: dark;
    --ppo-page: #0b1628;
    --ppo-panel: #182943;
    --ppo-alt: #10213a;
    --ppo-text: #edf3fb;
    --ppo-muted: #bdcbde;
    --ppo-heading: #e1ecff;
    --ppo-link: #95d5ff;
    --ppo-line: #536681;
    --ppo-field: #0d1d33;
    --ppo-field-border: #93a8c3;
    --ppo-button: #275da3;
    --ppo-button-hover: #3973bb;
    --ppo-button-text: #ffffff;
    --ppo-focus: #f7a81b;
    --ppo-error: #ffb4a9;
    --ppo-image-bg: #ffffff;
  }
}
html[data-rotary-theme="dark"] {
  color-scheme: dark;
  --ppo-page: #0b1628;
  --ppo-panel: #182943;
  --ppo-alt: #10213a;
  --ppo-text: #edf3fb;
  --ppo-muted: #bdcbde;
  --ppo-heading: #e1ecff;
  --ppo-link: #95d5ff;
  --ppo-line: #536681;
  --ppo-field: #0d1d33;
  --ppo-field-border: #93a8c3;
  --ppo-button: #275da3;
  --ppo-button-hover: #3973bb;
  --ppo-button-text: #ffffff;
  --ppo-focus: #f7a81b;
  --ppo-error: #ffb4a9;
  --ppo-image-bg: #ffffff;
}

/* Shared components and Gutenberg content. */
body, .site-main, .rotary-blog-layout { background: var(--ppo-page); color: var(--ppo-text); }
.entry-content .is-style-rotary-surface,
.rotary-contact-form, .rotary-blog-card-heading, .rotary-blog-cta,
.rotary-article-tools, .rotary-video-frame, .rotary-blog-empty,
.rotary-ai-links a:hover { background: var(--ppo-alt); }
.entry-content .rotary-benefits > .wp-block-column,
.entry-content .join-info > .wp-block-column,
.entry-content .copy-stat, .entry-content .copy-topic,
.rotary-stats > .wp-block-column:not(:first-child),
.rotary-card, .rotary-blog-card, .rotary-blog-card--text,
.rotary-google-preferred, .rotary-ai-links a,
.rotary-contact-status { background: var(--ppo-panel); }
.entry-content h1, .entry-content h2, .entry-content h3,
.rotary-blog-header h1, .rotary-blog-index-header h1,
.rotary-blog-card h2, .rotary-blog-cta p,
.rotary-article-video h2, .rotary-article-faq h2,
.rotary-ai-tools h2, .rotary-article-faq summary,
.rotary-contact-form label, .rotary-stats h3,
.entry-content .copy-international .copy-conclusion,
.entry-content .copy-funding .copy-conclusion,
.entry-content .afterwork-facts p,
.entry-content .home-hero-details .copy-hero-impact p {
  color: var(--ppo-heading);
}
.entry-content .section-intro, .rotary-stats p,
.rotary-card .place, .rotary-card .visual-note, .rotary-archive-grid p,
.rotary-contact-form .form-privacy, .rotary-blog-date,
.rotary-blog-index-header > p:last-child, .rotary-blog-card time,
.entry-content .source-note { color: var(--ppo-muted); }
a, .rotary-blog-card-category, .rotary-blog-kicker,
.entry-content .eyebrow, .rotary-card .meta { color: var(--ppo-link); }
a:hover { color: var(--ppo-heading); }
.rotary-blog-header, .rotary-blog-index-header, .rotary-blog-card,
.rotary-blog-card-heading, .rotary-card, .rotary-contact-form,
.entry-content .rotary-benefits > .wp-block-column,
.entry-content .join-info > .wp-block-column,
.entry-content .copy-stat, .entry-content .copy-topic,
.rotary-stats > .wp-block-column:not(:first-child),
.rotary-article-tools, .rotary-ai-links a,
.rotary-article-faq, .rotary-article-faq details,
.rotary-blog-index .page-numbers {
  border-color: var(--ppo-line);
}
.entry-content .rotary-stat-section { border-block-color: var(--ppo-line); }
.entry-content .editorial-split .wp-block-image { box-shadow: 20px 20px 0 var(--ppo-alt); }
.entry-content .is-style-rotary-surface .editorial-split .wp-block-image { box-shadow: 20px 20px 0 var(--ppo-panel); }
.rotary-card .wp-block-image.image-contain img { background: var(--ppo-image-bg); }
.rotary-contact-form input:not([type=checkbox]), .rotary-contact-form textarea,
input[type=search], .search-form input, .wp-block-search__input {
  background: var(--ppo-field);
  color: var(--ppo-text);
  border-color: var(--ppo-field-border);
}
input::placeholder, textarea::placeholder { color: var(--ppo-muted); opacity: 1; }
.rotary-contact-status.error, [aria-invalid="true"] { border-color: var(--ppo-error); }
.rotary-contact-status.error { color: var(--ppo-error); }
:focus-visible { outline-color: var(--ppo-focus); }
.site-header :focus-visible, .site-footer :focus-visible,
.entry-content .is-style-rotary-blue :focus-visible,
.entry-content .wp-block-cover :focus-visible { outline-color: #f7a81b; }
:disabled, [aria-disabled="true"] { cursor: not-allowed; }
.entry-content .wp-block-button__link:not(.has-background),
.rotary-submit, .rotary-blog-cta a, .rotary-blog-index .page-numbers.current {
  background: var(--ppo-button);
  border-color: var(--ppo-button);
  color: var(--ppo-button-text);
}
.entry-content .wp-block-button__link:not(.has-background):hover,
.rotary-submit:hover, .rotary-blog-cta a:hover {
  background: var(--ppo-button-hover);
  border-color: var(--ppo-button-hover);
  color: var(--ppo-button-text);
}

/* Flatten the menu's flex box to place the existing social links before the theme controls. */
.site-header .primary-nav {
  flex: 1;
  gap: 12px;
  justify-content: flex-end;
}
.site-header .primary-nav > ul {
  display: contents;
}
.site-header .primary-nav.rotary-appearance-ready > ul {
  display: flex;
  gap: 12px;
}
.site-header .primary-nav .header-social {
  order: 1;
  gap: 4px;
  padding-left: 0;
  border-left: 0;
}
.site-header .rotary-appearance-item {
  order: 2;
  width: 134px;
  flex: none;
  margin-left: auto;
}
.site-header .rotary-appearance-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.site-header .rotary-appearance-group legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  margin: 0;
  padding: 0;
}
.site-header .rotary-appearance-options {
  display: flex;
  gap: 4px;
}
.site-header .rotary-appearance-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
.site-header .rotary-appearance-options label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #b3c6e4;
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}
.site-header .rotary-appearance-options svg {
  display: block;
  width: 20px;
  height: 20px;
  flex: none;
}
.site-header .rotary-appearance-options input:checked + label {
  border-color: #f7a81b;
  background: #f7a81b;
  color: #00246c;
}
.site-header .rotary-appearance-options input:not(:checked) + label:hover {
  background: rgba(255, 255, 255, .16);
}
.site-header .rotary-appearance-options input:focus-visible + label {
  outline: 3px solid #f7a81b;
  outline-offset: 3px;
}
.rotary-appearance-option-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 1160px) {
  .site-header .primary-nav.is-open {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    row-gap: 0;
  }
  .site-header .primary-nav:not(.rotary-appearance-ready) > ul > li:not(.rotary-appearance-item) {
    flex: 0 0 100%;
  }
  .site-header .primary-nav.rotary-appearance-ready > ul {
    flex: 0 0 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .site-header .primary-nav .header-social {
    margin-top: 12px;
  }
  .site-header .rotary-appearance-item {
    width: auto;
    margin-top: 12px;
    border-bottom: 0;
  }
  .site-header .rotary-appearance-options label {
    flex-basis: 44px;
  }
}
@media (max-width: 720px) {
  .site-header .primary-nav.is-open.rotary-appearance-ready {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: 0;
  }
  .site-header .primary-nav.rotary-appearance-ready > ul {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
  }
  .site-header .primary-nav .header-social {
    flex: 0 0 92px;
    width: 92px;
    min-width: 0;
  }
  .site-header .rotary-appearance-item {
    flex: 0 0 140px;
    width: 140px;
    min-width: 0;
    margin: 12px 0 0;
  }
}
@media (max-width: 300px) {
  .site-header .primary-nav { padding-inline: 12px; }
}

/* Gutenberg's fixed white backgrounds need an explicit dark surface. */
@media (prefers-color-scheme: dark) {
  html:not([data-rotary-theme="light"]) .entry-content .has-white-background-color:not(.wp-block-cover) {
    background-color: var(--ppo-panel) !important;
  }
  html:not([data-rotary-theme="light"]) .entry-content .has-black-color:not(.wp-block-cover) {
    color: var(--ppo-text) !important;
  }
}
html[data-rotary-theme="dark"] .entry-content .has-white-background-color:not(.wp-block-cover) {
  background-color: var(--ppo-panel) !important;
}
html[data-rotary-theme="dark"] .entry-content .has-black-color:not(.wp-block-cover) {
  color: var(--ppo-text) !important;
}

/* Article tools, form labels, and button variants. */
.rotary-google-preferred, .rotary-ai-links a,
.entry-content .copy-beneficiaries .beneficiary-item a { color: var(--ppo-heading); }
.rotary-google-preferred { border-color: var(--ppo-line); }
.rotary-google-preferred:hover {
  background: var(--ppo-button);
  border-color: var(--ppo-button);
  color: var(--ppo-button-text);
}
.rotary-ai-links a:hover { border-color: var(--ppo-link); color: var(--ppo-heading); }
.rotary-contact-form .consent { color: var(--ppo-text); }
.entry-content .is-style-rotary-gold .wp-block-button__link,
.entry-content .is-style-rotary-blue .wp-block-button__link {
  background: #f7a81b;
  border-color: #f7a81b;
  color: #00246c;
}
.entry-content .is-style-rotary-gold .wp-block-button__link:hover,
.entry-content .is-style-rotary-blue .wp-block-button__link:hover {
  background: #ffc254;
  border-color: #ffc254;
  color: #00246c;
}
.entry-content .is-style-outline .wp-block-button__link {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}
.entry-content .wp-block-cover .is-style-outline .wp-block-button__link { color: #ffffff; }

/* Keep existing icon artwork legible on dark panels without altering its colors. */
@media (prefers-color-scheme: dark) {
  html:not([data-rotary-theme="light" ]) .rotary-article-tools img { background: #ffffff; border-radius: 4px; }
}
html[data-rotary-theme="dark"] .rotary-article-tools img { background: #ffffff; border-radius: 4px; }


/* Keep the selector's space reserved until its saved value is shown. */
.rotary-appearance-pending .rotary-appearance-item { visibility: hidden; }


/* Preserve the Rotary gold accent and the original light borders. */
.entry-content .copy-stat { border-top-color: #f7a81b; }
.entry-content .copy-beneficiaries .beneficiary-item { border-bottom-color: var(--ppo-line); }

