/* -------------------------------------------------------------------------- */
/* 1.8.52 — /news/ desk front + mobile full-bleed (TT5/Divi carcass)          */
/* Scoped to .tmg-news-front — does not alter .tmg-home-news grid.            */
/* Sticky site header DEFERRED (separate chrome slice).                       */
/* -------------------------------------------------------------------------- */

/*
 * Staging DOM (TT5): main.has-global-padding.is-layout-constrained
 *   > .wp-block-group.alignfull.has-global-padding.is-layout-constrained
 *     > .entry-content.alignfull.has-global-padding.is-layout-constrained
 *       > .tmg-news-page.tmg-news-front.alignfull
 * Alignfull ancestors re-apply root padding; pad-kill without killing negative
 * margins caused H-scroll + ~70px gutters / ~235px cards at 390px.
 */

/* Page shell owns gutters; zero ancestor pads + alignfull pull-out. */
body:has(.tmg-news-page.tmg-news-front) .wp-site-blocks > main,
body:has(.tmg-news-page.tmg-news-front) .wp-site-blocks > main.has-global-padding,
body:has(.tmg-news-page.tmg-news-front) .wp-site-blocks > main.wp-block-group,
body:has(.tmg-news-page.tmg-news-front) main .wp-block-group:has(.tmg-news-page.tmg-news-front),
body:has(.tmg-news-page.tmg-news-front) main .wp-block-group.alignfull:has(.tmg-news-page.tmg-news-front),
body:has(.tmg-news-page.tmg-news-front) main .wp-block-column:has(.tmg-news-page.tmg-news-front),
body .entry-content:has(.tmg-news-page.tmg-news-front),
body .wp-block-post-content:has(.tmg-news-page.tmg-news-front),
body:has(.tmg-news-page.tmg-news-front) .et_pb_section:has(.tmg-news-page.tmg-news-front),
body:has(.tmg-news-page.tmg-news-front) .et_pb_row:has(.tmg-news-page.tmg-news-front),
body:has(.tmg-news-page.tmg-news-front) .et_pb_column:has(.tmg-news-page.tmg-news-front) {
	box-sizing: border-box;
	margin-left: 0 !important;
	margin-right: 0 !important;
	max-width: none !important;
	overflow-x: clip;
	padding-left: 0 !important;
	padding-right: 0 !important;
	width: 100% !important;
}

/* Kill alignfull negative margins once padding is zeroed (H-scroll source). */
body:has(.tmg-news-page.tmg-news-front) .has-global-padding > .alignfull:has(.tmg-news-page.tmg-news-front),
body:has(.tmg-news-page.tmg-news-front) .has-global-padding > .alignfull.tmg-news-front,
body:has(.tmg-news-page.tmg-news-front) .is-layout-constrained > .tmg-news-front,
body:has(.tmg-news-page.tmg-news-front) .is-layout-constrained > .alignfull:has(.tmg-news-page.tmg-news-front),
body:has(.tmg-news-page.tmg-news-front) .is-layout-constrained > .alignfull.tmg-news-front {
	margin-left: 0 !important;
	margin-right: 0 !important;
	max-width: none !important;
	width: 100% !important;
}

/* Scoped H-scroll hard stop (news front only). */
html:has(.tmg-news-page.tmg-news-front),
body:has(.tmg-news-page.tmg-news-front),
body:has(.tmg-news-page.tmg-news-front) .wp-site-blocks {
	overflow-x: clip;
}

/* P1 — shrink/hide WP page intro blurb above the shortcode. */
body:has(.tmg-news-page.tmg-news-front) .entry-content > p:first-child,
body:has(.tmg-news-page.tmg-news-front) .wp-block-post-content > p:first-child,
body:has(.tmg-news-page.tmg-news-front) .entry-content > .wp-block-paragraph:first-child,
body:has(.tmg-news-page.tmg-news-front) .wp-block-post-content > .wp-block-paragraph:first-child {
	display: none !important;
	height: 0 !important;
	margin: 0 !important;
	overflow: hidden !important;
	padding: 0 !important;
}

.tmg-news-front.tmg-news-page {
	box-sizing: border-box;
	color: var(--tmg-mist);
	margin-left: auto;
	margin-right: auto;
	max-width: min(100%, var(--tmg-content-max, 1240px));
	overflow-x: clip;
	padding: .35rem 16px 2rem;
	padding-inline: 16px;
	width: 100%;
}

.tmg-news-front.tmg-news-page *,
.tmg-news-front.tmg-news-page *::before,
.tmg-news-front.tmg-news-page *::after {
	box-sizing: border-box;
}

/* Tighten masthead → hero gap (P1). */
.tmg-news-front .tmg-news-masthead {
	border-bottom: 2px solid var(--tmg-teal);
	margin: 0 0 .85rem;
	padding: 0 0 .55rem;
}

.tmg-news-front .tmg-news-kicker {
	margin: 0 0 .25rem;
}

.tmg-news-front .tmg-news-mast-title {
	margin: 0;
}

/* -------------------------------------------------------------------------- */
/* Hero 1+2 — asymmetric desktop; stack on mobile                             */
/* -------------------------------------------------------------------------- */
.tmg-news-hero {
	display: grid;
	gap: 16px;
	grid-template-columns: 1.55fr 0.75fr;
	margin: 0 0 1.1rem;
	min-width: 0;
	width: 100%;
}

.tmg-news-hero:not(:has(.tmg-news-hero__secondary)) {
	grid-template-columns: 1fr;
}

.tmg-news-hero__primary,
.tmg-news-hero__secondary {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-height: 0;
	min-width: 0;
}

.tmg-news-hero__primary {
	min-height: 22rem;
}

.tmg-news-hero__secondary {
	flex: 1 1 auto;
}

.tmg-news-hero__primary > .tmg-card,
.tmg-news-hero__secondary > .tmg-card {
	flex: 1 1 auto;
	height: 100%;
	max-width: 100%;
	min-height: 0;
	min-width: 0;
	width: 100%;
}

.tmg-news-hero__secondary > .tmg-card {
	min-height: 10.5rem;
}

/* Overlay card — copy on image, dark bottom gradient (Synth pattern). */
.tmg-news-front article.tmg-card.tmg-card--overlay {
	aspect-ratio: auto;
	background: #0a0c0e;
	border-radius: 18px;
	isolation: isolate;
	overflow: hidden;
	padding: 0;
	position: relative;
}

.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__media {
	bottom: 0;
	height: 100%;
	left: 0;
	padding: 0;
	position: absolute;
	right: 0;
	top: 0;
	width: 100%;
	z-index: 0;
}

.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__media > img,
.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__media-placeholder {
	aspect-ratio: auto;
	border-radius: 0;
	height: 100%;
	object-fit: cover;
	object-position: center;
	width: 100%;
}

.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__body {
	background: linear-gradient(
		180deg,
		rgba(10, 12, 14, 0) 0%,
		rgba(10, 12, 14, .55) 28%,
		rgba(10, 12, 14, .92) 100%
	);
	bottom: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	justify-content: flex-end;
	left: 0;
	padding: 2.4rem 1.1rem 1.05rem;
	position: absolute;
	right: 0;
	z-index: 2;
}

/* Overlay: type as teal text kicker (not outline pill). */
.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-type-badge-wrap {
	margin: 0;
}

.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-type-badge,
.tmg-news-front article.tmg-card.tmg-card--overlay a.tmg-type-badge {
	background: transparent !important;
	border: 0 !important;
	border-radius: 0;
	color: var(--tmg-teal) !important;
	font-size: .7rem;
	font-weight: 800;
	letter-spacing: .12em;
	padding: 0;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
	text-transform: uppercase;
}

.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__by,
.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__date,
.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__tags {
	display: none !important;
}

.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__title {
	-webkit-box-orient: vertical;
	color: #E8EEF0 !important;
	display: -webkit-box;
	font-size: clamp(1.05rem, 2vw, 1.35rem);
	font-weight: 800;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	line-height: 1.2;
	margin: 0;
	overflow: hidden;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .65);
}

.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__title a {
	color: inherit !important;
	text-decoration: none !important;
}

.tmg-news-front article.tmg-card.tmg-card--overlay:hover .tmg-card__title,
.tmg-news-front article.tmg-card.tmg-card--overlay:focus-within .tmg-card__title {
	color: var(--tmg-teal) !important;
}

.tmg-news-front .tmg-news-card--hero-primary.tmg-card--overlay .tmg-card__title {
	font-size: clamp(1.35rem, 2.6vw, 1.95rem);
	-webkit-line-clamp: 4;
	line-clamp: 4;
}

.tmg-news-front .tmg-news-card--hero-secondary.tmg-card--overlay .tmg-card__title {
	font-size: clamp(.95rem, 1.6vw, 1.15rem);
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__cta {
	margin: .15rem 0 0;
}

.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__cta a {
	color: rgba(232, 238, 240, .92) !important;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-decoration: none !important;
	text-transform: uppercase;
}

.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__cta a:hover,
.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__cta a:focus-visible {
	color: var(--tmg-teal) !important;
}

/* Score — fixed corner (kill % inset that clipped / duplicated on narrow cards). */
.tmg-news-front .tmg-score {
	right: 12px;
	top: 12px;
	z-index: 3;
}

.tmg-news-front article.tmg-card.tmg-card--overlay .tmg-score {
	right: 12px;
	top: 12px;
}

/* Only one score pill; never let a second bleed past the card. */
.tmg-news-front article.tmg-card .tmg-card__media > .tmg-score ~ .tmg-score {
	display: none !important;
}

/* -------------------------------------------------------------------------- */
/* Filter chips (P2) — markup + CSS; All active; category links for HOTP/Rev  */
/* -------------------------------------------------------------------------- */
.tmg-news-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 1.15rem;
	min-width: 0;
	width: 100%;
}

.tmg-news-chip,
a.tmg-news-chip {
	background: transparent;
	border: 1.5px solid var(--tmg-teal, #00C9B1);
	border-radius: 999px;
	color: var(--tmg-mist, #E8EEF0) !important;
	display: inline-flex;
	font-size: .78rem;
	font-weight: 750;
	letter-spacing: .03em;
	line-height: 1.2;
	padding: .45rem .95rem;
	text-decoration: none !important;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}

a.tmg-news-chip:hover,
a.tmg-news-chip:focus-visible {
	background: rgba(0, 201, 177, .16);
	color: #E8EEF0 !important;
}

.tmg-news-chip.is-active,
a.tmg-news-chip.is-active,
.tmg-news-chip[aria-current="page"] {
	background: var(--tmg-teal, #00C9B1);
	border-color: var(--tmg-teal, #00C9B1);
	color: #0B1214 !important;
}

.tmg-news-chip--disabled {
	cursor: default;
	opacity: .45;
	pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* Feed grid — 3 / 2 / 1; under-image meta (standard bubble cards)            */
/* -------------------------------------------------------------------------- */
.tmg-news-feed.tmg-card-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	min-width: 0;
	width: 100%;
}

.tmg-news-feed > .tmg-card,
.tmg-news-front .tmg-news-feed article.tmg-card.tmg-news-card {
	gap: 0;
	height: auto;
	max-width: 100%;
	min-width: 0;
	padding: 0;
	width: 100%;
}

/* Feed score also uses fixed corner (media padding still 8% for ribbon frame). */
.tmg-news-feed .tmg-card__media {
	min-width: 0;
	overflow: hidden;
}

.tmg-news-feed .tmg-score {
	/* Sit inside padded media without % drift past clip edge. */
	right: max(12px, 8%);
	top: max(12px, 8%);
}

/* -------------------------------------------------------------------------- */
/* Mobile — full-width cards, ~16px gutters, zero horizontal scroll           */
/* Desktop hero 1.55|0.75 unchanged above.                                    */
/* -------------------------------------------------------------------------- */
@media (max-width: 900px) {
	.tmg-news-front.tmg-news-page {
		margin-left: 0;
		margin-right: 0;
		max-width: 100% !important;
		padding-inline: 16px;
		width: 100% !important;
	}

	/* Re-assert ancestor breakout (TT5 + Divi carcass). */
	body:has(.tmg-news-page.tmg-news-front) .wp-site-blocks > main,
	body:has(.tmg-news-page.tmg-news-front) main .wp-block-group:has(.tmg-news-page.tmg-news-front),
	body:has(.tmg-news-page.tmg-news-front) main .wp-block-column:has(.tmg-news-page.tmg-news-front),
	body .entry-content:has(.tmg-news-page.tmg-news-front),
	body .wp-block-post-content:has(.tmg-news-page.tmg-news-front),
	body:has(.tmg-news-page.tmg-news-front) .et_pb_section:has(.tmg-news-page.tmg-news-front),
	body:has(.tmg-news-page.tmg-news-front) .et_pb_row:has(.tmg-news-page.tmg-news-front),
	body:has(.tmg-news-page.tmg-news-front) .et_pb_column:has(.tmg-news-page.tmg-news-front) {
		margin-left: 0 !important;
		margin-right: 0 !important;
		max-width: 100% !important;
		padding-inline: 0 !important;
		width: 100% !important;
	}

	.tmg-news-hero,
	.tmg-news-hero__primary,
	.tmg-news-hero__secondary,
	.tmg-news-feed.tmg-card-grid,
	.tmg-news-front article.tmg-card,
	.tmg-news-front article.tmg-card.tmg-card--overlay {
		max-width: 100% !important;
		min-width: 0 !important;
		width: 100% !important;
	}

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

	.tmg-news-hero__primary {
		min-height: 16rem;
	}

	.tmg-news-hero__secondary > .tmg-card {
		min-height: 11rem;
	}

	.tmg-news-feed.tmg-card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.tmg-news-front.tmg-news-page {
		max-width: 100% !important;
		padding-inline: 16px;
		width: 100% !important;
	}

	.tmg-news-feed.tmg-card-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.tmg-news-hero__primary {
		min-height: 14.5rem;
	}

	.tmg-news-chips {
		gap: 6px;
	}

	.tmg-news-chip,
	a.tmg-news-chip {
		font-size: .74rem;
		padding: .4rem .8rem;
	}
}

/* Hard stop any child from forcing H-scroll on the news front. */
.tmg-news-front,
.tmg-news-front .tmg-news-hero,
.tmg-news-front .tmg-news-feed,
.tmg-news-front .tmg-news-chips,
.tmg-news-front article.tmg-card,
.tmg-news-front article.tmg-card.tmg-card--overlay {
	max-width: 100%;
	min-width: 0;
	width: 100%;
}

.tmg-news-front article.tmg-card img {
	max-width: 100%;
}

/* Light theme — overlay stays high-contrast on dark gradient; chips/teal ok. */
html[data-theme="light"] .tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__title,
body.tmg-theme-light .tmg-news-front article.tmg-card.tmg-card--overlay .tmg-card__title {
	color: #E8EEF0 !important;
}

html[data-theme="light"] .tmg-news-chip.is-active,
body.tmg-theme-light .tmg-news-chip.is-active,
html[data-theme="light"] a.tmg-news-chip.is-active,
body.tmg-theme-light a.tmg-news-chip.is-active {
	color: #0B1214 !important;
}

html[data-theme="light"] .tmg-news-chip,
body.tmg-theme-light .tmg-news-chip,
html[data-theme="light"] a.tmg-news-chip,
body.tmg-theme-light a.tmg-news-chip {
	color: #0B1214 !important;
}
