/**
 * NewsCore Design Polish — v2.2
 * Card hover lift, hero gradient overlays, ticker edge fades,
 * headline link animations and typography refinements.
 */

/* ---------- 1. News card hover: lift + zoom + title tint ---------- */
.news-card {
	transition:
		transform .28s cubic-bezier(.2, .7, .3, 1),
		box-shadow .28s cubic-bezier(.2, .7, .3, 1),
		border-color .28s ease;
}
.news-card:hover {
	transform: translateY(-4px);
	border-color: var(--nc-color-border-dark);
	box-shadow:
		0 12px 28px -8px rgb(15 23 42 / .18),
		0 4px 10px -4px rgb(15 23 42 / .1);
}
.news-card:hover .card-media img,
.news-card:hover .news-card__media img {
	transform: scale(1.07);
}
.news-card .entry-title a,
.news-card__title a {
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 0% 2px;
	background-repeat: no-repeat;
	background-position: 0 100%;
	transition: background-size .3s ease, color .2s ease;
}
.news-card:hover .entry-title a,
.news-card:hover .news-card__title a {
	background-size: 100% 2px;
	color: var(--nc-color-primary);
}

/* ---------- 2. Hero image gradient overlay variant ---------- */
.news-card--hero .card-media,
.news-card--featured .card-media {
	position: relative;
}
.news-card--hero .card-media::after,
.news-card--featured .card-media::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(
		to top,
		rgb(2 6 17 / .78) 0%,
		rgb(2 6 17 / .38) 42%,
		rgb(2 6 17 / 0) 72%
	);
	pointer-events: none;
	transition: opacity .3s ease;
}
.news-card--hero:hover .card-media::after,
.news-card--featured:hover .card-media::after {
	opacity: .92;
}
/* Optional overlay-caption style: add class "has-overlay-caption" to the card
   via Customizer/child theme to float the title over the image. */
.news-card--hero.has-overlay-caption .card-body,
.news-card--featured.has-overlay-caption .card-body {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	z-index: 2;
	padding: var(--nc-space-5);
	background: transparent;
}
.news-card--hero.has-overlay-caption .hero-title a,
.news-card--featured.has-overlay-caption .entry-title a,
.news-card--hero.has-overlay-caption .hero-summary {
	color: #fff;
	text-shadow: 0 1px 8px rgb(0 0 0 / .45);
}

/* ---------- 3. Breaking ticker: edge fade masks ---------- */
.breaking-news-ticker-wrap {
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 3%, #000 97%, transparent 100%);
	mask-image: linear-gradient(to right, transparent 0, #000 3%, #000 97%, transparent 100%);
}
.breaking-news-label {
	position: relative;
	z-index: 2;
	box-shadow: 4px 0 12px -4px rgb(0 0 0 / .35);
}
.breaking-news-item {
	position: relative;
}
.breaking-news-item + .breaking-news-item::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: var(--nc-color-primary);
	opacity: .7;
	margin-inline-end: var(--nc-space-3);
	flex-shrink: 0;
}
.breaking-news-link {
	transition: color .2s ease;
}
.breaking-news-link:hover {
	color: var(--nc-color-primary);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- 4. Typography refinements ---------- */
.entry-title,
.news-card__title,
.hero-title {
	text-wrap: balance;
	letter-spacing: -0.015em;
}
.section-title {
	position: relative;
	letter-spacing: -0.01em;
}
.section-title::after {
	content: "";
	display: block;
	width: 44px;
	height: 3px;
	margin-top: 8px;
	border-radius: 2px;
	background: var(--nc-color-primary);
}
/* Drop cap for single article lead paragraph */
.single-post .entry-content > p:first-of-type::first-letter {
	font-size: 3.2em;
	line-height: .9;
	font-weight: 800;
	float: left;
	margin: 4px 10px 0 0;
	color: var(--nc-color-primary);
}

/* ---------- 5. Buttons & badges micro-polish ---------- */
.btn,
.button,
.wp-block-button__link {
	transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.btn:hover,
.button:hover,
.wp-block-button__link:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px -6px rgb(15 23 42 / .35);
}
.btn:active,
.button:active {
	transform: translateY(0);
}
.card-badge-overlay .badge,
.badge--breaking {
	box-shadow: 0 2px 8px rgb(0 0 0 / .25);
	letter-spacing: .04em;
}

/* ---------- 6. Subtle image treatment ---------- */
.card-media img,
.news-card__media img {
	filter: saturate(1.04) contrast(1.02);
}

/* ---------- 7. Reduced motion respect ---------- */
@media (prefers-reduced-motion: reduce) {
	.news-card,
	.news-card .card-media img,
	.news-card__media img,
	.btn, .button {
		transition: none;
	}
	.news-card:hover {
		transform: none;
	}
	.breaking-news-marquee:not(.is-crawling) {
		animation: none;
	}
}

/* ---------- 9. Featured image fit modes (v2.2.1) ---------- */
/* Default (body.newscore-img-fit-contain, set in Theme Settings >
   Design > Featured Image Display): the complete featured image is
   shown everywhere — no side cropping. The rules below ONLY apply when
   the site owner explicitly switches the setting back to "cover"
   (fill the box, old behaviour). */
body.newscore-img-fit-cover .news-card .card-media img,
body.newscore-img-fit-cover .news-card__media img,
body.newscore-img-fit-cover .news-card--compact .card-media img,
body.newscore-img-fit-cover .news-card-compact .card-media-compact img {
	object-fit: cover;
	background-color: transparent;
}
body.newscore-img-fit-cover .article-featured-media-wrap {
	aspect-ratio: 16 / 9;
	max-height: 440px;
}
body.newscore-img-fit-cover .article-featured-img,
body.newscore-img-fit-cover .page-featured-image img {
	width: 100%;
	height: 100%;
	max-height: 440px;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	object-position: center top;
}

/* ---------- 8. Newsletter subscribe box (v2.2) ---------- */
.article-newsletter-box {
	margin-block: var(--nc-space-6);
	border-radius: var(--nc-radius-lg);
	background:
		radial-gradient(120% 160% at 0% 0%, rgb(220 38 38 / .12) 0%, transparent 55%),
		radial-gradient(120% 160% at 100% 100%, rgb(2 132 199 / .12) 0%, transparent 55%),
		var(--nc-color-surface);
	border: 1px solid var(--nc-color-border);
	overflow: hidden;
}
.article-newsletter-inner {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: var(--nc-space-2) var(--nc-space-4);
	align-items: center;
	padding: var(--nc-space-6);
}
.newsletter-icon-circle {
	width: 56px;
	height: 56px;
	border-radius: 999px;
	display: grid;
	place-items: center;
	color: #fff;
	background: linear-gradient(135deg, var(--nc-color-primary), #7c2d12);
	box-shadow: 0 8px 20px -6px rgb(220 38 38 / .5);
}
.article-newsletter-title {
	font-size: var(--nc-font-size-xl);
	font-weight: 800;
	letter-spacing: -0.01em;
	margin: 0 0 var(--nc-space-1);
}
.article-newsletter-desc {
	margin: 0;
	color: var(--nc-color-text-muted);
	font-size: var(--nc-font-size-sm);
}
.article-newsletter-form {
	grid-column: 1 / -1;
	display: flex;
	gap: var(--nc-space-2);
	margin-top: var(--nc-space-2);
}
.newsletter-email-input {
	flex: 1;
	min-width: 0;
	padding: 12px 16px;
	border-radius: var(--nc-radius-md);
	border: 1px solid var(--nc-color-border-dark);
	background: var(--nc-color-bg);
	color: var(--nc-color-text);
	font-size: var(--nc-font-size-base);
}
.newsletter-email-input:focus {
	outline: 2px solid var(--nc-color-primary);
	outline-offset: 1px;
	border-color: var(--nc-color-primary);
}
.newsletter-honeypot {
	position: absolute;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.newsletter-submit-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border: 0;
	border-radius: var(--nc-radius-md);
	background: var(--nc-color-primary);
	color: #fff;
	font-weight: 700;
	font-size: var(--nc-font-size-base);
	cursor: pointer;
	white-space: nowrap;
	transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.newsletter-submit-btn:hover {
	background: var(--nc-color-primary-hover);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px -6px rgb(220 38 38 / .5);
}
.newsletter-submit-btn:disabled {
	opacity: .7;
	cursor: wait;
	transform: none;
}
.newsletter-btn-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border-radius: 999px;
	border: 2px solid rgb(255 255 255 / .4);
	border-top-color: #fff;
	animation: nc-spin .7s linear infinite;
}
.article-newsletter-form.is-submitting .newsletter-btn-spinner {
	display: inline-block;
}
@keyframes nc-spin {
	to { transform: rotate(360deg); }
}
.article-newsletter-msg {
	grid-column: 1 / -1;
	margin: var(--nc-space-2) 0 0;
	padding: 10px 14px;
	border-radius: var(--nc-radius-md);
	font-size: var(--nc-font-size-sm);
	font-weight: 600;
}
.article-newsletter-msg.is-success {
	background: var(--nc-color-success-light);
	color: #047857;
	border: 1px solid #a7f3d0;
}
.article-newsletter-msg.is-error {
	background: var(--nc-color-error-light);
	color: #b91c1c;
	border: 1px solid #fecaca;
}
.article-newsletter-privacy {
	grid-column: 1 / -1;
	margin: var(--nc-space-1) 0 0;
	font-size: 12px;
	color: var(--nc-color-text-light);
}
@media (max-width: 560px) {
	.article-newsletter-inner {
		grid-template-columns: 1fr;
		padding: var(--nc-space-5);
	}
	.article-newsletter-form {
		flex-direction: column;
	}
	.newsletter-submit-btn {
		justify-content: center;
	}
}
