/* XEEIN News: its own look. News red and deep navy, a colour for each category, dark by default
   (a light version for people whose phone is set to light). Sinhala first: Noto Sans Sinhala for Sinhala text. */
@font-face { font-family: 'Anton'; src: url(/fonts/anton-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fonts/inter-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fonts/inter-latin-600-normal.woff2) format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fonts/inter-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fonts/inter-latin-800-normal.woff2) format('woff2'); font-weight: 800 900; font-display: swap; }
@font-face { font-family: 'Noto Sans Sinhala'; src: url(/fonts/noto-sans-sinhala-sinhala-400-normal.woff2) format('woff2'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Noto Sans Sinhala'; src: url(/fonts/noto-sans-sinhala-sinhala-700-normal.woff2) format('woff2'); font-weight: 600 900; font-display: swap; }

:root {
  --bg: #0a0f1c; --bg-2: #0e1525; --card: #111a2c; --line: #213049; --text: #f1f3f8; --muted: #a4adc0; --dim: #6c7891;
  --red: #e3172b; --red-hi: #ff3347; --brand: linear-gradient(100deg, #ff3347, #c8102e);
  --radius: 20px; --wrap: 1200px;
  --font: 'Noto Sans Sinhala', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f6f5f2; --bg-2: #ffffff; --card: #ffffff; --line: #e6e3dc; --text: #121318; --muted: #535866; --dim: #858a96; color-scheme: light; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16.5px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
html[lang="en"] body { font-family: 'Inter', 'Noto Sans Sinhala', system-ui, sans-serif; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }

/* top bar: logo, language, categories */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo img { width: 38px; height: 38px; }
.logo .word { display: flex; align-items: baseline; gap: 6px; font-family: 'Inter', sans-serif; font-size: 1.32rem; letter-spacing: .02em; line-height: 1; }
.logo .word b { font-weight: 900; }
.logo .word i { font-style: normal; font-weight: 900; color: #fff; background: var(--red); padding: 4px 7px 3px; border-radius: 6px; font-size: .92em; }
.lang { margin-left: auto; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.lang button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .88rem; line-height: 1; cursor: pointer; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-top: 2px; padding-bottom: 12px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--card); padding: 7px 14px; border-radius: 999px; font-size: .9rem; font-weight: 600; cursor: pointer; color: var(--muted); transition: transform .15s, background .15s; }
.cats button i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.cats button:hover { color: var(--text); transform: translateY(-1px); }
.cats button[aria-pressed="true"] { color: #fff; background: var(--c, var(--red)); border-color: transparent; }
.cats button.cat-all[aria-pressed="true"] { background: var(--brand); }
.cats button[aria-pressed="true"] i { background: #fff; }

/* hero */
.hero { padding: 44px 20px 18px; }
.kicker { margin: 0 0 8px; font-weight: 700; font-size: .85rem; letter-spacing: .06em; color: var(--red-hi); display: inline-block; }
.hero-t { margin: 0; font-size: clamp(2rem, 5.4vw, 3.6rem); line-height: 1.2; font-weight: 800; letter-spacing: -.01em; max-width: 900px; }
html[lang="en"] .hero-t { font-family: 'Inter', sans-serif; font-weight: 900; letter-spacing: -.03em; }
.hero-s { margin: 12px 0 0; color: var(--muted); font-size: 1.08rem; max-width: 680px; }

/* a day: date, how many of ten, a dot per category */
.day-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 26px 0 18px; }
.day-t { margin: 0; font-size: 1.15rem; font-weight: 700; }
.count { font-family: 'Inter', sans-serif; font-weight: 800; font-size: .85rem; padding: 4px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.dots { display: flex; gap: 5px; }
.dots i { width: 22px; height: 6px; border-radius: 6px; background: var(--line); }
.dots i.on { background: var(--c); }

/* the cards */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 55%, var(--line)); box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--c) 60%, transparent); }
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c); z-index: 2; }
.pic { position: relative; display: block; background: #0a0f1c; }
.cv { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; }
.num { position: absolute; left: 12px; bottom: 12px; font-family: 'Inter', sans-serif; font-weight: 900; font-size: .8rem; color: #fff; background: rgba(0,0,0,.45); padding: 3px 8px; border-radius: 8px; backdrop-filter: blur(6px); }
.body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.chip { font-size: .78rem; font-weight: 700; color: #fff; background: var(--c); padding: 3px 10px; border-radius: 999px; }
.ok { font-size: .78rem; font-weight: 600; color: #22c55e; }
.when { font-size: .78rem; font-weight: 600; color: var(--dim); }
.title { margin: 0; font-size: 1.2rem; line-height: 1.45; font-weight: 700; }
.title a { text-decoration: none; }
.title a:hover { text-decoration: underline; text-decoration-color: var(--c); text-underline-offset: 4px; }
.sum { margin: 0; color: var(--muted); font-size: .98rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.src { margin: 0; font-size: .85rem; color: var(--dim); }
.src a { color: var(--muted); }
.tags { margin: 0; font-size: .85rem; font-weight: 700; color: var(--c); word-spacing: 2px; }
.credit { margin: 0; font-size: .72rem; color: var(--dim); }
.credit a { color: inherit; }
.acts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: auto; padding-top: 10px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 7px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; font-family: 'Inter', sans-serif; font-size: .7rem; font-weight: 700; color: var(--muted); transition: background .15s, color .15s, transform .1s; }
.act svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.act:hover { color: #fff; background: var(--c); border-color: transparent; }
.act:active { transform: scale(.96); }
.act.busy { color: #fff; background: var(--c); pointer-events: none; }
.act.a-reel { color: var(--text); }

/* the first card (and a story's own page): picture beside the text */
.card.lead { grid-column: 1 / -1; flex-direction: row; }
.card.lead .pic { flex: 0 0 min(42%, 460px); }
.card.lead .body { padding: 26px 30px; gap: 12px; }
.card.lead .title { font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.35; }
.card.lead .sum { font-size: 1.08rem; -webkit-line-clamp: 6; }
.card.solo { flex-direction: row; margin-top: 28px; }
.card.solo .pic { flex: 0 0 min(46%, 520px); }
.card.solo .body { padding: 28px 32px; gap: 14px; }
.card.solo .title { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.35; }
.card.solo .sum { -webkit-line-clamp: unset; font-size: 1.1rem; }
.card.lead .acts, .card.solo .acts { max-width: 520px; }

.sec-t { font-size: 1.4rem; margin: 48px 0 6px; }
.more .day-head { margin-top: 8px; }
.pill-link { display: inline-block; margin: 30px 0 0; padding: 12px 22px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; }
.empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.hidden { display: none !important; }

/* how we pick */
.how { margin-top: 36px; }
.how ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.how li { padding: 16px 18px 16px 48px; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; color: var(--muted); font-size: .95rem; }
.how li::before { content: "✓"; position: absolute; left: 16px; top: 14px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 900; }

.foot { margin-top: 64px; border-top: 1px solid var(--line); padding: 34px 0 44px; color: var(--dim); font-size: .9rem; }
.foot-in { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.foot p { margin: 0; }
.foot .small { font-size: .8rem; }

/* a small message at the bottom ("Copied", "Making the reel…") */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: .92rem; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .how ul { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .wrap { padding: 0 14px; }
  .hero { padding: 26px 14px 6px; }
  .grid { grid-template-columns: 1fr; gap: 18px; }
  .card.lead, .card.solo { flex-direction: column; }
  .card.lead .pic, .card.solo .pic { flex: none; }
  .card.lead .body, .card.solo .body { padding: 16px 18px 18px; }
  .logo .word { font-size: 1.15rem; }
  .top-in { height: 58px; }
  .dots i { width: 16px; }
}

/* the caption box, when a phone does not let the page copy */
.cap-box { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60; display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.cap-in { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 10px; }
.cap-in p { margin: 0; font-weight: 700; }
.cap-in textarea { width: 100%; height: 40vh; font-size: 16px; line-height: 1.5; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 12px; resize: none; box-sizing: border-box; }
.cap-in button { align-self: flex-end; background: var(--red); color: #fff; border: 0; border-radius: 999px; padding: 10px 22px; font-weight: 700; font-size: 1rem; }
.ready-media img, .ready-media video { display: block; max-width: 100%; max-height: 52vh; margin: 0 auto; border-radius: 10px; -webkit-touch-callout: default; }
.cap-in small { color: var(--muted, #a4adc0); line-height: 1.5; font-size: .92rem; }
.ready-btns { display: flex; gap: 10px; justify-content: flex-end; }
.ready-btns .close { background: transparent; border: 1px solid var(--line); color: var(--text); }
