/**
 * PunjabiTime News — Phase 1 FINAL homepage hard polish (additive, safe).
 *
 * Loaded via the Novamira sandbox loader AFTER every other stylesheet
 * (priority 96, i.e. after main, ui-extras, phase1-polish=90, followup=95) so
 * these decisive layout caps win without editing main.css or any template.
 *
 * Goal: a stable, balanced, compact, professional latest-news homepage.
 *   - Hard caps on every homepage image height (no half-page images).
 *   - Top Stories rebalanced: lead larger but bounded; clean secondary align.
 *   - Category sections look right with 1 / 2 / 3 / 4+ posts (no blank space).
 *   - Consistent section spacing; capped headline sizes; empty/Opinion hidden.
 *   - Cream FT background + dark mode preserved (no hardcoded colours here).
 *
 * Changes NO posts, images, categories, menus, settings, AdSense, ads.txt,
 * the cream background, or the dark footer. Fully reversible: disable/delete
 * the sandbox loader (pt-phase1-final.php) and this file.
 */

/* ================================================================== *
 * 1) GLOBAL HOMEPAGE IMAGE SIZE CONTROL — hard caps so nothing is huge.
 * ================================================================== */
.pt-home .pt-card__image,
.pt-home .pt-video-card__image {
	overflow: hidden;
	border-radius: 3px;
	margin-bottom: 12px;
}

/* Standard / grid / feature-list cards: compact, consistent 16:10, capped. */
.pt-home .pt-card--standard .pt-card__image img,
.pt-home .pt-grid-section .pt-card__image img,
.pt-home .pt-card-grid .pt-card__image img {
	width: 100%;
	aspect-ratio: 16 / 10;
	max-height: 190px;
	object-fit: cover;
}

/* Lead images (Top Stories lead + feature lead): larger but firmly bounded. */
.pt-home .pt-top-grid__lead .pt-card__image img,
.pt-home .pt-feature-grid__main .pt-card__image img,
.pt-home .pt-card--lead .pt-card__image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	max-height: 300px;
	object-fit: cover;
}

/* Video lead. */
.pt-home .pt-video-grid__main .pt-video-card__image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	max-height: 300px;
	object-fit: cover;
}

/* ================================================================== *
 * 2) TOP STORIES — balanced, professional, lead bounded.
 * ================================================================== */
.pt-home .pt-top-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.95fr) minmax(220px, 0.75fr);
	gap: 26px;
	align-items: start;
}

/* Lead headline: prominent but never poster-sized (main.css had up to 52px). */
.pt-home .pt-top-grid__lead .pt-card__title,
.pt-home .pt-card--lead .pt-card__title {
	font-size: clamp(23px, 2.3vw, 34px);
	line-height: 1.12;
}

.pt-home .pt-top-grid__lead .pt-card__excerpt,
.pt-home .pt-card--lead .pt-card__excerpt {
	font-size: 15px;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Secondary (side) cards align cleanly and stay compact. */
.pt-home .pt-top-grid__side .pt-card__title {
	font-size: clamp(16px, 1.3vw, 19px);
	line-height: 1.18;
}

.pt-home .pt-top-grid__side .pt-card__excerpt {
	display: none;
}

/* The text "More top stories" list stays tight. */
.pt-home .pt-top-grid__list {
	gap: 12px;
}

.pt-home .pt-top-grid__list .pt-news-line h3 {
	font-size: 15px;
	line-height: 1.25;
}

/* ================================================================== *
 * 3) HEADLINE CAPS + EVEN CARD HEIGHTS everywhere on the homepage.
 * ================================================================== */
.pt-home .pt-card__title {
	font-size: clamp(16px, 1.4vw, 20px);
	line-height: 1.18;
}

.pt-home .pt-card__title a {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pt-home .pt-card__excerpt {
	font-size: 14px;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pt-home .pt-card-grid {
	align-items: stretch;
}

.pt-home .pt-card-grid .pt-card {
	display: flex;
	flex-direction: column;
}

.pt-home .pt-card-grid .pt-card .pt-card__body {
	flex: 1 1 auto;
}

/* ================================================================== *
 * 4) SPARSE SECTIONS — look good with 1 / 2 / 3 posts (no blank space).
 * ================================================================== */

/* --- 4-up grids (Latest, World, Politics, Crime, Entertainment) --- */
.pt-home .pt-card-grid--four {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 22px;
	justify-content: start;
}

/* 1 card -> one compact card, left aligned (not a stretched giant). */
.pt-home .pt-card-grid--four:has(> .pt-card:only-child) {
	grid-template-columns: minmax(0, 300px);
}

/* 2 cards -> two balanced compact cards. */
.pt-home .pt-card-grid--four:has(> .pt-card:nth-child(2):last-child) {
	grid-template-columns: repeat(2, minmax(0, 300px));
}

/* 3 cards -> three even columns. */
.pt-home .pt-card-grid--four:has(> .pt-card:nth-child(3):last-child) {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* --- Feature sections (Punjab, India, NRI, Sports) lead + side list ---
 * When the side list has no news lines (only 1 post in the category), drop the
 * empty column and show a single bounded lead card instead of a half-page block. */
.pt-home .pt-feature-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
	gap: 26px;
	align-items: start;
}

.pt-home .pt-feature-grid:has(> .pt-feature-grid__list:empty),
.pt-home .pt-feature-grid:not(:has(.pt-feature-grid__list .pt-news-line)) {
	grid-template-columns: minmax(0, 600px);
}

.pt-home .pt-feature-grid:has(> .pt-feature-grid__list:empty) .pt-feature-grid__list,
.pt-home .pt-feature-grid:not(:has(.pt-feature-grid__list .pt-news-line)) .pt-feature-grid__list {
	display: none;
}

.pt-home .pt-feature-grid:not(:has(.pt-feature-grid__list .pt-news-line)) .pt-feature-grid__main .pt-card__image img {
	max-height: 280px;
}

/* Feature side list tight. */
.pt-home .pt-feature-grid__list {
	gap: 14px;
}

.pt-home .pt-feature-grid__list .pt-news-line h3 {
	font-size: 15px;
	line-height: 1.25;
}

/* ================================================================== *
 * 5) CONSISTENT SECTION SPACING (compact, even rhythm).
 * ================================================================== */
.pt-home .pt-section {
	padding: 26px 0;
}

.pt-home .pt-section:first-child {
	padding-top: 20px;
}

.pt-home .pt-section__head {
	margin-bottom: 16px;
}

/* Trending list compact. */
.pt-home .pt-trending-list {
	gap: 14px 20px;
}

/* ================================================================== *
 * 6) Keep empty sections + Opinion hidden (reassert; harmless duplicate).
 * ================================================================== */
.pt-home .pt-section:has(> .pt-container > .pt-empty),
.pt-home .pt-section:has(> .pt-container .pt-card-grid > .pt-empty),
.pt-home .pt-section:has(> .pt-container .pt-feature-grid > .pt-empty),
.pt-home .pt-opinion-section,
.pt-home .pt-section.pt-is-empty {
	display: none !important;
}

/* ================================================================== *
 * 7) RESPONSIVE — tablet + mobile stay clean and not oversized.
 * ================================================================== */
@media (max-width: 1100px) {
	.pt-home .pt-top-grid {
		grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
	}
	.pt-home .pt-card-grid--four {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.pt-home .pt-card-grid--four:has(> .pt-card:only-child) {
		grid-template-columns: minmax(0, 300px);
	}
}

@media (max-width: 820px) {
	.pt-home .pt-section {
		padding: 20px 0;
	}
	.pt-home .pt-top-grid,
	.pt-home .pt-feature-grid,
	.pt-home .pt-feature-grid:has(> .pt-feature-grid__list:empty),
	.pt-home .pt-card-grid--four,
	.pt-home .pt-card-grid--four:has(> .pt-card:only-child),
	.pt-home .pt-card-grid--four:has(> .pt-card:nth-child(2):last-child),
	.pt-home .pt-card-grid--four:has(> .pt-card:nth-child(3):last-child) {
		grid-template-columns: 1fr;
	}

	.pt-home .pt-top-grid__lead .pt-card__title,
	.pt-home .pt-card--lead .pt-card__title {
		font-size: 23px;
	}

	.pt-home .pt-card__title {
		font-size: 19px;
	}

	/* On mobile, lead + standard images a touch shorter for a tidy scroll. */
	.pt-home .pt-top-grid__lead .pt-card__image img,
	.pt-home .pt-feature-grid__main .pt-card__image img,
	.pt-home .pt-card--lead .pt-card__image img,
	.pt-home .pt-video-grid__main .pt-video-card__image img {
		max-height: 240px;
	}

	.pt-home .pt-card--standard .pt-card__image img,
	.pt-home .pt-grid-section .pt-card__image img,
	.pt-home .pt-card-grid .pt-card__image img {
		max-height: 220px;
	}

	/* Show side-card excerpts again on mobile single column for context. */
	.pt-home .pt-top-grid__side .pt-card__excerpt {
		display: -webkit-box;
	}
}
