/* Kotgadi — the unbiased wire */
:root {
  --paper: #f6f2e9;
  --ink: #17150f;
  --ink-soft: #5c574b;
  --rule: #d8d2c2;
  --accent: #b3261e;
  --card: #fffdf8;
  --ne: "Noto Sans Devanagari", "Mangal", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Noto Serif Devanagari", serif;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 3px double var(--ink); background: var(--card); }
.masthead-inner {
  max-width: 1080px; margin: 0 auto; padding: 18px 20px 10px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.mark { width: 52px; height: 52px; object-fit: contain; }
.masthead-titles { flex: 1; min-width: 260px; }
.masthead-titles h1 {
  margin: 0; font-size: 44px; letter-spacing: 2px; line-height: 1.05;
  font-family: var(--ne);
}
.masthead-titles .latin {
  font-family: Georgia, serif; font-size: 18px; letter-spacing: 6px;
  color: var(--ink-soft); margin-left: 10px;
}
.tagline { margin: 4px 0 0; color: var(--ink-soft); font-style: italic; font-size: 14px; }
.masthead-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.dateline { font-size: 12px; color: var(--ink-soft); }
.lang-toggle { display: flex; border: 1.5px solid var(--ink); }
.lang-toggle button {
  padding: 5px 14px; border: 0; background: transparent; font-size: 13px;
  font-weight: 700; color: var(--ink-soft);
}
.lang-toggle button.active { background: var(--ink); color: var(--paper); }

/* ---------- section nav ---------- */
.section-nav {
  max-width: 1080px; margin: 0 auto; padding: 0 20px 10px;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.chip {
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  padding: 5px 14px; font-size: 13px; font-weight: 700; letter-spacing: .4px;
  border-radius: 999px; transition: all .15s;
}
.chip:hover { background: #ece5d4; }
.chip.active { background: var(--ink); color: var(--paper); }
.chip.active[data-key="breaking"] { background: var(--accent); border-color: var(--accent); }
.chip .count {
  font-size: 11px; font-weight: 400; opacity: .75; margin-left: 6px;
}

/* ---------- front ---------- */
.front { max-width: 1080px; margin: 0 auto; padding: 22px 20px 40px; }
.section-head { border-bottom: 1.5px solid var(--ink); padding-bottom: 8px; margin-bottom: 18px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 {
  margin: 0; font-size: 26px; letter-spacing: 1px;
  font-family: var(--ne);
}
#front[data-section="breaking"] .section-head h2 { color: var(--accent); }
.section-note { margin: 0; color: var(--ink-soft); font-size: 13px; font-style: italic; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.card {
  display: block; background: var(--card); border: 1px solid var(--rule);
  border-top: 4px solid var(--ink); padding: 16px 16px 12px; text-decoration: none;
  color: inherit; transition: transform .12s, box-shadow .12s;
  position: relative;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(23, 21, 15, .12); }
.card.breaking { border-top-color: var(--accent); }
.card .kicker {
  display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap;
}
.badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .6px; padding: 2px 8px;
  border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-soft);
  text-transform: uppercase;
}
.badge.breaking { background: var(--accent); border-color: var(--accent); color: #fff; }
.badge.imp { border: 0; color: #fff; }
.imp-9-10 { background: #b3261e; }
.imp-7-8  { background: #d4622a; }
.imp-5-6  { background: #b8860b; }
.imp-low  { background: #8a94a0; }
.card h3 {
  margin: 0 0 8px; font-size: 18px; line-height: 1.32;
  font-family: "Noto Sans Devanagari", var(--ne), Georgia, serif;
}
.card p.snippet {
  margin: 0 0 12px; font-size: 14px; color: var(--ink-soft); line-height: 1.55;
  font-family: "Noto Sans Devanagari", Georgia, serif;
}
.card .meta {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  border-top: 1px solid var(--rule); padding-top: 8px; font-size: 12px;
  color: var(--ink-soft);
}
.card .src { font-weight: 700; letter-spacing: .4px; }
.card .clock { opacity: .8; }
.card .ext { font-size: 11px; }

.empty {
  text-align: center; color: var(--ink-soft); font-style: italic;
  padding: 60px 20px; border: 1.5px dashed var(--rule); background: var(--card);
}

/* ---------- colophon ---------- */
.colophon {
  border-top: 3px double var(--ink); background: var(--card);
  max-width: 1080px; margin: 0 auto; padding: 18px 20px 30px;
  color: var(--ink-soft); font-size: 13px;
}
.colophon .fine { font-size: 12px; opacity: .8; }

@media (max-width: 640px) {
  .masthead-titles h1 { font-size: 34px; }
  .masthead-tools { align-items: flex-start; }
  .grid { grid-template-columns: 1fr; }
}
/* ---------- briefings edition ---------- */
.card { display: block; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card h3 a::after { content: " \2197"; font-size: 12px; color: var(--ink-soft); }
.lead {
  margin: 0 0 10px; font-size: 14.5px; line-height: 1.6; color: var(--ink);
  font-family: "Noto Sans Devanagari", Georgia, serif;
}
.balance {
  margin: 0 0 8px; font-size: 12px; color: #6b6455; font-style: italic;
  border-left: 3px solid #c9c2b0; padding-left: 8px;
}
.diverge {
  margin: 0 0 8px; font-size: 12.5px; color: #8a6d1a;
  background: #f7f0dd; border: 1px solid #e8dcc0; border-radius: 6px; padding: 6px 9px;
}
.angles {
  list-style: none; margin: 0 0 8px; padding: 8px 10px;
  background: #f4efe3; border-radius: 6px;
}
.angles li { font-size: 12.5px; color: #4c463a; margin: 0 0 5px; line-height: 1.5; }
.angles li:last-child { margin-bottom: 0; }
.versions { list-style: none; margin: 6px 0 10px; padding: 8px 0 0; border-top: 1px solid var(--rule); }
.versions li { font-size: 12.5px; margin: 0 0 4px; }
.versions li a { color: var(--ink); text-decoration: none; font-weight: 600; }
.versions li a:hover { color: var(--accent); text-decoration: underline; }
.vs { color: var(--ink-soft); font-size: 11px; margin-left: 6px; }
.langtag {
  display: inline-block; min-width: 22px; text-align: center; font-size: 10px;
  font-weight: 700; color: var(--ink-soft); border: 1px solid var(--rule);
  border-radius: 4px; padding: 0 4px; margin-right: 6px; text-transform: uppercase;
}


/* full LLM-written article + clickable "sources" disclosure */
.article { margin: 2px 0 10px; }
.article p { margin: 0 0 9px; line-height: 1.62; font-size: 14.5px; }
.article p:last-child { margin-bottom: 0; }
.sources { background: none; border: 0; padding: 0; margin: 6px 0 0;
  font-size: 11.5px; letter-spacing: .4px; color: var(--accent);
  cursor: pointer; text-transform: none; font-family: inherit; }
.sources::after { content: " \25be"; opacity: .7; }
.sources.open::after { content: " \25b8"; opacity: .7; }
.card .versions { display: none; list-style: none; margin: 8px 0 0;
  padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px;
  background: #faf6ee; }
.card .versions.open { display: block; }
.rbody { font-size: 13px; color: var(--ink-soft); margin: 6px 0 0;
  line-height: 1.55; }

/* archive link in the masthead */
.masthead-tools a.archive-link {
  display: inline-block; margin-left: 12px; padding: 2px 12px;
  border: 1px solid #cfc8b8; border-radius: 999px;
  color: inherit; text-decoration: none;
  font-size: 12px; letter-spacing: .5px; text-transform: uppercase;
}
.masthead-tools a.archive-link:hover { background: #f0ebdf; }

/* MT badge: story contains machine-translated text */
.badge.mt { background: #f3ead6; }

/* editor re-score control (admin queue) */
.rescore { display: flex; align-items: center; gap: 6px;
           margin-top: 6px; }
.rescore label { font-size: 12px; opacity: .8; }
.rescore input { width: 52px; }
.rescore .rs-msg { font-size: 12px; opacity: .85; }

.editbox { margin-top: 8px; padding: 10px; background: #fbf9f4;
            border: 1px dashed #c9c2b2; border-radius: 8px; }
.editbox b { display: block; margin: 8px 0 4px; font-size: 11px;
             letter-spacing: 1px; }
.editbox input[type=text], .editbox textarea {
    width: 100%; box-sizing: border-box; font: inherit; padding: 6px;
    border: 1px solid #ccc; border-radius: 6px; margin-bottom: 4px; }
.editbox textarea { min-height: 90px; }
.editbox .edrow { font-size: 13px; margin-bottom: 4px; }
.editbox label { font-size: 12px; margin-right: 12px; }

.site-ok { color: #2e7d32; }
.site-error { color: #b3261e; word-break: break-word; }
.site-building { color: #8a6d1a; }
.site-idle { color: #888; }

/* static source count (the per-source rows were removed on request) */
.sources.static { display:inline-block; margin-top:8px; font-size:12px;
  letter-spacing:.04em; color:var(--muted,#6b665c); border:1px solid var(--line,#d9d2c3);
  border-radius:999px; padding:3px 10px; background:#fff; cursor:default; }

/* folded list of source links at the bottom of each card */
.sources-fold { margin-top:10px; border-top:1px dotted var(--line,#d9d2c3); padding-top:8px; }
.sources-fold > summary { cursor:pointer; font-size:12px; letter-spacing:.04em;
  color:var(--muted,#6b665c); display:inline-flex; align-items:center; gap:6px; }
.sources-fold > summary::-webkit-details-marker { display:none; }
.sources-fold > summary::before { content:"\25B8"; font-size:10px; transition:transform .15s ease; }
.sources-fold[open] > summary::before { transform:rotate(90deg); }
.sources-fold ul { margin:8px 0 0; padding:0; list-style:none; display:grid; gap:6px; }
.sources-fold li { font-size:13px; line-height:1.35; color:var(--ink,#17150f);
  padding-left:10px; border-left:2px solid var(--line,#d9d2c3); }
.sources-fold li a { color:var(--ink,#17150f); text-decoration:none; border-bottom:1px solid rgba(23,21,15,.25); }
.sources-fold li a:hover { border-bottom-color:var(--ink,#17150f); }
.sources-fold .vs { color:var(--muted,#6b665c); font-size:11px; letter-spacing:.03em; text-transform:uppercase; }

/* "new edition available" bar */
#new-edition { position:fixed; left:50%; bottom:18px; transform:translateX(-50%);
  z-index:50; display:flex; align-items:center; gap:12px;
  background:var(--ink,#17150f); color:var(--paper,#f6f2e9);
  padding:10px 14px; border-radius:999px; font-size:13px;
  box-shadow:0 8px 24px rgba(0,0,0,.25); }
#new-edition button { font:inherit; cursor:pointer; border-radius:999px;
  padding:5px 12px; border:1px solid currentColor; background:transparent;
  color:inherit; }
#new-edition #ne-reload { background:#c9a227; border-color:#c9a227; color:#17150f;
  font-weight:600; }

/* In-depth analysis band, above the daily briefs ------------------------ */
.indepth { margin: 4px 0 26px; }
.indepth-head { margin-bottom: 10px; }
.indepth-head h2 .ne { font-family: var(--ne); font-weight: 500;
  color: var(--ink-soft); font-size: .78em; letter-spacing: 0; }
.indepth-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.indepth-card { display: block; text-decoration: none; color: inherit;
  border-top: 3px solid var(--accent); }
.indepth-card:hover { text-decoration: none; }
.indepth-card h3 { margin: 8px 0 6px; font-size: 22px; }
.indepth-card h3::after { content: none; }
.indepth-card .indepth-lead { display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.indepth-badge { background: var(--accent); color: #fff; border-color: var(--accent); }
.indepth-cta { display: inline-block; margin-top: 12px; font-size: 11px;
  font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); border-bottom: 2px solid #c9a227; padding-bottom: 2px; }
.indepth-card:hover .indepth-cta { color: var(--accent); }

/* the All News header now sits under the in-depth band */
.indepth { margin: 4px 0 22px; }
.indepth + .section-head { margin-top: 6px; }

/* ---------- hand-written (staff) news: images, badge, byline ---------- */
.badge.staff { background: #e8e2d2; border-color: #cfc4a9; color: #4c463a; }
.card .byline { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted, #6b665c); font-weight: 600; }
.gallery { margin: 0 0 10px; }
.gallery.solo figure { margin: 0; }
.gallery.solo img { width: 100%; height: auto; max-height: 460px;
  object-fit: cover; border-radius: 6px; border: 1px solid var(--rule); }
.gallery.multi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gallery.multi figure:first-child { grid-column: 1 / -1; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: auto; display: block;
  border-radius: 5px; border: 1px solid var(--rule);
  max-height: 340px; object-fit: cover; }
.gallery figcaption { font-size: 11.5px; color: var(--muted, #6b665c);
  margin-top: 3px; line-height: 1.35; }
@media (max-width: 640px) {
  .gallery.multi { grid-template-columns: 1fr; }
  .gallery.multi figure:first-child { grid-column: auto; }
}

/* admin: news composer + image well (admin page) */
.composer { margin: 14px 0; padding: 14px 16px; background: #fbf9f4;
  border: 1.5px solid #c9c2b2; border-radius: 10px; }
.composer h2 { margin: 0 0 10px; font-size: 16px; }
.composer .row { display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center; margin-bottom: 10px; }
.composer label { font-size: 12.5px; color: #4c463a; margin-right: 6px; }
.composer select, .composer input[type=text], .composer input[type=number] {
  font: inherit; padding: 6px 8px; border: 1px solid #ccc; border-radius: 6px; }
.composer textarea { width: 100%; box-sizing: border-box; font: inherit;
  padding: 8px; border: 1px solid #ccc; border-radius: 6px; min-height: 90px;
  margin-top: 4px; }
.composer .field { margin-bottom: 8px; }
.composer .field > b { display: block; font-size: 11px; letter-spacing: .8px;
  text-transform: uppercase; color: #6b665c; margin-bottom: 4px; }
.imgwell { border: 1.5px dashed #c9c2b2; border-radius: 8px; padding: 10px;
  background: #fff; }
.imgwell.dragover { border-color: var(--accent); background: #f7f0dd; }
.imgwell .hint { font-size: 12px; color: #8a8578; margin-bottom: 8px; }
.thumb { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.thumb img { width: 96px; height: 72px; object-fit: cover; border-radius: 5px;
  border: 1px solid var(--rule); flex: 0 0 auto; }
.thumb .tinfo { flex: 1; min-width: 0; }
.thumb input[type=text] { width: 100%; box-sizing: border-box; font: inherit;
  font-size: 12.5px; padding: 5px 7px; border: 1px solid #ccc; border-radius: 5px; }
.thumb .rm { font-size: 11px; color: #b3261e; cursor: pointer;
  background: none; border: 1px solid #d8b4b2; border-radius: 5px;
  padding: 2px 8px; margin-top: 5px; }
.thumb .up { font-size: 11px; color: #8a6d1a; }
.composer .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.composer .actions button { padding: 8px 16px; border-radius: 6px;
  font-weight: 700; font-size: 13px; cursor: pointer; border: 1px solid var(--rule); }
.composer .btn-save { background: #fff; color: var(--ink); }
.composer .btn-pub { background: var(--accent); border-color: var(--accent); color: #fff; }
.composer .btn-cancel { background: none; }
.composer .composer-msg { font-size: 12.5px; margin-top: 8px; }
.mystory { border-top: 1px dashed var(--rule); padding: 6px 2px 10px; }
.mystory .ms-row { display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; margin-bottom: 6px; }
.mystory .ms-row a { font-size: 13px; }
.mystory .ms-actions { margin-left: auto; display: flex; gap: 6px; }
.mystory .ms-actions button { font-size: 11.5px; padding: 3px 9px;
  border-radius: 5px; border: 1px solid var(--rule); background: #fff;
  cursor: pointer; }
.mystory .ms-actions button.del { color: #b3261e; border-color: #d8b4b2; }
.mystory .ms-actions button.busy { opacity: .55; cursor: default; }

/* ---------- Facebook share chips (briefings + in-depth cards) ---------- */
.share-fb {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0;
  background: #1877f2; color: #fff; cursor: pointer; flex: 0 0 auto;
  transition: transform .12s, box-shadow .12s;
}
.share-fb::before { content: "f"; font: 800 14px/1 Arial, Helvetica, sans-serif;
  margin-top: -2px; }
.share-fb:hover, .share-fb:focus-visible {
  transform: scale(1.15); box-shadow: 0 3px 12px rgba(24, 119, 242, .45);
  outline: none;
}
/* briefing cards: right end of the meta row */
.card .meta .share-fb { margin-left: auto; }
/* in-depth cards: below the "read the analysis" CTA, right-aligned */
.indepth-card .share-fb { display: flex; margin-top: 12px; margin-left: auto; }
