/*
Theme Name: IcelandWire
Description: Fast, accessible news theme for IcelandWire. No JavaScript, system fonts, one stylesheet.
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: icelandwire
*/

:root {
	--iw-ink: #14181b;
	--iw-ink-soft: #4a545b;
	--iw-paper: #f7f8f6;
	--iw-card: #ffffff;
	--iw-line: #dde2e0;
	--iw-navy: #0b1f2a;
	--iw-navy-ink: #f2f5f4;
	--iw-lava: #c8462a;          /* kicker, breaking: passes 4.5:1 on paper */
	--iw-glacier: #1f6f7d;       /* links */
	--iw-sea: #dbe7ea;
	--iw-land: #fbfbf9;
	--iw-box: #eef3f2;
	--iw-serif: "Iowan Old Style", "Charter", "Source Serif Pro", "Georgia", "Times New Roman", serif;
	--iw-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--iw-wrap: 1180px;
	--iw-gutter: 16px;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--iw-ink: #e9eeec;
		--iw-ink-soft: #a9b4b8;
		--iw-paper: #0f1416;
		--iw-card: #161d20;
		--iw-line: #2a3438;
		--iw-navy: #0a1a23;
		--iw-lava: #ff7a59;
		--iw-glacier: #7fc8d4;
		--iw-sea: #12262d;
		--iw-land: #2b3a3f;
		--iw-box: #1b2529;
	}
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--iw-paper);
	color: var(--iw-ink);
	font: 17px/1.6 var(--iw-sans);
	text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--iw-glacier); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--iw-lava); outline-offset: 2px; }

.iw-wrap { max-width: var(--iw-wrap); margin: 0 auto; padding: 0 var(--iw-gutter); }
.iw-skip { position: absolute; left: -999px; top: 0; background: var(--iw-card); padding: 8px 12px; z-index: 10; }
.iw-skip:focus { left: 8px; }

/* masthead */
.iw-masthead { background: var(--iw-navy); color: var(--iw-navy-ink); }
.iw-masthead__inner { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 14px; flex-wrap: wrap; }
.iw-logo { color: inherit; text-decoration: none; font: 800 30px/1 var(--iw-sans); letter-spacing: .06em; white-space: nowrap; }
.iw-logo__b { color: #7fc8d4; font-weight: 300; }
.iw-logo--small { font-size: 20px; color: var(--iw-ink); }
.iw-logo--small .iw-logo__b { color: var(--iw-glacier); }
.iw-tagline { margin: 0; font-size: 14px; color: #b9c6ca; }
.iw-nav { border-top: 1px solid rgba(255, 255, 255, .12); }
.iw-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.iw-nav__list::-webkit-scrollbar { display: none; }
.iw-nav__list a { display: block; padding: 10px 10px; color: var(--iw-navy-ink); text-decoration: none; font-size: 15px; font-weight: 600; white-space: nowrap; }
.iw-nav__list a:hover, .iw-nav__list [aria-current="page"], .iw-nav__list .current-menu-item > a { box-shadow: inset 0 -3px 0 #7fc8d4; }

.iw-main { padding-top: 24px; padding-bottom: 48px; }

/* typography */
.iw-kicker { display: inline-block; color: var(--iw-lava); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; margin-bottom: 6px; }
.iw-meta { margin: 6px 0 0; color: var(--iw-ink-soft); font-size: 14px; }
.iw-updated { white-space: nowrap; }
.iw-rail-title { font: 700 14px/1 var(--iw-sans); letter-spacing: .08em; text-transform: uppercase; border-top: 3px solid var(--iw-ink); padding-top: 10px; margin: 36px 0 12px; }

/* cards */
.iw-card { background: var(--iw-card); border: 1px solid var(--iw-line); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; }
.iw-card__media img, .iw-card__media svg { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.iw-card__body { padding: 14px 16px 16px; }
.iw-card__title { font: 700 21px/1.25 var(--iw-serif); margin: 0; }
.iw-card__title a { color: var(--iw-ink); text-decoration: none; }
.iw-card__title a:hover { text-decoration: underline; }
.iw-card__dek { margin: 8px 0 0; color: var(--iw-ink-soft); font-size: 16px; }
.iw-card--lead .iw-card__title { font-size: clamp(28px, 4vw, 42px); line-height: 1.12; }
.iw-card--lead .iw-card__dek { font-size: 18px; }
.iw-card--row { border: 0; border-bottom: 1px solid var(--iw-line); border-radius: 0; background: transparent; }
.iw-card--row .iw-card__body { padding: 12px 0; }
.iw-card--row .iw-card__title { font-size: 18px; }

.iw-front { display: grid; gap: 20px; }
.iw-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.iw-list { display: grid; }
@media (min-width: 900px) {
	.iw-card--lead { display: grid; grid-template-columns: 3fr 2fr; }
	.iw-card--lead .iw-card__body { padding: 24px 28px; align-self: center; }
	.iw-list { grid-template-columns: 1fr 1fr; column-gap: 40px; }
}

/* fallback placeholder */
.iw-fallback { margin: 0; }
.iw-fb__g1 { stop-color: var(--iw-navy); }
.iw-fb__g2 { stop-color: #1f4a5a; }
.iw-fb__mark { font: 800 96px var(--iw-sans); letter-spacing: .08em; fill: #f2f5f4; }
.iw-fb__mark2 { fill: #7fc8d4; font-weight: 300; }

/* article */
.iw-article__head { max-width: 780px; }
.iw-article__title { font: 700 clamp(30px, 5vw, 48px)/1.1 var(--iw-serif); margin: 0 0 12px; letter-spacing: -.01em; }
.iw-article__dek { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.45; color: var(--iw-ink-soft); margin: 0 0 8px; }
.iw-article__media { margin: 20px 0 24px; }
.iw-article__media img, .iw-article__media svg { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }
.iw-article__media figcaption { font-size: 13px; color: var(--iw-ink-soft); margin-top: 6px; }
.iw-article__layout { display: grid; gap: 40px; }
@media (min-width: 1000px) { .iw-article__layout { grid-template-columns: minmax(0, 700px) 300px; justify-content: space-between; } }
.iw-article__body { font: 19px/1.7 var(--iw-serif); max-width: 700px; }
.iw-article__body h2 { font: 700 24px/1.25 var(--iw-serif); margin: 36px 0 8px; }
.iw-article__body p { margin: 0 0 1.1em; }
.iw-article__body blockquote { margin: 1.2em 0; padding-left: 18px; border-left: 3px solid var(--iw-lava); font-style: italic; }
.iw-page { max-width: 760px; }

/* plugin boxes (Mentloop Publisher) */
.mlp-key-facts, .mlp-context, .mlp-sources, .mlp-corrections { font: 16px/1.55 var(--iw-sans); background: var(--iw-box); border-radius: 4px; padding: 14px 18px; margin: 0 0 24px; }
.mlp-box-title { font: 700 13px/1 var(--iw-sans) !important; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px !important; color: var(--iw-ink-soft); }
.mlp-key-facts ul, .mlp-sources ul { margin: 0; padding-left: 18px; }
.mlp-key-facts li { margin: 2px 0; }
.mlp-context { border-left: 4px solid var(--iw-glacier); }
.mlp-corrections { border-left: 4px solid var(--iw-lava); }
.mlp-corrections p { margin: 0; }
.mlp-sources { margin-top: 32px; }
.mlp-lang, .mlp-first, .mlp-illustrative { color: var(--iw-ink-soft); font-size: 14px; }
.mlp-image-credit { margin: 10px 0 0; font-size: 14px; color: var(--iw-ink-soft); }
.mlp-disclosure { font: 14px/1.5 var(--iw-sans); color: var(--iw-ink-soft); border-top: 1px solid var(--iw-line); padding-top: 12px; }

/* listings */
.iw-listing-head h1 { font: 700 clamp(28px, 4vw, 40px)/1.15 var(--iw-serif); margin: 0 0 4px; }
.iw-listing-head__desc { color: var(--iw-ink-soft); margin-bottom: 16px; }
.iw-empty { color: var(--iw-ink-soft); }
.nav-links { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.nav-links .page-numbers { padding: 6px 12px; border: 1px solid var(--iw-line); border-radius: 4px; text-decoration: none; }

/* ads: reserved space, clearly labelled */
.iw-ad { display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 24px auto; max-width: var(--iw-wrap); }
.iw-ad__label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--iw-ink-soft); margin-bottom: 4px; }
.iw-ad--sidebar { position: sticky; top: 16px; }
@media (max-width: 999px) { .iw-ad--sidebar { display: none; } }

/* footer */
.iw-footer { border-top: 1px solid var(--iw-line); background: var(--iw-card); }
.iw-footer__inner { display: grid; gap: 16px; padding-top: 28px; padding-bottom: 28px; font-size: 15px; }
@media (min-width: 800px) { .iw-footer__inner { grid-template-columns: 2fr 1fr; } .iw-footer__small { grid-column: 1 / -1; } }
.iw-footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.iw-footer__small { color: var(--iw-ink-soft); font-size: 13px; margin: 0; }

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