/* Directory page - restyles the existing .dir-* components (main.css) to the
   landing look. Scoped under .dirx so nothing else is affected. */

.dirx-hero { padding: 3rem 0 6rem; }
.dirx-hero-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.dirx-h1 { max-width: 820px; font-size: clamp(1.8rem, 6cqi, 3rem); text-wrap: balance; }
.dirx-hero .lp-hero-sub { max-width: 640px; }
body.has-app-sidebar .dirx-hero { padding-top: calc(var(--navbar-h, 72px) + 2rem); }

.dirx-body { padding: 0 0 4rem; background: var(--lp-bg); }
.dirx-body > .lp-wrap { position: relative; }

/* floating control panel overlapping the hero */
.dirx .dir-controls {
    align-items: stretch; max-width: none;
    position: relative; z-index: 2; margin-top: -3.4rem;
    display: flex; flex-direction: column; gap: .9rem;
    padding: 1rem; border-radius: 22px; background: #fff;
    border: 1px solid var(--lp-line); box-shadow: 0 24px 50px -22px rgba(15, 22, 40, .35);
}
.dirx .dir-tabs { align-self: flex-start; display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--lp-bg); border: 0; box-shadow: none; }
.dirx .dir-tab { white-space: nowrap; display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.1rem; border-radius: 999px; border: 0; background: transparent; color: var(--lp-muted); font-family: inherit; font-weight: 800; font-size: .9rem; cursor: pointer; box-shadow: none; }
.dirx .dir-tab:hover { color: var(--lp-text); }
.dirx .dir-tab.active { background: var(--lp-ink); color: #fff; box-shadow: 0 8px 18px -8px rgba(10, 15, 31, .6); }
.dirx .dir-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 .45rem; border-radius: 999px; background: rgba(15, 22, 40, .08); color: inherit; font-size: .72rem; font-weight: 800; }
.dirx .dir-tab.active .dir-tab-count { background: var(--lp-gold); color: #1b1404; }

.dirx .dir-toolbar { display: flex; flex-direction: row; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: stretch; width: 100%; max-width: none; margin: 0; }
.dirx .dir-search { flex: 1 1 260px; display: flex; align-items: center; gap: .6rem; height: 48px; padding: 0 1rem; border-radius: 14px; border: 1.5px solid var(--lp-line); background: #fff; color: var(--lp-muted); }
.dirx .dir-search:focus-within { border-color: var(--lp-brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
.dirx .dir-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-family: inherit; font-size: .95rem; color: var(--lp-text); }
.dirx .dir-filter-select, .dirx .dir-sort-select, .dirx .dir-filter-toggle { height: 48px; border-radius: 14px; border: 1.5px solid var(--lp-line); background: #fff; color: var(--lp-text); font-family: inherit; font-weight: 700; font-size: .9rem; padding: 0 1rem; }
.dirx .dir-filter-toggle { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }
.dirx .dir-filter-toggle.has-active, .dirx .dir-filter-toggle[aria-expanded="true"] { border-color: var(--lp-brand); color: var(--lp-brand); background: #f2f1ff; }
.dirx .dir-filter-badge { background: var(--lp-brand); color: #fff; }
.dirx .dir-filters { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .6rem; padding: 1rem; border-radius: 18px; background: #fff; border: 1px solid var(--lp-line); }
.dirx .dir-filters[hidden] { display: none; }
.dirx .dir-filter-clear { color: var(--lp-brand); font-weight: 800; background: none; border: 0; cursor: pointer; font-family: inherit; }

/* grid + cards */
.dirx .dir-grid { margin-top: 1.5rem; display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.dirx .dir-grid[hidden] { display: none; }
.dirx .dir-card { border-radius: 20px; padding: 1.3rem; border: 1px solid var(--lp-line); box-shadow: var(--lp-shadow); }
.dirx .dir-card::before { height: 4px; background: linear-gradient(90deg, var(--lp-brand), var(--lp-brand-2)); opacity: 1; }
.dirx .dir-card:has(.dir-card-avatar--firm)::before { background: linear-gradient(90deg, #0a0f1f, #3b4a8a); }
.dirx .dir-card:hover { border-color: #b9b4f7; box-shadow: 0 2px 4px rgba(15, 22, 40, .05), 0 26px 50px -18px rgba(15, 22, 40, .22); }
.dirx .dir-card-avatar { width: 56px; height: 56px; background: linear-gradient(135deg, var(--lp-brand), var(--lp-brand-2)); box-shadow: 0 0 0 3px var(--lp-bg); }
.dirx .dir-card-avatar--firm { background: linear-gradient(135deg, #0a0f1f, #3b4a8a); }
.dirx .dir-card-name { font-size: 1rem; color: var(--lp-text); }
.dirx .dir-card-spec { background: rgba(79, 70, 229, .1); color: var(--lp-brand); font-size: .74rem; }
.dirx .dir-card-spec--muted { background: var(--lp-bg); color: var(--lp-muted); }
.dirx .dir-card-meta { border-top-color: var(--lp-line); font-size: .78rem; color: var(--lp-muted); }
.dirx .dir-card-cta { border: 0; background: var(--lp-bg); color: var(--lp-brand); font-size: .82rem; font-weight: 800; padding: .7rem .5rem; }
.dirx .dir-card:hover .dir-card-cta { background: linear-gradient(135deg, var(--lp-brand), var(--lp-brand-2)); color: #fff; }
.dirx .dir-empty { grid-column: 1 / -1; padding: 3rem 1rem; text-align: center; color: var(--lp-muted); background: #fff; border: 1px dashed var(--lp-line); border-radius: 18px; }
#dir-no-results { margin-top: 1.5rem; padding: 2.5rem 1rem; text-align: center; color: var(--lp-muted); background: #fff; border: 1px dashed var(--lp-line); border-radius: 18px; }
#dir-no-results[hidden] { display: none; }

/* pagination */
.dirx .dir-pagination { margin-top: 2.2rem; }
.dirx .dir-page-btn { min-width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--lp-line); font-family: inherit; }
.dirx .dir-page-btn:hover:not(:disabled) { border-color: var(--lp-brand); color: var(--lp-brand); }
.dirx .dir-page-btn.active { background: var(--lp-ink); border-color: var(--lp-ink); color: #fff; }

@container lp (max-width: 520px) {
    .dirx .dir-tabs { align-self: stretch; min-width: 0; }
    .dirx .dir-tab { flex: 1 1 0; min-width: 0; justify-content: center; }
    .dirx .dir-search { flex: 0 0 auto; width: 100%; }
    .dirx .dir-filter-select--primary, .dirx .dir-sort-select { flex: 1 1 calc(50% - .3rem); min-width: 0; }
    .dirx .dir-filter-toggle { flex: 1 1 calc(50% - .3rem); justify-content: center; }
    .dirx .dir-tab { padding-inline: .6rem; font-size: .82rem; }
}

/* ==========================================================================
   Directory cards - two distinct designs
   consultants: portrait card (violet header, big round photo, facts, "ask" button)
   offices:     landscape card (navy, square logo, description, chips, gold arrow)
   ========================================================================== */
.dirx #dir-panel-lawyers { grid-template-columns: repeat(auto-fill, minmax(min(100%, 238px), 1fr)); }
.dirx #dir-panel-companies { grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); }
.dirx .dir-card--lawyer::before, .dirx .dir-card--firm::before { display: none; }

/* ---- consultant ---- */
.dirx .dir-card--lawyer {
    position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: center;
    background: #fff; border: 1px solid var(--lp-line); border-radius: 24px; text-decoration: none; color: var(--lp-text);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.dirx .dir-card--lawyer::after {
    content: ''; display: block; order: -1; height: 92px; flex: none;
    background: radial-gradient(circle at 85% 0, rgba(255, 255, 255, .28), transparent 55%), linear-gradient(135deg, #5b21b6, #8b5cf6 55%, #ec4899);
}
.dirx .dir-card--lawyer:hover { transform: translateY(-4px); border-color: #c4b5fd; box-shadow: 0 24px 46px -18px rgba(109, 40, 217, .4); }
.dirx .dir-card--lawyer .dc-top { position: absolute; top: 12px; inset-inline: 12px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dirx .dc-role { max-width: 100%; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, .2); color: #fff; font-size: .72rem; font-weight: 800; backdrop-filter: blur(6px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dirx .dc-person { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: -46px; padding: 0 16px; position: relative; z-index: 2; }
.dirx .dc-ring { padding: 4px; border-radius: 50%; background: #fff; box-shadow: 0 10px 24px rgba(109, 40, 217, .28); }
.dirx .dc-photo { width: 88px; height: 88px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #6d28d9, #a855f7); color: #fff; }
.dirx .dc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dirx .dc-photo b { font-size: 1.5rem; font-weight: 800; }
.dirx .dc-name { margin: 8px 0 0; font-size: 1.03rem; font-weight: 800; line-height: 1.4; color: var(--lp-text); }
.dirx .dc-spec { margin-top: 2px; padding: 3px 12px; border-radius: 999px; background: rgba(139, 92, 246, .12); color: #6d28d9; font-size: .75rem; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dirx .dc-bio { margin: 6px 0 0; font-size: .8rem; line-height: 1.6; color: var(--lp-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dirx .dc-facts { list-style: none; display: flex; margin: 14px 14px 0; padding: 10px 0; border-block: 1px dashed var(--lp-line); }
.dirx .dc-facts li { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.dirx .dc-facts li + li { border-inline-start: 1px solid var(--lp-line); }
.dirx .dc-facts b { font-size: .88rem; font-weight: 800; color: var(--lp-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dirx .dc-facts small { font-size: .66rem; color: var(--lp-muted); font-weight: 700; }
.dirx .dc-loc { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 10px; font-size: .78rem; color: var(--lp-muted); padding: 0 12px; }
.dirx .dc-cta {
    margin: auto 14px 14px; padding: .8rem 1rem; border-radius: 15px; display: flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(135deg, #6d28d9, #8b5cf6); color: #fff; font-weight: 800; font-size: .86rem; box-shadow: 0 10px 22px -8px rgba(109, 40, 217, .55);
    transition: filter .15s, gap .15s;
}
.dirx .dc-person + .dc-facts, .dirx .dc-person + .dc-loc { margin-top: 14px; }
.dirx .dir-card--lawyer .dc-loc + .dc-cta, .dirx .dir-card--lawyer .dc-facts + .dc-cta, .dirx .dir-card--lawyer .dc-person + .dc-cta { margin-top: 14px; }
.dirx .dir-card--lawyer:hover .dc-cta { filter: brightness(1.08); gap: 12px; }

/* ---- office ---- */
.dirx .dir-card--firm {
    position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 18px 18px 18px 16px; overflow: hidden;
    border: 0; border-radius: 24px; text-decoration: none; color: #fff;
    background: radial-gradient(circle at 100% 0, rgba(251, 191, 36, .16), transparent 45%), linear-gradient(135deg, #0b1226, #15234d 60%, #213a78);
    box-shadow: 0 16px 36px -16px rgba(11, 18, 38, .6); transition: transform .2s, box-shadow .2s;
}
.dirx .dir-card--firm:hover { transform: translateY(-4px); box-shadow: 0 26px 48px -16px rgba(11, 18, 38, .7); }
.dirx .df-logo { width: 84px; height: 84px; border-radius: 22px; background: #fff; display: grid; place-items: center; padding: 9px; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); flex: none; overflow: hidden; }
.dirx .df-logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 10px; }
.dirx .df-logo b { font-size: 1.5rem; font-weight: 800; color: #15234d; }
.dirx .df-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.dirx .df-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.dirx .df-name { margin: 0; font-size: 1.08rem; font-weight: 800; line-height: 1.4; color: #fff; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dirx .df-verified { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fbbf24; color: #1b1404; flex: none; }
.dirx .df-kind { font-size: .78rem; font-weight: 700; color: #a5b4fc; }
.dirx .df-desc { margin: 0; font-size: .82rem; line-height: 1.65; color: #cbd5f5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dirx .df-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.dirx .df-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #e0e7ff; font-size: .74rem; font-weight: 700; }
.dirx .df-chip--price { background: #fbbf24; color: #1b1404; font-weight: 800; }
.dirx .df-go { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 14px; background: #fbbf24; color: #1b1404; font-weight: 800; font-size: .82rem; white-space: nowrap; transition: gap .15s, background .15s; }
.dirx .df-go i { font-style: normal; font-size: 1rem; }
.dirx .dir-card--firm:hover .df-go { gap: 12px; background: #fcd34d; }
html[dir="ltr"] .dirx .dc-cta i, html[dir="ltr"] .dirx .df-go i { display: inline-block; transform: scaleX(-1); }

/* ---- phones ---- */
@media (max-width: 640px) {
  .dirx #dir-panel-lawyers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .dirx #dir-panel-companies { grid-template-columns: 1fr; gap: .8rem; }

  .dirx .dir-card--lawyer { border-radius: 20px; }
  .dirx .dir-card--lawyer::after { height: 72px; }
  .dirx .dc-person { margin-top: -38px; padding: 0 10px; }
  .dirx .dc-photo { width: 70px; height: 70px; }
  .dirx .dc-photo b { font-size: 1.2rem; }
  .dirx .dc-name { font-size: .9rem; }
  .dirx .dc-spec { font-size: .68rem; padding: 3px 9px; }
  .dirx .dc-bio { display: none; }
  .dirx .dc-role { font-size: .65rem; padding: 3px 8px; }
  .dirx .dc-facts { margin: 12px 8px 0; flex-wrap: wrap; row-gap: 8px; }
  .dirx .dc-facts li { flex: 1 1 45%; }
  .dirx .dc-facts li + li { border-inline-start: 0; }
  .dirx .dc-facts b { font-size: .8rem; }
  .dirx .dc-loc { font-size: .7rem; padding: 0 8px; }
  .dirx .dc-cta { margin: auto 10px 10px; padding: .65rem .5rem; font-size: .78rem; border-radius: 13px; }

  .dirx .dir-card--firm { grid-template-columns: auto 1fr; gap: 12px 14px; padding: 14px; border-radius: 20px; }
  .dirx .df-logo { width: 62px; height: 62px; border-radius: 17px; padding: 7px; }
  .dirx .df-name { font-size: .98rem; }
  .dirx .df-desc { -webkit-line-clamp: 2; font-size: .78rem; }
  .dirx .df-go { grid-column: 1 / -1; justify-content: center; width: 100%; padding: 10px 14px; }
}
@media (max-width: 340px) { .dirx #dir-panel-lawyers { grid-template-columns: 1fr; } }

.dirx .df-chip--new { background: rgba(251, 191, 36, .18); color: #fde68a; border: 1px solid rgba(251, 191, 36, .45); }

/* promoted firm: pinned above the grids, ignores tabs/filters/search */
.dir-ad { position: relative; display: flex; align-items: center; gap: 1rem; margin: 0 0 1.1rem; padding: 1rem 1.2rem; border-radius: 20px; border: 1px solid rgba(212,167,58,.6); background: linear-gradient(135deg, rgba(212,167,58,.14), rgba(124,58,237,.06) 70%, transparent); box-shadow: 0 16px 36px -22px rgba(212,167,58,.8); color: inherit; text-decoration: none; transition: transform .2s; }
.dir-ad:hover { transform: translateY(-2px); }
.dir-ad-badge { position: absolute; top: .6rem; inset-inline-end: .8rem; padding: 2px 10px; border-radius: 999px; font-size: .68rem; font-weight: 700; color: #8a6410; background: rgba(212,167,58,.22); }
.dir-ad-logo { flex: none; width: 64px; height: 64px; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: #fff; border: 1px solid rgba(0,0,0,.08); font-size: 1.2rem; }
.dir-ad-logo img { width: 100%; height: 100%; object-fit: contain; }
.dir-ad-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dir-ad-name { font-size: 1.1rem; display: flex; align-items: center; gap: .35rem; }
.dir-ad-sub { font-size: .82rem; opacity: .75; }
.dir-ad-desc { font-size: .84rem; opacity: .8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dir-ad-go { flex: none; font-weight: 700; font-size: .85rem; color: #8a6410; white-space: nowrap; }
@media (max-width: 575px) { .dir-ad { flex-wrap: wrap; padding-top: 1.7rem; } .dir-ad-go { width: 100%; text-align: end; } }

/* mobile: keep both tabs inside their pill (viewport-based; the container query alone missed some widths) */
@media (max-width: 575px) {
    .dirx .dir-tabs { display: flex; align-self: stretch; width: 100%; max-width: 100%; box-sizing: border-box; }
    .dirx .dir-tab { flex: 1 1 0; min-width: 0; justify-content: center; gap: .3rem; padding: .55rem .4rem; font-size: .8rem; }
    .dirx .dir-tab svg { display: none; }
    .dirx .dir-tab > span:not(.dir-tab-count) { overflow: hidden; text-overflow: ellipsis; }
    .dirx .dir-tab-count { min-width: 22px; padding: 0 .35rem; }
}
