/* ==========================================================================
   Lawyer directory theme — layers on top of Bootstrap 5.
   Fonts are served from /assets/rubik (variable font, static files as fallback).
   ========================================================================== */

@font-face {
  font-family: 'Rubik';
  src: url('../rubik/Rubik-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Rubik';
  src: url('../rubik/Rubik-Italic-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #14181f;
  --ink-soft: #5a6472;
  --line: #e4e8ee;
  --brand: #1f4e79;
  --brand-dark: #163b5c;
  --brand-tint: #eef4fa;
  --gold: #c8952a;
  --surface: #ffffff;
  --canvas: #f6f8fb;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 31, .06), 0 2px 8px rgba(20, 24, 31, .04);
  --shadow-md: 0 4px 12px rgba(20, 24, 31, .08), 0 12px 28px rgba(20, 24, 31, .06);

  --bs-body-font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-primary: #1f4e79;
  --bs-primary-rgb: 31, 78, 121;
  --bs-link-color: #1f4e79;
  --bs-link-color-rgb: 31, 78, 121;
  --bs-link-hover-color: #163b5c;
  --bs-border-radius: 14px;
}

body {
  font-family: var(--bs-body-font-family);
  color: var(--ink);
  background: var(--canvas);
  font-size: .975rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .display-title {
  font-weight: 600;
  letter-spacing: -.018em;
  color: var(--ink);
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

.text-soft { color: var(--ink-soft); }

/* Utility ---------------------------------------------------------------- */

.section { padding: 3.25rem 0; }
.section-tight { padding: 2.25rem 0; }

/* Bootstrap has no min-width utility, and flex children default to
   min-width:auto — without this, .text-truncate never truncates. */
.min-w-0 { min-width: 0; }

.eyebrow {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
}

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

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

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1030;
}

/* Admin-managed header dropdowns (Menus screen) --------------------------- */

.dropdown-menu.mega-menu {
  columns: 2;
  column-gap: 1.5rem;
  min-width: 26rem;
  max-width: calc(100vw - 2rem);
  padding: 1rem 1.25rem;
}
.dropdown-menu.mega-menu .dropdown-item { break-inside: avoid; border-radius: 6px; }

@media (max-width: 576px) {
  .dropdown-menu.mega-menu { min-width: 0; columns: 1; }
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -.02em;
  color: var(--ink);
}

.brand-mark .glyph {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.site-header .nav-link {
  color: var(--ink-soft);
  font-size: .9rem;
  font-weight: 500;
  padding: .4rem .85rem;
}

.site-header .nav-link:hover,
.site-header .nav-link.active { color: var(--brand); }

/* Hero ------------------------------------------------------------------- */

.hero {
  background:
    radial-gradient(1100px 420px at 15% -10%, rgba(31, 78, 121, .16), transparent 60%),
    radial-gradient(900px 380px at 88% 0%, rgba(200, 149, 42, .13), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, var(--canvas) 100%);
  border-bottom: 1px solid var(--line);
  padding: 3.5rem 0 3rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 3.4vw, 2.65rem);
  font-weight: 700;
  line-height: 1.2;
  max-width: 17ch;
}

.hero .lead {
  color: var(--ink-soft);
  font-size: 1.02rem;
  max-width: 54ch;
}

/* Search panel ----------------------------------------------------------- */

.search-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 1rem;
}

.search-panel .form-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: .3rem;
}

.search-panel .form-control,
.search-panel .form-select {
  border-color: var(--line);
  border-radius: 10px;
  padding: .58rem .8rem;
  font-size: .92rem;
  background-color: #fbfcfe;
}

.search-panel .form-control:focus,
.search-panel .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 78, 121, .12);
  background-color: #fff;
}

.btn-brand {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #fff;
  font-weight: 500;
  border-radius: 10px;
  padding: .58rem 1.35rem;
}

.btn-brand:hover,
.btn-brand:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  border-radius: 10px;
  padding: .5rem 1.05rem;
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-tint);
}

/* Stat strip ------------------------------------------------------------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat-strip .stat {
  background: var(--surface);
  padding: 1.05rem 1.15rem;
}

.stat-strip .stat .n {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--brand);
  line-height: 1.2;
}

.stat-strip .stat .l {
  font-size: .78rem;
  color: var(--ink-soft);
}

/* Avatar ----------------------------------------------------------------- */

.avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--brand-tint);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .02em;
  overflow: hidden;
}

.avatar-lg {
  width: 108px;
  height: 108px;
  flex-basis: 108px;
  border-radius: 16px;
  font-size: 2rem;
}

/* Lawyer card ------------------------------------------------------------ */

.lawyer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.lawyer-card:hover {
  border-color: rgba(31, 78, 121, .38);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* The text column beside the avatar. Flex items default to min-width:auto,
   which is exactly what lets a long name push past the card edge — so the
   shrink permission lives here rather than on a utility class in the markup. */
.lawyer-card-ident {
  flex: 1 1 auto;
  min-width: 0;
}

.lawyer-card .name {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;

  /* Names are the reason someone is scanning this list, so allow a second line
     before clipping instead of truncating most of them on the first. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;

  /* Last-resort guard: an unbroken 40-character token still can't escape. */
  overflow-wrap: anywhere;
}

.lawyer-card:hover .name { color: var(--brand); }

.lawyer-card .meta {
  font-size: .82rem;
  color: var(--ink-soft);
  min-width: 0;
}

/* Location: one line, ellipsised — the full value is in the title attribute. */
.lawyer-card .meta-1line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lawyer-card .card-foot {
  margin-top: auto;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

/* Rating ----------------------------------------------------------------- */

.rating {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
}

.rating .stars {
  --pct: 0%;
  display: inline-block;
  font-size: .85rem;
  line-height: 1;
  letter-spacing: .06em;
  background: linear-gradient(90deg, var(--gold) var(--pct), #d7dce4 var(--pct));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rating .count {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: .78rem;
}

/* Chips / tags ----------------------------------------------------------- */

.chip {
  display: inline-block;
  font-size: .755rem;
  font-weight: 500;
  line-height: 1.5;
  padding: .2rem .58rem;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand);
  border: 1px solid rgba(31, 78, 121, .14);
}

.chip-muted {
  background: #f3f5f8;
  color: var(--ink-soft);
  border-color: var(--line);
}

.chip-gold {
  background: #fdf6e7;
  color: #8a6416;
  border-color: rgba(200, 149, 42, .28);
}

a.chip:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

/* Profile ---------------------------------------------------------------- */

.profile-head {
  background: linear-gradient(180deg, #ffffff 0%, var(--canvas) 100%);
  border-bottom: 1px solid var(--line);
  padding: 2.25rem 0 2rem;
}

.profile-head h1 {
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  font-weight: 700;
  margin-bottom: .35rem;
  overflow-wrap: anywhere;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.15rem;
}

.panel > .panel-head {
  padding: .95rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.panel > .panel-head h2,
.panel > .panel-head h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.panel > .panel-body { padding: 1.25rem; }

/* Definition grid used for the "at a glance" facts */
.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line);
}

.fact-grid .fact {
  background: var(--surface);
  padding: .95rem 1.25rem;
}

.fact-grid .fact dt {
  font-size: .715rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: .15rem;
}

.fact-grid .fact dd {
  margin: 0;
  font-size: .92rem;
  font-weight: 500;
  color: var(--ink);
}

.bio :is(p, li) { color: #333b47; }
.bio p:last-child { margin-bottom: 0; }
.bio h2, .bio h3 { font-size: 1.02rem; margin: 1.4rem 0 .55rem; }

/* Sticky contact card on profile */
.contact-card { position: sticky; top: 84px; }

.contact-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: .9rem;
}

.contact-row:last-of-type { border-bottom: 0; }

.contact-row .ico {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand-tint);
  color: var(--brand);
}

/* "Click to view number" gate — link-styled so it fits inline with the
   phone/email/office rows. Scoped to .contact-row so it doesn't clash with
   .lead-gate-btn also being used on the full Bootstrap Call now/WhatsApp buttons. */
.contact-row .lead-gate-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  font-weight: 500;
  font-size: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.contact-row .lead-gate-btn:hover { color: var(--brand-dark); text-decoration: underline; }
.contact-row .lead-gate-btn i { font-size: .8rem; }

/* Lead capture modals (#leadModal, #enquiryModal) ------------------------- */

.lead-success { text-align: center; padding: 1.25rem 0; }
.lead-success-icon { font-size: 2.25rem; color: var(--brand); margin-bottom: .5rem; }

.enquiry-lawyer { border-bottom: 1px solid var(--line); }
.enquiry-lawyer .avatar { width: 58px; height: 58px; flex: 0 0 58px; border-radius: 12px; font-size: 1.05rem; }

/* FAQ -------------------------------------------------------------------- */

.faq-heading {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

.faq-heading .faq-heading-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--brand);
  color: var(--brand);
  font-size: .95rem;
}

.faq .accordion-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: .75rem;
}

.faq .accordion-item:last-child { margin-bottom: 0; }

.faq .accordion-button {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  padding: 1.1rem 1.35rem;
  box-shadow: none;
}

.faq .accordion-button:not(.collapsed) { color: var(--brand); background: var(--line); }
.faq .accordion-button:focus { box-shadow: none; }
.faq .accordion-button::after { flex-shrink: 0; }
.faq .accordion-body { padding: 1.35rem 1.35rem 1.25rem; color: var(--ink-soft); font-size: .92rem; line-height: 1.7; }

/* Pagination ------------------------------------------------------------- */

.pagination { --bs-pagination-border-radius: 9px; gap: .3rem; }

.pagination .page-link {
  border-color: var(--line);
  color: var(--ink);
  font-size: .875rem;
  padding: .45rem .8rem;
  border-radius: 9px;
}

.pagination .page-link:hover { background: var(--brand-tint); color: var(--brand); }

.pagination .page-item.active .page-link {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.pagination .page-item.disabled .page-link { color: #aeb6c2; background: #fafbfc; }

/* Editorial copy on city / practice-area pages ---------------------------- */

.page-copy {
  /* max-width: 74ch; */
  color: #333b47;
  font-size: .95rem;
  line-height: 1.75;
}

.page-copy > :first-child { margin-top: 0; }
.page-copy > :last-child { margin-bottom: 0; }

.page-copy h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
.page-copy h3 { font-size: 1rem; margin: 1.3rem 0 .5rem; }
.page-copy p, .page-copy li { color: #333b47; }
.page-copy ul, .page-copy ol { padding-left: 1.15rem; }
.page-copy li { margin-bottom: .3rem; }
.page-copy a { color: var(--brand); text-decoration: underline; }
.page-copy img { max-width: 100%; height: auto; border-radius: 10px; }

.page-copy table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .9rem;
  display: block;
  overflow-x: auto;
}

.page-copy th, .page-copy td {
  border: 1px solid var(--line);
  padding: .5rem .7rem;
  text-align: left;
}

.page-copy th { background: #f8fafc; font-weight: 600; }

/* Advanced filter panel --------------------------------------------------- */

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 84px;
  overflow: hidden;
}

.filter-panel .filter-head {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}

.filter-panel .filter-group {
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.filter-panel .filter-group:last-child { border-bottom: 0; }

.filter-panel .form-label {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: .35rem;
}

.filter-panel .form-control,
.filter-panel .form-select {
  border-color: var(--line);
  border-radius: 10px;
  font-size: .88rem;
  padding: .45rem .65rem;
}

.filter-panel .form-control:focus,
.filter-panel .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 78, 121, .12);
}

@media (max-width: 991.98px) {
  .filter-panel { position: static; }
}

/* City tiles ------------------------------------------------------------- */

.city-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .7rem .95rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 500;
  transition: border-color .15s ease, background .15s ease;
}

.city-tile:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.city-tile .n { font-size: .78rem; color: var(--ink-soft); font-weight: 400; }
.city-tile:hover .n { color: var(--brand); }

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

.site-footer {
  background: var(--surface);
  color: var(--ink-soft);
  padding: 3rem 0 1.5rem;
  font-size: .875rem;
  border-top: 1px solid var(--line);
}

.site-footer h6 {
  color: var(--ink);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: .85rem;
}

.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--brand); }

.site-footer .brand-mark { color: var(--ink); }

.footer-social { display: flex; gap: .5rem; }
.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-tint);
  color: var(--brand) !important;
  transition: background .15s ease, color .15s ease;
}
.footer-social a:hover { background: var(--brand); color: #fff !important; }

.footer-base {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding-top: 1.15rem;
  font-size: .82rem;
  color: var(--ink-soft);
}

.footer-disclaimer { color: var(--ink-soft); line-height: 1.6; border-top: 1px solid var(--line); padding-top: 1.25rem; }

/* Floating widgets (scroll-to-top / WhatsApp) ----------------------------- */

.floating-widget-btn {
  position: fixed;
  right: 1.25rem;
  z-index: 1030;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  transition: transform .15s ease, opacity .15s ease;
}
.floating-widget-btn:hover { transform: translateY(-2px); }

.scroll-top-btn {
  bottom: 1.25rem;
  background: var(--brand);
  color: #fff;
  opacity: 0;
  pointer-events: none;
}
.scroll-top-btn.visible { opacity: 1; pointer-events: auto; }

.whatsapp-float-btn {
  bottom: 5.25rem;
  background: #25d366;
  color: #fff;
}

@media (max-width: 576px) {
  .floating-widget-btn { right: .85rem; width: 42px; height: 42px; font-size: 1.05rem; }
  .scroll-top-btn { bottom: .85rem; }
  .whatsapp-float-btn { bottom: 4.5rem; }
}

/* Empty state ------------------------------------------------------------ */

.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* Responsive tweaks ------------------------------------------------------ */

@media (max-width: 575.98px) {
  /* Three stats in a two-column grid leave a dead cell; let the last one span. */
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip .stat:last-child { grid-column: 1 / -1; }

  .hero { padding: 2.25rem 0 2rem; }
  .section { padding: 2.25rem 0; }
  .avatar-lg { width: 78px; height: 78px; flex-basis: 78px; font-size: 1.5rem; }
  .panel > .panel-body { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lawyer-card { transition: none; }
  .lawyer-card:hover { transform: none; }
}

::-webkit-scrollbar {
    width: 4px;
    height: 5px;
    border-radius: 34px;
    background: #edeef2;
}
::-webkit-scrollbar-thumb {
    background-color: #1F4E79;
    border-radius: 34px;
}
::-webkit-scrollbar-track {
    border-radius: 30px;
    background: #edeef2;
}