/* Apply the selected palette to shared page accents after page-level styles. */
html[data-theme-color] {
    --portal-accent: var(--aj-gold);
    --portal-accent-strong: var(--aj-gold-strong);
    --portal-accent-light: var(--aj-gold-light);
    --portal-accent-soft: var(--aj-gold-soft);
    --portal-accent-border: color-mix(in srgb, var(--aj-gold) 36%, white);
    --portal-accent-focus: color-mix(in srgb, var(--aj-gold) 20%, transparent);
}

/* Keep page title heroes visually consistent with the services catalog. */
html[data-theme-color] :is(
    .services-hero,
    .portal-sitemap__hero,
    .portal-contact__hero,
    .portal-laws__hero,
    .poll-history__hero,
    .portal-providers__hero,
    .open-data-hero,
    .service-info-hero,
    .module-hero
) {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid #e3e8ee;
    border-top: 1px solid #e3e8ee;
    border-inline-start: 1px solid #e3e8ee;
    border-radius: 20px;
    background: linear-gradient(115deg, #fff 0%, #fff 65%, #faf6ec 100%);
    box-shadow: 0 8px 26px rgb(18 48 77 / 5%);
}

html[data-theme-color] :is(
    .services-hero,
    .portal-sitemap__hero,
    .portal-contact__hero,
    .portal-laws__hero,
    .poll-history__hero,
    .portal-providers__hero,
    .open-data-hero,
    .service-info-hero,
    .module-hero
)::after {
    position: absolute;
    z-index: 0;
    inset-inline-end: -3rem;
    inset-block-start: -5rem;
    width: 15rem;
    height: 15rem;
    border: 1px solid rgb(182 138 55 / 11%);
    border-radius: 50%;
    box-shadow: 0 0 0 25px rgb(182 138 55 / 4%), 0 0 0 52px rgb(182 138 55 / 3%);
    content: "";
    pointer-events: none;
}

html[data-theme-color] :is(
    .services-hero,
    .portal-sitemap__hero,
    .portal-contact__hero,
    .portal-laws__hero,
    .poll-history__hero,
    .portal-providers__hero,
    .open-data-hero,
    .service-info-hero,
    .module-hero
)::before {
    position: absolute;
    z-index: 0;
    inset-inline-end: .7rem;
    inset-block-end: -.28em;
    color: var(--portal-accent-strong);
    font-family: FontAwesome;
    font-size: clamp(6rem, 13vw, 11rem);
    line-height: 1;
    opacity: .055;
    pointer-events: none;
}

html[data-theme-color] .services-hero::before { content: "\f132"; }
html[data-theme-color] .portal-sitemap__hero::before { content: "\f0e8"; }
html[data-theme-color] .portal-contact__hero::before { content: "\f086"; }
html[data-theme-color] .portal-laws__hero::before { content: "\f24e"; }
html[data-theme-color] .poll-history__hero::before { content: "\f080"; }
html[data-theme-color] .portal-providers__hero::before { content: "\f1ad"; }
html[data-theme-color] .open-data-hero::before { content: "\f1c0"; }
html[data-theme-color] .service-info-hero::before { content: "\f0f6"; }
html[data-theme-color] .module-hero::before { content: "\f086"; }

html[data-theme-color] :is(
    .services-hero > *,
    .portal-sitemap__hero > *,
    .portal-contact__hero > *,
    .portal-laws__hero > *,
    .poll-history__hero > *,
    .portal-providers__hero > *,
    .open-data-hero > *,
    .service-info-hero > *,
    .module-hero > *
) { position: relative; z-index: 1; }

@media (max-width: 600px) {
    html[data-theme-color] :is(
        .services-hero,
        .portal-sitemap__hero,
        .portal-contact__hero,
        .portal-laws__hero,
        .poll-history__hero,
        .portal-providers__hero,
        .open-data-hero,
        .service-info-hero,
        .module-hero
    ) { border-radius: 15px; }
}

/* Navigation, links and page breadcrumbs. */
html[data-theme-color] .main-nav-bar { background: var(--portal-accent-strong); border-color: var(--portal-accent); }
html[data-theme-color] .main-nav-bar .site-nav__home .fa,
html[data-theme-color] .main-nav-bar .nav-dropdown > summary .fa,
html[data-theme-color] .mobile-nav .site-nav__home .fa,
html[data-theme-color] .mobile-nav .nav-dropdown > summary .fa { color: var(--portal-accent-light); }
html[data-theme-color] .portal-breadcrumbs__separator,
html[data-theme-color] .portal-breadcrumbs__icon,
html[data-theme-color] .portal-breadcrumbs a:hover { color: var(--portal-accent-strong); }
html[data-theme-color] .portal-breadcrumbs [aria-current=page] .portal-breadcrumbs__icon { color: var(--portal-accent-strong); }

/* Shared actions and form focus states used by Front and Services pages. */
html[data-theme-color] :is(.module-link--primary, .site-modal__primary, .content-feedback__submit,
    .news-comment-form__submit, .news-comments__login-button, .service-tile__button--primary,
    .service-info-button--primary, .context-menu__title, .news-archive-pagination__pages .is-current) {
    border-color: var(--portal-accent-strong);
    background-color: var(--portal-accent-strong);
}
html[data-theme-color] :is(.content-feedback__submit, .news-comment-form__submit,
    .news-comments__login-button, .service-tile__button--primary, .service-info-button--primary,
    .module-link--primary, .site-modal__primary, .news-archive-pagination__pages .is-current) { color: #fff; }
html[data-theme-color] :is(.content-feedback__submit:hover:not(:disabled), .news-comment-form__submit:hover,
    .news-comments__login-button:hover, .service-tile__button--primary:hover,
    .service-tile__button--primary:focus-visible, .service-info-button--primary:hover,
    .service-info-button--primary:focus-visible, .module-link--primary:hover,
    .site-modal__primary:hover, .site-modal__primary:focus-visible) {
    border-color: var(--portal-accent-strong);
    color: #fff;
    background: var(--portal-accent-strong);
    outline-color: var(--portal-accent-border);
}
html[data-theme-color] :is(.module-link, .service-tile__button, .service-info-button,
    .services-search, .services-category-nav__link, .services-helpful-link,
    .content-feedback__choice, .content-feedback__note textarea, .news-comment-form .form-control,
    .news-article__share a, .news-article__share button) { accent-color: var(--portal-accent); }
html[data-theme-color] :is(.services-search:focus-within, .content-feedback__note textarea:focus,
    .news-comment-form .form-control:focus) {
    border-color: var(--portal-accent);
    outline-color: var(--portal-accent-focus);
    box-shadow: 0 0 0 3px var(--portal-accent-focus);
}

/* Service catalog card accents, filters and action buttons. */
html[data-theme-color] .services-hero { border-top-color: var(--portal-accent); }
html[data-theme-color] .services-hero { border: 0; }
html[data-theme-color] .services-hero__eyebrow,
html[data-theme-color] .services-category__icon,
html[data-theme-color] .service-tile__icon,
html[data-theme-color] .service-tile__details>.service-tile__button:hover,
html[data-theme-color] .service-tile__details[open]>.service-tile__button,
html[data-theme-color] .services-helpful-link__icon,
html[data-theme-color] .services-search__clear:hover,
html[data-theme-color] .services-search__clear:focus-visible { color: var(--portal-accent-strong); background-color: var(--portal-accent-soft); }
html[data-theme-color] .services-search:focus-within,
html[data-theme-color] .services-category-nav__link:hover,
html[data-theme-color] .services-category-nav__link:focus-visible,
html[data-theme-color] .service-tile:hover,
html[data-theme-color] .service-tile__details>.service-tile__button:hover,
html[data-theme-color] .service-tile__details[open]>.service-tile__button,
html[data-theme-color] .services-helpful-link:hover,
html[data-theme-color] .services-helpful-link:focus-visible { border-color: var(--portal-accent-border); }
html[data-theme-color] .service-tile:before { background: var(--portal-accent); }
html[data-theme-color] :is(.services-search>i, .services-category-nav__link i, .service-tile__visits i,
    .services-empty i, .services-helpful-link__arrow) { color: var(--portal-accent); }
html[data-theme-color] :is(.services-hero h1, .services-category__title) { color: var(--aj-navy); }
html[data-theme-color] .services-category__count { color: var(--portal-accent-strong); background: var(--portal-accent-soft); }
html[data-theme-color] .services-category-nav__link:hover,
html[data-theme-color] .services-category-nav__link:focus-visible { color: var(--portal-accent-strong); background: var(--portal-accent-soft); }

/* Service detail card. */
html[data-theme-color] .service-info-card { border-top-color: var(--portal-accent); }
html[data-theme-color] :is(.service-info-hero__icon, .service-info-fact__icon,
    .service-info-section__heading>span, .service-info-steps__number) {
    border-color: color-mix(in srgb, var(--portal-accent) 25%, white);
    color: var(--portal-accent-strong);
    background-color: var(--portal-accent-soft);
}
html[data-theme-color] :is(.service-info-eyebrow, .service-info-document-groups h3,
    .service-info-subheading, .service-info-pills i, .service-info-footer i,
    .service-info-empty i) { color: var(--portal-accent-strong); }
html[data-theme-color] .service-info-pills span { border-color: color-mix(in srgb, var(--portal-accent) 22%, white); }
html[data-theme-color] .service-info-button--secondary:hover,
html[data-theme-color] .service-info-button--secondary:focus-visible {
    border-color: var(--portal-accent-border);
    color: var(--portal-accent-strong);
    background: var(--portal-accent-soft);
}

/* About, feedback and news interactions. */
html[data-theme-color] .about-article__title-icon,
html[data-theme-color] .content-feedback__mark,
html[data-theme-color] .content-feedback__complete-icon,
html[data-theme-color] .news-comments__title>span:first-child,
html[data-theme-color] .news-comment__avatar { color: var(--portal-accent-strong); background: var(--portal-accent-soft); }
html[data-theme-color] .context-menu__link i,
html[data-theme-color] .news-article__meta-item .fa,
html[data-theme-color] .news-article__share a,
html[data-theme-color] .news-article__share button,
html[data-theme-color] .news-archive-empty i { color: var(--portal-accent-strong); }
html[data-theme-color] .context-menu__link:hover,
html[data-theme-color] .context-menu__link:focus-visible,
html[data-theme-color] .content-feedback__choice:hover,
html[data-theme-color] .content-feedback__choice[aria-pressed=true] {
    border-color: var(--portal-accent-border);
    color: var(--portal-accent-strong);
    background: var(--portal-accent-soft);
}
html[data-theme-color] .news-article__share a:hover,
html[data-theme-color] .news-article__share button:hover {
    border-color: var(--portal-accent-strong);
    color: #fff;
    background: var(--portal-accent-strong);
}
html[data-theme-color] .news-archive-pagination__pages .is-current { color: #fff; }
html[data-theme-color] .news-archive-card__category,
html[data-theme-color] .news-archive-card__link,
html[data-theme-color] .news-archive-card__content h2 a:hover,
html[data-theme-color] .news-archive-card__more,
html[data-theme-color] .news-archive-card__more:hover,
html[data-theme-color] .news-archive-pagination a:hover,
html[data-theme-color] .news-archive-pagination a:focus-visible { color: var(--portal-accent-strong); }
html[data-theme-color] .news-archive-pagination a:hover,
html[data-theme-color] .news-archive-pagination a:focus-visible { border-color: var(--portal-accent-border); background: var(--portal-accent-soft); }
html[data-theme-color] .news-archive-rail h2 { color: var(--portal-accent-strong); }
html[data-theme-color] .news-archive-rail h2 span { color: var(--portal-accent-strong); background: var(--portal-accent-soft); }
html[data-theme-color] .news-archive-rail__item a:hover { color: var(--portal-accent-strong); }
html[data-theme-color] .news-archive-list.is-loading:after { border-color: var(--portal-accent-soft); border-top-color: var(--portal-accent-strong); }
html[data-theme-color] .news-rating__star.is-filled,
html[data-theme-color] .news-rating:not([data-rated=true]) .news-rating__stars:hover .news-rating__star.is-preview-filled,
html[data-theme-color] .news-rating:not([data-rated=true]) .news-rating__stars.is-previewing .news-rating__star.is-preview-filled { color: var(--portal-accent); }
html[data-theme-color] .news-rating__star.is-half { background-image: linear-gradient(90deg, var(--portal-accent) 50%, #c9d0d9 50%); }

/* Keep the footer palette fixed as requested; page content follows the picker. */
