/* =========================================================
   TEACHING OVERLAY REDESIGN
   Panel matches site-modal exactly (About/Contact windows).
   One-row two-column compact layout — no scrollable sections.
   ========================================================= */

/* ── Panel: exact site-modal dimensions and animation ── */
#teaching-detail-overlay .teaching-detail-panel.teaching-template-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(860px, calc(100vw - 32px));
  height: min(76vh, 680px);
  padding: 0;
  overflow: hidden;
  margin: 0;

  background: rgba(250,248,244,0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(28,25,23,0.09);
  border-radius: 22px;
  box-shadow:
    0 32px 80px rgba(28,25,23,0.16),
    0 4px 16px rgba(28,25,23,0.08);

  /* Opening animation — mirrors contact window */
  transform: translateY(12px) scale(0.96);
  transition: transform 0.34s cubic-bezier(0.22,1,0.36,1);
}

/* Close button floats over the hero image — give it a frosted background */
#teaching-detail-overlay .teaching-detail-panel.teaching-template-panel .site-modal-close {
  background: rgba(250,248,244,0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#teaching-detail-overlay .teaching-detail-panel.teaching-template-panel .site-modal-close:hover {
  background: rgba(250,248,244,0.96);
}

/* ── Hero image at the top of the panel ── */
.teach-hero-wrap {
  flex-shrink: 0;
  width: 100%;
  height: 300px;
  overflow: hidden;
  background: #EDE9E1;
  border-radius: 22px 22px 0 0;
}

.teach-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* Narrative image: user is at the top — anchor crop there */
[data-course="iat313"] .teach-hero-img {
  object-position: center top;
}

#teaching-detail-overlay[aria-hidden="false"] .teaching-detail-panel.teaching-template-panel {
  transform: translateY(0) scale(1);
}

/* ── Inner scrollable body — fills remaining height below hero ── */
.teach-window-body {
  flex: 1;
  min-height: 0;
  padding: 24px 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(28,25,23,0.14) transparent;
}

.teach-window-body::-webkit-scrollbar {
  width: 6px;
}
.teach-window-body::-webkit-scrollbar-track {
  background: transparent;
}
.teach-window-body::-webkit-scrollbar-thumb {
  background: rgba(28,25,23,0.14);
  border-radius: 999px;
}

/* ── Single-column sections ── */
.teach-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Meta items in a 2-column grid */
.teach-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 40px;
}

.teach-window-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ── Typography — mirrors About/Contact ── */
.teach-window-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(28,25,23,0.88);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  max-width: 28ch;
}

.teach-window-lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.82;
  color: rgba(28,25,23,0.74);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.teach-window-section-label {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(28,25,23,0.46);
  margin-bottom: 8px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.teach-window-para {
  margin: 0;
  font-size: 14px;
  line-height: 1.80;
  color: rgba(28,25,23,0.70);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.teach-window-list {
  margin: 0;
  padding-left: 16px;
}

.teach-window-list li {
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.74;
  color: rgba(28,25,23,0.70);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.teach-window-meta-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(28,25,23,0.38);
  margin-bottom: 2px;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.teach-window-meta-value {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(28,25,23,0.82);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

/* ── Mobile ── */
@media (max-width: 736px) {
  /* Push panel below the nav bar — matches site-modal mobile offset */
  #teaching-detail-overlay {
    padding-top: 64px;
  }

  #teaching-detail-overlay .teaching-detail-panel.teaching-template-panel {
    width: calc(100vw - 20px);
    height: min(82vh, 600px);
    border-radius: 18px;
  }

  .teach-hero-wrap {
    height: 200px;
    border-radius: 18px 18px 0 0;
  }

  .teach-window-body {
    padding: 20px 20px 22px;
  }

  .teach-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .teach-window-body {
    padding: 18px 16px 20px;
  }
}
