/*
Theme Name: Blogif News
Theme URI: https://blogif.in/
Author: Blogif
Author URI: https://blogif.in/
Description: Child theme of GeneratePress that turns blogif.in into a news-style site. Keeps the GeneratePress header, navigation and footer and restyles the homepage, single posts and archives with a news layout (breaking ticker, featured stories, card grids, trending sidebar, article share bar, related stories). No parent-theme files are modified.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blogif-news
Template: generatepress
Tags: news, blog, generatepress, child-theme
*/

/* ==========================================================================
   BLOGIF NEWS — centralised stylesheet
   Design tokens (matches the site's existing red banner style):
   --news-red #D51F1F | text #1a1a1a | muted #666 | borders #e5e5e5
   Header / nav / footer are styled globally (they are shared by every page).
   News layouts are scoped under body.blogif-news (home, single posts,
   archives) so static pages keep the plain GeneratePress look.
   ========================================================================== */

:root {
	--news-red: #d51f1f;
	--news-red-dark: #a81616;
	--news-text: #1a1a1a;
	--news-muted: #666;
	--news-border: #e5e5e5;
	--news-bg: #ffffff;
	--news-dark: #111111;
	--news-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

body.blogif-news {
	background: var(--news-bg);
	color: var(--news-text);
	font-family: var(--news-sans);
	overflow-x: hidden;
}

body.blogif-news img {
	max-width: 100%;
	height: auto;
}

body.blogif-news a {
	overflow-wrap: break-word;
}

/* --------------------------------------------------------------------------
   Header (GeneratePress markup, kept as-is)
   -------------------------------------------------------------------------- */

.site-header {
	background: #fff;
	border-bottom: 1px solid var(--news-border);
}

.site-header .site-title,
.site-header .site-title a {
	color: var(--news-text);
	font-weight: 800;
	letter-spacing: -0.5px;
}

.site-header .site-title a:hover {
	color: var(--news-red);
}

.site-header .site-description {
	color: var(--news-muted);
}

/* --------------------------------------------------------------------------
   Primary navigation — dark bar, white links (GeneratePress markup)
   -------------------------------------------------------------------------- */

.main-navigation,
.main-navigation .inside-navigation {
	background: var(--news-dark);
}

.main-navigation .main-nav ul li a {
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	padding: 14px 16px;
	line-height: 1.4;
}

.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li[class*="current-menu-"] > a {
	background: var(--news-red);
	color: #fff;
}

/* Sub-menus */
.main-navigation .main-nav ul ul {
	background: #1c1c1c;
}

.main-navigation .main-nav ul ul li a {
	padding: 10px 16px;
	font-size: 14px;
}

/* Mobile menu toggle */
.main-navigation .menu-toggle {
	color: #fff;
}

.main-navigation .menu-toggle:hover,
.main-navigation .menu-toggle:focus {
	background: var(--news-red);
	color: #fff;
}

.main-navigation.toggled .main-nav {
	background: var(--news-dark);
}

/* Navigation search (enable in Customizer > Layout > Primary Navigation) */
.main-navigation .navigation-search input[type="search"] {
	background: #fff;
	color: var(--news-text);
}

/* --------------------------------------------------------------------------
   Footer — dark (GeneratePress markup)
   -------------------------------------------------------------------------- */

.site-footer {
	background: var(--news-dark);
	color: #ccc;
}

.site-footer .footer-widgets {
	background: var(--news-dark);
	color: #ccc;
}

.site-footer .widget-title {
	color: #fff;
}

.site-footer a {
	color: #fff;
}

.site-footer a:hover {
	color: #fff;
	text-decoration: underline;
}

.site-footer .site-info {
	color: #999;
	font-size: 14px;
	text-align: center;
}

/* --------------------------------------------------------------------------
   Shared news bits
   -------------------------------------------------------------------------- */

/* Category badge */
.news-cat {
	display: inline-block;
	background: var(--news-red);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.8px;
	line-height: 1.4;
	padding: 3px 8px;
	border-radius: 2px;
	text-transform: uppercase;
	text-decoration: none;
}

a.news-cat,
a.news-cat:visited {
	color: #fff;
	text-decoration: none;
}

a.news-cat:hover {
	background: var(--news-red-dark);
	color: #fff;
}

/* Section title */
.news-section-title {
	border-bottom: 2px solid var(--news-border);
	font-size: 22px;
	font-weight: 800;
	line-height: 1.3;
	margin: 36px 0 20px;
	padding-bottom: 10px;
	position: relative;
}

.news-section-title::after {
	background: var(--news-red);
	bottom: -2px;
	content: "";
	height: 2px;
	left: 0;
	position: absolute;
	width: 60px;
}

/* News card (used on home grid, archives, related stories) */
.news-card {
	background: #fff;
	border: 1px solid var(--news-border);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.news-card-thumb {
	display: block;
	line-height: 0;
}

.news-card-thumb img {
	aspect-ratio: 16 / 9;
	display: block;
	object-fit: cover;
	width: 100%;
}

.news-card-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 16px;
}

.news-card-body .news-cat {
	align-self: flex-start;
	margin-bottom: 10px;
}

.news-card-title {
	font-size: 19px;
	font-weight: 700;
	line-height: 1.35;
	margin: 0 0 8px;
}

.news-card-title a {
	color: var(--news-text);
	text-decoration: none;
}

.news-card-title a:hover {
	color: var(--news-red);
}

.news-card-excerpt {
	color: #555;
	font-size: 15px;
	line-height: 1.6;
	margin: 0 0 12px;
}

.news-card-meta {
	color: var(--news-muted);
	font-size: 13px;
	margin-top: auto;
}

.news-card-meta a {
	color: var(--news-muted);
	text-decoration: none;
}

.news-card-meta a:hover {
	color: var(--news-red);
}

/* Two-column card grid */
.news-grid {
	display: grid;
	gap: 24px;
	grid-template-columns: 1fr 1fr;
}

/* Pagination */
body.blogif-news .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin: 32px 0 8px;
}

body.blogif-news .nav-links .page-numbers {
	border: 1px solid var(--news-border);
	color: var(--news-text);
	padding: 8px 14px;
	text-decoration: none;
}

body.blogif-news .nav-links a.page-numbers:hover {
	border-color: var(--news-red);
	color: var(--news-red);
}

body.blogif-news .nav-links .page-numbers.current {
	background: var(--news-red);
	border-color: var(--news-red);
	color: #fff;
}

/* --------------------------------------------------------------------------
   Breaking-news ticker (hooked after the header, home only)
   -------------------------------------------------------------------------- */

.news-ticker {
	background: var(--news-red);
	color: #fff;
}

.news-ticker-inner {
	align-items: center;
	display: flex;
	gap: 12px;
	margin: 0 auto;
	max-width: 1200px;
	padding: 8px 20px;
}

.news-ticker-label {
	align-items: center;
	background: var(--news-dark);
	display: inline-flex;
	flex-shrink: 0;
	font-size: 12px;
	font-weight: 800;
	gap: 6px;
	letter-spacing: 1px;
	padding: 3px 10px;
	text-transform: uppercase;
}

.news-ticker-label::before {
	animation: news-ticker-pulse 1.4s ease-in-out infinite;
	background: #fff;
	border-radius: 50%;
	content: "";
	display: inline-block;
	height: 8px;
	width: 8px;
}

@keyframes news-ticker-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.25; }
}

.news-ticker-items {
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
}

.news-ticker-item {
	display: none;
	overflow: hidden;
	text-overflow: ellipsis;
}

.news-ticker-item.active {
	display: block;
}

.news-ticker-item a {
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.news-ticker-item a:hover {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Homepage
   -------------------------------------------------------------------------- */

/* Featured section: 1 large card + 3 small cards */
.news-featured {
	margin-bottom: 8px;
}

.news-featured-grid {
	display: grid;
	gap: 20px;
	grid-template-columns: 1.8fr 1fr;
}

.news-featured-main {
	background: #fff;
	border: 1px solid var(--news-border);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.news-featured-main .news-featured-img {
	display: block;
	line-height: 0;
}

.news-featured-main .news-featured-img img {
	aspect-ratio: 16 / 9;
	display: block;
	object-fit: cover;
	width: 100%;
}

.news-featured-main .news-featured-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 20px;
}

.news-featured-main .news-cat {
	align-self: flex-start;
	margin-bottom: 12px;
}

.news-featured-title {
	font-size: 28px;
	font-weight: 800;
	line-height: 1.3;
	margin: 0 0 10px;
}

.news-featured-title a {
	color: var(--news-text);
	text-decoration: none;
}

.news-featured-title a:hover {
	color: var(--news-red);
}

.news-featured-excerpt {
	color: #555;
	font-size: 16px;
	line-height: 1.65;
	margin: 0 0 12px;
}

.news-featured-meta {
	color: var(--news-muted);
	font-size: 13px;
	margin-top: auto;
}

.news-featured-meta a {
	color: var(--news-muted);
	text-decoration: none;
}

.news-featured-meta a:hover {
	color: var(--news-red);
}

/* Small featured cards (horizontal: thumb left, text right) */
.news-featured-side {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.news-featured-small {
	background: #fff;
	border: 1px solid var(--news-border);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	display: flex;
	flex: 1;
	gap: 14px;
	overflow: hidden;
	padding: 12px;
}

.news-featured-small .news-featured-thumb {
	display: block;
	flex-shrink: 0;
	line-height: 0;
	width: 140px;
	align-self: center;
}

.news-featured-small .news-featured-thumb img {
	aspect-ratio: 16 / 9;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

.news-featured-small .news-featured-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.news-featured-small .news-cat {
	align-self: flex-start;
	margin-bottom: 8px;
}

.news-featured-small-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 0 6px;
}

.news-featured-small-title a {
	color: var(--news-text);
	text-decoration: none;
}

.news-featured-small-title a:hover {
	color: var(--news-red);
}

.news-featured-small-meta {
	color: var(--news-muted);
	font-size: 12px;
	margin-top: auto;
}

/* Latest + Trending two-column layout */
.news-home-layout {
	align-items: start;
	display: grid;
	gap: 32px;
	grid-template-columns: 1fr 320px;
}

/* Trending Now sidebar */
.news-trending {
	position: sticky;
	top: 20px;
}

.news-trending-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.news-trending-list li {
	border-bottom: 1px solid var(--news-border);
	display: flex;
	gap: 14px;
	padding: 14px 0;
}

.news-trending-list li:first-child {
	padding-top: 0;
}

.news-trending-num {
	color: var(--news-red);
	flex-shrink: 0;
	font-size: 28px;
	font-weight: 800;
	line-height: 1;
}

.news-trending-title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.45;
	margin: 0 0 4px;
}

.news-trending-title a {
	color: var(--news-text);
	text-decoration: none;
}

.news-trending-title a:hover {
	color: var(--news-red);
}

.news-trending-meta {
	color: var(--news-muted);
	font-size: 12px;
}

/* About Us section */
.news-about {
	background: #f7f7f7;
	border: 1px solid var(--news-border);
	margin-top: 40px;
	padding: 24px;
}

.news-about h2 {
	font-size: 22px;
	font-weight: 800;
	margin: 0 0 12px;
}

.news-about .news-about-content {
	color: #444;
	font-size: 15px;
	line-height: 1.7;
}

.news-about .news-about-content p:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Single article
   -------------------------------------------------------------------------- */

.news-article {
	margin: 0 auto;
	max-width: 780px;
}

/* Breadcrumb (Yoast output is #breadcrumbs; fallback uses .news-breadcrumb) */
.news-breadcrumb,
#breadcrumbs {
	color: var(--news-muted);
	font-size: 13px;
	margin-bottom: 16px;
}

.news-breadcrumb a,
#breadcrumbs a {
	color: var(--news-muted);
	text-decoration: none;
}

.news-breadcrumb a:hover,
#breadcrumbs a:hover {
	color: var(--news-red);
}

.news-article .news-cat {
	margin-bottom: 14px;
}

.news-article-title {
	font-size: 32px;
	font-weight: 800;
	line-height: 1.25;
	margin: 0 0 12px;
}

.news-article-subtitle {
	color: #444;
	font-size: 18px;
	line-height: 1.6;
	margin: 0 0 20px;
}

/* Author / dates / reading time */
.news-article-meta {
	align-items: center;
	border-bottom: 1px solid var(--news-border);
	border-top: 1px solid var(--news-border);
	color: var(--news-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: 14px;
	gap: 8px 20px;
	margin-bottom: 24px;
	padding: 12px 0;
}

.news-article-meta .news-author {
	align-items: center;
	display: inline-flex;
	gap: 10px;
}

.news-article-meta .news-author img {
	border-radius: 50%;
	display: block;
}

.news-article-meta a {
	color: var(--news-text);
	font-weight: 600;
	text-decoration: none;
}

.news-article-meta a:hover {
	color: var(--news-red);
}

/* Featured image + caption */
.news-article-hero {
	line-height: 0;
	margin: 0 0 24px;
}

.news-article-hero img {
	aspect-ratio: 16 / 9;
	display: block;
	object-fit: cover;
	width: 100%;
}

.news-article-hero figcaption {
	color: var(--news-muted);
	font-size: 13px;
	line-height: 1.5;
	padding-top: 8px;
	text-align: center;
}

/* Article body — Gutenberg content inherits this automatically */
.news-article-body {
	font-size: 17px;
	line-height: 1.8;
	overflow-wrap: break-word;
}

.news-article-body > p:first-child {
	margin-top: 0;
}

.news-article-body p {
	margin: 0 0 1.4em;
}

.news-article-body h2 {
	font-size: 26px;
	font-weight: 800;
	line-height: 1.35;
	margin: 1.6em 0 0.6em;
}

.news-article-body h3 {
	font-size: 21px;
	font-weight: 700;
	line-height: 1.4;
	margin: 1.5em 0 0.5em;
}

.news-article-body h4 {
	font-size: 18px;
	font-weight: 700;
	margin: 1.4em 0 0.5em;
}

.news-article-body ul,
.news-article-body ol {
	margin: 0 0 1.4em;
	padding-left: 1.5em;
}

.news-article-body li {
	margin-bottom: 0.4em;
}

.news-article-body blockquote {
	background: #fafafa;
	border-left: 4px solid var(--news-red);
	font-size: 18px;
	font-style: italic;
	line-height: 1.7;
	margin: 1.5em 0;
	padding: 16px 20px;
}

.news-article-body blockquote p:last-child {
	margin-bottom: 0;
}

.news-article-body img {
	height: auto;
	max-width: 100%;
}

.news-article-body figure {
	margin: 1.5em 0;
}

.news-article-body figure img {
	display: block;
}

.news-article-body figcaption {
	color: var(--news-muted);
	font-size: 13px;
	text-align: center;
}

.news-article-body table {
	border-collapse: collapse;
	display: block;
	margin: 0 0 1.4em;
	overflow-x: auto;
	width: 100%;
}

.news-article-body th,
.news-article-body td {
	border: 1px solid var(--news-border);
	font-size: 15px;
	padding: 10px 12px;
	text-align: left;
}

.news-article-body th {
	background: #f7f7f7;
	font-weight: 700;
}

.news-article-body a {
	color: var(--news-red);
}

.news-article-body a:hover {
	color: var(--news-red-dark);
}

/* Easy Table of Contents — keep it, restyle lightly to fit */
.news-article-body .ez-toc-container {
	background: #fafafa;
	border: 1px solid var(--news-border);
	margin: 0 0 24px;
	padding: 16px 20px;
}

.news-article-body .ez-toc-container a {
	color: var(--news-text);
}

.news-article-body .ez-toc-container a:hover {
	color: var(--news-red);
}

/* Share bar */
.news-share {
	align-items: center;
	border-bottom: 1px solid var(--news-border);
	border-top: 1px solid var(--news-border);
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 28px 0;
	padding: 14px 0;
}

.news-share-label {
	font-size: 14px;
	font-weight: 700;
	margin-right: 4px;
}

.news-share-btn {
	border-radius: 4px;
	color: #fff;
	display: inline-block;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	padding: 8px 14px;
	text-decoration: none;
}

a.news-share-btn,
a.news-share-btn:visited {
	color: #fff;
	text-decoration: none;
}

.news-share-btn:hover {
	opacity: 0.85;
}

.news-share-x {
	background: #000;
}

.news-share-fb {
	background: #1877f2;
}

.news-share-wa {
	background: #25d366;
}

.news-share-tg {
	background: #229ed9;
}

button.news-share-btn {
	border: 1px solid #ccc;
	cursor: pointer;
	font-family: inherit;
}

button.news-share-btn.news-share-copy,
button.news-share-btn.news-share-print {
	background: #fff;
	color: var(--news-text);
}

button.news-share-btn.news-share-copy:hover,
button.news-share-btn.news-share-print:hover {
	border-color: var(--news-red);
	color: var(--news-red);
	opacity: 1;
}

/* Related stories */
.news-related {
	margin-top: 40px;
}

.news-related-grid {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(3, 1fr);
}

/* --------------------------------------------------------------------------
   Archive / category pages
   -------------------------------------------------------------------------- */

.news-archive-header {
	border-bottom: 2px solid var(--news-border);
	margin-bottom: 24px;
	padding-bottom: 12px;
}

.news-archive-title {
	font-size: 28px;
	font-weight: 800;
	line-height: 1.3;
	margin: 0 0 6px;
}

.news-archive-description {
	color: var(--news-muted);
	font-size: 15px;
	line-height: 1.6;
	margin: 0;
}

.news-archive-description p:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
	/* Featured: stack large card above, small cards in 3 columns */
	.news-featured-grid {
		grid-template-columns: 1fr;
	}

	.news-featured-side {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
	}

	.news-featured-small {
		flex-direction: column;
	}

	.news-featured-small .news-featured-thumb {
		width: 100%;
	}

	/* Latest + Trending: single column, trending below */
	.news-home-layout {
		grid-template-columns: 1fr;
	}

	.news-trending {
		position: static;
	}
}

@media (max-width: 768px) {
	.news-grid {
		grid-template-columns: 1fr;
	}

	.news-featured-side {
		grid-template-columns: 1fr;
	}

	.news-featured-small {
		flex-direction: row;
	}

	.news-featured-small .news-featured-thumb {
		width: 140px;
	}

	.news-featured-title {
		font-size: 24px;
	}

	.news-article-title {
		font-size: 28px;
	}

	.news-article-body {
		font-size: 16px;
	}

	.news-article-body h2 {
		font-size: 23px;
	}

	.news-related-grid {
		grid-template-columns: 1fr;
	}

	.news-ticker-inner {
		padding: 8px 15px;
	}
}

@media (max-width: 480px) {
	.news-section-title {
		font-size: 19px;
	}

	.news-featured-title {
		font-size: 22px;
	}

	.news-featured-main .news-featured-body {
		padding: 16px;
	}

	.news-featured-small {
		flex-direction: column;
	}

	.news-featured-small .news-featured-thumb {
		width: 100%;
	}

	.news-card-title {
		font-size: 18px;
	}

	.news-article-title {
		font-size: 26px;
	}

	.news-article-subtitle {
		font-size: 16px;
	}

	.news-article-meta {
		font-size: 13px;
	}

	.news-about {
		padding: 18px;
	}

	.news-ticker-label {
		font-size: 11px;
		padding: 3px 8px;
	}
}

/* --------------------------------------------------------------------------
   Print — article only
   -------------------------------------------------------------------------- */

@media print {
	.site-header,
	.main-navigation,
	.news-ticker,
	.news-share,
	.news-related,
	.news-trending,
	.news-about,
	.site-footer,
	.news-article-meta .news-author img {
		display: none !important;
	}

	body.blogif-news {
		background: #fff;
	}

	.news-article {
		max-width: 100%;
	}

	.news-article-title {
		font-size: 26px;
	}

	.news-article-body {
		font-size: 14px;
		line-height: 1.6;
	}

	.news-article-body a {
		color: #000;
		text-decoration: none;
	}

	.news-article-hero img {
		aspect-ratio: auto;
		max-height: 320px;
	}
}
