:root {
  --bg: #F6F1E7;
  --ink: #2A211C;
  --ink-soft: #5B4F47;
  --line: #DDD3C2;
  --accent: #8B3A2E;
  --gold: #C9A227;
  --navy: #171C29;
  --radius-img: 12px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

/* ---------- Masthead (rebuilt from logo.png) ---------- */
.masthead {
  background: radial-gradient(120% 140% at 50% 0%, #262d3f 0%, var(--navy) 55%, #0f131c 100%);
  padding: 26px 16px 22px;
  text-align: center;
}

.logo {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
  font-family: "Kanit", "Arial Black", Impact, sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: clamp(2.1rem, 11.5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.01em;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.logo-be, .logo-va {
  display: inline-block;
  padding-right: 0.08em;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.logo-be { background-image: linear-gradient(180deg, #FFF07A 0%, #FFC61A 45%, #E39A00 100%); }
.logo-va { background-image: linear-gradient(180deg, #FFFFFF 0%, #DDE1E8 50%, #A6ACB8 100%); }

.logo-bars {
  display: flex;
  justify-content: center;
  gap: 4%;
  width: min(100%, 22rem);
  margin: 10px auto 0;
}

.bar {
  display: block;
  flex: 1;
  height: 7px;
  transform: skewX(-32deg);
  border-radius: 1px;
}

.bar-black { background: linear-gradient(180deg, #454C5B, #10141C); box-shadow: 0 0 0 1px #2c3342; }
.bar-gold  { background: linear-gradient(180deg, #FFDD55, #E8A800); box-shadow: 0 0 10px rgba(255, 190, 30, 0.55); }
.bar-red   { background: linear-gradient(180deg, #FF4A4A, #D10F1B); box-shadow: 0 0 10px rgba(240, 30, 40, 0.6); }

/* Visual touch 1: thin gold rule beneath the masthead */
.gold-rule {
  height: 2px;
  background: var(--gold);
}

/* ---------- Feed ---------- */
.feed {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 8px;
}

.section-title {
  margin: 32px 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.story {
  display: flex;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.story:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.story-img {
  display: block;
  object-fit: cover;
  background: var(--line);
  /* Visual touch 2: soft rounded corners on every story image */
  border-radius: var(--radius-img);
}

.story-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  line-height: 1.25;
  font-weight: 700;
}

.story-preview {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.story-more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

/* Politics: image above headline */
.layout-stack .story { flex-direction: column; gap: 12px; }
.layout-stack .story-img { width: 100%; aspect-ratio: 16 / 9; }

/* Economy/Business: image left; Finance: image right */
.layout-left .story,
.layout-right .story { align-items: flex-start; }
.layout-left .story { flex-direction: row; }
.layout-right .story { flex-direction: row-reverse; }
.layout-left .story-img,
.layout-right .story-img { flex: 0 0 36%; width: 36%; aspect-ratio: 1 / 1; }
.layout-left .story-title,
.layout-right .story-title { font-size: 1.05rem; }
.layout-left .story-preview,
.layout-right .story-preview { font-size: 0.88rem; }

.feed-error { padding: 32px 0; color: var(--accent); font-weight: 600; }

.footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 16px calc(36px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ---------- Full-screen article overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.overlay[hidden] { display: none; }

.overlay-close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 14px;
  z-index: 101;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 3px;
}

.overlay-close:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.overlay-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(64px + env(safe-area-inset-top)) 16px calc(48px + env(safe-area-inset-bottom));
}

.overlay-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-img);
  background: var(--line);
}

.overlay-section {
  margin: 20px 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.overlay-title {
  margin: 0 0 18px;
  font-size: 1.7rem;
  line-height: 1.2;
  font-weight: 700;
}

.overlay-body p {
  margin: 0 0 1em;
  font-size: 1.05rem;
  line-height: 1.65;
}
