/* =========================================================================
   TAXBADI.COM — shared site chrome (header, footer, ad slots, section-nav)
   Load this ONE file from every page's <head> so every folder matches.
   ========================================================================= */

/* ---- Design tokens --------------------------------------------------- */
:root{
  --color-ink:        #142B45;  /* primary navy — header, headings, buttons */
  --color-ink-2:      #1D3A5C;  /* hover shade of ink */
  --color-steel:      #3E6E92;  /* links, secondary accents */
  --color-brass:      #B07D2B;  /* accent gold — active states, one signature detail */
  --color-brass-tint: #F3E4C7;  /* light brass wash for badges */
  --color-paper:      #F5F7FA;  /* page background */
  --color-surface:    #FFFFFF;  /* header/card background */
  --color-border:     #E2E6EC;
  --color-brass-dark: #8F631F;  /* hover shade of brass */
  --color-text:       #1C2530;
  --color-text-muted: #5B6675;
  --color-success:      #1E7A4C; /* "Live" badge */
  --color-success-tint: #E4F2EA;

  --font-sans:  'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  --radius-sm: 6px;
  --radius-md: 10px;

  --shadow-soft: 0 1px 2px rgba(20,43,69,.06), 0 4px 14px rgba(20,43,69,.06);
  --shadow-lift: 0 10px 24px rgba(176,125,43,.16), 0 2px 6px rgba(20,43,69,.10);

  --header-height: 68px;
  --content-width: 1120px;   /* comfortable line length for Act text */
  --wide-width: 1120px;     /* header/footer inner width */
  --header-bg: var(--color-ink); /* dark navy header bar — official look */
  --gutter: 20px;                /* shared side padding — see mobile override below */
}

@media (prefers-color-scheme: dark){
  /* Explicitly opted out of dark mode for this brief — force light regardless
     of the visitor's OS setting, so the "clean govt" look stays consistent. */
  :root{ color-scheme: light; }
}

/* ---- Reset / base ------------------------------------------------------ */
*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; }
body{
  margin: 0;
  background: var(--color-paper);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
a{ color: var(--color-steel); text-decoration: none; }
a:hover{ color: var(--color-ink); }

.sr-only{
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link{
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--color-ink); color: #fff; padding: .6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus{ left: 0; }

:focus-visible{ outline: 2px solid var(--color-brass); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---- Header -------------------------------------------------------- */
.site-header{
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255,255,255,.08);
  transition: box-shadow .2s ease;
}
.site-header.is-scrolled{ box-shadow: var(--shadow-soft); }

.site-header__inner{
  max-width: var(--wide-width);
  margin: 0 auto;
  height: var(--header-height);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand{
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.brand__logo{ height: 50px; width: auto; }
.brand__name{
  font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; color: #fff;
}
.brand__dot{ font-weight: 500; color: rgba(255,255,255,.6); }

.site-nav{ flex: 1; min-width: 0; }
.site-nav ul{
  list-style: none; display: flex; gap: 4px; margin: 0; padding: 0;
}
.site-nav a{
  display: inline-flex; align-items: center; height: 40px;
  padding: 0 14px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.82); font-weight: 500; font-size: .95rem;
  position: relative;
}
.site-nav a:hover{ background: rgba(255,255,255,.10); color: #fff; }
.site-nav a.is-active{ color: #fff; }
.site-nav a.is-active::after{
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; background: var(--color-brass); border-radius: 2px;
}

.site-search{
  display: flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius-md); padding: 6px 6px 6px 12px;
  flex-shrink: 0; width: 220px;
}
.site-search input{
  border: 0; background: transparent; outline: 0; font: inherit;
  color: var(--color-text); width: 100%;
}
.site-search input::placeholder{ color: var(--color-text-muted); }
.site-search button{
  border: 0; background: var(--color-brass); color: #fff; width: 30px; height: 30px;
  border-radius: 8px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.site-search button:hover{ background: var(--color-brass-dark); }
.site-search svg{ width: 15px; height: 15px; }

.nav-toggle{
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer;
  border-radius: var(--radius-sm); flex-shrink: 0; margin-left: auto;
}
.nav-toggle span{ height: 2px; background: #fff; border-radius: 2px; }
.nav-toggle:hover{ background: rgba(255,255,255,.10); }

/* ---- Ad slots ------------------------------------------------------ */
.ad-slot{
  max-width: var(--wide-width); margin: 0 auto; padding: 10px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.ad-slot__label{
  font-size: .72rem; color: var(--color-text-muted);
}
.ad-slot__box{
  width: 100%; min-height: 90px;
  display: grid; place-items: center;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted); font-size: .85rem;
}
.ad-slot--inline{ padding: 0; max-width: 320px; }
.ad-slot--inline .ad-slot__box{ min-height: 100px; }

/* ---- Main content wrapper ------------------------------------------ */
.site-main{ display: block; }
.page{
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 28px 9px 8px;
}
.page--wide{ max-width: var(--wide-width); }

.breadcrumb{
  font-size: .85rem; color: var(--color-text-muted); margin: 0 0 18px;
}
.breadcrumb a{ color: var(--color-text-muted); }
.breadcrumb a:hover{ color: var(--color-ink); }
.breadcrumb .sep{ margin: 0 6px; color: var(--color-border); }

/* ---- Content card — the shared white panel every page's body sits in ---- */
.content-card{
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-soft);
  padding: 28px 32px;
}
.content-card + .content-card{ margin-top: 20px; }
.content-card h1{
  font-family: var(--font-sans); color: var(--color-ink);
  font-size: 1.5rem; line-height: 1.3; margin: 0 0 8px;
}
.content-card h2{
  font-family: var(--font-sans); font-size: .95rem; color: var(--color-ink);
  margin: 0 0 14px; font-weight: 600;
}
.meta-line{ font-size: .85rem; color: var(--color-text-muted); margin: 0 0 20px; }
.muted{ color: var(--color-text-muted); font-size: .9rem; }

.section-tag{
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding: 0 12px;
  background: var(--color-ink); color: #fff;
  border-radius: 50px; font-family: var(--font-sans); font-weight: 700; font-size: .95rem;
  margin-bottom: 14px;
}

/* Serif treatment only for the actual Act text passage, not listing pages */
.act-section{ font-family: var(--font-serif); }
.act-section p{ font-size: 1.05rem; color: var(--color-text); margin: 0 0 1.1em; }
.act-section .content h3, .act-section .content h4{
  font-family: var(--font-sans); color: var(--color-ink); margin: 1.4em 0 .6em;
}
.act-section .content ul, .act-section .content ol{ margin: 0 0 1.1em; padding-left: 1.4em; }
.act-section .content li{ margin-bottom: .4em; }
.xref{ color: var(--color-steel); text-decoration: underline; text-decoration-color: var(--color-border); text-underline-offset: 2px; }
.xref:hover{ color: var(--color-ink); text-decoration-color: var(--color-brass); }

/* "In plain terms" callout */
.plain-summary{
  background: var(--color-brass-tint); border-left: 3px solid var(--color-brass);
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 24px;
  font-family: var(--font-sans); font-size: .95rem; color: var(--color-text);
}
.plain-summary b{ color: var(--color-ink); }

/* Amendment history footnotes */
.amendments{ margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--color-border); }
.amendments h4{ font-family: var(--font-sans); font-size: .85rem; color: var(--color-text); margin: 0 0 10px; }
.amendments ul{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.amendments li{ font-size: .85rem; color: var(--color-text-muted); font-family: var(--font-sans); }
.amendments li b{ color: var(--color-ink); }

/* Calculator cross-link CTA */
.calc-link-box{
  margin: 20px 0 0; padding: 16px 20px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-steel); border-radius: var(--radius-sm);
  font-size: .95rem; color: var(--color-text);
}
.calc-link-box a{ font-weight: 600; margin-left: 6px; }

/* Section/chapter listings (chapter.php, index.php, search.php results) */
.section-list, .chapter-list{ list-style: none; margin: 0; padding: 0; }
.section-list li, .chapter-list li{
  padding: 12px 0; border-bottom: 1px solid var(--color-border); font-size: .95rem;
}
.section-list li:last-child, .chapter-list li:last-child{ border-bottom: 0; }
.section-list .num, .chapter-list .count{ color: var(--color-text-muted); font-size: .85rem; }
.section-list a, .chapter-list a{ color: var(--color-ink); font-weight: 500; }
.section-list a:hover, .chapter-list a:hover{ color: var(--color-steel); }

/* Search box (search.php + index.php hero) */
.search-box{ display: flex; gap: 8px; margin: 4px 0 0; }
.search-box input{
  flex: 1; padding: 12px 14px; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); font: inherit; color: var(--color-text);
  background: var(--color-paper);
}
.search-box input:focus{ outline: 2px solid var(--color-brass); outline-offset: 1px; border-color: transparent; }
.search-box button{
  padding: 0 22px; border: 0; border-radius: var(--radius-sm);
  background: var(--color-ink); color: #fff; font-weight: 600; cursor: pointer;
}
.search-box button:hover{ background: var(--color-ink-2); }

/* ---- Section prev/next nav ------------------------------------------ */
.section-nav{
  max-width: var(--content-width); margin: 24px auto 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch;
}
.section-nav__link{
  display: flex; align-items: center; gap: 12px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 14px 16px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  min-width: 0;
}
.section-nav__link:hover{
  box-shadow: var(--shadow-lift); border-color: var(--color-brass); transform: translateY(-1px);
}
.section-nav__link--next{ justify-content: flex-end; text-align: right; }
.section-nav__arrow{
  display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 50%; background: var(--color-brass-tint); color: var(--color-brass);
  font-weight: 700;
}
.section-nav__text{ min-width: 0; }
.section-nav__eyebrow{ display: block; font-size: .78rem; color: var(--color-text-muted); }
.section-nav__title{
  display: block; font-weight: 600; color: var(--color-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.section-nav__link--disabled{ visibility: hidden; }

/* ---- Homepage hero --------------------------------------------------- */
.hero{
  background:
    radial-gradient(circle, rgba(255,255,255,.07) 1px, transparent 1.6px),
    linear-gradient(135deg, var(--color-ink) 0%, #1C4970 55%, var(--color-steel) 100%);
  background-size: 22px 22px, auto;
  color: #fff;
}
.hero__inner{
  max-width: var(--wide-width); margin: 0 auto;
  padding: 52px var(--gutter) 44px;
}
.hero h1{
  font-family: var(--font-sans); font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  line-height: 1.25; margin: 0 0 14px; max-width: 640px;
}
.hero p{
  font-size: 1.02rem; color: rgba(255,255,255,.86);
  max-width: 600px; margin: 0 0 28px;
}
.hero__stats{ display: flex; flex-wrap: wrap; gap: 32px; }
.hero__stat b{ display: block; font-size: 1.4rem; font-weight: 700; }
.hero__stat span{ font-size: .8rem; color: rgba(255,255,255,.68); }

/* ---- Homepage feature grid — all 5 cards equal size --------------------- */
.feature-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }

.feature-card{
  background: linear-gradient(155deg, #EAF3FA 0%, #FFFFFF 62%); /* light steel wash — "live" */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-soft);
  padding: 26px 28px; display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
a.feature-card{ color: inherit; }
.feature-card:hover{ box-shadow: var(--shadow-lift); border-color: var(--color-brass); transform: translateY(-2px); }
.feature-card.is-soon{
  background: linear-gradient(155deg, #FBF2E2 0%, #FFFFFF 62%); /* light brass wash — "coming soon" */
  opacity: .88; cursor: default;
}
.feature-card.is-soon:hover{ box-shadow: var(--shadow-soft); transform: none; border-color: var(--color-border); }

.feature-card__badge{
  align-self: flex-start; padding: 3px 10px; border-radius: 50px;
  font-size: .72rem; font-weight: 600;
}
.feature-card__badge--live{ background: var(--color-success-tint); color: var(--color-success); }
.feature-card__badge--soon{ background: rgba(255,255,255,.7); color: var(--color-text-muted); border: 1px solid var(--color-border); }

.feature-card h3{ font-family: var(--font-sans); font-size: 1.15rem; color: var(--color-ink); margin: 0; }
.feature-card p{ font-size: .92rem; color: var(--color-text-muted); margin: 0; flex: 1; }
.feature-card__cta{ font-size: .88rem; font-weight: 600; color: var(--color-steel); }
.feature-card:hover .feature-card__cta{ color: var(--color-brass); }
.feature-card.is-soon .feature-card__cta{ color: var(--color-text-muted); }

/* ---- "Latest changes" digest ------------------------------------------- */
.changes-list{ display: flex; flex-direction: column; }
.changes-item{ display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.changes-item:last-child{ border-bottom: 0; padding-bottom: 4px; }
.changes-item:first-child{ padding-top: 0; }
.changes-item__date{
  flex-shrink: 0; width: 92px; font-size: .78rem; font-weight: 600;
  color: var(--color-text-muted); padding-top: 2px;
}
.changes-item__body h4{ margin: 0 0 4px; font-size: .98rem; color: var(--color-ink); }
.changes-item__body p{ margin: 0; font-size: .9rem; color: var(--color-text-muted); }
.changes-item__body a{ font-size: .85rem; font-weight: 600; }

/* ---- Footer ---------------------------------------------------------- */
.site-footer{ margin-top: 56px; border-top: 1px solid var(--color-border); background: var(--color-surface); }
.site-footer__inner{
  max-width: var(--wide-width); margin: 0 auto; padding: 32px var(--gutter);
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px;
}
.site-footer__brand{ display: flex; flex-direction: column; gap: 12px; }
.site-footer__logo{ height: 30px; width: auto; }
.site-footer__brand p{ color: var(--color-text-muted); font-size: .9rem; margin: 0; }
.site-footer__col h3{
  font-size: .85rem; color: var(--color-text); margin: 0 0 12px;
}
.site-footer__col ul{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer__col a{ font-size: .9rem; color: var(--color-text-muted); }
.site-footer__col a:hover{ color: var(--color-ink); }
.site-footer__bottom{
  border-top: 1px solid var(--color-border);
  padding: 14px var(--gutter); text-align: center;
}
.site-footer__bottom p{ margin: 0; font-size: .82rem; color: var(--color-text-muted); }

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 880px){
  :root{ --gutter: 24px; } /* a touch more breathing room on phones than on desktop */

  .site-search{ display: none; }
  .site-nav{ display: none; }
  .nav-toggle{ display: flex; }

  .site-header.nav-open .site-nav{
    display: block; position: absolute; left: 0; right: 0; top: var(--header-height);
    background: var(--color-surface); border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
  }
  .site-header.nav-open .site-nav ul{ flex-direction: column; padding: 8px; gap: 2px; }
  .site-header.nav-open .site-nav a{
    height: 44px; width: 100%;
    color: var(--color-text); /* dark text — this panel is a light dropdown off the dark bar */
  }
  .site-header.nav-open .site-nav a:hover{ background: var(--color-paper); color: var(--color-ink); }
  .site-header.nav-open .site-nav a.is-active{ color: var(--color-ink); }

  .section-nav{ grid-template-columns: 1fr; }
  .section-nav__link--next{ justify-content: flex-start; text-align: left; }
  .ad-slot--inline{ max-width: none; margin: 4px auto; }

  .feature-grid{ grid-template-columns: 1fr 1fr; }
  .hero__inner{ padding: 36px var(--gutter) 32px; }
  .hero__stats{ gap: 22px; }

  .site-footer__inner{ grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px){
  .site-footer__inner{ grid-template-columns: 1fr; }
  .content-card h1{ font-size: 1.35rem; }
  .content-card{ padding: 22px 20px; }
  .feature-grid{ grid-template-columns: 1fr; }
}