/* Optional editorial finish. This layer owns colour and surface treatment, not layout. */
html[data-oh-theme="dark"] {
  --ed-paper: #060606;
  --ed-surface: #111;
  --ed-raised: #181818;
  --ed-ink: #f6f6f6;
  --ed-muted: #b3b3b3;
  --ed-rule: rgb(255 255 255 / .10);
  --ed-field-border: #696969;
  --ref-input: #0a0a0a;
  --ref-overlay: rgb(6 6 6 / .88);
  --ref-grain: rgb(255 255 255 / .022);
  --brand-accent: #dedede;
  --brand-accent-hover: #f1f1f1;
  --brand-accent-link: #eaeaea;
  --brand-accent-ink: #141414;
}

html[data-oh-theme="light"] {
  --ed-paper: #f7f6f2;
  --ed-surface: #fff;
  --ed-raised: #efefea;
  --ed-ink: #181818;
  --ed-muted: #575757;
  --ed-rule: rgb(17 17 17 / .15);
  --ed-field-border: #767676;
  --ref-input: #fff;
  --ref-overlay: rgb(247 246 242 / .90);
  --ref-grain: rgb(17 17 17 / .026);
  --brand-accent: #333;
  --brand-accent-hover: #222;
  --brand-accent-link: #393939;
  --brand-accent-ink: #fff;
}

html[data-oh-theme] {
  /* Neutral defaults let each site's profile supply its own branding. */
  --brand-secondary: var(--brand-accent);
  --brand-secondary-link: var(--brand-accent-link);
  --brand-accent-soft: color-mix(in srgb, var(--brand-accent) 9%, var(--ed-surface));
  --brand-accent-border: color-mix(in srgb, var(--brand-accent) 38%, var(--ed-surface));
  --brand-accent-glow: color-mix(in srgb, var(--brand-accent) 34%, transparent);
  --ed-blue: var(--brand-accent-link);
  --ed-blue-fill: var(--brand-accent);
  --ed-blue-hover: var(--brand-accent-hover);
  --ed-green: var(--brand-secondary-link);
  --ed-button-text: var(--brand-accent-ink);
  --ed-badge: var(--brand-accent-soft);
  --ed-badge-ink: var(--brand-accent-link);
  --ed-badge-landscape: color-mix(in srgb, var(--brand-secondary) 10%, var(--ed-surface));
  --ed-badge-landscape-ink: var(--brand-secondary-link);
  --ed-badge-essay: var(--brand-accent-soft);
  --ed-badge-essay-ink: var(--brand-accent-link);
  --ed-essay-rule: var(--brand-secondary-link);
  --ed-focus: var(--brand-accent-link);
  --ed-hover-rule: var(--brand-accent-border);
  --ed-success: var(--brand-accent-link);
  --ref-radius: 5px;
  --ref-noise: radial-gradient(var(--ref-grain) .55px, transparent .7px) 0 0 / 4px 5px;
  --global-palette1: var(--brand-accent-link);
  --global-palette2: var(--brand-accent-link);
  --global-palette3: var(--ed-ink);
  --global-palette4: var(--ed-ink);
  --global-palette5: var(--ed-muted);
  --global-palette6: var(--ed-muted);
  --global-palette7: var(--ed-raised);
  --global-palette8: var(--ed-paper);
  --global-palette9: var(--ed-surface);
}

html[data-oh-theme] ::selection { background: var(--brand-accent); color: var(--brand-accent-ink); }

html[data-oh-theme] .oh-masthead {
  --ed-surface: var(--ref-overlay);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
html[data-oh-theme] body.wp-child-theme-onehundred .oh-masthead :is(.oh-masthead__main,.oh-primary-band,.oh-section-nav) {
  background: transparent !important; /* Existing appearance layer paints each header tier. */
}
html[data-oh-theme] body.wp-child-theme-onehundred .oh-section-nav__list a::after { background: var(--brand-accent); }
html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-section-nav__list,.oh-app-nav) :is(.current-menu-item a,[aria-current="page"]) {
  color: var(--brand-accent-link) !important;
}

/* Map legacy section colour hooks onto this finish, including archive and article controls. */
html[data-oh-theme] body.wp-child-theme-onehundred.oh-category-themed {
  --oh-category: var(--brand-accent);
  --oh-category-ink: var(--brand-accent-link);
  --oh-category-deep: var(--brand-accent-link);
  --oh-category-soft: var(--brand-accent-soft);
  --oh-category-on-accent: var(--brand-accent-ink);
}
html[data-oh-theme] body.wp-child-theme-onehundred [style*="--oh-story-ink"] {
  --oh-story-ink: var(--brand-accent-link) !important;
}
html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-home-section,.oh-home-topic) {
  --ref-section-link: var(--brand-accent-link);
  --ref-section-soft: var(--brand-accent-soft);
  --oh-section-accent: var(--ref-section-link) !important;
  --oh-section-ink: var(--ref-section-link) !important;
  --oh-section-soft: var(--ref-section-soft) !important;
  --oh-topic-accent: var(--ref-section-link) !important;
  --oh-topic-ink: var(--ref-section-link) !important;
}
html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-home-section,.oh-home-topic)[data-editorial-layout="landscape"] {
  --ref-section-link: var(--brand-secondary-link);
  --ref-section-soft: var(--ed-badge-landscape);
}

html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-top-headlines,.oh-home-discovery) {
  background: var(--brand-accent-soft) !important;
}
html[data-oh-theme] .oh-top-headlines { --oh-red: var(--brand-accent); }
html[data-oh-theme] .oh-home-discovery__suggestions a:hover { text-decoration: underline; text-underline-offset: .2em; }

html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-category-surface,.oh-author-hero) {
  background: var(--ed-paper);
  color: var(--ed-ink);
}
html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-category-lead,.oh-category-support,.oh-author-stats,.oh-article-author,.oh-newsletter-prompt,.oh-search-filter-panel) {
  background: var(--ed-surface);
  border-color: var(--ed-rule);
  color: var(--ed-ink);
  box-shadow: none;
}
/* Replace inherited starter-theme gradients and white text on these surfaces. */
html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-search-head,.oh-category-discovery,.oh-category-promise,.oh-error) {
  background: var(--ed-surface) !important;
  box-shadow: none !important;
  border-radius: var(--ref-radius) !important;
  color: var(--ed-ink) !important;
}
html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-search-head,.oh-category-discovery,.oh-category-promise,.oh-error) :is(h1,h2) {
  color: var(--ed-ink) !important;
}
html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-search-head,.oh-category-discovery,.oh-category-promise) :is(a,.oh-kicker) {
  color: var(--brand-accent-link) !important;
}
html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-search-head,.oh-category-discovery,.oh-category-promise) p {
  color: var(--ed-muted) !important;
}
html[data-oh-theme] :is(.oh-category-lead,.oh-category-support,.oh-category-row,.oh-author-hero,.oh-article-author) :is(h1,h2,h3,a:not([class])) { color: var(--ed-ink); }
html[data-oh-theme] :is(.oh-category-lead,.oh-category-support,.oh-category-row,.oh-category-header,.oh-author-hero,.oh-article-author) p { color: var(--ed-muted); }
html[data-oh-theme] :is(.oh-author-hero__links,.oh-article-author,.oh-pagination,.pagination) a {
  color: var(--brand-accent-link);
  text-underline-offset: .18em;
}
html[data-oh-theme] .oh-search-filters .oh-search-filters__reset {
  color: var(--brand-accent-link);
  text-decoration: underline;
  text-underline-offset: .18em;
}

html[data-oh-theme] :is(.oh-news-kicker,.oh-category-label,.oh-rail-latest__category,.oh-article__section,.oh-kicker) {
  color: var(--brand-accent-link);
  letter-spacing: .055em;
}
html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-primary-story,.oh-home-topic) > :is(.oh-news-kicker,.oh-home-topic__category) {
  --ed-rule: var(--brand-accent-border);
}
html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-primary-story,.oh-home-topic) > :is(.oh-news-kicker,.oh-home-topic__category)[data-editorial-layout="landscape"] {
  --ed-rule: color-mix(in srgb, var(--brand-secondary) 38%, var(--ed-surface));
}
html[data-oh-theme] body.wp-child-theme-onehundred .oh-support-story {
  border-color: var(--ed-rule);
}
html[data-oh-theme] .oh-rail-latest { background: transparent; }
html[data-oh-theme] :is(.oh-rail-latest,.oh-category-latest,.oh-related-panel) :where(li,article) { border-color: var(--ed-rule); }

html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-home-topic__media,.oh-category-lead__media,.oh-category-support__media,.oh-card__media,.oh-article__featured) {
  border-radius: var(--ref-radius);
}
@media (max-width: 480px) {
  /* Keep the configured spread; fit its labels and headlines inside each column. */
  html[data-oh-theme] body.home.wp-child-theme-onehundred .oh-home-topic {
    min-inline-size: 0;
    overflow-wrap: anywhere;
  }
  html[data-oh-theme] body.home.wp-child-theme-onehundred .oh-home-topic[data-editorial-layout] h3 {
    font-size: 1rem !important;
    line-height: 1.21 !important;
  }
}
html[data-oh-theme="dark"] body.wp-child-theme-onehundred :is(.oh-home-topic__media,.oh-support-story__media,.oh-rail-latest__media) img {
  filter: saturate(.84) contrast(1.04);
}
html[data-oh-theme] :is(.oh-home-topic__media,.oh-support-story__media,.oh-rail-latest__media) { overflow: clip; }

html[data-oh-theme] body.wp-child-theme-onehundred section.oh-newsletter.oh-edition-newsletter {
  background: var(--ref-noise), var(--brand-accent-soft) !important;
  border-color: var(--brand-accent-border) !important;
  border-radius: var(--ref-radius);
}
html[data-oh-theme] body.wp-child-theme-onehundred :is(main,.oh-newsletter) :is(input[type="email"],input[type="search"],select) {
  --ed-raised: var(--ref-input);
}
html[data-oh-theme] :is(input[type="email"],input[type="search"],select):focus {
  --ed-field-border: var(--brand-accent-link);
}
html[data-oh-theme] body.wp-child-theme-onehundred .oh-search-filters select:has(option:checked:not([value=""],[value="0"],[value="any"],[value="relevance"])) {
  --ed-field-border: var(--brand-accent-link);
}
html[data-oh-theme] body.wp-child-theme-onehundred .search-form :is(.search-submit,.kadence-search-icon-wrap) {
  color: var(--brand-accent-ink);
}

html[data-oh-theme] :is(.oh-button,button[type="submit"],input[type="submit"]) {
  border-radius: var(--ref-radius);
}
html[data-oh-theme] :is(.oh-actions,.oh-search-filter-panel) :is(.oh-search,.oh-theme-toggle,summary):hover {
  --ed-field-border: var(--brand-accent-link);
}

html[data-oh-theme] :is(.oh-prose,.oh-page__content) blockquote {
  color: var(--ed-ink);
  border-inline-start-color: var(--brand-accent-border);
}
html[data-oh-theme] .oh-prose :is(th,td) { border-color: var(--ed-rule); }
html[data-oh-theme] .oh-prose th { background-color: var(--ed-raised); }
html[data-oh-theme] .oh-footer { --ed-paper: var(--ref-input); }

@media (hover: hover) {
  html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-primary-story,.oh-home-section__lead,.oh-more-stories article,.oh-card):hover {
    --ed-surface: var(--ed-raised);
  }
  html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-primary-story,.oh-support-story,.oh-home-topic,.oh-card,.oh-home-section__lead,.oh-more-stories,.oh-category-lead,.oh-category-support,.oh-category-row,.oh-rail-latest) :is(h2 a,h3 a,.oh-rail-latest__copy > a):hover {
    color: var(--brand-accent-link) !important; /* Existing appearance pins headline colours. */
    text-decoration: underline;
    text-underline-offset: .16em;
  }
  html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-button,.oh-newsletter button[type="submit"],.oh-newsletter input[type="submit"]):hover:not(:disabled) {
    box-shadow: 0 0 14px var(--brand-accent-glow) !important; /* Overrides the base button reset. */
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-home-topic__media,.oh-support-story__media,.oh-rail-latest__media) img {
    transition: filter 480ms ease, transform 480ms ease;
  }
  html[data-oh-theme] body.wp-child-theme-onehundred :is(.oh-home-topic,.oh-support-story,.oh-rail-latest li):is(:hover,:focus-within) :is(.oh-home-topic__media,.oh-support-story__media,.oh-rail-latest__media) img {
    filter: saturate(1) contrast(1.04);
    transform: scale(1.025);
  }
}
