/*
 * ATMA – fundament (nagłówek, menu pełnoekranowe, stopka, wspólne wzorce).
 * Tylko to, czego nie da się ustawić kontrolkami Elementora. Kolory/fonty/odstępy są w Elementorze (kit + widżety).
 * Strona główna: atma-home.css, podstrony: atma-pages.css (inne pliki, inni właściciele).
 */

/* Stary motyw: body { overflow-x: hidden } – wielkie słowo w tle i ramki zdjęć wystają poza sekcje. */
body { overflow-x: hidden; }

/* Treść (widżet Edytor tekstu z klasą .atma-prose / dowolny edytor tekstu): listy jak w starym motywie
   (Hello resetuje listy; stary motyw: margin-left 25px, punktor disc). */
.elementor-widget-text-editor ul,
.elementor-widget-text-editor ol { margin: 0 0 16px 25px; padding: 0; }
.elementor-widget-text-editor ul { list-style: disc; }
.elementor-widget-text-editor ol { list-style: decimal; }
.elementor-widget-text-editor p:last-child { margin-bottom: 16px; }
/* Nagłówki wpisane w Edytorze tekstu przejmują kolor ustawiony w widżecie (np. biały w ciemnych sekcjach). */
.elementor-widget-text-editor :is(h1, h2, h3, h4, h5, h6) { color: inherit; }

/* Menu pełnoekranowe (popup): bieżąca pozycja pogrubiona, z turkusową kreską po lewej (stary ::before). */
.atma-fullmenu .elementor-nav-menu--dropdown { background: transparent; }
.atma-fullmenu .elementor-nav-menu--dropdown .elementor-item.elementor-item-active,
.atma-fullmenu .elementor-nav-menu--dropdown .elementor-sub-item.elementor-item-active,
.atma-fullmenu .elementor-nav-menu--dropdown .current-menu-item > a { font-weight: 700 !important; position: relative; }
.atma-fullmenu .elementor-nav-menu--dropdown .current-menu-item > a::before {
	content: ""; position: absolute; left: -60px; top: 20px; width: 63px; height: 1px; background: #54A6A0;
}
.atma-fullmenu .elementor-nav-menu--dropdown ul.sub-menu { padding: 10px 0 10px 20px; }
/* Elementor wymusza w menu line-height 20px – przywróć interlinię z typografii globalnej (96.8%). */
.atma-fullmenu .elementor-nav-menu--dropdown a { border: 0; white-space: normal; line-height: .968; }

/* Stopka: stary motyw usuwał skryptem pozycje z podmenu (Oferta, Projekty) z menu w stopce. */
/* Zmiana: działy z prawdziwym adresem (Rehabilitacja, Opieka) są widoczne; ukryte zostają tylko pozycje bez adresu (Projekty #) oraz podmenu i strzałki. */
.atma-footer-menu .elementor-nav-menu > .menu-item-has-children:has(> a[href="#"]) { display: none; }
.atma-footer-menu .elementor-nav-menu .sub-menu, .atma-footer-menu .elementor-nav-menu .sub-arrow { display: none !important; }
/* Stopka: powyżej 1441px stary motyw miał 10% marginesu bocznego (Elementor nie ma tu punktu łamania). */
@media (min-width: 1442px) {
	.atma-footer.e-con { padding-left: calc(10% - 15px); padding-right: calc(10% - 15px); }
	.atma-copyright.e-con { padding-left: calc(10% + 15px); padding-right: calc(10% + 15px); }
}

/* Link „Czytaj więcej” (Pole ikony): strzałka 20x8 w kółku – ikona SVG nie może być kwadratem 1em x 1em. */
.atma-more .elementor-icon svg { width: 20px; height: 8px; }

/* --- Poprawka strzałki w kółku (cała witryna, wzorzec atma_more_link) -------------------------------------
   Było: ramka = strzałka 20x8 + padding 13px → spłaszczony owal 46x34. Jest: prawdziwe koło 46x46 ze strzałką
   wyśrodkowaną flexem; etykieta i koło wyrównane w pionie; hover = turkusowe wypełnienie, strzałka przesuwa się
   o 3px. Dotyczy tylko wariantu z ramką (elementor-view-framed) – strzałka bez kółka (karty usług) bez zmian. */
.atma-more.elementor-view-framed .elementor-icon {
	display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
	width: 46px; height: 46px; padding: 0; border-radius: 50%; line-height: 1;
	transition: background-color .25s, border-color .25s, color .25s;
}
.atma-more.elementor-view-framed .elementor-icon svg { flex: 0 0 auto; transition: transform .25s; }
.atma-more.elementor-view-framed .elementor-icon-box-wrapper { align-items: center; }
.atma-more.elementor-view-framed .elementor-icon-box-icon { display: inline-flex; flex: 0 0 auto; }
.atma-more.elementor-view-framed:hover .elementor-icon,
.atma-more.elementor-view-framed a:focus-visible .elementor-icon { background-color: #54A6A0; border-color: #54A6A0; color: #fff; }
.atma-more.elementor-view-framed:hover .elementor-icon svg { fill: #fff; transform: translateX(3px); }

/* Menu pełnoekranowe: podmenu bieżącej sekcji od razu rozwinięte (stary skrypt dodawał klasę .open). */
.atma-fullmenu .elementor-nav-menu--dropdown .current-menu-ancestor > ul.sub-menu,
.atma-fullmenu .elementor-nav-menu--dropdown .current-menu-parent > ul.sub-menu { display: block !important; }

/* Przycisk „do góry” (widżet Ikona w stopce, pozycja fixed): pojawia się dopiero po przewinięciu strony.
   Przeglądarki bez animacji sterowanych przewijaniem pokazują go stale. */
@supports (animation-timeline: scroll()) {
	.atma-totop { animation: atma-totop linear both; animation-timeline: scroll(root); animation-range: 0 400px; }
	@keyframes atma-totop { 0%, 70% { opacity: 0; visibility: hidden; } 100% { opacity: 1; visibility: visible; } }
}

/* Siatka bezpieczeństwa: widoki bez banera zbudowanego w Elementorze (wpisy, archiwa, 404, strony jeszcze
   nieprzebudowane) – przezroczysty nagłówek z białym tekstem dostaje ciemne tło i wraca do normalnego układu. */
body:not(.elementor-page) .atma-header.e-con { position: relative; background-color: #131313; }

/* Menu pełnoekranowe: pozycje-kotwice (/opieka/#…) nie są podświetlane jako "bieżąca strona" –
   WordPress ignoruje #hash, więc bez tego wszystkie trzy byłyby pogrubione naraz. */
.atma-fullmenu .menu-item-type-custom.current-menu-item > a[href*="#"] { font-weight: 200 !important; }
.atma-fullmenu .menu-item-type-custom.current-menu-item > a[href*="#"]::before { display: none !important; }

/* Pusty "mały baner" na dole podstron (stary motyw rysował tam pusty pas z gradientem do bieli) –
   ukryty, dopóki w banerze nie ma żadnej treści. */
.atma-small-banner:not(:has(.elementor-widget)) { display: none !important; }

/* ================= HEADER: top bar + main row + sticky state ================= */
.atma-header.e-con { transition: background-color .25s ease, box-shadow .25s ease; }
.atma-topbar { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.atma-topbar .elementor-widget-icon-list { flex: none; }
.atma-topbar .elementor-icon-list-items { flex-wrap: nowrap !important; }
.atma-topbar .elementor-icon-list-item, .atma-topbar .elementor-icon-list-text { white-space: nowrap; }
.atma-topbar-right { width: auto; flex: 0 1 auto; min-width: 0; }
.atma-topbar .elementor-social-icons-wrapper { display: flex; flex-wrap: nowrap; }
.atma-topbar-badge .elementor-icon-list-item { margin: 0 !important; padding: 5px 14px !important; border-radius: 999px; background: rgba(84, 166, 160, .16); border: 1px solid rgba(84, 166, 160, .55); transition: background-color .2s ease; }
.atma-topbar-badge .elementor-icon-list-item:hover { background: rgba(84, 166, 160, .3); }
.atma-topbar-badge .elementor-icon-list-item:hover .elementor-icon-list-text { color: #fff !important; }
.atma-topbar-address .elementor-icon-list-item { margin: 0 !important; padding: 0 !important; }

/* main row */
.atma-header-actions { width: auto; }
.atma-burger { transition: background-color .2s ease, border-color .2s ease; cursor: pointer; text-decoration: none; }
.atma-burger:hover { background-color: rgba(255, 255, 255, .12); border-color: #fff !important; }
.atma-burger .elementor-icon { display: block; line-height: 1; }
.atma-burger .elementor-icon-wrapper { line-height: 0; }
.atma-header .elementor-button { box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }

/* tablet: keep everything on one line */
@media (max-width: 1024px) and (min-width: 768px) {
	.atma-topbar { padding-left: 3% !important; padding-right: 3% !important; }
	.atma-topbar-badge .elementor-icon-list-item { padding: 4px 10px !important; }
}
@media (max-width: 880px) and (min-width: 768px) {
	.atma-topbar .elementor-icon-list-text { font-size: 11.5px !important; }
	.atma-topbar-phones .elementor-icon-list-item { margin-inline: 6px !important; padding: 0 !important; }
	.atma-topbar-right { gap: 8px !important; }
}

/* phone: the address line may wrap, nothing can push the page wider than the screen */
@media (max-width: 767px) {
	.atma-header.e-con, .atma-topbar, .atma-header-bar { max-width: 100vw; overflow: hidden; }
	.atma-topbar .elementor-widget-icon-list { flex: 0 1 auto; min-width: 0; }
	.atma-topbar-mobile .elementor-icon-list-items { flex-wrap: wrap !important; justify-content: center; }
	.atma-topbar-mobile .elementor-icon-list-item, .atma-topbar-mobile .elementor-icon-list-text { white-space: normal; text-align: center; }
	.atma-topbar-mobile .elementor-icon-list-item { margin: 0 !important; padding: 0 !important; }
	.atma-header-actions { flex: 0 1 auto; min-width: 0; }
	.atma-call .elementor-button { white-space: nowrap; }
	.atma-burger { width: 44px !important; height: 44px; padding: 0 !important; }
}
@media (max-width: 359px) {
	.atma-call .elementor-button-text { display: none; }
	.atma-call .elementor-button { padding: 13px !important; }
	.atma-call .elementor-button-icon { margin: 0 !important; }
}

/* sticky state (class set on <html> by the child theme's script once the page is scrolled) */
html { scroll-padding-top: 88px; }
html.atma-scrolled body:is(.elementor-page, :has(.atma-banner)) .atma-header.e-con {
	position: fixed !important; top: 0; left: 0; right: 0;
	background-color: rgba(13, 15, 16, .82);
	-webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
	box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
	animation: atma-header-in .28s ease both;
}
html.atma-scrolled body.admin-bar:is(.elementor-page, :has(.atma-banner)) .atma-header.e-con { top: 32px; }
@media (max-width: 782px) { html.atma-scrolled body.admin-bar:is(.elementor-page, :has(.atma-banner)) .atma-header.e-con { top: 46px; } }
@media (max-width: 600px) { html.atma-scrolled body.admin-bar:is(.elementor-page, :has(.atma-banner)) .atma-header.e-con { top: 0; } }
html.atma-scrolled body:is(.elementor-page, :has(.atma-banner)) .atma-topbar { display: none !important; }
html.atma-scrolled body:is(.elementor-page, :has(.atma-banner)) .atma-header-bar { padding-top: 9px !important; padding-bottom: 9px !important; }
html.atma-scrolled body:is(.elementor-page, :has(.atma-banner)) .atma-brand { width: 150px !important; }
html.atma-scrolled body:is(.elementor-page, :has(.atma-banner)) .atma-tagline { display: none !important; }
@media (max-width: 767px) { html.atma-scrolled body:is(.elementor-page, :has(.atma-banner)) .atma-brand { width: 104px !important; } }
@keyframes atma-header-in { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { html.atma-scrolled .atma-header.e-con { animation: none !important; } }
.atma-header .atma-burger.e-con { width: auto !important; flex: none; }
.atma-header .atma-header-actions.e-con { width: auto !important; flex: none; }
/* logged-in view: keep the header below the WordPress admin bar */
body.admin-bar .atma-header.e-con { top: 32px !important; }
@media (max-width: 782px) { body.admin-bar .atma-header.e-con { top: 46px !important; } }
@media (max-width: 600px) { html.atma-scrolled body.admin-bar .atma-header.e-con { top: 0 !important; } }
@media (max-width: 767px) { .atma-header .atma-burger.e-con { width: 44px !important; } }
.atma-topbar-address .elementor-icon-list-items, .atma-topbar-badge .elementor-icon-list-items, .atma-topbar-mobile .elementor-icon-list-items { margin: 0 !important; }
.atma-topbar-right > .elementor-widget { flex: none; }
@media (max-width: 767px) {
	.atma-topbar-mobile .elementor-icon-list-item { justify-content: center; }
	.atma-topbar-mobile .elementor-icon-list-text { flex: 0 1 auto; }
}
@media (max-width: 420px) { .atma-topbar-mobile .elementor-icon-list-text { font-size: 10.8px !important; letter-spacing: 0 !important; } }
