/* Картки спеціалістів: клік → попап з описом */
.doc[data-doc], .doc-mini[data-doc] { cursor: pointer; outline: none; }
.doc__media { object-position: center 22%; }
.doc[data-doc] .doc__media { transition: transform .35s ease, box-shadow .35s ease; }
.doc[data-doc]:hover .doc__media, .doc[data-doc]:focus-visible .doc__media { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(58,58,58,.14); }
.doc[data-doc]:focus-visible .doc__media { outline: 2px solid #eda150; outline-offset: 3px; }
.doc__more { margin: 10px 0 0; font-size: 13.5px; font-weight: 500; color: #eda150; }

.dmodal[hidden] { display: none; }
.dmodal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 24px; font-family: 'Manrope', 'Helvetica Neue', Arial, sans-serif; }
.dmodal__backdrop { position: absolute; inset: 0; background: rgba(40,36,32,.5); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: dmFade .28s ease both; }
.dmodal__panel { position: relative; display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); width: 100%; max-width: 900px; max-height: min(86vh, 720px); background: #f9f7f4; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.28); animation: dmPop .34s cubic-bezier(.2,.8,.2,1) both; }
.dmodal__media { position: relative; background: #f0efed; min-height: 100%; overflow: hidden; }
.dmodal .dmodal__img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; aspect-ratio: auto !important; border-radius: 0 !important; object-fit: cover; object-position: center 22%; display: block; animation: dmImg .6s ease both; }
.dmodal__body { display: flex; flex-direction: column; min-width: 0; min-height: 0; color: #3a3a3a; }
.dmodal__head { flex: none; padding: 40px 40px 0; animation: dmUp .45s .08s cubic-bezier(.2,.8,.2,1) both; }
.dmodal__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 40px 12px; animation: dmUp .45s .12s cubic-bezier(.2,.8,.2,1) both; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px); mask-image: linear-gradient(to bottom, transparent 0, #000 14px); }
.dmodal__foot { flex: none; padding: 14px 40px 32px; border-top: 1px solid transparent; }
.dmodal__name { margin: 0 0 6px; font-size: 28px; line-height: 1.15; font-weight: 600; }
.dmodal__spec { margin: 0 0 6px; font-size: 15.5px; color: #eda150; }
.dmodal__meta { margin: 0; font-size: 14px; color: #918b82; }
.dmodal__meta:empty { display: none; }
.dmodal__bio p { margin: 0 0 14px; font-size: 15.5px; line-height: 1.65; color: #6e6a64; }
.dmodal__cta { transition: transform .2s ease, box-shadow .2s ease, background-color .2s; }
.dmodal__cta:active { transform: scale(.985); }
.dmodal__close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: #3a3a3a; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); transition: background .2s, transform .2s; }
.dmodal__close:hover { background: #fff; transform: rotate(90deg); }
.dmodal__close:focus:not(:focus-visible) { outline: none; }
.dmodal__grab { display: none; }
body.dmodal-open { overflow: hidden; }

.dmodal.is-closing .dmodal__backdrop { animation: dmFadeOut .14s ease-out both; }
.dmodal.is-closing .dmodal__panel { animation: dmPopOut .17s ease-in both; }

@keyframes dmFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes dmFadeOut { from { opacity: 1 } to { opacity: 0 } }
@keyframes dmPop { from { opacity: 0; transform: translateY(14px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes dmPopOut { from { opacity: 1; transform: none } to { opacity: 0; transform: translateY(10px) scale(.985) } }
@keyframes dmImg { from { opacity: 0; transform: scale(1.04) } to { opacity: 1; transform: none } }
@keyframes dmUp { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
@keyframes dmSheet { from { transform: translateY(100%) } to { transform: none } }
@keyframes dmSheetOut { from { transform: none } to { transform: translateY(100%) } }

/* Мобільні (≤720px): майже повноекранний «шит», кнопка закріплена знизу, текст скролиться */
@media (max-width: 720px) {
  .dmodal { padding: 0; align-items: flex-end; }
  .dmodal__panel { display: flex; flex-direction: column; max-width: none; width: 100%; max-height: none; height: calc(100dvh - 12px); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.2); animation: dmSheet .38s cubic-bezier(.2,.8,.2,1) both; will-change: transform; touch-action: pan-y; }
  .dmodal.is-closing .dmodal__panel { animation: dmSheetOut .22s cubic-bezier(.4,0,1,1) both; }
  .dmodal__panel.is-dragging { animation: none; transition: none; }
  .dmodal__panel.is-snap { animation: none; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
  .dmodal__backdrop.is-snap { transition: opacity .16s ease-out; }
  .dmodal__media { flex: none; height: clamp(200px, 36dvh, 420px); min-height: 0; }
  .dmodal .dmodal__img { object-position: center 16%; }
  .dmodal__grab { display: block; position: absolute; top: 8px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 3px; background: rgba(255,255,255,.88); z-index: 3; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
  .dmodal__close { top: 16px; right: 16px; }
  .dmodal__head { padding: 20px 22px 0; }
  .dmodal__scroll { padding: 14px 22px 8px; }
  .dmodal__foot { padding: 12px 22px calc(14px + env(safe-area-inset-bottom)); border-top-color: #e9e4dc; background: #f9f7f4; }
  .dmodal__name { font-size: 24px; }
  .dmodal__spec { font-size: 15px; }
  .dmodal__bio p { font-size: 15px; line-height: 1.58; margin-bottom: 10px; }
  .dmodal__cta { width: 100%; }
}
@media (max-width: 720px) and (max-height: 640px) {
  .dmodal__media { height: 28dvh; }
}
@media (prefers-reduced-motion: reduce) {
  .dmodal__backdrop, .dmodal__panel, .dmodal .dmodal__img, .dmodal__head, .dmodal__scroll { animation: none !important; }
  .dmodal__panel.is-snap, .dmodal__backdrop.is-snap { transition: none; }
}
