/* Reference Detail Page (Referans Detay) */
/* Sayfa hero: css/page-hero.css */

/* ----- Detail Content (text + figures) ----- */
.ref-detail-content {
  padding: 60px 0 120px;
  background: var(--color-bg);
}

.ref-detail-content .container {
  display: flex;
  flex-direction: column;
  gap: 100px;
  align-items: stretch;
  max-width: 1240px;
  padding-inline: 100px;
}

/* Featured / Full image figures */
.ref-detail-figure {
  margin: 0;
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  overflow: hidden;
  background: #213354;
  aspect-ratio: 1040 / 584;
  display: block;
}

.ref-detail-figure--full {
  background: var(--color-black);
}

.ref-detail-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ref-detail-figure--featured img {
  object-fit: cover;
  object-position: center;
}

/* Text block */
.ref-detail-block {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
  color: #020b22;
}

.ref-detail-block h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4.4vw, 56px);
  line-height: 1.1;
  margin: 0;
  max-width: 885px;
  letter-spacing: -0.01em;
}

.ref-detail-block p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
}

/* Collage (staggered 2 image layout) */
.ref-detail-collage {
  position: relative;
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  height: 580px;
}

.ref-detail-collage__item {
  margin: 0;
  position: absolute;
  overflow: hidden;
  background: linear-gradient(180deg, #d4d4d4 0%, #c8c8c8 100%);
}

.ref-detail-collage__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ref-detail-collage__item--robot {
  left: 0;
  top: 0;
  width: 595px;
  height: 374px;
  z-index: 1;
}

.ref-detail-collage__item--phone {
  right: 0;
  bottom: 0;
  width: 632px;
  height: 571px;
  z-index: 2;
}

/* Responsive content */
@media (max-width: 1100px) {
  .ref-detail-content .container {
    padding-inline: 32px;
    gap: 80px;
  }

  .ref-detail-collage {
    height: clamp(420px, 60vw, 560px);
  }

  .ref-detail-collage__item--robot {
    width: 56%;
    height: 60%;
  }

  .ref-detail-collage__item--phone {
    width: 60%;
    height: 90%;
  }
}

@media (max-width: 768px) {
  .ref-detail-content {
    padding: 40px 0 80px;
  }

  .ref-detail-content .container {
    padding-inline: 16px;
    gap: 56px;
  }

  .ref-detail-block {
    gap: 20px;
  }

  .ref-detail-block p {
    font-size: 14px;
    line-height: 1.7;
  }

  .ref-detail-collage {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .ref-detail-collage__item {
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: 595 / 374;
  }

  .ref-detail-collage__item--phone {
    aspect-ratio: 632 / 571;
  }
}

/* ----- Client Logos Strip (Black Marquee) ----- */
.ref-clients-strip {
  background: var(--color-black);
  height: 179px;
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

.ref-clients-strip__track {
  display: flex;
  gap: 80px;
  align-items: center;
  width: max-content;
  animation: ref-strip-scroll 30s linear infinite;
  padding-left: 80px;
}

.ref-clients-strip__group {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 80px;
  align-items: center;
  flex-shrink: 0;
}

.ref-clients-strip__group li {
  display: flex;
  align-items: center;
  height: 32px;
}

.ref-clients-strip__group img {
  height: 32px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

@keyframes ref-strip-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 768px) {
  .ref-clients-strip {
    height: 120px;
  }

  .ref-clients-strip__track,
  .ref-clients-strip__group {
    gap: 50px;
  }

  .ref-clients-strip__group img {
    height: 24px;
  }
}

/* ----- Related Stories ----- */
.ref-related {
  background: var(--color-bg);
  padding: 110px 0;
}

.ref-related .container {
  display: flex;
  flex-direction: column;
  gap: 60px;
  max-width: 1240px;
}

.ref-related__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--color-black);
  margin: 0;
  letter-spacing: -0.01em;
}

/* Slider viewport (overflow clip) */
.ref-related__viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.ref-related__track {
  display: flex;
  gap: 45px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.ref-related__track::-webkit-scrollbar {
  display: none;
}

.ref-related-card {
  display: flex;
  flex-direction: column;
  gap: 32px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease;
  flex: 0 0 calc((100% - 90px) / 3);
  scroll-snap-align: start;
  min-width: 0;
}

.ref-related-card:hover {
  transform: translateY(-4px);
}

.ref-related-card__media {
  aspect-ratio: 605 / 457;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #d4d4d4 0%, #c8c8c8 100%);
}

.ref-related-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.ref-related-card:hover .ref-related-card__media img {
  transform: scale(1.04);
}

.ref-related-card__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ref-related-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 2.8vw, 36px);
  line-height: 1.1;
  color: #020b22;
  margin: 0;
}

.ref-related-card__desc {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.5;
  color: var(--color-black);
  margin: 0;
}

/* Pagination arrows */
.ref-related__nav {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

.ref-related__arrow {
  width: 47px;
  height: 47px;
  border-radius: 50%;
  border: 1.5px solid var(--color-black);
  background: transparent;
  color: var(--color-black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  padding: 0;
}

.ref-related__arrow svg {
  width: 22px;
  height: 22px;
  display: block;
}

.ref-related__arrow:hover:not(:disabled) {
  background: var(--color-black);
  color: var(--color-bg);
}

.ref-related__arrow:focus-visible {
  outline: 2px solid var(--color-purple);
  outline-offset: 3px;
}

.ref-related__arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Related responsive */
@media (max-width: 1100px) {
  .ref-related__track {
    gap: 32px;
  }

  .ref-related-card {
    flex: 0 0 calc((100% - 64px) / 3);
  }
}

@media (max-width: 900px) {
  .ref-related {
    padding: 80px 0;
  }

  .ref-related__track {
    gap: 28px;
  }

  .ref-related-card {
    flex: 0 0 calc((100% - 28px) / 2);
    gap: 20px;
  }

  .ref-related-card__body {
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .ref-related {
    padding: 60px 0;
  }

  .ref-related .container {
    gap: 40px;
  }

  .ref-related__track {
    gap: 20px;
  }

  .ref-related-card {
    flex: 0 0 85%;
  }

  .ref-related-card__desc {
    font-size: 14px;
  }

  .ref-related__arrow {
    width: 40px;
    height: 40px;
  }

  .ref-related__arrow svg {
    width: 18px;
    height: 18px;
  }
}

/* ----- WYSIWYG gövde (panel HTML) ----- */
.ref-detail-block--wysiwyg h2,
.ref-detail-block--wysiwyg h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3.5vw, 48px);
  line-height: 1.12;
  margin: 1.25em 0 0.5em;
  max-width: 885px;
  color: #020b22;
}

.ref-detail-block--wysiwyg h2:first-child,
.ref-detail-block--wysiwyg h3:first-child {
  margin-top: 0;
}

.ref-detail-block--wysiwyg p,
.ref-detail-block--wysiwyg li {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: #020b22;
}

.ref-detail-block--wysiwyg p {
  margin: 0 0 1em;
  max-width: 885px;
}

.ref-detail-block--wysiwyg ul,
.ref-detail-block--wysiwyg ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
  max-width: 885px;
}

.ref-detail-block--wysiwyg img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em 0;
}

.ref-detail-block--wysiwyg .ref-detail-collage,
.ref-detail-block--wysiwyg .ref-detail-figure {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

@media (max-width: 768px) {
  .ref-detail-block--wysiwyg p,
  .ref-detail-block--wysiwyg li {
    font-size: 14px;
    line-height: 1.7;
  }
}
