/*
Theme Name: Newsdesk
Description: Lightweight news-portal theme with per-site colours, fonts and home layouts.
Version: 1.0.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: newsdesk
*/

:root {
	--nd-bg: #ffffff;
	--nd-soft: #f4f5f7;
	--nd-line: #e3e5ea;
	--nd-muted: #5f6672;
	--nd-text: #1b1e24;
	--nd-radius: 6px;
	--nd-wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--nd-bg);
	color: var(--nd-text);
	font: 400 17px/1.6 var(--nd-body);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--nd-primary); }
h1, h2, h3, h4 { font-family: var(--nd-head); font-weight: 700; line-height: 1.2; color: var(--nd-ink); margin: 0; }
.container { width: 100%; max-width: var(--nd-wrap); margin: 0 auto; padding: 0 20px; }
.screen-reader-text, .nd-skip { position: absolute; left: -9999px; }
.nd-skip:focus { left: 10px; top: 10px; z-index: 99; background: #fff; padding: 8px 12px; }

/* ---------- Top bar ---------- */
.nd-topbar { background: var(--nd-soft); border-bottom: 1px solid var(--nd-line); font-size: 13px; color: var(--nd-muted); }
.nd-topbar__in { display: flex; justify-content: space-between; align-items: center; min-height: 34px; gap: 16px; }
.nd-topbar ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.nd-topbar a:hover { color: var(--nd-primary); }

/* ---------- Header ---------- */
.nd-header { background: #fff; border-bottom: 1px solid var(--nd-line); }
.nd-header__in { display: flex; align-items: center; gap: 24px; min-height: 84px; }
.nd-header__tagline { margin: 0; color: var(--nd-muted); font-size: 14px; border-left: 2px solid var(--nd-line); padding-left: 16px; max-width: 320px; line-height: 1.35; }
.nd-header__tools { margin-left: auto; display: flex; gap: 6px; }
.nd-iconbtn { background: transparent; border: 0; color: var(--nd-ink); width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.nd-iconbtn:hover { background: var(--nd-soft); }
.nd-menubtn { display: none; }

.nd-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--nd-ink); }
.nd-brand:hover { color: var(--nd-ink); }
.nd-brand__icon { width: 46px; height: 46px; flex: none; }
.nd-brand__icon svg { width: 100%; height: 100%; display: block; }
.nd-brand__name { font-family: var(--nd-head); font-weight: 700; font-size: 30px; letter-spacing: -.01em; line-height: 1; white-space: nowrap; }
.nd-brand__a { color: var(--nd-primary); }
.nd-brand__b { color: var(--nd-ink); }
.nd-brand--small .nd-brand__icon { width: 34px; height: 34px; }
.nd-brand--small .nd-brand__name { font-size: 22px; }

.nd-header-dark .nd-header { background: var(--nd-primary); border-bottom: 0; }
.nd-header-dark .nd-header .nd-brand__a { color: var(--nd-accent); }
.nd-header-dark .nd-header .nd-brand__b,
.nd-header-dark .nd-header .nd-iconbtn { color: #fff; }
.nd-header-dark .nd-header .nd-iconbtn:hover { background: rgba(255,255,255,.12); }
.nd-header-dark .nd-header__tagline { color: rgba(255,255,255,.75); border-color: rgba(255,255,255,.25); }

.nd-search { border-top: 1px solid var(--nd-line); padding: 14px 0; background: #fff; }
.nd-searchform { display: flex; gap: 8px; max-width: 640px; }
.nd-searchform input { flex: 1; font: inherit; padding: 10px 14px; border: 1px solid var(--nd-line); border-radius: var(--nd-radius); }
.nd-searchform button { font: 700 15px var(--nd-body); padding: 10px 18px; border: 0; border-radius: var(--nd-radius); background: var(--nd-primary); color: #fff; cursor: pointer; }

/* ---------- Navigation ---------- */
.nd-nav { background: var(--nd-primary); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.nd-header-dark .nd-nav { background: var(--nd-ink); border-top: 1px solid rgba(255,255,255,.08); }
.nd-nav__in { display: flex; align-items: center; overflow-x: auto; scrollbar-width: none; }
.nd-nav__in::-webkit-scrollbar { display: none; }
.nd-nav a { display: block; padding: 13px 16px; font: 700 15px/1.2 var(--nd-body); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; color: #fff; }
.nd-nav a:hover, .nd-nav .current-menu-item > a, .nd-nav .current-cat > a { background: rgba(0,0,0,.18); color: #fff; }
.nd-nav__home { background: var(--nd-accent); color: var(--nd-ink) !important; }
.nd-header-dark .nd-nav__home { color: #fff !important; background: var(--nd-primary); }
.nd-menu { display: flex; list-style: none; margin: 0; padding: 0; }

/* ---------- Ticker ---------- */
.nd-ticker { border-bottom: 1px solid var(--nd-line); background: #fff; font-size: 14px; }
.nd-ticker__in { display: flex; align-items: center; gap: 14px; min-height: 42px; overflow: hidden; }
.nd-ticker__label { background: var(--nd-accent); color: var(--nd-ink); font: 700 12px/1 var(--nd-body); text-transform: uppercase; letter-spacing: .06em; padding: 6px 9px; border-radius: 3px; flex: none; }
.nd-ticker ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; white-space: nowrap; overflow: hidden; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.nd-ticker li { position: relative; font-weight: 700; }
.nd-ticker li + li::before { content: ""; position: absolute; left: -16px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--nd-primary); transform: translateY(-50%); }

.nd-main { padding-bottom: 40px; }

/* ---------- Section titles ---------- */
.nd-sec-title { font-size: 20px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 3px solid var(--nd-ink); margin: 0 0 18px; display: flex; }
.nd-sec-title span { display: inline-block; padding: 0 0 6px; position: relative; }
.nd-sec-title span::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--nd-primary); }
.nd-sec-title a:hover { color: var(--nd-primary); }

/* ---------- Cards ---------- */
.nd-card { position: relative; }
.nd-card__media { display: block; overflow: hidden; border-radius: var(--nd-radius); background: var(--nd-soft); aspect-ratio: 16 / 9; }
.nd-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.nd-card:hover .nd-card__media img { transform: scale(1.04); }
.nd-card__media--empty { background: linear-gradient(135deg, var(--nd-primary), var(--nd-ink)); }
.nd-card__title { font-size: 19px; margin: 6px 0 6px; }
.nd-card__title a:hover { color: var(--nd-primary); }
.nd-card__dek { margin: 0 0 8px; color: var(--nd-muted); font-size: 16px; }
.nd-label { display: inline-block; margin-top: 12px; font: 700 12px/1 var(--nd-body); text-transform: uppercase; letter-spacing: .07em; color: var(--nd-primary); }
.nd-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--nd-muted); }
.nd-meta > * + *::before { content: "·"; margin-right: 12px; }

.nd-card--hero .nd-card__title { font-size: 36px; letter-spacing: -.01em; }
.nd-card--hero .nd-card__dek { font-size: 18px; }

.nd-card--list { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--nd-line); }
.nd-card--list:first-of-type { padding-top: 0; }
.nd-card--list .nd-card__media { aspect-ratio: 3 / 2; }
.nd-card--list .nd-card__title { font-size: 16px; margin: 0 0 4px; }

.nd-card--row { display: grid; grid-template-columns: 300px 1fr; gap: 22px; padding: 20px 0; border-bottom: 1px solid var(--nd-line); }
.nd-card--row:first-child { padding-top: 0; }
.nd-card--row .nd-label { margin-top: 0; }
.nd-card--row .nd-card__title { font-size: 22px; }

.nd-card--overlay { height: 100%; }
.nd-card--overlay .nd-card__media { height: 100%; aspect-ratio: auto; min-height: 220px; }
.nd-card--overlay .nd-card__media::after { content: ""; position: absolute; inset: 0; border-radius: var(--nd-radius); background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.82)); pointer-events: none; }
.nd-card--overlay .nd-card__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px; color: #fff; pointer-events: none; }
.nd-card--overlay .nd-card__body a { pointer-events: auto; }
.nd-card--overlay .nd-label { background: var(--nd-accent); color: var(--nd-ink); padding: 5px 8px; border-radius: 3px; margin: 0; }
.nd-card--overlay .nd-card__title { color: #fff; font-size: 20px; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.nd-card--overlay .nd-card__title a:hover { color: #fff; text-decoration: underline; }
.nd-card--overlay .nd-meta { color: rgba(255,255,255,.85); }

.nd-card--mini { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--nd-line); }
.nd-card__num { font: 700 28px/1 var(--nd-head); color: var(--nd-primary); opacity: .85; }
.nd-card--mini .nd-card__title { font-size: 15px; margin: 0 0 4px; }

/* ---------- Grids & layouts ---------- */
.nd-section { margin-top: 40px; }
.nd-grid { display: grid; gap: 28px 24px; }
.nd-grid--2 { grid-template-columns: repeat(2, 1fr); }
.nd-grid--3 { grid-template-columns: repeat(3, 1fr); }
.nd-grid--4 { grid-template-columns: repeat(4, 1fr); }

.nd-top { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; margin-top: 28px; }
.nd-top__side { border-left: 1px solid var(--nd-line); padding-left: 28px; }

.nd-two { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; margin-top: 28px; align-items: start; }
.nd-lead { margin-bottom: 36px; }
.nd-lead .nd-grid { margin-top: 26px; }

.nd-banner { background: var(--nd-ink); padding: 28px 0; }
.nd-banner .nd-card--overlay .nd-card__media { min-height: 460px; }
.nd-banner .nd-card--overlay .nd-card__title { font-size: 40px; max-width: 900px; }
.nd-banner .nd-card--overlay .nd-card__body { padding: 36px; }

.nd-mosaic { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-top: 28px; }
.nd-mosaic__big .nd-card__media { min-height: 520px; }
.nd-mosaic__big .nd-card__title { font-size: 32px; }
.nd-mosaic__small { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; }
.nd-mosaic__small .nd-card__media { min-height: 250px; }
.nd-mosaic__small .nd-card__body { padding: 16px; }
.nd-mosaic__small .nd-card__title { font-size: 17px; }

.nd-catblock { margin-top: 44px; }
.nd-catblock__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; }
.nd-catblock__lead .nd-card__title { font-size: 26px; }
.nd-catblock__lead .nd-card--overlay .nd-card__media { min-height: 360px; }

/* ---------- Sidebar ---------- */
.nd-sidebar { position: sticky; top: 64px; display: grid; gap: 32px; }
.nd-widget { background: #fff; }
.nd-catlist { list-style: none; margin: 0; padding: 0; }
.nd-catlist li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--nd-line); font-weight: 700; }
.nd-catlist span { color: var(--nd-muted); font-weight: 400; font-size: 14px; }
.nd-widget--about { background: var(--nd-soft); border-top: 4px solid var(--nd-primary); padding: 20px; border-radius: 0 0 var(--nd-radius) var(--nd-radius); }
.nd-widget--about p { font-size: 15px; color: var(--nd-muted); margin: 12px 0; }
.nd-more { font-weight: 700; color: var(--nd-primary); }

/* ---------- Article ---------- */
.nd-crumbs { font-size: 13px; color: var(--nd-muted); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.nd-crumbs a:hover { color: var(--nd-primary); }
.nd-article__head .nd-label { margin-top: 0; }
.nd-article__title { font-size: 42px; letter-spacing: -.015em; margin: 8px 0 14px; }
.nd-article__dek { font-size: 21px; line-height: 1.45; color: #3b414c; margin: 0 0 20px; }
.nd-article__meta { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--nd-line); border-bottom: 1px solid var(--nd-line); margin-bottom: 24px; }
.nd-article__avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--nd-primary); color: #fff; font: 700 18px var(--nd-head); flex: none; }
.nd-article__avatar--lg { width: 60px; height: 60px; font-size: 24px; }
.nd-article__by { display: block; font-weight: 700; font-size: 15px; }
.nd-article__by a { color: var(--nd-primary); }
.nd-article__figure { margin: 0 0 28px; }
.nd-article__figure img { width: 100%; border-radius: var(--nd-radius); }
.nd-article__figure figcaption, .nd-content figcaption { font-size: 14px; color: var(--nd-muted); margin-top: 8px; line-height: 1.45; }

.nd-content { font-size: 18px; line-height: 1.75; }
.nd-content > * { margin: 0 0 1.15em; }
.nd-content h2 { font-size: 28px; margin: 1.6em 0 .6em; }
.nd-content h3 { font-size: 22px; margin: 1.4em 0 .5em; }
.nd-content a { color: var(--nd-primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.nd-content ul, .nd-content ol { padding-left: 1.3em; }
.nd-content li { margin-bottom: .45em; }
.nd-content blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--nd-accent); font-size: 20px; color: #333; }
.nd-content table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.nd-content th, .nd-content td { border: 1px solid var(--nd-line); padding: 9px 12px; text-align: left; vertical-align: top; }
.nd-content thead th { background: var(--nd-ink); color: #fff; }
.nd-content tbody tr:nth-child(even) td { background: var(--nd-soft); }
.nd-content figure { margin: 1.8em 0; }
.nd-content figure img { width: 100%; border-radius: var(--nd-radius); }
.nd-credit { opacity: .85; }
.nd-credit::before { content: "— "; }
.nd-credit a { text-decoration: underline; text-underline-offset: 2px; color: inherit; }
.nd-content h2:last-of-type + ul { font-size: 15px; background: var(--nd-soft); padding: 16px 16px 16px 34px; border-radius: var(--nd-radius); }

.nd-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0; }
.nd-tags a { font-size: 14px; background: var(--nd-soft); padding: 6px 12px; border-radius: 99px; }
.nd-tags a:hover { background: var(--nd-primary); color: #fff; }
.nd-authorbox { display: flex; gap: 16px; padding: 20px; border: 1px solid var(--nd-line); border-left: 4px solid var(--nd-primary); border-radius: var(--nd-radius); }
.nd-authorbox p { margin: 4px 0 0; color: var(--nd-muted); font-size: 15px; }
.nd-related { margin-top: 48px; padding-top: 8px; }

.nd-page { max-width: 820px; margin-top: 32px; }
.nd-archive__head { margin-bottom: 24px; padding-bottom: 14px; border-bottom: 3px solid var(--nd-ink); }
.nd-archive__title { font-size: 38px; }
.nd-archive__desc { color: var(--nd-muted); margin-top: 8px; }
.nd-empty { color: var(--nd-muted); }
.nav-links { display: flex; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.nav-links .page-numbers { padding: 8px 14px; border: 1px solid var(--nd-line); border-radius: var(--nd-radius); font-weight: 700; }
.nav-links .current { background: var(--nd-primary); color: #fff; border-color: var(--nd-primary); }

/* ---------- Footer ---------- */
.nd-footer { background: var(--nd-ink); color: rgba(255,255,255,.78); margin-top: 56px; font-size: 15px; }
.nd-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-top: 44px; padding-bottom: 32px; }
.nd-footer .nd-brand__b { color: #fff; }
.nd-footer .nd-brand__a { color: var(--nd-accent); }
.nd-footer p { max-width: 420px; }
.nd-footer__title { color: #fff; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.nd-footer__links { list-style: none; margin: 0; padding: 0; }
.nd-footer__links li { margin-bottom: 8px; }
.nd-footer a:hover { color: #fff; text-decoration: underline; }
.nd-footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.14); padding-top: 18px; padding-bottom: 26px; font-size: 13px; color: rgba(255,255,255,.6); }

/* ---------- Layout accents ---------- */
.nd-layout-delfi .nd-sec-title { border-bottom-width: 2px; }
.nd-layout-euronews .nd-sec-title { border: 0; }
.nd-layout-euronews .nd-sec-title span { padding-left: 12px; border-left: 5px solid var(--nd-primary); }
.nd-layout-euronews .nd-sec-title span::after { display: none; }
.nd-layout-lrt .nd-card__media, .nd-layout-lrt .nd-card--overlay .nd-card__media::after { border-radius: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.nd-grid--4 { grid-template-columns: repeat(2, 1fr); }
	.nd-two { grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; }
	.nd-card--row { grid-template-columns: 220px 1fr; }
	.nd-header__tagline { display: none; }
}
@media (max-width: 900px) {
	.nd-top, .nd-two, .nd-mosaic, .nd-catblock__grid { grid-template-columns: 1fr; }
	.nd-top__side { border-left: 0; padding-left: 0; }
	.nd-sidebar { position: static; }
	.nd-grid--3 { grid-template-columns: repeat(2, 1fr); }
	.nd-mosaic__big .nd-card__media { min-height: 360px; }
	.nd-banner .nd-card--overlay .nd-card__media { min-height: 360px; }
	.nd-banner .nd-card--overlay .nd-card__title { font-size: 30px; }
	.nd-footer__grid { grid-template-columns: 1fr 1fr; }
	.nd-footer__about { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
	body { font-size: 16px; }
	.container { padding: 0 16px; }
	.nd-topbar ul { display: none; }
	.nd-header__in { min-height: 64px; }
	.nd-brand__icon { width: 36px; height: 36px; }
	.nd-brand__name { font-size: 22px; }
	.nd-menubtn { display: grid; }
	.nd-nav { position: static; display: none; }
	.nd-nav.is-open { display: block; }
	.nd-nav__in { flex-direction: column; align-items: stretch; }
	.nd-menu { flex-direction: column; }
	.nd-ticker ul li:nth-child(n+2) { display: none; }
	.nd-grid--2, .nd-grid--3, .nd-grid--4, .nd-mosaic__small { grid-template-columns: 1fr; }
	.nd-mosaic__small { grid-template-rows: none; }
	.nd-card--hero .nd-card__title, .nd-mosaic__big .nd-card__title { font-size: 26px; }
	.nd-card--row { grid-template-columns: 120px 1fr; gap: 14px; }
	.nd-card--row .nd-card__title { font-size: 17px; }
	.nd-card--row .nd-card__dek { display: none; }
	.nd-banner .nd-card--overlay .nd-card__body { padding: 20px; }
	.nd-banner .nd-card--overlay .nd-card__title { font-size: 24px; }
	.nd-article__title { font-size: 30px; }
	.nd-article__dek { font-size: 18px; }
	.nd-content { font-size: 17px; }
	.nd-content h2 { font-size: 23px; }
	.nd-footer__grid { grid-template-columns: 1fr; }
}
