/* National mourning. Enabled at image build by appearance.json.
 * Neutral UI pairs remain unchanged by the final grayscale compositing pass.
 * Root filter covers legacy inline CSS, background images and embedded media;
 * never move it to body (that changes the containing block of fixed dialogs).
 */
html[data-uws-mourning="true"] {
  filter: grayscale(1);
  --navy: #000;
  --ink: #111;
  --muted: #555;
  --ground: #f2f2f2;
  --line: #767676;
  --focus: #000;
}
html[data-uws-mourning="true"] body { color: #111; background-color: #fff; }
html[data-uws-mourning="true"] :is(header, #main-navigation, #main-navigation::before,
  .uws-www-mobile-nav, .uws-www-menu-status, .newsletter_background,
  .footer, .footer_block, .cms-banner) { background-color: #000 !important; color: #fff; }
html[data-uws-mourning="true"] #main-navigation::before { background: #000 !important; }
/* The standalone 404 uses a dark raster logo on a light header. */
html[data-uws-mourning="true"] header.top { background: #fff !important; color: #111; }
/* Static fallback must retain a readable logo and navigation without JS. */
html[data-uws-mourning="true"] header .logo_uph { background-image: url("/templates/www.uph.edu.pl/images/logo-uws-poziom-bialy.svg") !important; }
html[data-uws-mourning="true"] header .logo_uph.en { background-image: url("/templates/www.uph.edu.pl/images/logo-uws-en-white.svg") !important; }
html[data-uws-mourning="true"] header .logo_uph.uk { background-image: url("/templates/www.uph.edu.pl/images/logo-uws-poziom-bialy-uk.png") !important; }
html[data-uws-mourning="true"] header .logo_uph.ru { background-image: url("/templates/www.uph.edu.pl/images/logo_uph_ru_biale.svg") !important; }
html[data-uws-mourning="true"] #main-navigation ul.dj-megamenu > li > a,
html[data-uws-mourning="true"] #main-navigation ul.dj-megamenu > li > a span { color: #fff !important; }

html[data-uws-mourning="true"] :is(.footer, .footer_block, .newsletter_background) a { color: #fff !important; }
html[data-uws-mourning="true"] :is(.dj-subwrap, .dj-subwrap-in) { background: #111 !important; }
html[data-uws-mourning="true"] #main-navigation .dj-submenu :is(a, .uws-www-menu-label, button) { color: #fff !important; }
html[data-uws-mourning="true"] #main-navigation :is(a:hover, a:focus-visible, [aria-current="page"]) {
  text-decoration: underline !important; text-underline-offset: .2em;
}
html[data-uws-mourning="true"] :is(.uws-www-mobile-nav__panel, .uws-www-mobile-nav__link,
  .uws-www-mobile-nav__text) { color: #111 !important; background-color: #fff; }
html[data-uws-mourning="true"] :is(.uws-www-mobile-nav__search, .uws-www-mobile-nav__sub,
  .uws-www-mobile-nav__branch-toggle) { background: #f2f2f2 !important; color: #000 !important; }
html[data-uws-mourning="true"] .uws-www-mobile-nav__link:hover { background: #000; color: #fff !important; text-decoration: underline; }
html[data-uws-mourning="true"] :is(.page-header h2, .article-content-newstyle a,
  .oferta-dydaktyczna-tekst, .bt-title, .cms-track .bt-title, .cms-tiles .bt-title,
  .cms-article-card__title a, .cms-expert-card__title, .cms-more-tile a,
  .cms-more-li a) { color: #000 !important; border-color: #000; }
html[data-uws-mourning="true"] :is(.item-page, .cms-page-content, .article-content-newstyle) a {
  text-decoration: underline; text-underline-offset: .15em;
}
html[data-uws-mourning="true"] :is(.custom-button-newstyle, .tabela_dokumentow_head-newstyle,
  .cms-nav, .cms-pause, .cms-banner__button, .uws-search-form button,
  .cms-pager .active span, .back) {
  color: #fff !important; background: #000 !important; border-color: #000 !important;
}
html[data-uws-mourning="true"] :is(.custom-button-newstyle, .cms-nav, .cms-pause,
  .cms-banner__button, .uws-search-form button, .back):hover { background: #333 !important; }
html[data-uws-mourning="true"] :is(.cms-nav, .cms-pause):not(:disabled) { opacity: 1; }
html[data-uws-mourning="true"] :is(.cms-more-tile, .cms-tile__placeholder, .cms-tiles .bt-center,
  .cms-expert-card__image-link) { background: #f2f2f2 !important; border-color: #767676 !important; }
html[data-uws-mourning="true"] :is(.cms-pager a, .cms-pager span, #uws-more) {
  background: #fff; color: #000; border-color: #767676;
}
html[data-uws-mourning="true"] :is(.cms-article-card__date, .cms-expert-card__date,
  .cms-expert-card__lead, .uws-opt-s, .uws-opt-x, .uws-res-path,
  .uws-res-snip, .uws-cal__item-loc, .uws-cal__empty) { color: #555; }
html[data-uws-mourning="true"] :is(.uws-search-list, .uws-modal, .uws-cal__item,
  .uws-cal__nav, .uws-search-form input, .uws-www-mobile-nav__search input[type="text"]) {
  color: #111; background: #fff; border-color: #767676;
}
html[data-uws-mourning="true"] :is(.uws-cal, .uws-cal__day, .uws-opt-t,
  .uws-res h2 a, .uws-res-sec, .uws-search-all, .uws-cal__item-date,
  .uws-modal__when, .uws-modal__link, .uws-search-empty a) { color: #000; }
html[data-uws-mourning="true"] .uws-cal__table th { color: #555; }
html[data-uws-mourning="true"] :is(.uws-cal__day.has-ev, .uws-cal__nav:hover,
  .uws-cal__item:hover, .uws-search-all:hover, .uws-search-opt:hover,
  .uws-search-opt[aria-selected="true"], .uws-modal__close) {
  background: #f2f2f2; color: #000; border-color: #767676;
}
html[data-uws-mourning="true"] :is(.uws-cal__day.is-today, .uws-search-opt[aria-selected="true"],
  .uws-search-all[aria-selected="true"]) { outline-color: #000; }
html[data-uws-mourning="true"] .uws-cal__dot { background: #000; }
html[data-uws-mourning="true"] :is(.uws-search-list mark, .uws-res mark) {
  background: #ddd; color: #000; text-decoration: underline; font-weight: 700;
}
html[data-uws-mourning="true"] .uws-www-mobile-nav__search input[type="submit"] {
  color: #000; background: #fff; border-color: #000;
}
html[data-uws-mourning="true"] .uws-www-mobile-nav__search input[type="submit"]:hover {
  color: #fff; background: #000;
}
html[data-uws-mourning="true"] .uws-announcement-bar { background: #000 !important; }
html[data-uws-mourning="true"] .uws-announcement-bar__inner { color: #fff !important; }
/* Two contrasting edges work on light, dark and photographic surfaces. */
html[data-uws-mourning="true"] :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid #000 !important; outline-offset: 3px !important;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #000 !important;
}
/* Inset rings remain visible in clipped cards and menu items. */
html[data-uws-mourning="true"] :is(#main-navigation a, #main-navigation button,
  .cms-tile__link):focus-visible {
  outline: 3px solid #fff !important; outline-offset: -3px !important;
  box-shadow: inset 0 0 0 6px #000 !important;
}
html[data-uws-mourning="true"] :is(.cms-tiles, .cms-carousel) .bt-row:has(.cms-tile__link:focus-visible) {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #000 !important;
}
@media (forced-colors: active) {
  html[data-uws-mourning="true"] { filter: none; }
  html[data-uws-mourning="true"] :is(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid Highlight !important; box-shadow: none !important;
  }
}
