/* ==========================================================================
  Doctor Cards v2  Medikom/Cleveland-style premium grid
  Iter 4: rating stars, review count, experience, languages, clinic, CTA.
  Tokens: var(--ds-brand), var(--ds-line), var(--ds-text-primary), etc.
  ========================================================================== */

/* --- Grid ----------------------------------------------------------------- */
.dc2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 28px;
  margin: 32px 0 16px;
}

@media (min-width: 768px) {
  .dc2-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .dc2-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Card container ------------------------------------------------------- */
.dc2-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--ds-line, rgba(15, 38, 60, .08));
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 38, 60, .05);
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
  display: flex;
  flex-direction: column;
}

.dc2-card:hover {
  box-shadow: 0 12px 32px rgba(15, 38, 60, .12);
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary-color, #09CA8F) 40%, transparent);
}

/* Full-card click: name-link absolutely covers card; specific CTA buttons stay above */
.dc2-card__name-link::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.dc2-card__actions,
.dc2-card__actions * { position: relative; z-index: 2; }

/* Focus ring on the whole card when the name-link is keyboard-focused */
.dc2-card:has(.dc2-card__name-link:focus-visible) {
  outline: 3px solid var(--primary-color, #09CA8F);
  outline-offset: 3px;
}
.dc2-card__name-link:focus-visible { outline: none; }

/* --- Photo area ----------------------------------------------------------- */
.dc2-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #edf1f4;
  overflow: hidden;
}

.dc2-card__img-link {
  display: block;
  width: 100%;
  height: 100%;
}

.dc2-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .35s ease;
}

.dc2-card:hover .dc2-card__img {
  transform: scale(1.04);
}

/* Placeholder when no photo  compact, no giant blank space */
.dc2-card__img-link--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f8f2 0%, #d3efe8 100%);
  width: 100%;
  height: 100%;
  /* Override aspect-ratio with a fixed max height for placeholder cards */
  min-height: 140px;
  max-height: 220px;
}

/* When the card has no real image, reduce the media area height */
.dc2-card:has(.dc2-card__img-link--placeholder) .dc2-card__media {
  aspect-ratio: unset;
  height: 160px;
}

@media (max-width: 599px) {
  .dc2-card:has(.dc2-card__img-link--placeholder) .dc2-card__media {
    height: 110px;
  }
}

.dc2-card__img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-brand, #09ca8f);
  opacity: .45;
}

@media (max-width: 599px) {
  .dc2-card__img-placeholder svg {
    width: 36px;
    height: 36px;
  }
}

/* "New doctor" badge */
.dc2-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  line-height: 1.4;
}

.dc2-badge--new {
  background: rgba(255, 255, 255, .92);
  color: var(--ds-brand, #09ca8f);
  border: 1px solid color-mix(in srgb, var(--ds-brand, #09ca8f) 30%, transparent);
  backdrop-filter: blur(4px);
}

/* --- Body ----------------------------------------------------------------- */
.dc2-card__body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

/* Name */
.dc2-card__name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 4px;
  letter-spacing: -.2px;
  color: var(--ds-text-primary, #1d1d1f);
}

.dc2-card__name-link {
  color: inherit;
  text-decoration: none;
  transition: color .15s ease;
}

.dc2-card__name-link:hover {
  color: var(--ds-brand, #09ca8f);
}

/* Specialty */
.dc2-card__specialty {
  font-size: 13px;
  font-weight: 600;
  color: var(--ds-brand, #09ca8f);
  margin: 0 0 12px;
  line-height: 1.4;
}

/* --- Rating row ----------------------------------------------------------- */
.dc2-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.dc2-rating__stars {
  display: flex;
  align-items: center;
  gap: 1px;
  color: #f5a623;
}

.dc2-star {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.dc2-star--full {
  fill: currentColor;
  stroke: none;
}

.dc2-star--half {
  stroke: currentColor;
  stroke-width: 1px;
}

.dc2-star--empty {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2px;
  opacity: .35;
}

.dc2-rating__score {
  font-size: 14px;
  font-weight: 700;
  color: var(--ds-text-primary, #1d1d1f);
  letter-spacing: -.2px;
  line-height: 1;
}

.dc2-rating__count {
  font-size: 12px;
  color: var(--ds-text-muted, #6e6e73);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s ease;
}

.dc2-rating__count:hover {
  color: var(--ds-brand, #09ca8f);
}

.dc2-rating__no-reviews {
  font-size: 12px;
  color: var(--ds-text-muted, #6e6e73);
  font-style: italic;
}

/* --- Meta list ------------------------------------------------------------ */
.dc2-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 18px;
  padding: 0;
}

.dc2-meta__row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.dc2-meta__icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--ds-text-muted, #6e6e73);
}

.dc2-meta__val {
  font-size: 13px;
  color: var(--ds-text-primary, #1d1d1f);
  line-height: 1.45;
  margin: 0;
}

.dc2-meta__val--muted {
  color: var(--ds-text-muted, #6e6e73);
  font-style: italic;
}

/* Languages flags row */
.dc2-meta__langs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dc2-lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ds-text-primary, #1d1d1f);
  background: #f5f5f7;
  border: 1px solid var(--ds-line, rgba(15, 38, 60, .08));
  border-radius: 5px;
  padding: 2px 6px;
  line-height: 1.4;
}

/* --- CTA buttons ---------------------------------------------------------- */
.dc2-card__actions {
  display: flex;
  gap: 9px;
  margin-top: auto;
}

.dc2-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
  white-space: nowrap;
}

.dc2-btn--primary {
  background: var(--ds-brand, #09ca8f);
  color: #fff;
  border: 1.5px solid var(--ds-brand, #09ca8f);
}

.dc2-btn--primary:hover {
  background: color-mix(in srgb, var(--ds-brand, #09ca8f) 85%, #000);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgba(9, 202, 143, .5);
  color: #fff;
}

.dc2-btn--ghost {
  background: transparent;
  color: var(--ds-brand, #09ca8f);
  border: 1.5px solid color-mix(in srgb, var(--ds-brand, #09ca8f) 28%, transparent);
}

.dc2-btn--ghost:hover {
  background: color-mix(in srgb, var(--ds-brand, #09ca8f) 7%, transparent);
  border-color: var(--ds-brand, #09ca8f);
}

/* --- Methodology note below grid ------------------------------------------ */
.dc2-methodology-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 28px;
  font-size: 13px;
  color: var(--ds-text-muted, #6e6e73);
}

.dc2-methodology-note svg {
  flex-shrink: 0;
  color: var(--ds-text-muted, #6e6e73);
}

.dc2-methodology-note a {
  color: var(--ds-text-muted, #6e6e73);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .15s ease;
}

.dc2-methodology-note a:hover {
  color: var(--ds-brand, #09ca8f);
}

/* --- Archive hero subtitle ------------------------------------------------ */
.archive-hero__sub {
  font-size: 16px;
  color: var(--ds-text-muted, #6e6e73);
  margin: -4px 0 0;
  max-width: 560px;
  line-height: 1.6;
}

/* --- Mobile adjustments --------------------------------------------------- */

/* xs: 2 columns, compact cards */
@media (max-width: 599px) {
  .dc2-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0 12px;
  }

  /* Photo: keep 4:5 ratio for real photos, but cap height */
  .dc2-card__media {
    aspect-ratio: 4 / 5;
    max-height: 200px;
  }

  .dc2-card__body {
    padding: 12px 12px 14px;
    gap: 0;
  }

  .dc2-card__name {
    font-size: 14px;
    margin-bottom: 2px;
  }

  .dc2-card__specialty {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .dc2-rating {
    gap: 3px;
    margin-bottom: 10px;
    flex-wrap: wrap;
  }

  .dc2-star {
    width: 12px;
    height: 12px;
  }

  .dc2-rating__score {
    font-size: 12px;
  }

  .dc2-rating__count,
  .dc2-rating__no-reviews {
    font-size: 11px;
  }

  .dc2-meta {
    gap: 5px;
    margin-bottom: 12px;
  }

  .dc2-meta__val {
    font-size: 12px;
  }

  .dc2-meta__icon {
    width: 12px;
    height: 12px;
  }

  .dc2-lang {
    font-size: 11px;
    padding: 1px 5px;
  }

  .dc2-card__actions {
    flex-direction: column;
    gap: 6px;
  }

  .dc2-btn {
    flex: unset;
    width: 100%;
    padding: 9px 12px;
    font-size: 12px;
  }

  .dc2-badge {
    font-size: 10px;
    padding: 2px 7px;
  }
}

/* sm: 2 columns slightly larger */
@media (min-width: 600px) and (max-width: 767px) {
  .dc2-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}
