/* Sri-Lanka.energy — prototype styles */
:root {
  --brand: #0b3d4a;
  --brand-2: #135b6b;
  --amber: #f2a900;
  --ink: #16191d;
  --ink-2: #4a525c;
  --ink-3: #7a838d;
  --line: #e3e6ea;
  --bg: #f4f2ee;
  --card: #ffffff;
  --lk: #1e9e4a;      /* Sri Lanka stripe */
  --mv: #1f6fd1;      /* Maldives stripe */
  --s-power: #6b3fa0;
  --s-renew: #d98a00;
  --s-fuel: #d0432b;
  --s-policy: #a8326e;
  --s-business: #7a5a2e;
  --up: #c0392b;
  --down: #1e9e4a;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover .hl, a:hover.hl { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.hide { display: none !important; }

/* ---------- top bar & masthead ---------- */
.topbar { background: var(--brand); color: #cfe3e8; font-size: 13px; }
.topbar .wrap { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 6px 16px; }
.topbar a { color: #fff; }
.proto-badge { background: var(--amber); color: #2a1f00; font-weight: 700; border-radius: 3px; padding: 1px 7px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.wrap { max-width: 1320px; margin: 0 auto; }
.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.masthead .wrap { display: flex; align-items: center; gap: 18px; padding: 14px 16px 10px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo svg { width: 42px; height: 42px; flex: none; }
.wordmark { font-family: var(--serif); font-weight: 800; font-size: 34px; letter-spacing: -.02em; color: var(--brand); line-height: 1; }
.wordmark span { color: var(--amber); }
.tagline { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.masthead .spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #2a1f00; }
.btn.danger { color: #b3261e; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }

nav.sections { background: #fff; border-bottom: 3px solid var(--brand); position: sticky; top: 0; z-index: 50; }
nav.sections .wrap { display: flex; gap: 2px; overflow-x: auto; padding: 0 8px; scrollbar-width: none; }
nav.sections .wrap::-webkit-scrollbar { display: none; }
nav.sections a { white-space: nowrap; padding: 11px 12px 9px; font-weight: 700; font-size: 14px; border-bottom: 4px solid transparent; margin-bottom: -3px; }
nav.sections a:hover { background: #f6f7f8; }
nav.sections a.on { border-bottom-color: var(--c, var(--brand)); }
nav.sections a .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }

/* ---------- page grid with side ads ---------- */
.page { display: grid; grid-template-columns: 160px minmax(0, 1fr) 160px; gap: 20px; max-width: 1320px; margin: 0 auto; padding: 16px; }
.side-ad { position: sticky; top: 64px; align-self: start; }
.main { min-width: 0; }
@media (max-width: 1220px) { .page { grid-template-columns: minmax(0, 1fr); } .side-ad { display: none; } }

/* ---------- ads ---------- */
.ad { position: relative; text-align: center; }
.ad .ad-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; display: block; }
.ad img { margin: 0 auto; border: 1px solid var(--line); background: #fff; }
/* Top banner spans the full page grid: from the left edge of the left side ad to the right edge of the right one. */
.ad.top { margin: 14px auto 0; max-width: 1320px; padding: 0 16px; }
.ad.top img, .ad.top .house { width: 100%; height: auto; }
.ad.feed { margin: 6px 0 22px; }
.ad.feed img { width: 100%; height: auto; display: block; }
.ad.house { border: 2px dashed #cbd1d6; border-radius: 6px; padding: 22px; color: var(--ink-2); background: #fafafa; }
.ad.house b { color: var(--brand); }

/* ---------- story cards ---------- */
.card { position: relative; background: var(--card); border-left: 5px solid var(--lk); display: block; overflow: hidden; }
.card.mv { border-left-color: var(--mv); }
.card .img { aspect-ratio: 16/9; background: #dfe3e6; overflow: hidden; position: relative; }
.card .img img { width: 100%; height: 100%; object-fit: cover; }
.card .txt { padding: 12px 16px 16px; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.kicker .sp { color: #8a6d00; background: #fff4cc; padding: 1px 6px; border-radius: 3px; margin-left: 6px; letter-spacing: .04em; }
.hl { font-family: var(--serif); font-weight: 800; letter-spacing: -.01em; line-height: 1.12; margin: 4px 0 6px; }
.stand { color: var(--ink-2); margin: 0; }
.meta { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.meta .pin { color: #b3261e; font-weight: 700; }
.card.sponsored { background: #fffbea; }
/* Country tag, bottom right of every story card: green frame for Sri Lanka, blue for the Maldives. */
.card .ctry { position: absolute; right: 12px; bottom: 12px; border: 2px solid var(--lk); color: #15763a; background: #e2f4e8; border-radius: 4px; padding: 2px 8px; font: 700 11px/1.3 var(--sans); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.card.mv .ctry { border-color: var(--mv); color: #1756a8; background: #e3edfb; }
.card .meta { padding-right: 100px; min-height: 22px; align-items: center; }

.lead-full { margin-bottom: 22px; }
.lead-full .card.xl .img { aspect-ratio: 21/9; }
.row-lead { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; margin-bottom: 22px; align-items: start; }
.card.xl .hl { font-size: clamp(28px, 3.4vw, 44px); }
.card.xl .stand { font-size: 18px; }
.card.lg .hl { font-size: clamp(24px, 2.6vw, 34px); }
.card.lg { margin-bottom: 22px; }
.card.lg .img { aspect-ratio: 21/9; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 22px; }
.card.md .hl { font-size: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.card.sm .hl { font-size: 17px; }
.card.sm .txt { padding: 10px 12px 12px; }
.card.sm .stand { display: none; }
.headlines { background: #fff; padding: 6px 16px; margin-bottom: 22px; }
.headlines h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 10px 0 4px; }
.hlrow { display: grid; grid-template-columns: 5px 1fr auto; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); align-items: baseline; }
.hlrow:first-of-type { border-top: 0; }
.hlrow .bar { align-self: stretch; background: var(--lk); border-radius: 2px; }
.hlrow.mv .bar { background: var(--mv); }
.hlrow .hl { font-size: 16px; margin: 0; font-family: var(--sans); font-weight: 700; }
.hlrow .kicker { font-size: 11px; margin-right: 8px; }
@media (max-width: 900px) { .row-lead { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .card.md .hl { font-size: 20px; } .page { padding: 12px; } }

/* illustrated fallback image */
.illus { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: space-between; padding: 12px 14px; color: #fff; background: linear-gradient(135deg, var(--c) 0%, color-mix(in srgb, var(--c) 55%, #0b1a20) 100%); position: relative; }
.illus svg { position: absolute; right: 8%; top: 12%; width: 38%; height: 76%; opacity: .28; }
.illus small { font-size: 11px; opacity: .85; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }

/* ---------- side column next to lead ---------- */
.lead-side { display: flex; flex-direction: column; gap: 16px; }
.prices { background: #fff; border-top: 5px solid var(--lk); }
.prices.mv { border-top-color: var(--mv); }
.prices header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 4px; gap: 8px; flex-wrap: wrap; }
.prices h2, .tabs button { white-space: nowrap; }
.prices h2 { font-size: 15px; margin: 0; text-transform: uppercase; letter-spacing: .06em; }
.tabs { display: flex; gap: 4px; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 3px 10px; cursor: pointer; color: var(--ink-2); }
.tabs button.on.lk { background: var(--lk); border-color: var(--lk); color: #fff; }
.tabs button.on.mv { background: var(--mv); border-color: var(--mv); color: #fff; }
.prices .eff { font-size: 12px; color: var(--ink-3); padding: 0 14px 6px; }
.plist { list-style: none; margin: 0; padding: 0 14px; }
.plist li { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line); gap: 8px; }
.plist .nm { font-weight: 600; font-size: 14.5px; }
.plist .nm small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11.5px; }
.plist .pr { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 16px; white-space: nowrap; }
.chg { font-size: 12px; font-weight: 700; margin-left: 6px; }
.chg.up { color: var(--up); } .chg.down { color: var(--down); } .chg.flat { color: var(--ink-3); }
.prices footer { padding: 8px 14px 12px; font-size: 13px; }
.prices footer a { color: var(--brand-2); font-weight: 700; }
.prices .empty { padding: 10px 14px 14px; font-size: 14px; color: var(--ink-2); }
@media (max-width: 900px) {
  .prices .plist { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .prices .plist li { flex: 0 0 auto; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; scroll-snap-align: start; min-width: 132px; }
}

.mostread { background: #fff; padding: 10px 14px 6px; }
.mostread h2 { font-size: 15px; margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; }
.mostread ol { list-style: none; padding: 0; margin: 0; counter-reset: mr; }
.mostread li { counter-increment: mr; display: grid; grid-template-columns: 30px 1fr; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
.mostread li::before { content: counter(mr); font-family: var(--serif); font-size: 26px; font-weight: 800; color: var(--amber); line-height: 1; }
.mostread a { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.latest { background: #fff; padding: 10px 14px 6px; }
.latest h2 { font-size: 15px; margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; }
.latest ul { list-style: none; padding: 0; margin: 0; }
.latest li { padding: 8px 0; border-top: 1px solid var(--line); }
.latest li[hidden], .latest[hidden] { display: none; }
.latest .when { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.latest .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lk); flex: none; }
.latest li.mv .dot { background: var(--mv); }
.latest a { display: block; font-weight: 700; font-size: 14.5px; line-height: 1.25; }

.subscribe { background: var(--brand); color: #fff; padding: 18px 20px; margin-bottom: 22px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.subscribe h3 { margin: 0 0 3px; font-family: var(--serif); font-size: 22px; }
.subscribe p { margin: 0; color: #cfe3e8; font-size: 14px; }
.subscribe form { display: flex; gap: 8px; }
.subscribe input { border: 0; border-radius: 999px; padding: 9px 14px; min-width: 230px; }
.subscribe .ok { color: var(--amber); font-weight: 700; }
@media (max-width: 700px) { .subscribe { grid-template-columns: 1fr; } .subscribe input { min-width: 0; flex: 1; } }

/* ---------- article page ---------- */
.article { background: #fff; padding: 24px clamp(16px, 4vw, 48px) 32px; border-left: 6px solid var(--lk); }
.article.mv { border-left-color: var(--mv); }
.article h1 { font-family: var(--serif); font-size: clamp(30px, 4vw, 46px); line-height: 1.08; margin: 6px 0 10px; letter-spacing: -.015em; }
.article .lede { font-size: 20px; color: var(--ink-2); margin: 0 0 14px; }
.article figure { margin: 16px 0; }
.article figcaption { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.article .body { max-width: 680px; font-family: var(--serif); font-size: 19px; line-height: 1.6; }
.article .body p { margin: 0 0 1em; }
.article .body h2 { font-family: var(--sans); font-size: 21px; margin: 1.4em 0 .4em; }
.notice { background: #fff8e1; border: 1px solid #f1d98a; border-radius: 6px; padding: 10px 14px; font-size: 14px; color: #5a4600; margin: 12px 0; max-width: 680px; }
.notice.sp { background: #fff4cc; }
.sources { max-width: 680px; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 10px; font-size: 14px; }
.sources a { color: var(--brand-2); text-decoration: underline; }
.chartbox { max-width: 680px; margin: 18px 0; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.chartbox h4 { margin: 0 0 8px; font-family: var(--sans); font-size: 15px; }

.sec-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.sec-head h1 { margin: 0; font-family: var(--serif); font-size: 34px; }
.sec-head .sw { width: 14px; height: 34px; background: var(--c); border-radius: 3px; }
.sec-head p { margin: 0; color: var(--ink-2); }
.related { margin-top: 26px; }
.related h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }

/* ---------- atlas ---------- */
.panel { background: #fff; padding: 18px 20px; margin-bottom: 20px; }
.panel h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 26px; }
.panel h3 { margin: 14px 0 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { background: #fff; padding: 16px; border-top: 4px solid var(--brand); display: block; }
.tile:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.tile h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 21px; }
.tile p { margin: 0; color: var(--ink-2); font-size: 14px; }
.checked { display: inline-block; font-size: 12px; color: #1d6b3a; background: #e8f5ec; border-radius: 3px; padding: 1px 7px; }
.org { border-left: 5px solid var(--lk); padding: 12px 14px; background: #fff; margin-bottom: 12px; }
.org.mv { border-left-color: var(--mv); }
.org h3 { margin: 0; font-size: 18px; }
.org .type { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.org .head { margin-top: 6px; font-size: 14px; }
.org p { margin: 6px 0; font-size: 14.5px; color: var(--ink-2); }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .cols-2 { grid-template-columns: 1fr; } }
.map { height: 520px; border: 1px solid var(--line); background: #e9eef0; }
.map.short { height: 300px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 8px 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
.legend i.dot { width: 10px; height: 10px; border-radius: 50%; }
.stat { display: inline-block; margin-right: 22px; }
.stat b { display: block; font-size: 26px; font-family: var(--serif); }
.stat span { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.supplier { background: #fff; padding: 12px 14px; border-left: 5px solid var(--lk); margin-bottom: 10px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.supplier.mv { border-left-color: var(--mv); }
.supplier.featured { background: #fffbea; box-shadow: inset 0 0 0 2px #f2d16b; }
.supplier h4 { margin: 0; font-size: 17px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 3px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.badge.feat { background: var(--amber); color: #2a1f00; }
.badge.sample { background: #eceff1; color: #546e7a; }
.badge.pending { background: #fde7e9; color: #9b1c2c; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; max-width: 760px; }
.formgrid label, .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.formgrid .full { grid-column: 1 / -1; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=month], input[type=search], input[type=url], select, textarea {
  border: 1px solid #cfd5da; border-radius: 6px; padding: 8px 10px; background: #fff; color: var(--ink); font-weight: 400; font-size: 15px; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
@media (max-width: 640px) { .formgrid { grid-template-columns: 1fr; } }
.msg { padding: 8px 12px; border-radius: 6px; font-size: 14px; margin: 10px 0; }
.msg.ok { background: #e8f5ec; color: #1d6b3a; }
.msg.err { background: #fde7e9; color: #9b1c2c; }

/* ---------- footer ---------- */
footer.site { background: var(--brand); color: #cfe3e8; margin-top: 30px; font-size: 14px; }
footer.site .wrap { padding: 26px 16px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; }
footer.site a { color: #fff; }
footer.site h4 { color: #fff; margin: 0 0 6px; }
footer.site p { margin: 4px 0; }
@media (max-width: 700px) { footer.site .wrap { grid-template-columns: 1fr; } }
.leaflet-popup-content { font-family: var(--sans); }
.osm-tiles { filter: saturate(.35) brightness(1.04); }
.leaflet-popup-content a { color: var(--brand-2); font-weight: 700; }

/* ---------- phones ---------- */
.menu-btn, nav.sections a.m-only { display: none; }
.row-lead > *, .cols-2 > * { min-width: 0; }  /* let the scrolling price chips scroll inside the column instead of widening the page */
@media (max-width: 620px) {
  .topbar .wrap { padding: 5px 12px; font-size: 12px; }
  .masthead .wrap { padding: 10px 12px; gap: 10px; }
  .masthead .btn { display: none; }
  .logo { gap: 8px; min-width: 0; }
  .logo svg { width: 32px; height: 32px; }
  .wordmark { font-size: 24px; white-space: nowrap; }
  .tagline { font-size: 11.5px; line-height: 1.3; }
  /* Hamburger menu: the section menu is hidden until the ☰ button opens it as a full-width list. */
  .menu-btn { display: flex; flex-direction: column; justify-content: center; gap: 5px; margin-left: auto; flex: none; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
  .menu-btn span { display: block; height: 3px; border-radius: 2px; background: var(--brand); transition: transform .2s, opacity .2s; }
  body.menu-open .menu-btn span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  body.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
  body.menu-open .menu-btn span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  nav.sections { display: none; }
  body.menu-open nav.sections { display: block; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
  nav.sections .wrap { flex-direction: column; gap: 0; overflow: visible; padding: 4px 0 8px; }
  nav.sections a { padding: 13px 16px; font-size: 15px; margin: 0; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
  nav.sections a.on { border-bottom-color: var(--line); border-left-color: var(--c, var(--brand)); background: #f6f7f8; }
  nav.sections a.m-only { display: block; font-weight: 600; }
  .ad.top { margin-top: 10px; padding: 0 12px; }
  .ad.feed { margin: 4px 0 16px; }
  .lead-full .card.xl .img { aspect-ratio: 16/9; }
  .card.xl .hl { font-size: 30px; }
  .card.xl .stand { font-size: 16px; }
  .card.lg .hl { font-size: 24px; }
  .card.lg .img { aspect-ratio: 16/9; }
  .card .txt { padding: 10px 12px 14px; }
  .lead-full, .card.lg, .row-lead, .grid-2, .grid-3 { margin-bottom: 14px; }
  .grid-2, .grid-3, .row-lead { gap: 14px; }
}
