/**
 * Site layout (all pages): logo bar header, 3-column / 2-column grids,
 * left menu, right column (ads, Most Read, Top News).
 *
 * ≥1024px : logo bar + 3 links; home/category/404 = menu · content · right column;
 *           single = content · right column.
 * <1024px : compact bar (☰ · logo · language) + ticker, columns stack,
 *           left menu hidden (hamburger covers it).
 *
 * Colors from the enewsTime logo. Brand (maroon) itself comes from
 * Provibe News → Branding so it stays editable.
 */

:root {
	--pv-logo-blue: #006fab;
	--pv-logo-ink: #111111;
	--pv-bar-h: 78px;
	--pv-col-gap: var(--wp--preset--spacing--50);
	--pv-sticky-top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--pv-bar-h) + var(--wp--preset--spacing--40));
}

html[data-theme="dark"] {
	--pv-logo-blue: #4fb0e6;
	--pv-logo-ink: var(--wp--preset--color--ink);
}

/* ---------- Header switch: desktop bar vs regular header ---------- */
.pv-only-desktop {
	display: none !important;
}

@media (min-width: 1024px) {
	.pv-only-desktop {
		display: block !important;
	}

	.pv-only-compact {
		display: none !important;
	}
}

/* ---------- Desktop logo bar ---------- */
.pv-bar {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
	background: var(--wp--preset--color--base);
	border-bottom: 3px solid var(--wp--preset--color--brand);
	box-shadow: 0 2px 10px rgb(0 0 0 / 0.06);
}

.pv-bar__inner {
	min-height: var(--pv-bar-h);
	gap: var(--wp--preset--spacing--50);
}

.pv-bar__logo {
	flex: 0 0 auto;
	margin: 0 !important;
}

.pv-bar__logo img {
	display: block;
	width: 220px;
	height: auto;
}

/* Dark mode: logo is black text on transparent, give it a light plate. */
html[data-theme="dark"] .pv-bar__logo img {
	padding: 4px 8px;
	background: #fff;
	border-radius: 2px;
}

.pv-bar__menu .pv-menu {
	display: flex;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pv-bar__menu .pv-menu a {
	display: block;
	padding: 0.55rem 1rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	color: var(--pv-logo-ink);
	border-bottom: 3px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.pv-bar__menu .pv-menu a:hover,
.pv-bar__menu .pv-menu a:focus-visible,
.pv-bar__menu .current-menu-item > a {
	color: var(--wp--preset--color--brand);
	border-bottom-color: var(--pv-logo-blue);
}

/* ---------- Menu icon + slide-out drawer ---------- */
.pv-bar__brand {
	gap: 0.75rem;
}

.pv-drawer__open,
.pv-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	color: var(--pv-logo-ink);
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.pv-drawer__open:hover,
.pv-drawer__open:focus-visible,
.pv-drawer__close:hover,
.pv-drawer__close:focus-visible {
	color: var(--wp--preset--color--brand);
	background: var(--wp--preset--color--surface);
}

.pv-drawer {
	position: fixed;
	inset: 0 auto 0 0;
	width: min(320px, 85vw);
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0 var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	overflow-y: auto;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--base);
	border: 0;
	border-right: 3px solid var(--wp--preset--color--brand);
	box-shadow: 8px 0 30px rgb(0 0 0 / 0.18);
}

.pv-drawer[open] {
	animation: pv-drawer-in 0.22s ease-out;
}

.pv-drawer::backdrop {
	background: rgb(0 0 0 / 0.45);
}

@keyframes pv-drawer-in {
	from {
		transform: translateX(-100%);
	}
}

.pv-drawer__head {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 0;
	background: var(--wp--preset--color--base);
}

.pv-drawer__title {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--pv-logo-blue);
}

.pv-drawer__search {
	display: flex;
	margin-bottom: var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
}

.pv-drawer__search:focus-within {
	border-color: var(--wp--preset--color--brand);
}

.pv-drawer__search input {
	flex: 1;
	min-width: 0;
	padding: 0.6rem 0 0.6rem 1rem;
	font: inherit;
	font-size: 1rem; /* Under 16px iPhones zoom in on focus. */
	color: inherit;
	background: transparent;
	border: 0;
}

.pv-drawer__search input:focus {
	outline: 0;
}

.pv-drawer__search button {
	display: grid;
	place-items: center;
	width: 44px;
	padding: 0;
	color: var(--wp--preset--color--brand);
	background: transparent;
	border: 0;
	cursor: pointer;
}

.pv-drawer .pv-theme-toggle {
	margin-top: var(--wp--preset--spacing--40);
}

/* ---------- Phone / tablet bar: ☰ · logo · language ---------- */
/* Header box removed so the bars stick relative to the whole page. */
.wp-site-blocks > header.wp-block-template-part {
	display: contents;
}

.pv-mbar {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
	background: var(--wp--preset--color--base);
	border-bottom: 3px solid var(--wp--preset--color--brand);
}

/* WordPress admin bar is not fixed on small screens. */
@media (max-width: 600px) {
	.pv-mbar {
		top: 0;
	}
}

.pv-mbar__inner {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.5rem;
	min-height: 64px;
}

.pv-mbar__inner > * {
	margin: 0 !important;
}

.pv-mbar .pv-drawer__open {
	width: 44px;
	height: 44px;
	margin-left: -10px;
}

.pv-mbar__brand {
	justify-self: center;
	max-width: 100%;
	text-align: center;
}

.pv-mbar__brand > * {
	margin: 0 !important;
}

.pv-mbar__brand .wp-block-site-logo ~ .wp-block-site-title {
	display: none; /* Logo alt text carries the name. */
}

.pv-mbar__brand img {
	display: block;
	width: auto;
	max-width: min(180px, 100%);
	max-height: 52px;
	height: auto;
}

html[data-theme="dark"] .pv-mbar__brand img {
	padding: 3px 6px;
	background: #fff;
	border-radius: 2px;
}

.pv-mbar__lang {
	grid-column: 3;
}

@media (max-width: 400px) {
	.pv-mbar__lang .pv-lang__link {
		padding-inline: 0.5rem;
	}
}

/* ---------- Grid ---------- */
.pv-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--pv-col-gap);
	margin-top: var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--70);
}

.pv-layout > * {
	margin: 0 !important;
	min-width: 0;
}

.pv-layout__nav {
	display: none;
}

@media (min-width: 1024px) {
	.pv-layout {
		grid-template-columns: 180px minmax(0, 1fr) 300px;
		align-items: start;
	}

	.pv-layout--2col {
		grid-template-columns: minmax(0, 1fr) 300px;
	}

	.pv-layout__nav {
		display: block;
		position: sticky;
		top: var(--pv-sticky-top);
		max-height: calc(100vh - var(--pv-sticky-top) - 1rem);
		overflow-y: auto;
		scrollbar-width: thin;
	}

	.pv-layout__main {
		padding: 0 var(--pv-col-gap);
		border-left: 1px solid var(--wp--preset--color--line);
		border-right: 1px solid var(--wp--preset--color--line);
	}

	.pv-layout--2col .pv-layout__main {
		padding-left: 0;
		border-left: 0;
	}

	/* Stretch so the sticky Top News has room to travel. */
	.pv-layout__side {
		align-self: stretch;
	}

	.pv-layout__side > .wp-block-template-part,
	.pv-layout__side .pv-sidebar,
	.pv-home-side {
		height: 100%;
	}
}

/* ---------- Left column menu ---------- */
.pv-side-nav .pv-menu {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 3px solid var(--pv-logo-ink);
}

.pv-side-nav .pv-menu li {
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.pv-side-nav .pv-menu a {
	position: relative;
	display: block;
	padding: 0.7rem 0.5rem 0.7rem 0.85rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	transition: color 0.15s ease, background-color 0.15s ease;
}

.pv-side-nav .pv-menu a::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 3px;
	background: var(--wp--preset--color--brand);
	transform: scaleY(0);
	transition: transform 0.15s ease;
}

.pv-side-nav .pv-menu a:hover,
.pv-side-nav .pv-menu a:focus-visible {
	color: var(--wp--preset--color--brand);
	background: var(--wp--preset--color--surface);
}

.pv-side-nav .pv-menu a:hover::before,
.pv-side-nav .pv-menu a:focus-visible::before,
.pv-side-nav .current-menu-item > a::before {
	transform: scaleY(1);
}

.pv-side-nav .current-menu-item > a {
	color: var(--pv-logo-blue);
}

/* Menu item icons (picked in Appearance → Menus). */
.pv-menu a:has(> .pv-menu-icon) {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.pv-menu-icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	color: var(--wp--preset--color--muted);
	transition: color 0.15s ease;
}

.pv-menu a:hover > .pv-menu-icon,
.pv-menu a:focus-visible > .pv-menu-icon,
.pv-menu .current-menu-item > a > .pv-menu-icon {
	color: currentColor;
}

.pv-side-nav .sub-menu .pv-menu-icon {
	width: 15px;
	height: 15px;
}

.pv-bar__menu .pv-menu a:has(> .pv-menu-icon) {
	gap: 0.4rem;
}

.pv-bar__menu .pv-menu-icon {
	color: var(--wp--preset--color--brand);
}

/* Sub-items (depth 2): indented, lighter. */
.pv-side-nav .sub-menu {
	margin: 0;
	padding: 0 0 0.35rem;
	list-style: none;
}

.pv-side-nav .sub-menu li {
	border-bottom: 0;
}

.pv-side-nav .sub-menu a {
	padding: 0.4rem 0.5rem 0.4rem 1.6rem;
	font-weight: 500;
	color: var(--wp--preset--color--ink-soft);
}

.pv-menu-hint {
	padding: 0.75rem;
	font-size: var(--wp--preset--font-size--x-small);
	border: 1px dashed var(--wp--preset--color--muted);
}

/* ---------- Middle column: homepage category sections ---------- */
.pv-layout__main .pv-catsecs > .pv-catsec:first-child {
	margin-top: 0;
}

.pv-layout__main .pv-catsec,
.pv-layout__main .pv-opinion {
	margin-top: var(--wp--preset--spacing--60);
}

@media (min-width: 1024px) {
	/* Lead | two image stories, headlines in two columns underneath. */
	.pv-layout__main .pv-catsec__grid {
		grid-template-columns: 1.45fr 1fr;
	}

	.pv-layout__main .pv-catsec__list {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: 1fr 1fr;
		column-gap: var(--pv-col-gap);
		padding: 0.85rem 0 0;
		border-left: 0;
		border-top: 1px solid var(--wp--preset--color--line);
	}

	.pv-layout__main .pv-catsec__list > li,
	.pv-layout__main .pv-catsec__list > li + li {
		padding: 0 0 0.85rem;
		border-top: 0;
	}

	.pv-layout__main .pv-catsec__title {
		font-size: var(--wp--preset--font-size--large);
	}

	.pv-layout__main .pv-opinion {
		padding: var(--wp--preset--spacing--50);
	}
}

/* Opinion in the middle column: one per row, avatar left, upright headline. */
.pv-layout__main .pv-opinion__grid {
	grid-template-columns: minmax(0, 1fr);
}

.pv-layout__main .pv-opinion__card,
.pv-layout__main .pv-opinion__card:nth-last-child(-n + 3) {
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.pv-layout__main .pv-opinion__card:last-child {
	border-bottom: 0;
}

.pv-layout__main .pv-opinion__title {
	font-style: normal;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.35;
}

/* ---------- 404 ---------- */
.pv-404__title {
	margin-top: 0 !important;
	font-size: var(--wp--preset--font-size--xx-large) !important;
}

.pv-404__search {
	margin-bottom: var(--wp--preset--spacing--60) !important;
}

/* ---------- Right column: ads, Most Read, Top News ---------- */
.pv-home-side__ads {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	margin-bottom: var(--wp--preset--spacing--50);
}

.pv-home-side__ads .pv-ad {
	margin: 0;
}

.pv-top-news {
	border-top: 3px solid var(--pv-logo-blue);
	background: var(--wp--preset--color--base);
}

@media (min-width: 1024px) {
	/* Follows the reader down the page; never taller than the screen. */
	.pv-top-news {
		position: sticky;
		top: var(--pv-sticky-top);
		max-height: calc(100vh - var(--pv-sticky-top) - 1rem);
		overflow-y: auto;
		scrollbar-width: thin;
	}

	.pv-home-side .pv-most-read {
		margin-bottom: var(--wp--preset--spacing--50) !important;
	}
}

.pv-top-news__title {
	margin: 0 !important;
	padding: 0.6rem 0;
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 800 !important;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--pv-logo-blue);
}

.pv-top-news__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pv-top-news__item {
	padding: 0.7rem 0;
	border-top: 1px solid var(--wp--preset--color--line);
}

.pv-top-news__item--lead {
	padding-top: 0;
	border-top: 0;
}

.pv-top-news__img {
	display: block;
	overflow: hidden;
	margin-bottom: 0.55rem;
}

.pv-top-news__img img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.pv-top-news__item:hover .pv-top-news__img img {
	transform: scale(1.03);
}

.pv-top-news__link {
	display: block;
	font-family: var(--wp--preset--font-family--headline);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
}

.pv-top-news__item--lead .pv-top-news__link {
	font-size: var(--wp--preset--font-size--medium);
}

.pv-top-news__link:hover,
.pv-top-news__link:focus-visible {
	color: var(--wp--preset--color--brand);
}

.pv-top-news__time {
	display: block;
	margin-top: 0.25rem;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	color: var(--wp--preset--color--brand);
}

@media (prefers-reduced-motion: reduce) {
	.pv-top-news__img img,
	.pv-side-nav .pv-menu a::before {
		transition: none;
	}

	.pv-drawer[open] {
		animation: none;
	}
}
