/* =============================================================
   Divi Team Pro — Frontend Styles v1.1.0
   Advanced design: no badge, full-bleed photo, minimal body
   ============================================================= */

:root {
  --dtp-navy:        #0a1628;
  --dtp-navy2:       #1a3a6b;
  --dtp-text:        var(--color-text-primary, #1a1a1a);
  --dtp-muted:       var(--color-text-secondary, #6b7280);
  --dtp-bg:          var(--color-background-primary, #fff);
  --dtp-surface:     var(--color-background-secondary, #f7f6f2);
  --dtp-border:      var(--color-border-tertiary, rgba(0,0,0,.08));
  --dtp-border-h:    rgba(0,0,0,.14);
  --dtp-radius:      16px;
  --dtp-transition:  all .22s ease;
}

/* ---------- Wrapper ---------- */
.dtp-wrapper {
  width: 100%;
  font-family: inherit;
  box-sizing: border-box;
  padding: 8px 0 32px;
}

/* ---------- Section header ---------- */
.dtp-section-header { text-align: center; margin-bottom: 36px; }
.dtp-section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--dtp-navy);
  margin: 0 0 10px;
  letter-spacing: -.02em;
}
.dtp-title-line {
  width: 36px; height: 2px;
  background: #185FA5;
  margin: 0 auto;
  border-radius: 1px;
}

/* ---------- Grid ---------- */
.dtp-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(var(--dtp-cols, 3), minmax(0, 1fr));
}
/* Base column classes — use !important so Divi's container width never
   overrides the explicitly requested column count at desktop sizes. */
.dtp-cols-1 { --dtp-cols: 1 !important; }
.dtp-cols-2 { --dtp-cols: 2 !important; }
.dtp-cols-3 { --dtp-cols: 3 !important; }
.dtp-cols-4 { --dtp-cols: 4 !important; }
.dtp-cols-5 { --dtp-cols: 5 !important; }
.dtp-cols-6 { --dtp-cols: 6 !important; }

/* Responsive breakpoints — collapse gracefully on smaller screens.
   Breakpoints are intentionally high because Divi content areas are often
   narrower than the full viewport (sidebar layouts, boxed themes etc.).
   Override order: desktop class wins → tablet collapses → mobile stacks. */
@media (max-width: 1200px) {
  .dtp-cols-6 { --dtp-cols: 4 !important; }
  .dtp-cols-5 { --dtp-cols: 4 !important; }
}
@media (max-width: 900px) {
  .dtp-cols-6 { --dtp-cols: 3 !important; }
  .dtp-cols-5 { --dtp-cols: 3 !important; }
  .dtp-cols-4 { --dtp-cols: 3 !important; }
}
@media (max-width: 680px) {
  .dtp-cols-6,
  .dtp-cols-5,
  .dtp-cols-4,
  .dtp-cols-3 { --dtp-cols: 2 !important; }
}
@media (max-width: 480px) {
  .dtp-grid { --dtp-cols: 1 !important; gap: 14px; }
}

/* ---------- Card ---------- */
.dtp-card {
  background: var(--dtp-bg);
  border: 0.5px solid var(--dtp-border);
  border-radius: var(--dtp-radius);
  overflow: hidden;
  text-align: center;
  transition: var(--dtp-transition);
}
.dtp-card:hover {
  transform: translateY(-5px);
  border-color: var(--dtp-border-h);
}
.dtp-has-popup { cursor: pointer; }

/* ---------- Photo — full-bleed, no badge ---------- */
.dtp-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 3.6;
  overflow: hidden;
  background: #dde2e8;
}
.dtp-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform .38s ease;
}
.dtp-card:hover .dtp-photo { transform: scale(1.04); }

.dtp-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--dtp-navy2), var(--dtp-navy));
  font-size: 3rem;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  letter-spacing: .04em;
}

/* white fade at photo bottom — no overlay badge */
.dtp-photo-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--dtp-bg) 0%, transparent 100%);
  pointer-events: none;
}

/* popup overlay */
.dtp-card-overlay {
  position: absolute; inset: 0;
  background: rgba(10,22,40,.62);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .22s ease;
}
.dtp-has-popup:hover .dtp-card-overlay { opacity: 1; }
.dtp-view-profile {
  color: #fff;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 20px;
  padding: 6px 16px;
  background: rgba(255,255,255,.1);
}

/* ---------- Card body ---------- */
.dtp-card-body {
  padding: 14px 18px 18px;
}

.dtp-name {
  font-size: .93rem;
  font-weight: 500;
  color: var(--dtp-text);
  margin: 0 0 4px;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.dtp-name a { color: inherit; text-decoration: none; transition: color .18s; }
.dtp-name a:hover { color: var(--dtp-navy2); }

/* designation shown as muted subtitle — no pill, no badge */
.dtp-designation {
  display: block;
  font-size: .75rem;
  font-weight: 400;
  color: var(--dtp-muted);
  letter-spacing: .01em;
  margin-bottom: 4px;
  line-height: 1.4;
}

/* sub-text: one line below designation — dept, unit, affiliation */
.dtp-subtext {
  display: block;
  font-size: .72rem;
  font-weight: 400;
  color: var(--dtp-muted);
  letter-spacing: .01em;
  margin-bottom: 10px;
  line-height: 1.4;
  opacity: .8;
}

/* thin rule separator */
.dtp-card-rule {
  width: 32px; height: 1.5px;
  background: var(--dtp-border-h);
  margin: 0 auto 12px;
  border-radius: 1px;
}

.dtp-bio {
  font-size: .78rem;
  color: var(--dtp-muted);
  line-height: 1.55;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ---------- Icon row ---------- */
.dtp-icon-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dtp-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 0.5px solid var(--dtp-border);
  background: var(--dtp-surface);
  color: var(--dtp-muted);
  text-decoration: none;
  transition: var(--dtp-transition);
  flex-shrink: 0;
}
.dtp-icon-btn svg { width: 14px; height: 14px; }
.dtp-icon-btn:hover { transform: scale(1.1); }

.dtp-icon-btn.dtp-ic-webpage:hover,
.dtp-icon-btn.dtp-ic-email:hover    { background: var(--dtp-navy); border-color: var(--dtp-navy); color: #fff; }
.dtp-icon-btn.dtp-social-linkedin:hover   { background: #0077b5; border-color: #0077b5; color: #fff; }
.dtp-icon-btn.dtp-social-twitter:hover    { background: #000;    border-color: #000;    color: #fff; }
.dtp-icon-btn.dtp-social-google_scholar:hover { background: #4285f4; border-color: #4285f4; color: #fff; }
.dtp-icon-btn.dtp-social-researchgate:hover   { background: #00ccbb; border-color: #00ccbb; color: #fff; }
.dtp-icon-btn.dtp-social-github:hover    { background: #24292e; border-color: #24292e; color: #fff; }
.dtp-icon-btn.dtp-social-youtube:hover   { background: #ff0000; border-color: #ff0000; color: #fff; }
.dtp-icon-btn.dtp-social-instagram:hover { background: #c13584; border-color: #c13584; color: #fff; }
.dtp-icon-btn.dtp-social-facebook:hover  { background: #1877f2; border-color: #1877f2; color: #fff; }

/* ---------- Compact layout ---------- */
.dtp-layout-compact .dtp-card { text-align: left; }
.dtp-layout-compact .dtp-card-inner { display: flex; align-items: center; gap: 14px; padding: 14px; }
.dtp-layout-compact .dtp-photo-wrap {
  width: 68px; height: 68px;
  border-radius: 50%;
  aspect-ratio: 1;
  flex-shrink: 0;
}
.dtp-layout-compact .dtp-photo-fade { display: none; }
.dtp-layout-compact .dtp-card-body { padding: 0; }
.dtp-layout-compact .dtp-icon-row { justify-content: flex-start; }
.dtp-layout-compact .dtp-card-rule { margin: 0 0 10px; }

/* ---------- Horizontal layout ---------- */
.dtp-layout-horizontal .dtp-grid { grid-template-columns: 1fr !important; }
.dtp-layout-horizontal .dtp-card { text-align: left; }
.dtp-layout-horizontal .dtp-card-inner { display: flex; }
.dtp-layout-horizontal .dtp-photo-wrap { width: 200px; flex-shrink: 0; aspect-ratio: unset; }
.dtp-layout-horizontal .dtp-photo-fade { display: none; }
.dtp-layout-horizontal .dtp-icon-row { justify-content: flex-start; }
.dtp-layout-horizontal .dtp-card-rule { margin: 0 0 10px; }
@media (max-width: 580px) {
  .dtp-layout-horizontal .dtp-card-inner { flex-direction: column; }
  .dtp-layout-horizontal .dtp-photo-wrap { width: 100%; aspect-ratio: 16/7; }
  .dtp-layout-horizontal .dtp-card { text-align: center; }
  .dtp-layout-horizontal .dtp-icon-row { justify-content: center; }
}

/* ---------- No members ---------- */
.dtp-no-members { color: var(--dtp-muted); font-style: italic; padding: 24px; text-align: center; }

/* =============================================================
   Modal
   ============================================================= */
.dtp-modal-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(10,22,40,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .22s ease;
}
.dtp-modal-overlay:not([hidden]) { opacity: 1; }
.dtp-modal-overlay[hidden] { display: none; }

.dtp-modal {
  background: var(--dtp-bg);
  border-radius: 20px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  position: relative;
  transform: scale(.96) translateY(10px);
  transition: transform .28s cubic-bezier(.34,1.56,.64,1);
  outline: none;
  overscroll-behavior: contain;
  text-align: center;
}
.dtp-modal-overlay:not([hidden]) .dtp-modal { transform: scale(1) translateY(0); }
.dtp-modal::-webkit-scrollbar { width: 4px; }
.dtp-modal::-webkit-scrollbar-thumb { background: var(--dtp-border-h); border-radius: 2px; }

.dtp-modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.12);
  color: #fff; font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--dtp-transition); z-index: 2;
}
.dtp-modal-close:hover { background: rgba(255,255,255,.28); }

.dtp-modal-photo-wrap {
  width: 100%; height: 220px; overflow: hidden;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(150deg, var(--dtp-navy2), var(--dtp-navy));
  position: relative;
}
.dtp-modal-photo { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.dtp-modal-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; font-weight: 500; color: rgba(255,255,255,.7);
}
.dtp-modal-photo-fade {
  position: absolute; bottom: 0; left: 0; right: 0; height: 64px;
  background: linear-gradient(to top, var(--dtp-bg), transparent);
}

.dtp-modal-content { padding: 18px 28px 30px; }
.dtp-modal-name {
  font-size: 1.3rem; font-weight: 500;
  color: var(--dtp-text); margin: 0 0 4px;
  letter-spacing: -.015em;
}
.dtp-modal-designation {
  font-size: .78rem;
  color: var(--dtp-muted);
  margin: 0 0 4px;
  letter-spacing: .01em;
}
.dtp-modal-subtext {
  font-size: .73rem;
  color: var(--dtp-muted);
  margin: 0 0 16px;
  opacity: .8;
  letter-spacing: .01em;
}
.dtp-modal-contact {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 7px;
  margin-bottom: 18px;
}
.dtp-modal-contact-item {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .76rem; color: var(--dtp-muted);
  background: var(--dtp-surface); border: 0.5px solid var(--dtp-border);
  border-radius: 20px; padding: 4px 12px;
  text-decoration: none; transition: var(--dtp-transition);
}
.dtp-modal-contact-item:hover { background: var(--dtp-navy); color: #fff; border-color: var(--dtp-navy); }
.dtp-modal-contact-item svg { width: 12px; height: 12px; flex-shrink: 0; }
.dtp-modal-bio { font-size: .84rem; color: var(--dtp-muted); line-height: 1.65; margin-bottom: 12px; }
.dtp-modal-full-bio { font-size: .84rem; color: var(--dtp-text); line-height: 1.7; margin-bottom: 18px; }
.dtp-modal-full-bio p { margin: 0 0 .75em; }
.dtp-modal-full-bio:empty { display: none; }
.dtp-modal-socials {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  padding-top: 16px; border-top: 0.5px solid var(--dtp-border);
}
.dtp-modal-socials .dtp-icon-btn { width: 34px; height: 34px; border-radius: 10px; }
.dtp-modal-socials .dtp-icon-btn svg { width: 15px; height: 15px; }

/* ---------- Accessibility ---------- */
.dtp-modal-close:focus-visible,
.dtp-icon-btn:focus-visible,
.dtp-has-popup:focus-visible { outline: 3px solid #378ADD; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .dtp-card,.dtp-modal,.dtp-modal-overlay,.dtp-photo,.dtp-card-overlay { transition: none; }
}
