/* Compton & Smith, PA — Law Firm Theme */
:root {
  --bg: #f7f8fc;
  --bg-alt: #eef1f9;
  --card: #ffffff;
  --text: #1e2a3a;
  --heading: #0f1d3a;
  --muted: #5a6a85;
  --line: #dce3f0;
  --brand: #1b3a7b;
  --brand-light: #2a5cb8;
  --accent: #b08a2e;
  --accent-light: #c9a23e;
  --success: #1a7a3a;
  --error: #b8242a;
  --header-bg: #0c1a38;
  --shadow-sm: 0 2px 8px rgba(12, 26, 56, 0.06);
  --shadow: 0 8px 24px rgba(12, 26, 56, 0.08);
  --shadow-lg: 0 16px 48px rgba(12, 26, 56, 0.12);
  --radius: 10px;
  --radius-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

/* --- Skip link (a11y) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--brand);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 100;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* --- Links --- */
a { color: var(--brand-light); transition: color 0.2s; }
a:hover { color: var(--brand); }
a:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Container --- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ==========  HEADER  ========== */
header {
  background: var(--header-bg);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 62px;
  gap: 16px;
}
.site-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.site-title:hover { color: #fff; opacity: 0.88; }
.nav nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.nav nav a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 7px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}
.nav nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.nav .phone-link {
  color: var(--accent-light);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 7px 14px;
  border: 1px solid rgba(176, 138, 46, 0.35);
  border-radius: 6px;
  text-decoration: none;
  margin-left: 4px;
  white-space: nowrap;
}
.nav .phone-link:hover {
  background: rgba(176, 138, 46, 0.12);
  color: #fff;
}

/* ==========  HERO (homepage)  ========== */
.hero {
  background: linear-gradient(135deg, #0c1a38 0%, #1b3a7b 60%, #254a8f 100%);
  color: #fff;
  padding: 68px 0 60px;
  text-align: center;
}
.hero h1 {
  color: #fff;
  font-size: clamp(1.75rem, 4vw, 2.7rem);
  margin: 0 0 14px;
  line-height: 1.18;
}
.hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
  max-width: 580px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.hero .cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.hero .cta:hover {
  background: var(--accent-light);
  color: #fff;
  transform: translateY(-1px);
}
.hero .cta:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 3px;
}

/* ==========  SECTION / PAGE  ========== */
section { padding: 40px 0; }
section.container {
  padding-top: 40px !important;
  padding-bottom: 56px !important;
}

/* ==========  TYPOGRAPHY  ========== */
h1, h2, h3, h4 {
  color: var(--heading);
  line-height: 1.24;
  letter-spacing: -0.015em;
}
h1 {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  margin: 0.2rem 0 0.7rem;
}
h2 {
  font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  margin: 1.8rem 0 0.7rem;
}
h3 {
  font-size: clamp(1.02rem, 1.5vw, 1.22rem);
  margin: 1.4rem 0 0.45rem;
}
p { margin: 0.6rem 0; }
.muted { color: var(--muted); }
.lead {
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 66ch;
  line-height: 1.7;
}

/* Constrain prose width */
section.container > p:not(.muted),
section.container > h2,
section.container > h3 { max-width: 72ch; }

/* Subtitle pill (first muted p after h1) */
section.container > .muted:first-of-type {
  display: inline-block;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ==========  GRID & CARDS  ========== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 1.2rem 0 1.5rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s, transform 0.25s;
}
.card:hover {
  box-shadow: var(--shadow);
}
.card img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 12px;
}
figcaption.muted {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--muted);
}

/* Linked card */
a.card {
  text-decoration: none;
  color: inherit;
  display: block;
}
a.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
a.card h3 { color: var(--brand); margin-top: 0; }

/* ==========  FEATURED IMAGE (replaces duplicate grids)  ========== */
.featured-img {
  margin: 0 0 1.5rem;
  max-width: 420px;
}
.featured-img img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
figure.featured-img figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
}

/* ==========  PRACTICE AREA CARDS  ========== */
.practice-card {
  border-left: 4px solid var(--brand);
}
.practice-card h3 { margin-top: 0; }
.practice-card h3 a {
  text-decoration: none;
  color: var(--heading);
}
.practice-card h3 a:hover { color: var(--brand-light); }
.practice-card p {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 0;
}

/* ==========  ATTORNEY PROFILES  ========== */
.attorney-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
  margin: 1.5rem 0 2rem;
}
.attorney-photo {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.attorney-bio h2 { margin-top: 0; }

/* Team listing cards */
.team-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  align-items: start;
  text-align: left;
}
.team-card img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  object-fit: cover;
  aspect-ratio: 3 / 4;
  box-shadow: var(--shadow-sm);
}
.team-card h3 { margin-top: 0; }
.team-card h3 a {
  text-decoration: none;
  color: var(--heading);
}
.team-card h3 a:hover { color: var(--brand-light); }

/* ==========  ARTICLE CARDS  ========== */
.article-card h3 {
  margin-top: 0;
  margin-bottom: 4px;
}
.article-card h3 a {
  text-decoration: none;
  color: var(--heading);
}
.article-card h3 a:hover { color: var(--brand-light); }
.article-card .excerpt {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
  margin: 0;
}
.article-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* Tags */
.tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 2px 10px;
  border-radius: 999px;
  text-decoration: none;
}
.tag:hover {
  background: var(--line);
  color: var(--brand);
}

/* ==========  SECTION ACCENT HEADERS  ========== */
body.page-contact section.container > h2:first-of-type,
body.page-profile section.container > h2:first-of-type,
body.page-practice section.container > h2:first-of-type {
  font-size: clamp(1.1rem, 1.7vw, 1.4rem);
  color: var(--muted);
  font-weight: 600;
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
  max-width: fit-content;
}

/* Article / category / author listing page H2 separators */
body.page-articles section.container > h2,
body.page-category section.container > h2,
body.page-author section.container > h2 {
  padding-top: 1.2rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* ==========  CTA LINK  ========== */
.cta-link {
  display: inline-block;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 28px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s, transform 0.15s;
}
.cta-link:hover {
  background: var(--brand-light);
  color: #fff;
  transform: translateY(-1px);
}
.cta-link:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 3px;
}
.cta-link--accent {
  background: var(--accent);
}
.cta-link--accent:hover {
  background: var(--accent-light);
}

/* ==========  CONTACT GRID & FORM  ========== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 1.2rem 0;
}
.contact-card { padding: 28px; }

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lead-form label {
  font-weight: 620;
  font-size: 0.93rem;
  color: var(--heading);
}
.lead-form .required { color: var(--error); }
.lead-form input,
.lead-form textarea {
  font: inherit;
  font-size: 0.95rem;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lead-form input:focus,
.lead-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(27, 58, 123, 0.12);
}
.lead-form button {
  align-self: flex-start;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 32px;
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.lead-form button:hover {
  background: var(--brand-light);
  transform: translateY(-1px);
}
.lead-form button:disabled { opacity: 0.6; cursor: wait; }
.form-msg { font-size: 0.93rem; min-height: 1.4em; }
.form-msg.success { color: var(--success); }
.form-msg.error { color: var(--error); }

/* ==========  RELATED ARTICLES  ========== */
.related-articles {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.related-articles h3 { margin-top: 0; }
.related-articles ul {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}
.related-articles li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.related-articles li:last-child { border-bottom: none; }
.related-articles a {
  text-decoration: none;
  font-weight: 500;
}

/* ==========  TRUST BAR (homepage)  ========== */
.trust-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  padding: 20px 0;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}
.trust-bar strong { color: var(--heading); }

/* ==========  FOOTER  ========== */
footer {
  background: var(--header-bg);
  color: rgba(255, 255, 255, 0.75);
  padding: 36px 0;
  margin-top: 36px;
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-brand {
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
}
.footer-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.footer-nav a {
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.86rem;
  transition: all 0.2s;
}
.footer-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.footer-info {
  width: 100%;
  text-align: center;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ==========  RESPONSIVE  ========== */
@media (max-width: 1024px) {
  .nav {
    min-height: auto;
    padding: 12px 0;
    flex-direction: column;
    align-items: flex-start;
  }
  .site-title { font-size: 1rem; }
  .nav nav {
    width: 100%;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .nav nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .attorney-grid {
    grid-template-columns: 160px 1fr;
    gap: 20px;
  }
}

@media (max-width: 760px) {
  .hero { padding: 44px 0 38px; }
  .hero h1 { font-size: 1.55rem; }

  .contact-grid { grid-template-columns: 1fr; }
  .lead-form button { width: 100%; }

  .attorney-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .attorney-photo {
    max-width: 180px;
    margin: 0 auto;
  }

  .team-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .team-card img {
    max-width: 150px;
    margin: 0 auto;
  }

  .grid { grid-template-columns: 1fr; }

  .trust-bar { gap: 16px; font-size: 0.85rem; }

  section.container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .nav .phone-link { margin-left: 0; }
}
