/*
Theme Name: Colombo Tribune
Description: Text-first bilingual (English / Sinhala) news theme. Section colours come from the Sri Lankan flag and double as the main navigation.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: colombotribune
*/

:root {
	--ink: #14161a;
	--ink-2: #4f5560;
	--rule: #e2e4e8;
	--paper: #ffffff;
	--tint: #f4f5f7;
	--focus: #1a5fd0;
	--brand: #b82128; /* the red sun in the logo */

	--c-local: #8d153a;
	--c-business: #00534e;
	--c-sports: #a84e00;
	--c-world: #2b3a67;
	--c-sinhala: #7a5a00;
	--c-default: #14161a;

	--serif: "Newsreader", Georgia, "Times New Roman", serif;
	--sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--si-serif: "Abhaya Libre", "Noto Sans Sinhala", serif;
	--si-sans: "Noto Sans Sinhala", system-ui, sans-serif;
}

.sec-local { --sec: var(--c-local); }
.sec-business { --sec: var(--c-business); }
.sec-sports { --sec: var(--c-sports); }
.sec-world { --sec: var(--c-world); }
.sec-sinhala { --sec: var(--c-sinhala); }
.sec-default { --sec: var(--c-default); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 var(--sans); }
[lang="si"] { font-family: var(--si-sans); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--paper); padding: 8px 12px; }

.wrap { max-width: 1240px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 760px) { .wrap { padding-left: 24px; padding-right: 24px; } }

/* ---------- top bar ---------- */
.topbar { border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--ink-2); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; }
.today { font-variant-numeric: tabular-nums; }
.langs { display: flex; gap: 4px; }
.langs a { padding: 4px 11px; border-radius: 999px; }
.langs a:hover { background: var(--tint); }
.langs a.is-current { background: var(--brand); color: var(--paper); }

/* ---------- social ---------- */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.fb-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.fb-link:hover { color: #1877f2; }
.foot-follow { margin: 24px 0 0; }
.fb-foot { padding: 8px 14px; border: 1px solid #3a3f48; border-radius: 999px; color: #fff; }
.fb-foot:hover { border-color: #fff; color: #fff; }

/* ---------- masthead ---------- */
.masthead-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand-logo { width: auto; height: 76px; }
@media (min-width: 760px) { .brand-logo { height: 104px; } }
.brand-en { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 7vw, 64px); letter-spacing: -0.025em; font-variation-settings: "opsz" 72; }
.search { display: none; }
@media (min-width: 760px) { .search { display: flex; } }
.search input { font: inherit; font-size: 14px; width: 220px; padding: 9px 15px; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); color: var(--ink); }
.search input:focus { border-color: var(--ink); }

/* ---------- section band (signature) ---------- */
.sections { border-bottom: 1px solid var(--rule); }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; scrollbar-width: none; }
.nav-list::-webkit-scrollbar { display: none; }
.nav-list li { flex: 1 0 auto; }
.nav-list a { display: block; padding: 12px 16px 11px; border-top: 5px solid var(--sec); font-weight: 600; font-size: 15px; white-space: nowrap; }
.nav-list a:hover, .nav-list .is-current a { background: color-mix(in srgb, var(--sec) 9%, var(--paper)); color: var(--sec); }

/* ---------- breaking news ---------- */
.breaking { background: var(--brand); color: #fff; }
.breaking-in { display: flex; align-items: center; gap: 12px; min-height: 46px; padding-top: 8px; padding-bottom: 8px; font-weight: 600; }
.breaking-label { flex: none; padding: 3px 8px; border-radius: 3px; background: #fff; color: var(--brand); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.breaking a { color: #fff; line-height: 1.3; }
.breaking a:hover { text-decoration: underline; text-underline-offset: 3px; }
.card.is-breaking { --sec: var(--brand); }

/* ---------- ads ---------- */
.ad { margin: 20px auto; text-align: center; }
.ad-label { display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.ad-header { max-width: 1000px; padding: 0 16px; }
.ad-header, .ad-header_mobile { min-height: 50px; overflow: hidden; }
.ad iframe { max-width: 100%; }
/* Wide banners are scaled down to fit narrow screens (see footer script), never hidden. */
.ad-fit { display: inline-block; transform-origin: top left; }
@media (min-width: 760px) { .ad-header_mobile { display: none; } }

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

/* ---------- cards ---------- */
.kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 6px; color: var(--sec); font-weight: 600; font-size: 13px; letter-spacing: 0.02em; }
.kicker::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--sec); }
.card-title { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.16; letter-spacing: -0.01em; text-wrap: balance; }
.card[lang="si"] .card-title { font-family: var(--si-serif); font-weight: 700; line-height: 1.35; letter-spacing: 0; }
.card-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.card-standard .card-title { font-size: 21px; }
.card-compact .card-title { font-size: 17px; }
.card-lead .card-title { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.06; font-variation-settings: "opsz" 72; }
.card-dek { margin: 10px 0 0; color: var(--ink-2); font-size: 16px; }
.card-lead .card-dek { font-size: 19px; max-width: 60ch; }
.card-meta { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.card-media { display: block; margin-bottom: 12px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--tint); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- front page ---------- */
.top { display: grid; align-items: start; gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
@media (min-width: 900px) { .top { grid-template-columns: 1.7fr 1fr; gap: 44px; } }
.card-lead { border-left: 5px solid var(--sec); padding-left: 20px; }
.stack { display: grid; gap: 18px; align-content: start; }
.stack > .card + .card { border-top: 1px solid var(--rule); padding-top: 18px; }

.home-grid { display: grid; gap: 40px; padding-top: 28px; }
@media (min-width: 1040px) { .home-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
.block { margin-bottom: 40px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding-top: 10px; border-top: 5px solid var(--sec); }
.block-title { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 700; }
.block-title[lang="si"] { font-family: var(--si-serif); }
.block-more { font-size: 14px; font-weight: 600; color: var(--sec); }
.block-more:hover { text-decoration: underline; }
.block-grid { display: grid; gap: 22px; }
@media (min-width: 700px) { .block-grid { grid-template-columns: 1.3fr 1fr; gap: 32px; } }

/* ---------- latest timeline ---------- */
.rail { align-self: start; }
@media (min-width: 1040px) { .rail { position: sticky; top: 16px; } }
.rail-title { margin: 0 0 16px; padding-top: 10px; border-top: 5px solid var(--brand); font: 700 13px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; }
.latest { position: relative; list-style: none; margin: 0; padding: 0; }
.latest::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1px; background: var(--rule); }
.latest li { position: relative; padding: 0 0 16px 22px; }
.latest li::before { content: ""; position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--sec); box-shadow: 0 0 0 3px var(--paper); }
.latest time { display: block; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.latest a { font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.28; }
.latest li[lang="si"] a { font-family: var(--si-serif); font-weight: 700; }
.latest a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- article ---------- */
.article-grid { display: grid; gap: 44px; }
@media (min-width: 1040px) { .article-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
.article { max-width: 720px; }
.article-title { margin: 4px 0 0; font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 5vw, 46px); line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; font-variation-settings: "opsz" 72; }
.article[lang="si"] .article-title { font-family: var(--si-serif); line-height: 1.3; letter-spacing: 0; }
.article-dek { margin: 14px 0 0; font-size: 20px; line-height: 1.45; color: var(--ink-2); }
.article-meta { margin: 16px 0 0; padding-bottom: 16px; border-bottom: 1px solid var(--rule); font-size: 14px; color: var(--ink-2); }
.article-figure { margin: 22px 0 0; }
.article-figure figcaption { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.article-body { margin-top: 22px; font-family: var(--serif); font-size: 19px; line-height: 1.65; }
.article[lang="si"] .article-body { font-family: var(--si-sans); font-size: 18px; line-height: 1.85; }
.article-body p { margin: 0 0 1.1em; }
.article-body h2 { margin: 1.6em 0 0.6em; font-family: var(--sans); font-size: 22px; line-height: 1.25; }
.article-body a { text-decoration: underline; text-decoration-color: var(--sec); text-underline-offset: 3px; }
.article-body blockquote { margin: 1.4em 0; padding-left: 18px; border-left: 4px solid var(--sec); font-style: italic; }
.article-body ul { padding-left: 1.2em; }
.article-body .nap-source { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 14px; color: var(--ink-2); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; font-size: 14px; }
.share a { padding: 8px 15px; border: 1px solid var(--rule); border-radius: 999px; font-weight: 600; }
.share a:hover { border-color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding: 0; list-style: none; }
.tags a { display: block; padding: 4px 10px; background: var(--tint); border-radius: 4px; font-size: 13px; }
.related { margin-top: 48px; }
.related-grid { display: grid; gap: 22px; }
@media (min-width: 700px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- archives ---------- */
.archive-head { margin-bottom: 26px; padding-top: 12px; border-top: 5px solid var(--sec); }
.archive-title { margin: 0; font-family: var(--serif); font-size: clamp(30px, 5vw, 44px); line-height: 1.1; }
.archive-title[lang="si"] { font-family: var(--si-serif); }
.archive-list { display: grid; gap: 26px 32px; }
@media (min-width: 700px) { .archive-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .archive-list { grid-template-columns: repeat(3, 1fr); } }
.archive-list > .card { padding-top: 18px; border-top: 1px solid var(--rule); }
.empty { padding: 40px 0; color: var(--ink-2); }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 36px; }
.page-numbers { display: block; padding: 8px 13px; border: 1px solid var(--rule); border-radius: 6px; font-size: 14px; }
.page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.page-numbers:hover:not(.current) { border-color: var(--ink); }

/* ---------- pages ---------- */
.page-body { max-width: 720px; }

/* ---------- footer ---------- */
.site-foot { margin-top: 24px; padding: 40px 0 28px; background: var(--ink); color: #c9cdd3; font-size: 14px; }
.site-foot .brand-en { color: #fff; font-size: 34px; }
.foot-in { display: grid; gap: 28px; }
@media (min-width: 760px) { .foot-in { grid-template-columns: 1fr auto; align-items: end; } }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 0; padding: 0; }
.foot-links a:hover { color: #fff; text-decoration: underline; }
.foot-note { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid #2c3038; font-size: 13px; color: #8d939c; }
