/* ─────────────────────────────────────────────────────────────
   DOCTOR PAGE — #sec-education, השכלה מקצועית ותעודות

   Each certificate is the doctor's own file (image, or PDF with the
   server's preview of it), shown in the same white 380px card with the
   tinted inner frame the old mock certificates used, so the section keeps
   the page's look. The whole card is one button; it opens the full-size
   view (#dmc-lightbox).

   The row is a native horizontal scroller with snap points: swipe on
   touch, drag with the mouse (assets/js/doctor-certificates.js), the
   arrows, or Tab through the cards. When every card fits, the row centres
   itself and the arrows stay hidden. No autoplay.

   Replaces the template's looping slider for this section; the old
   .dmc-dr-education-slide rules in team-member.css and
   doctor-education-figma.css no longer match anything here.
   ───────────────────────────────────────────────────────────── */

.dmc-dr-page-wrapper.dmc-dr-story #sec-education.dmc-dr-certs {
  position: relative;
  padding: 100px 0;
  background: transparent;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__container {
  position: relative;
  z-index: 2;
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ── Row ───────────────────────────────────────────────── */

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 20px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  /* room for the hover lift and the card shadow, which overflow would clip */
  margin: -20px -20px 0;
  padding: 20px 20px 30px;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__viewport::-webkit-scrollbar {
  display: none;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__viewport.is-scrollable {
  cursor: grab;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__viewport.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__viewport.is-dragging .dmc-dr-certs__card {
  pointer-events: none;
}

/* max-content + auto margins: centred when the cards fit, scrollable from
   the first card when they do not (justify-content:center would cut off
   the start of an overflowing row). */
.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__track {
  display: flex;
  gap: 30px;
  width: max-content;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__item {
  flex: 0 0 380px;
  margin: 0;
  padding: 0;
  scroll-snap-align: center;
}

/* ── Card ──────────────────────────────────────────────── */

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 490px;
  margin: 0;
  padding: 16px;
  box-sizing: border-box;
  border: 0;
  border-radius: 20px;
  background: #FFF;
  box-shadow: 0 10px 30px rgba(8, 76, 153, 0.05);
  color: #283565;
  font: inherit;
  text-align: right;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(8, 76, 153, 0.12);
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__card:focus-visible {
  outline: 3px solid #087CF5;
  outline-offset: 4px;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__frame {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
  border: 1px solid rgba(40, 53, 101, 0.2);
  border-radius: 15px;
  background: rgba(40, 53, 101, 0.05);
  overflow: hidden;
}

/* The certificate as a sheet of paper on the tinted frame. The box fills
   the frame (an auto-sized lazy image is 0x0 until it loads, so it never
   would), contain keeps the sheet's proportions, and drop-shadow — unlike
   box-shadow — follows the painted sheet rather than the letterboxed box. */
.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(40, 53, 101, 0.18));
}

/* A PDF the server could not render a preview for. */
.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__pdf-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 124px;
  border-radius: 6px;
  background: #FFF;
  box-shadow: 0 6px 18px rgba(40, 53, 101, 0.16);
  color: #283565;
  font-family: Polin, sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 4px 0;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__title {
  flex: 1 1 auto;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: #283565;
  font-family: Polin, sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__badge {
  flex: 0 0 auto;
  padding: 2px 9px;
  border: 1px solid #0660C2;
  border-radius: 999px;
  color: #0660C2;
  font-family: Polin, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__zoom {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #087CF5;
  color: #FFF;
  transition: transform 0.3s ease;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__card:hover .dmc-dr-certs__zoom {
  transform: scale(1.08);
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Arrows ────────────────────────────────────────────── */

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__nav {
  margin-top: 15px;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__nav[hidden] {
  display: none !important;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

.dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__btn:focus-visible {
  outline: 3px solid #087CF5;
  outline-offset: 3px;
}

/* A doctor with no certificates: the section is not printed, and its tab
   buttons carry [hidden], which the bar's display rules would override. */
.dmc-dr-page-wrapper.dmc-dr-story .dmc-story-tab[hidden] {
  display: none !important;
}

/* ── Phone ─────────────────────────────────────────────── */

@media (max-width: 767px) {
  .dmc-dr-page-wrapper.dmc-dr-story #sec-education.dmc-dr-certs {
    padding: 60px 0;
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__track {
    gap: 17px;
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__item {
    flex-basis: min(281px, 75vw);
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__card {
    height: 380px;
    padding: 12px;
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__frame {
    padding: 14px;
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__meta {
    padding-top: 12px;
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__title {
    font-size: 16px;
    line-height: 22px;
  }

  /* The shared carousel arrows are 34px; a touch target needs 44. */
  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__nav .dmc-dr-certs__btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
  }
}

/* ============================================================
   FULL-SIZE VIEW (#dmc-lightbox)
   One id heavier than team-member.css's .dmc-dr-lightbox rules.
   ============================================================ */

/* The theme sets overflow on html with !important; body too, for iOS. */
html.dmc-lightbox-open,
html.dmc-lightbox-open body {
  overflow: hidden !important;
}

#dmc-lightbox.dmc-dr-lightbox {
  padding: 24px;
  box-sizing: border-box;
}

#dmc-lightbox.dmc-dr-lightbox[hidden] {
  display: none !important;
}

#dmc-lightbox .dmc-dr-lightbox__content {
  width: min(1000px, 100%);
  max-width: none;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

#dmc-lightbox .dmc-dr-lightbox__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

#dmc-lightbox .dmc-dr-lightbox__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: #FFF;
  font-family: Polin, sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  text-align: right;
}

#dmc-lightbox .dmc-dr-lightbox__open {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #FFF;
  font-family: Polin, sans-serif;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#dmc-lightbox .dmc-dr-lightbox__open[hidden] {
  display: none;
}

#dmc-lightbox .dmc-dr-lightbox__close {
  position: static;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #FFF;
  font-size: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#dmc-lightbox .dmc-dr-lightbox__close:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.28);
}

#dmc-lightbox .dmc-dr-lightbox__close:focus-visible,
#dmc-lightbox .dmc-dr-lightbox__open:focus-visible,
#dmc-lightbox .dmc-dr-lightbox__pdf-btn:focus-visible {
  outline: 3px solid #FFF;
  outline-offset: 3px;
}

#dmc-lightbox .dmc-dr-lightbox__inner {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  overflow: auto;
}

#dmc-lightbox .dmc-dr-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  min-height: 0;
  object-fit: contain;
  border-radius: 8px;
}

#dmc-lightbox .dmc-dr-lightbox-iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 8px;
}

#dmc-lightbox .dmc-dr-lightbox__pdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  background: #087CF5;
  color: #FFF;
  font-family: Polin, sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 767px) {
  #dmc-lightbox.dmc-dr-lightbox {
    padding: 16px;
  }

  #dmc-lightbox .dmc-dr-lightbox__title {
    font-size: 18px;
  }

  #dmc-lightbox .dmc-dr-lightbox__inner {
    padding: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__card,
  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__zoom,
  #dmc-lightbox.dmc-dr-lightbox {
    transition: none;
  }

  .dmc-dr-page-wrapper.dmc-dr-story .dmc-dr-certs__card:hover {
    transform: none;
  }
}
