/* =========================================================================
   TBG CUSTOM THEME — MAIN STYLESHEET
   Organized per spec: Reset, Variables, Typography, Global Layout, Buttons,
   Header, Navigation, Hero, Cards, Forms, Page Sections, News, Resources,
   Footer, Utilities. Responsive rules live in responsive.css.
   ========================================================================= */

/* ---------- 1. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; }

/* ---------- 2. VARIABLES ---------- */
:root {
  --tbg-navy: #0f2741;
  --tbg-blue: #214f78;
  --tbg-green: #557a46;
  --tbg-charcoal: #333333;
  --tbg-light: #f5f6f4;
  --tbg-white: #ffffff;
  --tbg-border: #dfe3e6;

  --font-heading: 'Libre Baskerville', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container-width: 1200px;
  --container-padding: 24px;
  --radius: 3px;
  --space-sm: 0.75rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
}

/* ---------- 3. TYPOGRAPHY ---------- */
body {
  font-family: var(--font-body);
  color: var(--tbg-charcoal);
  background: var(--tbg-white);
  line-height: 1.6;
  font-size: 16px;
}
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--tbg-navy);
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 0.5em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 0.5em; }
h3 { font-size: 1.3rem; margin-bottom: 0.4em; }
p { margin-bottom: 1.1em; max-width: 68ch; }
a { color: var(--tbg-blue); }
a:hover { text-decoration: underline; }

/* ---------- 4. GLOBAL LAYOUT ---------- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}
section { padding: var(--space-xl) 0; }
.section-tight { padding: var(--space-lg) 0; }
.bg-light { background: var(--tbg-light); }
.bg-navy { background: var(--tbg-navy); color: #dbe4ee; }
.bg-navy h1, .bg-navy h2, .bg-navy h3 { color: #fff; }
.bg-navy a { color: #9cc6e8; }
.text-center { text-align: center; }
.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); align-items: center; }
.split.reverse .split-media { order: -1; }
.section-head { max-width: 62ch; margin-bottom: var(--space-md); }
.eyebrow { font-size: 0.8rem; letter-spacing: 0.03em; color: var(--tbg-green); font-weight: 600; margin-bottom: 0.6rem; }
.bg-navy .eyebrow { color: #9cc6e8; }
:focus-visible { outline: 3px solid var(--tbg-green); outline-offset: 2px; }

/* ---------- 5. BUTTONS ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75em 1.6em;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--tbg-green); color: #fff; }
.btn-primary:hover { background: #46653a; }
.btn-secondary { background: transparent; color: var(--tbg-navy); border-color: var(--tbg-navy); }
.btn-secondary:hover { background: var(--tbg-navy); color: #fff; }
.bg-navy .btn-secondary { color: #fff; border-color: #fff; }
.bg-navy .btn-secondary:hover { background: #fff; color: var(--tbg-navy); }
.btn-link { color: var(--tbg-blue); font-weight: 600; }
.btn-row { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-top: 1.25rem; }

/* ---------- 6. HEADER ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--tbg-navy); color: #fff;
  padding: 0.75rem 1.25rem; z-index: 1000;
}
.skip-link:focus { left: 0; }
.utility-bar { background: var(--tbg-navy); color: #cfd9e4; font-size: 0.85rem; }
.utility-bar .container { display: flex; justify-content: flex-end; gap: 1.5rem; padding: 0.4rem var(--container-padding); }
.utility-bar a { color: #cfd9e4; }
.site-header { border-bottom: 1px solid var(--tbg-border); position: sticky; top: 0; background: #fff; z-index: 100; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem var(--container-padding); }
.site-logo { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-heading); font-size: 1.3rem; color: var(--tbg-navy); font-weight: 700; }
.site-logo img { height: 42px; width: auto; }

/* ---------- 7. NAVIGATION ----------
   Uses WordPress's native wp_nav_menu() output classes:
   .primary-menu (top-level <ul>), .menu-item-has-children (parent <li>),
   .sub-menu (WP's default class for nested <ul>). */
.primary-nav { display: flex; align-items: center; gap: 1.75rem; }
.primary-menu { display: flex; align-items: center; gap: 1.75rem; }
.primary-menu li { position: relative; }
.primary-menu a { color: var(--tbg-navy); font-weight: 600; font-size: 0.95rem; }
.primary-menu a:hover { color: var(--tbg-blue); text-decoration: none; }
.menu-item-has-children > a::after { content: ''; display: inline-block; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-left: 6px; }
.sub-menu {
  position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--tbg-border);
  min-width: 240px; box-shadow: 0 8px 20px rgba(15,39,65,0.08); display: none; padding: 0.5rem 0;
}
.menu-item-has-children:hover > .sub-menu,
.menu-item-has-children:focus-within > .sub-menu { display: block; }
.sub-menu li a { display: block; padding: 0.5rem 1.1rem; font-weight: 500; }
.sub-menu li a:hover { background: var(--tbg-light); text-decoration: none; }
.menu-toggle { display: none; background: none; border: none; padding: 0.4rem; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--tbg-navy); margin: 5px 0; }

/* ---------- 8. HERO ---------- */
.hero { background: var(--tbg-navy); color: #dbe4ee; padding: var(--space-xl) 0; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-lg); align-items: center; }
.hero h1 { color: #fff; }
.hero-sub { font-size: 1.15rem; color: #c3d2e0; max-width: 46ch; }
.hero-media img, .hero-media .media-placeholder { border-radius: var(--radius); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.page-hero { background: var(--tbg-light); padding: var(--space-lg) 0; border-bottom: 1px solid var(--tbg-border); }

/* ---------- 9. CARDS ---------- */
.card { border: 1px solid var(--tbg-border); border-top: 3px solid var(--tbg-green); padding: 1.75rem; background: #fff; }
.card h3 { margin-bottom: 0.5rem; }
.card p:last-child { margin-bottom: 0; }
.testimonial { border: 1px solid var(--tbg-border); padding: 1.75rem; background: #fff; }
.testimonial p { font-style: italic; }
.testimonial cite { font-style: normal; font-weight: 600; color: var(--tbg-navy); display: block; margin-top: 0.75rem; }
.steps { display: grid; gap: var(--space-md); grid-template-columns: repeat(5, 1fr); }
.steps li { border-left: 3px solid var(--tbg-green); padding-left: 1rem; }
.step-num { font-family: var(--font-heading); font-size: 1.4rem; color: var(--tbg-green); display: block; }
.callout { border: 1px solid var(--tbg-border); border-left: 4px solid var(--tbg-navy); background: var(--tbg-light); padding: 1.25rem 1.5rem; margin: var(--space-md) 0; }
.callout strong { color: var(--tbg-navy); }

/* ---------- 10. FORMS ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md) 1.25rem; }
.form-field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.form-field.full-width { grid-column: 1 / -1; }
.form-field label { font-weight: 600; font-size: 0.9rem; color: var(--tbg-navy); }
.required-mark { color: #b5352c; }
.form-field input, .form-field select, .form-field textarea {
  font-family: var(--font-body); font-size: 1rem; padding: 0.65em 0.8em;
  border: 1px solid var(--tbg-border); border-radius: var(--radius); background: #fff; color: var(--tbg-charcoal);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--tbg-blue); }
.form-field textarea { min-height: 120px; resize: vertical; }
.form-checkbox { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.92rem; margin-bottom: 1rem; }
.form-checkbox input { margin-top: 0.25rem; }
.form-error { color: #b5352c; font-size: 0.85rem; display: block; }
.form-note { background: var(--tbg-light); border: 1px solid var(--tbg-border); padding: 1rem 1.25rem; font-size: 0.92rem; margin-bottom: var(--space-md); }
.form-status { padding: 0.85rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: 0.95rem; }
.form-status.success { background: #eaf3e8; color: #2f5c28; border: 1px solid #bcd9b7; }
.form-status.error { background: #fbeceb; color: #8c2a22; border: 1px solid #f0c2bd; }
.honeypot-field { position: absolute; left: -9999px; }

/* ---------- 11. PAGE SECTIONS ---------- */
.final-cta { background: var(--tbg-navy) url('') center/cover; }
.article-body { max-width: 72ch; margin: 0 auto; }
.article-body img { border-radius: var(--radius); margin: var(--space-md) 0; }
.article-meta { color: #6b7280; font-size: 0.9rem; margin-bottom: var(--space-md); }

/* ---------- 12. NEWS ---------- */
.news-card { border: 1px solid var(--tbg-border); background: #fff; }
.news-card img, .news-card .media-placeholder { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.news-card .news-body { padding: 1.25rem; }
.news-meta { font-size: 0.82rem; color: #6b7280; margin-bottom: 0.4rem; }
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin-top: var(--space-lg); }
.pagination a, .pagination span { padding: 0.5em 0.9em; border: 1px solid var(--tbg-border); border-radius: var(--radius); }
.pagination .current { background: var(--tbg-navy); color: #fff; }

/* ---------- 13. RESOURCES ---------- */
.resource-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border: 1px solid var(--tbg-border); background: #fff; }
.resource-item + .resource-item { margin-top: 0.75rem; }
.resource-external-tag { font-size: 0.75rem; color: var(--tbg-green); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }

/* ---------- 14. FOOTER ---------- */
.site-footer { background: var(--tbg-navy); color: #b9c6d3; padding: var(--space-lg) 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: var(--space-lg); padding-bottom: var(--space-lg); border-bottom: 1px solid rgba(255,255,255,0.12); }
.footer-grid h4 { color: #fff; font-family: var(--font-body); font-size: 0.85rem; margin-bottom: 0.9rem; }
.footer-grid ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-grid a { color: #b9c6d3; }
.footer-grid a:hover { color: #fff; }
.footer-brand p { color: #b9c6d3; max-width: 34ch; }
.footer-newsletter { padding: var(--space-md) 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
.newsletter-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; }
.newsletter-form { display: flex; gap: 0.6rem; }
.newsletter-form input { padding: 0.6em 0.9em; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.05); color: #fff; min-width: 240px; }
.newsletter-form input::placeholder { color: #9fb0c0; }
.footer-bottom { padding: 1.25rem 0; font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.footer-bottom a { color: #b9c6d3; }
.footer-bottom ul { display: flex; gap: 1.25rem; }

/* ---------- 15. UTILITIES ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.media-placeholder {
  background: repeating-linear-gradient(45deg, #eef0ee, #eef0ee 10px, #e4e7e3 10px, #e4e7e3 20px);
  border: 1px dashed var(--tbg-border);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: #6b7280; font-size: 0.8rem; padding: 1rem; min-height: 160px; border-radius: var(--radius);
}
.center-page { min-height: 40vh; display: flex; align-items: center; }
.center-page .container { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
