/**
 * Global styles for Anamedical Gutenberg pages.
 */

:root {
	--anm-font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
	--anm-font-sans: "IBM Plex Sans", sans-serif;
	--anm-color-black: #000000;
	--anm-color-white: #ffffff;
	--anm-content-width: 1664px;
	--anm-page-line-color: #ffffff1c;
	--anm-page-line-offset: max(0px, calc((100vw - var(--anm-content-width)) / 2));
	--anm-page-lines-top: 0px;
	--anm-section-gutter: clamp(1.25rem, 4vw, 2rem); /* ~20px mobile, max 32px */
}

/* --- Tło strony — tylko gdy ustawione per strona (klasa .anm-page-custom-bg) --- */
body.anm-page-custom-bg,
body.anm-page-custom-bg #page,
body.anm-page-custom-bg .site {
	background-color: var(--anm-page-bg) !important;
}

body.anm-gutenberg-page.ast-separate-container #primary,
body.anm-gutenberg-page.ast-separate-container #primary .site-main,
body.anm-gutenberg-page.ast-separate-container .ast-article-single,
body.anm-gutenberg-page .site-content,
body.anm-gutenberg-page .site-content > .ast-container,
body.anm-gutenberg-page .entry-content {
	background: transparent !important;
}

body.anm-gutenberg-page .site-content > .ast-container {
	max-width: none;
	width: 100%;
	padding-left: 0;
	padding-right: 0;
}

body.anm-gutenberg-page.ast-separate-container #primary {
	margin: 0;
	padding: 0;
}

/*
 * Główny kontener treści Gutenberg — 1664px wyśrodkowany (jak w Figmie).
 * Na szerszych ekranach widać kolor tła strony po bokach.
 */
body.anm-gutenberg-page .entry-content {
	position: relative;
	margin: 0 auto;
	padding: 0;
	max-width: var(--anm-content-width);
	width: 100%;
	box-sizing: border-box;
}

body.anm-gutenberg-page .entry-content > *:first-child {
	margin-top: 0;
}

/*
 * Pionowe linie ramki strony — Figma Line 257/258 @ 1920 (x: 127 / 1792).
 * Start od pierwszego .anm-media-text.is-image-left (--anm-page-lines-top z JS).
 * Mobile (≤767px): ukryte.
 */
@media (max-width: 767px) {
	body.anm-gutenberg-page::before,
	body.anm-gutenberg-page::after,
	body.anm-gutenberg-page .anm-page-lines-fx {
		display: none !important;
		content: none;
	}
}

@media (min-width: 1665px) {
	body.anm-gutenberg-page::before,
	body.anm-gutenberg-page::after {
		content: "";
		position: fixed;
		top: var(--anm-page-lines-top);
		bottom: 0;
		width: 1px;
		background-color: var(--anm-page-line-color);
		pointer-events: none;
		z-index: 40;
	}

	body.anm-gutenberg-page::before {
		left: var(--anm-page-line-offset);
	}

	body.anm-gutenberg-page::after {
		right: var(--anm-page-line-offset);
	}

	/* Sekcje full-bleed nad liniami (Figma: treatment-how, patient-results, reviews cards) */
	body.anm-gutenberg-page .anm-treatment-how,
	body.anm-gutenberg-page .anm-patient-results,
	body.anm-gutenberg-page .anm-patient-reviews__cards {
		position: relative;
		z-index: 50;
	}

	/*
	 * Spadające smugi na liniach — Figma Rectangle 558–563 (1×40–75px).
	 * Gradient #1a1a1a → #8fd9fb, animacja w page-lines.js + CSS poniżej.
	 */
	body.anm-gutenberg-page .anm-page-lines-fx {
		position: fixed;
		inset: 0;
		pointer-events: none;
		z-index: 41;
		overflow: hidden;
	}

	body.anm-gutenberg-page .anm-page-lines-fx__rail {
		position: absolute;
		top: var(--anm-page-lines-top);
		bottom: 0;
		width: 1px;
		overflow: hidden;
	}

	body.anm-gutenberg-page .anm-page-lines-fx__rail--left {
		left: var(--anm-page-line-offset);
	}

	body.anm-gutenberg-page .anm-page-lines-fx__rail--right {
		right: var(--anm-page-line-offset);
	}

	body.anm-gutenberg-page .anm-page-lines-fx__drop {
		position: absolute;
		left: 0;
		width: 1px;
		height: var(--anm-drop-h, 50px);
		background: linear-gradient(180deg, #1a1a1a 0%, #8fd9fb 100%);
		will-change: top;
		animation: anm-page-line-fall var(--anm-drop-dur, 14s) linear var(--anm-drop-delay, 0s) infinite;
		animation-fill-mode: backwards;
	}

	@keyframes anm-page-line-fall {
		from {
			top: calc(-1 * var(--anm-drop-h, 50px));
		}

		to {
			top: 100%;
		}
	}

	@media (prefers-reduced-motion: reduce) {
		body.anm-gutenberg-page .anm-page-lines-fx__drop {
			animation: none;
			opacity: 0;
		}
	}
}

body.anm-hide-page-title .entry-header,
body.anm-hide-page-title .ast-single-entry-banner {
	display: none !important;
}

/* Bloki wewnątrz kontenera 1664px — bez wychodzenia na 100vw */
body.anm-gutenberg-page .entry-content .alignfull,
body.anm-gutenberg-page .entry-content .alignwide {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* Przyciski we wszystkich blokach Anamedical */
.anm-hero-consultation__btn,
.anm-faq-accordion__btn-phone,
.anm-pricing-packages__btn,
[class*="anm-"] a[class*="__btn"],
[class*="anm-"] button[class*="__btn"] {
	font-family: "IBM Plex Sans", sans-serif !important;
}

.anm-hero-consultation__btn span,
.anm-faq-accordion__btn-phone span,
.anm-pricing-packages__btn span {
	font-family: inherit !important;
}

/* --- WYSIWYG / rich text we wszystkich blokach --- */
[class*="anm-"] .anm-rich-text > :first-child {
	margin-top: 0;
}

[class*="anm-"] .anm-rich-text > :last-child {
	margin-bottom: 0;
}

[class*="anm-"] .anm-rich-text p {
	margin: 0 0 1em;
}

[class*="anm-"] .anm-rich-text p:last-child {
	margin-bottom: 0;
}

[class*="anm-"] .anm-rich-text strong,
[class*="anm-"] .anm-rich-text b {
	font-weight: 600;
}

/* Nagłówki z edytora — dziedziczą styl rodzica */
[class*="anm-"][class*="__heading"].anm-rich-text p,
[class*="anm-"][class*="__headline"].anm-rich-text p {
	margin: 0;
	font: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	color: inherit;
	background: inherit;
	-webkit-background-clip: inherit;
	background-clip: inherit;
	-webkit-text-fill-color: inherit;
}
