/* ===== IMMA Media palette — taken from the logo ===== */
:root {
  --navy: #04163a;        /* logo background */
  --navy-2: #0a3470;      /* logo background glow */
  --brand: #0b4fa8;       /* satellite blue */
  --brand-2: #1e7bff;     /* electric blue glow */
  --accent: #f5b003;      /* "MEDIA" gold */
  --accent-2: #fdca1c;    /* dish gold highlight */
  --on-accent: #04163a;

  --bg: #f7f9fd;
  --surface: #ffffff;
  --soft: #edf2fa;
  --text: #0a1630;
  --muted: #55607a;
  --line: #dce4f0;
  --brand-soft: #e2ecfa;
  --up: #0f8a4a;
  --down: #d1302f;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000a1c; --surface: #061733; --soft: #0a1f42; --text: #eef3fb;
    --muted: #9fb0cc; --line: #15305a; --brand: #5aa2ff; --brand-2: #1e7bff;
    --brand-soft: #0d2a55; --up: #34d27f; --down: #ff6b6b;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.wrap { width: min(1260px, 100% - 32px); margin-inline: auto; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 72px; }
.logo { font-weight: 800; font-size: 1.75rem; letter-spacing: -.04em; color: var(--brand); white-space: nowrap; }
.logo span { color: var(--text); }
.logo.small { font-size: 1.3rem; }
.searchbox { flex: 1; max-width: 680px; display: flex; border: 2px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--surface); transition: border-color .2s; }
.searchbox:focus-within { border-color: var(--brand-2); }
.searchbox input { flex: 1; border: 0; padding: 11px 20px; font: inherit; font-size: 1rem; background: transparent; color: var(--text); outline: none; }
.searchbox button { border: 0; background: var(--brand); color: #fff; width: 56px; cursor: pointer; display: grid; place-items: center; }
.searchbox button:hover { background: var(--brand-2); }
.top-links { display: flex; align-items: center; gap: 18px; font-weight: 600; font-size: .95rem; margin-left: auto; }
.top-links a:hover { color: var(--brand); }
.pill { background: var(--brand); color: #fff !important; padding: 8px 18px; border-radius: 99px; }
.menu-toggle { display: none; background: none; border: 0; font-size: 1.5rem; color: var(--text); cursor: pointer; padding: 0; }

/* Category bar */
.catbar { border-top: 1px solid var(--line); }
.catbar-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.catbar-inner::-webkit-scrollbar { display: none; }
.chip { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 14px 9px; font: 600 .95rem Inter, sans-serif; color: var(--muted); cursor: pointer; white-space: nowrap; }
.chip:hover { color: var(--brand); }
.chip.on { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; padding: 24px 0 48px; }

/* Top stories: big hero + side headlines */
.top-stories { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 32px; }
.hero { position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer; min-height: 380px; background: #222; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.hero:hover img { transform: scale(1.03); }
.hero-text { position: absolute; inset: auto 0 0 0; padding: 28px 24px 22px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.hero-text h1 { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; margin: 8px 0 6px; }
.hero-text p { margin: 0; opacity: .9; }
.side-heads { display: grid; gap: 12px; }
.side-head { display: grid; grid-template-columns: 110px 1fr; gap: 12px; cursor: pointer; align-items: start; }
.side-head img { width: 110px; height: 80px; object-fit: cover; border-radius: 8px; }
.side-head h3 { font-size: .98rem; font-weight: 700; }
.side-head:hover h3, .item:hover h3 { color: var(--brand); text-decoration: underline; }

.label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.hero .label { color: #fff; background: var(--brand); padding: 3px 8px; border-radius: 4px; }

/* Stream */
.block-title { font-size: 1.25rem; font-weight: 800; padding-bottom: 10px; border-bottom: 2px solid var(--text); margin-bottom: 4px; }
.block-title span { color: var(--muted); font-weight: 500; font-size: .95rem; }
.item { display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.item img { width: 220px; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; }
.item h3 { font-size: 1.2rem; font-weight: 700; margin: 4px 0 6px; }
.item p { margin: 0 0 8px; color: var(--muted); }
.source { font-size: .82rem; color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }

/* ---------- Sidebar panels ---------- */
.side-col { display: grid; gap: 20px; align-content: start; }
.panel { background: var(--soft); border-radius: var(--radius); padding: 18px; }
.panel-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; }
.panel-title small { font-size: .7rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.trending { list-style: none; padding: 0; margin: 0; counter-reset: t; }
.trending li { counter-increment: t; display: flex; gap: 12px; padding: 7px 0; cursor: pointer; font-weight: 600; font-size: .95rem; }
.trending li::before { content: counter(t); color: var(--brand); font-weight: 800; min-width: 16px; }
.trending li:hover { color: var(--brand); }

.weather-now { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.wx-icon { font-size: 2.6rem; }
.weather-now strong { display: block; font-size: 2rem; font-weight: 800; line-height: 1; }
.weather-now span { color: var(--muted); font-size: .88rem; }
.forecast { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); text-align: center; font-size: .85rem; }
.forecast li { display: grid; gap: 2px; }
.forecast span { color: var(--muted); }

.markets { list-style: none; padding: 0; margin: 0; }
.markets li { display: grid; grid-template-columns: 1fr auto 64px; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.markets li:last-child { border-bottom: 0; }
.markets em { font-style: normal; font-weight: 700; text-align: right; }
.up { color: var(--up); } .down { color: var(--down); }

.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.info-list li { display: flex; gap: 12px; }
.info-list span { font-size: 1.4rem; }
.info-list p { margin: 0; color: var(--muted); font-size: .88rem; }

.form { display: grid; gap: 8px; }
.form input, .form textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.form button { background: var(--brand); color: #fff; border: 0; padding: 10px; border-radius: 99px; font: 700 .95rem Inter, sans-serif; cursor: pointer; }
.form-note { color: var(--up); margin: 0; font-size: .9rem; }

/* ---------- Reader ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; max-width: 760px; width: calc(100% - 32px); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(5,15,40,.6); }
dialog img { width: 100%; aspect-ratio: 16/8; object-fit: cover; }
.reader-text { padding: 24px 28px 32px; }
.reader-text h2 { font-size: 1.8rem; font-weight: 800; margin: 8px 0 12px; }
.reader-text .lead { font-size: 1.1rem; color: var(--muted); }
.close { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,.6); color: #fff; border: 0; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }

/* ---------- Footer ---------- */
.footer { background: var(--soft); border-top: 1px solid var(--line); padding: 28px 0; font-size: .9rem; color: var(--muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer nav { display: flex; gap: 20px; }
.footer nav a:hover { color: var(--brand); }
.footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .side-col { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px; }
  .menu-toggle { display: block; }
  .searchbox { order: 3; flex-basis: 100%; max-width: none; }
  .top-links a:not(.pill) { display: none; }
  .top-stories { grid-template-columns: 1fr; }
  .hero { min-height: 280px; }
  .item { grid-template-columns: 110px 1fr; gap: 12px; }
  .item img { width: 110px; }
  .item h3 { font-size: 1rem; }
  .item p { display: none; }
}

/* ---------- Yellow accents ---------- */
.topbar { border-top: 4px solid; border-image: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent)) 1; }
.pill { background: var(--accent); color: var(--on-accent) !important; }
.pill:hover { filter: brightness(1.05); }
.hero .label { background: var(--accent); color: var(--on-accent); }
.chip.on { border-bottom-color: var(--accent); }
.block-title { border-bottom-color: var(--accent); border-bottom-width: 3px; }
.trending li::before { background: var(--accent); color: var(--on-accent); border-radius: 50%; width: 24px; height: 24px; min-width: 24px; display: grid; place-items: center; font-size: .8rem; }
.panel-title { border-left: 4px solid var(--accent); padding-left: 10px; }
.form button { background: var(--accent); color: var(--on-accent); }
.searchbox button:hover { background: var(--accent); color: var(--on-accent); }
.footer { border-top: 4px solid var(--accent); }

/* ---------- IMMA Media branding ---------- */
.topbar { background: linear-gradient(90deg, var(--navy), var(--navy-2)); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.topbar-inner { height: 80px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; }
.logo img { height: 60px; width: auto; border-radius: 6px; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text b { font-size: 1.6rem; font-weight: 800; letter-spacing: .04em; color: #fff; }
.logo-text i { font-style: normal; font-size: .78rem; font-weight: 700; letter-spacing: .42em; color: var(--accent); margin-top: 3px; }
.top-links a { color: #fff; }
.top-links a:not(.pill):hover { color: var(--accent); }
.menu-toggle { color: #fff; }
.searchbox { border-color: transparent; background: #fff; }
.searchbox input { color: #1d1d1f; }
.searchbox:focus-within { border-color: var(--accent); }
.catbar { background: var(--surface); border-top: 0; }

.footer { background: var(--navy); color: #c9d3ea; }
.footer nav a:hover { color: var(--accent); }
.footer-logo img { height: 110px; width: auto; border-radius: 8px; }

@media (max-width: 720px) {
  .topbar-inner { height: auto; }
  .logo img { height: 44px; }
  .logo-text b { font-size: 1.25rem; }
  .logo-text i { font-size: .65rem; }
}

/* ---------- Logo-colour finishing touches ---------- */
.block-title { color: var(--text); }
.hero-text { background: linear-gradient(transparent, rgba(4,22,58,.92)); }
.searchbox button { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.pill, .form button { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.chip.on { color: var(--brand); }
.item:hover h3, .side-head:hover h3 { color: var(--brand-2); }
.panel { border: 1px solid var(--line); }
.footer { background: radial-gradient(ellipse at 50% 120%, var(--navy-2), var(--navy) 70%); }
dialog::backdrop { background: rgba(0,10,28,.7); }

/* ---------- Few-stories layout + story credits ---------- */
.top-stories.solo { grid-template-columns: 1fr; }
.top-stories.solo .side-heads { display: none; }
.top-stories.solo .hero { min-height: 440px; }
.caption { font-size: .8rem; color: var(--muted); padding: 6px 28px 0; margin: 0; }
.credit { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.credit a { color: var(--brand); text-decoration: underline; }
.reader-text p { line-height: 1.7; }

/* ---------- Live weather ---------- */
.weather.loading .weather-now { opacity: .6; }
.weather .panel-title small, .markets-panel .panel-title small { color: var(--up); }
.wx-credit { margin: 12px 0 0; font-size: .75rem; color: var(--muted); }
.wx-credit a { color: var(--brand); }
.markets li { grid-template-columns: 1fr auto 70px; }
.markets em:empty::after { content: "—"; color: var(--muted); font-weight: 400; }

/* ---------- Extra photos inside articles ---------- */
.extra { margin: 24px 0; }
.extra img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
.extra figcaption { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.reader-text strong { color: var(--text); }

/* ---------- Formatted (long-form) articles ---------- */
.reader-text h3 { font-size: 1.25rem; font-weight: 800; margin: 32px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.reader-text h3:first-child { border-top: 0; }
.reader-text ul, .reader-text ol { padding-left: 22px; line-height: 1.7; }
.reader-text li { margin-bottom: 4px; }
.reader-text hr { display: none; }
.reader-text em { color: var(--muted); }
.reader-text table { display: block; overflow-x: auto; border-collapse: collapse; margin: 16px 0; font-size: .9rem; }
.reader-text th, .reader-text td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.reader-text th { background: var(--soft); font-weight: 700; }
.reader-text td:not(:first-child), .reader-text th:not(:first-child) { text-align: right; white-space: nowrap; }
.reader-text code { background: var(--soft); padding: 1px 5px; border-radius: 4px; }
