/* =========================================
   Referans Detay Popup
========================================= */

.bitur-ref-popup {
  --bitur-ref-accent: var(--alizarin-crimson, #1bb1bc);
  --bitur-ref-text: #2a2a2a;
  --bitur-ref-muted: #5a5a5a;
  --bitur-ref-line: rgba(0, 0, 0, 0.1);
  --bitur-ref-ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 40px);
  pointer-events: none;
}

.bitur-ref-popup[hidden] {
  display: none;
}

.bitur-ref-popup.is-open {
  pointer-events: auto;
}

/* Blur, üst öğenin opacity geçişine bağlanırsa tarayıcı bulanıklığı ancak
   animasyon bittikten sonra uyguluyor; bu yüzden overlay kendi geçişini yönetir. */
.bitur-ref-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(1, 9, 24, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  cursor: pointer;
  will-change: backdrop-filter, background-color;
  transition:
    background-color 0.35s var(--bitur-ref-ease),
    backdrop-filter 0.35s var(--bitur-ref-ease),
    -webkit-backdrop-filter 0.35s var(--bitur-ref-ease);
}

.bitur-ref-popup.is-open .bitur-ref-popup__overlay {
  background: rgba(1, 9, 24, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.bitur-ref-popup__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 940px);
  max-height: min(88vh, 660px);
  background: #ffffff;
  border-radius: clamp(18px, 2.2vw, 28px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(18px) scale(0.985);
  opacity: 0;
  transition:
    transform 0.45s var(--bitur-ref-ease),
    opacity 0.35s var(--bitur-ref-ease);
}

.bitur-ref-popup.is-open .bitur-ref-popup__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.bitur-ref-popup__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.25s var(--bitur-ref-ease),
    color 0.25s var(--bitur-ref-ease);
}

.bitur-ref-popup__close:hover,
.bitur-ref-popup__close:focus-visible {
  background: rgba(27, 177, 188, 0.12);
  color: var(--bitur-ref-accent);
  outline: none;
}

.bitur-ref-popup__close svg {
  display: block;
  width: 16px;
  height: 16px;
}

.bitur-ref-popup__quote {
  position: absolute;
  top: clamp(26px, 3.4vw, 42px);
  left: clamp(26px, 3.4vw, 42px);
  z-index: 2;
  width: clamp(30px, 3.6vw, 44px);
  height: auto;
  fill: var(--bitur-ref-accent);
  pointer-events: none;
  user-select: none;
}

.bitur-ref-popup__body {
  display: grid;
  grid-template-columns: minmax(160px, 250px) minmax(0, 1fr);
  gap: clamp(24px, 3.6vw, 48px);
  align-items: center;
  padding: clamp(56px, 5.5vw, 72px) clamp(28px, 4vw, 56px) clamp(32px, 4vw, 56px);
  overflow-y: auto;
  max-height: min(88vh, 660px);
  -webkit-overflow-scrolling: touch;
}

.bitur-ref-popup__media {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Referans kartındaki görsel diliyle aynı: köşeleri yumuşak, çerçeveli */
.bitur-ref-popup__frame {
  width: 100%;
  max-width: 250px;
  aspect-ratio: 376 / 471;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: clamp(14px, 1.8vw, 24px);
  background: rgba(0, 0, 0, 0.03);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.bitur-ref-popup__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.bitur-ref-popup__content {
  min-width: 0;
}

.bitur-ref-popup__text {
  margin: 0;
  color: var(--bitur-ref-muted);
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.75;
  font-weight: 400;
}

.bitur-ref-popup__divider {
  margin: clamp(20px, 2.4vw, 30px) 0;
  border: 0;
  border-top: 1px solid var(--bitur-ref-line);
}

.bitur-ref-popup__name {
  display: block;
  color: var(--bitur-ref-accent);
  font-size: clamp(20px, 1.9vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.bitur-ref-popup__site {
  display: inline-block;
  margin-top: 8px;
  color: #656565;
  font-size: clamp(13px, 1vw, 15px);
  text-decoration: none;
  transition: color 0.25s var(--bitur-ref-ease);
}

.bitur-ref-popup__site:hover,
.bitur-ref-popup__site:focus-visible {
  color: var(--bitur-ref-accent);
}

/* Tıklanabilir referans kartı */
.bitur-ref-card {
  cursor: pointer;
}

.bitur-ref-card:focus-visible {
  outline: 2px solid var(--alizarin-crimson, #1bb1bc);
  outline-offset: 4px;
}

html.bitur-ref-popup-open,
html.bitur-ref-popup-open body {
  overflow: hidden !important;
  touch-action: none;
}

@media (max-width: 767px) {
  .bitur-ref-popup {
    padding: 12px;
  }

  .bitur-ref-popup__dialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px;
  }

  .bitur-ref-popup__body {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 58px 22px 28px;
    max-height: 92vh;
    align-items: stretch;
  }

  .bitur-ref-popup__quote {
    top: 20px;
    left: 22px;
    width: 30px;
  }

  .bitur-ref-popup__close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  .bitur-ref-popup__frame {
    max-width: min(58vw, 200px);
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bitur-ref-popup__overlay,
  .bitur-ref-popup__dialog {
    transition: none;
  }
}
