/*
Theme Name: GDI Broadsheet
Theme URI: https://blog.masorigins.com
Description: Lightweight news theme for Global Defense Insights. Broadsheet layout, no page builder, no jQuery.
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: gdi
License: Proprietary
*/

:root {
  --accent: #9E1B1B;
  --ink: #16181B;
  --body: #3A3F45;
  --muted: #5A5F66;
  --rule: #DEDED8;
  --rule-strong: #C9CAC3;
  --paper: #FAFAF8;
  --white: #FFFFFF;
  --placeholder: #DADCD7;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }

.screen-reader-text, .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 1000; background: var(--white); padding: 10px 14px; border: 2px solid var(--ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.serif { font-family: var(--serif); }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.meta { font-size: 13px; color: var(--muted); }
.dek { color: var(--body); line-height: 1.55; }

/* ---------- Header ---------- */
.utility { background: var(--white); border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.utility .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-top: 8px; padding-bottom: 8px; }
.utility nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.utility a { color: var(--muted); }

.masthead { background: var(--white); }
.masthead > .wrap { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; padding-top: 28px; padding-bottom: 20px; }
.brand { display: flex; flex-direction: column; gap: 6px; }
.brand-name { font-family: var(--serif); font-size: clamp(30px, 5vw, 44px); font-weight: 700; letter-spacing: -.01em; line-height: 1; margin: 0; }
.brand-tagline { font-size: 15px; color: var(--muted); }
.custom-logo { max-height: 64px; width: auto; }

.search-form { display: flex; gap: 8px; align-items: center; }
.search-form input[type="search"] { width: 280px; max-width: 60vw; height: 44px; padding: 0 14px; border: 1px solid var(--rule-strong); border-radius: 6px; font: inherit; font-size: 15px; background: var(--white); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--ink); color: var(--white); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover, .btn:focus-visible { color: var(--white); background: #000; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent); filter: brightness(.9); }
.btn-outline { background: var(--white); color: var(--ink); border: 1px solid var(--rule-strong); }
.btn-outline:hover { background: var(--white); color: var(--accent); }

.primary-nav { background: var(--white); border-top: 3px solid var(--ink); border-bottom: 1px solid var(--rule); }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 26px; font-size: 15px; font-weight: 600; }
.primary-nav a { display: inline-block; padding: 13px 0; }
.primary-nav .current-menu-item > a, .primary-nav .current-cat > a, .primary-nav a[aria-current="page"] { color: var(--accent); }

.latest-strip { background: var(--ink); color: var(--white); font-size: 14px; }
.latest-strip .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding-top: 10px; padding-bottom: 10px; }
.latest-strip .label { background: var(--accent); color: var(--white); font-weight: 700; font-size: 12px; letter-spacing: .08em; padding: 4px 8px; border-radius: 3px; }
.latest-strip time { color: #C5C8CC; margin-right: 6px; }
.latest-strip a { color: var(--white); }
.latest-strip a:hover { color: #F0C9C9; }

/* ---------- Layout ---------- */
.site-main { padding-top: 32px; padding-bottom: 16px; }
.stack { display: flex; flex-direction: column; gap: 48px; }
.row { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.col-main { flex: 2 1 560px; min-width: 0; }
.col-side { flex: 1 1 300px; min-width: 0; }
.with-sidebar { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.with-sidebar > .content { flex: 999 1 600px; min-width: 0; }
.with-sidebar > aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 18px; }
.section-head h2 { font-family: var(--serif); font-size: 28px; }
.section-head a.more { font-size: 14px; font-weight: 600; color: var(--accent); }
.label-head { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding-bottom: 10px; border-bottom: 2px solid var(--ink); margin-bottom: 4px; }

/* ---------- Media placeholders ---------- */
.media { background: var(--placeholder); border-radius: 4px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #4A4F55; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media-lead { aspect-ratio: 16 / 9; }
.media-card { aspect-ratio: 16 / 9; }
.media-thumb { aspect-ratio: 5 / 3; width: 100%; }
.list-item .thumb { flex: 0 0 200px; }

/* ---------- Lead and top stories ---------- */
.lead { display: flex; flex-direction: column; gap: 14px; }
.lead h2 { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; font-weight: 700; }
.lead .dek { font-size: 18px; }
.top-list .item { padding: 16px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; }
.top-list h3 { font-family: var(--serif); font-size: 20px; line-height: 1.25; font-weight: 600; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.card { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.card h3 { font-family: var(--serif); font-size: 19px; line-height: 1.3; font-weight: 600; }

/* ---------- Lists ---------- */
.list-item { display: flex; flex-wrap: wrap; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.list-item .text { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.list-item h3 { font-family: var(--serif); font-size: 21px; line-height: 1.25; font-weight: 600; }
.list-item .dek { font-size: 15px; }
.compact .item { padding: 14px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; }
.compact h3 { font-family: var(--serif); font-size: 18px; line-height: 1.3; font-weight: 600; }
.numbered .item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.numbered .num { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--accent); width: 22px; line-height: 1; flex: none; }
.numbered h3 { font-family: var(--serif); font-size: 17px; line-height: 1.35; font-weight: 600; }

.columns-3 { display: flex; flex-wrap: wrap; gap: 32px; }
.columns-3 > div { flex: 1 1 300px; min-width: 0; }
.columns-3 .section-head { margin-bottom: 0; }
.columns-3 .section-head h2 { font-size: 24px; }

/* ---------- Boxes ---------- */
.box { background: var(--white); border: 1px solid var(--rule); border-radius: 6px; padding: 24px; }
.dark-box { background: var(--ink); color: var(--white); border-radius: 6px; padding: 32px; }
.dark-box p { color: #D2D5D9; }
.dark-box h2 { font-family: var(--serif); font-size: 30px; }
.newsletter { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; justify-content: space-between; }
.newsletter > div { flex: 1 1 380px; display: flex; flex-direction: column; gap: 10px; }
.newsletter form { flex: 1 1 380px; display: flex; flex-wrap: wrap; gap: 10px; }
.newsletter input[type="email"] { flex: 1 1 220px; height: 48px; padding: 0 14px; border: 0; border-radius: 6px; font: inherit; font-size: 16px; }
.side-newsletter form { display: flex; flex-direction: column; gap: 8px; }
.side-newsletter input[type="email"] { height: 44px; padding: 0 12px; border: 0; border-radius: 6px; font: inherit; }
.side-newsletter h2 { font-size: 24px; }

.shows .show { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.shows .tag { width: 64px; flex: none; text-align: center; padding: 8px 0; background: var(--white); border: 1px solid var(--rule); border-radius: 4px; font-size: 11px; font-weight: 700; color: var(--body); letter-spacing: .04em; }

/* ---------- Article ---------- */
.breadcrumb { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumb a { color: var(--muted); }
.article { max-width: 780px; display: flex; flex-direction: column; gap: 20px; }
.article-title { font-family: var(--serif); font-size: clamp(32px, 4vw, 46px); line-height: 1.1; font-weight: 700; }
.article-dek { font-size: 20px; line-height: 1.5; color: var(--body); }
.byline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.byline .who { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #EEEEE9; color: var(--body); font-size: 12px; font-weight: 600; }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.share a, .share button { min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--white); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); }
figure.featured { margin: 0; display: flex; flex-direction: column; gap: 8px; }
figure.featured figcaption { font-size: 13px; color: var(--muted); }

.entry-content { font-family: var(--serif); font-size: 20px; line-height: 1.7; }
.entry-content > * + * { margin-top: 20px; }
.entry-content > .standfirst:first-child { display: none; } /* shown above as the article summary */
.entry-content h2 { font-family: var(--sans); font-size: 24px; font-weight: 600; margin-top: 32px; }
.entry-content h3 { font-family: var(--sans); font-size: 20px; font-weight: 600; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.entry-content blockquote { margin: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--rule-strong); color: var(--body); }
.entry-content .why-it-matters { background: var(--white); border: 1px solid var(--rule); border-radius: 6px; padding: 20px 24px; font-size: 19px; line-height: 1.55; }
.entry-content .why-it-matters strong { display: block; font-family: var(--sans); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.entry-content .source-credit { font-family: var(--sans); font-size: 14px; color: var(--body); border-top: 1px solid var(--rule); padding-top: 16px; margin-top: 32px; }
.entry-content .source-credit em, .entry-content .ai-note em { font-style: normal; }
.entry-content .ai-note { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 6px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a, .chips a { padding: 8px 14px; border: 1px solid var(--rule-strong); border-radius: 20px; font-size: 14px; background: var(--white); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Archive ---------- */
.archive-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.archive-head h1 { font-family: var(--serif); font-size: clamp(36px, 5vw, 52px); line-height: 1; }
.archive-head .dek { font-size: 17px; max-width: 720px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.pagination .page-numbers { min-width: 44px; height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--rule-strong); border-radius: 6px; font-weight: 600; background: var(--white); }
.pagination .page-numbers.current { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* ---------- Page ---------- */
.page-content { max-width: 780px; }
.page-content h1 { font-family: var(--serif); font-size: clamp(34px, 4vw, 48px); line-height: 1.05; margin-bottom: 24px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 64px; background: var(--ink); color: #D2D5D9; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 32px 64px; padding-top: 48px; padding-bottom: 48px; }
.site-footer a { color: #D2D5D9; }
.site-footer a:hover { color: var(--white); }
.site-footer .about { flex: 2 1 320px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.6; }
.site-footer .about .name { font-family: var(--serif); font-size: 28px; font-weight: 700; color: var(--white); }
.site-footer .about a { color: var(--white); text-decoration: underline; }
.site-footer .col { flex: 1 1 160px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.site-footer .col h2 { font-size: 14px; font-weight: 600; color: var(--white); font-family: var(--sans); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.copyright { border-top: 1px solid #2E3237; font-size: 13px; }
.copyright .wrap { padding-top: 16px; padding-bottom: 16px; }

.empty { padding: 40px 0; color: var(--muted); font-size: 17px; }

@media (max-width: 640px) {
  .primary-nav ul { gap: 0 18px; font-size: 14px; }
  .primary-nav a, .primary-nav details summary { padding: 9px 0; }
  .latest-strip .wrap > span:nth-of-type(n+3) { display: none; }
  .masthead > .wrap { padding-top: 20px; }
  .list-item .thumb { flex-basis: 100%; }
  .search-form input[type="search"] { width: 100%; }
  .search-form { width: 100%; }
  .dark-box { padding: 24px; }
  .entry-content { font-size: 18px; }
}

.side-newsletter { display: flex; flex-direction: column; gap: 14px; }
.side-newsletter > div { display: flex; flex-direction: column; gap: 10px; }

.entry-content .key-facts { background: #F1F1EC; border-radius: 6px; padding: 20px 24px; font-family: var(--sans); }
.entry-content .key-facts h2 { margin: 0 0 10px; font-size: 18px; }
.entry-content .key-facts ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 32px; font-size: 15px; line-height: 1.45; }
.entry-content .key-facts strong { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }

/* Regions dropdown in the main menu */
.primary-nav .has-sub { position: relative; }
.primary-nav details summary { list-style: none; cursor: pointer; padding: 13px 0; }
.primary-nav details summary::-webkit-details-marker { display: none; }
.primary-nav details summary::after { content: " \25BE"; font-size: 12px; }
.primary-nav details[open] summary { color: var(--accent); }
.primary-nav details ul { position: absolute; top: 100%; left: -16px; z-index: 50; display: flex; flex-direction: column; gap: 0; min-width: 210px; padding: 6px 0; background: var(--white); border: 1px solid var(--rule-strong); border-radius: 6px; }
.primary-nav details li a { display: block; padding: 10px 16px; }

/* Around the world */
.regions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 24px 32px; }
.regions-grid .label-head a { color: var(--ink); }
.regions-grid h3.label-head { font-size: 13px; }

/* Story-type highlight box and quick answers (new article format) */
.entry-content .highlight-box { background: var(--white); border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: 0 0 6px 6px; padding: 18px 24px 20px; font-family: var(--sans); }
.entry-content .highlight-box h2 { margin: 0 0 12px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.entry-content .highlight-box ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 32px; font-size: 16px; line-height: 1.4; }
.entry-content .highlight-box strong { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.entry-content .quick-answers { border-top: 1px solid var(--rule); padding-top: 20px; margin-top: 32px; }
.entry-content .quick-answers h2 { margin-top: 0; }
.entry-content .quick-answers h3 { font-family: var(--sans); font-size: 18px; font-weight: 600; margin: 18px 0 4px; }
.entry-content .quick-answers p { margin-top: 0; font-size: 18px; }

/* Advertising slots */
.ad-band { background: var(--white); border-bottom: 1px solid var(--rule); }
.ad-band .wrap { padding-top: 12px; padding-bottom: 12px; }
.ad-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 auto; }
.ad-slot .ad-label { align-self: stretch; text-align: center; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-slot img { max-width: 100%; height: auto; }
.ad-header img, .ad-section_top img, .ad-in_article img { max-height: 250px; width: auto; }
.ad-home_mid img { max-height: 250px; width: auto; }
.ad-sidebar img { max-height: 600px; width: auto; }
.archive-head + .ad-slot { margin-bottom: 28px; }
.entry-content .ad-slot { font-family: var(--sans); padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.ad-house .house { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 22px; border: 1px dashed var(--rule-strong); border-radius: 6px; text-align: center; background: var(--white); }
.ad-house .house strong { font-family: var(--serif); font-size: 19px; }
.ad-house .house span { font-size: 14px; color: var(--muted); }
.ad-home_mid.ad-house .house { padding: 32px; }

/* Sponsored content */
.kicker.sponsored { color: #7A4B00; }
.sponsored-notice { background: #FBF3E4; border: 1px solid #E9D3A8; border-radius: 6px; padding: 14px 18px; font-size: 15px; line-height: 1.5; color: #4A3200; }
.sponsored-notice strong { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.sponsored-notice a { color: #4A3200; text-decoration: underline; }
