/* Ośrodek Logopedyczny — warstwa WCAG 2.1 AA.
 * Ładowany jako ostatni arkusz: nie zmienia layoutu ani treści,
 * tylko kontrast, focus, skip-linki, reflow i czytelność z klawiatury.
 */

/* --- 2.4.1 Bypass Blocks: skip-linki widoczne dopiero po fokusie --- */
.uws-skip-links {
  position: absolute;
  z-index: 100000;
  top: 0;
  left: 0;
}

.uws-skip-link,
.uws-skip-link:link,
.uws-skip-link:visited,
.uws-skip-link:hover,
.uws-skip-link:active,
.uws-skip-link:focus,
.uws-skip-link:focus-visible {
  background: #111 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-decoration-color: #ffffff !important;
}

.uws-skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  margin: 0;
  padding: 0.65rem 1.1rem;
  font-family: Montserrat, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  border: 3px solid #ffdd00;
  border-radius: 0 0 4px 0;
}

.uws-skip-link:focus,
.uws-skip-link:focus-visible {
  position: fixed;
  left: 0.75rem;
  top: 0.75rem;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  z-index: 100001;
  outline: 3px solid #ffdd00;
  outline-offset: 2px;
}

.uws-skip-links .uws-skip-link:nth-of-type(2):focus,
.uws-skip-links .uws-skip-link:nth-of-type(2):focus-visible {
  top: 3.55rem;
}

.uws-skip-links .uws-skip-link:nth-of-type(3):focus,
.uws-skip-links .uws-skip-link:nth-of-type(3):focus-visible {
  top: 6.35rem;
}

.uws-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Skip-target: fokus bez przesuwania layoutu */
#content:focus,
#content:focus-visible,
#masthead:focus,
#masthead:focus-visible,
#colophon:focus,
#colophon:focus-visible,
#main:focus,
#main:focus-visible {
  outline: 3px solid #111;
  outline-offset: -3px;
}

/* --- 2.4.7 + 1.4.11: widoczny fokus (czarny 3:1+ na bieli; żółty na ciemnym) --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
.ast-menu-toggle:focus-visible,
.menu-toggle:focus-visible,
.elementor-button:focus-visible,
.social-link:focus-visible {
  outline: 3px solid #111 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px #ffdd00 !important;
}

.site-footer a:focus-visible,
.site-footer button:focus-visible,
.site-footer .social-link:focus-visible {
  outline-color: #ffdd00 !important;
  box-shadow: 0 0 0 6px #111 !important;
}

input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
textarea:focus,
.wp-block-search__input:focus {
  outline: 3px solid #111 !important;
  outline-offset: 2px !important;
  border-color: #111 !important;
  border-width: 2px !important;
}

.search-form input.search-field:focus,
input {
  outline: revert;
}

/* --- 1.4.3 Kontrast: token jasnego błękitu (2.85:1) → AA --- */
:root {
  --ast-global-color-7: #005ea2;
  --e-global-color-astglobalcolor7: #005ea2;
  /* Gutenberg has-white-color w eksporcie WP nie dostaje tego tokenu */
  --wp--preset--color--white: #ffffff;
}

/* Stopka: h1–h6 dziedziczą --ast-global-color-2 (#000) — 1.2:1 na tle #333.
   Klasa has-white-color nie ma reguły w tym eksporcie. Przywracamy zamierzony biały. */
.site-footer .has-white-color,
.site-footer .wp-block-heading,
.site-footer .widget-title,
.site-footer h2.social-heading,
.site-footer h3.social-heading,
.site-footer .social-card-title,
.site-footer .social-card h4,
.site-footer .uws-footer-sitename,
.cms-footer-content .ol-footer__social-heading,
.cms-footer-content .ol-footer__social-card-title {
  color: #ffffff !important;
}

/* Karty social: zawsze widoczne, bez obcinania długich tytułów (NKL). */
.site-footer .social-card,
.cms-footer-content .ol-footer__social-card {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.site-footer .social-card-title,
.site-footer .social-card h4,
.cms-footer-content .ol-footer__social-card-title {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/*
 * Astra: poniżej 545px jest mobile-full (1 kolumna), ale 545–921px zostaje
 * tablet-3-equal — środkowa kolumna pusta, social (~130px) po prawej.
 * Na telefonie w poziomie / wąskim tablecie „Naukowe Koło…” ginęło w ciasnej kolumnie.
 */
@media (max-width: 921.9px) {
  .site-primary-footer-wrap .site-primary-footer-inner-wrap.ast-builder-grid-row,
  .site-primary-footer-wrap .ast-builder-footer-grid-columns {
    grid-template-columns: 1fr !important;
  }

  .site-primary-footer-wrap .site-footer-section {
    width: 100% !important;
    max-width: 100% !important;
  }

  .cms-footer-content .ol-footer__inner {
    grid-template-columns: 1fr !important;
  }

  .site-footer .social-list,
  .cms-footer-content .ol-footer__social-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem;
  }
}

/* Scalone logo+nazwa: jeden link zamiast dwóch redundantnych */
.site-branding > a.custom-logo-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.site-branding > a.custom-logo-link .site-title {
  color: inherit;
}

/* site-description 9px + ikony menu — WAVE Very small text */
.site-header .site-description,
.site-footer .uws-footer-faculty,
.has-small-font-size {
  font-size: 0.75rem !important;
  line-height: 1.4;
}

/* Strzałki submenu: Font Awesome (zamiast Astra icon font) — tylko pozycje z dziećmi */
.ast-menu-toggle::before,
.main-header-bar .main-header-bar-navigation .menu-item-has-children > a:after,
.menu-item-has-children .ast-header-navigation-arrow:after {
  font-size: 0.75rem !important;
}

/* Astra/FA: nie pokazuj strzałki przy liściach (pozycje bez podmenu) */
.main-header-menu .menu-item:not(.menu-item-has-children):not(.page_item_has_children) > .menu-link:before,
.main-header-menu .menu-item:not(.menu-item-has-children):not(.page_item_has_children) > .menu-link:after,
.main-header-menu .menu-item:not(.menu-item-has-children):not(.page_item_has_children) > .ast-menu-toggle,
.ast-header-break-point .main-navigation ul.sub-menu .menu-item:not(.menu-item-has-children):not(.page_item_has_children) > .menu-link:before {
  content: none !important;
  display: none !important;
}

/* Mobile: pasek + hamburger Astry (NAV_V2 chował .menu-toggle, a uws-nav jest w ukrytym #ast-desktop-header) */
@media (max-width: 921.9px) {
  #ast-mobile-header {
    display: block !important;
  }

  #ast-mobile-header .ast-button-wrap,
  #ast-mobile-header .menu-toggle.main-header-menu-toggle {
    display: flex !important;
    align-items: center;
    visibility: visible !important;
    opacity: 1 !important;
  }

  #ast-mobile-header .menu-toggle .ast-mobile-svg.ast-menu-svg {
    display: block !important;
    width: 24px;
    height: 24px;
    fill: #000;
  }
}

.uws-footer-sitename {
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
}

.uws-footer-sitename-sub {
  display: block;
  font-weight: 500;
  font-size: 0.95em;
  margin-top: 0.15em;
}

.social-card-title {
  margin: 0 0 0.85rem;
  color: #fff;
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 700;
}

/* Globalne a:focus { color:#4d0000 } na tle #333 nie spełnia 1.4.3 */
.site-footer a:focus,
.site-footer a:focus-visible {
  color: #ffadad;
}

/* --- 1.4.10 Reflow + 1.4.4 Resize: obrazy i media nie wychodzą poza viewport --- */
img,
video,
svg,
iframe,
.elementor-widget-image img,
.elementor-image-box-img img,
.uael-grid-img-thumbnail img,
.wp-block-image img {
  max-width: 100%;
  height: auto;
}

.site,
.site-content,
.entry-content,
.cms-page-content,
.elementor,
.elementor-widget-container,
.uael-modal-text,
.uael-text-editor {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.site-content,
.entry-content,
.cms-page-content,
.ast-site-identity,
.ast-site-title-wrap,
.site-header .ast-builder-grid-row,
.site-header .site-header-section-left {
  min-width: 0;
}

.site-title,
.site-title a,
.elementor-heading-title,
.uws-page-banner .elementor-heading-title {
  white-space: normal !important;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

/*
 * iOS: overflow-x ≠ visible na html/body/#page zamienia overflow-y na auto
 * i tworzy zagnieżdżony scrollport wysokości viewportu. Stopka maluje się
 * poza scrollHeight — widać ją tylko przy gumie, po puszczeniu wraca.
 * Poziomy overflow (100vw alignfull) tniemy na .site-content, BEZ stopki.
 */
html,
body,
#page.site {
  overflow: visible !important;
}

.site-content,
.entry-content,
.elementor {
  overflow-x: clip;
  max-width: 100%;
}

/*
 * Dolny pasek Safari / pasek gestu nie zmniejsza scrollHeight.
 * !important — wstrzyknięty styl CMS ma padding: shorthand i nadpisywał padding-bottom.
 */
@media (max-width: 921.9px) {
  .site-footer,
  .cms-footer-content .ol-footer {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

.elementor-section,
.elementor-container,
.elementor-widget-wrap,
.elementor-widget-container,
.uws-page-banner,
.uws-page-banner .elementor-element-311d1d8e,
.uws-page-banner .elementor-element-59086f2f > .elementor-widget-wrap {
  max-width: 100%;
  box-sizing: border-box;
}

/* Ikony jednostek na home: inline SVG (webfont FA nie ma woff2), bordo jak Kontakt (#82000f). */
.elementor-element-9aa8e53 .elementor-icon-wrapper,
.elementor-element-f104b34 .elementor-icon-wrapper,
.elementor-element-a7a12df .elementor-icon-wrapper {
  text-align: center;
}

.elementor-element-9aa8e53 .elementor-icon,
.elementor-element-f104b34 .elementor-icon,
.elementor-element-a7a12df .elementor-icon {
  color: #82000f !important;
  border-color: #82000f !important;
  font-size: 3.5rem;
  line-height: 1;
}

.elementor-element-9aa8e53 .elementor-icon svg,
.elementor-element-f104b34 .elementor-icon svg,
.elementor-element-a7a12df .elementor-icon svg {
  fill: currentColor !important;
  width: 1em;
  height: 1em;
  display: block;
  margin-inline: auto;
}

/* 1.4.10: Elementor na ≤1024px daje tytułowi paddingu 150px i font 3.8em — tekst wychodzi poza 320px. */
@media (max-width: 1024px) {
  .uws-page-banner .elementor-section.elementor-section-height-min-height,
  .uws-page-banner .elementor-element-311d1d8e,
  .uws-page-banner .elementor-element-1794eb9c,
  .uws-page-banner .elementor-element-2a765b5c {
    min-height: 0 !important;
    overflow: visible !important;
  }

  .uws-page-banner .elementor-container,
  .uws-page-banner .elementor-element-311d1d8e > .elementor-container,
  .uws-page-banner .elementor-element-1794eb9c > .elementor-container,
  .uws-page-banner .elementor-element-2a765b5c > .elementor-container {
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    padding: 1.5rem 1rem 2.5rem !important;
  }

  .uws-page-banner .elementor-widget-container,
  .uws-page-banner .elementor-element-populated,
  .uws-page-banner .elementor-element-220aa02a > .elementor-widget-container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .uws-page-banner h1,
  .uws-page-banner .elementor-heading-title,
  .uws-page-banner .elementor-element-220aa02a .elementor-heading-title,
  .elementor-element-311d1d8e h1.elementor-heading-title,
  .elementor-element-1794eb9c h1.elementor-heading-title,
  .elementor-element-2a765b5c h1.elementor-heading-title {
    font-size: clamp(1.15rem, 5.2vw, 2rem) !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 767px) {
  .elementor-section .elementor-container {
    flex-wrap: wrap;
  }

  .wp-container-core-columns-is-layout-7387b849 {
    flex-wrap: wrap !important;
  }

  .elementor-element-de72c4a .elementor-heading-title,
  .elementor-element-40e8b98 .elementor-heading-title {
    font-size: clamp(1.35rem, 7vw, 2rem) !important;
    line-height: 1.2 !important;
  }

  .site-title {
    font-size: 1.05rem !important;
    line-height: 1.25 !important;
  }

  .site-footer .uws-footer-sitename {
    overflow-wrap: anywhere;
  }
}

/* --- 1.4.12 Text Spacing: nie obcinaj zwiększonych odstępów użytkownika --- */
p,
li,
h1, h2, h3, h4, h5, h6,
.elementor-heading-title,
.elementor-image-box-description,
.elementor-button-text {
  overflow: visible;
}

/* Etykiety menu-nonclick są spanem, nie martwym href="#" */
.menu-nonclick > .menu-link {
  display: inline-block;
  pointer-events: none;
  cursor: default;
  text-decoration: none;
  color: #111;
}

/* Stopka: dawne h1/h2 (duplikat nagłówka strony) zachowują wygląd jako akapity */
.site-footer .uws-footer-sitename {
  margin: 0 0 20px;
  color: var(--ast-global-color-4, #f6f9f6);
  font-family: Montserrat, sans-serif;
  font-size: 40px;
  font-size: 2.6666666666667rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.site-footer .uws-footer-faculty {
  margin: 0 0 20px;
  color: var(--ast-global-color-4, #f6f9f6);
  font-family: Montserrat, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

@media (max-width: 544px) {
  .site-footer .uws-footer-sitename {
    font-size: 18px;
    font-size: 1.2rem;
  }
}

/* Pozostałość WP: pusta wtyczka mapy nie rezerwuje miejsca */
.googlemaps_embed:empty {
  display: none;
}

/* 2.3.3 / reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
