/* TreasuryRateHub theme. Design tokens (--trh-*) come from the plugin's trh.css and are
   repeated here so the theme still renders sensibly without the plugin. */
:root {
  --trh-navy: #10233F; --trh-navy-2: #19365B; --trh-teal: #0F9D91; --trh-teal-dark: #0B7A70;
  --trh-bg: #F5F8FC; --trh-surface: #FFFFFF; --trh-text: #172B45; --trh-muted: #5B6B80; --trh-border: #E2E8F0;
  --trh-radius: 10px; --trh-shadow: 0 1px 2px rgba(16, 35, 63, .06), 0 1px 1px rgba(16, 35, 63, .04);
  --trh-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; background: var(--trh-bg); color: var(--trh-text); font: 400 16px/1.65 var(--trh-font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--trh-teal-dark); text-underline-offset: 2px; }
a:hover { color: var(--trh-navy-2); }
:focus-visible { outline: 3px solid var(--trh-teal); outline-offset: 2px; }
h1, h2, h3, h4 { color: var(--trh-navy); line-height: 1.25; letter-spacing: -.01em; }
table { font-variant-numeric: tabular-nums; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--trh-navy); color: #fff; padding: 10px 14px; border-radius: 6px; font-weight: 600; }
.skip-link:focus { top: 10px; color: #fff; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.site-main { outline: none; min-height: 60vh; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--trh-border); backdrop-filter: saturate(1.4) blur(6px); }
.admin-bar .site-header { top: 32px; }
.site-header__inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--trh-navy); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; flex-shrink: 0; }
.brand:hover { color: var(--trh-navy); }
.brand__img { max-height: 40px; width: auto; }
.brand--light { color: #fff; }
.brand--light:hover { color: #fff; }
.brand--light .brand__mark rect:nth-child(1) { fill: #3B6EA5; }
.brand--light .brand__mark rect:nth-child(2) { fill: #C9D6E8; }

.site-nav { margin-left: auto; }
.site-nav__list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav__list a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--trh-text); text-decoration: none; font-weight: 500; font-size: .94rem; }
.site-nav__list a:hover { background: var(--trh-bg); color: var(--trh-navy); }
.site-nav__list .current-menu-item > a, .site-nav__list .current_page_item > a, .site-nav__list a[aria-current="page"] { color: var(--trh-navy); font-weight: 700; box-shadow: inset 0 -2px 0 var(--trh-teal); border-radius: 0; }
.site-nav__list .sub-menu { display: none; }

.nav-toggle, .site-search__toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 8px;
  border: 1px solid var(--trh-border); background: #fff; color: var(--trh-navy); cursor: pointer;
}
.nav-toggle { display: none; margin-left: auto; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.site-search { position: relative; }
.site-search__panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(360px, 90vw); background: #fff; border: 1px solid var(--trh-border); border-radius: var(--trh-radius); padding: 12px; box-shadow: 0 10px 30px rgba(16, 35, 63, .12); }

.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] { flex: 1; min-height: 44px; padding: 8px 12px; border: 1px solid #CBD5E1; border-radius: 8px; font: inherit; }
.search-form button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--trh-teal); color: #fff; font: 600 .92rem var(--trh-font); cursor: pointer; }
.search-form button:hover { background: var(--trh-teal-dark); }

/* Sections (homepage) */
.section { padding: 48px 0; }
.section--alt { background: #fff; border-top: 1px solid var(--trh-border); border-bottom: 1px solid var(--trh-border); }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.section__title { font-size: clamp(1.4rem, 2.4vw, 1.75rem); margin: 0; }
.eyebrow { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--trh-teal-dark); margin: 0 0 6px; }
.section-link { font-weight: 600; text-decoration: none; font-size: .92rem; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.panel { background: #fff; border: 1px solid var(--trh-border); border-radius: var(--trh-radius); padding: 18px; box-shadow: var(--trh-shadow); min-width: 0; }
.panel__title { font-size: 1.05rem; margin: 0 0 10px; }

/* Pages and articles */
.page-wrap { padding-top: 20px; padding-bottom: 56px; }
.breadcrumbs { font-size: .84rem; color: var(--trh-muted); margin-bottom: 14px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; color: #94A3B8; }
.breadcrumbs a { color: var(--trh-muted); }
.breadcrumbs .separator { margin: 0 6px; color: #94A3B8; }
.page-header { margin-bottom: 18px; }
.page-title { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin: 0 0 8px; }
.page-lead { font-size: 1.1rem; color: var(--trh-muted); max-width: 780px; margin: 0 0 8px; }
.page-meta { font-size: .84rem; color: var(--trh-muted); margin: 0; }

.entry-content > :where(p, ul, ol, h2, h3, h4, h5, blockquote, dl, .wp-block-table, figure:not(.trh-figure)) { max-width: 800px; }
.entry-content h2 { font-size: 1.5rem; margin: 2.2rem 0 .7rem; }
.entry-content h3 { font-size: 1.18rem; margin: 1.6rem 0 .5rem; }
.entry-content p, .entry-content li { color: #22364F; }
.entry-content li + li { margin-top: .35rem; }
.entry-content blockquote { margin: 1.5rem 0; padding: 12px 18px; border-left: 4px solid var(--trh-teal); background: #fff; border-radius: 0 8px 8px 0; }
.entry-content table:not(.trh-table) { border-collapse: collapse; width: 100%; background: #fff; font-size: .92rem; }
.entry-content table:not(.trh-table) th, .entry-content table:not(.trh-table) td { border: 1px solid var(--trh-border); padding: 8px 10px; text-align: left; }
.entry-content table:not(.trh-table) th { background: #F8FAFD; }
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content code { background: #EEF2F7; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.callout { background: #fff; border: 1px solid var(--trh-border); border-left: 4px solid var(--trh-teal); border-radius: 8px; padding: 14px 18px; margin: 1.4rem 0; max-width: 800px; }
.callout--warn { border-left-color: #B7791F; background: #FFFBF3; }
.faq h3 { margin-top: 1.4rem; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #fff; border: 1px solid var(--trh-border); border-radius: 8px; padding: 10px 14px; overflow-x: auto; max-width: 800px; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.article { background: #fff; border: 1px solid var(--trh-border); border-radius: var(--trh-radius); padding: 28px 32px; box-shadow: var(--trh-shadow); }
.article__hero { margin: 0 0 20px; }
.article__hero img { border-radius: 8px; }
.article__foot { border-top: 1px solid var(--trh-border); margin-top: 28px; padding-top: 14px; }
.article-aside { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 16px; }
.article-aside .trh-cards { grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0 0 8px; }
.article-aside .trh-card { padding: 10px 12px; box-shadow: none; }
.article-aside .trh-card__value { font-size: 1.3rem; }
.related { padding-bottom: 0; }
.related__list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.related__list a { display: block; background: #fff; border: 1px solid var(--trh-border); border-radius: 8px; padding: 14px; font-weight: 600; text-decoration: none; color: var(--trh-navy); height: 100%; }
.related__list a:hover { border-color: var(--trh-teal); }

.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.result { background: #fff; border: 1px solid var(--trh-border); border-radius: 8px; padding: 16px 18px; }
.result__title { font-size: 1.1rem; margin: 0 0 4px; }
.result__title a { text-decoration: none; color: var(--trh-navy); }
.result__meta { font-size: .8rem; color: var(--trh-muted); margin: 0 0 6px; }
.result p { margin: 0; }
.search-again { max-width: 520px; margin-top: 12px; }
.notfound__links { columns: 2; max-width: 600px; padding-left: 1.1rem; }
.nav-links { display: flex; gap: 8px; margin-top: 20px; }
.nav-links .page-numbers { padding: 6px 12px; border: 1px solid var(--trh-border); border-radius: 6px; background: #fff; text-decoration: none; }
.nav-links .current { background: var(--trh-navy); color: #fff; }

/* Footer */
.site-footer { background: var(--trh-navy); color: #C9D6E8; margin-top: 40px; }
.site-footer__inner { max-width: 1200px; margin: 0 auto; padding: 44px 24px 28px; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.site-footer__brand p { font-size: .88rem; margin: 10px 0 0; max-width: 340px; }
.site-footer__independent { color: #93A8C9; font-size: .8rem !important; }
.site-footer__heading { color: #fff; font-size: .92rem; margin: 4px 0 12px; letter-spacing: 0; }
.site-footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .88rem; }
.site-footer a { color: #C9D6E8; text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { color: #fff; text-decoration: underline; }
.site-footer__bottom { max-width: 1200px; margin: 0 auto; padding: 16px 24px 24px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: #93A8C9; }
.site-footer__bottom p { margin: 0; }

/* Responsive */
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { position: fixed; inset: var(--header-h) 0 auto 0; background: #fff; border-bottom: 1px solid var(--trh-border); box-shadow: 0 12px 24px rgba(16, 35, 63, .12); display: none; padding: 8px 16px 16px; margin: 0; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
  .admin-bar .site-nav { top: calc(var(--header-h) + 46px); }
  .is-site-nav-open .site-nav { display: block; }
  .site-nav__list { flex-direction: column; gap: 0; }
  .site-nav__list a { padding: 14px 8px; border-bottom: 1px solid var(--trh-border); border-radius: 0; font-size: 1rem; }
  .site-nav__list a[aria-current="page"], .site-nav__list .current-menu-item > a { box-shadow: inset 3px 0 0 var(--trh-teal); padding-left: 14px; }
  .site-header__inner { gap: 10px; }
  .grid-2, .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-aside { position: static; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .related__list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) {
  .container, .site-header__inner { padding: 0 16px; }
  .section { padding: 32px 0; }
  .article { padding: 20px 18px; }
  .site-footer__inner { grid-template-columns: 1fr; padding: 32px 16px 20px; }
  .site-footer__bottom { padding: 14px 16px 20px; }
  .notfound__links { columns: 1; }
  .brand { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
