/*
Theme Name: WSI News
Theme URI: https://wsi.news
Author: WSI News
Author URI: https://wsi.news
Description: A professional newspaper-style WordPress theme for WSI News — World Street Intelligence. Features a WSJ-inspired editorial layout with markets ticker, hero grid, opinion section, and newsletter signup.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wsi-news
Tags: news, magazine, blog, two-columns, three-columns, custom-header, custom-menu, featured-images, sticky-post, theme-options, translation-ready
*/

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #111111;
  --ink-mid: #333333;
  --ink-light: #666666;
  --ink-faint: #999999;
  --paper: #faf9f7;
  --paper-warm: #f5f3ef;
  --rule: #d0cdc8;
  --rule-heavy: #888;
  --accent: #c41230;
  --accent-dark: #8b0d22;
  --gold: #b8960c;
  --col-gap: 20px;
}

html { font-size: 16px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Serif 4', Georgia, serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }

/* === UTILITY === */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.screen-reader-text { position: absolute; left: -9999px; }

/* === TICKER === */
.ticker-bar {
  background: var(--ink);
  color: #fff;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 6px 0;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-inner {
  display: inline-flex;
  gap: 0;
  animation: ticker 40s linear infinite;
}
.ticker-item {
  padding: 0 32px;
  border-right: 1px solid #444;
  display: flex;
  gap: 10px;
  align-items: center;
}
.ticker-item .symbol { color: #aaa; }
.ticker-item .up { color: #4caf82; }
.ticker-item .down { color: #e05a5a; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* === TOP UTILITY BAR === */
.top-utility {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  border-bottom: 1px solid var(--rule);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11.5px;
  color: var(--ink-light);
  background: var(--paper);
}
.top-utility a { color: var(--ink-light); margin: 0 8px; }
.top-utility a:hover { color: var(--accent); }
.btn-subscribe {
  background: var(--accent);
  color: #fff !important;
  padding: 4px 12px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  margin-left: 12px;
}
.btn-subscribe:hover { background: var(--accent-dark) !important; }

/* === MASTHEAD === */
.masthead {
  text-align: center;
  padding: 18px 24px 12px;
  border-bottom: 3px solid var(--ink);
}
.masthead-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.masthead-logo span { color: var(--accent); }
.masthead-tagline {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 4px;
}
.masthead-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  justify-content: center;
}
.masthead-rule span {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.masthead-rule hr { flex: 1; border: none; border-top: 1px solid var(--rule); max-width: 120px; }

/* === NAVIGATION === */
.main-nav {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  padding: 0 24px;
  max-width: 1280px;
  margin: 0 auto;
}
.main-nav ul { list-style: none; display: flex; align-items: center; margin: 0; padding: 0; }
.main-nav ul li a {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mid);
  padding: 13px 16px;
  border-bottom: 2px solid transparent;
  display: block;
  transition: all 0.15s;
  white-space: nowrap;
}
.main-nav ul li a:hover,
.main-nav ul li.current-menu-item a {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.nav-search-btn {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-light);
  cursor: pointer;
  padding: 13px 0 13px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Sans', sans-serif;
  background: none;
  border: none;
}
.nav-search-btn svg { width: 15px; height: 15px; }

/* Search overlay */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17,17,17,0.95);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.search-overlay.active { display: flex; }
.search-overlay form { display: flex; width: 600px; max-width: 90vw; }
.search-overlay input {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid #fff;
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  padding: 12px 0;
  outline: none;
}
.search-overlay input::placeholder { color: #555; }
.search-overlay button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 16px;
}
.search-close {
  position: absolute;
  top: 24px;
  right: 24px;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

/* === BREAKING BANNER === */
.breaking-banner {
  background: var(--accent);
  color: #fff;
  padding: 9px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'IBM Plex Sans', sans-serif;
}
.breaking-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #fff;
  color: var(--accent);
  padding: 2px 8px;
  white-space: nowrap;
  border-radius: 1px;
}
.breaking-text { font-size: 13px; font-weight: 500; }

/* === HERO SECTION === */
.hero-section { border-bottom: 2px solid var(--ink); padding: 24px 0 0; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 2px 1fr 2px 320px;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 24px;
}
.hero-divider { background: #d0cdc8; margin: 0; width: 2px; min-width: 2px; align-self: stretch; }
.hero-col { padding: 0 28px; }
.hero-col:first-child { padding-left: 0; }
.hero-col.sidebar { padding-right: 0; }

/* Story typography */
.kicker {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.hero-story h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.hero-story h1 a:hover, .hero-story h2 a:hover, .hero-story h3 a:hover { color: var(--accent); }
.hero-story h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.hero-story h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.28;
  margin-bottom: 6px;
}
.deck {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-mid);
  margin-bottom: 10px;
  font-weight: 300;
}
.byline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 8px;
}
.byline-row .author { font-weight: 600; color: var(--ink-mid); }
.img-wrap { overflow: hidden; margin: 12px 0; }
.img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.img-wrap:hover img { transform: scale(1.02); }
.img-caption {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-top: 4px;
  font-style: italic;
}
.sub-story { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--rule); }
.sub-story:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* === SIDEBAR === */
.sidebar { padding-left: 0; }
.sidebar-section { margin-bottom: 24px; }
.sidebar-heading {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 14px;
}
.sidebar-item { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  transition: color 0.15s;
}
.sidebar-item:hover h4 { color: var(--accent); }
.sidebar-item .meta { font-family: 'IBM Plex Sans', sans-serif; font-size: 10.5px; color: var(--ink-faint); }
.rank-num {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

/* === MARKETS WIDGET === */
.markets-widget { border: 1px solid var(--rule); background: #fff; padding: 14px; }
.market-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
}
.market-row:last-child { border-bottom: none; }
.market-name { font-weight: 500; color: var(--ink-mid); }
.market-val { font-weight: 600; }
.market-chg { font-size: 11px; padding: 1px 6px; border-radius: 2px; }
.up-bg { background: #e8f5ee; color: #2a7d50; }
.down-bg { background: #fdf0f0; color: #c0392b; }

/* === SECTION RULE === */
.section-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 0 16px;
}
.section-rule .label {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  padding: 0 4px;
}
.section-rule hr { flex: 1; border: none; border-top: 1px solid var(--rule); }
.section-rule hr.heavy { border-color: var(--ink); border-width: 2px; }

/* === STORY GRID === */
.story-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 2px solid var(--ink);
  border-left: 1px solid var(--rule);
}
.story-card {
  padding: 20px 24px 18px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transition: background 0.15s;
}
.story-card:hover { background: #fff; }
.story-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.28;
  margin-bottom: 6px;
  transition: color 0.15s;
}
.story-card:hover h3 { color: var(--accent); }
.story-card p { font-size: 13px; color: var(--ink-mid); line-height: 1.5; font-weight: 300; }
.story-card .meta { margin-top: 10px; font-family: 'IBM Plex Sans', sans-serif; font-size: 10.5px; color: var(--ink-faint); }
.story-card .img-wrap { margin-bottom: 10px; height: 130px; }

/* === OPINION === */
.opinion-strip {
  background: var(--paper-warm);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 24px 0;
  margin: 8px 0;
}
.opinion-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-left: 1px solid var(--rule);
}
.opinion-card { padding: 16px 20px; border-right: 1px solid var(--rule); }
.opinion-card .kicker { color: var(--gold); }
.opinion-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.3;
  margin-bottom: 8px;
}
.opinion-card p { font-size: 13px; color: var(--ink-mid); line-height: 1.5; font-weight: 300; font-style: italic; }
.author-chip { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-family: 'IBM Plex Sans', sans-serif; }
.author-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--rule);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--ink-mid); flex-shrink: 0;
  overflow: hidden;
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-name { font-size: 12px; font-weight: 600; color: var(--ink-mid); }
.author-title { font-size: 10.5px; color: var(--ink-faint); }

/* === MARKETS STRIP === */
.markets-strip { background: var(--ink); color: #fff; padding: 14px 24px; }
.markets-strip-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 0; overflow-x: auto;
}
.mkt-label {
  font-family: 'IBM Plex Sans', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: #888;
  margin-right: 24px; white-space: nowrap;
}
.mkt-item { display: flex; flex-direction: column; padding: 0 20px; border-left: 1px solid #333; white-space: nowrap; }
.mkt-sym { font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; font-weight: 600; color: #aaa; }
.mkt-price { font-family: 'IBM Plex Sans', sans-serif; font-size: 15px; font-weight: 600; color: #fff; }
.mkt-delta { font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; }
.mkt-up { color: #4caf82; }
.mkt-dn { color: #e05a5a; }

/* === NEWSLETTER === */
.newsletter-strip {
  border: 1px solid var(--rule); padding: 28px 32px; margin: 24px 0;
  background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.newsletter-text .eyebrow {
  font-family: 'IBM Plex Sans', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.newsletter-text h3 { font-family: 'Playfair Display', Georgia, serif; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.newsletter-text p { font-size: 13.5px; color: var(--ink-mid); font-weight: 300; }
.newsletter-form { display: flex; gap: 8px; flex-shrink: 0; }
.newsletter-form input {
  border: 1px solid var(--rule); padding: 10px 14px;
  font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; width: 240px;
  outline: none; background: var(--paper);
}
.newsletter-form input:focus { border-color: var(--ink); }
.newsletter-form button {
  background: var(--ink); color: #fff; border: none; padding: 10px 20px;
  font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; transition: background 0.15s;
}
.newsletter-form button:hover { background: var(--accent); }

/* === SINGLE POST === */
.single-article { max-width: 720px; margin: 40px auto; padding: 0 24px; }
.single-article .post-kicker { font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.single-article h1.post-title {
  font-family: 'Playfair Display', Georgia, serif; font-size: clamp(28px, 4vw, 44px);
  font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 16px;
}
.single-article .post-deck { font-size: 17px; line-height: 1.55; color: var(--ink-mid); font-weight: 300; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 16px 0; margin-bottom: 20px; }
.single-article .post-meta { font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; color: var(--ink-faint); margin-bottom: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.single-article .post-meta strong { color: var(--ink-mid); }
.single-article .post-featured-img { margin-bottom: 8px; }
.single-article .post-featured-img img { width: 100%; }
.single-article .post-content { font-size: 16px; line-height: 1.75; }
.single-article .post-content p { margin-bottom: 1.6em; }
.single-article .post-content h2 { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; margin: 1.8em 0 0.6em; }
.single-article .post-content h3 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 600; margin: 1.5em 0 0.5em; }
.single-article .post-content blockquote {
  border-left: 3px solid var(--accent); margin: 1.5em 0; padding: 4px 0 4px 20px;
  font-family: 'Playfair Display', serif; font-size: 18px; font-style: italic; color: var(--ink-mid);
}
/* ── Lists: override global reset + support WP block editor classes ── */
.single-article .post-content ul,
.single-article .post-content ol,
.single-article .post-content .wp-block-list {
  list-style-position: outside !important;
  margin: 0 0 1.5em 2.2em !important;
  padding-left: 0 !important;
}
.single-article .post-content ul,
.single-article .post-content .wp-block-list {
  list-style-type: disc !important;
}
.single-article .post-content ol {
  list-style-type: decimal !important;
}
.single-article .post-content li,
.single-article .post-content .wp-block-list li {
  display: list-item !important;
  margin-bottom: 0.55em !important;
  padding-left: 0.25em !important;
}
.single-article .post-content li::marker,
.single-article .post-content .wp-block-list li::marker {
  color: var(--accent);
}
/* Nested */
.single-article .post-content ul ul,
.single-article .post-content ol ol,
.single-article .post-content ul ol,
.single-article .post-content ol ul {
  margin-top: 0.4em !important;
  margin-bottom: 0.2em !important;
  margin-left: 1.5em !important;
}

/* === FOOTER === */
footer.site-footer { background: var(--ink); color: #ccc; padding: 40px 24px 24px; margin-top: 32px; }
.footer-inner { max-width: 1280px; margin: 0 auto; }
.footer-logo { font-family: 'Playfair Display', Georgia, serif; font-size: 28px; font-weight: 900; color: #fff; margin-bottom: 6px; }
.footer-logo span { color: var(--accent); }
.footer-tagline { font-family: 'IBM Plex Sans', sans-serif; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: #666; margin-bottom: 28px; }
.footer-cols {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px;
  border-top: 1px solid #333; padding-top: 24px; margin-bottom: 28px;
}
.footer-col-head { font-family: 'IBM Plex Sans', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #fff; margin-bottom: 12px; }
.footer-col a { display: block; font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; color: #888; margin-bottom: 8px; transition: color 0.15s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #333; padding-top: 16px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; color: #555;
}
.footer-bottom a { color: #555; margin: 0 8px; }
.footer-bottom a:hover { color: #fff; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .story-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-divider { display: none; }
  .sidebar { padding-left: 0; margin-top: 20px; }
  .opinion-grid { grid-template-columns: 1fr; }
  .newsletter-strip { flex-direction: column; align-items: flex-start; }
  .newsletter-form { flex-wrap: wrap; }
  .newsletter-form input { width: 100%; }
}
@media (max-width: 600px) {
  .story-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .top-utility .top-date { display: none; }
  .main-nav ul { overflow-x: auto; }
}
