/* ==========================================================================
   Overall Signals theme
   Tokens: drafting-paper ground, green-black ink, cobalt for data and links.
   Type: Schibsted Grotesk for interface and numbers, Newsreader for reading.
   ========================================================================== */

:root {
	--paper: #ffffff;
	--panel: #f6f7f5;
	--ink: #17211e;
	--muted: #5b6661;
	--rule: #e1e4e0;
	--accent: #2340d8;
	--up: #1d7a50;
	--down: #b23a2b;

	--sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

	--gutter: clamp(1.25rem, 4vw, 2.5rem);
	--max: 77.5rem;
	--text: 42rem;
	--radius: 3px;

	color-scheme: light;
}

/* Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1rem;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img, svg, video, iframe { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 1px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--sans); line-height: 1.15; letter-spacing: -0.015em; font-weight: 650; margin: 0 0 0.5em; text-wrap: balance; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-text { width: 100%; max-width: calc(var(--text) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto; margin: 0;
	position: fixed !important; top: 0.75rem; left: 0.75rem; z-index: 1000;
	padding: 0.75rem 1rem; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600;
}
.site-main:focus { outline: none; }

/* Header ---------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.25rem; }
.site-title { font-family: var(--sans) !important; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.3125rem; letter-spacing: -0.03em; }
.custom-logo { display: block; max-height: 2.5rem; width: auto; }
.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.75rem; }
.site-nav .menu a { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav .menu a:hover, .site-nav .current-menu-item > a { text-decoration: underline; text-underline-offset: 0.35em; }
.site-nav .sub-menu { list-style: none; margin: 0; padding: 0; }
.menu-item-has-children { position: relative; }
@media (min-width: 900px) {
	.site-nav .sub-menu {
		position: absolute; top: 100%; left: -1rem; min-width: 13rem; z-index: 20;
		padding: 0.5rem 1rem; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius);
		visibility: hidden; opacity: 0;
	}
	.site-nav .menu-item-has-children:hover > .sub-menu,
	.site-nav .menu-item-has-children:focus-within > .sub-menu { visibility: visible; opacity: 1; }
	.site-nav .sub-menu a { display: block; padding: 0.4rem 0; }
}
.site-nav .search-form { width: 15rem; }

.nav-toggle { display: none; }

@media (max-width: 899px) {
	.nav-toggle {
		display: inline-flex; align-items: center; gap: 0.6rem;
		background: none; border: 1px solid var(--rule); border-radius: var(--radius);
		color: var(--ink); font: 500 0.9375rem var(--sans); padding: 0.5rem 0.8rem; cursor: pointer;
	}
	.nav-toggle-bars, .nav-toggle-bars::before { display: block; width: 1rem; height: 2px; background: currentColor; position: relative; }
	.nav-toggle-bars::before { content: ""; position: absolute; top: 5px; }
	.nav-toggle-bars { top: -2.5px; }
	.site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 4.25rem; z-index: 30;
		flex-direction: column; align-items: stretch; gap: 1.25rem;
		padding: 1.25rem var(--gutter) 1.75rem; background: var(--paper); border-bottom: 1px solid var(--rule);
	}
	.site-header { position: relative; }
	.site-header.is-open .site-nav { display: flex; }
	.site-nav .menu { flex-direction: column; gap: 0.25rem; }
	.site-nav .menu a { display: block; padding: 0.5rem 0; font-size: 1.125rem; }
	.site-nav .sub-menu { padding-left: 1rem; }
	.site-nav .search-form { width: 100%; }
}

/* Forms ----------------------------------------------------------------- */
.search-form { display: flex; gap: 0.5rem; }
input[type="search"], input[type="text"], input[type="email"], input[type="url"], textarea {
	width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
	background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius);
	padding: 0.55rem 0.75rem;
}
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
button, .button, input[type="submit"] {
	font: 600 0.9375rem var(--sans); color: var(--paper); background: var(--ink);
	border: 0; border-radius: var(--radius); padding: 0.6rem 1rem; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .button:hover, input[type="submit"]:hover { background: var(--accent); color: #fff; }
.site-nav .search-submit { flex: none; }

/* Plugin widgets, themed --------------------------------------------- */
body .ovs {
	--ovs-font: var(--sans);
	--ovs-muted: var(--muted);
	--ovs-rule: var(--rule);
	--ovs-track: color-mix(in srgb, var(--ink) 9%, transparent);
	--ovs-bar: var(--accent);
	--ovs-new: var(--accent);
	--ovs-up: var(--up);
	--ovs-down: var(--down);
	--ovs-urgent: var(--down);
	--ovs-live: var(--up);
	margin-block: 0;
}

/* Front page ---------------------------------------------------------- */
.board-hero { padding-block: clamp(3rem, 9vw, 7.5rem) clamp(2.5rem, 5vw, 4rem); }
.board-hero .ovs-lead { margin: 0; gap: 1.25rem; }
/* Locked down: other plugins' global styles must not change the headline. */
.board-hero .ovs .ovs-lead-statement {
	display: block !important;
	position: static !important;
	height: auto !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	font-family: var(--sans) !important;
	font-size: 3.5rem !important;
	font-size: clamp(2.6rem, 1rem + 5.6vw, 6.25rem) !important;
	font-weight: 680 !important;
	line-height: 1.04 !important;
	letter-spacing: -0.04em !important;
	color: var(--ink) !important;
	white-space: normal !important;
	max-width: 15ch;
}
.board-hero .ovs .ovs-lead-sub,
.board-hero .ovs .ovs-status { position: static !important; height: auto !important; line-height: 1.45 !important; }
.board-hero .ovs .ovs-lead { display: grid !important; gap: 1.25rem; }
.board-hero .ovs-lead-sub { font-family: var(--serif); font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem); color: var(--muted); max-width: 40ch; }
.hero-fallback { font-size: clamp(2.2rem, 1rem + 4vw, 4.5rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 650; max-width: 18ch; }
.admin-hint { font-size: 0.9375rem; color: var(--muted); border-left: 3px solid var(--accent); padding-left: 0.75rem; }

.board-movers { background: var(--panel); border-block: 1px solid var(--rule); padding-block: 1.5rem; }
.board-movers .ovs-movers { margin: 0; grid-template-columns: 1fr 1fr; gap: 1rem 3rem; }
.board-movers .ovs-mover-col { display: grid; grid-template-columns: 5.5rem 1fr; align-items: baseline; gap: 1rem; }
.board-movers .ovs-mover-title { margin: 0; font-size: 0.9375rem; color: var(--muted); font-weight: 500; }
.board-movers .ovs-mover-list { display: flex; flex-wrap: wrap; gap: 0.4rem 1.75rem; }
.board-movers .ovs-mover-list li { border: 0; padding: 0; gap: 0.5rem; justify-content: flex-start; }
@media (max-width: 760px) {
	.board-movers .ovs-movers { grid-template-columns: 1fr; }
	.board-movers .ovs-mover-col { grid-template-columns: 1fr; gap: 0.4rem; }
}

.board { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-title { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem); letter-spacing: -0.03em; line-height: 1.05; max-width: 22ch; margin-bottom: 2.25rem; }
.board-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 3rem 4.5rem; align-items: start; }
.board-side { border-left: 1px solid var(--rule); padding-left: 2.5rem; }
.side-title, .board-main .ovs-table caption { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.015em; margin: 0 0 0.9rem; }
@media (max-width: 1000px) {
	.board-grid { grid-template-columns: 1fr; }
	.board-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 2.5rem; }
}

.front-content { padding-block: 1rem 3rem; }

/* Cards --------------------------------------------------------------- */
.signals-posts { padding-block: clamp(3rem, 7vw, 5.5rem); border-top: 1px solid var(--rule); }
.section-head { margin-bottom: 2.5rem; }
.section-head .section-title { margin-bottom: 0.75rem; }
.section-intro { font-family: var(--serif); font-size: 1.1875rem; color: var(--muted); max-width: 52ch; margin: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 3rem 2.25rem; }
.card { display: flex; flex-direction: column; min-width: 0; }
.card-link { color: var(--ink); text-decoration: none; display: block; }
.card-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--panel); margin-bottom: 1rem; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-title { font-size: 1.375rem; line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 0.6rem; }
.card-link:hover .card-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.card-excerpt { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.5; color: var(--muted); margin: 0 0 0.9rem; }
.card-meta { margin: auto 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1rem; font-size: 0.875rem; color: var(--muted); }
.card-signal { color: var(--ink); font-weight: 550; }
.card-signal .ovs-change { margin-left: 0.25rem; }
/* Change labels used outside the plugin widgets (cards, post signal box). */
.ovs-change { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ovs-change.is-up { color: var(--up); }
.ovs-change.is-down { color: var(--down); }
.ovs-change.is-new { color: var(--accent); }
.ovs-change.is-flat { color: var(--muted); }
.card-pin { color: var(--ink); font-weight: 550; }

/* Listings --------------------------------------------------------------- */
.listing { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.page-header { margin-bottom: 3rem; max-width: 46rem; }
.page-title { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.5rem); letter-spacing: -0.035em; line-height: 1.02; }
.archive-description { font-family: var(--serif); font-size: 1.1875rem; color: var(--muted); }
.page-header .search-form { max-width: 30rem; margin-top: 1.5rem; }

.pagination { margin-top: 4rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.pagination .page-numbers { display: inline-block; min-width: 2.5rem; padding: 0.45rem 0.7rem; text-align: center; color: var(--ink); text-decoration: none; border: 1px solid var(--rule); border-radius: var(--radius); font-variant-numeric: tabular-nums; }
.pagination .page-numbers.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pagination a.page-numbers:hover { border-color: var(--ink); }

/* Single ---------------------------------------------------------------- */
.entry-header { padding-top: clamp(3rem, 8vw, 6rem); margin-bottom: 2.5rem; }
.entry-title { font-size: clamp(2.25rem, 1.3rem + 3.4vw, 4.25rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 680; max-width: 20ch; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; color: var(--muted); font-size: 0.9375rem; margin-top: 1.25rem; }
.entry-meta a { color: inherit; }
.entry-media { margin-block: 0 3rem; }
.entry-media img { width: 100%; border-radius: var(--radius); display: block; }
.entry-media figcaption, .wp-caption-text, .wp-element-caption, figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 0.6rem; font-family: var(--sans); }

.entry-content { font-family: var(--serif); font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem); line-height: 1.65; padding-inline: var(--gutter); }
.entry-content > * { max-width: var(--text); margin-inline: auto; }
.entry-content > .alignwide { max-width: calc(var(--max) - 2 * var(--gutter)); }
.entry-content > .alignfull { max-width: none; margin-inline: calc(-1 * var(--gutter)); }
.entry-content h2, .entry-content h3, .entry-content h4 { margin-top: 2.25em; }
.entry-content h2 { font-size: 1.75rem; letter-spacing: -0.025em; }
.entry-content h3 { font-size: 1.375rem; }
.entry-content blockquote { font-size: 1.375rem; line-height: 1.4; font-style: italic; border-left: 2px solid var(--ink); margin-block: 2rem; padding-left: 1.5rem; }
.entry-content blockquote cite { display: block; font: normal 0.9375rem var(--sans); color: var(--muted); margin-top: 0.75rem; }
.entry-content ul, .entry-content ol { padding-left: 1.25em; }
.entry-content li { margin-bottom: 0.35em; }
.entry-content figure { margin-block: 2.5rem; }
.entry-content img { border-radius: var(--radius); }
.entry-content pre, .entry-content code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.875em; }
.entry-content pre { background: var(--panel); border: 1px solid var(--rule); padding: 1rem; overflow-x: auto; border-radius: var(--radius); }
.entry-content table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.9375rem; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--rule); padding: 0.6rem 0.75rem 0.6rem 0; text-align: left; }
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content .ovs { font-size: 1rem; }

.entry-footer { margin-top: 3rem; }
.post-signal { border-top: 2px solid var(--ink); padding-top: 1.25rem; margin-bottom: 2rem; }
.post-signal-text { font-size: 1.1875rem; font-weight: 550; letter-spacing: -0.01em; margin-bottom: 0.4rem; }
.post-signal a { font-weight: 550; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.entry-tags a { font-size: 0.875rem; color: var(--ink); text-decoration: none; border: 1px solid var(--rule); border-radius: 999px; padding: 0.2rem 0.75rem; }
.entry-tags a:hover { border-color: var(--ink); }

.post-nav { margin-block: 4rem; }
.post-nav .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.post-nav a { color: var(--ink); text-decoration: none; display: block; }
.post-nav .nav-next { text-align: right; grid-column: 2; }
.post-nav .nav-label { display: block; font-size: 0.875rem; color: var(--muted); margin-bottom: 0.25rem; }
.post-nav .nav-title { font-weight: 600; }
.post-nav a:hover .nav-title { text-decoration: underline; }

/* Comments -------------------------------------------------------------- */
.comments { margin-block: 4rem; }
.comment-list { list-style: none; padding: 0; margin: 0 0 3rem; }
.comment-list .children { list-style: none; padding-left: 1.5rem; border-left: 1px solid var(--rule); }
.comment-body { padding-block: 1.25rem; border-bottom: 1px solid var(--rule); }
.comment-author { display: flex; align-items: center; gap: 0.75rem; font-weight: 600; }
.comment-author .avatar { border-radius: 50%; }
.comment-meta { font-size: 0.875rem; }
.comment-metadata a { color: var(--muted); }
.comment-content { font-family: var(--serif); font-size: 1.0625rem; }
.comment-form p { margin-bottom: 1rem; }
.comment-form label { display: block; font-weight: 500; margin-bottom: 0.35rem; }
.comment-form-cookies-consent { display: flex; gap: 0.5rem; align-items: baseline; }
.comment-form-cookies-consent label { display: inline; font-weight: 400; }

/* 404 ------------------------------------------------------------------- */
.notfound { padding-block: clamp(4rem, 10vw, 8rem); }
.notfound .search-form { margin-block: 1.5rem; max-width: 30rem; }

/* Footer -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--rule); margin-top: 2rem; padding-block: 3rem; background: var(--panel); }
.site-footer-inner { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2rem 4rem; }
.footer-note { color: var(--muted); max-width: 38ch; margin-top: 0.75rem; }
.footer-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-nav a { color: var(--ink); }
.footer-legal { grid-column: 1 / -1; font-size: 0.875rem; color: var(--muted); margin: 0; }
.widget { margin-bottom: 1.5rem; }
.widget-title { font-size: 1rem; }
@media (max-width: 760px) { .site-footer-inner { grid-template-columns: 1fr; } }

/* WordPress core classes ------------------------------------------------ */
.alignleft { float: left; margin: 0.4rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.4rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.gallery-caption, .sticky, .bypostauthor { /* Required by WordPress; styled where used. */ }
.page-links { font-family: var(--sans); font-size: 0.9375rem; margin-top: 2rem; }

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