/* ============================================
   NasdaqDigest — Editorial / Newspaper Theme
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  font-size: 16px; line-height: 1.75; color: #1a1a1a; background: #fafaf7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: #b91c1c; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

:root {
  --ink: #1a1a1a;
  --ink-2: #444;
  --muted: #888;
  --line: #d4d4d0;
  --line-dark: #1a1a1a;
  --accent: #b91c1c;
  --bg: #fafaf7;
  --card: #fff;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* ---------- Masthead ---------- */
.masthead {
  text-align: center; padding: 36px 0 20px;
  border-bottom: 3px double var(--line-dark);
}
.masthead .brand {
  font-family: var(--serif); font-size: 42px; font-weight: 700;
  letter-spacing: 2px; color: var(--ink); display: inline-block;
}
.masthead .brand:hover { color: var(--ink); }
.masthead .tagline {
  font-family: var(--sans); font-size: 12px; color: var(--muted);
  margin-top: 6px; letter-spacing: 1px; text-transform: uppercase;
}

/* ---------- Nav ---------- */
.mainnav {
  border-bottom: 1px solid var(--line-dark);
}
.mainnav .wrap {
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.mainnav ul {
  display: flex; justify-content: center; flex-wrap: wrap;
}
.mainnav a {
  display: block; padding: 12px 22px; font-family: var(--sans);
  font-size: 13px; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; color: var(--ink);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.mainnav a:hover, .mainnav a.on {
  border-bottom-color: var(--accent); color: var(--accent);
}
.nav-tools {
  position: absolute; right: 32px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 8px; align-items: center;
}
.nav-tools .search-toggle, .nav-tools .menu-toggle {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  padding: 4px 8px;
}
.menu-toggle { display: none; }

/* Nav overlay (mobile) */
.nav-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,.4); z-index: 150;
}
.nav-overlay.show { display: block; }
.nav-close {
  display: none;
  font-family: var(--sans); font-size: 14px; color: var(--muted);
  padding: 14px 0; width: 100%; text-align: left;
  border-bottom: 1px solid var(--line);
}

/* ---------- Search bar ---------- */
.search-bar {
  display: none; padding: 12px 0; border-bottom: 1px solid var(--line);
  background: #f0efe8;
}
.search-bar.open { display: block; }
.search-bar form { display: flex; gap: 8px; max-width: 500px; margin: 0 auto; }
.search-bar input {
  flex: 1; padding: 8px 14px; border: 1px solid var(--line);
  font-family: var(--sans); font-size: 14px; background: #fff; outline: none;
}
.search-bar button {
  padding: 8px 20px; background: var(--ink); color: #fff;
  font-family: var(--sans); font-size: 13px;
}

/* ---------- Date strip ---------- */
.datestrip {
  font-family: var(--sans); font-size: 12px; color: var(--muted);
  padding: 10px 0; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between;
}

/* ---------- Hero / Lead Story ---------- */
.lead {
  display: grid; grid-template-columns: 2fr 1fr; gap: 40px;
  padding: 36px 0; border-bottom: 1px solid var(--line);
}
.lead-main .cat-label {
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--accent);
  margin-bottom: 10px;
}
.lead-main h1 {
  font-family: var(--serif); font-size: 36px; line-height: 1.25;
  font-weight: 700; margin-bottom: 14px;
}
.lead-main h1 a { color: var(--ink); }
.lead-main h1 a:hover { color: var(--accent); }
.lead-main .dek {
  font-size: 17px; color: var(--ink-2); line-height: 1.6; margin-bottom: 16px;
}
.lead-main .byline {
  font-family: var(--sans); font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 12px;
}
.lead-main .lead-img {
  margin-bottom: 20px; overflow: hidden;
}
.lead-main .lead-img img { width: 100%; height: auto; }

.lead-side { border-left: 1px solid var(--line); padding-left: 32px; }
.lead-side h3 {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--ink);
}
.lead-side-item {
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.lead-side-item:last-child { border-bottom: none; }
.lead-side-item h4 {
  font-family: var(--serif); font-size: 16px; line-height: 1.4;
  font-weight: 700; margin-bottom: 4px;
}
.lead-side-item h4 a { color: var(--ink); }
.lead-side-item h4 a:hover { color: var(--accent); }
.lead-side-item .meta {
  font-family: var(--sans); font-size: 11px; color: var(--muted);
}

/* ---------- Section heading ---------- */
.sec-title {
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px; color: var(--ink);
  margin: 40px 0 20px; padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  display: flex; justify-content: space-between; align-items: baseline;
}
.sec-title .more {
  font-size: 11px; font-weight: 400; text-transform: none;
  letter-spacing: 0; color: var(--muted);
}

/* ---------- News Grid (3 columns) ---------- */
.news-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
  padding-bottom: 32px; border-bottom: 1px solid var(--line);
}
.news-card {
  display: block;
}
.news-card .thumb {
  width: 100%; height: 180px; overflow: hidden; margin-bottom: 12px;
  background: #e8e6df;
}
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-card .cat {
  font-family: var(--sans); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--accent);
}
.news-card h3 {
  font-family: var(--serif); font-size: 19px; line-height: 1.35;
  font-weight: 700; margin: 6px 0 8px;
}
.news-card h3 a { color: var(--ink); }
.news-card h3 a:hover { color: var(--accent); }
.news-card p {
  font-size: 14px; color: var(--ink-2); line-height: 1.6;
}
.news-card .meta {
  font-family: var(--sans); font-size: 11px; color: var(--muted);
  margin-top: 8px;
}

/* ---------- News List (no thumb) ---------- */
.news-list-plain {
  padding-bottom: 32px; border-bottom: 1px solid var(--line);
}
.news-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.news-row:last-child { border-bottom: none; }
.news-row h3 {
  font-family: var(--serif); font-size: 18px; font-weight: 700;
  flex: 1; margin-right: 24px;
}
.news-row h3 a { color: var(--ink); }
.news-row h3 a:hover { color: var(--accent); }
.news-row .meta {
  font-family: var(--sans); font-size: 12px; color: var(--muted);
  white-space: nowrap;
}

/* ---------- Two-column layout (list + sidebar) ---------- */
.two-col {
  display: grid; grid-template-columns: 1fr 300px; gap: 48px;
  padding: 32px 0;
}

/* ---------- Sidebar ---------- */
.side-block { margin-bottom: 32px; }
.side-block h4 {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--ink);
  padding-bottom: 8px; border-bottom: 2px solid var(--ink); margin-bottom: 12px;
}
.side-item {
  padding: 10px 0; border-bottom: 1px solid var(--line);
  display: flex; gap: 10px; align-items: flex-start;
}
.side-item:last-child { border-bottom: none; }
.side-num {
  font-family: var(--serif); font-size: 22px; font-weight: 700;
  color: var(--line); line-height: 1; min-width: 24px;
}
.side-item:nth-child(2) .side-num,
.side-item:nth-child(3) .side-num { color: var(--accent); }
.side-item a {
  font-family: var(--serif); font-size: 14px; line-height: 1.45; color: var(--ink);
}
.side-item a:hover { color: var(--accent); }

/* ---------- Article Page ---------- */
.article-single {
  padding: 40px 0;
}
.article-single .crumb {
  font-family: var(--sans); font-size: 12px; color: var(--muted);
  margin-bottom: 24px;
}
.article-single .crumb a:hover { color: var(--accent); }
.article-single .crumb .sep { margin: 0 6px; }
.article-single h1 {
  font-family: var(--serif); font-size: 38px; line-height: 1.25;
  font-weight: 700; margin-bottom: 16px;
}
.article-single .dek {
  font-size: 19px; color: var(--ink-2); line-height: 1.6;
  margin-bottom: 20px;
}
.article-single .byline {
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 28px;
}
.article-single .byline .dot { margin: 0 8px; }
.article-body {
  font-size: 17px; line-height: 1.85; color: #222;
}
.article-body p { margin-bottom: 20px; }
.article-body img { margin: 24px 0; }
.article-body h2, .article-body h3 {
  font-family: var(--serif); margin: 28px 0 14px;
}

.article-tags {
  margin: 28px 0; padding-top: 20px; border-top: 1px solid var(--line);
}
.article-tags a {
  font-family: var(--sans); font-size: 12px; color: var(--muted);
  margin-right: 16px;
}
.article-tags a:hover { color: var(--accent); }

.article-pager {
  display: flex; justify-content: space-between; gap: 24px;
  margin-top: 32px; padding-top: 24px; border-top: 3px double var(--line-dark);
}
.article-pager a { flex: 1; }
.article-pager .dir {
  font-family: var(--sans); font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); display: block; margin-bottom: 4px;
}
.article-pager .pt {
  font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--ink);
}
.article-pager .next { text-align: right; }

/* ---------- Pagination ---------- */
.pagination, .pages {
  margin: 32px 0; text-align: center;
  font-family: var(--sans); font-size: 13px;
}
.pagination a, .pages a, .pages span, .pages strong {
  display: inline-block; padding: 6px 12px; margin: 0 2px;
  color: var(--ink); border: 1px solid var(--line);
  text-decoration: none;
}
.pagination a:hover, .pages a:hover {
  border-color: var(--ink);
}
.pagination .current, .pages .current, .pages strong {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.pagination ul, .pages ul { display: inline; }
.pagination li, .pages li { display: inline; list-style: none; }

/* ---------- Footer ---------- */
.colophon {
  margin-top: 48px; padding: 32px 0; border-top: 3px double var(--line-dark);
  text-align: center;
}
.colophon .brand {
  font-family: var(--serif); font-size: 24px; font-weight: 700;
  letter-spacing: 1px;
}
.colophon p {
  font-family: var(--sans); font-size: 12px; color: var(--muted);
  margin-top: 8px; line-height: 1.8;
}
.colophon a { color: var(--muted); }
.colophon a:hover { color: var(--accent); }

/* ---------- Scroll top ---------- */
.scroll-top {
  position: fixed; right: 24px; bottom: 24px; width: 40px; height: 40px;
  background: var(--ink); color: #fff; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all .3s; z-index: 99;
}
.scroll-top.show { opacity: 1; visibility: visible; }

/* ---------- Page head (list/search) ---------- */
.page-head { padding: 32px 0 20px; }
.page-head h1 {
  font-family: var(--serif); font-size: 32px; font-weight: 700;
  padding-bottom: 12px; border-bottom: 3px double var(--line-dark);
}

/* ---------- Market Table (Newspaper style) ---------- */
.market-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--sans); font-size: 13px;
  margin-bottom: 8px;
}
.market-table th {
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
  padding: 8px 12px; border-bottom: 2px solid var(--ink);
}
.market-table th.num { text-align: right; }
.market-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.market-table td.num {
  text-align: right; font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 14px;
}
.market-table .sym {
  font-weight: 700; font-size: 13px; color: var(--ink);
}
.market-table .name {
  font-size: 12px; color: var(--muted);
}
.market-table .up { color: #c0392b; }
.market-table .down { color: #0a8f5c; }
.market-table .chg { font-size: 12px; font-weight: 600; }

/* Index cards row (3 columns, newspaper style) */
.index-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border-top: 1px solid var(--line-dark); border-bottom: 3px double var(--line-dark);
  margin-bottom: 32px;
}
.index-cell {
  padding: 20px 24px; border-right: 1px solid var(--line);
}
.index-cell:last-child { border-right: none; }
.index-cell .idx-name {
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
}
.index-cell .idx-px {
  font-family: var(--serif); font-size: 28px; font-weight: 700;
  margin: 6px 0 2px; line-height: 1;
}
.index-cell .idx-chg {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
}
.index-cell .idx-chg.up { color: #c0392b; }
.index-cell .idx-chg.down { color: #0a8f5c; }

/* Sidebar mini quote */
.quote-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--line);
  font-family: var(--sans); font-size: 13px;
}
.quote-row:last-child { border-bottom: none; }
.quote-row .q-sym { font-weight: 700; }
.quote-row .q-px {
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.quote-row .q-chg { font-size: 11px; font-weight: 600; margin-left: 6px; }
.quote-row .q-chg.up { color: #c0392b; }
.quote-row .q-chg.down { color: #0a8f5c; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .lead { grid-template-columns: 1fr; gap: 24px; }
  .lead-side { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .wrap { padding: 0 20px; }
  .masthead { padding: 24px 0 16px; }
  .masthead .brand { font-size: 26px; }
  .mainnav .wrap {
    justify-content: space-between; height: 48px;
  }
  .mainnav ul {
    display: none;
    position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
    background: #fff; flex-direction: column;
    padding: 60px 20px 20px; z-index: 200;
    box-shadow: -4px 0 20px rgba(0,0,0,.1);
    transition: right .3s;
  }
  .mainnav ul.open { right: 0; display: flex; justify-content: flex-start; }
  .mainnav ul li { border-bottom: 1px solid var(--line); }
  .mainnav ul li.nav-close-li { border-bottom: 1px solid var(--line-dark); }
  .mainnav ul a { padding: 14px 0; border-bottom: none; }
  .nav-close { display: block; }
  .nav-tools {
    position: static; transform: none;
  }
  .menu-toggle { display: flex; }
  .lead-main h1 { font-size: 24px; }
  .news-grid { grid-template-columns: 1fr; }
  .article-single h1 { font-size: 24px; }
  .datestrip { flex-direction: column; gap: 4px; }
  .index-row { grid-template-columns: 1fr; }
  .index-cell { border-right: none; border-bottom: 1px solid var(--line); }
  .index-cell:last-child { border-bottom: none; }
  .market-table th, .market-table td { padding: 8px 6px; font-size: 12px; }
  .article-pager { flex-direction: column; gap: 12px; }
  .article-pager .next { text-align: left; }
  .news-row { flex-direction: column; gap: 4px; }
  .news-row .meta { white-space: normal; }
}
