/* Nyhetsradar – Verdensavis design
   Version: 1.1.1 - category list: all thumbnails same width (200px box)
   1.1.0 - default image (.nr-ph) for stories without a picture
   1.0.1 - article image is as wide as the text column (640px)
   1.0.0 - first version, shared by index.php and article.php */

:root {
    --ink: #121212;
    --text: #363636;
    --muted: #5a5a5a;
    --rule: #dfdfdf;
    --accent: #3b5a8a;
    --bg: #fff;
    --img: #e2e2e2;
    --serif: 'Libre Caslon Text', Georgia, 'Times New Roman', serif;
    --sans: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.5; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.nr-wrap { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.nr-h { font-family: var(--serif); font-weight: 700; color: var(--ink); margin: 0; }
.nr-meta { font: 500 13px/1.4 var(--sans); color: var(--muted); }
.nr-kicker { display: inline-block; font: 700 12px/1.3 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 4px; }
.nr-label { font: 700 13px/1.3 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin: 0 0 8px; }
.nr-teaser { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text); }

/* ---------- Header ---------- */
.nr-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 10px; font: 600 12px/1.3 var(--sans); }
.nr-topline a { padding: 12px 0; }
.nr-mast { margin: 0; text-align: center; font: 700 clamp(40px, 5.4vw, 66px)/1.1 var(--serif); letter-spacing: -.01em; padding: 4px 0 10px; }
.nr-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 22px; border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
.nr-nav a { font-size: 13px; font-weight: 500; padding: 13px 0; }
.nr-nav a.is-active { font-weight: 700; color: var(--accent); }
.nr-header--compact .nr-mast { font-size: 34px; padding: 0 0 8px; }

/* ---------- Front page ---------- */
.nr-main { padding-top: 20px; padding-bottom: 48px; }
.nr-front { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.nr-front > div { padding: 0 20px; border-left: 1px solid var(--rule); }
.nr-front > div:first-child { padding-left: 0; border-left: 0; }
.nr-front > div:last-child { padding-right: 0; }
.nr-story + .nr-story { border-top: 1px solid var(--rule); margin-top: 16px; padding-top: 14px; }
.nr-story .nr-h { font-size: 20px; line-height: 1.2; margin-bottom: 6px; }
.nr-story .nr-meta { margin-top: 8px; }
.nr-lead .nr-h { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.12; margin: 14px 0 8px; }
.nr-lead .nr-teaser { font-size: 17px; }
.nr-img { background: var(--img); width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
/* Default image: raster dots in the category colour + white plate with the category name */
.nr-ph { display: flex; align-items: center; justify-content: center; container-type: inline-size; overflow: hidden;
    background-color: var(--ph, var(--accent));
    background-image: radial-gradient(circle at 80% 18%, rgba(255,255,255,.22), transparent 55%),
                      radial-gradient(rgba(0,0,0,.28) 1.6px, transparent 2.2px);
    background-size: 100% 100%, 12px 12px; }
.nr-ph-plate { display: flex; flex-direction: column; align-items: center; gap: .35em; max-width: 84%; background: #fff; color: var(--ink);
    padding: .55em 1.1em .6em; border-top: 1px solid var(--ink); border-bottom: 4px double var(--ink); font-size: clamp(13px, 7.5cqw, 60px); }
.nr-ph-brand { font: 700 max(7px, .22em)/1 var(--sans); letter-spacing: .25em; text-transform: uppercase; color: var(--muted); }
.nr-ph-cat { font: 700 1em/1.05 var(--serif); text-align: center; overflow-wrap: anywhere; }
.nr-figure .nr-ph { aspect-ratio: 4 / 3; }
.nr-caption { font: 500 12px/1.4 var(--sans); color: var(--muted); margin-top: 6px; }
.nr-latest .nr-story .nr-h { font-size: 17px; line-height: 1.25; }
.nr-latest .nr-teaser { font-size: 14px; }
.nr-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 20px 0; border-bottom: 1px solid var(--ink); }
.nr-row > article { padding: 0 20px; border-left: 1px solid var(--rule); }
.nr-row > article:first-child { padding-left: 0; border-left: 0; }
.nr-row > article:last-child { padding-right: 0; }
.nr-row > .nr-story + .nr-story { border-top: 0; margin-top: 0; padding-top: 0; }
.nr-row .nr-img { margin-bottom: 10px; }
.nr-row .nr-h { font-size: 19px; line-height: 1.2; margin-bottom: 6px; }
.nr-empty { padding: 40px 0; text-align: center; color: var(--muted); }

/* ---------- Pagination (class names used by the PHP) ---------- */
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin: 32px 0 8px; }
.pagination-btn { min-width: 44px; height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--rule); font: 600 14px var(--sans); color: var(--ink); }
.pagination-btn:hover { border-color: var(--ink); color: var(--ink); }
.pagination-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination-btn.disabled { color: #9a9a9a; }
.pagination-ellipsis { padding: 0 4px; color: var(--muted); }

/* ---------- Article ---------- */
.nr-article-page { padding-top: 40px; padding-bottom: 64px; }
.nr-narrow { max-width: 640px; margin: 0 auto; }
.nr-crumbs { font: 500 13px/1.4 var(--sans); color: var(--muted); margin-bottom: 14px; }
.nr-crumbs a { color: var(--accent); font-weight: 600; }
.nr-title { font-size: clamp(32px, 3.8vw, 44px); line-height: 1.12; margin-bottom: 16px; }
.nr-dek { font: 400 21px/1.45 var(--serif); color: var(--text); margin: 0 0 24px; }
.nr-figure { max-width: 640px; margin: 0 auto 24px; } /* same width as .nr-narrow text column */
.nr-figure img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--img); }
.nr-byline { margin: 0 0 28px; font: 500 13px/1.5 var(--sans); color: var(--ink); }
.nr-byline time { color: var(--muted); }
.nr-keypoints { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 16px 0; margin-bottom: 28px; }
.nr-keypoints ul { margin: 0; padding-left: 18px; font-size: 16px; line-height: 1.55; color: var(--text); }
.nr-keypoints li + li { margin-top: 4px; }
.nr-body { font: 400 20px/1.6 var(--serif); color: var(--ink); }
.nr-body p { margin: 0 0 24px; }
.nr-body h2, .nr-body h3, .nr-body h4 { font-family: var(--serif); font-weight: 700; line-height: 1.25; margin: 40px 0 14px; }
.nr-body h2 { font-size: 24px; }
.nr-body h3 { font-size: 21px; }
.nr-body a { color: var(--accent); text-decoration: underline; }
.nr-section { border-top: 1px solid var(--rule); padding-top: 18px; margin-top: 8px; }
.nr-section ul { margin: 0; padding-left: 20px; font: 400 14px/1.9 var(--sans); color: var(--text); }
.nr-section a { color: var(--accent); text-decoration: underline; word-break: break-word; }
.nr-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 32px; }
.nr-topics { margin: 20px 0 0; font: 500 13px/1.6 var(--sans); color: var(--muted); }
.nr-related { margin-top: 56px; }
.nr-related .nr-label { padding-top: 12px; border-top: 2px solid var(--ink); margin-bottom: 16px; }
.nr-related-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nr-related-grid > article { padding: 0 18px; border-left: 1px solid var(--rule); }
.nr-related-grid > article:first-child { padding-left: 0; border-left: 0; }
.nr-related-grid .nr-img { margin-bottom: 10px; }
.nr-related-grid .nr-h { font-size: 18px; line-height: 1.25; }

/* ---------- Category ---------- */
.nr-cat-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; border-bottom: 1px solid var(--ink); padding-bottom: 14px; margin-bottom: 20px; }
.nr-cat-head .nr-h { font-size: clamp(34px, 4vw, 46px); }
.nr-cat-intro { font: 400 17px/1.5 var(--serif); color: var(--text); max-width: 760px; margin: 0 0 24px; }
.nr-cat-lead { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
.nr-cat-lead .nr-h { font-size: 30px; line-height: 1.15; margin-bottom: 10px; }
.nr-cat-lead .nr-teaser { font-size: 16px; margin-bottom: 10px; }
.nr-list { list-style: none; margin: 0; padding: 0; max-width: 920px; }
.nr-list li { display: flex; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.nr-list time { flex: 0 0 120px; }
.nr-list .nr-list-text { flex: 1 1 auto; min-width: 0; }
.nr-list .nr-h { font-size: 20px; line-height: 1.25; margin-bottom: 6px; }
.nr-list-media { flex: 0 0 200px; width: 200px; align-self: flex-start; }
.nr-list-media .nr-img { width: 100%; }

/* ---------- 404, admin, feed viewer ---------- */
.error-container { text-align: center; padding: 64px 0; }
.error-code { font: 700 96px/1 var(--serif); }
.error-message { font: 700 24px/1.3 var(--serif); margin: 12px 0; }
.error-description { color: var(--text); margin-bottom: 24px; }
.nr-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border: 1px solid var(--ink); font: 600 14px var(--sans); }
.edit-form-container { max-width: 800px; margin: 0 auto; }
.error { color: #b42318; padding: 12px 0; }
.loading, .no-entries { color: var(--muted); padding: 12px 0; text-align: center; }
.entries-container { max-width: 800px; margin: 0 auto; }
.entry { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.entry-title { font: 700 20px/1.25 var(--serif); margin: 0 0 6px; }
.entry-summary { color: var(--text); font-size: 15px; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.share-section { max-width: 800px; margin: 32px auto 0; padding-top: 18px; border-top: 1px solid var(--ink); }
.integration-options { display: grid; gap: 16px; margin-top: 12px; }
.integration-title { font-weight: 600; margin-bottom: 6px; }
.share-link { display: inline-block; max-width: 100%; padding: 10px 12px; border: 1px solid var(--rule); font: 13px/1.4 ui-monospace, monospace; word-break: break-all; cursor: pointer; }
.copy-icon { cursor: pointer; margin-left: 8px; }
.copy-feedback { color: #1a7f37; font-size: 13px; margin-top: 6px; }

/* ---------- Footer ---------- */
.nr-footer { border-top: 3px double var(--ink); margin-top: 16px; }
.nr-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 20px; padding-bottom: 28px; }
.nr-footer-logo { font: 700 24px var(--serif); }
.nr-footer-nav { display: flex; gap: 20px; font: 600 13px var(--sans); }
.nr-footer-nav a { padding: 12px 0; }
.nr-footer-note { flex-basis: 100%; margin: 0; font: 500 13px/1.5 var(--sans); color: var(--muted); }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
    .nr-front, .nr-row, .nr-cat-lead { grid-template-columns: minmax(0, 1fr); }
    .nr-front > div, .nr-row > article { padding: 16px 0 0; margin-top: 16px; border-left: 0; border-top: 1px solid var(--rule); }
    .nr-front > .nr-lead { order: -1; border-top: 0; margin-top: 0; padding-top: 0; }
    .nr-row > article:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
    .nr-row > .nr-story + .nr-story { border-top: 1px solid var(--rule); margin-top: 16px; padding-top: 16px; }
    .nr-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 0; }
    .nr-related-grid > article:nth-child(odd) { padding-left: 0; border-left: 0; }
    .nr-nav { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; }
    .nr-list li { flex-wrap: wrap; gap: 6px 16px; }
    .nr-list time { flex-basis: 100%; }
    .nr-list-media { display: none; }
}
@media (max-width: 560px) {
    .nr-wrap { padding: 0 16px; }
    .nr-related-grid { grid-template-columns: minmax(0, 1fr); }
    .nr-related-grid > article { padding: 0 !important; border-left: 0 !important; }
    .nr-body { font-size: 18px; }
}
