/**
 * Pilbe Agent Profile (Claimed) — Phase 9b Phase 1
 * Implements SKILL §4.5 layout for /agents/{id}/{slug}/ pages where
 * _pilbe_profile_status is anything other than 'unclaimed'.
 * (URL migrated from /agency/{slug}/ in Phase 9c-1 via Path A.)
 *
 * Token-only colour references. No hardcoded hex outside pilbe-tokens.css.
 *
 * @package Pilbe
 * @version 1.0.0
 */

/* ──────────────────────────────────────────────────────────────────
   Hero C dim strip (SKILL §3.6)
   ────────────────────────────────────────────────────────────────── */

.pilbe-agency-hero-strip {
  height: 120px;
  background: var(--pilbe-bg-sidebar);
  position: relative;
  overflow: hidden;
}

.pilbe-agency-hero-strip::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.0) 0%,
    rgba(15, 23, 42, 0.55) 100%
  );
  pointer-events: none;
}

/* ──────────────────────────────────────────────────────────────────
   Breadcrumbs (SKILL §3.9)
   ────────────────────────────────────────────────────────────────── */

.pilbe-breadcrumbs {
  height: 40px;
  display: flex;
  align-items: center;
  gap: var(--pilbe-space-2);
  padding: 0 var(--pilbe-space-4);
  background: var(--pilbe-bg-subtle);
  border-bottom: 1px solid var(--pilbe-border-default);
  font-family: var(--pilbe-font);
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--pilbe-text-secondary);
}

.pilbe-breadcrumbs__inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--pilbe-space-2);
  flex-wrap: wrap;
}

.pilbe-breadcrumbs a {
  color: var(--pilbe-text-secondary);
  text-decoration: none;
  transition: color 200ms ease;
}

.pilbe-breadcrumbs a:hover {
  color: var(--pilbe-brand-700);
  text-decoration: underline;
}

.pilbe-breadcrumbs__sep {
  color: var(--pilbe-text-muted);
  user-select: none;
}

.pilbe-breadcrumbs__current {
  color: var(--pilbe-text-primary);
  font-weight: 700;
}

.pilbe-breadcrumbs__locality {
  color: var(--pilbe-text-secondary);
}

/* ──────────────────────────────────────────────────────────────────
   Page wrapper
   ────────────────────────────────────────────────────────────────── */

.pilbe-agency-page {
  background: var(--pilbe-bg-page);
  padding: 0 0 var(--pilbe-space-16);
  min-height: 60vh;
}

.pilbe-agency-page__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--pilbe-space-4);
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

/* ──────────────────────────────────────────────────────────────────
   Hero card
   ────────────────────────────────────────────────────────────────── */

.pilbe-agency-hero__body {
  padding: var(--pilbe-space-8);
  display: flex;
  flex-direction: column;
  gap: var(--pilbe-space-3);
}

.pilbe-agency-hero__name {
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-h1);
  line-height: var(--pilbe-lh-h1);
  font-weight: 700;
  color: var(--pilbe-text-primary);
  margin: 0;
}

.pilbe-agency-hero__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--pilbe-space-2);
}

.pilbe-agency-hero__address {
  display: flex;
  align-items: center;
  gap: var(--pilbe-space-2);
  margin: 0;
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-base);
  line-height: var(--pilbe-lh-base);
  color: var(--pilbe-text-secondary);
}

.pilbe-agency-hero__address svg {
  flex: 0 0 auto;
  color: var(--pilbe-text-muted);
}

.pilbe-agency-hero__count {
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-base);
  line-height: var(--pilbe-lh-base);
  margin: 0;
}

.pilbe-agency-hero__count a {
  color: var(--pilbe-text-link);
  font-weight: 700;
  text-decoration: none;
}

.pilbe-agency-hero__count a:hover {
  color: var(--pilbe-brand-700);
  text-decoration: underline;
}

.pilbe-agency-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--pilbe-space-3);
  margin-top: var(--pilbe-space-4);
}

@media (max-width: 767px) {
  .pilbe-agency-hero__body {
    padding: var(--pilbe-space-5);
  }
  .pilbe-agency-hero__name {
    font-size: 28px;
    line-height: 36px;
  }
}

/* ──────────────────────────────────────────────────────────────────
   Pills (SKILL §3.x — pill-shaped, Lato 700, uppercase, tracking 0.04em)
   ────────────────────────────────────────────────────────────────── */

.pilbe-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--pilbe-space-1);
  padding: 4px 10px;
  border-radius: var(--pilbe-radius-pill);
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-xs);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pilbe-pill--founder {
  background: var(--pilbe-brand-500);
  color: var(--pilbe-text-inverse);
}

.pilbe-pill--founder::before {
  content: '★';
  font-size: 10px;
  margin-right: 2px;
  letter-spacing: 0;
}

.pilbe-pill--partner {
  background: var(--pilbe-brand-500);
  color: var(--pilbe-text-inverse);
}

.pilbe-pill--success {
  background: var(--pilbe-success-50);
  color: var(--pilbe-success-700);
}

/* Verified pill: a stronger treatment of the green success pill so the
   owner-attested status is visually distinct from the Sales/Lettings
   informational pills which share the success-50 background. */
.pilbe-pill--verified {
  background: var(--pilbe-success-700);
  color: var(--pilbe-text-inverse);
  border: 1px solid var(--pilbe-success-700);
}

.pilbe-pill--info {
  background: var(--pilbe-brand-50);
  color: var(--pilbe-brand-700);
}

.pilbe-pill--neutral {
  background: var(--pilbe-neutral-100);
  color: var(--pilbe-neutral-700);
}

.pilbe-pill__check {
  font-size: 10px;
  letter-spacing: 0;
}

/* ──────────────────────────────────────────────────────────────────
   Buttons
   ────────────────────────────────────────────────────────────────── */

.pilbe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--pilbe-space-2);
  padding: 12px 20px;
  border-radius: var(--pilbe-radius-md);
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-base);
  line-height: 1;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
  min-height: 44px;
}

.pilbe-btn:focus-visible {
  outline: none;
  box-shadow: var(--pilbe-shadow-focus);
}

.pilbe-btn--gradient {
  background: var(--pilbe-gradient);
  color: var(--pilbe-text-inverse);
}

.pilbe-btn--gradient:hover {
  background: var(--pilbe-gradient-hover);
  transform: translateY(-1px);
  box-shadow: var(--pilbe-shadow-md);
}

.pilbe-btn--ghost {
  background: transparent;
  color: var(--pilbe-text-primary);
  border-color: var(--pilbe-border-strong);
}

.pilbe-btn--ghost:hover {
  background: var(--pilbe-bg-subtle);
  border-color: var(--pilbe-text-secondary);
}

.pilbe-btn--secondary {
  background: var(--pilbe-brand-500);
  color: var(--pilbe-text-inverse);
}

.pilbe-btn--secondary:hover {
  background: var(--pilbe-brand-700);
  transform: translateY(-1px);
}

.pilbe-btn--sm {
  padding: 8px 14px;
  font-size: var(--pilbe-text-sm);
  min-height: 36px;
}

/* ──────────────────────────────────────────────────────────────────
   Dual feature-card row (Market Appraisal + Contact Agent)
   ────────────────────────────────────────────────────────────────── */

.pilbe-agency-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--pilbe-space-4);
  margin-top: var(--pilbe-space-6);
}

.pilbe-feature-card {
  display: flex;
  align-items: flex-start;
  gap: var(--pilbe-space-4);
  padding: var(--pilbe-space-6);
  text-decoration: none;
  position: relative;
}

.pilbe-feature-card__icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: var(--pilbe-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pilbe-text-inverse);
}

.pilbe-feature-card--gradient {
  background: var(--pilbe-brand-50);
}

.pilbe-feature-card--gradient .pilbe-feature-card__icon {
  background: var(--pilbe-gradient);
}

.pilbe-feature-card--light {
  background: var(--pilbe-bg-surface);
}

.pilbe-feature-card--light .pilbe-feature-card__icon {
  background: var(--pilbe-neutral-900);
}

.pilbe-feature-card__body {
  flex: 1 1 auto;
}

.pilbe-feature-card__title {
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-h4);
  line-height: var(--pilbe-lh-h4);
  font-weight: 700;
  color: var(--pilbe-text-primary);
  margin: 0 0 var(--pilbe-space-1);
}

.pilbe-feature-card__sub {
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-sm);
  line-height: var(--pilbe-lh-sm);
  color: var(--pilbe-text-secondary);
  margin: 0;
}

.pilbe-feature-card__arrow {
  flex: 0 0 auto;
  font-size: 24px;
  color: var(--pilbe-text-primary);
  align-self: center;
  line-height: 1;
}

@media (max-width: 767px) {
  .pilbe-agency-features {
    grid-template-columns: 1fr;
  }
}

/* ──────────────────────────────────────────────────────────────────
   Two-column layout (main 60% / sidebar 40%)
   ────────────────────────────────────────────────────────────────── */

.pilbe-agency-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: var(--pilbe-space-6);
  margin-top: var(--pilbe-space-6);
}

.pilbe-agency-main {
  display: flex;
  flex-direction: column;
  gap: var(--pilbe-space-6);
  min-width: 0;
}

.pilbe-agency-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--pilbe-space-4);
  position: sticky;
  top: 88px;
  align-self: start;
}

@media (max-width: 1199px) {
  .pilbe-agency-layout {
    grid-template-columns: 1fr;
  }
  .pilbe-agency-sidebar {
    position: static;
  }
}

/* ──────────────────────────────────────────────────────────────────
   Active Listings card
   ────────────────────────────────────────────────────────────────── */

.pilbe-listings-card .pilbe-card__header {
  flex-wrap: wrap;
  row-gap: var(--pilbe-space-3);
}

.pilbe-listings-tabs {
  display: flex;
  gap: var(--pilbe-space-2);
  flex-wrap: wrap;
}

.pilbe-listings-tabs__tab {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--pilbe-radius-pill);
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-sm);
  line-height: 1;
  font-weight: 700;
  color: var(--pilbe-text-secondary);
  background: transparent;
  text-decoration: none;
  border: 1px solid var(--pilbe-border-default);
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.pilbe-listings-tabs__tab:hover {
  color: var(--pilbe-brand-700);
  border-color: var(--pilbe-brand-500);
}

.pilbe-listings-tabs__tab.is-active {
  color: var(--pilbe-text-inverse);
  background: var(--pilbe-brand-500);
  border-color: var(--pilbe-brand-500);
}

.pilbe-listing-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pilbe-listing-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  gap: var(--pilbe-space-4);
  align-items: center;
  padding: var(--pilbe-space-4) 0;
  border-bottom: 1px solid var(--pilbe-border-default);
}

.pilbe-listing-row:last-child {
  border-bottom: 0;
}

.pilbe-listing-row__thumb {
  display: block;
  width: 100px;
  height: 80px;
  border-radius: var(--pilbe-radius-md);
  overflow: hidden;
  background: var(--pilbe-neutral-100);
}

.pilbe-listing-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pilbe-listing-row__body {
  min-width: 0;
}

.pilbe-listing-row__title {
  display: block;
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-base);
  line-height: var(--pilbe-lh-base);
  font-weight: 700;
  color: var(--pilbe-text-primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pilbe-listing-row__title:hover {
  color: var(--pilbe-brand-700);
  text-decoration: underline;
}

.pilbe-listing-row__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--pilbe-space-1);
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

.pilbe-listing-row__pills li {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--pilbe-radius-pill);
  background: var(--pilbe-neutral-100);
  color: var(--pilbe-neutral-700);
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-xs);
  line-height: 1.4;
  font-weight: 400;
}

.pilbe-listing-row__date {
  margin: 4px 0 0;
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-xs);
  line-height: var(--pilbe-lh-xs);
  color: var(--pilbe-text-muted);
}

.pilbe-listing-row__price {
  font-family: var(--pilbe-font);
  font-size: 20px;
  line-height: 26px;
  font-weight: 700;
  color: var(--pilbe-text-primary);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  text-align: right;
  white-space: nowrap;
}

.pilbe-listing-row__price .price {
  font-weight: 700;
}

@media (max-width: 600px) {
  .pilbe-listing-row {
    grid-template-columns: 88px minmax(0, 1fr);
    grid-template-areas:
      "thumb body"
      "price price";
  }
  .pilbe-listing-row__thumb { grid-area: thumb; width: 88px; height: 70px; }
  .pilbe-listing-row__body  { grid-area: body; }
  .pilbe-listing-row__price { grid-area: price; text-align: left; padding-top: var(--pilbe-space-2); }
}

/* Empty state inside cards */
.pilbe-empty {
  margin: 0;
  padding: var(--pilbe-space-6) 0;
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-base);
  color: var(--pilbe-text-secondary);
  text-align: center;
}

/* ──────────────────────────────────────────────────────────────────
   Office Location card
   ────────────────────────────────────────────────────────────────── */

.pilbe-office-card__map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--pilbe-neutral-100);
}

.pilbe-office-card__map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pilbe-office-card__address {
  position: absolute;
  bottom: var(--pilbe-space-3);
  left: var(--pilbe-space-3);
  display: flex;
  align-items: center;
  gap: var(--pilbe-space-2);
  background: var(--pilbe-bg-surface);
  padding: var(--pilbe-space-2) var(--pilbe-space-3);
  border-radius: var(--pilbe-radius-md);
  box-shadow: var(--pilbe-shadow-md);
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-sm);
  line-height: var(--pilbe-lh-sm);
  font-weight: 700;
  color: var(--pilbe-text-primary);
  max-width: calc(100% - var(--pilbe-space-6));
}

.pilbe-office-card__address svg {
  flex: 0 0 auto;
  color: var(--pilbe-brand-500);
}

/* ──────────────────────────────────────────────────────────────────
   About card (with truncation)
   ────────────────────────────────────────────────────────────────── */

.pilbe-about-card__text {
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-base);
  line-height: var(--pilbe-lh-base);
  color: var(--pilbe-text-primary);
}

.pilbe-about-card__text p {
  margin: 0 0 var(--pilbe-space-3);
}

.pilbe-about-card__text.is-truncated {
  max-height: 12em;
  overflow: hidden;
  position: relative;
}

.pilbe-about-card__text.is-truncated::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 4em;
  background: linear-gradient(to bottom, transparent, var(--pilbe-bg-surface));
  pointer-events: none;
}

.pilbe-about-card__text.is-expanded {
  max-height: none;
}

.pilbe-about-card__text.is-expanded::after {
  display: none;
}

.pilbe-about-card__toggle {
  margin-top: var(--pilbe-space-3);
  background: transparent;
  border: 0;
  padding: 0;
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-base);
  font-weight: 700;
  color: var(--pilbe-brand-600);
  cursor: pointer;
}

.pilbe-about-card__toggle:hover {
  color: var(--pilbe-brand-700);
  text-decoration: underline;
}

/* ──────────────────────────────────────────────────────────────────
   Sidebar — Performance card uses .pilbe-card-stats from cards.css
   Sidebar — Nearby Agents card
   ────────────────────────────────────────────────────────────────── */

.pilbe-nearby-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--pilbe-space-3);
}

.pilbe-nearby-row {
  margin: 0;
}

.pilbe-nearby-row a {
  display: flex;
  align-items: center;
  gap: var(--pilbe-space-3);
  text-decoration: none;
  padding: var(--pilbe-space-2);
  border-radius: var(--pilbe-radius-md);
  transition: background 200ms ease;
}

.pilbe-nearby-row a:hover {
  background: var(--pilbe-bg-subtle);
}

.pilbe-nearby-row__logo {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: var(--pilbe-radius-md);
  background: var(--pilbe-bg-sidebar);
  color: var(--pilbe-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--pilbe-font);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pilbe-nearby-row__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pilbe-nearby-row__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pilbe-nearby-row__name {
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-sm);
  line-height: var(--pilbe-lh-sm);
  font-weight: 700;
  color: var(--pilbe-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pilbe-nearby-row__locality {
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-xs);
  line-height: var(--pilbe-lh-xs);
  color: var(--pilbe-text-secondary);
}

.pilbe-nearby-row__count {
  flex: 0 0 auto;
  margin-left: auto;
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-xs);
  line-height: var(--pilbe-lh-xs);
  color: var(--pilbe-brand-500);
  font-weight: 700;
  white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────────────
   Sidebar — Quick Links card
   ────────────────────────────────────────────────────────────────── */

.pilbe-quicklinks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--pilbe-space-2);
}

.pilbe-quicklinks li {
  margin: 0;
}

.pilbe-quicklinks a {
  display: flex;
  align-items: center;
  gap: var(--pilbe-space-2);
  font-family: var(--pilbe-font);
  font-size: var(--pilbe-text-sm);
  line-height: var(--pilbe-lh-sm);
  color: var(--pilbe-text-primary);
  text-decoration: none;
  padding: 6px 0;
}

.pilbe-quicklinks a:hover {
  color: var(--pilbe-brand-700);
  text-decoration: underline;
}

.pilbe-quicklinks__arrow {
  flex: 0 0 auto;
  color: var(--pilbe-brand-500);
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
}

/* ──────────────────────────────────────────────────────────────────
   Section spacing inside main column
   ────────────────────────────────────────────────────────────────── */

.pilbe-agency-main > .pilbe-card__title,
.pilbe-agency-sidebar .pilbe-card__title {
  margin-bottom: var(--pilbe-space-3);
}

.pilbe-agency-sidebar .pilbe-card__body {
  padding-top: var(--pilbe-space-3);
}
