/* James E Baird Solicitors
   Palette and type lifted from the previous Legalized theme so the site
   looks continuous with what clients have seen before. No framework:
   the whole design is ~300 lines, which is the point. */

:root {
  --brand:        #2124b2;   /* links, active nav, accents */
  --brand-dark:   #171a80;
  --header-bg:    #484848;
  --nav-bg:       #f3f3f3;
  --ink:          #515151;   /* body copy */
  --ink-strong:   #333333;
  --ink-muted:    #7f7f7f;
  --rule:         #dfdfdf;
  --panel:        #f3f3f3;
  --white:        #ffffff;

  --serif: "Merriweather", Georgia, "Times New Roman", serif;
  --measure: 68ch;
  --wrap: 1140px;
  --wrap-text: 880px;   /* reading column for content pages */
  --step: 1.5rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.0625rem);
  line-height: 1.75;
  color: var(--ink);
  background: var(--white);
}

img { max-width: 100%; height: auto; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover, a:focus-visible { color: var(--brand-dark); }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--brand); color: var(--white);
  padding: 0.75rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; top: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }

/* Content pages use a narrower, centred column so copy is not stranded
   against the left edge of a wide container. */
.wrap--text { max-width: var(--wrap-text); }

/* ---------- Header ---------- */

.topbar { background: var(--header-bg); color: var(--white); }

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: 1rem;
}

.logo { flex: 0 0 auto; line-height: 0; }
.logo img { width: 125px; height: auto; }

.tagline {
  flex: 1 1 auto;
  margin: 0;
  font-size: 0.9375rem;
  color: #cfcfcf;
}

.phone {
  flex: 0 0 auto;
  display: inline-block;
  padding: 0.5rem 0.9rem;
  background: #3a3a3a;
  border-radius: 4px;
  color: var(--white);
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}
.phone:hover, .phone:focus-visible { background: var(--brand); color: var(--white); }

/* ---------- Navigation ---------- */

.mainnav { background: var(--nav-bg); border-bottom: 1px solid var(--rule); }

.mainnav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mainnav a {
  display: block;
  padding: 1.15rem 1.15rem;
  color: var(--ink);
  font-size: 0.9375rem;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.mainnav a:hover, .mainnav a:focus-visible { color: var(--brand); }
.mainnav a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }

/* CSS-only mobile menu — no JavaScript on the site at all */
.navtoggle-input { position: absolute; opacity: 0; pointer-events: none; }
.navtoggle { display: none; }

@media (max-width: 800px) {
  .navtoggle {
    display: inline-block;
    padding: 0.85rem 0;
    font-size: 0.9375rem;
    color: var(--brand);
    cursor: pointer;
  }
  .navtoggle::before { content: "\2630"; margin-right: 0.5rem; }
  .mainnav ul { display: none; flex-direction: column; padding-bottom: 0.5rem; }
  .navtoggle-input:checked ~ ul { display: flex; }
  .mainnav a { padding: 0.7rem 0; border-bottom: none; }
  .mainnav a[aria-current="page"] { border-bottom: none; font-weight: 700; }
  .topbar-inner { gap: 0.75rem; }
  .tagline { flex-basis: 100%; order: 3; }
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink-strong);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.25rem);
  font-weight: 400;
  padding-block: 1.5rem 0;
}
h1::after {
  content: "";
  display: block;
  width: 88px;
  height: 4px;
  margin-top: 1.1rem;
  background: var(--rule);
}

h2 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); margin-top: 2em; }
h3 { font-size: 1.125rem; margin-top: 1.8em; }

.prose { padding-block: 1.5rem 3rem; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.35em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: 0.45em; }
.prose strong { font-weight: 700; color: var(--ink-strong); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.5em; }
.prose th, .prose td { padding: 0.6rem 0.75rem; border: 1px solid var(--rule); text-align: left; }
.prose th { background: var(--panel); font-weight: 700; }

/* ---------- Home ---------- */

.home-intro { padding-block: 0 1rem; }

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1.25rem;
  padding-block: 1rem 3.5rem;
  list-style: none;
  margin: 0;
  padding-inline: 0;
}

.service {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 118px;
  padding: 1.5rem 1.25rem;
  background: var(--brand);
  color: var(--white);
  font-size: 1.375rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border-radius: 3px;
  transition: background 0.15s ease-in-out;
}
.service:hover, .service:focus-visible { background: var(--brand-dark); color: var(--white); }

/* ---------- Contact form ---------- */

.form-grid { display: grid; gap: 1.1rem; max-width: 34rem; }

.field label { display: block; margin-bottom: 0.35rem; font-size: 0.9375rem; color: var(--ink-strong); }
.field .req { color: #b3261e; }

.field input, .field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #cfcfcf;
  border-radius: 3px;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); }
.field textarea { min-height: 9rem; resize: vertical; }

.hp { position: absolute; left: -9999px; }

/* Turnstile renders its own iframe; just give it room and stop it
   overflowing on narrow screens. */
.cf-turnstile { min-height: 65px; }
.cf-turnstile iframe { max-width: 100%; }

.btn {
  justify-self: start;
  padding: 0.8rem 1.6rem;
  font: inherit;
  font-weight: 700;
  color: var(--white);
  background: var(--brand);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}
.btn:hover, .btn:focus-visible { background: var(--brand-dark); }

.notice { padding: 1rem 1.1rem; border-left: 4px solid var(--brand); background: var(--panel); margin-bottom: 1.5rem; }
.notice.error { border-left-color: #b3261e; }

.form-privacy { font-size: 0.875rem; color: var(--ink-muted); max-width: 34rem; }

/* ---------- Footer ---------- */

.site-footer { margin-top: 2rem; background: var(--panel); border-top: 1px solid var(--rule); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: center;
  padding-block: 2.25rem;
}

.footer-contact p { margin: 0 0 0.4rem; font-size: 0.9375rem; }
.footer-contact .footer-firm { margin-bottom: 0.6rem; }
.footer-contact address {
  font-style: normal;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 0.7rem;
}

.footer-accreditations { display: flex; align-items: center; gap: 1.5rem; }
.footer-accreditations img { max-height: 62px; width: auto; }

.footer-legal {
  border-top: 1px solid var(--rule);
  padding-block: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
}
.footer-legal { flex-direction: column; gap: 0.55rem; }
.footer-legal p { margin: 0; font-size: 0.8125rem; line-height: 1.6; color: var(--ink-muted); max-width: 78ch; }
.footer-legal a { color: var(--ink-muted); text-decoration: underline; }
.footer-legal a:hover, .footer-legal a:focus-visible { color: var(--brand); }
.footer-legal .footer-meta { margin-top: 0.2rem; }

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { color: #000; }
}
