/*!
 * michigan-drunk-driving.com — shared stylesheet (mdd-site.css)
 * Replaces Bootstrap 3, theduilawyer.css, newcourts2.css and two copies of
 * Font Awesome on the revised court pages. No framework, no web fonts.
 * Sections: 1 tokens · 2 base · 3 layout · 4 header/nav · 5 page head
 * 6 content components · 7 forms · 8 footer · 9 utilities · 10 print
 */

/* 1. TOKENS ------------------------------------------------------------ */
:root {
  --ink: #1b2530;
  --ink-2: #3a4754;
  --muted: #56636f;
  --lake: #0e4a6b;
  --lake-deep: #0a2e44;
  --link: #0b5c8a;
  --link-visited: #5a3e85;
  --brass: #8f6210;
  --paper: #ffffff;
  --wash: #f2f5f7;
  --rule: #d3dbe1;
  --focus: #f2b632;

  --info-bg: #eaf2f8;   --info-rule: #0b5c8a;
  --caution-bg: #fff5dc; --caution-rule: #b7791f;
  --warn-bg: #fcebea;   --warn-rule: #a4262c;
  --ok-bg: #eaf5ee;     --ok-rule: #2f7d4b;
  --note-bg: #f1efea;   --note-rule: #6f675a;

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

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.625rem, 1.2rem + 1.6vw, 2.25rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem;    --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem;

  --measure: 70ch;
  --wrap: 76rem;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(10, 46, 68, .08);
  --speed: .15s;
}

/* 2. BASE -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font: 400 var(--step-0)/1.65 var(--serif);
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}
img, iframe, video { max-width: 100%; }
img { height: auto; border: 0; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--sans);
  line-height: 1.25;
  color: var(--lake-deep);
  margin: 1.8em 0 .5em;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: var(--step-3); margin-top: 0; letter-spacing: -.01em; }
h2 { font-size: var(--step-2); padding-top: .25em; }
h3 { font-size: var(--step-1); }
h4 { font-size: 1.0625rem; }
h5, h6 { font-size: 1rem; }
p, ul, ol, dl, blockquote, figure, table { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: .35em; }
li > ul, li > ol { margin-top: .35em; }
a { color: var(--link); text-underline-offset: .15em; text-decoration-thickness: 1px; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
strong, b { font-weight: 700; }
small { font-size: var(--step--1); }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--space-6) 0; }
address { font-style: normal; }
abbr[title] { text-decoration: underline dotted; }

.skip-link {
  position: absolute; left: var(--space-3); top: -4rem; z-index: 100;
  background: var(--paper); color: var(--lake-deep); padding: var(--space-2) var(--space-4);
  font: 600 1rem var(--sans); border: 2px solid var(--lake);
}
.skip-link:focus { top: var(--space-3); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* 3. LAYOUT ------------------------------------------------------------ */
@media (min-width: 1100px) { body { font-size: 1.125rem; } :root { --measure: 72ch; } }
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.layout { display: block; }
.content { max-width: var(--measure); min-width: 0; }
.content > section { scroll-margin-top: 1rem; }
@media (min-width: 1100px) {
  .layout { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: var(--space-7); align-items: start; }
  .layout > .toc { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
}
.grid-2, .grid-3 { display: grid; gap: var(--space-4) var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.split { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
/* .split stays stacked inside the reading column; it only divides in wide containers */
@media (min-width: 900px) { :not(.content) > .split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .content .split { grid-template-columns: 1fr; } }
.content .grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.grid-2 > *, .grid-3 > *, .split > * { min-width: 0; }

/* 4. HEADER / NAV ------------------------------------------------------ */
.site-header { background: var(--lake-deep); color: #fff; font-family: var(--sans); }
.site-header a { color: #fff; }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; }
.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; min-width: 0; }
.brand img { height: 40px; width: auto; display: block; }
.brand__text { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.brand__text span { display: block; font-weight: 400; font-size: .85rem; opacity: .85; }
.header-call { white-space: nowrap; font-weight: 700; text-decoration: none; border: 1px solid rgba(255,255,255,.5); border-radius: var(--radius); padding: .45rem .8rem; }
.header-call:hover, .header-call:focus-visible { background: rgba(255,255,255,.12); }
.site-nav { border-top: 1px solid rgba(255,255,255,.15); }
.site-nav ul { display: flex; gap: 0 var(--space-5); margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: thin; }
.site-nav li { margin: 0; flex: none; }
.site-nav a { display: block; padding: .7rem 0; text-decoration: none; font-size: .95rem; opacity: .92; }
.site-nav a:hover, .site-nav a:focus-visible { opacity: 1; text-decoration: underline; }
@media (max-width: 600px) {
  .brand__text span { display: none; }
  .brand__text { font-size: 1rem; }
  .brand img { height: 34px; }
}

.breadcrumbs { font: .875rem/1.4 var(--sans); color: var(--muted); padding: var(--space-4) 0 0; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "/"; padding: 0 .5em; color: var(--rule); }
.breadcrumbs a { color: var(--muted); }

/* 5. PAGE HEAD (court caption) ----------------------------------------- */
.page-head { padding: var(--space-5) 0 var(--space-6); border-bottom: 1px solid var(--rule); margin-bottom: var(--space-6); }
.page-head__grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .page-head__grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--space-7); } }
.page-head .subtitle { font: 600 var(--step-1)/1.35 var(--sans); color: var(--ink-2); margin: -.2rem 0 var(--space-4); }
.page-head .lede { font-size: 1.125rem; max-width: 60ch; }
.page-head__facts { list-style: none; padding: 0; margin: 0 0 var(--space-5); font-family: var(--sans); font-size: .98rem; }
.page-head__facts li { padding-left: 1.1rem; position: relative; }
.page-head__facts li::before { content: ""; position: absolute; left: 0; top: .6em; width: .45rem; height: .45rem; background: var(--brass); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.byline { font: .9rem/1.4 var(--sans); color: var(--muted); display: flex; gap: var(--space-3); align-items: center; margin-top: var(--space-5); }
.byline img { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; }

.caption-card {
  font-family: var(--sans);
  background: var(--wash);
  border-left: 6px solid var(--brass);
  padding: var(--space-5);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.caption-card h2 { font-size: 1.15rem; margin: 0 0 var(--space-3); padding: 0; }
.caption-card dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem var(--space-4); margin: 0; font-size: .95rem; }
.caption-card dt { color: var(--muted); font-weight: 600; }
.caption-card dd { margin: 0; }
.caption-card .fineprint { margin: var(--space-4) 0 0; font-size: .8rem; color: var(--muted); }

/* 6. CONTENT COMPONENTS ------------------------------------------------ */
.lead { font-size: 1.125rem; color: var(--ink-2); }
.toc { font-family: var(--sans); font-size: .92rem; border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-6); background: var(--paper); }
.toc summary { font-weight: 700; cursor: pointer; color: var(--lake-deep); padding: var(--space-1) 0; }
.toc ol { list-style: none; padding: 0; margin: var(--space-2) 0 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: .3rem 0 .3rem .6rem; border-left: 2px solid var(--rule); text-decoration: none; color: var(--ink-2); }
.toc a:hover, .toc a:focus-visible { border-left-color: var(--lake); color: var(--lake-deep); }

.callout { border-left: 4px solid var(--info-rule); background: var(--info-bg); padding: var(--space-4) var(--space-5); margin: var(--space-5) 0; border-radius: 0 var(--radius) var(--radius) 0; }
.callout > :last-child { margin-bottom: 0; }
.callout > h2:first-child, .callout > h3:first-child, .callout > h4:first-child, .callout > h5:first-child, .callout__title { margin-top: 0; font-size: 1.05rem; font-family: var(--sans); font-weight: 700; color: var(--ink); padding: 0; }
.callout--caution { background: var(--caution-bg); border-color: var(--caution-rule); }
.callout--warning { background: var(--warn-bg); border-color: var(--warn-rule); }
.callout--ok { background: var(--ok-bg); border-color: var(--ok-rule); }
.callout--note { background: var(--note-bg); border-color: var(--note-rule); }
.callout--note .callout__title { color: var(--note-rule); }

.penalty { border-top: 3px solid var(--lake); padding-top: var(--space-2); margin: var(--space-6) 0; }
.penalty > h3:first-child { margin-top: var(--space-3); }
.penalty ul, .checklist { list-style: none; padding-left: 0; }
.penalty li, .checklist li { position: relative; padding-left: 1.25rem; }
.penalty li::before { content: ""; position: absolute; left: .1rem; top: .62em; width: .45rem; height: .45rem; background: var(--lake); }
.checklist li::before { content: ""; position: absolute; left: .1rem; top: .55em; width: .55rem; height: .3rem; border-left: 2px solid var(--ok-rule); border-bottom: 2px solid var(--ok-rule); transform: rotate(-45deg); }

.card { border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-4) var(--space-5); background: var(--paper); box-shadow: var(--shadow); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card--contact { border-left: 4px solid var(--lake); font-family: var(--sans); font-size: .95rem; }
.card--contact h3, .card--contact h4 { font-size: 1rem; }
.card--person h3, .card--person h4, .card--person h5 { text-align: center; }
.card--person p { font-size: .95rem; }
.card--person img, .judge-photo { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; display: block; margin: 0 auto var(--space-3); background: var(--wash); }
.card--muted { background: var(--wash); box-shadow: none; }
.cards { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); margin: var(--space-4) 0 var(--space-5); }

.badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--space-3); align-items: center; margin: var(--space-4) 0; }
.badges img { max-height: 96px; width: auto; margin-inline: auto; display: block; }

.pullquote { margin: var(--space-6) 0; padding: var(--space-4) 0 var(--space-4) var(--space-5); border-left: 3px solid var(--brass); font-size: 1.15rem; }
.pullquote p { margin-bottom: var(--space-2); }
.pullquote .pullquote__cite { font: .9rem var(--sans); color: var(--muted); }

.figure-inline { margin: 0 0 var(--space-4); }
.figure-inline img { display: block; border-radius: var(--radius); }
@media (min-width: 760px) { .figure-inline--right { float: right; max-width: 45%; margin: .3rem 0 var(--space-4) var(--space-5); } }
.clear { clear: both; }

.map-frame { position: relative; aspect-ratio: 4 / 3; background: var(--wash); border-radius: var(--radius); overflow: hidden; }
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.table-wrap { overflow-x: auto; margin: var(--space-4) 0 var(--space-5); }
table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .55rem .7rem; border-bottom: 1px solid var(--rule); }
thead th { background: var(--wash); color: var(--lake-deep); }
/* Stacked tables: each row becomes a labelled block on narrow screens */
@media (max-width: 640px) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack th, .table--stack td { display: block; width: 100%; }
  .table--stack tr { border-bottom: 2px solid var(--rule); padding: var(--space-2) 0; }
  .table--stack th[scope="row"] { border: 0; padding-bottom: 0; }
  .table--stack td { border: 0; padding-top: .25rem; padding-bottom: .25rem; }
  .table--stack td::before { content: attr(data-label); display: block; font-weight: 600; font-size: .85rem; color: var(--muted); }
}

.sources { font-size: .95rem; }
.sources li { margin-bottom: .6em; }
.editor-note { font: .85rem var(--sans); color: var(--muted); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 44px; padding: .6rem 1.1rem;
  font: 700 1rem/1.2 var(--sans); text-decoration: none; text-align: center;
  color: #fff; background: var(--lake); border: 2px solid var(--lake); border-radius: var(--radius);
  cursor: pointer; transition: background var(--speed), border-color var(--speed);
}
.button:visited { color: #fff; }
.button:hover { background: var(--lake-deep); border-color: var(--lake-deep); }
.button--call { background: var(--brass); border-color: var(--brass); }
.button--call:hover { background: #6f4b0b; border-color: #6f4b0b; }
.button--secondary { background: transparent; color: var(--lake); }
.button--secondary:visited { color: var(--lake); }
.button--secondary:hover { background: var(--info-bg); color: var(--lake-deep); }
.button--block { display: flex; width: 100%; }
.button[disabled] { opacity: .6; cursor: progress; }

.related { font-family: var(--sans); font-size: .95rem; columns: 2 14rem; column-gap: var(--space-6); padding-left: 1.1em; }
.related li { break-inside: avoid; }

/* 7. FORMS ------------------------------------------------------------- */
.form { font-family: var(--sans); }
.field { margin-bottom: var(--space-4); }
.field label, .fieldset legend { display: block; font-weight: 600; margin-bottom: .3rem; }
.field .hint, .form .hint { display: block; font-size: .85rem; color: var(--muted); margin-top: .3rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .7rem;
  font: 1rem/1.4 var(--sans); color: var(--ink);
  background: #fff; border: 1px solid #8a98a5; border-radius: var(--radius);
}
textarea { min-height: 9rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--lake); }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: var(--space-4) 0; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-messages .callout { margin-top: var(--space-4); }

/* 8. FOOTER ------------------------------------------------------------ */
.site-footer { margin-top: var(--space-7); background: var(--wash); border-top: 1px solid var(--rule); font: .92rem/1.55 var(--sans); color: var(--ink-2); padding: var(--space-6) 0 var(--space-7); }
.site-footer h2 { font-size: 1rem; margin: 0 0 var(--space-3); }
.site-footer__grid { display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 900px) { .site-footer__grid { grid-template-columns: 1.1fr 1fr 1.4fr; } }
.site-footer ul { list-style: none; padding: 0; }
.site-footer .courts-list { columns: 2 12rem; column-gap: var(--space-5); margin-bottom: var(--space-4); }
.site-footer .courts-county { font-size: .9rem; margin: var(--space-3) 0 var(--space-2); color: var(--ink-2); }
.site-footer .courts-list li { break-inside: avoid; margin-bottom: .3em; }
.disclaimer { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--rule); margin-top: var(--space-6); padding-top: var(--space-4); }

.call-bar { display: none; }
@media (max-width: 760px) {
  .call-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--lake-deep); padding: .4rem .6rem calc(.4rem + env(safe-area-inset-bottom));
    gap: .5rem; font-family: var(--sans);
  }
  .call-bar a { flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; text-decoration: none; border: 1px solid rgba(255,255,255,.35); border-radius: var(--radius); }
  .call-bar a:first-child { flex: 2; white-space: nowrap; }
  body.has-call-bar { padding-bottom: 4.25rem; }
  .header-call { display: none; }
}

/* 9. UTILITIES --------------------------------------------------------- */
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }

/* 10. PRINT ------------------------------------------------------------ */
@media print {
  .site-header, .site-nav, .toc, .call-bar, .form, .map-frame, .actions { display: none !important; }
  body { font-size: 11pt; color: #000; }
  a { color: #000; }
  .content { max-width: none; }
  .callout, .card { break-inside: avoid; }
}
