/*
 * Shared article / content page layout (hírek + képzések).
 * Title: Source Sans 3; body: site Helvetica stack.
 */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@600;700&display=swap');

/*
 * Scroll trap fix (mobile):
 * Site uses html/body { height:100% } and .page-container { overflow-x:hidden }
 * which computes to overflow-y:auto — a nested scrollport beside the document.
 * After scrolling (esp. near wide tables) the inner/outer scrollports desync:
 * menu scrolls away and you cannot fully reach the top again.
 * Article pages scroll ONLY on the document.
 */
html:has(body.single-articles),
html:has(body.macske-article-page) {
	height: auto;
	min-height: 100%;
	overflow-x: visible;
	overflow-y: visible;
}

body.single-articles,
body.page-template-default.macske-article-page,
body.page.macske-article-page {
	height: auto !important;
	min-height: 100%;
	align-content: flex-start;
	/* flex + nested overflow is a common iOS scroll desync source */
	display: block;
	overflow: visible !important;
}

body.single-articles .page-container,
body.macske-article-page .page-container {
	/* Critical: do not become a second vertical scrollport */
	overflow: visible !important;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

body.single-articles footer,
body.macske-article-page footer {
	margin-top: 0;
}

/*
 * iPhone Chrome / iOS WebKit:
 * The closed mobile drawer stays position:fixed; height:100%; overflow:auto
 * (translated off-screen). That nested scrollport steals vertical pans so the
 * document cannot fully scroll back to the header. Disable it while closed.
 * (No sticky header — it covered the article content.)
 */
@media (max-width: 1034px) {
	body.single-articles:not(.smenu) .navbar .navbar-collapse,
	body.macske-article-page:not(.smenu) .navbar .navbar-collapse {
		pointer-events: none !important;
		overflow: hidden !important;
		-webkit-overflow-scrolling: auto;
		touch-action: none;
	}

	body.single-articles.smenu .navbar .navbar-collapse,
	body.macske-article-page.smenu .navbar .navbar-collapse {
		pointer-events: auto !important;
		overflow-y: auto !important;
		touch-action: pan-y;
	}
}

.main-article {
	padding-bottom: 45px;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	/* Do NOT set overflow-x here — it forces overflow-y:auto and traps scroll */
}

@media (max-width: 767px) {
	.main-article {
		padding-bottom: 30px;
	}
}

.main-article .news.article-layout {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	border-radius: 8px;
	box-sizing: border-box;
	min-width: 0;
}

.main-article .news.article-layout > * {
	min-width: 0;
	max-width: 100%;
}

.main-article .article-layout__title {
	position: relative;
	margin: 0 0 1.35rem;
	padding: 0 0 0.85rem;
	font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-size: clamp(24px, 2.8vw, 34px);
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.28;
	text-align: left;
	text-transform: none;
	color: #9e2060;
}

.main-article .article-layout__title::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 48px;
	height: 4px;
	border-radius: 3px;
	background: #9e2060;
}

/* Hide legacy centered .ptitle underlines when title is article-layout */
.main-article .article-layout__title.ptitle::after {
	left: 0;
	right: auto;
	margin: 0;
	transform: none;
}

.main-article .article-layout__main {
	flex: 1 1 auto;
	min-width: 0;
}

.main-article .article-layout__main::after {
	content: '';
	display: table;
	clear: both;
}

.main-article .article-layout__date {
	margin: 1.25rem 0 0;
	padding: 0;
	align-self: flex-end;
	text-align: right;
	color: #888;
	font-size: 13px;
	line-height: 1.4;
}

.main-article .article-layout__media {
	display: block;
	margin: 0 0 1.15rem;
	overflow: hidden;
	background: #f3ecef;
	border-radius: 8px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.main-article .article-layout__media a {
	display: block;
	position: relative;
	cursor: zoom-in;
	border-radius: 8px;
	overflow: hidden;
}

.main-article .article-layout__media img {
	display: block;
	width: 100%;
	height: 200px;
	object-fit: cover;
	object-position: center;
	border: 0 !important;
	border-radius: 8px;
	transition: transform 0.35s ease, filter 0.35s ease;
}

.main-article .article-layout__body {
	min-width: 0;
	text-align: justify;
	hyphens: auto;
	-webkit-hyphens: auto;
}

.main-article .article-layout__body > *:first-child {
	margin-top: 0;
}

/*
 * Képzés / továbbképzés body — egységes tipográfia.
 * A régi .kepzes-container keretek és inline style-ok helyett.
 */
.main-article .article-layout__body {
	font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	color: #333;
	text-align: left;
}

/* Legacy wrapper: soha ne legyen külön keret / óriás padding */
.main-article .article-layout__body .kepzes-container,
.article-layout__body .kepzes-container {
	background: transparent !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
	color: inherit;
	text-align: left !important;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.main-article .article-layout__body .kepzes-container h2.ptitle {
	display: none;
}

.main-article .article-layout__body .kepzes-eyebrow {
	margin: 0 0 1rem;
	font-weight: 700;
	font-size: 1.05em;
	letter-spacing: 0.02em;
	color: #9e2060;
	text-align: left;
}

.main-article .article-layout__body .kepzes-legal {
	margin: 0 0 1.25rem;
	padding: 0.75rem 0.95rem;
	background: #f7f0f3;
	border-left: 3px solid #9e2060;
	border-radius: 0 6px 6px 0;
	font-size: 0.92em;
	line-height: 1.45;
	color: #444;
	text-align: left;
}

.main-article .article-layout__body .kepzes-section {
	margin: 1.75rem 0 0.85rem;
	font-weight: 700;
	font-size: 1.1em;
	color: #9e2060;
	text-align: left;
	text-transform: none;
}

.main-article .article-layout__body .kepzes-cta {
	margin: 1.75rem 0 0.75rem;
	text-align: center;
}

/* Gomb: Online jelentkezés — egységes minden képzés-aloldalon */
.main-article .article-layout__body .kepzes-cta a,
.main-article .article-layout__body p > a[href*="jelentkezesi-lap"]:only-child,
.main-article .article-layout__body p > b > a[href*="jelentkezesi-lap"]:only-child,
.main-article .article-layout__body p > strong > a[href*="jelentkezesi-lap"]:only-child {
	display: inline-block;
	padding: 0.65rem 1.5rem;
	border-radius: 6px;
	background: #9e2060;
	color: #fff !important;
	font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none !important;
	text-align: center;
	border: 0;
	box-shadow: none;
	transition: background 0.2s ease;
}

.main-article .article-layout__body .kepzes-cta a:hover,
.main-article .article-layout__body .kepzes-cta a:focus,
.main-article .article-layout__body p > a[href*="jelentkezesi-lap"]:only-child:hover,
.main-article .article-layout__body p > a[href*="jelentkezesi-lap"]:only-child:focus,
.main-article .article-layout__body p > b > a[href*="jelentkezesi-lap"]:only-child:hover,
.main-article .article-layout__body p > strong > a[href*="jelentkezesi-lap"]:only-child:hover {
	background: #771442;
	color: #fff !important;
}

.main-article .article-layout__body p:has(> a[href*="jelentkezesi-lap"]:only-child),
.main-article .article-layout__body p:has(> b > a[href*="jelentkezesi-lap"]),
.main-article .article-layout__body p:has(> strong > a[href*="jelentkezesi-lap"]) {
	text-align: center;
	margin: 1.75rem 0 0.75rem;
}

.main-article .article-layout__body .kepzes-alert {
	color: #c62828;
	font-weight: 600;
}

.main-article .article-layout__body ul {
	list-style-type: disc;
	margin: 0.75rem 0 1rem;
	padding-left: 1.35rem;
}

.main-article .article-layout__body ol {
	margin: 0.75rem 0 1rem;
	padding-left: 1.35rem;
}

.main-article .article-layout__body li {
	margin: 0.25rem 0;
	padding-left: 0;
}

/*
 * Tables:
 * - Desktop/tablet: natural width + horizontal scroll in the white band.
 * - Phone: keep real table grid, but compress into the band (no nested
 *   overflow scroller — that trapped iPhone Chrome vertical scroll).
 */
.main-article .article-layout__table-scroll {
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 1rem 0;
}

.main-article .article-layout__body table {
	height: auto !important;
	margin: 1rem 0;
	border-collapse: collapse;
}

.main-article .article-layout__table-scroll > table {
	margin: 0;
}

.main-article .article-layout__body table td,
.main-article .article-layout__body table th {
	padding: 0.5rem 0.65rem;
	border: 1px solid #ddd;
	vertical-align: top;
	height: auto !important;
	white-space: normal;
	word-break: normal;
}

@media (min-width: 768px) {
	.main-article .article-layout__table-scroll {
		overflow-x: auto;
		overflow-y: hidden;
		overscroll-behavior-x: contain;
	}

	.main-article .article-layout__body table {
		width: max-content !important;
		min-width: 100%;
		max-width: none !important;
	}
}

@media (max-width: 767px) {
	.main-article .article-layout__table-scroll {
		overflow: visible;
	}

	.main-article .article-layout__body table {
		display: table;
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
		table-layout: fixed;
	}

	.main-article .article-layout__body table td,
	.main-article .article-layout__body table th {
		padding: 0.3rem 0.25rem;
		font-size: 11px;
		line-height: 1.3;
		word-break: break-word;
		overflow-wrap: anywhere;
		hyphens: auto;
		-webkit-hyphens: auto;
	}
}

.main-article .article-layout__body img {
	max-width: 100%;
	height: auto;
}

@media (min-width: 768px) {
	.main-article .news.article-layout--has-media .article-layout__media {
		float: left;
		width: 38%;
		max-width: 420px;
		margin: 0 1.5rem 1rem 0;
	}

	.main-article .news.article-layout--has-media .article-layout__media img {
		height: 260px;
	}
}

@media (min-width: 1200px) {
	.main-article .news.article-layout--has-media .article-layout__media {
		width: 34%;
		max-width: 400px;
		margin: 0 1.75rem 1.15rem 0;
	}

	.main-article .news.article-layout--has-media .article-layout__media img {
		height: 280px;
	}
}

@media (max-width: 767px) {
	.main-article .article-layout__media img {
		height: 180px;
	}
}
