/*
Theme Name: PulseWire
Theme URI: https://example.com
Author: PulseWire Team
Description: A professional markets news theme covering crypto AND stocks. Real WordPress posts power every article (each with its own linked page), category hub pages for Crypto and Stocks with distinct layouts and accent colors, a combined market ticker, and a working contact form.
Version: 1.0
Requires at least: 5.9
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: pulsewire
*/

:root {
  --bg: #0F1421;
  --panel: #161D2E;
  --panel-2: #1B233A;
  --border: #2A3349;
  --text: #ECEFF4;
  --text-dim: #9098AC;
  --text-dimmer: #656E85;
  --accent: #E3A548;
  --accent-ink: #171208;
  --teal: #45CFC3;
  --up: #4CC38A;
  --down: #E2594B;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F6F4EE; --panel: #FFFFFF; --panel-2: #F0EDE4; --border: #DDD7C8;
    --text: #1B2029; --text-dim: #5B6270; --text-dimmer: #868C99;
    --accent: #A9700F; --teal: #157A72; --up: #1C8F5C; --down: #C13A28;
  }
}
:root[data-theme="light"] {
  --bg: #F6F4EE; --panel: #FFFFFF; --panel-2: #F0EDE4; --border: #DDD7C8;
  --text: #1B2029; --text-dim: #5B6270; --text-dimmer: #868C99;
  --accent: #A9700F; --teal: #157A72; --up: #1C8F5C; --down: #C13A28;
}

/* Stocks pages get a cooler blue/green accent so they visually read as a
   different section of the site, while sharing the same type system. */
.page-template-template-stocks {
  --accent: #4C8DFF;
  --accent-ink: #071022;
  --teal: #33C481;
}
@media (prefers-color-scheme: light) {
  .page-template-template-stocks:not([data-theme="dark"]) { --accent: #1D5FD1; --teal: #178F53; }
}
.page-template-template-stocks[data-theme="light"] { --accent: #1D5FD1; --teal: #178F53; }

/* Services page gets its own accent too, so it doesn't feel like a copy
   of the news pages — it's a business page, not an article listing. */
.page-template-template-services {
  --accent: #B98CE0;
  --accent-ink: #170F22;
}
@media (prefers-color-scheme: light) {
  .page-template-template-services:not([data-theme="dark"]) { --accent: #7A3FB0; }
}
.page-template-template-services[data-theme="light"] { --accent: #7A3FB0; }

html { scroll-padding-top: env(safe-area-inset-top, 0px); }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif; -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: 'IBM Plex Mono', monospace; }
.serif { font-family: 'Newsreader', Georgia, serif; }
img, svg { max-width: 100%; display: block; }

/* ===== Utility + header ===== */
.utility {
  border-bottom: 1px solid var(--border); font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: .02em; color: var(--text-dimmer);
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px clamp(16px, 4vw, 40px); padding-top: calc(7px + env(safe-area-inset-top, 0px));
}
.utility .dot { color: var(--up); }
.theme-toggle {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 20px; padding: 3px 10px; font-family: inherit; font-size: 11px; cursor: pointer;
}
header.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(16px, 4vw, 40px) 14px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 12px; position: sticky; top: 0; background: var(--bg); z-index: 20;
}
.logo {
  font-family: 'Newsreader', serif; font-weight: 600; font-size: 26px; letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 2px;
}
.logo .accent { color: var(--accent); font-style: italic; }
.logo.active { opacity: 0.7; pointer-events: none; }
nav.main-nav { display: flex; gap: 26px; font-size: 14px; font-weight: 500; }
nav.main-nav a { color: var(--text-dim); padding-bottom: 4px; border-bottom: 2px solid transparent; }
nav.main-nav a:hover, nav.main-nav a.active { color: var(--text); border-bottom-color: var(--accent); }
.burger { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text); width: 38px; height: 38px; cursor: pointer; font-size: 16px; }

/* ===== Ticker ===== */
.ticker-wrap { background: var(--panel); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ticker-wrap::-webkit-scrollbar { display: none; }
.ticker { display: flex; width: max-content; padding: 0 clamp(16px, 4vw, 40px); }
.tick { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; padding: 10px 18px; border-right: 1px solid var(--border); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tick a { display: flex; align-items: center; gap: 8px; }
.tick .sym { color: var(--text-dim); font-weight: 500; }
.tick .px { color: var(--text); font-weight: 600; }
.tick .chg.up { color: var(--up); }
.tick .chg.down { color: var(--down); }
.snapshot-note { font-size: 10.5px; color: var(--text-dimmer); padding: 6px clamp(16px,4vw,40px); border-bottom: 1px solid var(--border); }

main.site-main { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* ===== Hero (home) ===== */
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 44px; padding: 40px 0 36px; border-bottom: 1px solid var(--border); }
.kicker { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--teal); letter-spacing: .04em; margin-bottom: 12px; display: block; }
.hero h1 { font-family: 'Newsreader', serif; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; font-weight: 600; margin: 0 0 14px; letter-spacing: -0.01em; }
.hero .dek { font-size: 16px; color: var(--text-dim); line-height: 1.55; max-width: 60ch; margin: 0 0 16px; }
.byline { font-size: 12px; color: var(--text-dimmer); font-family: 'IBM Plex Mono', monospace; }
.hero-thumb { border-radius: 12px; overflow: hidden; margin-bottom: 18px; border: 1px solid var(--border); aspect-ratio: 16/9; }
.hero-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-side { display: flex; flex-direction: column; gap: 20px; }
.side-story { display: grid; grid-template-columns: 78px 1fr; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.side-story:last-child { border-bottom: none; padding-bottom: 0; }
.side-thumb { border-radius: 8px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1/1; }
.side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-story h3 { font-family: 'Newsreader', serif; font-size: 17px; font-weight: 600; margin: 3px 0 6px; line-height: 1.25; }
.side-story p { font-size: 12.5px; color: var(--text-dim); margin: 0; line-height: 1.5; }

/* ===== Section labels + filters ===== */
.section-label { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--text-dimmer); letter-spacing: .05em; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.section-label a { color: var(--accent); }
.hub-links { display: flex; gap: 10px; padding: 26px 0 4px; }
.hub-chip { font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border); color: var(--text-dim); }
.hub-chip:hover { color: var(--text); border-color: var(--accent); }

/* ===== Article grid (home / archives) ===== */
.content-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 48px; padding-bottom: 50px; }
.article-row { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.article-row .thumb { border-radius: 8px; overflow: hidden; border: 1px solid var(--border); align-self: start; aspect-ratio: 1/1; }
.article-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-row .cat { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--teal); margin-bottom: 4px; display: inline-block; }
.article-row h3 { font-family: 'Newsreader', serif; font-size: 19px; font-weight: 600; line-height: 1.28; margin: 0 0 6px; }
.article-row h3 a:hover { color: var(--accent); }
.article-row p { font-size: 13.5px; color: var(--text-dim); margin: 0 0 8px; line-height: 1.55; }
.row-meta { font-size: 11.5px; color: var(--text-dimmer); font-family: 'IBM Plex Mono', monospace; display: flex; align-items: center; gap: 10px; }
.bookmark-btn { background: none; border: none; cursor: pointer; color: var(--text-dimmer); font-size: 15px; padding: 0; line-height: 1; }
.bookmark-btn.saved { color: var(--accent); }

/* ===== Sidebar panels ===== */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 22px; }
.panel h4 { font-family: 'Newsreader', serif; font-size: 17px; font-weight: 600; margin: 0 0 14px; }
.mover-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.mover-row:last-child { border-bottom: none; }
.mover-row a { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.mover-name { font-weight: 500; }
.mover-name .full { color: var(--text-dimmer); font-size: 11.5px; margin-left: 6px; }
.mover-val { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.mover-val.up { color: var(--up); }
.mover-val.down { color: var(--down); }
.tag-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill { font-size: 12px; padding: 6px 12px; border-radius: 20px; background: var(--panel-2); color: var(--text-dim); border: 1px solid var(--border); }
.tag-pill:hover { color: var(--text); border-color: var(--accent); }
.newsletter-panel { background: linear-gradient(160deg, var(--panel-2), var(--panel)); }
.newsletter-panel p { font-size: 13px; color: var(--text-dim); margin: 0 0 14px; line-height: 1.5; }
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; color: var(--text); font-family: 'Inter'; font-size: 13px; min-width: 0; }
.newsletter-form button { background: var(--accent); border: none; border-radius: 6px; color: var(--accent-ink); font-weight: 600; font-size: 13px; padding: 10px 16px; cursor: pointer; white-space: nowrap; }
.form-note { font-size: 11px; color: var(--text-dimmer); margin-top: 8px; }

/* ===== Generic inner-page header ===== */
.page-head { padding: 46px 0 30px; border-bottom: 1px solid var(--border); }
.page-head .kicker { margin-bottom: 10px; }
.page-head h1 { font-family: 'Newsreader', serif; font-size: clamp(28px, 4vw, 42px); font-weight: 600; margin: 0 0 14px; letter-spacing: -0.01em; }
.page-head p { font-size: 15.5px; color: var(--text-dim); max-width: 62ch; line-height: 1.6; margin: 0; }

/* ===== Crypto hub (list layout) ===== */
.crypto-list .article-row { grid-template-columns: 120px 1fr; }

/* ===== Stocks hub (card grid layout — visually distinct) ===== */
.indices-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; padding: 34px 0; border-bottom: 1px solid var(--border); }
.index-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.index-card .name { font-size: 11.5px; color: var(--text-dimmer); font-family: 'IBM Plex Mono', monospace; }
.index-card .val { font-family: 'Newsreader', serif; font-size: 22px; font-weight: 600; margin: 6px 0 4px; }
.index-card .chg { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; font-weight: 600; }
.stocks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 40px 0 50px; }
.stock-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: transform .15s ease, border-color .15s ease; }
.stock-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.stock-card .thumb { aspect-ratio: 16/10; border-radius: 0; border: none; border-bottom: 1px solid var(--border); }
.stock-card .body { padding: 18px; }
.stock-card h3 { font-family: 'Newsreader', serif; font-size: 18px; margin: 0 0 8px; font-weight: 600; }
.stock-card p { font-size: 13px; color: var(--text-dim); margin: 0 0 10px; line-height: 1.5; }

/* ===== Services page (distinct, non-article layout) ===== */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 46px 0; }
.service-card { padding: 26px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); display: flex; flex-direction: column; gap: 14px; transition: border-color .15s ease, transform .15s ease; }
.service-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.service-icon { width: 42px; height: 42px; }
.service-card h3 { font-family: 'Newsreader', serif; font-size: 19px; margin: 0; font-weight: 600; }
.service-card p { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; margin: 0; flex: 1; }
.service-cta { font-size: 12.5px; font-weight: 600; color: var(--accent); font-family: 'IBM Plex Mono', monospace; }
.cta-band { margin: 10px 0 46px; padding: 40px; border-radius: 14px; background: linear-gradient(135deg, var(--panel-2), var(--panel)); border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta-band h3 { font-family: 'Newsreader', serif; font-size: 24px; margin: 0 0 6px; font-weight: 600; }
.cta-band p { margin: 0; color: var(--text-dim); font-size: 14px; }
.cta-btn { background: var(--accent); color: var(--accent-ink); border: none; padding: 13px 24px; border-radius: 7px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; display: inline-block; }
.process { padding: 10px 0 50px; border-top: 1px solid var(--border); }
.process h2 { font-family: 'Newsreader', serif; font-size: 26px; font-weight: 600; margin: 26px 0 28px; }
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.process-step { position: relative; padding-top: 6px; }
.process-step .pn { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text-dimmer); }
.process-step h4 { font-family: 'Newsreader', serif; font-size: 16.5px; margin: 8px 0 6px; font-weight: 600; }
.process-step p { font-size: 13px; color: var(--text-dim); margin: 0; line-height: 1.55; }

/* ===== Single article page ===== */
.article-head { padding: 40px 0 24px; border-bottom: 1px solid var(--border); max-width: 76ch; }
.article-head h1 { font-family: 'Newsreader', serif; font-size: clamp(28px, 4.4vw, 44px); font-weight: 600; line-height: 1.12; margin: 14px 0 16px; }
.article-meta { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text-dimmer); display: flex; gap: 14px; flex-wrap: wrap; }
.article-featured { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); margin: 30px 0; aspect-ratio: 16/8; }
.article-featured img { width: 100%; height: 100%; object-fit: cover; }
.article-body { max-width: 68ch; margin: 0 auto 20px 0; font-size: 16.5px; line-height: 1.8; color: var(--text); }
.article-body p { margin: 0 0 20px; }
.article-body h2 { font-family: 'Newsreader', serif; font-size: 24px; margin: 34px 0 14px; font-weight: 600; }
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 48px; padding: 0 0 50px; }
.share-row { display: flex; gap: 10px; margin: 30px 0; }
.share-btn { border: 1px solid var(--border); border-radius: 20px; padding: 8px 16px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.share-btn:hover { color: var(--text); border-color: var(--accent); }
.keep-reading { margin-top: 40px; padding: 24px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.keep-reading h4 { font-family: 'Newsreader', serif; font-size: 17px; margin: 0 0 6px; }
.keep-reading p { font-size: 13.5px; color: var(--text-dim); margin: 0 0 14px; }
.keep-reading a.hub-cta { display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 13px; padding: 10px 18px; border-radius: 7px; }
.related-list .article-row { grid-template-columns: 70px 1fr; }

/* ===== About page ===== */
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 40px 0; border-bottom: 1px solid var(--border); }
.stat .num { font-family: 'Newsreader', serif; font-size: 40px; font-weight: 600; color: var(--accent); line-height: 1; }
.stat .lbl { font-size: 12.5px; color: var(--text-dim); margin-top: 8px; }
.about-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; padding: 46px 0; border-bottom: 1px solid var(--border); align-items: start; }
.about-split h2 { font-family: 'Newsreader', serif; font-size: 26px; font-weight: 600; margin: 0 0 16px; }
.about-split p { font-size: 15px; color: var(--text-dim); line-height: 1.7; margin: 0 0 14px; }
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 46px 0; border-bottom: 1px solid var(--border); }
.value-card { padding: 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.value-card .vi { width: 34px; height: 34px; margin-bottom: 14px; }
.value-card h3 { font-family: 'Newsreader', serif; font-size: 18px; margin: 0 0 8px; }
.value-card p { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; margin: 0; }
.timeline { padding: 46px 0; border-bottom: 1px solid var(--border); }
.timeline h2 { font-family: 'Newsreader', serif; font-size: 26px; font-weight: 600; margin: 0 0 28px; }
.tl-row { display: grid; grid-template-columns: 90px 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border); }
.tl-row:first-of-type { border-top: none; }
.tl-year { font-family: 'IBM Plex Mono', monospace; font-size: 14px; color: var(--teal); padding-top: 2px; }
.tl-row h4 { font-family: 'Newsreader', serif; font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.tl-row p { font-size: 13.5px; color: var(--text-dim); margin: 0; line-height: 1.55; }
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 46px 0; }
.avatar { width: 68px; height: 68px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Newsreader', serif; font-weight: 600; font-size: 20px; color: #fff; margin-bottom: 14px; }
.team-card h4 { font-size: 15px; margin: 0 0 3px; font-weight: 600; }
.team-card .role { font-size: 12px; color: var(--text-dimmer); font-family: 'IBM Plex Mono', monospace; }

/* ===== Contact page ===== */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; padding: 46px 0 60px; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--panel); border: 1px solid var(--border); border-radius: 7px; padding: 11px 13px;
  color: var(--text); font-family: 'Inter'; font-size: 14px; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.submit-btn { background: var(--accent); color: var(--accent-ink); border: none; padding: 13px 20px; border-radius: 7px; font-weight: 600; font-size: 14px; cursor: pointer; align-self: flex-start; }
.contact-status { font-size: 13px; color: var(--teal); min-height: 18px; }
.contact-info-card { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.contact-info-card:last-child { border-bottom: none; }
.ci-icon { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; }
.contact-info-card h4 { font-size: 14.5px; margin: 0 0 4px; font-weight: 600; }
.contact-info-card p { font-size: 13px; color: var(--text-dim); margin: 0; line-height: 1.5; }
.worldmap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-top: 22px; }

/* ===== Footer ===== */
footer.site-footer { border-top: 1px solid var(--border); padding: 40px clamp(16px, 4vw, 40px) calc(30px + env(safe-area-inset-bottom, 0px)); margin-top: 10px; }
.footer-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h5 { font-size: 12.5px; color: var(--text-dimmer); font-family: 'IBM Plex Mono', monospace; margin: 0 0 14px; letter-spacing: .04em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-grid a { color: var(--text-dim); font-size: 13.5px; }
.footer-grid a:hover { color: var(--accent); }
.footer-about p { font-size: 13px; color: var(--text-dim); line-height: 1.6; max-width: 32ch; }
.footer-bottom { max-width: 1240px; margin: 30px auto 0; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--text-dimmer); font-family: 'IBM Plex Mono', monospace; }

@media (max-width: 900px) {
  .hero, .content-grid, .about-split, .contact-grid, .article-layout { grid-template-columns: 1fr; }
  .stats-bar, .team-grid, .indices-bar, .stocks-grid, .services-grid, .process-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  nav.main-nav { display: none; }
  .burger { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .stats-bar, .team-grid, .indices-bar, .stocks-grid, .services-grid, .process-grid { grid-template-columns: 1fr; }
}
nav.main-nav.mobile-open { display: flex !important; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); flex-direction: column; padding: 16px clamp(16px,4vw,40px); border-bottom: 1px solid var(--border); gap: 4px; }
nav.main-nav.mobile-open a { padding: 10px 0; border-bottom: none; }
