/* ee365 — карточка преподавателя «Подробнее» (окно поверх сайта).
   Работает на любой странице: цвета и шрифты заданы с запасными значениями. */

html.modal-open { overflow: hidden; }

.tmodal {
  --tm-ink: var(--c-ink, #11110f);
  --tm-soft: rgba(17, 17, 15, .68);
  --tm-paper: var(--c-paper, #f3e8d2);
  --tm-sand: var(--c-sand, #fae2b1);
  --tm-green: var(--c-green, #95c73a);
  --tm-green-hover: var(--c-green-hover, #a6d64b);
  --tm-green-light: var(--c-green-light, #c9ee87);
  --tm-green-dark: var(--c-green-dark, #628f0e);
  --tm-line: rgba(17, 17, 15, .25);

  width: min(1120px, calc(100% - 2 * clamp(8px, 2.2vw, 40px)));
  max-width: none;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: var(--tm-paper);
  color: var(--tm-ink);
  font-family: var(--f-sans, "Medeo Sans", Arial, sans-serif);
  font-size: 18px;
  line-height: 1.4;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .6);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.tmodal::-webkit-scrollbar { display: none; }
.tmodal::backdrop { background: rgba(6, 14, 10, .72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.tmodal[open] { animation: tmodal-in .28s ease; }
.tmodal[open]::backdrop { animation: tmodal-fade .28s ease; }
@keyframes tmodal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes tmodal-fade { from { opacity: 0; } to { opacity: 1; } }

.tmodal a { color: inherit; }
.tmodal h2, .tmodal h3, .tmodal p, .tmodal dl, .tmodal dd, .tmodal ul, .tmodal figure, .tmodal blockquote { margin: 0; }
.tmodal button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
.tmodal :focus-visible { outline: 2px solid var(--tm-green-dark); outline-offset: 3px; }

.tmodal__inner { padding: 56px 56px 36px; }

/* Верх: на ПК — только крестик, «прилипает» при прокрутке окна */
.tmodal__top {
  position: sticky; top: 24px; z-index: 3;
  height: 0;
  display: flex; justify-content: flex-end; align-items: flex-start;
  margin: -32px -32px 0 0;
}
.tmodal__top .tmodal__count { display: none; }
.tmodal__close {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tm-ink) !important; color: var(--tm-paper) !important;
  transition: background-color .2s, transform .2s;
}
.tmodal__close:hover { background: var(--tm-green-dark) !important; transform: rotate(90deg); }

.tmodal__grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 56px; }

/* Левая колонка */
.tmodal__aside { display: flex; flex-direction: column; align-items: flex-start; }
.tmodal__avatar {
  width: 300px; height: 300px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden; position: relative;
  font-family: var(--f-display, "IvyPresto Display", Georgia, serif); font-size: 120px; line-height: 1;
}
.tmodal__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; } /* ровно в круг (см. .teacher__avatar) */
.tmodal__name { margin-top: 28px !important; font-weight: 500; font-size: 44px; line-height: 1; }
.tmodal__role { margin-top: 10px !important; font-size: 18px; color: var(--tm-soft); }
.tmodal__facts { margin-top: 24px !important; width: 100%; display: grid; grid-template-columns: auto 1fr; font-size: 16px; }
.tmodal__facts dt, .tmodal__facts dd { padding: 11px 0; border-top: 1px dashed var(--tm-line); }
.tmodal__facts dt { color: var(--tm-soft); padding-right: 16px; }
.tmodal__facts dd { text-align: right; }
.tmodal__facts dt:nth-last-of-type(1), .tmodal__facts dd:nth-last-of-type(1) { border-bottom: 1px dashed var(--tm-line); }
.tmodal__tags { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.tmodal__tags span { padding: 6px 12px; border-radius: 20px; background: var(--tm-green-light); font-size: 14px; }
.tmodal__cta {
  margin-top: 28px; width: 100%;
  display: flex; justify-content: center; align-items: center;
  min-height: 56px; padding: 0 20px;
  border-radius: 12px;
  background: var(--tm-green);
  box-shadow: 0 6px 0 -2px rgba(17, 17, 15, .18);
  font-family: var(--f-mono, "Medeo Mono", monospace); font-size: 16px; letter-spacing: -.01em;
  text-align: center; text-decoration: none;
  transition: background-color .2s, transform .15s, box-shadow .2s;
}
.tmodal__cta:hover { background: var(--tm-green-hover); transform: translateY(-1px); box-shadow: 0 8px 0 -2px rgba(17, 17, 15, .2); }
.tmodal__tg {
  margin-top: 10px; align-self: center;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  font-family: var(--f-mono, "Medeo Mono", monospace); font-size: 14px;
  text-decoration: underline; text-underline-offset: 3px;
}
.tmodal__tg:hover { color: var(--tm-green-dark); }

/* Правая колонка */
.tmodal__main { display: flex; flex-direction: column; gap: 34px; padding-top: 6px; min-width: 0; }
.tmodal__sec-head { display: flex; align-items: center; gap: 12px; }
.tmodal__h { font-weight: 300; font-size: 32px; line-height: 1.15; font-optical-sizing: none; }
.tmodal__accent { font-family: var(--f-pixel, "Medeo Pixel", monospace); font-weight: 400; color: var(--tm-green-dark); }
.tmodal__p { margin-top: 14px !important; font-size: 18px; line-height: 1.5; }
.tmodal__p + .tmodal__p { margin-top: 12px !important; }
.tmodal__list { margin-top: 16px !important; padding: 0; list-style: none; display: grid; gap: 12px; font-size: 17px; }
.tmodal__list li { display: flex; gap: 12px; }
.tmodal__list svg { flex: none; margin-top: 1px; color: var(--tm-green-dark); stroke-width: 2.4; }
.tmodal__video {
  margin-top: 16px; width: 100%; height: 300px;
  display: grid; place-items: center; align-content: center; gap: 14px;
  border-radius: 20px; background: var(--tm-ink); color: var(--tm-paper) !important;
  text-decoration: none;
}
a.tmodal__video:hover .tmodal__play { transform: scale(1.08); }
.tmodal__play {
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tm-green); color: var(--tm-ink);
  transition: transform .2s;
}
div.tmodal__video .tmodal__play { opacity: .5; }
.tmodal__video-cap { font-family: var(--f-mono, "Medeo Mono", monospace); font-size: 15px; }
.tmodal__reviews { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tmodal__review { padding: 20px 22px; border-radius: 10px 24px 24px 24px; background: var(--tm-sand); }
.tmodal__stars { color: #8a6d0b; font-size: 16px; letter-spacing: 2px; }
.tmodal__review blockquote { margin-top: 8px !important; font-size: 16px; line-height: 1.45; }
.tmodal__review figcaption { margin-top: 10px; font-family: var(--f-mono, "Medeo Mono", monospace); font-size: 13px; color: var(--tm-soft); }

/* Переход между преподавателями */
.tmodal__nav {
  margin-top: 40px; padding-top: 20px;
  border-top: 1px dashed var(--tm-line);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.tmodal__step {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 4px !important;
  font-family: var(--f-mono, "Medeo Mono", monospace) !important; font-size: 15px;
  transition: color .2s;
}
.tmodal__step:hover { color: var(--tm-green-dark); }
.tmodal__step svg { transition: transform .2s; }
.tmodal__step:hover svg { transform: translateX(-3px); }
.tmodal__step--next:hover svg { transform: translateX(3px); }
.tmodal__count { font-family: var(--f-mono, "Medeo Mono", monospace); font-size: 14px; color: var(--tm-soft); }

.tmodal__sticky { display: none; }

/* ---------- Планшет ---------- */
@media (max-width: 1023px) {
  .tmodal__inner { padding: 48px 40px 32px; }
  .tmodal__grid { grid-template-columns: 260px minmax(0, 1fr); gap: 40px; }
  .tmodal__avatar { width: 240px; height: 240px; font-size: 96px; }
  .tmodal__name { font-size: 38px; }
  .tmodal__reviews { grid-template-columns: 1fr; }
  .tmodal__video { height: 240px; }
}

/* ---------- Телефон: карточка на весь экран ---------- */
@media (max-width: 767px) {
  .tmodal {
    width: 100%; height: 100%;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
  .tmodal__inner { min-height: 100%; display: flex; flex-direction: column; padding: 0 24px; }
  .tmodal__top {
    position: sticky; top: 0;
    height: auto;
    margin: 0 -24px;
    padding: 12px 16px 12px 24px;
    justify-content: space-between; align-items: center;
    background: rgba(243, 232, 210, .95);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-bottom: 1px dashed rgba(17, 17, 15, .2);
  }
  .tmodal__top .tmodal__count { display: inline; }
  .tmodal__close { width: 44px; height: 44px; }
  .tmodal__grid { grid-template-columns: 1fr; gap: 32px; padding-top: 24px; }
  .tmodal__aside { align-items: stretch; }
  .tmodal__avatar { align-self: center; width: 200px; height: 200px; font-size: 84px; }
  .tmodal__name, .tmodal__role { text-align: center; }
  .tmodal__name { margin-top: 20px !important; font-size: 36px; }
  .tmodal__role { font-size: 16px; }
  .tmodal__facts { margin-top: 22px !important; font-size: 15px; }
  .tmodal__facts dt, .tmodal__facts dd { padding: 10px 0; }
  .tmodal__tags { margin-top: 16px; }
  .tmodal__aside .tmodal__cta { display: none; }
  .tmodal__tg { margin-top: 8px; }
  .tmodal__main { gap: 32px; padding-top: 0; }
  .tmodal__h { font-size: 28px; }
  .tmodal__p { font-size: 17px; }
  .tmodal__list { font-size: 16px; gap: 10px; }
  .tmodal__video { height: 194px; border-radius: 18px; }
  .tmodal__play { width: 64px; height: 64px; }
  .tmodal__video-cap { font-size: 13px; }
  .tmodal__reviews { grid-template-columns: 1fr; gap: 12px; }
  .tmodal__review { padding: 18px 20px; }
  .tmodal__nav { margin-top: 28px; padding: 14px 0; }
  .tmodal__count--nav { display: none; }
  .tmodal__sticky {
    display: block;
    position: sticky; bottom: 0; z-index: 3;
    margin: auto -24px 0;
    padding: 12px 16px 20px;
    background: var(--tm-paper);
    box-shadow: 0 -10px 24px -14px rgba(17, 17, 15, .35);
  }
  .tmodal__cta--sticky { margin-top: 0; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .tmodal[open], .tmodal[open]::backdrop { animation: none; }
  .tmodal *, .tmodal *::before, .tmodal *::after { transition: none !important; }
}
