/*
Theme Name: Portali Child
Template: Newspaper
Version: 1.0.0
Description: Child theme for Portali, built on Newspaper.
Text Domain: portali-child
*/

/* ---------------------------------------------------------------
   Header: centre the main menu between the logo and the search
   (desktop header row = logo | menu | search).
   --------------------------------------------------------------- */
.wpb_wrapper:has(> .tdb_header_menu) > .tdb_header_logo,
.wpb_wrapper:has(> .tdb_header_menu) > .tdb_header_search {
	flex: 1 1 0;
	min-width: 0;
}
.wpb_wrapper:has(> .tdb_header_menu) > .tdb_header_menu {
	flex: 0 0 auto;
	margin-left: 0 !important;
	margin-right: 0 !important;
}
.wpb_wrapper:has(> .tdb_header_menu) > .tdb_header_search {
	display: flex;
	justify-content: flex-end;
}

/* ---------------------------------------------------------------
   Language switcher (GTranslate, SQ / EN / DE / FR)
   Top bar: right-aligned on the same line as the date.
   --------------------------------------------------------------- */
.wpb_text_column:has(.gtranslate_wrapper) {
	margin-bottom: 0 !important;
}
.wpb_wrapper:has(> .wpb_text_column .gtranslate_wrapper) {
	justify-content: flex-end;
	align-items: center;
}
.gtranslate_wrapper a {
	color: inherit;
	font-size: 11px;
	letter-spacing: .04em;
	margin-left: 12px;
	text-decoration: none;
	white-space: nowrap;
}
.gtranslate_wrapper a:first-child {
	margin-left: 0;
}
.gtranslate_wrapper a.gt-current-lang {
	font-weight: 700;
}
.vc_row:has(.tdb_header_date) .gtranslate_wrapper a {
	color: #fff;
}
.vc_row:has(.tdb_header_date) .gtranslate_wrapper a:hover {
	opacity: .8;
}

/* ---------------------------------------------------------------
   Article page: published / updated line (functions.php)
   --------------------------------------------------------------- */
.portali-dates {
	font-size: 13px;
	color: #666;
	margin: 0 0 18px;
}
.portali-dates time {
	font-weight: 600;
	color: #333;
}
.portali-dates-sep {
	margin: 0 6px;
}

/* Article author line: show only the author name (no "By"/"Nga" label). */
html body .tdb_single_author.td_block_wrap .tdb-author-by {
	display: none !important;
}

/* ---------------------------------------------------------------
   Stage 5: ad slots ("Reklamë")
   --------------------------------------------------------------- */
.pp-ad {
	display: none;
	max-width: 728px;
	margin: 24px auto;
	text-align: center;
	clear: both;
}
.pp-ad.pp-ad-on {
	display: block;
}
.pp-ad-label {
	font-size: 11px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #888;
	margin-bottom: 6px;
	line-height: 1.2;
}
.pp-ad-inner {
	min-height: 90px;
	overflow: hidden;
}
.pp-ad-inner img {
	max-width: 100%;
	height: auto;
}
.pp-ad-placeholder {
	background: #f2f2f2;
	border: 1px dashed #ccc;
	height: 90px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #aaa;
	font-size: 12px;
}
.tdb_single_content .pp-ad .pp-ad-placeholder {
	height: 250px;
	max-width: 336px;
	margin: 0 auto;
}

/* Sponsored article badge */
.pp-sponsored-badge {
	display: inline-block;
	background: #f5b400;
	color: #111;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 3px;
	margin: 0 0 12px;
}

/* ---------------------------------------------------------------
   Stage 5: cookie consent banner
   --------------------------------------------------------------- */
.pp-consent[hidden] {
	display: none !important;
}
.pp-consent {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100000;
	padding: 12px;
	pointer-events: none;
}
.pp-consent-box {
	pointer-events: auto;
	max-width: 760px;
	margin: 0 auto;
	background: #fff;
	color: #222;
	border-radius: 8px;
	box-shadow: 0 6px 30px rgba(0, 0, 0, .25);
	padding: 18px 20px;
	font-size: 14px;
	line-height: 1.5;
}
.pp-consent-title {
	font-weight: 700;
	font-size: 16px;
	margin: 0 0 6px;
}
.pp-consent-text {
	margin: 0 0 12px;
}
.pp-consent-text a {
	text-decoration: underline;
}
.pp-consent-prefs[hidden] {
	display: none;
}
.pp-consent-row {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 0 0 8px;
	font-weight: 400;
}
.pp-consent-row input {
	margin-top: 4px;
}
.pp-consent-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}
.pp-btn {
	font: inherit;
	cursor: pointer;
	border-radius: 4px;
	padding: 9px 16px;
	border: 1px solid #111;
}
.pp-btn[hidden] {
	display: none;
}
.pp-btn-primary {
	background: #111;
	color: #fff;
	font-weight: 600;
	min-width: 140px;
}
.pp-btn-link {
	background: transparent;
	color: #111;
	border-color: transparent;
	text-decoration: underline;
}
@media (max-width: 600px) {
	.pp-consent-box {
		padding: 14px;
		font-size: 13px;
	}
	.pp-btn-primary {
		flex: 1 1 40%;
		min-width: 0;
	}
}

/* Homepage section headers (Lajme, Bota, Tech/Auto, Shëndetësi, Showbiz,
   Sociale): solid black line under the title row. */
.home .vc_row_inner:has(.tdm_block_button a[href*="/category/"]) {
	border-bottom: 2px solid #000 !important;
}

/* Homepage top banner (slot home-top): up to 970 px wide, tight spacing. */
.pp-ad[data-slot="home-top"] {
	max-width: 970px;
	margin: 0 auto;
}
.vc_row:has(.pp-ad[data-slot="home-top"]) {
	padding-top: 20px !important;
	padding-bottom: 0 !important;
}
.vc_raw_html:has(.pp-ad[data-slot="home-top"]) {
	margin-bottom: 0 !important;
}
.tdc-row:has(.pp-ad[data-slot="home-top"]) + .tdc-row > .vc_row {
	padding-top: 24px !important;
}

/* Direct banners (image + link) and the extra AdSense places. */
.pp-ad-inner a {
	display: block;
}
.pp-ad-inner img {
	display: block;
	margin: 0 auto;
}
.pp-ad[data-slot="sidebar"] {
	max-width: 300px;
	margin: 24px auto;
}
.pp-ad[data-slot="sidebar"] .pp-ad-placeholder {
	height: 250px;
}
.pp-ad[data-slot="category"] {
	margin: 8px auto 32px;
}

/* ---------------------------------------------------------------
   Stage 8: phone fixes (screens up to 767 px wide)
   --------------------------------------------------------------- */
@media (max-width: 767px) {
	/* Article title: smaller on phones (was 36 px). */
	.single-post .tdb_title .tdb-title-text,
	.single-post .tdb_title h1 {
		font-size: 28px !important;
		line-height: 1.2 !important;
	}
	/* Footer and mobile-menu links: bigger tap areas. */
	.td_block_list_menu li a {
		display: inline-block;
		padding-top: 10px !important;
		padding-bottom: 10px !important;
	}
}
/* Category pages: previous / next buttons big enough to tap. */
html body .td-next-prev-wrap a.td-ajax-prev-page,
html body .td-next-prev-wrap a.td-ajax-next-page {
	min-width: 44px !important;
	min-height: 44px !important;
	align-items: center;
	justify-content: center;
}

/* ---------------------------------------------------------------
   Stage 9: accessibility – tap targets on phones (at least 32 px)
   --------------------------------------------------------------- */
@media (max-width: 767px) {
	.portali-lang-mobile a,
	.gtranslate_wrapper a.glink {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		min-width: 32px;
		min-height: 32px;
	}
	#td-mobile-nav .menu-item > a,
	.td-mobile-content .menu-item > a {
		min-height: 44px;
		display: flex !important;
		align-items: center;
	}
}

@media (max-width: 767px) {
	/* Category labels in article lists: taller tap area and space above the title. */
	.td_module_flex .td-module-meta-info .td-post-category {
		display: inline-block;
		padding-top: 6px !important;
		padding-bottom: 6px !important;
		margin-bottom: 4px;
	}
}
