/* TennesseeAnytime.org — site styles
   Palette taken from the Tennessee flag: field blue, flag red, white. */
:root {
  --navy: #14305e;
  --navy-deep: #0d2246;
  --red: #b5162b;
  --paper: #f4f6f9;
  --white: #ffffff;
  --ink: #1a2131;
  --muted: #566176;
  --line: #d5dce6;
  --sky: #e8eef7;

  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1140px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.65 var(--serif);
}
img { max-width: 100%; height: auto; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--white); padding: 8px 14px; font-family: var(--sans);
}
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--navy);
  color: var(--white);
  border-bottom: 5px solid var(--red);
  position: relative;
  z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 76px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--white); text-decoration: none;
  font-family: var(--serif); font-size: 1.3rem; line-height: 1.1; font-weight: 700;
}
.brand:hover { color: var(--white); }
.brand svg { flex: none; width: 44px; height: 44px; }
.brand-name small {
  display: block; font: 400 0.8rem/1.3 var(--sans);
  color: #c7d3e8; letter-spacing: 0.01em;
}

.nav-toggle {
  display: none;
  background: transparent; color: var(--white);
  border: 1px solid rgba(255,255,255,.45); border-radius: 4px;
  font: 600 0.95rem var(--sans); padding: 8px 14px; cursor: pointer;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.site-nav a {
  display: block; padding: 10px 12px;
  color: var(--white); text-decoration: none;
  font: 500 0.95rem/1.2 var(--sans);
  border-radius: 3px;
}
.site-nav a:hover { background: rgba(255,255,255,.12); color: var(--white); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--white); }

/* ---------- People-search box ---------- */
.search-band { background: var(--sky); border-bottom: 1px solid var(--line); }
.search-band .wrap { padding-top: 20px; padding-bottom: 20px; }

.ps {
  background: var(--white); color: var(--ink);
  border-top: 4px solid var(--red); border-radius: 6px;
  box-shadow: 0 1px 2px rgba(20, 48, 94, .08), 0 8px 24px rgba(20, 48, 94, .10);
  padding: 20px 22px 22px; font-family: var(--sans);
}
.ps-title { font: 700 1.3rem/1.25 var(--serif); margin: 0 0 4px; color: var(--ink); }
.ps-sub { margin: 0 0 14px; font-size: 0.95rem; line-height: 1.45; color: var(--muted); }
.ps-title + .ps-form { margin-top: 12px; }
.ps-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.ps-field label { display: block; margin: 0 0 5px; font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.ps-opt { font-weight: 400; color: var(--muted); }
.ps-field input, .ps-field select {
  display: block; width: 100%; height: 48px; margin: 0;
  padding: 0 12px; font: 17px/1.2 var(--sans); color: var(--ink);
  background: var(--white); border: 1px solid #98a4b6; border-radius: 4px;
}
.ps-field select { padding-right: 8px; }
.ps-field input:focus, .ps-field select:focus { border-color: var(--navy); outline: 3px solid rgba(20, 48, 94, .25); outline-offset: 0; }
.ps-field input:user-invalid { border-color: var(--red); }
.ps-btn {
  grid-column: 1 / -1; height: 52px; margin-top: 2px;
  background: var(--red); color: var(--white); border: 0; border-radius: 4px;
  font: 700 1.1rem/1 var(--sans); letter-spacing: 0.01em; cursor: pointer;
}
.ps-btn:hover { background: #951224; }
.ps-btn:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* Home hero: 2 x 2 fields, full-width button */
.ps-hero { max-width: 640px; }

/* Top of inner pages: one row on wide screens */
@media (min-width: 961px) {
  .ps-band .ps-form { grid-template-columns: 1fr 1fr 1fr 190px auto; align-items: end; }
  .ps-band .ps-btn { grid-column: auto; padding: 0 26px; height: 48px; margin-top: 0; }
}

/* End of articles (override the article's own h2/p spacing) */
.ps-end { margin: 2.2em 0 0; max-width: 640px; }
.article .ps-title { margin: 0 0 4px; color: var(--ink); font-size: 1.3rem; }
.article .ps-sub { margin: 0 0 14px; }

@media (max-width: 359px) {
  .ps-form { grid-template-columns: 1fr; }
}

/* ---------- Home hero ---------- */
.hero {
  background: var(--navy-deep);
  color: var(--white);
  padding: clamp(36px, 7vw, 72px) 0 clamp(40px, 7vw, 64px);
  position: relative; overflow: hidden;
}
.hero::after {
  /* Tri-star roundel, oversized and cropped at the right edge */
  content: ""; position: absolute; right: -120px; top: 50%;
  width: 420px; height: 420px; transform: translateY(-50%);
  background: url("../img/tristar.svg") no-repeat center / contain;
  opacity: .14; pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 {
  font: 700 clamp(2.1rem, 5.2vw, 3.6rem)/1.05 var(--serif);
  margin: 0 0 14px; max-width: 16ch; letter-spacing: -0.01em;
}
.hero .wrap > p { font-size: 1.15rem; max-width: 52ch; margin: 0 0 28px; color: #d6e0f0; }

/* ---------- Directory (home) ---------- */
.directory { padding: clamp(36px, 6vw, 60px) 0 10px; }
.directory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; }
.directory h2 {
  font: 700 1.55rem/1.2 var(--serif); margin: 0 0 6px;
  padding-bottom: 10px; border-bottom: 3px solid var(--navy);
}
.dir-list { list-style: none; margin: 0 0 32px; padding: 0; }
.dir-list li { border-bottom: 1px solid var(--line); }
.dir-list a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 16px;
  padding: 14px 2px; text-decoration: none; color: var(--ink);
}
.dir-list a:hover .dir-title { color: var(--red); }
.dir-title { font-weight: 700; font-size: 1.12rem; color: var(--navy); }
.dir-desc { grid-column: 1; font: 0.92rem/1.45 var(--sans); color: var(--muted); }
.dir-list a::after {
  content: ""; grid-column: 2; grid-row: 1 / span 2; align-self: center;
  width: 9px; height: 9px; border-top: 2px solid var(--red); border-right: 2px solid var(--red);
  transform: rotate(45deg);
}

.latest { padding: 10px 0 56px; }
.latest h2 {
  font: 700 1.55rem/1.2 var(--serif); margin: 0 0 18px;
  padding-bottom: 10px; border-bottom: 3px solid var(--navy);
}
.latest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.teaser img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; margin-bottom: 14px; border-radius: 2px; }
.teaser h3 { font: 700 1.2rem/1.3 var(--serif); margin: 0 0 8px; }
.teaser h3 a { text-decoration: none; }
.teaser p { margin: 0; font-size: 1rem; color: var(--muted); }

/* ---------- Inner pages ---------- */
.page-head { background: var(--white); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-top: 26px; padding-bottom: 26px; }
.breadcrumb { font: 0.88rem/1.4 var(--sans); color: var(--muted); margin: 0 0 10px; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.breadcrumb li + li::before { content: "/"; margin: 0 8px; color: #a3adbd; }
.breadcrumb a { color: var(--muted); }
.page-head h1 {
  font: 700 clamp(1.85rem, 4vw, 2.6rem)/1.15 var(--serif);
  margin: 0; max-width: 28ch; letter-spacing: -0.005em;
}

.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px; padding-top: 36px; padding-bottom: 56px;
}

.article { max-width: 68ch; }
.article > :first-child { margin-top: 0; }
.article p { margin: 0 0 1.1em; }
.article h2 {
  font: 700 1.45rem/1.25 var(--serif); color: var(--navy);
  margin: 1.8em 0 0.5em;
}
.article ul, .article ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.article li { margin-bottom: 0.35em; }
.article li::marker { color: var(--red); }
.article img { border-radius: 2px; }
.article .img-right { float: right; margin: 6px 0 14px 24px; max-width: 45%; }
.article .img-left { float: left; margin: 6px 24px 14px 0; max-width: 45%; }
.article .img-block { display: block; margin: 14px 0 6px; }
.article::after { content: ""; display: table; clear: both; }

/* Government lookup forms embedded in a few pages */
.lookup-form {
  background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--navy);
  padding: 20px; margin: 0 0 1.4em; font: 0.98rem/1.5 var(--sans);
}
.lookup-form table { width: 100%; border-collapse: collapse; }
.lookup-form td { padding: 6px 0; vertical-align: top; }
.lookup-form input[type="text"] {
  width: 100%; max-width: 360px; font: inherit; padding: 8px 10px;
  border: 1px solid #b7c1d1; border-radius: 3px;
}
.lookup-form input[type="submit"], .lookup-form button {
  font: 600 1rem var(--sans); background: var(--navy); color: var(--white);
  border: 0; border-radius: 3px; padding: 10px 20px; cursor: pointer;
}
.lookup-form input[type="submit"]:hover { background: var(--red); }

/* ---------- Sidebar ---------- */
.sidebar { font-family: var(--sans); font-size: 0.95rem; line-height: 1.5; }
.side-block { margin: 0 0 32px; }
.side-block h2 {
  font: 700 1.05rem/1.3 var(--serif); margin: 0 0 8px; color: var(--ink);
  padding-bottom: 8px; border-bottom: 2px solid var(--navy);
}
.side-block ul { list-style: none; margin: 0; padding: 0; }
.side-block li { border-bottom: 1px solid var(--line); }
.side-block li a { display: block; padding: 9px 0; text-decoration: none; }
.side-block li a:hover { text-decoration: underline; }
.side-block li a[aria-current="page"] { color: var(--red); font-weight: 600; }
.side-block p { margin: 0; color: var(--muted); }
.side-related { background: var(--white); border: 1px solid var(--line); padding: 16px 18px 6px; }
.side-related li:last-child { border-bottom: 0; }
.ad-slot { text-align: center; margin: 0 0 32px; min-height: 1px; }
.ad-wide { text-align: center; margin: 8px 0 0; clear: both; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep); color: #c7d3e8;
  font: 0.92rem/1.6 var(--sans); padding: 40px 0 30px;
  border-top: 5px solid var(--red);
}
.site-footer a { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h2 { font: 700 1rem/1.3 var(--serif); color: var(--white); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 6px; }
.site-footer p { margin: 0 0 10px; max-width: 52ch; }
.footer-base { border-top: 1px solid rgba(255,255,255,.15); margin-top: 28px; padding-top: 18px; }

/* ---------- 404 ---------- */
.notfound { padding: 64px 0 80px; }
.notfound h1 { font: 700 2.4rem/1.1 var(--serif); margin: 0 0 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 24px; }
  .article { max-width: none; }
  .latest-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--navy); border-bottom: 5px solid var(--red);
    padding: 6px var(--gutter) 14px;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 13px 4px; font-size: 1.05rem; border-bottom: 1px solid rgba(255,255,255,.12); border-radius: 0; }
  .site-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--white); padding-left: 14px; }
}
@media (max-width: 680px) {
  body { font-size: 17px; }
  .directory-grid { grid-template-columns: 1fr; }
  .latest-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero::after { width: 260px; height: 260px; right: -90px; top: 30%; }
  .article .img-right, .article .img-left { float: none; display: block; margin: 8px 0 16px; max-width: 100%; }
  .brand { font-size: 1.1rem; }
  .brand svg { width: 38px; height: 38px; }
  .brand-name small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .search-band, .sidebar, .site-footer, .ad-wide { display: none; }
  .layout { display: block; }
}
.article p.dateline { font: 0.9rem/1.4 var(--sans); color: var(--muted); margin-bottom: 1.2em; }
