/**
 * Front-end styling for the [nv_news] shortcode.
 * Deliberately light: it inherits the theme's fonts and colours so wire copy
 * sits inside an existing design instead of fighting it.
 */

.nv-news {
	--nv-news-rule: rgba(0, 0, 0, 0.12);
	--nv-news-muted: rgba(0, 0, 0, 0.55);
	margin: 0 0 2rem;
}

.nv-news-title {
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	border-bottom: 2px solid currentColor;
	padding-bottom: 0.4rem;
	margin: 0 0 1rem;
}

.nv-news-item {
	padding: 0 0 1rem;
	margin: 0 0 1rem;
	border-bottom: 1px solid var(--nv-news-rule);
}

.nv-news-items > .nv-news-item:last-child {
	border-bottom: 0;
	margin-bottom: 0;
}

.nv-news-eyebrow {
	display: flex;
	gap: 0.6rem;
	align-items: center;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--nv-news-muted);
	margin: 0 0 0.3rem;
}

.nv-news-desk {
	font-weight: 700;
}

.nv-news-place::before {
	content: "";
	display: inline-block;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: currentColor;
	vertical-align: middle;
	margin-right: 0.6rem;
}

.nv-news-headline {
	font-size: 1.15rem;
	line-height: 1.3;
	margin: 0 0 0.35rem;
}

.nv-news-headline a {
	text-decoration: none;
	color: inherit;
}

.nv-news-headline a:hover,
.nv-news-headline a:focus {
	text-decoration: underline;
}

.nv-news-excerpt {
	margin: 0 0 0.35rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.nv-news-time {
	margin: 0;
	font-size: 0.75rem;
	color: var(--nv-news-muted);
}

/* Masthead: the publication's own voice, set apart from wire copy. */
.nv-brand {
	margin: 0 0 1.5rem;
}

.nv-brand-rule {
	border-bottom: 3px solid currentColor;
	padding-bottom: 0.5rem;
}

.nv-brand-center {
	text-align: center;
}

.nv-brand-name {
	margin: 0;
	font-size: clamp(1.4rem, 4vw, 2.1rem);
	font-weight: 800;
	letter-spacing: -0.015em;
	line-height: 1.1;
}

.nv-brand-name a {
	color: inherit;
	text-decoration: none;
}

.nv-brand-tagline {
	margin: 0.3rem 0 0;
	font-size: 0.85rem;
	font-style: italic;
	color: var(--nv-news-muted, rgba(0, 0, 0, 0.55));
}

/* Byline: the writer's credit, with an honest mark on it. */
.nv-byline {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	margin: 0 0 1.4rem;
	padding: 0.7rem 0;
	border-top: 1px solid var(--nv-news-rule, rgba(0, 0, 0, 0.12));
	border-bottom: 1px solid var(--nv-news-rule, rgba(0, 0, 0, 0.12));
}

.nv-byline-avatar {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.nv-byline-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.nv-byline-monogram {
	color: #fff;
	font-weight: 700;
	font-size: 0.85rem;
	letter-spacing: 0.02em;
}

.nv-byline-text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.nv-byline-name {
	font-weight: 700;
	font-size: 0.95rem;
	display: flex;
	align-items: center;
	gap: 0.45rem;
}

.nv-byline-tag {
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.12rem 0.35rem;
	border: 1px solid currentColor;
	border-radius: 2px;
	opacity: 0.75;
	line-height: 1.4;
}

.nv-byline-tag-link {
	text-decoration: none;
	color: inherit;
}

.nv-byline-tag-link:hover .nv-byline-tag {
	opacity: 1;
}

.nv-byline-meta {
	font-size: 0.75rem;
	color: var(--nv-news-muted, rgba(0, 0, 0, 0.55));
}

/* List: optional thumbnail beside the text. */
.nv-news-list .nv-news-item {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
}

.nv-news-list .nv-news-thumb {
	flex: 0 0 140px;
}

.nv-news-list .nv-news-body {
	flex: 1 1 auto;
}

/* Grid: image-led cards. */
.nv-news-grid .nv-news-items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.5rem;
}

.nv-news-grid .nv-news-item {
	border-bottom: 0;
	padding: 0;
	margin: 0;
}

.nv-news-grid .nv-news-thumb {
	display: block;
	margin-bottom: 0.6rem;
}

/* Headlines: dense, no excerpts. */
.nv-news-headlines .nv-news-item {
	padding-bottom: 0.6rem;
	margin-bottom: 0.6rem;
}

.nv-news-headlines .nv-news-headline {
	font-size: 1rem;
}

/* Ticker: one line, scrollable on small screens. */
.nv-news-ticker-list {
	display: flex;
	gap: 1.6rem;
	list-style: none;
	margin: 0;
	padding: 0.6rem 0;
	overflow-x: auto;
	border-top: 1px solid var(--nv-news-rule);
	border-bottom: 1px solid var(--nv-news-rule);
	font-size: 0.85rem;
	white-space: nowrap;
	scrollbar-width: thin;
}

.nv-news-ticker-list li {
	margin: 0;
}

.nv-news-more {
	margin: 0.8rem 0 0;
	font-size: 0.85rem;
}

.nv-news img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Related stories */
.nv-related {
	margin: 2rem 0 0;
	padding: 1rem 0 0;
	border-top: 2px solid currentColor;
}

.nv-related-title {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	margin: 0 0 0.6rem;
}

.nv-related ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nv-related li {
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--nv-news-rule);
}

.nv-related li:last-child {
	border-bottom: 0;
}

/* Archive controls */
.nv-archive-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
	margin: 0 0 1.2rem;
	padding: 0.8rem 0;
	border-bottom: 1px solid var(--nv-news-rule);
}

.nv-archive-field {
	display: inline-flex;
}

.nv-archive-controls input[type="search"],
.nv-archive-controls select {
	font: inherit;
	font-size: 0.9rem;
	padding: 0.4rem 0.6rem;
	border: 1px solid var(--nv-news-rule);
	border-radius: 3px;
	background: transparent;
	color: inherit;
	max-width: 100%;
}

.nv-archive-search input {
	min-width: 220px;
}

.nv-archive-submit {
	font: inherit;
	font-size: 0.85rem;
	padding: 0.45rem 1rem;
	border: 1px solid currentColor;
	border-radius: 3px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.nv-archive-submit:hover {
	background: currentColor;
}

.nv-archive-reset {
	font-size: 0.8rem;
	opacity: 0.7;
}

.nv-archive-count {
	font-size: 0.85rem;
	color: var(--nv-news-muted);
	margin: 0 0 1rem;
}

.nv-archive-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 1.6rem;
	padding-top: 1rem;
	border-top: 1px solid var(--nv-news-rule);
	font-size: 0.9rem;
}

.nv-archive-pagination .page-numbers {
	padding: 0.35rem 0.7rem;
	border: 1px solid var(--nv-news-rule);
	border-radius: 3px;
	text-decoration: none;
	color: inherit;
}

.nv-archive-pagination .page-numbers.current {
	background: currentColor;
	border-color: currentColor;
}

.nv-archive-pagination .page-numbers.current::after {
	content: "";
}

/* Timed message */
.nv-popup {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.2rem;
}

.nv-popup[hidden] {
	display: none;
}

.nv-popup-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 14, 20, 0.55);
}

.nv-popup-panel {
	position: relative;
	background: #fff;
	color: #101820;
	max-width: 420px;
	width: 100%;
	padding: 1.8rem 1.6rem 1.4rem;
	border-radius: 4px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	text-align: center;
	animation: nv-popup-in 0.18s ease-out;
}

@keyframes nv-popup-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nv-popup-panel {
		animation: none;
	}
}

.nv-popup-close {
	position: absolute;
	top: 0.4rem;
	right: 0.6rem;
	background: none;
	border: 0;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	opacity: 0.5;
	padding: 0.2rem 0.4rem;
}

.nv-popup-close:hover,
.nv-popup-close:focus-visible {
	opacity: 1;
}

.nv-popup-title {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
	line-height: 1.25;
}

.nv-popup-message {
	font-size: 0.95rem;
	line-height: 1.5;
}

.nv-popup-message p {
	margin: 0 0 0.6rem;
}

.nv-popup-actions {
	margin: 1rem 0 0.4rem;
}

.nv-popup-button {
	display: inline-block;
	padding: 0.6rem 1.6rem;
	background: #101820;
	color: #fff;
	text-decoration: none;
	border-radius: 3px;
	font-weight: 600;
}

.nv-popup-form {
	margin-top: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	text-align: left;
}

.nv-popup-form input[type="email"] {
	font: inherit;
	font-size: 0.95rem;
	padding: 0.65rem 0.8rem;
	border: 1px solid #c9ced6;
	border-radius: 3px;
	width: 100%;
	box-sizing: border-box;
}

.nv-popup-form input[type="email"]:focus {
	outline: 2px solid #101820;
	outline-offset: 1px;
}

.nv-popup-consent {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
	font-size: 0.75rem;
	line-height: 1.4;
	color: #4a5561;
}

.nv-popup-consent input {
	margin-top: 0.15rem;
	flex: 0 0 auto;
}

.nv-popup-form .nv-popup-button {
	border: 0;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	width: 100%;
	padding: 0.7rem 1rem;
}

.nv-popup-form .nv-popup-button:disabled {
	opacity: 0.6;
	cursor: default;
}

.nv-popup-done {
	margin: 0.4rem 0 1rem;
	font-size: 0.95rem;
	line-height: 1.55;
	text-align: center;
	color: #1d7a4c;
}

.nv-popup-status {
	margin: 0;
	font-size: 0.8rem;
	min-height: 1.1em;
	text-align: center;
	color: #4a5561;
}

.nv-popup-status.is-good {
	color: #1d7a4c;
}

.nv-popup-status.is-bad {
	color: #b32d2e;
}

.nv-popup-dismiss {
	display: block;
	margin: 0.4rem auto 0;
	background: none;
	border: 0;
	font: inherit;
	font-size: 0.8rem;
	text-decoration: underline;
	opacity: 0.6;
	cursor: pointer;
	color: inherit;
}

.nv-popup-dismiss:hover {
	opacity: 1;
}

@media (max-width: 600px) {
	.nv-archive-search input {
		min-width: 0;
		width: 100%;
	}

	.nv-archive-field,
	.nv-archive-search {
		flex: 1 1 100%;
	}

	.nv-news-list .nv-news-item {
		display: block;
	}

	.nv-news-list .nv-news-thumb {
		margin-bottom: 0.6rem;
	}
}
