/*
Theme Name: Capital Monitor Local
Theme URI: https://ht2.xyys.cc/
Author: Local editorial deployment
Description: A responsive editorial WordPress theme for the Capital Monitor archive.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.2
Text Domain: capital-monitor
*/

:root {
  --ink: #102f2b;
  --ink-2: #17483f;
  --cyan: #9bcf38;
  --cyan-bright: #c2eb6f;
  --paper: #f2f3e9;
  --white: #ffffff;
  --muted: #62717b;
  --line: #d8dedf;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--sans); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { display: block; max-width: 100%; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.page-shell { min-height: 100vh; overflow: clip; }

.utility-bar { background: var(--ink); color: #b8c7cf; font-size: 11px; letter-spacing: .055em; }
.utility-inner { min-height: 32px; display: flex; align-items: center; justify-content: space-between; }
.local-badge { color: var(--cyan-bright); text-transform: uppercase; font-weight: 700; }
.site-header { position: relative; z-index: 20; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); }
.header-main { height: 88px; display: flex; align-items: center; gap: 44px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 212px; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; background: var(--cyan); color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 23px; letter-spacing: -.06em; }
.brand-name { font-family: var(--serif); font-size: 17px; line-height: .92; font-weight: 700; letter-spacing: -.02em; }
.main-nav { display: flex; align-items: stretch; gap: 27px; height: 100%; }
.main-nav a { display: grid; place-items: center; position: relative; text-transform: uppercase; font-weight: 700; font-size: 11px; letter-spacing: .07em; white-space: nowrap; }
.main-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 4px; background: var(--cyan); transition: right .2s ease; }
.main-nav a:hover::after { right: 0; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.archive-link { font-weight: 700; font-size: 12px; border: 1px solid var(--ink); padding: 12px 15px; }
.search-button { width: 42px; height: 42px; border: 0; background: var(--cyan); color: var(--ink); font-size: 25px; cursor: pointer; }
.icon-button { display: none; }
.search-strip { background: var(--ink-2); color: white; }
.search-strip-inner { min-height: 84px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; }
.search-strip label { font-family: var(--serif); font-size: 20px; }
.search-strip input { min-width: 0; border: 0; border-bottom: 1px solid #78909d; background: transparent; color: white; padding: 12px 4px; outline: none; }
.search-strip button { border: 0; background: var(--cyan); color: var(--ink); padding: 12px 25px; font-weight: 700; cursor: pointer; }

.ticker { background: #edf2df; border-bottom: 1px solid #d6dfbf; }
.ticker-inner { min-height: 46px; display: flex; align-items: center; gap: 18px; font-size: 13px; white-space: nowrap; overflow: hidden; }
.ticker-inner strong { color: var(--cyan); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; }
.ticker-inner span { overflow: hidden; text-overflow: ellipsis; }
.section-kicker, .section-heading span { display: block; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero-section { padding-block: 54px 70px; }
.hero-section > .section-kicker { margin-bottom: 18px; }
.lead-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .75fr); gap: 38px; }
.article-card { min-width: 0; }
.card-image-wrap { display: block; overflow: hidden; background: #dce5e5; aspect-ratio: 16/9; }
.card-image { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.article-card:hover .card-image { transform: scale(1.035); }
.image-placeholder { height: 100%; display: grid; place-items: center; background: linear-gradient(145deg, var(--ink), #2e6658); color: var(--cyan); font: 700 34px var(--serif); }
.card-copy { padding-top: 15px; }
.eyebrow { color: var(--cyan); text-transform: uppercase; font-weight: 800; font-size: 10px; letter-spacing: .12em; margin-bottom: 9px; }
.article-card h3 { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.12; letter-spacing: -.025em; }
.article-card h3 a:hover { color: #067f8d; }
.article-card p { margin: 13px 0 0; color: var(--muted); font: 17px/1.5 var(--serif); }
.article-card-featured h3 { font-size: clamp(34px, 4.2vw, 59px); line-height: 1.01; }
.byline { display: flex; gap: 11px; flex-wrap: wrap; margin-top: 15px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.byline span { color: var(--ink); font-weight: 700; }
.lead-list { display: grid; gap: 24px; }
.lead-list .article-card { display: grid; grid-template-columns: 132px 1fr; gap: 16px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.lead-list .card-copy { padding-top: 0; }
.lead-list .article-card h3 { font-size: 19px; }
.lead-list .byline { margin-top: 10px; }
.hero-loading, .article-loading { min-height: 500px; display: grid; grid-template-columns: 2fr 1fr; gap: 28px; padding: 60px 10vw; }
.hero-loading div, .article-loading div { background: linear-gradient(100deg, #edf0ef 20%, #f7f8f7 50%, #edf0ef 80%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.hero-loading div:first-child { grid-row: span 2; }
@keyframes shimmer { to { background-position: -200% 0; } }

.ink-section { background: var(--ink); color: white; padding-block: 70px 78px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 28px; }
.section-heading h2 { font: 700 clamp(34px, 5vw, 56px)/.95 var(--serif); letter-spacing: -.035em; margin: 8px 0 0; }
.section-heading > a { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding-bottom: 7px; }
.section-heading > a b, .newsletter-inner a b { color: var(--cyan); font-size: 19px; margin-left: 7px; }
.section-heading-light { border-color: #325064; }
.analysis-grid { display: grid; grid-template-columns: 1.45fr repeat(3, 1fr); gap: 24px; }
.analysis-grid .article-card:not(:first-child) .article-card h3 { font-size: 20px; }
.analysis-grid .article-card-featured h3 { font-size: clamp(30px, 3.2vw, 45px); }
.analysis-grid .card-image-wrap { aspect-ratio: 4/3; }
.analysis-grid .article-card p, .analysis-grid .byline { color: #a8bbc4; }
.analysis-grid .byline span { color: white; }

.news-section, .themes-section { padding-block: 76px; }
.news-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 34px 24px; }
.news-grid .article-card { border-bottom: 1px solid var(--line); padding-bottom: 25px; }
.news-grid .article-card h3 { font-size: 21px; }
.newsletter-band { background: linear-gradient(105deg, #9bcf38, #c9ea7c); color: var(--ink); }
.newsletter-inner { min-height: 220px; display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.newsletter-inner .section-kicker { color: white; }
.newsletter-inner h2 { max-width: 720px; font: 700 clamp(34px, 5vw, 59px)/1 var(--serif); letter-spacing: -.04em; margin: 10px 0 0; }
.newsletter-inner a { background: var(--ink); color: white; padding: 18px 23px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.archive-main { background: var(--paper); }
.archive-hero { background: linear-gradient(120deg, var(--ink), #20594b); color: white; padding-block: 65px 55px; }
.archive-hero h1 { font: 700 clamp(50px, 7vw, 92px)/.92 var(--serif); letter-spacing: -.05em; margin: 18px 0 42px; }
.archive-search { display: flex; align-items: center; background: white; max-width: 780px; color: var(--ink); }
.archive-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 19px 22px; font-size: 16px; }
.archive-search span { padding: 0 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.archive-content { display: grid; grid-template-columns: 205px 1fr; gap: 50px; padding-block: 54px 80px; align-items: start; }
.filter-panel { position: sticky; top: 20px; display: grid; }
.filter-panel h2 { font: 700 22px var(--serif); margin: 0 0 15px; }
.filter-panel button, .filter-panel > a { display: flex; justify-content: space-between; border: 0; border-top: 1px solid #cfd6d5; background: transparent; padding: 13px 4px; text-align: left; text-transform: capitalize; cursor: pointer; color: #40525d; font-size: 12px; }
.filter-panel button span, .filter-panel > a span { color: #8b989e; }
.filter-panel button.active { color: var(--ink); font-weight: 800; border-left: 4px solid var(--cyan); padding-left: 10px; }
.filter-panel > a.active { color: var(--ink); font-weight: 800; border-left: 4px solid var(--cyan); padding-left: 10px; }
.archive-title-row { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 3px solid var(--ink); padding-bottom: 12px; margin-bottom: 26px; }
.archive-title-row h2 { font: 700 38px var(--serif); text-transform: capitalize; margin: 0; }
.archive-title-row span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 22px; }
.archive-grid .article-card h3 { font-size: 20px; }
.load-more { display: block; margin: 52px auto 0; border: 1px solid var(--ink); background: transparent; padding: 16px 28px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; font-size: 11px; cursor: pointer; }
.load-more:hover { background: var(--ink); color: white; }

.article-main { padding-bottom: 80px; }
.article-breadcrumb { display: flex; gap: 10px; padding-top: 30px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.article-breadcrumb a:hover { color: var(--cyan); }
.article-header { max-width: 980px; padding-block: 57px 38px; }
.article-header h1 { font: 700 clamp(48px, 7vw, 86px)/.95 var(--serif); letter-spacing: -.052em; margin: 12px 0 22px; }
.standfirst { max-width: 820px; color: #405563; font: 23px/1.42 var(--serif); margin: 0; }
.article-meta { display: flex; gap: 20px; align-items: center; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.article-meta strong { color: var(--ink); }
.hero-figure { margin-top: 0; }
.hero-figure img { width: 100%; max-height: 700px; object-fit: cover; }
.hero-figure figcaption { margin-top: 9px; color: var(--muted); font-size: 10px; }
.article-layout { display: grid; grid-template-columns: 65px minmax(0, 720px) minmax(210px, 1fr); gap: 38px; padding-top: 54px; align-items: start; }
.share-rail { position: sticky; top: 25px; display: grid; gap: 9px; justify-items: center; }
.share-rail span { writing-mode: vertical-rl; text-transform: uppercase; letter-spacing: .12em; font-size: 9px; color: var(--muted); margin-bottom: 8px; }
.share-rail a { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); font-weight: 700; font-size: 12px; }
.article-body { color: #243946; font: 19px/1.72 var(--serif); overflow: hidden; }
.article-body > :first-child { margin-top: 0; }
.article-body h2, .article-body h3 { color: var(--ink); font-family: var(--serif); line-height: 1.1; letter-spacing: -.025em; margin: 1.5em 0 .55em; }
.article-body h2 { font-size: 38px; }
.article-body h3 { font-size: 27px; }
.article-body a { color: #007e8c; text-decoration: underline; text-underline-offset: 3px; }
.article-body img { width: 100%; height: auto; margin-block: 30px 8px; }
.article-body figure { margin: 34px 0; }
.article-body blockquote { border-left: 5px solid var(--cyan); margin: 30px 0; padding: 5px 0 5px 28px; color: var(--ink); font-size: 25px; line-height: 1.35; }
.article-body table { max-width: 100%; border-collapse: collapse; font: 13px/1.4 var(--sans); }
.article-body td, .article-body th { border: 1px solid var(--line); padding: 8px; }
.source-card { background: var(--paper); border-top: 5px solid var(--cyan); padding: 24px; }
.source-card > span { color: var(--cyan); text-transform: uppercase; letter-spacing: .1em; font-size: 9px; font-weight: 800; }
.source-card h3 { font: 700 24px/1.1 var(--serif); margin: 11px 0; }
.source-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.source-card a { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.article-end { max-width: 980px; border-top: 1px solid var(--line); margin-top: 55px; padding-top: 20px; font-size: 12px; font-weight: 700; }
.missing-page { min-height: 60vh; display: grid; place-content: center; text-align: center; }
.missing-page span { color: var(--cyan); font-weight: 800; }
.missing-page h1 { font: 700 58px var(--serif); margin: 8px 0 22px; }
.status-panel { padding: 40px; background: var(--paper); border-left: 5px solid var(--cyan); }

.site-footer { background: #0a2823; color: #b9cbc4; padding-block: 60px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.1fr .6fr 1fr; gap: 70px; }
.footer-brand { color: white; font: 700 25px var(--serif); }
.footer-brand span { display: inline-grid; place-items: center; width: 42px; height: 42px; background: var(--cyan); color: var(--ink); margin-right: 9px; }
.site-footer h3 { color: white; text-transform: uppercase; font-size: 10px; letter-spacing: .1em; margin: 0 0 16px; }
.site-footer p { max-width: 500px; font-size: 12px; line-height: 1.65; }
.site-footer a { display: block; color: white; font-size: 12px; margin-block: 10px; }
.footer-bottom { display: flex; justify-content: space-between; border-top: 1px solid #29404e; margin-top: 45px; padding-top: 20px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.footer-bottom a { margin: 0; color: var(--cyan); }

/* WordPress integration */
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; }
.pagination .page-numbers { border: 1px solid var(--ink); padding: 10px 14px; font-size: 12px; font-weight: 700; }
.pagination .current, .pagination a:hover { background: var(--ink); color: white; }
.article-body .grid-x, .article-body .cell, .article-body .main-content { display: block; width: auto; }
.article-body .wp-caption { max-width: 100% !important; }
.article-body .wp-caption-text, .article-body figcaption { color: var(--muted); font: 11px/1.45 var(--sans); }
.article-body iframe { max-width: 100%; }
.article-body > div:empty, .article-body aside:empty { display: none; }
.admin-bar .site-header { top: 32px; }
.no-results { grid-column: 1 / -1; padding: 60px 25px; text-align: center; background: white; border-top: 5px solid var(--cyan); }
.no-results h2 { font: 700 36px var(--serif); margin: 0 0 10px; }
.brand-logo { width: 58px; height: 58px; object-fit: contain; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

@media (max-width: 1050px) {
  .header-main { gap: 24px; }
  .main-nav { gap: 16px; }
  .main-nav a:nth-last-child(-n+2) { display: none; }
  .analysis-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid, .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 50px minmax(0, 1fr); }
  .source-card { grid-column: 2; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 28px, 1180px); }
  .utility-inner > span:first-child, .archive-link { display: none; }
  .utility-inner { justify-content: flex-end; }
  .header-main { height: 70px; justify-content: space-between; }
  .brand { min-width: 0; }
  .brand-mark { width: 44px; height: 44px; font-size: 18px; }
  .brand-name { display: none; }
  .icon-button { display: grid; width: 42px; height: 42px; padding: 11px 9px; border: 0; background: transparent; cursor: pointer; }
  .menu-button span { height: 2px; background: var(--ink); }
  .main-nav { display: none; position: absolute; top: 70px; left: 0; right: 0; height: auto; background: white; border-bottom: 4px solid var(--cyan); padding: 18px 20px; }
  .main-nav.is-open { display: grid; }
  .main-nav a { display: block !important; padding: 12px; border-bottom: 1px solid var(--line); }
  .header-actions { margin-left: 0; }
  .search-strip-inner { grid-template-columns: 1fr auto; padding-block: 16px; }
  .search-strip label { display: none; }
  .hero-section { padding-block: 38px 52px; }
  .lead-layout { grid-template-columns: 1fr; }
  .article-card-featured h3 { font-size: 38px; }
  .lead-list .article-card { grid-template-columns: 112px 1fr; }
  .analysis-grid, .news-grid, .theme-grid, .archive-grid { grid-template-columns: 1fr; }
  .analysis-grid .article-card { display: grid; grid-template-columns: 120px 1fr; gap: 15px; }
  .analysis-grid .article-card:first-child { display: block; }
  .analysis-grid .card-copy { padding-top: 0; }
  .analysis-grid .article-card:first-child .card-copy { padding-top: 15px; }
  .newsletter-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 44px; }
  .newsletter-inner h2 { font-size: 39px; }
  .archive-hero h1 { font-size: 52px; }
  .archive-search span { display: none; }
  .archive-content { grid-template-columns: 1fr; gap: 30px; }
  .filter-panel { position: static; display: flex; overflow-x: auto; gap: 8px; padding-bottom: 8px; }
  .filter-panel h2 { display: none; }
  .filter-panel button { flex: none; border: 1px solid var(--line); padding: 10px 13px; gap: 12px; }
  .filter-panel > a { flex: none; border: 1px solid var(--line); padding: 10px 13px; gap: 12px; }
  .filter-panel button.active { border-left: 1px solid var(--line); border-bottom: 3px solid var(--cyan); padding-left: 13px; }
  .filter-panel > a.active { border-left: 1px solid var(--line); border-bottom: 3px solid var(--cyan); padding-left: 13px; }
  .article-header { padding-block: 40px 28px; }
  .article-header h1 { font-size: 49px; }
  .standfirst { font-size: 20px; }
  .article-meta { align-items: flex-start; flex-direction: column; gap: 7px; }
  .article-layout { grid-template-columns: 1fr; padding-top: 35px; }
  .share-rail { position: static; display: flex; justify-content: flex-start; align-items: center; }
  .share-rail span { writing-mode: initial; margin: 0 8px 0 0; }
  .source-card { grid-column: 1; }
  .footer-grid { grid-template-columns: 1fr; gap: 35px; }
}
