/*
Theme Name: GovInfo
Description: Fast, ad-optimised theme for government announcement and jobs sites. Six reserved AdSense slots, zero layout shift, no external font requests.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: govinfo
*/

/* ------------------------------------------------------------------
   Design tokens
   ------------------------------------------------------------------ */
:root {
  --ink: #10151c;
  --ink-2: #39424e;
  --ink-3: #6b7683;
  --line: #dde3e9;
  --line-2: #eef2f5;
  --paper: #ffffff;
  --surface: #f5f7f9;

  --brand: #056839;      /* deep, authoritative green — not flag neon */
  --brand-dark: #04492a;
  --brand-wash: #e8f2ec;
  --urgent: #b45309;     /* deadlines */
  --urgent-wash: #fdf3e7;

  --sans: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Noto Sans",
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;

  --wrap: 1200px;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 21, 28, .06), 0 4px 12px rgba(16, 21, 28, .04);
}

/* ------------------------------------------------------------------
   Reset
   ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
input, button, textarea, select { font: inherit; color: inherit; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: #fff; padding: 12px 18px;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }

.topbar {
  background: var(--ink);
  color: #b9c2cc;
  font-size: 12.5px;
  letter-spacing: .02em;
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 34px;
}
.topbar time { color: #8c97a3; }

.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 18px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; flex: none; border-radius: var(--radius);
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 19px; letter-spacing: -.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--ink);
}
.brand-tag { font-size: 12px; color: var(--ink-3); font-weight: 500; }

.search-form { display: flex; }
.search-form input[type="search"] {
  width: 210px; padding: 9px 12px;
  border: 1px solid var(--line); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface); font-size: 14px;
}
.search-form input[type="search"]:focus {
  outline: 2px solid var(--brand); outline-offset: -2px; background: #fff;
}
.search-form button {
  padding: 9px 16px; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 600;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.search-form button:hover { background: var(--brand-dark); }

/* Primary nav */
.nav-bar { background: var(--brand); }
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 10px 0; color: #fff; font-weight: 600; font-size: 15px;
}
.primary-nav ul {
  display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0;
}
.primary-nav a {
  display: block; padding: 12px 16px;
  color: #fff; text-decoration: none;
  font-size: 14.5px; font-weight: 600; letter-spacing: .01em;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a {
  background: var(--brand-dark); color: #fff;
}

/* ------------------------------------------------------------------
   Ad slots — every one reserves its height so ads never shift layout
   ------------------------------------------------------------------ */
.ad {
  display: block; margin: 0 auto; text-align: center; overflow: hidden;
}
.ad-label {
  display: block;
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-3); margin-bottom: 6px;
}
.ad-inner { display: block; width: 100%; }

/* Reserved heights: prevents the CLS penalty that unreserved ads cause. */
.ad--header      { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.ad--header      .ad-inner { min-height: 100px; }
.ad--article-top .ad-inner,
.ad--article-mid .ad-inner,
.ad--article-end .ad-inner { min-height: 280px; }
.ad--sidebar     .ad-inner { min-height: 600px; }
.ad--footer      .ad-inner { min-height: 100px; }
.ad--in-feed     .ad-inner { min-height: 250px; }

.ad--article-top, .ad--article-mid, .ad--article-end { margin: 30px 0; }
.ad--footer { margin: 36px 0 0; padding: 20px 0; border-top: 1px solid var(--line-2); }
.ad--in-feed { margin: 4px 0; padding: 18px; background: var(--surface); border-radius: var(--radius); }

/* Admin-only placeholder so you can see the slots before pasting real code.
   Visitors never see these. */
.ad-placeholder {
  display: grid; place-content: center; gap: 4px;
  border: 2px dashed #c3ccd6; border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 10px, #f2f4f7 10px, #f2f4f7 20px);
  color: var(--ink-3); padding: 16px;
}
.ad-placeholder strong { color: var(--ink-2); font-size: 14px; }
.ad-placeholder span { font-size: 12px; }

@media (min-width: 1024px) {
  .ad--sidebar { position: sticky; top: 20px; }
}

/* ------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------ */
.site-main { padding: 28px 0 40px; }
.layout { display: grid; gap: 36px; }
@media (min-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 2px solid var(--ink);
}
.section-head h2 {
  font-size: 19px; font-weight: 800; letter-spacing: -.01em;
}
.section-head a { font-size: 13.5px; font-weight: 600; }

/* ------------------------------------------------------------------
   Cards — the "official notice" look: left accent rule + mono ref numbers
   ------------------------------------------------------------------ */
.card-list { display: grid; gap: 14px; }

.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: #c7d0d9; }
.card--urgent { border-left-color: var(--urgent); }

.card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-3); margin-bottom: 8px;
}
.chip {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--brand-wash); color: var(--brand-dark); text-decoration: none;
}
.chip--urgent { background: var(--urgent-wash); color: var(--urgent); }
.chip--ref { background: var(--surface); color: var(--ink-2); font-family: var(--mono); text-transform: none; letter-spacing: 0; }

.card-title { font-size: 17.5px; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--brand); }
.card-excerpt { margin-top: 7px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }

.card-foot {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line-2);
  font-size: 12.5px; color: var(--ink-3);
}
.card-foot b { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------
   Single post
   ------------------------------------------------------------------ */
.breadcrumb { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb span { margin: 0 6px; color: #b6c0ca; }

.entry-header { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.entry-title {
  font-size: clamp(26px, 4.4vw, 36px); line-height: 1.2;
  font-weight: 800; letter-spacing: -.025em; margin-bottom: 12px;
}
.entry-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-3);
}

.entry-content { font-size: 17.5px; line-height: 1.72; }
.entry-content > * + * { margin-top: 1.15em; }
.entry-content h2 {
  font-size: 23px; font-weight: 800; letter-spacing: -.015em;
  margin-top: 1.7em; padding-left: 12px; border-left: 4px solid var(--brand);
}
.entry-content h3 { font-size: 19px; font-weight: 700; margin-top: 1.5em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li + li { margin-top: .4em; }
.entry-content strong { font-weight: 700; }
.entry-content blockquote {
  border-left: 4px solid var(--line); padding-left: 16px; color: var(--ink-2); font-style: italic;
}

/* The summary table is the thing the source site doesn't give readers. */
.entry-content table {
  width: 100%; border-collapse: collapse;
  font-size: 15.5px; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: table;
}
.entry-content table th,
.entry-content table td {
  padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}
.entry-content table th {
  width: 38%; background: var(--surface); font-weight: 600; color: var(--ink-2);
}
.entry-content table tr:last-child th,
.entry-content table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.source-note {
  margin-top: 28px; padding: 14px 16px;
  background: var(--surface); border-left: 3px solid var(--ink-3);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px; color: var(--ink-2);
}

.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.share-row a {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink-2);
}
.share-row a:hover { border-color: var(--brand); color: var(--brand); }

/* ------------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------------ */
.sidebar { display: grid; gap: 24px; align-content: start; }
.widget {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.widget-title {
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  padding: 11px 14px; background: var(--ink); color: #fff;
}
.widget-body { padding: 6px 14px 12px; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--ink); text-decoration: none; font-weight: 500; }
.widget a:hover { color: var(--brand); }

/* ------------------------------------------------------------------
   Pagination / footer / 404
   ------------------------------------------------------------------ */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.pagination .page-numbers {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 600;
}
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }

.site-footer { background: var(--ink); color: #9aa5b1; margin-top: 40px; padding: 34px 0 26px; font-size: 14px; }
.footer-grid { display: grid; gap: 26px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .1em;
  color: #fff; margin-bottom: 12px;
}
.site-footer a { color: #c3ccd6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-disclaimer {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid #2a323c;
  font-size: 12.5px; color: #77828e; line-height: 1.6;
}

.notice-empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }

/* ------------------------------------------------------------------
   Mobile
   ------------------------------------------------------------------ */
@media (max-width: 1023px) {
  body { font-size: 16px; }
  .masthead { flex-wrap: wrap; gap: 12px; }
  .search-form { width: 100%; }
  .search-form input[type="search"] { width: 100%; }
  .nav-toggle { display: block; }
  .primary-nav { display: none; padding-bottom: 8px; }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; }
  .primary-nav a { padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.14); }
  .ad--sidebar .ad-inner { min-height: 280px; }
}

@media print {
  .ad, .site-footer, .nav-bar, .sidebar, .share-row { display: none !important; }
}
