/*
Theme Name: Newsbites
Theme URI: https://newsbites.media
Author: Zarroboogsfound
Author URI: https://zarroboogsfound.com
Description: Marketing shell for Newsbites, the pitch to TV stations. Dark, condensed-type front page with an auto-advancing hero of any length and sections driven by ordinary WordPress pages.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: newsbites
Tags: one-column, custom-logo, custom-menu, editor-style, featured-images, full-width-template, translation-ready
*/

/* ---------------------------------------------------------------------------
   Tokens. Every value here is taken from the source design rather than
   re-picked: #2fa34f is the accent that borders the Contact button and tops
   the caption panel, #4cc46e is the nav hover (brighter, because nav sits on
   black with no border to carry it), #e8a531 is the progress bar.
   --------------------------------------------------------------------------- */
:root {
	--nb-bg: #000000;
	--nb-fg: #ffffff;
	--nb-stage: #0b0b0b;
	--nb-panel: #111111;
	--nb-rule: #4a4a4a;
	--nb-track: #2a2a2a;
	--nb-muted: #b8b8b8;
	--nb-link: #c9c9c9;
	--nb-accent: #2fa34f;
	--nb-accent-bright: #4cc46e;
	--nb-progress: #e8a531;

	--nb-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
	--nb-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

	--nb-shell: 1440px;
	--nb-hero: 1098px;
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--nb-bg);
	color: var(--nb-fg);
	font-family: var(--nb-body);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--nb-link);
}

a:hover,
a:focus {
	color: var(--nb-fg);
}

img {
	max-width: 100%;
	height: auto;
}

/* Visible focus everywhere. The design has none, and a black page with no
   focus ring is unusable from the keyboard. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--nb-accent-bright);
	outline-offset: 3px;
}

.nb-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 12px 20px;
	background: var(--nb-panel);
	color: var(--nb-fg);
	font-family: var(--nb-display);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
}

.nb-skip:focus {
	left: 8px;
	top: 8px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */
.nb-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	max-width: var(--nb-shell);
	margin: 0 auto;
	padding: 24px 32px 30px;
}

.nb-header__kicker {
	flex: 1 1 160px;
	font-family: var(--nb-display);
	font-size: 19px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--nb-fg);
}

.nb-header__brand {
	flex: 0 0 auto;
	display: block;
	line-height: 0;
	color: var(--nb-fg);
	text-decoration: none;
}

.nb-header__brand img {
	height: 130px;
	width: auto;
	max-width: 100%;
	display: block;
}

/* Wordmark fallback when no logo is set, so the header is never headless. */
.nb-header__wordmark {
	font-family: var(--nb-display);
	font-size: 54px;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1;
	text-transform: uppercase;
}

.nb-header__actions {
	flex: 1 1 160px;
	display: flex;
	justify-content: flex-end;
}

.nb-btn {
	display: inline-flex;
	align-items: center;
	min-height: 54px;
	padding: 0 25px;
	border: 1px solid var(--nb-accent);
	border-radius: 2px;
	color: var(--nb-fg);
	text-decoration: none;
	font-family: var(--nb-display);
	font-size: 19px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	background: transparent;
	transition: background-color 200ms ease, border-color 200ms ease;
}

.nb-btn:hover,
.nb-btn:focus {
	background: var(--nb-accent);
	border-color: var(--nb-accent);
	color: var(--nb-fg);
}

/* ---------------------------------------------------------------------------
   Nav
   --------------------------------------------------------------------------- */
.nb-nav {
	border-top: 1px solid var(--nb-rule);
	border-bottom: 1px solid var(--nb-rule);
}

.nb-nav__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 48px;
	max-width: var(--nb-shell);
	margin: 0 auto;
	padding: 0 24px;
}

.nb-nav ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 48px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nb-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 52px;
	font-family: var(--nb-display);
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--nb-fg);
	text-decoration: none;
}

.nb-nav a:hover,
.nb-nav a:focus {
	color: var(--nb-accent-bright);
}

.nb-nav .current-menu-item > a,
.nb-nav .current_page_item > a {
	color: var(--nb-accent-bright);
}

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */
.nb-hero {
	max-width: 100%;
	width: var(--nb-hero);
	margin: 90px auto 0;
}

.nb-hero__stage {
	position: relative;
	width: 100%;
	aspect-ratio: 2 / 1;
	min-height: 252px;
	overflow: hidden;
	background: var(--nb-stage);
}

.nb-hero__slide {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 900ms ease;
}

/* Slides whose source is 3:2 rather than 2:1 are letterboxed instead of
   cropped -- the design makes the same distinction, because cropping them
   cuts the screenshot content they exist to show. */
.nb-hero__slide--contain {
	object-fit: contain;
}

.nb-hero__slide.is-on {
	opacity: 1;
}

.nb-hero__panel {
	margin: 60px auto 0;
	width: min(var(--nb-panel-w, 277px), calc(100% - 48px));
	background: var(--nb-panel);
	border-top: 3px solid var(--nb-accent);
	padding: 14px 17px 15px;
	display: flex;
	flex-direction: column;
	gap: 7px;
	transition: width 400ms ease;
}

.nb-hero__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-family: var(--nb-display);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--nb-muted);
}

.nb-hero__word {
	font-family: var(--nb-display);
	font-size: clamp(40px, 4.6vw, 65px);
	font-weight: 800;
	line-height: 0.9;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--nb-fg);
	text-align: center;
}

.nb-hero__track {
	height: 3px;
	background: var(--nb-track);
	width: 100%;
}

.nb-hero__bar {
	height: 3px;
	width: 0;
	background: var(--nb-progress);
}

/* ---------------------------------------------------------------------------
   Content sections and ordinary pages
   --------------------------------------------------------------------------- */
.nb-section {
	max-width: var(--nb-hero);
	margin: 0 auto;
	padding: 90px 24px 0;
}

.nb-section:last-of-type {
	padding-bottom: 90px;
}

.nb-section__title,
.nb-page__title {
	font-family: var(--nb-display);
	font-size: clamp(32px, 3.4vw, 48px);
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	margin: 0 0 24px;
	padding-bottom: 14px;
	border-bottom: 3px solid var(--nb-accent);
}

.nb-section__body > :first-child,
.nb-entry > :first-child {
	margin-top: 0;
}

.nb-entry h2,
.nb-entry h3,
.nb-entry h4,
.nb-section__body h2,
.nb-section__body h3,
.nb-section__body h4 {
	font-family: var(--nb-display);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.1;
}

.nb-entry a,
.nb-section__body a {
	color: var(--nb-accent-bright);
}

.nb-entry blockquote,
.nb-section__body blockquote {
	margin: 24px 0;
	padding: 4px 0 4px 20px;
	border-left: 3px solid var(--nb-accent);
	color: var(--nb-muted);
}

/* The section heading links to the page behind it but still reads as a
   heading: an underline would fight the accent rule directly beneath it. */
.nb-section__title a {
	color: inherit;
	text-decoration: none;
}

.nb-section__title a:hover,
.nb-section__title a:focus {
	color: var(--nb-accent-bright);
}

.nb-section__more {
	margin: 24px 0 0;
}

/* Smaller than the header's Contact button. There is one of these per section,
   and several full-size buttons down the page read as a toolbar rather than as
   a way onward. */
.nb-btn--ghost {
	min-height: 44px;
	padding: 0 18px;
	font-size: 16px;
	letter-spacing: 0.1em;
	border-color: var(--nb-rule);
}

.nb-btn--ghost:hover,
.nb-btn--ghost:focus {
	border-color: var(--nb-accent);
}

/* Shown only to users who can edit, so an unfilled section tells its author
   what to do without showing scaffolding to the public. */
.nb-section__hint {
	margin: 0;
	padding: 18px 20px;
	background: var(--nb-panel);
	border-left: 3px solid var(--nb-progress);
	color: var(--nb-muted);
	font-size: 15px;
}

.nb-section__hint code {
	color: var(--nb-fg);
}

.nb-main {
	max-width: var(--nb-hero);
	margin: 0 auto;
	padding: 60px 24px 90px;
}

.nb-list__item {
	padding: 0 0 36px;
	margin: 0 0 36px;
	border-bottom: 1px solid var(--nb-rule);
}

.nb-list__item:last-child {
	border-bottom: 0;
}

.nb-list__title {
	font-family: var(--nb-display);
	font-size: clamp(26px, 2.6vw, 36px);
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	line-height: 1.05;
	margin: 0 0 10px;
}

.nb-list__title a {
	color: var(--nb-fg);
	text-decoration: none;
}

.nb-list__title a:hover {
	color: var(--nb-accent-bright);
}

.nb-meta {
	font-size: 14px;
	color: var(--nb-muted);
}

.nb-pagination {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	padding-top: 24px;
	font-family: var(--nb-display);
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.nb-footer {
	border-top: 1px solid var(--nb-rule);
	margin-top: 90px;
}

.nb-footer__inner {
	max-width: var(--nb-shell);
	margin: 0 auto;
	padding: 36px 32px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	font-size: 14px;
	color: var(--nb-muted);
}

.nb-footer__nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nb-footer__nav a {
	font-family: var(--nb-display);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Narrow screens. The design is 1440-wide with wrapping flex rows, so the
   shell already reflows; these only tighten what would otherwise overflow or
   waste the whole viewport on the logo.
   --------------------------------------------------------------------------- */
@media (max-width: 860px) {
	.nb-header {
		padding: 18px 16px 22px;
		justify-content: center;
		text-align: center;
	}

	.nb-header__kicker,
	.nb-header__actions {
		flex: 1 1 100%;
		justify-content: center;
	}

	.nb-header__brand img {
		height: 92px;
	}

	.nb-header__wordmark {
		font-size: 38px;
	}

	.nb-nav__inner,
	.nb-nav ul {
		gap: 0 28px;
	}

	.nb-nav a {
		min-height: 46px;
		font-size: 15px;
		letter-spacing: 0.16em;
	}

	.nb-hero {
		margin-top: 48px;
	}

	.nb-hero__panel {
		margin-top: 32px;
		width: calc(100% - 32px);
	}

	.nb-section,
	.nb-main {
		padding-left: 16px;
		padding-right: 16px;
		padding-top: 56px;
	}

	.nb-footer__inner {
		padding: 28px 16px;
		justify-content: center;
		text-align: center;
	}
}

/* Someone who asked not to be animated gets the first step, held still. */
@media (prefers-reduced-motion: reduce) {
	.nb-hero__slide,
	.nb-hero__panel,
	.nb-btn {
		transition: none;
	}
}
