/* ============================================================
   FederalTaxRules.com — Main Stylesheet
   Static Reference Site | Clean Utilitarian Design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* --- Variables --- */
:root {
  --navy: #1a2b4a;
  --navy-mid: #243660;
  --ink: #1e1e2e;
  --body-text: #2d3040;
  --muted: #5a6378;
  --rule-line: #d4d8e2;
  --bg: #f7f8fb;
  --white: #ffffff;
  --accent: #2a6ebb;
  --accent-dark: #1c4f8a;
  --accent-light: #e8f0fb;
  --gold: #b07c2a;
  --gold-light: #faf3e0;
  --success: #1e7a4a;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --max-w: 860px;
  --max-w-wide: 1100px;
  --radius: 4px;
  --shadow-sm: 0 1px 3px rgba(26,43,74,0.08);
  --shadow-md: 0 3px 12px rgba(26,43,74,0.12);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.72;
  color: var(--body-text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--navy);
  line-height: 1.28;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.1rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 600; margin-top: 2.2rem; margin-bottom: 0.7rem; }
h3 { font-size: 1.15rem; font-weight: 600; margin-top: 1.6rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1.1rem; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5rem; margin-bottom: 1.1rem; }
li { margin-bottom: 0.35rem; }

strong { font-weight: 600; color: var(--navy); }
em { font-style: italic; }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: #eef1f7;
  padding: 0.1em 0.35em;
  border-radius: 2px;
  color: var(--navy-mid);
}

hr {
  border: none;
  border-top: 1px solid var(--rule-line);
  margin: 2rem 0;
}

/* --- Layout Wrappers --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-wide {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Site Header --- */
.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 58px;
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo .logo-badge {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.12rem 0.4rem;
  border-radius: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.site-nav a {
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* --- Mobile Nav Toggle --- */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  color: #fff;
  font-size: 1.25rem;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  line-height: 1;
}

/* --- Hero / Page Header --- */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 3.5rem 1.25rem 3rem;
  text-align: center;
  border-bottom: 3px solid var(--accent);
}

.page-hero .hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.page-hero h1 {
  color: #fff;
  font-size: 2.4rem;
  max-width: 680px;
  margin: 0 auto 1rem;
  line-height: 1.2;
}

.page-hero p.hero-sub {
  color: rgba(255,255,255,0.78);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

.page-hero-sm {
  background: var(--navy);
  padding: 2.2rem 1.25rem 2rem;
  border-bottom: 2px solid var(--rule-line);
}

.page-hero-sm h1 {
  color: #fff;
  font-size: 1.85rem;
  margin-bottom: 0.4rem;
}

.page-hero-sm p {
  color: rgba(255,255,255,0.72);
  margin: 0;
  font-size: 0.97rem;
}

/* --- Main Content Area --- */
.main-content {
  padding: 2.8rem 0 3.5rem;
}

/* --- Article Grid (Homepage) --- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.article-card {
  background: var(--white);
  border: 1px solid var(--rule-line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.2rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.18s, border-top-color 0.18s;
  box-shadow: var(--shadow-sm);
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  border-top-color: var(--gold);
  text-decoration: none;
}

.article-card .card-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.article-card h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--navy);
  margin: 0 0 0.5rem;
  font-weight: 600;
  line-height: 1.35;
}

.article-card p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1rem;
  flex: 1;
  line-height: 1.55;
}

.card-link-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
}

/* --- Content Sections --- */
.section {
  margin-bottom: 3rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule-line);
  max-width: 80px;
}

/* --- Info Boxes --- */
.info-box {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  font-size: 0.94rem;
}

.info-box.warning {
  background: var(--gold-light);
  border-left-color: var(--gold);
}

.info-box p { margin: 0; }
.info-box strong { color: var(--navy); }

/* --- Example Scenarios --- */
.example-block {
  background: #f0f4fa;
  border: 1px solid #c9d4e8;
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  margin: 1.8rem 0;
}

.example-block .example-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.example-block p { font-size: 0.95rem; margin-bottom: 0.6rem; }
.example-block p:last-child { margin-bottom: 0; }

/* --- Reference Table --- */
.ref-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--rule-line);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--white);
}

thead th {
  background: var(--navy);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  text-align: left;
}

tbody tr:nth-child(even) { background: #f5f7fb; }
tbody tr:hover { background: var(--accent-light); }

td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--rule-line);
  color: var(--body-text);
  font-family: var(--font-mono);
  font-size: 0.87rem;
}

td:first-child {
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

/* --- Calculator CTA Links --- */
.calc-links {
  background: var(--white);
  border: 1px solid var(--rule-line);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  margin: 2rem 0;
}

.calc-links .calc-links-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.calc-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.calc-links ul li { margin: 0; }

.calc-links ul li a {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid #c0d4ee;
  transition: background 0.15s, color 0.15s;
}

.calc-links ul li a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* --- FAQ List --- */
.faq-list { list-style: none; padding: 0; margin: 0; }

.faq-list .faq-item {
  border-bottom: 1px solid var(--rule-line);
  padding: 1.4rem 0;
}

.faq-list .faq-item:first-child { padding-top: 0; }
.faq-list .faq-item:last-child { border-bottom: none; }

.faq-list .faq-q {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.faq-list .faq-a {
  font-size: 0.95rem;
  color: var(--body-text);
  line-height: 1.65;
}

/* --- Trust Strip --- */
.trust-strip {
  background: var(--navy);
  padding: 1.4rem 1.25rem;
  text-align: center;
  color: rgba(255,255,255,0.72);
  font-size: 0.87rem;
  border-top: 2px solid var(--accent);
}

.trust-strip strong { color: rgba(255,255,255,0.92); }

/* --- Disclaimer Bar --- */
.disclaimer-bar {
  background: var(--gold-light);
  border-top: 2px solid var(--gold);
  border-bottom: 1px solid #e8d8a8;
  padding: 0.85rem 1.25rem;
  font-size: 0.85rem;
  color: #5a430a;
  text-align: center;
}

/* --- Page Nav (breadcrumb style) --- */
.breadcrumb {
  font-size: 0.83rem;
  color: var(--muted);
  padding: 0.75rem 0 0;
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--body-text); }

/* --- Article Prose Styles --- */
.article-prose h2 {
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule-line);
  margin-top: 2.4rem;
}

.article-prose h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }

/* --- Sidebar Layout (article pages) --- */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2.5rem;
  align-items: start;
}

.sidebar-box {
  background: var(--white);
  border: 1px solid var(--rule-line);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
  padding: 1.3rem;
  font-size: 0.9rem;
  position: sticky;
  top: 78px;
}

.sidebar-box h4 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.sidebar-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-box ul li {
  border-bottom: 1px solid var(--rule-line);
  padding: 0.4rem 0;
  margin: 0;
}

.sidebar-box ul li:last-child { border-bottom: none; }
.sidebar-box ul li a { font-size: 0.87rem; color: var(--accent); }

/* --- Footer --- */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.65);
  font-size: 0.87rem;
  padding: 2.8rem 1.25rem 1.5rem;
  margin-top: 0;
}

.footer-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.9rem;
  font-weight: 500;
}

.footer-col p {
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li { margin-bottom: 0.35rem; }

.footer-col ul li a {
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  font-size: 0.87rem;
  transition: color 0.15s;
}

.footer-col ul li a:hover { color: rgba(255,255,255,0.9); }

.footer-related-tools { margin-top: 0.3rem; }

#footer-related-tools-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#footer-related-tools-list li { margin-bottom: 0.35rem; }

#footer-related-tools-list li a {
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  font-size: 0.87rem;
  transition: color 0.15s;
}

#footer-related-tools-list li a:hover { color: rgba(255,255,255,0.9); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.38);
}

.footer-bottom a {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
}

.footer-bottom a:hover { color: rgba(255,255,255,0.75); }

.footer-resource-link {
  color: rgba(255,255,255,0.5);
  font-size: 0.83rem;
  margin-top: 0.4rem;
  display: block;
}

.footer-resource-link a {
  color: rgba(255,255,255,0.6);
  text-decoration: underline;
}

/* --- Homepage specific --- */
.home-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.home-block {
  background: var(--white);
  border: 1px solid var(--rule-line);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.home-block h3 {
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.home-block p { font-size: 0.92rem; }

/* --- Responsive --- */
@media (max-width: 820px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar-box { position: static; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .home-intro-grid {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 1.7rem; }
  .page-hero h1 { font-size: 1.85rem; }
}

@media (max-width: 560px) {
  .site-nav { display: none; }
  .nav-toggle { display: block; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 1rem 1.25rem;
    z-index: 99;
    border-bottom: 2px solid var(--accent);
  }
  .site-nav.open a {
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 1.5rem; }
  .page-hero h1 { font-size: 1.55rem; }
}
