/* Kim Yoder Law - main stylesheet */
:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #333a40;
  --muted: #666f78;
  --heading: #1f2d3d;
  --accent: #1f5f8b;
  --accent-hover: #164566;
  --border: #e3e6ea;
  --header-bg: #ffffff;
  --footer-bg: #1f2d3d;
  --footer-text: #c9d1da;
  --shadow: 0 1px 4px rgba(0, 0, 0, .08);
  --radius: 6px;
  --font: "Open Sans", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--font);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { color: var(--heading); line-height: 1.25; font-weight: 600; }
h1 { font-size: 2rem; margin: 0 0 1rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 0 0 .4rem; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 16px; }
.logo img { width: 245px; max-width: 60vw; height: auto; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; gap: 4px; }
.site-nav li { position: relative; }
.site-nav a {
  display: block; padding: 10px 12px;
  color: var(--heading); text-decoration: none; font-weight: 600; font-size: .95rem;
  border-radius: var(--radius);
}
.site-nav a:hover, .site-nav li.active > a { color: var(--accent); }
.site-nav .sub {
  position: absolute; left: 0; top: 100%; min-width: 250px;
  background: var(--header-bg); border-top: 3px solid var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12); padding: 8px 0;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.site-nav .sub a { font-weight: 400; padding: 8px 18px; border-radius: 0; }
.site-nav .has-sub:hover > .sub,
.site-nav .has-sub:focus-within > .sub,
.site-nav .has-sub.open > .sub { opacity: 1; visibility: visible; transform: none; }
.sub-toggle { display: none; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 0; position: relative;
}
.nav-toggle .bar, .nav-toggle .bar::before, .nav-toggle .bar::after {
  position: absolute; left: 10px; width: 24px; height: 2px; background: var(--accent);
  content: ""; transition: transform .2s, background .2s;
}
.nav-toggle .bar { top: 21px; }
.nav-toggle .bar::before { left: 0; top: -7px; }
.nav-toggle .bar::after { left: 0; top: 7px; }
.nav-toggle[aria-expanded="true"] .bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar::after { transform: translateY(-7px) rotate(-45deg); }

/* Layout */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px;
  padding-top: 48px; padding-bottom: 56px;
}
.content > p:first-of-type { margin-top: 0; }
.lead { font-size: 1.08rem; color: var(--heading); }
.center { margin: 1.5rem auto; display: flex; justify-content: center; }
.center-text { text-align: center; }
.float-right { float: right; margin: 0 0 1rem 1.5rem; }
.portrait { border-radius: var(--radius); box-shadow: var(--shadow); }
figure { margin: 0; }
address { font-style: normal; margin: 1rem 0; }
.content::after { content: ""; display: table; clear: both; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 2rem; }
.tile {
  display: block; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); text-decoration: none; color: var(--text);
  transition: border-color .2s, transform .2s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.tile p { margin: 0; font-size: .92rem; color: var(--muted); }

.practice { list-style: none; padding: 0; margin: 0; }
.practice li { border-bottom: 1px solid var(--border); }
.practice a { display: block; padding: 14px 4px; text-decoration: none; font-size: 1.08rem; color: var(--heading); }
.practice a:hover { color: var(--accent); }
.sect { color: var(--accent); font-weight: 700; margin-right: 8px; }

.cv { padding-left: 1.25rem; }
.cv li { margin-bottom: .4rem; }
.cv ul { padding-left: 1.25rem; margin-top: .3rem; }

.testimonial {
  margin: 2.5rem 0 0; padding: 20px 24px; background: var(--surface);
  border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}
.testimonial p { margin: 0 0 .5rem; }
.testimonial cite { font-style: normal; font-weight: 600; color: var(--heading); }

.btn {
  display: inline-block; padding: 10px 18px; border-radius: var(--radius);
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem;
  border: 2px solid var(--accent);
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-alt { background: transparent; color: var(--accent); }
.btn-alt:hover { color: #fff; }
.call-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.5rem 0; }

/* Sidebar */
.sidebar .card {
  position: sticky; top: 100px;
  padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.card-title { margin: 0 0 .75rem; font-size: 1.15rem; }
.sidebar .btn { display: block; text-align: center; margin-top: .5rem; }

/* Footer */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding: 32px 0 20px; font-size: .88rem; }
.disclaimer { font-style: italic; text-align: center; max-width: 820px; margin: 0 auto 24px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 16px; }
.footer-bottom p { margin: 0; }
.social { list-style: none; display: flex; gap: 12px; margin: 0; padding: 0; }
.social a { display: block; width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.social a:hover { background: var(--accent); }
.social svg { width: 100%; height: 100%; fill: #fff; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .85);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 90vh; max-width: 100%; width: auto; border-radius: var(--radius); }
.lb-close { position: absolute; top: 12px; right: 16px; font-size: 2.2rem; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer; }

/* Responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .sidebar .card { position: static; }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--header-bg); box-shadow: 0 8px 16px rgba(0, 0, 0, .1);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .site-nav.open { max-height: 80vh; overflow-y: auto; }
  .site-nav > ul { flex-direction: column; padding: 8px 16px 16px; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--border); }
  .site-nav .has-sub { display: flex; flex-wrap: wrap; }
  .site-nav .has-sub > a { flex: 1; }
  .sub-toggle {
    display: block; width: 44px; background: none; border: 0; cursor: pointer; position: relative;
  }
  .sub-toggle span::before {
    content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
    border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
    transform: translate(-50%, -70%) rotate(45deg); transition: transform .2s;
  }
  .has-sub.open .sub-toggle span::before { transform: translate(-50%, -30%) rotate(-135deg); }
  .site-nav .sub {
    position: static; width: 100%; box-shadow: none; border-top: 0; padding: 0 0 8px 12px;
    opacity: 1; visibility: visible; transform: none; display: none;
  }
  .site-nav .has-sub:hover > .sub, .site-nav .has-sub:focus-within > .sub { display: none; }
  .site-nav .has-sub.open > .sub { display: block; }
  .site-nav .sub li { border: 0; }
  .float-right { float: none; margin: 0 auto 1.5rem; display: flex; justify-content: center; }
  h1 { font-size: 1.65rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .site-header, .sidebar, .lightbox, .social { display: none; }
  .layout { display: block; }
}
