/* Doctor Directory and Profile Page Stylesheet */

/* ==========================================================================
   1. Listing Page (/doctors) Grid & Cards
   ========================================================================== */

.doctor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

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

.doctor-card {
  display: flex;
  align-items: flex-start;
  padding: 1.25rem;
  background: var(--doc-gray-5);
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  color: var(--doc-blue-1);
  text-decoration: none;
  font-family: var(--font-inter);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--box-shadow-4);
  position: relative;
  overflow: hidden;
}

.doctor-card:hover {
  background: var(--doc-blue-3);
  border-color: var(--doc-blue-2);
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--box-shadow-hover);
}

.doctor-card-avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 1.25rem;
  flex-shrink: 0;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.doctor-card-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doctor-card-details {
  flex-grow: 1;
  min-width: 0;
  padding-right: 0.75rem;
}

.doctor-card-name {
  font-size: 1.1rem;
  color: var(--doc-blue-1);
  font-family: var(--font-ubuntu);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.doctor-card-specialty {
  font-size: 0.85rem;
  color: var(--doc-blue-2);
  font-weight: 600;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doctor-card-credentials {
  font-size: 0.8rem;
  color: var(--doc-gray-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doctor-card-arrow {
  font-size: 1.2rem;
  color: var(--doc-blue-2);
  font-weight: 700;
  transition: transform 0.25s ease;
  margin-left: auto;
  line-height: 1;
}

.doctor-card:hover .doctor-card-arrow {
  transform: translateX(4px);
}


/* ==========================================================================
   2. Detail Page (/doctors/dr-slug) Profile Box & Meta Cards
   ========================================================================== */

.doctor-overview-box {
  background-color: var(--doc-blue-3);
  border-radius: var(--doc-radius);
  padding: 2.25rem;
  display: flex;
  align-items: flex-start;
  gap: 2.25rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(79, 157, 212, 0.15);
  box-shadow: 0 4px 20px rgba(79, 157, 212, 0.04);
}

@media (max-width: 991px) {
  .doctor-overview-box {
    gap: 1.75rem;
    padding: 1.75rem;
  }
}

@media (max-width: 1024px) {
  .doctor-overview-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .doctor-overview-avatar-wrap {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    margin-bottom: 0.5rem;
  }
}

.doctor-overview-avatar-wrap {
  width: 30%;
  aspect-ratio: 1 / 1;
  border-radius: var(--doc-radius);
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.doctor-overview-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doctor-overview-info {
  flex-grow: 1;
  width: 100%;
}


.doctor-meta-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .doctor-meta-cards {
    text-align: left;
  }
}

@media (max-width: 600px) {
  .doctor-meta-cards {
    grid-template-columns: 1fr;
  }
}

.doctor-meta-card {
  background: #ffffff;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius-s);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.doctor-meta-card.span-2 {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .doctor-meta-card.span-2 {
    grid-column: span 1;
  }
}

.doctor-meta-card-label {
  font-size: var(--font-size-sm);
  color: var(--doc-gray-2);
  font-family: var(--font-inter);
  margin-bottom: 0.5rem;
}

.doctor-meta-card-value {
  font-size: 1rem;
  line-height: 1.45;
  font-family: var(--font-ubuntu);
}

/* Scrollspy Anchor Target Margin Fix */
.medical-section[id^="section-"] {
  scroll-margin-top: 100px;
}

/* Sidebar Narrow Index override for doctor archive page */
@media (min-width: 768px) {
  .page-template-page-doctors .product-content-nav.aside-nav.sidebar,
  .post-type-archive-doc_author .product-content-nav.aside-nav.sidebar {
    flex-basis: min-content !important;
  }

  .page-template-page-doctors .product-content.with-sidebar,
  .post-type-archive-doc_author .product-content.with-sidebar {
    flex-basis: auto !important;
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }
}

/* Clear search button styling */
.search-clear-btn {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--doc-gray-3);
  cursor: pointer;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.search-clear-btn:hover {
  color: var(--doc-red-1);
}

/* Search Input Focus override */
#doctor-search:focus {
  border-color: var(--doc-blue-2) !important;
  box-shadow: 0 0 0 3px rgba(79, 157, 212, 0.12) !important;
}