:root {
  --directory-navy: #10233f;
  --directory-ink: #122033;
  --directory-muted: #66758c;
  --directory-line: rgba(17, 34, 63, 0.1);
  --directory-surface: #ffffff;
  --directory-surface-soft: #f6f8fc;
  --directory-accent: #0a78ff;
  --directory-accent-deep: #0754c8;
  --directory-success: #0f9d7a;
  --directory-shadow: 0 28px 90px rgba(16, 35, 63, 0.12);
  --directory-radius-lg: 28px;
  --directory-radius-md: 20px;
  --directory-radius-sm: 14px;
}

/* ============================================================
   Directory hero
   Replaces the old two-column hero, whose 9.4ch headline cap forced a 4.8rem
   serif title into five lines beside two mostly-empty cards. Single centred
   band instead, on the same tokens as the business listing page so the two
   surfaces read as one product.
============================================================ */

.dir-hero {
  --dh-brand: #2f68e6;
  --dh-brand-deep: #1e4bb8;
  --dh-brand-ink: #12306f;
  --dh-brand-wash: #eef3fe;
  --dh-ink: #0b1533;
  --dh-muted: #6b7590;
  --dh-line: #e4e9f4;
  --dh-surface: #ffffff;

  position: relative;
  isolation: isolate;
  margin: 18px 0 8px;
  padding: 76px 0 78px;
  border-radius: 28px;
  overflow: hidden;
}

[data-theme="dark"] .dir-hero {
  --dh-brand: #5b93ff;
  --dh-brand-ink: #a8c6ff;
  --dh-brand-wash: #14243f;
  --dh-ink: #eaf0fa;
  --dh-muted: #8c9ab6;
  --dh-line: #22304a;
  --dh-surface: #101a2b;
}

/* soft mesh + masked grid, same language as the listing page CTA band */
.dir-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(90% 120% at 12% 0%, rgba(47, 104, 230, .13), transparent 55%),
    radial-gradient(80% 110% at 92% 8%, rgba(111, 75, 216, .12), transparent 55%),
    linear-gradient(180deg, #ffffff, #f5f8fe);
}
[data-theme="dark"] .dir-hero-bg {
  background:
    radial-gradient(90% 120% at 12% 0%, rgba(91, 147, 255, .16), transparent 55%),
    radial-gradient(80% 110% at 92% 8%, rgba(111, 75, 216, .18), transparent 55%),
    linear-gradient(180deg, #0e1726, #0b1320);
}
.dir-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(11, 21, 51, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 21, 51, .05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 70% at 50% 0%, #000, transparent 76%);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 0%, #000, transparent 76%);
}
[data-theme="dark"] .dir-hero-bg::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
}

.dir-hero-inner { text-align: center; }

.dir-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--dh-brand-wash);
  border: 1px solid color-mix(in srgb, var(--dh-brand) 18%, transparent);
  color: var(--dh-brand-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
[data-theme="dark"] .dir-eyebrow { color: var(--dh-brand-ink); }
.dir-eyebrow i { font-size: 12px; }

.dir-hero h1 {
  margin: 22px auto 16px;
  max-width: 17ch;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.035em;
  color: var(--dh-ink);
}
.dir-hero > .dir-hero-inner > p {
  margin: 0 auto;
  max-width: 60ch;
  font-size: 17px;
  line-height: 1.68;
  color: var(--dh-muted);
}

.dir-hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.dir-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 26px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.01em;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.dir-btn--primary {
  background: var(--dh-brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(47, 104, 230, .3);
}
.dir-btn--primary:hover {
  background: var(--dh-brand-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(47, 104, 230, .38);
}
.dir-btn--soft {
  background: var(--dh-surface);
  color: var(--dh-ink);
  border-color: var(--dh-line);
  box-shadow: 0 1px 2px rgba(11, 21, 51, .04), 0 8px 20px rgba(11, 21, 51, .05);
}
.dir-btn--soft:hover { border-color: var(--dh-brand); color: var(--dh-brand); transform: translateY(-2px); }

@media (max-width: 860px) {
  .dir-hero { padding: 54px 0 56px; margin-top: 12px; border-radius: 22px; }
  .dir-hero-actions { flex-direction: column; align-items: stretch; }
  .dir-btn { justify-content: center; }
}

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

body.directory-body,
body.profile-body,
.directory-page,
.profile-page {
  background:
    radial-gradient(circle at top right, rgba(47, 104, 230, 0.08), transparent 20%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 48%, #f7f9fd 100%);
}

.directory-shell,
.profile-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.directory-search-panel,
.profile-card,
.profile-panel {
  border: 1px solid var(--directory-line);
  box-shadow: var(--directory-shadow);
}

.profile-panel-header span,
.profile-eyebrow,
.directory-toolbar-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 800;
}

.profile-identity-copy h1 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.04em;
}

.profile-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.directory-primary-button,
.directory-ghost-button,
.profile-primary-action,
.profile-secondary-action,
.profile-directory-link,
.directory-card-link {
  appearance: none;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.directory-primary-button,
.profile-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--directory-accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 16px 30px rgba(10, 120, 255, 0.18);
}

.directory-primary-button {
  background: var(--directory-accent);
  color: #fff;
  box-shadow: 0 16px 30px rgba(10, 120, 255, 0.24);
}

.directory-ghost-button,
.profile-secondary-action,
.profile-directory-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(16, 35, 63, 0.1);
  color: var(--directory-ink);
  font-weight: 700;
}

.directory-ghost-button {
  background: var(--directory-surface);
  border: 1px solid var(--directory-line);
  color: var(--directory-ink);
}

.directory-primary-button:hover,
.directory-ghost-button:hover,
.profile-primary-action:hover,
.profile-secondary-action:hover,
.profile-directory-link:hover,
.directory-card-link:hover {
  transform: translateY(-1px);
}

.directory-search-section {
  padding: 0 0 70px;
}

.directory-search-panel {
  padding: 26px;
  border-radius: var(--directory-radius-lg);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
}

.directory-form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.directory-form-grid label {
  display: grid;
  gap: 9px;
  font-size: 13px;
  color: var(--directory-muted);
  font-weight: 700;
}

.directory-form-grid input {
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(16, 35, 63, 0.1);
  background: #fff;
  padding: 0 16px;
  font: inherit;
  color: var(--directory-ink);
  outline: none;
}

.directory-form-grid input:focus {
  border-color: rgba(10, 120, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(10, 120, 255, 0.1);
}

.directory-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.directory-results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 28px 0 18px;
}

.directory-results-toolbar h2,
.profile-panel-header h2 {
  font-family: "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.03em;
  color: var(--directory-navy);
}

.directory-results-toolbar h2 {
  margin-top: 4px;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
}

.directory-results-meta {
  color: var(--directory-muted);
  font-weight: 600;
}

.directory-message,
.profile-message {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--directory-line);
  color: var(--directory-ink);
}

.directory-message.is-error,
.profile-message.is-error {
  background: #fff4f4;
  border-color: rgba(216, 46, 46, 0.18);
  color: #921d1d;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.directory-card {
  display: grid;
  grid-template-rows: 196px 1fr;
  overflow: hidden;
  border-radius: var(--directory-radius-lg);
  background: var(--directory-surface);
  border: 1px solid var(--directory-line);
  box-shadow: var(--directory-shadow);
}

.directory-card-cover {
  position: relative;
  background:
    linear-gradient(180deg, rgba(47, 104, 230, 0.08), rgba(17, 34, 63, 0.28)),
    linear-gradient(135deg, #edf4ff, #dce9ff);
}

.directory-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.directory-card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 25%, rgba(13, 28, 54, 0.18) 100%);
}

.directory-card-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 1;
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--directory-accent-deep);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.directory-card-logo {
  position: absolute;
  left: 18px;
  bottom: -32px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 18px 34px rgba(10, 22, 41, 0.18);
  overflow: hidden;
}

.directory-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.directory-card-logo-image {
  display: block;
}

.directory-card-logo-fallback {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--directory-navy);
}

.directory-card-body {
  display: flex;
  flex-direction: column;
  padding: 42px 22px 22px;
}

/* Info block takes the slack so the CTA sits on the card floor — buttons stay
   level across a row even when one business writes more About copy than another. */
.directory-card-info { flex: 1; min-width: 0; }

.directory-card-body h3 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--directory-navy);
}

.directory-card-location {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--directory-muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.directory-card-location i { margin-top: 3px; color: var(--directory-accent); font-size: 13px; }

/* Exactly two lines, ellipsised. min-height reserves the same space whether the
   copy runs to one line or twenty, so cards in a row stay visually level. */
.directory-card-about {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 12px 0 0;
  min-height: 2.9em;
  color: var(--directory-muted);
  font-size: 14.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.profile-chip-row,
.profile-contact-list,
.profile-hours-list,
.profile-social-list {
  display: grid;
  gap: 12px;
}

.profile-chip,
.profile-contact-item,
.profile-hours-item,
.profile-social-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.directory-card-link {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #2f68e6;
  color: #fff;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -.01em;
  box-shadow: 0 4px 14px rgba(47, 104, 230, .26);
}

.directory-card-link:hover {
  background: #1e4bb8;
  color: #fff;
}

.directory-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.profile-page {
  padding: 24px 0 72px;
}

.profile-card {
  overflow: hidden;
  border-radius: 32px;
  background: #fff;
  position: relative;
}

.profile-cover {
  position: relative;
  min-height: 280px;
  padding: 34px;
  background:
    radial-gradient(circle at top right, rgba(47, 104, 230, 0.12), transparent 20%),
    linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.profile-cover.has-image {
  background-size: cover;
  background-position: center;
}

.profile-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.16) 100%);
}

.profile-cover-content {
  position: relative;
  z-index: 1;
  min-height: 100%;
}

.profile-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-badge {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(47, 104, 230, 0.08);
  border: 1px solid rgba(47, 104, 230, 0.12);
  color: var(--directory-accent-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-logo-anchor {
  position: relative;
  z-index: 3;
  height: 0;
  padding-left: 28px;
}

.profile-logo-wrap {
  width: 112px;
  height: 112px;
  border-radius: 28px;
  background: #fff;
  overflow: hidden;
  border: 6px solid #fff;
  box-shadow: 0 24px 44px rgba(5, 17, 37, 0.18);
  flex-shrink: 0;
  transform: translateY(-56px);
}

.profile-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-logo-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--directory-navy);
}

.profile-identity-copy {
  color: var(--directory-ink);
  display: grid;
  gap: 8px;
}

.profile-eyebrow {
  color: #5f6f89;
}

.profile-identity-meta {
  margin-top: 8px;
  text-transform: none;
  letter-spacing: normal;
  font-size: 15px;
  font-weight: 600;
  color: #5f6f89;
}

.profile-identity-copy h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.04;
  color: #162033;
}

.profile-identity-copy p {
  max-width: 54ch;
  color: #5f6f89;
  font-size: 17px;
  line-height: 1.65;
}

.profile-intro-panel {
  padding: 28px;
  margin-top: 0;
  position: relative;
  z-index: 2;
  min-height: 320px;
}

.profile-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(290px, 0.9fr);
  gap: 26px;
  padding: 18px 28px 28px;
  border-top: 1px solid rgba(16, 35, 63, 0.08);
}

.profile-main-column,
.profile-side-column {
  display: grid;
  gap: 22px;
  align-content: start;
}

.profile-panel {
  padding: 24px;
  border-radius: 24px;
  background: #fff;
}

.profile-panel-header {
  margin-bottom: 18px;
}

.profile-panel-header span {
  color: var(--directory-accent-deep);
}

.profile-panel-header h2 {
  margin-top: 6px;
  font-size: 1.5rem;
}

.profile-story-panel p,
.profile-service-card p,
.profile-contact-item small,
.profile-hours-item small {
  color: var(--directory-muted);
  line-height: 1.7;
}

.profile-chip-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 22px;
}

.profile-chip {
  min-height: 60px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--directory-surface-soft);
  color: var(--directory-ink);
  font-weight: 700;
}

.profile-chip strong,
.profile-contact-item strong,
.profile-hours-item strong {
  display: block;
  color: var(--directory-navy);
}

.profile-service-grid,
.profile-gallery-grid {
  display: grid;
  gap: 16px;
}

.profile-service-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.profile-service-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  border: 1px solid rgba(16, 35, 63, 0.08);
}

.profile-service-card h3 {
  margin-bottom: 10px;
  color: var(--directory-navy);
  font-size: 1.05rem;
}

.profile-gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.profile-gallery-item {
  overflow: hidden;
  border-radius: 22px;
  background: var(--directory-surface-soft);
  border: 1px solid rgba(16, 35, 63, 0.08);
}

.profile-gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.profile-gallery-item div {
  padding: 14px 16px 16px;
}

.profile-gallery-item strong {
  color: var(--directory-navy);
}

.profile-contact-item,
.profile-hours-item,
.profile-social-link {
  padding: 16px;
  border-radius: 18px;
  background: var(--directory-surface-soft);
  border: 1px solid rgba(16, 35, 63, 0.08);
}

.profile-contact-item a,
.profile-social-link {
  color: var(--directory-accent-deep);
  text-decoration: none;
  font-weight: 700;
}

.profile-social-link {
  justify-content: space-between;
}

.profile-social-link:hover {
  background: #eef5ff;
}

.profile-empty-copy {
  color: var(--directory-muted);
}

.profile-owner-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(10, 120, 255, 0.18);
  border-radius: 18px;
  background: #f4f9ff;
  box-shadow: 0 16px 40px rgba(16, 35, 63, 0.08);
}

.profile-owner-actions[hidden] {
  display: none;
}

.profile-owner-actions strong,
.profile-owner-actions span {
  display: block;
}

.profile-owner-actions strong {
  color: var(--directory-navy);
  font-weight: 800;
}

.profile-owner-actions span {
  margin-top: 4px;
  color: var(--directory-muted);
}

.profile-owner-action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 1080px) {
  .directory-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .directory-grid,
  .profile-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .directory-search-panel,
  .profile-cover,
  .profile-panel,
  .profile-main-grid {
    padding-left: 20px;
    padding-right: 20px;
  }

  .directory-shell,
  .profile-shell {
    width: min(1180px, calc(100% - 20px));
  }

  .directory-form-grid {
    grid-template-columns: 1fr;
  }

  .directory-form-actions,
  .directory-results-toolbar,
  .profile-identity,
  .profile-badge-row,
  .profile-owner-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .directory-grid {
    grid-template-columns: 1fr;
  }

  .profile-cover {
    min-height: 240px;
    padding-top: 24px;
  }

  .profile-logo-anchor {
    padding-left: 20px;
  }

  .profile-logo-wrap {
    width: 92px;
    height: 92px;
    transform: translateY(-46px);
  }

  .profile-main-grid {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .profile-intro-panel {
    min-height: auto;
  }
}
