/* Konieczny Fizjoterapia: overrides on top of Physeo. */

/* Polish copy uses sentence case; the theme capitalizes every word in many places. */
h1, h2, h3, h4, h5, h6,
.wdt-heading-holder .wdt-heading-title-wrapper,
.wdt-heading-holder .wdt-heading-title-wrapper .wdt-heading-colored-elements,
.wdt-button, .wdt-button-holder .wdt-button, .wdt-button-text,
.elementor-button, button, .button, a.button,
input[type="submit"], input[type="reset"], input[type="button"],
.wdt-header-menu li a, .wdt-header-menu ul li ul.sub-menu > li > a, .wdt-header-menu ul li ul.children > li > a,
.wdt-content-item .wdt-content-title h5,
.wdt-image-box-holder .wdt-content-item .wdt-content-title h5,
.wdt-image-box-holder .wdt-content-item .wdt-content-description,
.wdt-rc-template-icon-aside-content .wdt-content-item .wdt-content-description,
.widgettitle, .widget_block > h2,
.blog-entry .entry-button a.wdt-button, .blog-entry div.entry-meta-group > div,
#footer .elementor-widget-heading .elementor-heading-title,
#footer .wdt-accordion-toggle-holder .wdt-accordion-toggle-title-holder,
.wdt-accordion-toggle-holder .wdt-accordion-toggle-title-holder,
.comment-reply-link, .frm-group .placeholder,
.main-title-section h1, .breadcrumb,
.wdt-heading-holder .wdt-heading-title-wrapper .wdt-split-heading-title,
.wdt-heading-holder .wdt-heading-title-wrapper .wdt-split-heading-title:nth-child(1) {
	text-transform: none !important;
}

/* Main menu: five Polish labels are longer than the demo ones; keep them on one line. */
@media (max-width: 1540px) {
	.elementor-element-dea5fb9 .wdt-primary-nav > li > a { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 1366px) {
	.elementor-element-dea5fb9 .wdt-primary-nav > li > a { padding-left: 9px; padding-right: 9px; font-size: 15px; }
}

/* Long e-mail addresses in contact boxes must not run into the next column. */
.wdt-image-box-holder .wdt-content-title,
.wdt-image-box-holder .wdt-content-title a,
.wdt-image-box-holder .wdt-content-button a {
	overflow-wrap: anywhere;
}

/* ---------- Content pages migrated from the old site (classic content, page.php) ---------- */
#primary .type-page { max-width: 900px; margin-left: auto; margin-right: auto; }
#primary .type-page img { max-width: 100%; height: auto; border-radius: 30px; }
#primary .type-page figure { margin: 0 0 20px; }
#primary .type-page figcaption { margin-top: 10px; font-weight: 700; color: var(--wdtPrimaryColor); }
/* Exercise clips are 16:9; the ratio reserves space until metadata loads, then the file's own ratio wins. */
#primary .type-page video { display: block; width: 100%; height: auto; aspect-ratio: auto 16 / 9; margin: 0 auto 30px; border-radius: 30px; background: #000; }
#primary .type-page iframe { display: block; width: 100%; max-width: 760px; height: 340px; margin: 10px 0 30px; border: 0; border-radius: 30px; }
#primary .type-page p a, #primary .type-page li a { overflow-wrap: anywhere; }
#primary .type-page h2, #primary .type-page h3 { margin-top: 1.4em; }

/* Booking links inside old content look like the theme buttons. */
#primary .type-page a[href^="/umow-wizyte"],
#primary .type-page a[href*="medfile.pl/register"] {
	display: inline-flex;
	align-items: center;
	min-height: 52px;
	margin: 6px 0 14px;
	padding: 0 28px;
	border-radius: 40px;
	background: var(--wdtSecondaryColor);
	color: #fff;
	font-size: 16px;
	font-weight: 400;
	white-space: nowrap;
	text-decoration: none;
}
#primary .type-page a[href^="/umow-wizyte"]:hover,
#primary .type-page a[href*="medfile.pl/register"]:hover { background: var(--wdtPrimaryColor); color: #fff; }

.kf-grid { display: grid; gap: 24px; margin: 0 0 40px; }
.kf-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kf-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kf-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 20px; margin: 0 0 50px; }
.kf-tile, .kf-promo {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 18px;
	border-radius: 30px;
	background: #fff;
	color: var(--wdtPrimaryColor);
	font-weight: 700;
	text-align: center;
	text-decoration: none !important;
	transition: transform 0.2s, box-shadow 0.2s;
}
.kf-tile img { border-radius: 0 !important; max-height: 150px; width: auto !important; }
.kf-tile:hover, .kf-promo:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(31, 61, 63, 0.12); }
#primary .type-page a.kf-promo { background: #fff; color: var(--wdtPrimaryColor); padding: 0 0 18px; overflow: hidden; display: flex; min-height: 0; margin: 0; border-radius: 30px; white-space: normal; font-weight: 700; padding: 0 0 18px; }
.kf-promo img { border-radius: 0 !important; }

@media (max-width: 767px) {
	.kf-grid--2, .kf-grid--4 { grid-template-columns: 1fr; }
	.kf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	#primary .type-page iframe { height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
	.kf-tile, .kf-promo { transition: none; }
	.kf-tile:hover, .kf-promo:hover { transform: none; }
}
/* wpautop adds <br> between inline tiles; they must not become grid cells. */
.kf-tiles > br, .kf-grid > br, .kf-tiles > p:empty, .kf-grid > p:empty { display: none; }

/* Complaints carousel (home): the design has white cards with a white fade under the
   illustration and dark titles; the theme's image-overlay template only ships a dark fade. */
.elementor-element-d3f7a5e .wdt-content-image img { transform: none !important; }
.elementor-element-d3f7a5e .wdt-content-item::before {
	top: -2px !important;
	bottom: -2px !important;
	height: auto !important;
	background-image: linear-gradient(0deg, #fff 0%, #fff 18%, rgba(255, 255, 255, 0.85) 26%, rgba(255, 255, 255, 0) 45%) !important;
}

/* Opinie page: review links (each in its own heading) read as outline buttons. */
body.page-id-1853 #primary .type-page h3 > a {
	display: inline-flex;
	align-items: center;
	min-height: 52px;
	padding: 0 28px;
	border: 1px solid var(--wdtPrimaryColor);
	border-radius: 40px;
	color: var(--wdtPrimaryColor);
	font-size: 16px;
	font-family: inherit;
	text-decoration: none;
}
body.page-id-1853 #primary .type-page h3 > a:hover { background: var(--wdtPrimaryColor); color: #fff; }

/* Footer "Umów wizytę" button: the footer link colour made its label dark on teal. */
.wdt-footer-tpl .wdt-button-holder.wdt-template-filled .wdt-button,
.wdt-footer-tpl .wdt-button-holder.wdt-template-filled .wdt-button .wdt-button-text { color: #fff !important; }

/* Certificates gallery and clinic cards. */
.kf-certificates .gallery-item img { border-radius: 16px; box-shadow: 0 8px 20px rgba(31, 61, 63, 0.12); }
.kf-certificates .gallery { align-items: flex-start; }
.kf-clinic-card iframe { border-radius: 20px; }
body.page-id-1853 #primary .type-page h3:has(> a) { display: inline-block; margin: 6px 10px 6px 0; line-height: 1; }
body.page-id-1853 #primary .type-page h3 > a { line-height: 1; justify-content: center; font-family: "Lato", sans-serif; }
body.page-id-1853 #primary .type-page h3:not(:has(> a)) { margin-top: 1.6em; }

/* Współpraca: partner logos have different proportions; show them in identical square boxes. */
.kf-partner-logo-col { max-width: 360px; }
.kf-partner-logo img {
	display: block;
	width: 100% !important;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: #fff;
	border-radius: 30px;
	box-shadow: 0 10px 30px rgba(31, 61, 63, 0.08);
}
@media (max-width: 1024px) {
	.kf-partner-logo-col { max-width: 300px; }
}
@media (max-width: 767px) {
	.kf-partner-logo-col { max-width: 240px; }
}

/* Main menu: the widget has no typography control; sizes follow the design (18 px, #00384A). */
@media (min-width: 1541px) {
	.elementor-element-dea5fb9 .wdt-primary-nav > li > a { font-size: 18px; padding-left: 20px; padding-right: 20px; }
}
.elementor-element-dea5fb9 .wdt-primary-nav > li > a { color: #00384A; }

/* Forced line breaks in design headings only make sense on wide screens. */
@media (max-width: 767px) {
	.wdt-heading-title br { display: none; }
}

/* Home team section: theme headings carry a bottom margin; the design stacks name and role tightly. */
.elementor-element-kfteam0 .elementor-heading-title { margin: 0; }
/* Complaint cards: the theme draws a grey rule under image-box titles. */
.elementor-element-d3f7a5e .wdt-content-item .wdt-content-title { border-bottom: 0 !important; }

/* Subpages: the theme hard-codes 120/100/80/70/60/50 px under the title band; the design uses about 60 px. */
body:not(.home) #header-wrapper { margin-bottom: 60px; }
@media (max-width: 1540px) { body:not(.home) #header-wrapper { margin-bottom: 56px; } }
@media (max-width: 1280px) { body:not(.home) #header-wrapper { margin-bottom: 50px; } }
@media (max-width: 1024px) { body:not(.home) #header-wrapper { margin-bottom: 44px; } }
@media (max-width: 767px) { body:not(.home) #header-wrapper { margin-bottom: 36px; } }
/* Text pages: the first heading's top margin would add to the band spacing above. */
#primary .type-page > :first-child { margin-top: 0; }
/* Metody pracy quick links: the theme gives every button a 10 px top margin, which doubles the row gap. */
.elementor-element-knav000 .elementor-button { margin-top: 0; }

/* ==========================================================================
   Articles (posts in "Artykuły"): listing cards and the single article.
   Markup comes from the theme's Blog Posts widget and minimal post template;
   the header, TOC box, sources section and booking box come from inc/articles.php.
   ========================================================================== */

/* ---------- Cards: listing page and "Inne artykuły" (theme simple style, no image) ---------- */
/* The theme's equal-height grid drops the -15px gutter compensation; cards align with the heading again. */
.kf-articles-grid .apply-equal-height.tpl-blog-holder:not(.swiper-wrapper) { width: calc(100% + 30px); margin: 0 -15px; }
.wdt-simple-style.wdt-post-entry .blog-entry.type-post:not(.has-post-thumbnail) .entry-media-group { display: none; }
.wdt-simple-style.wdt-post-entry .blog-entry.type-post {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 34px 32px 32px;
}
.wdt-simple-style.wdt-post-entry .blog-entry.type-post .entry-content-group {
	flex: 1 1 auto;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: stretch;
	align-content: flex-start;
}
.wdt-simple-style.wdt-post-entry .blog-entry.type-post .entry-content-group > div { flex: 0 0 auto; }
.wdt-simple-style.wdt-post-entry .blog-entry.type-post .entry-content-group > .entry-button { margin-top: auto; padding-top: 6px; }
.wdt-simple-style.wdt-post-entry .blog-entry.type-post .entry-meta-group > div,
.kf-card-reading { font-family: var(--wdtFontTypo_Base); font-size: 14px; line-height: 22px; }
.wdt-simple-style.wdt-post-entry .blog-entry.type-post .entry-meta-group > div i { font-size: 15px; color: var(--wdtLinkHoverColor); }
.wdt-simple-style.wdt-post-entry .blog-entry.type-post .entry-title h4 { margin: 0; }
/* Reading time sits in the bottom row, opposite "Czytaj więcej". */
.kf-card-reading {
	position: absolute;
	bottom: 45px;
	right: 32px;
	z-index: 1;
	color: var(--wdtBodyTxtColor);
	white-space: nowrap;
}
.kf-card-reading i { margin-right: 5px; color: var(--wdtLinkHoverColor); }
.wdt-simple-style.wdt-post-entry:hover .kf-card-reading { color: var(--wdtAccentTxtColor); }
@media (max-width: 767px) {
	.wdt-simple-style.wdt-post-entry .blog-entry.type-post { padding: 26px 24px 24px; }
	.kf-card-reading { bottom: 37px; right: 24px; }
}

/* ---------- Single article: layout with the theme's right sidebar ---------- */
.single-post .blog-single-entry .post-meta { display: none; }
@media (min-width: 1025px) {
	.single-post #main > .container { max-width: 1300px; }
	.single-post #primary.with-right-sidebar { width: calc(100% - 380px); margin-right: 60px; }
	.single-post #secondary.secondary-has-right-sidebar { width: 320px; margin-top: -30px; }
	.single-post #secondary .wdt-sidebar-wrapper { margin-top: 30px; padding: 32px 30px; }
	/* On desktop the table of contents lives in the sidebar. */
	.single-post #primary.with-right-sidebar .kf-toc--inline { display: none; }
}
@media (min-width: 1025px) and (max-width: 1540px) {
	.single-post #main > .container { max-width: 1160px; }
}
@media (max-width: 1024px) {
	.single-post #secondary { display: none; }
}

/* Sidebar table of contents inside the theme's dark sidebar panel. */
.single-post #secondary .widget_text { margin-bottom: 0; }
.single-post #secondary .widgettitle { margin-bottom: 14px; font-size: 24px; }
.kf-toc--side .kf-toc__list {
	max-height: calc(100vh - 190px);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}
.single-post #secondary .kf-toc--side .kf-toc__list li { padding: 8px 0; border-color: rgba(var(--wdtAccentTxtColorRgb), 0.16); }
.single-post #secondary .kf-toc--side .kf-toc__list li:first-child { padding-top: 0; }
.single-post #secondary .kf-toc--side a { padding: 0; font-size: 15px; line-height: 1.45; color: var(--wdtAccentTxtColor); }
.single-post #secondary .kf-toc--side a:hover,
.single-post #secondary .kf-toc--side a:focus-visible { color: var(--wdtLinkHoverColor); }

/* Header: lead, date, reading time, authors. */
.kf-article-head { margin: 0 0 36px; padding: 0 0 26px; border-bottom: 1px solid rgba(var(--wdtBodyTxtColorRgb), 0.15); }
.kf-article-lead { margin: 0 0 20px; font-family: var(--wdtFontTypo_Alt); font-size: 24px; line-height: 1.45; color: var(--wdtHeadAltColor); }
.single-entry-body ul.kf-article-meta { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 0; padding: 0; list-style: none; }
.single-entry-body ul.kf-article-meta li { margin: 0; padding: 0; font-size: 15px; line-height: 1.5; list-style: none; }
.single-entry-body ul.kf-article-meta li::before { display: none; }
.kf-article-meta i { margin-right: 7px; color: var(--wdtLinkHoverColor); }
.kf-article-meta a { color: var(--wdtLinkHoverColor); text-decoration: none; }
.kf-article-meta a:hover { color: var(--wdtHeadAltColor); }
@media (max-width: 767px) {
	.kf-article-lead { font-size: 20px; }
	.single-entry-body ul.kf-article-meta { flex-direction: column; gap: 6px; }
}

/* Table of contents in the text (tablet and phone): collapsible white box. */
.kf-toc--inline { margin: 0 0 36px; border-radius: 30px; background: #fff; }
.kf-toc--inline summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 26px;
	cursor: pointer;
	list-style: none;
	font-family: var(--wdtFontTypo_Alt);
	font-size: 22px;
	color: var(--wdtHeadAltColor);
}
.kf-toc--inline summary::-webkit-details-marker { display: none; }
.kf-toc--inline summary::after {
	content: "";
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	margin-top: -4px;
	border-right: 2px solid var(--wdtLinkHoverColor);
	border-bottom: 2px solid var(--wdtLinkHoverColor);
	transform: rotate(45deg);
	transition: transform 0.2s;
}
.kf-toc--inline[open] summary::after { margin-top: 4px; transform: rotate(-135deg); }
.single-entry-body .kf-toc--inline ul.kf-toc__list { margin: 0; padding: 0 26px 18px; list-style: none; }
.single-entry-body .kf-toc--inline ul.kf-toc__list li { margin: 0; padding: 9px 0; border-top: 1px solid rgba(var(--wdtBodyTxtColorRgb), 0.1); list-style: none; }
.single-entry-body .kf-toc--inline ul.kf-toc__list li::before { display: none; }
.kf-toc--inline a { text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
	.kf-toc--inline summary::after { transition: none; }
}

/* Article typography. */
.single-post .single-entry-body h2 { margin: 1.5em 0 0.5em; font-size: clamp(26px, 1.4rem + 0.9vw, 34px); line-height: 1.25; }
.single-post .single-entry-body h3 { margin: 1.4em 0 0.5em; font-size: clamp(21px, 1.2rem + 0.4vw, 25px); line-height: 1.3; }
.single-post .single-entry-body h4,
.single-post .single-entry-body h5,
.single-post .single-entry-body h6 { margin: 1.3em 0 0.5em; font-size: 20px; line-height: 1.35; }
.single-post .single-entry-body h2[id], .single-post .single-entry-body h3[id] { scroll-margin-top: 30px; }
.single-post .single-entry-body .kf-article-head + h2,
.single-post .single-entry-body .kf-toc--inline + h2 { margin-top: 0; }
.single-post .single-entry-body p { margin-bottom: 1em; }
.single-post .single-entry-body ul,
.single-post .single-entry-body ol { margin-bottom: 1.2em; }
.single-post .single-entry-body li { margin-bottom: 0.35em; }
.single-post .single-entry-body blockquote {
	margin: 1.4em 0;
	padding: 20px 26px;
	border: 0;
	border-left: 4px solid var(--wdtLinkHoverColor);
	border-radius: 0 20px 20px 0;
	background: #fff;
	font-size: inherit;
	font-style: normal;
	line-height: inherit;
}
.single-post .single-entry-body img { max-width: 100%; height: auto; border-radius: 30px; }
.single-post .single-entry-body p a, .single-post .single-entry-body li a { overflow-wrap: anywhere; }
.single-post .single-entry-body table { width: 100%; margin: 1.4em 0; border-collapse: collapse; border-radius: 20px; overflow: hidden; background: #fff; font-size: 15px; line-height: 1.5; }
.single-post .single-entry-body td, .single-post .single-entry-body th { padding: 12px 14px; border: 0; border-bottom: 1px solid rgba(var(--wdtBodyTxtColorRgb), 0.1); vertical-align: top; text-align: left; }
.single-post .single-entry-body tr:first-child td { font-weight: 700; background: rgba(var(--wdtLinkHoverColorRgb), 0.12); }
@media (max-width: 767px) {
	.single-post .single-entry-body table { display: block; overflow-x: auto; font-size: 14px; }
	.single-post .single-entry-body td { min-width: 140px; }
}

/* Bibliography: separated and smaller. */
.kf-sources {
	margin-top: 48px;
	padding-top: 28px;
	border-top: 1px solid rgba(var(--wdtBodyTxtColorRgb), 0.15);
	font-size: 14px;
	line-height: 1.6;
	color: rgba(var(--wdtBodyTxtColorRgb), 0.85);
}
.single-post .single-entry-body .kf-sources > :is(h2, h3, h4, h5, h6):first-child { margin: 0 0 14px; font-size: 20px; }
.single-post .single-entry-body .kf-sources :is(p, li, h6) { font-size: 14px; }
.single-post .single-entry-body .kf-sources li { margin-bottom: 6px; }
.kf-sources a { overflow-wrap: anywhere; }

/* Booking box before the bibliography. */
.kf-article-cta {
	margin: 48px 0 0;
	padding: 40px 44px;
	border-radius: 30px;
	background: var(--wdtPrimaryColor) url(/wp-content/themes/physeo/assets/images/Home-1-exray-bg.png) center / cover no-repeat;
	color: var(--wdtAccentTxtColor);
}
.single-post .single-entry-body .kf-article-cta p { margin: 0 0 22px; color: rgba(var(--wdtAccentTxtColorRgb), 0.85); }
.single-post .single-entry-body .kf-article-cta .kf-article-cta__title { margin: 0 0 10px; font-family: var(--wdtFontTypo_Alt); font-size: clamp(26px, 1.4rem + 0.6vw, 32px); line-height: 1.25; color: var(--wdtAccentTxtColor); }
.kf-article-cta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.kf-article-cta .wdt-button { text-decoration: none; }
.single-post .single-entry-body a.kf-article-cta__phone { color: var(--wdtAccentTxtColor); font-size: 18px; text-decoration: none; white-space: nowrap; }
.kf-article-cta__phone i { margin-right: 8px; color: var(--wdtLinkHoverColor); }
.single-post .single-entry-body a.kf-article-cta__phone:hover { color: var(--wdtLinkHoverColor); }
@media (max-width: 767px) {
	.kf-article-cta { padding: 30px 24px; }
}

/* "Inne artykuły": the theme centres a small title. */
.single-post .blog-single-entry .related-post-title { display: block; margin: 70px 0 18px; text-align: left; font-size: clamp(26px, 1.4rem + 0.9vw, 34px); }
/* The single post template adds "margin: 20px auto 0" to every entry-* box in the article, cards included. */
.single-post .blog-single-entry .wdt-related-posts .blog-entry div[class*="entry-"] { margin: 0; }
.single-post .blog-single-entry .wdt-related-posts .blog-entry .entry-content-group > div:not(:last-child) { margin-bottom: 12px; }
.single-post .blog-single-entry .wdt-related-posts .blog-entry div.entry-meta-group { margin: -4px -8px 12px; }
.single-post .blog-single-entry .wdt-related-posts .blog-entry { margin-bottom: 0; }
.single-post .wdt-related-posts .kf-card-reading { bottom: 34px; }
/* Touch screens wider than 1024 px (tablets in landscape) scroll natively: the add-on skips the smooth
   scroller there but its CSS still transforms the page wrappers, so the theme's pinned sidebar (fixed
   position) slid off screen. Without the transform the pin stays in view. */
@media (min-width: 1025px) and (any-pointer: coarse) {
	.single-post #smooth-wrapper,
	.single-post #smooth-content { transform: none; will-change: auto; }
}
