/*
Theme Name: VB Magazine
Author: VB Magazine
Description: A fast, mobile-first WordPress news magazine theme inspired by clean editorial publishing layouts. Includes ad-ready placements, dark mode foundation, Elementor/Gutenberg support, infinite scroll, and reusable content sections.
Version: 1.1.0
Requires at least: 6.1
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vb-magazine
Tags: blog, news, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, editor-style, wide-blocks, grid-layout, one-column, two-columns
*/

:root {
	--vb-red: #d71920;
	--vb-red-dark: #a80f16;
	--vb-white: #ffffff;
	--vb-black: #111111;
	--vb-ink: #202124;
	--vb-muted: #6b7280;
	--vb-border: #e5e7eb;
	--vb-surface: #ffffff;
	--vb-surface-soft: #f7f7f8;
	--vb-link: #d71920;
	--vb-container: 1180px;
	--vb-radius: 8px;
	--vb-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
	--vb-font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	--vb-font-serif: Georgia, "Times New Roman", serif;
}

body.vb-dark-mode {
	--vb-white: #101214;
	--vb-black: #f8fafc;
	--vb-ink: #e5e7eb;
	--vb-muted: #a1a1aa;
	--vb-border: #2a2f35;
	--vb-surface: #15181c;
	--vb-surface-soft: #0f1115;
	--vb-link: #ff4d55;
	--vb-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--vb-surface-soft);
	color: var(--vb-ink);
	font-family: var(--vb-font-sans);
	font-size: 16px;
	line-height: 1.65;
	text-rendering: optimizeLegibility;
}

a {
	color: var(--vb-link);
	text-decoration: none;
}

a:hover,
a:focus {
	text-decoration: underline;
}

img,
video,
iframe {
	max-width: 100%;
	height: auto;
}

iframe {
	border: 0;
}

button,
input,
select,
textarea {
	font: inherit;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	z-index: 100000;
	top: 8px;
	left: 8px;
	display: block;
	width: auto;
	height: auto;
	padding: 12px 16px;
	clip: auto;
	background: var(--vb-red);
	color: #fff;
}

.vb-container {
	width: min(100% - 32px, var(--vb-container));
	margin-inline: auto;
}

.vb-site-header {
	position: sticky;
	z-index: 999;
	top: 0;
	background: var(--vb-surface);
	border-bottom: 1px solid var(--vb-border);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.vb-topbar {
	background: var(--vb-red);
	color: #fff;
	font-size: 0.82rem;
}

.vb-topbar a {
	color: #fff;
}

.vb-topbar__inner,
.vb-header__inner,
.vb-footer__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.vb-topbar__inner {
	min-height: 34px;
}

.vb-header__inner {
	min-height: 76px;
}

.vb-branding {
	display: flex;
	align-items: center;
	min-width: 0;
}

.vb-site-title {
	margin: 0;
	color: var(--vb-black);
	font-size: 1.45rem;
	font-weight: 800;
	letter-spacing: 0;
}

.vb-site-title a {
	color: inherit;
}

.vb-site-description {
	margin: 0;
	color: var(--vb-muted);
	font-size: 0.85rem;
}

.custom-logo {
	display: block;
	max-height: 56px;
	width: auto;
}

.vb-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.vb-icon-button,
.vb-menu-toggle,
.vb-load-more,
.vb-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0 14px;
	border: 1px solid var(--vb-border);
	border-radius: var(--vb-radius);
	background: var(--vb-surface);
	color: var(--vb-ink);
	cursor: pointer;
}

.vb-icon-button:hover,
.vb-menu-toggle:hover,
.vb-load-more:hover,
.vb-submit:hover {
	border-color: var(--vb-red);
	color: var(--vb-red);
}

.vb-menu-toggle {
	display: none;
}

.vb-primary-menu,
.vb-footer-menu {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.vb-primary-menu a,
.vb-footer-menu a {
	color: var(--vb-ink);
	font-weight: 700;
}

.vb-breaking {
	padding: 10px 0;
	background: var(--vb-surface);
	border-bottom: 1px solid var(--vb-border);
	font-size: 0.92rem;
}

.vb-breaking strong {
	margin-right: 8px;
	color: var(--vb-red);
	text-transform: uppercase;
}

.vb-main {
	padding: 24px 0 48px;
}

.vb-grid {
	display: grid;
	gap: 24px;
}

.vb-layout {
	grid-template-columns: minmax(0, 1fr) 320px;
	align-items: start;
}

.vb-layout > *,
.vb-post-grid > *,
.vb-featured-grid > * {
	min-width: 0;
}

.vb-card {
	background: var(--vb-surface);
	border: 1px solid var(--vb-border);
	border-radius: var(--vb-radius);
	overflow: hidden;
}

.vb-card__media {
	display: block;
	aspect-ratio: 16 / 10;
	background: #ddd;
	overflow: hidden;
}

.vb-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 180ms ease;
}

.vb-card:hover .vb-card__media img {
	transform: scale(1.03);
}

.vb-card__body {
	padding: 16px;
}

.vb-card__title {
	margin: 0 0 8px;
	color: var(--vb-black);
	font-size: 1.08rem;
	line-height: 1.28;
	overflow-wrap: anywhere;
}

.vb-card__title a {
	color: inherit;
}

.vb-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	color: var(--vb-muted);
	font-size: 0.82rem;
	overflow-wrap: anywhere;
}

.vb-kicker {
	display: inline-flex;
	width: fit-content;
	margin-bottom: 8px;
	color: var(--vb-red);
	font-size: 0.76rem;
	font-weight: 800;
	text-transform: uppercase;
}

.vb-section {
	margin-top: 32px;
}

.vb-section__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
	border-bottom: 2px solid var(--vb-border);
}

.vb-section__title {
	position: relative;
	margin: 0;
	padding-bottom: 10px;
	color: var(--vb-black);
	font-size: 1.2rem;
	line-height: 1.25;
}

.vb-section__title::after {
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 64px;
	height: 2px;
	background: var(--vb-red);
	content: "";
}

.vb-featured-grid {
	grid-template-columns: 1.4fr 1fr;
}

.vb-featured-main .vb-card__media {
	aspect-ratio: 16 / 9;
}

.vb-featured-main .vb-card__title {
	font-size: clamp(1.6rem, 4vw, 2.55rem);
}

.vb-featured-list {
	display: grid;
	gap: 16px;
}

.vb-trending-list {
	display: grid;
	gap: 12px;
	counter-reset: trending;
}

.vb-trending-item {
	display: grid;
	grid-template-columns: 42px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
	padding: 12px;
	background: var(--vb-surface);
	border: 1px solid var(--vb-border);
	border-radius: var(--vb-radius);
}

.vb-trending-item::before {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background: var(--vb-red);
	border-radius: 999px;
	color: #fff;
	font-weight: 800;
	counter-increment: trending;
	content: counter(trending);
}

.vb-post-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vb-sidebar {
	display: grid;
	gap: 20px;
}

.widget {
	min-width: 0;
	padding: 18px;
	background: var(--vb-surface);
	border: 1px solid var(--vb-border);
	border-radius: var(--vb-radius);
	overflow-wrap: anywhere;
}

.widget-title,
.widget .wp-block-heading {
	margin: 0 0 14px;
	color: var(--vb-black);
	font-size: 1rem;
}

.vb-ad-slot {
	display: grid;
	min-height: 90px;
	place-items: center;
	padding: 12px;
	margin: 20px 0;
	background: var(--vb-surface);
	border: 1px dashed color-mix(in srgb, var(--vb-red) 55%, var(--vb-border));
	border-radius: var(--vb-radius);
	color: var(--vb-muted);
	text-align: center;
}

.vb-entry-header,
.vb-entry-content,
.vb-entry-footer,
.vb-comments-area {
	max-width: 760px;
	margin-inline: auto;
}

.vb-entry-title {
	margin: 0 0 12px;
	color: var(--vb-black);
	font-size: clamp(2rem, 7vw, 3.8rem);
	line-height: 1.08;
}

.vb-entry-content {
	font-size: 1.08rem;
}

.vb-entry-content > * {
	margin-top: 0;
	margin-bottom: 1.25em;
}

.vb-entry-content h2,
.vb-entry-content h3,
.vb-entry-content h4 {
	color: var(--vb-black);
	line-height: 1.2;
}

.vb-share {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 18px 0;
}

.vb-share a,
.vb-share button {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding: 0 12px;
	border: 1px solid var(--vb-border);
	border-radius: var(--vb-radius);
	background: var(--vb-surface);
	color: var(--vb-ink);
	font-size: 0.9rem;
	font-weight: 700;
}

.vb-share .vb-whatsapp {
	background: #25d366;
	border-color: #25d366;
	color: #fff;
}

.vb-author-box {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr);
	gap: 16px;
	padding: 18px;
	margin: 28px auto;
	background: var(--vb-surface);
	border: 1px solid var(--vb-border);
	border-radius: var(--vb-radius);
}

.vb-author-box img {
	border-radius: 999px;
}

.vb-site-footer {
	padding: 36px 0;
	background: var(--vb-surface);
	border-top: 1px solid var(--vb-border);
	color: var(--vb-muted);
}

.vb-footer-widgets {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin-bottom: 28px;
}

.alignwide {
	max-width: min(100% - 32px, var(--vb-container));
	margin-inline: auto;
}

.alignleft {
	float: left;
	margin: 0 1.5em 1em 0;
}

.alignright {
	float: right;
	margin: 0 0 1em 1.5em;
}

.aligncenter {
	display: block;
	margin-right: auto;
	margin-left: auto;
	text-align: center;
}

.alignfull {
	width: 100%;
	max-width: 100%;
}

.wp-caption,
.wp-caption-text,
.gallery-caption,
.bypostauthor {
	color: inherit;
}

.sticky {
	position: relative;
}

@media (max-width: 900px) {
	.vb-layout,
	.vb-featured-grid {
		grid-template-columns: 1fr;
	}

	.vb-post-grid,
	.vb-footer-widgets {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.vb-menu-toggle {
		display: inline-flex;
	}

	.vb-navigation {
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		display: none;
		padding: 14px 16px;
		background: var(--vb-surface);
		border-bottom: 1px solid var(--vb-border);
	}

	.vb-navigation.is-open {
		display: block;
	}

	.vb-primary-menu {
		display: grid;
		gap: 12px;
	}
}

@media (max-width: 640px) {
	.vb-container {
		width: min(100% - 24px, var(--vb-container));
	}

	.vb-header__inner {
		min-height: 64px;
	}

	.vb-topbar__inner,
	.vb-footer__inner {
		align-items: flex-start;
		flex-direction: column;
		justify-content: center;
		padding: 8px 0;
	}

	.vb-post-grid,
	.vb-footer-widgets {
		grid-template-columns: 1fr;
	}

	.vb-card__body,
	.widget {
		padding: 14px;
	}

	.vb-author-box {
		grid-template-columns: 1fr;
	}
}
