/*
Theme Name: Signal News
Theme URI: https://example.com/signal-news
Author: Custom build
Description: A multi-vertical news theme built for publishers running several sites from one codebase. Site name, accent colour and category colours are all set in the Customizer, so the same theme reads as a different publication on every domain.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: signal
Tags: news, magazine, blog, custom-colors, custom-logo, custom-menu, featured-images, right-sidebar, translation-ready
*/

/* ---------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------- */

:root {
	--void: #101216;
	--surface: #ffffff;
	--wash: #eff1f4;
	--wash-deep: #e3e7ec;
	--rule: #d5d9df;
	--ink: #101216;
	--ink-soft: #5a626e;

	/* Overridden per site from the Customizer. */
	--brand: #1f4fd8;
	--brand-ink: #ffffff;

	--font-display: "Archivo", "Helvetica Neue", "Hiragino Kaku Gothic ProN",
		"Yu Gothic", "Noto Sans JP", sans-serif;
	--font-text: "Source Serif 4", Georgia, "Hiragino Mincho ProN",
		"Yu Mincho", "Noto Serif JP", serif;

	--step--1: 0.8125rem;
	--step-0: 1rem;
	--step-1: 1.1875rem;
	--step-2: 1.4375rem;
	--step-3: 1.75rem;
	--step-4: 2.125rem;
	--step-5: clamp(2.25rem, 1.4rem + 3.6vw, 3.5rem);

	--gap: 1.5rem;
	--gap-lg: 2.5rem;
	--shell: 1220px;
}

/* ---------------------------------------------------------------
   2. Reset & base
   --------------------------------------------------------------- */

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

body {
	margin: 0;
	background: var(--surface);
	color: var(--ink);
	font-family: var(--font-text);
	font-size: var(--step-0);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img,
video,
iframe {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

:focus-visible {
	outline: 3px solid var(--brand);
	outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.018em;
	margin: 0;
	text-wrap: balance;
}

p {
	margin: 0 0 1.1em;
}

.shell {
	width: min(100% - 2.5rem, var(--shell));
	margin-inline: auto;
}

.skip-link {
	position: absolute;
	left: -9999px;
	background: var(--void);
	color: #fff;
	padding: 0.75rem 1.25rem;
	z-index: 999;
}

.skip-link:focus {
	left: 1rem;
	top: 1rem;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---------------------------------------------------------------
   3. Masthead
   --------------------------------------------------------------- */

.masthead {
	background: var(--void);
	color: #fff;
}

.masthead a {
	color: inherit;
}

.masthead__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--gap);
	padding: 1.35rem 0;
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	min-width: 0;
}

.brand__mark {
	width: 0.55rem;
	align-self: stretch;
	min-height: 2.2rem;
	background: var(--brand);
	flex: none;
}

.brand__name {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: var(--step-3);
	font-stretch: 112%;
	letter-spacing: -0.03em;
	line-height: 1;
	margin: 0;
}

.brand__name a:hover {
	text-decoration: none;
}

.brand__tagline {
	font-family: var(--font-display);
	font-size: var(--step--1);
	font-weight: 400;
	color: #9aa3b1;
	margin: 0.3rem 0 0;
	line-height: 1.3;
}

.brand__logo img {
	max-height: 52px;
	width: auto;
}

.masthead__side {
	display: flex;
	align-items: center;
	gap: 1.1rem;
	font-family: var(--font-display);
	font-size: var(--step--1);
	color: #9aa3b1;
	flex: none;
}

.masthead__date {
	white-space: nowrap;
}

.icon-btn {
	background: none;
	border: 1px solid #333944;
	color: #fff;
	width: 2.4rem;
	height: 2.4rem;
	display: grid;
	place-items: center;
	cursor: pointer;
	padding: 0;
}

.icon-btn:hover {
	border-color: var(--brand);
	background: var(--brand);
}

.icon-btn svg {
	width: 1.05rem;
	height: 1.05rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

.nav-toggle {
	display: none;
}

/* Category strip */

.catstrip {
	background: var(--void);
	border-top: 1px solid #262b33;
}

.catstrip__list {
	display: flex;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}

.catstrip__list::-webkit-scrollbar {
	display: none;
}

.catstrip__list > li > a {
	display: block;
	padding: 0.85rem 1.15rem;
	font-family: var(--font-display);
	font-size: 0.9rem;
	font-weight: 600;
	color: #c6ccd6;
	white-space: nowrap;
	border-bottom: 3px solid transparent;
}

.catstrip__list > li > a:hover,
.catstrip__list > li.current-menu-item > a {
	color: #fff;
	border-bottom-color: var(--brand);
	text-decoration: none;
}

.catstrip__list > li:first-child > a {
	padding-left: 0;
}

/* Sub menus */

.catstrip__list li {
	position: relative;
}

.catstrip__list .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	background: #1a1e25;
	list-style: none;
	margin: 0;
	padding: 0.4rem 0;
	min-width: 200px;
	display: none;
	z-index: 60;
}

.catstrip__list li:hover > .sub-menu,
.catstrip__list li:focus-within > .sub-menu {
	display: block;
}

.catstrip__list .sub-menu a {
	display: block;
	padding: 0.5rem 1.1rem;
	font-family: var(--font-display);
	font-size: 0.9rem;
	color: #c6ccd6;
}

.catstrip__list .sub-menu a:hover {
	background: var(--brand);
	color: #fff;
	text-decoration: none;
}

/* Search drawer */

.searchdrawer {
	background: var(--wash);
	border-bottom: 1px solid var(--rule);
	display: none;
}

.searchdrawer.is-open {
	display: block;
}

.searchdrawer form {
	display: flex;
	gap: 0.6rem;
	padding: 1.15rem 0;
}

/* ---------------------------------------------------------------
   4. Forms & buttons
   --------------------------------------------------------------- */

input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
textarea {
	width: 100%;
	font: inherit;
	font-family: var(--font-display);
	font-size: var(--step-0);
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--rule);
	background: #fff;
	color: var(--ink);
	border-radius: 0;
}

input:focus,
textarea:focus {
	border-color: var(--brand);
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

.btn,
button[type="submit"],
input[type="submit"] {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: var(--step-0);
	background: var(--brand);
	color: var(--brand-ink);
	border: 0;
	padding: 0.72rem 1.4rem;
	cursor: pointer;
	border-radius: 0;
}

.btn:hover,
button[type="submit"]:hover {
	filter: brightness(0.9);
	text-decoration: none;
}

/* ---------------------------------------------------------------
   5. Article meta & kicker
   --------------------------------------------------------------- */

.kicker {
	font-family: var(--font-display);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--brand);
	display: inline-block;
	margin-bottom: 0.5rem;
}

.kicker a:hover {
	text-decoration: none;
	border-bottom: 2px solid currentColor;
}

.meta {
	font-family: var(--font-display);
	font-size: var(--step--1);
	color: var(--ink-soft);
	line-height: 1.4;
}

.meta span + span::before {
	content: " / ";
	color: var(--rule);
}

/* ---------------------------------------------------------------
   6. Home: anchor block
   --------------------------------------------------------------- */

.anchor {
	display: grid;
	grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
	gap: var(--gap-lg);
	padding: var(--gap-lg) 0;
	align-items: start;
}

.lead__media {
	position: relative;
	margin-bottom: 1.1rem;
	background: var(--wash-deep);
}

.lead__media img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 4px;
}

.lead__title {
	font-size: var(--step-5);
	font-stretch: 105%;
	margin-bottom: 0.6rem;
}

.lead__standfirst {
	font-size: var(--step-1);
	color: #33383f;
	max-width: 62ch;
	margin-bottom: 0.7rem;
}

/* Secondary stack */

.stack {
	border-top: 3px solid var(--ink);
	padding-top: 0.9rem;
}

.stack__heading {
	font-size: var(--step-1);
	margin-bottom: 1rem;
}

.stack__item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 84px;
	gap: 0.9rem;
	padding: 0.95rem 0;
	border-bottom: 1px solid var(--rule);
	align-items: start;
}

.stack__item:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.stack__item img {
	width: 84px;
	height: 64px;
	object-fit: cover;
	border-radius: 4px;
}

.stack__title {
	font-size: var(--step-0);
	font-weight: 600;
	line-height: 1.25;
	margin-bottom: 0.3rem;
}

/* ---------------------------------------------------------------
   7. Section headings & card grid
   --------------------------------------------------------------- */

.section {
	padding: var(--gap-lg) 0;
	border-top: 1px solid var(--rule);
}

.section--wash {
	background: var(--wash);
	border-top: 0;
}

.section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--gap);
	margin-bottom: 1.6rem;
}

.section__title {
	font-size: var(--step-3);
	position: relative;
	padding-bottom: 0.5rem;
}

.section__title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 3.5rem;
	height: 4px;
	background: var(--brand);
}

.section__more {
	font-family: var(--font-display);
	font-size: var(--step--1);
	font-weight: 600;
	color: var(--brand);
	flex: none;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
	gap: var(--gap-lg) var(--gap);
}

.card__media {
	margin-bottom: 0.85rem;
	background: var(--wash-deep);
	border-radius: 4px;
	overflow: hidden;
}

.card__media img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.card__title {
	font-size: var(--step-1);
	margin-bottom: 0.45rem;
}

.card__excerpt {
	font-size: 0.95rem;
	color: #43494f;
	margin-bottom: 0.5rem;
}

/* ---------------------------------------------------------------
   8. Single post & pages
   --------------------------------------------------------------- */

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: var(--gap-lg);
	padding: var(--gap-lg) 0 3.5rem;
	align-items: start;
}

.layout--wide {
	grid-template-columns: minmax(0, 1fr);
}

.breadcrumb {
	font-family: var(--font-display);
	font-size: var(--step--1);
	color: var(--ink-soft);
	padding-top: 1.4rem;
}

.breadcrumb span + span::before {
	content: " › ";
}

.entry__header {
	margin-bottom: 1.5rem;
}

.entry__title {
	font-size: var(--step-5);
	font-stretch: 105%;
	margin-bottom: 0.7rem;
}

.entry__standfirst {
	font-family: var(--font-text);
	font-size: var(--step-1);
	color: #33383f;
	max-width: 66ch;
	margin-bottom: 0.9rem;
}

.entry__byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.7rem;
	padding: 0.85rem 0;
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
}

.entry__byline img {
	width: 34px;
	height: 34px;
	border-radius: 50%;
}

.entry__media {
	margin: 1.5rem 0;
}

.entry__media img {
	width: 100%;
	border-radius: 4px;
}

.entry__media figcaption,
.wp-caption-text {
	font-family: var(--font-display);
	font-size: var(--step--1);
	color: var(--ink-soft);
	padding-top: 0.5rem;
}

.entry__content {
	max-width: 68ch;
	font-size: 1.0625rem;
	line-height: 1.75;
}

.entry__content h2 {
	font-size: var(--step-3);
	margin: 2rem 0 0.75rem;
}

.entry__content h3 {
	font-size: var(--step-2);
	margin: 1.7rem 0 0.6rem;
}

.entry__content a {
	color: var(--brand);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.entry__content ul,
.entry__content ol {
	padding-left: 1.3rem;
	margin: 0 0 1.2em;
}

.entry__content li {
	margin-bottom: 0.4em;
}

.entry__content blockquote {
	margin: 1.8rem 0;
	padding: 0.2rem 0 0.2rem 1.4rem;
	border-left: 4px solid var(--brand);
	font-size: var(--step-2);
	line-height: 1.4;
	color: #23272d;
}

.entry__content blockquote p:last-child {
	margin-bottom: 0;
}

.entry__content img {
	border-radius: 4px;
}

.entry__content figure {
	margin: 1.6rem 0;
}

.entry__content table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--font-display);
	font-size: 0.95rem;
	margin-bottom: 1.4rem;
}

.entry__content th,
.entry__content td {
	border: 1px solid var(--rule);
	padding: 0.6rem 0.75rem;
	text-align: left;
}

.entry__content th {
	background: var(--wash);
}

.entry__content code {
	background: var(--wash);
	padding: 0.1em 0.35em;
	font-size: 0.9em;
}

.entry__content pre {
	background: var(--void);
	color: #e6e9ee;
	padding: 1rem;
	overflow-x: auto;
	font-size: 0.9rem;
}

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin: 2rem 0;
}

.tags a {
	font-family: var(--font-display);
	font-size: var(--step--1);
	padding: 0.35rem 0.7rem;
	background: var(--wash);
	border: 1px solid var(--rule);
	color: var(--ink-soft);
}

.tags a:hover {
	background: var(--brand);
	border-color: var(--brand);
	color: var(--brand-ink);
	text-decoration: none;
}

.postnav {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: var(--gap);
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
	padding: 1.4rem 0;
	margin-bottom: 2.5rem;
}

.postnav__label {
	font-family: var(--font-display);
	font-size: var(--step--1);
	color: var(--ink-soft);
	margin-bottom: 0.3rem;
}

.postnav__title {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.3;
}

/* ---------------------------------------------------------------
   9. Sidebar & widgets
   --------------------------------------------------------------- */

.sidebar {
	position: sticky;
	top: 1.5rem;
}

.widget {
	margin-bottom: 2rem;
	font-family: var(--font-display);
	font-size: 0.95rem;
}

.widget-title {
	font-size: var(--step-1);
	padding-bottom: 0.5rem;
	margin-bottom: 1rem;
	border-bottom: 3px solid var(--ink);
}

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

.widget li {
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--rule);
}

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

/* ---------------------------------------------------------------
   10. Pagination
   --------------------------------------------------------------- */

.pagination {
	display: flex;
	justify-content: center;
	padding: 2rem 0 3rem;
}

.pagination .page-numbers {
	font-family: var(--font-display);
	font-weight: 600;
	padding: 0.55rem 0.95rem;
	border: 1px solid var(--rule);
	margin: 0 0.15rem;
}

.pagination .current,
.pagination .page-numbers:hover {
	background: var(--brand);
	border-color: var(--brand);
	color: var(--brand-ink);
	text-decoration: none;
}

/* ---------------------------------------------------------------
   11. Comments
   --------------------------------------------------------------- */

.comments {
	max-width: 68ch;
	margin-bottom: 3rem;
}

.comment-list {
	list-style: none;
	padding: 0;
	margin: 0 0 2rem;
}

.comment-list ol.children {
	list-style: none;
	padding-left: 1.5rem;
}

.comment-body {
	padding: 1.1rem 0;
	border-bottom: 1px solid var(--rule);
}

.comment-author img {
	border-radius: 50%;
	margin-right: 0.5rem;
	vertical-align: middle;
}

.comment-meta,
.comment-author {
	font-family: var(--font-display);
	font-size: var(--step--1);
	color: var(--ink-soft);
}

/* ---------------------------------------------------------------
   12. Footer
   --------------------------------------------------------------- */

.footer {
	background: var(--void);
	color: #b7bec9;
	font-family: var(--font-display);
	font-size: 0.95rem;
	margin-top: auto;
}

.footer a {
	color: #e4e8ee;
}

.footer__cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--gap-lg);
	padding: 3rem 0 2rem;
}

.footer .widget-title {
	color: #fff;
	border-bottom-color: var(--brand);
	font-size: var(--step-0);
}

.footer .widget li {
	border-bottom-color: #262b33;
}

.footer__base {
	border-top: 1px solid #262b33;
	padding: 1.25rem 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	font-size: var(--step--1);
	color: #8b939f;
}

.footer__menu {
	display: flex;
	flex-wrap: wrap;
	gap: 1.1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ---------------------------------------------------------------
   13. 404 / empty states
   --------------------------------------------------------------- */

.notice {
	padding: 4rem 0 5rem;
	max-width: 60ch;
}

.notice h1 {
	font-size: var(--step-5);
	margin-bottom: 0.8rem;
}

/* ---------------------------------------------------------------
   14. Archive header
   --------------------------------------------------------------- */

.archive-head {
	padding: 2.2rem 0 1.6rem;
	border-bottom: 3px solid var(--ink);
	margin-bottom: var(--gap-lg);
}

.archive-head h1 {
	font-size: var(--step-4);
}

.archive-head p {
	margin: 0.6rem 0 0;
	color: var(--ink-soft);
	max-width: 60ch;
}

/* ---------------------------------------------------------------
   15. Responsive
   --------------------------------------------------------------- */

@media (max-width: 980px) {
	.anchor,
	.layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.sidebar {
		position: static;
	}
}

@media (max-width: 720px) {
	:root {
		--gap-lg: 1.75rem;
	}

	.masthead__date {
		display: none;
	}

	.nav-toggle {
		display: grid;
	}

	.catstrip {
		display: none;
	}

	.catstrip.is-open {
		display: block;
	}

	.catstrip__list {
		flex-direction: column;
		overflow: visible;
	}

	.catstrip__list > li > a {
		padding-left: 0;
		border-bottom: 1px solid #262b33;
	}

	.catstrip__list .sub-menu {
		position: static;
		display: block;
		background: none;
		padding-left: 1rem;
	}

	.stack__item {
		grid-template-columns: minmax(0, 1fr) 96px;
	}

	.masthead__bar {
		padding: 1rem 0;
	}

	.brand__name {
		font-size: var(--step-2);
	}

	.brand__tagline {
		font-size: 0.75rem;
		max-width: 22ch;
	}

	.masthead__side {
		gap: 0.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* WordPress core alignment classes */

.alignleft {
	float: left;
	margin: 0.4rem 1.4rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0.4rem 0 1rem 1.4rem;
}

.aligncenter {
	margin-inline: auto;
}

.alignwide {
	width: min(100vw - 2.5rem, 1000px);
	max-width: none;
	margin-inline: auto;
}

.sticky .card__title::before {
	content: "★ ";
	color: var(--brand);
}
