/* Darwesh Group -- Professional Network (build.html / renovate.html
   shared shell around js/provider-discovery.js's mountProfessionalNetwork).
   PRESENTATION LAYER ONLY -- see js/provider-discovery.js for the engine
   this skins (query/pagination/role filtering/URL state all untouched by
   this pass). Same Spatial Graphite / Liquid Glass environment as
   Property Discovery (css/property-discovery.css, css/cinematic.css's
   glass-light / glass-spatial / glass-hero levels) -- one operating
   system, two layouts.

   GRID DENSITY. mountProviderDiscovery() owns the actual grid element
   (shared, unchanged, with service.html) so this file never touches its
   base `.ps-grid` class -- mountProfessionalNetwork() instead tags that
   element from the outside with a `.pn-grid` class + `data-density`
   attribute (see applyDensityToGrids() in js/provider-discovery.js),
   which is what every selector below actually targets. 4 columns is the
   default/base card design; [data-density="3"]/"5" carry the deltas. */

.cine-scope .pn-hero {
  max-width: 1280px; margin-inline: auto;
  padding-block: clamp(2rem, 4.2vw, 3rem) 0.25rem;
  padding-inline: 20px;
  text-align: center;
}
.cine-scope .pn-eyebrow {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cine-gold-1, var(--ps-color-secondary, #B49A6A));
  margin-bottom: 8px;
}
.cine-scope .pn-headline {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(32px, 3.4vw, 46px); font-weight: 700; line-height: 1.08;
  color: var(--ps-color-on-surface);
  text-wrap: balance;
  margin-bottom: 8px;
}
.cine-scope .pn-subhead {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px; color: var(--ps-color-on-surface-variant);
  max-width: 48ch; margin-inline: auto;
}
.cine-scope .pn-mode-row { display: flex; justify-content: center; margin-top: 18px; }
.cine-scope .pn-cta-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; }
.cine-scope .pn-cta-link {
  font-family: 'Inter', system-ui, sans-serif; font-size: 13px; font-weight: 600;
  color: var(--ps-color-on-surface-variant); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ps-color-outline-variant);
  transition: color var(--motion-fast,180ms) var(--ease-premium,ease);
}
.cine-scope .pn-cta-link:hover { color: var(--cine-gold-1, var(--ps-color-secondary, #B49A6A)); }
.cine-scope .pn-body { max-width: 1280px; margin: 22px auto 0; padding-inline: 20px; padding-bottom: 56px; }

/* View Density sits directly above the provider-filter toolbar
 * (mountProviderDiscovery()'s own `.svc-toolbar`, first child of
 * #pnInner) so it reads as a property of these results, not a second
 * nav control competing with the mode selector above it. */
.cine-scope .pn-toolbar-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }

/* ---- Redesigned provider card -- see professionalNetworkCard() in
 * js/provider-discovery.js. A fixed-size floating avatar tile instead of
 * a full-width 16:9 media block: the median provider has no photo, and a
 * small tinted glyph tile reads as an intentional, finished design in
 * that case, where a giant empty rectangle read as broken. The card
 * itself is a real Liquid Glass surface (`.glass-spatial`, applied in
 * markup) rather than a flat panel. Base rules below are the 4-column/
 * Balanced card -- the new Darwesh default. ---- */
.cine-scope .pn-card {
  position: relative;
  display: flex; flex-direction: column; gap: 9px;
  /* Grid items default to min-width:auto, which floors their width at
   * their content's min-content size -- and a white-space:nowrap name
   * (see .pn-card-name below) has no soft wrap points, so its min-content
   * equals its full unwrapped width. Without this, an unusually long
   * provider/company name silently grows the card (and the whole grid
   * track, and the page) past the viewport instead of truncating. */
  min-width: 0;
  border-radius: 19px;
  padding: 13px;
  transition: transform 180ms cubic-bezier(.2,.8,.2,1), box-shadow 180ms cubic-bezier(.2,.8,.2,1), border-color 180ms cubic-bezier(.2,.8,.2,1);
}
.cine-scope .pn-card:hover, .cine-scope .pn-card:focus-visible {
  transform: translateY(-2px); outline: none;
  border-block-start-color: rgba(255, 255, 255, 0.26);
}
.cine-scope .pn-card-top { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.cine-scope .pn-avatar {
  position: relative; z-index: 2;
  flex: none; width: 48px; height: 48px; border-radius: 13px;
  background-size: cover; background-position: center;
  background-color: var(--ps-color-surface-container);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.cine-scope .pn-avatar--fallback {
  display: flex; align-items: center; justify-content: center;
  background-image: linear-gradient(160deg, rgba(180,154,106,0.22), rgba(180,154,106,0.06));
  border-color: rgba(180,154,106,0.34);
}
.cine-scope .pn-avatar--fallback .dw-icon { font-size: 21px; color: var(--cine-gold-1, #B49A6A); }
.cine-scope .pn-card-id { min-width: 0; flex: 1 1 auto; }
.cine-scope .pn-card-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cine-scope .pn-card-name { font-family: 'Inter', system-ui, sans-serif; font-size: 14.5px; font-weight: 600; color: var(--ps-color-on-surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cine-scope .pn-badge {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--cine-gold-1, #B49A6A);
  background-image: linear-gradient(180deg, rgba(180,154,106,0.26), rgba(180,154,106,0.09));
  backdrop-filter: blur(12px) saturate(115%); -webkit-backdrop-filter: blur(12px) saturate(115%);
  border: 1px solid rgba(180,154,106,0.34);
  border-radius: 999px; padding: 2px 6px;
}
.cine-scope .pn-card-role {
  font-family: 'Inter', system-ui, sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--cine-gold-1, #B49A6A); margin-top: 2px;
}
.cine-scope .pn-card-place { display: flex; align-items: center; gap: 3px; font-family: 'Inter', system-ui, sans-serif; font-size: 11.5px; color: var(--ps-color-on-surface-variant); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cine-scope .pn-card-place .dw-icon { flex: none; }
.cine-scope .pn-card-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 9px; border-block-start: 1px solid rgba(255,255,255,0.08); }
.cine-scope .pn-years { font-family: 'Inter', system-ui, sans-serif; font-size: 11.5px; color: var(--ps-color-on-surface-variant); }
.cine-scope .pn-card-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cine-scope .pn-chips-full { display: flex; flex-wrap: wrap; gap: 5px; }
.cine-scope .pn-chip-summary {
  display: none;
  font-size: 10px; font-weight: 600; color: var(--ps-color-on-surface-variant);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px; padding: 3px 8px;
}
.cine-scope .pn-chip {
  font-size: 10.5px; font-weight: 500; color: var(--ps-color-on-surface-variant);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px; padding: 3px 8px;
}
.cine-scope .pn-card-main {
  display: flex; flex-direction: column; gap: inherit;
  color: inherit; text-decoration: none; min-width: 0;
}
.cine-scope .pn-card-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-top: 2px;
}
.cine-scope .pn-card-cta {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: 'Inter', system-ui, sans-serif; font-size: 12px; font-weight: 600;
  color: var(--ps-color-secondary);
  text-decoration: none;
  transition: color 160ms cubic-bezier(.2,.8,.2,1);
}
.cine-scope .pn-card:hover .pn-card-cta,
.cine-scope .pn-card-cta:hover { color: var(--cine-gold-1, #B49A6A); }
.cine-scope .pn-card-request {
  display: inline-flex; align-items: center;
  min-height: 32px; padding: 0 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--cine-gold-1, #B49A6A) 38%, transparent);
  background: color-mix(in srgb, var(--cine-gold-1, #B49A6A) 10%, transparent);
  font-family: 'Inter', system-ui, sans-serif; font-size: 11.5px; font-weight: 600;
  color: var(--ps-color-on-surface);
  text-decoration: none;
  transition: background 160ms cubic-bezier(.2,.8,.2,1), border-color 160ms cubic-bezier(.2,.8,.2,1), transform 160ms cubic-bezier(.2,.8,.2,1);
}
.cine-scope .pn-card-request:hover {
  border-color: color-mix(in srgb, var(--cine-gold-1, #B49A6A) 55%, transparent);
  background: color-mix(in srgb, var(--cine-gold-1, #B49A6A) 16%, transparent);
}
.cine-scope .pn-card-request:active { transform: scale(.98); }
.cine-scope .pn-card-cta:focus-visible,
.cine-scope .pn-card-request:focus-visible,
.cine-scope .pn-card-main:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--cine-gold-1, #B49A6A) 55%, transparent);
  outline-offset: 2px;
}
[dir="rtl"] .cine-scope .pn-card-cta .dw-icon { transform: scaleX(-1); }

/* ---- Grid column counts. Explicit at every tier (not relying on
 * .ps-grid's own auto-fit) so mobile/tablet/desktop density is
 * deterministic and matches Property Discovery's behavior exactly. ---- */
@media (max-width: 639px) {
  .cine-scope .pn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cine-scope .pn-grid[data-mobile-density="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
}
@media (max-width: 374px) {
  .cine-scope .pn-grid[data-mobile-density="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (min-width: 640px) and (max-width: 1199px) {
  .cine-scope .pn-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1200px) {
  .cine-scope .pn-grid[data-density="3"] { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .cine-scope .pn-grid[data-density="4"] { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .cine-scope .pn-grid[data-density="5"] { grid-template-columns: repeat(5, 1fr); gap: 14px; }
}

/* ---- Density 3 -- Spacious: closer to the original card this system
 * launched with. ---- */
@media (min-width: 1200px) {
  .cine-scope .pn-grid[data-density="3"] .pn-card { padding: 16px; gap: 12px; border-radius: 20px; }
  .cine-scope .pn-grid[data-density="3"] .pn-card-top { gap: 12px; }
  .cine-scope .pn-grid[data-density="3"] .pn-avatar { width: 56px; height: 56px; border-radius: 15px; }
  .cine-scope .pn-grid[data-density="3"] .pn-avatar--fallback .dw-icon { font-size: 24px; }
  .cine-scope .pn-grid[data-density="3"] .pn-card-name { font-size: 15.5px; }
  .cine-scope .pn-grid[data-density="3"] .pn-card-role { font-size: 11.5px; }
  .cine-scope .pn-grid[data-density="3"] .pn-card-place { font-size: 12px; }
  .cine-scope .pn-grid[data-density="3"] .pn-card-foot { padding-top: 11px; gap: 7px; }
  .cine-scope .pn-grid[data-density="3"] .pn-chip { font-size: 11px; padding: 3px 9px; }
  .cine-scope .pn-grid[data-density="3"] .pn-card-cta { font-size: 12.5px; }
}

/* ---- Density 5 -- Compact: smaller avatar, tighter spacing, role capped
 * to 2 lines so an unusually long title can't blow out the card, chips
 * shrink further. View Profile always stays visible -- nothing here is
 * ever removed, only compressed. ---- */
@media (min-width: 1200px) {
  .cine-scope .pn-grid[data-density="5"] .pn-card { padding: 10px; gap: 7px; border-radius: 17px; }
  .cine-scope .pn-grid[data-density="5"] .pn-card-top { gap: 8px; }
  .cine-scope .pn-grid[data-density="5"] .pn-avatar { width: 40px; height: 40px; border-radius: 11px; }
  .cine-scope .pn-grid[data-density="5"] .pn-avatar--fallback .dw-icon { font-size: 18px; }
  .cine-scope .pn-grid[data-density="5"] .pn-card-name { font-size: 13px; }
  .cine-scope .pn-grid[data-density="5"] .pn-badge { font-size: 8.5px; padding: 1px 5px; }
  .cine-scope .pn-grid[data-density="5"] .pn-card-role {
    font-size: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .cine-scope .pn-grid[data-density="5"] .pn-card-place { font-size: 10.5px; }
  .cine-scope .pn-grid[data-density="5"] .pn-card-foot { padding-top: 7px; gap: 5px; }
  .cine-scope .pn-grid[data-density="5"] .pn-years { font-size: 10.5px; }
  .cine-scope .pn-grid[data-density="5"] .pn-chip { font-size: 9.5px; padding: 2px 6px; }
  .cine-scope .pn-grid[data-density="5"] .pn-card-cta { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .cine-scope .pn-card, .cine-scope .pn-card-cta { transition: none; }
}

@media (max-width: 767px) {
  .cine-scope .pn-hero { padding-block: 1.35rem 0.2rem; padding-inline: 20px; }
  .cine-scope .pn-eyebrow { font-size: 10.5px; margin-bottom: 6px; }
  .cine-scope .pn-headline { font-size: clamp(30px, 8vw, 34px); line-height: 1.08; margin-bottom: 8px; }
  .cine-scope .pn-subhead { font-size: 14.5px; }
  .cine-scope .pn-mode-row { margin-top: 16px; }
  .cine-scope .pn-cta-row { margin-top: 14px; gap: 6px 16px; }
  .cine-scope .pn-body { margin-top: 18px; padding-inline: 16px; padding-bottom: 40px; }
  .cine-scope .pn-card:hover, .cine-scope .pn-card:focus-visible { transform: none; }
}

/* ---- True mobile (<640px): 2-column default / 3-column Compact, both a
 * full re-proportion of the card (not a scaled-down desktop card). Mirrors
 * the same pattern used in css/property-discovery.css's mobile block --
 * see js/provider-discovery.js's readPnMobileDensity()/#pnMobileDensitySwitch.
 * Never removes data (specialties/city/experience/View Profile all stay),
 * only re-presents it at a size that fits a compact directory tile. ---- */
@media (max-width: 639px) {
  .cine-scope .pn-toolbar-row { gap: 8px; }
  .cine-scope .pn-card {
    padding: 10px; gap: 7px; border-radius: 16px;
  }
  .cine-scope .pn-card-top { gap: 8px; }
  .cine-scope .pn-avatar { width: 44px; height: 44px; border-radius: 12px; }
  .cine-scope .pn-avatar--fallback .dw-icon { font-size: 19px; }
  .cine-scope .pn-card-name {
    font-size: 13px; font-weight: 600;
    white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .cine-scope .pn-badge { font-size: 8.5px; padding: 1px 5px; }
  .cine-scope .pn-card-role {
    font-size: 10.5px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .cine-scope .pn-card-place { font-size: 10.5px; }
  .cine-scope .pn-card-foot { padding-top: 7px; gap: 5px; }
  .cine-scope .pn-years { font-size: 10px; }
  /* Mobile 2-col shows at most 2 specialty chips -- data isn't removed
   * (chipsFull still holds every specialty), only capped for this tile size. */
  .cine-scope .pn-chips-full .pn-chip:nth-child(n+3) { display: none; }
  .cine-scope .pn-chip { font-size: 9.5px; padding: 2px 7px; }
  .cine-scope .pn-card-cta { font-size: 11px; }

  /* Compact (3-col): even tighter, chips collapse to a "+N skills" summary
   * so a full chip row never has to squeeze into a ~110px-wide card. */
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-card { padding: 8px; gap: 6px; border-radius: 14px; }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-card-top { gap: 6px; }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-avatar { width: 36px; height: 36px; border-radius: 10px; }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-avatar--fallback .dw-icon { font-size: 16px; }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-card-name { font-size: 11.5px; }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-badge {
    font-size: 0; padding: 3px; gap: 0; border-radius: 999px;
  }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-badge .dw-icon { font-size: 11px; }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-card-role { font-size: 9.5px; -webkit-line-clamp: 2; }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-card-place { font-size: 9.5px; }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-card-foot { padding-top: 6px; gap: 4px; }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-years { font-size: 9px; }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-card-cta { font-size: 10px; }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-chips-full { display: none; }
  .cine-scope .pn-grid[data-mobile-density="3"] .pn-chip-summary { display: inline-flex; }
}
