/* ==========================================================================
   Doctor Directory — Front-end styles
   ========================================================================== */
:root {
  --dd-navy: #1c3a5e;
  --dd-navy-dark: #16304e;
  --dd-text: #2d3748;
  --dd-muted: #718096;
  --dd-border: #e2e8f0;
  --dd-bg-card: #ffffff;
  --dd-radius: 6px;
  --dd-shadow: 0 2px 10px rgba(0,0,0,0.08);
  --dd-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.dd-archive-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.dd-archive-title {
  text-align: center;
  font-size: 28px;
  margin-bottom: 32px;
  color: var(--dd-text);
}

/* ==========================================================================
   GRID
   ========================================================================== */
.dd-grid {
  width: 100%;
}

.dd-grid-cards {
  display: grid;
  grid-template-columns: repeat(var(--dd-cols, 4), 1fr);
  gap: 24px;
}

.dd-grid[data-columns="3"] .dd-grid-cards { --dd-cols: 3; }
.dd-grid[data-columns="4"] .dd-grid-cards { --dd-cols: 4; }
.dd-grid[data-columns="2"] .dd-grid-cards { --dd-cols: 2; }

@media (max-width: 1024px) {
  .dd-grid-cards { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
  .dd-grid-cards { grid-template-columns: 1fr !important; }
}

.dd-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 50px 20px;
  color: var(--dd-muted);
  font-family: var(--dd-font);
}

.dd-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  color: var(--dd-muted);
  font-family: var(--dd-font);
}

.dd-grid-count {
  text-align: center;
  color: var(--dd-muted) !important;
  font-size: 13.5px !important;
  font-weight: 600;
  margin: 0 0 18px !important;
  font-family: var(--dd-font);
}

.dd-card {
  background: var(--dd-bg-card);
  border: 1px solid var(--dd-border);
  border-radius: var(--dd-radius);
  box-shadow: var(--dd-shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--dd-font);
  display: flex;
  flex-direction: column;
  animation: dd-fade-in 0.35s ease both;
}

@keyframes dd-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dd-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

/* Bulletproof image fill: position:absolute + !important guards against
   theme stylesheets that set a global `img { height: auto }` rule, which
   would otherwise leave a blank gap below the image inside this fixed-ratio box. */
.dd-card-photo {
  width: 100%;
  aspect-ratio: 1/1;
  background: #dbe4ee;
  overflow: hidden;
  position: relative !important;
}

.dd-card-photo img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: top center !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.dd-card-photo.dd-no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c93ad;
  font-size: 42px;
  font-weight: 700;
}

.dd-card-body {
  padding: 16px 14px 20px;
  text-align: center;
}

.dd-card-name {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--dd-text);
  margin: 0 0 8px;
  letter-spacing: 0.01em;
}

.dd-card-line {
  font-size: 13.5px;
  color: var(--dd-muted);
  line-height: 1.6;
  margin: 0;
}

.dd-card-btn {
  margin-top: 14px;
  width: 100%;
  height: 38px;
  border: 1.5px solid var(--dd-navy);
  background: #fff;
  color: var(--dd-navy);
  border-radius: var(--dd-radius);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--dd-font);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dd-card-btn:hover {
  background: var(--dd-navy);
  color: #fff;
}

/* ==========================================================================
   SEARCH WIDGET
   ========================================================================== */
.dd-search-wrap {
  max-width: 900px;
  margin: 0 auto 32px;
  font-family: var(--dd-font);
}

.dd-search-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dd-search-input-wrap {
  position: relative;
  flex: 1 1 260px;
  display: flex;
  align-items: center;
}

.dd-search-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
  display: flex;
}

.dd-search-input {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--dd-border);
  border-radius: var(--dd-radius);
  padding: 0 40px 0 40px;
  font-size: 14.5px;
  color: var(--dd-text);
  font-family: var(--dd-font);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dd-search-input:focus {
  outline: none;
  border-color: #4a7bb5;
  box-shadow: 0 0 0 3px rgba(74,123,181,0.15);
}

.dd-search-clear {
  position: absolute;
  right: 10px;
  width: 26px;
  height: 26px;
  border: none;
  background: #eef2f7;
  color: #64748b;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

.dd-search-clear:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.dd-search-clear.dd-visible {
  display: flex;
}

.dd-search-department {
  height: 48px;
  border: 1.5px solid var(--dd-border);
  border-radius: var(--dd-radius);
  padding: 0 36px 0 14px;
  font-size: 14.5px;
  color: var(--dd-text);
  font-family: var(--dd-font);
  background: #fff url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4L6 8L10 4' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  appearance: none;
  cursor: pointer;
  flex: 0 0 220px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dd-search-department:focus {
  outline: none;
  border-color: #4a7bb5;
  box-shadow: 0 0 0 3px rgba(74,123,181,0.15);
}

.dd-search-results {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.dd-search-results:empty {
  display: none;
}

@media (max-width: 1024px) {
  .dd-search-results { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .dd-search-results { grid-template-columns: 1fr; }
  .dd-search-department { flex: 1 1 100%; }
}

.dd-search-hint {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--dd-muted);
  padding: 30px 20px;
  font-size: 14px;
}

.dd-search-spinner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 20px;
  color: var(--dd-muted);
  font-size: 14px;
}

.dd-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #cbd5e1;
  border-top-color: #4a7bb5;
  border-radius: 50%;
  animation: dd-spin 0.7s linear infinite;
}

@keyframes dd-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.dd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 30, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 20px;
}

.dd-modal-overlay.dd-open {
  display: flex;
}

.dd-modal {
  background: var(--dd-navy);
  color: #fff;
  width: 100%;
  max-width: 980px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.35);
  font-family: var(--dd-font);
}

.dd-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: var(--dd-navy);
  border: none;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.dd-modal-close:hover {
  background: #e8edf3;
}

.dd-bio-wrap {
  display: flex;
  gap: 40px;
  padding: 44px;
  flex-wrap: wrap;
}

.dd-bio-photo-col {
  flex: 0 0 260px;
}

.dd-bio-photo {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 8px;
  overflow: hidden;
  background: #294b73;
  position: relative !important;
}

.dd-bio-photo img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.dd-bio-photo.dd-no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 700;
  color: #7fa0c9;
}

.dd-bio-caption {
  margin-top: 14px;
  padding-left: 12px;
  border-left: 3px solid #4a7bb5;
  font-style: italic;
  color: #e3edf7 !important;
  font-size: 14px;
}

.dd-bio-info-col {
  flex: 1 1 380px;
  min-width: 260px;
}

.dd-bio-name {
  font-size: 30px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 18px;
  letter-spacing: 0.01em;
  color: #ffffff !important;
}

.dd-bio-line {
  font-size: 15px;
  line-height: 1.9;
  color: #f4f8fc !important;
}

.dd-bio-line strong {
  color: #ffffff !important;
  font-weight: 700;
}

.dd-bio-specialities-title {
  margin: 24px 0 10px;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #ffffff !important;
}

.dd-bio-specialities-list {
  margin: 0;
  padding-left: 20px;
}

.dd-bio-specialities-list li {
  font-size: 14.5px;
  line-height: 1.8;
  color: #f4f8fc !important;
}

.dd-bio-content {
  margin-top: 20px;
  font-size: 14.5px;
  line-height: 1.8;
  color: #f4f8fc !important;
}

.dd-bio-content p {
  margin: 0 0 12px;
  color: #f4f8fc !important;
}

@media (max-width: 640px) {
  .dd-bio-wrap {
    padding: 28px 20px;
  }
  .dd-bio-photo-col {
    flex: 1 1 100%;
    max-width: 220px;
    margin: 0 auto;
  }
}
