/* =========================================================
   Ekcan Grup — Timed Cards Opening hero
   Structure ported 1:1 from Mers Lojistik timed-hero
   (CodePen @dilums NWodZMd adaptation, GSAP required).
   Scoped under #ekcan-hero — Ekcan palette + Urbanist font.
   ========================================================= */

/* Replace the compiled Next.js hero with the timed-cards hero.
   The old hero stays in the DOM (hydration safety) but is hidden. */
main > section.hero { display: none !important; }

/* Yer tutucu: yeni hero ancak hydration sonrası enjekte edildiği için
   aradaki kısa sürede alttaki bölüm yukarı çıkıyordu. main::before bir
   psödo-eleman olduğu için React'in DOM'una hiç dokunmaz; hero geldiğinde
   .ekcan-hero-ready ile kalkar. JS çalışmazsa sabit görsel olarak kalır. */
main::before {
  content: "";
  display: block;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  background:
    linear-gradient(90deg, rgba(7, 17, 18, 0.74) 0%, rgba(7, 17, 18, 0.52) 38%, rgba(7, 17, 18, 0.14) 72%, rgba(7, 17, 18, 0) 100%),
    linear-gradient(180deg, rgba(7, 17, 18, 0.34) 0%, rgba(7, 17, 18, 0) 26%, rgba(7, 17, 18, 0) 62%, rgba(7, 17, 18, 0.46) 100%),
    var(--green-deep, #0d261f) url('/projects/architecture-v2.jpg') center / cover no-repeat;
}
body.ekcan-hero-ready main::before { display: none; }
@media (max-width: 640px) {
  main::before { min-height: 560px; }
}

#ekcan-hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  width: 100%;
  overflow: hidden;
  background: var(--green-deep, #0d261f);
  color: rgba(255, 255, 255, 0.87);
  font-family: Urbanist, Arial, sans-serif;
}
@media (max-width: 640px) {
  #ekcan-hero { min-height: 560px; }
}

#ekcan-hero .card {
  position: absolute;
  left: 0;
  top: 0;
  background-position: center;
  background-size: cover;
  box-shadow: 6px 6px 24px 4px rgba(0, 0, 0, 0.45);
  border-radius: 0;
  overflow: hidden;
}
#ekcan-hero .card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Bottom scrim so card labels stay readable on busy imagery.
   Fades out while the card expands to fullscreen (is-full). */
#ekcan-hero .card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(13, 38, 31, 0) 34%,
    rgba(13, 38, 31, 0.35) 62%,
    rgba(13, 38, 31, 0.82) 100%);
  opacity: 1;
  transition: opacity 500ms ease;
  pointer-events: none;
}
#ekcan-hero .card.is-full::after { opacity: 0; }

#ekcan-hero .card-content {
  position: absolute;
  left: 0;
  top: 0;
  color: rgba(255, 255, 255, 0.87);
  padding-left: 16px;
  font-family: inherit;
  overflow: hidden;
}
/* Kısa sektör adı yalnızca mobil thumbnail'lerde kullanılır */
#ekcan-hero .content-short { display: none; }
@media (max-width: 768px) {
  /* Küçük kartlarda etiket sadeleşir: sadece sektör adı */
  #ekcan-hero .card-content { padding-left: 10px; padding-right: 8px; }
  #ekcan-hero .content-place,
  #ekcan-hero .content-title-1,
  #ekcan-hero .content-title-2 { display: none; }
  #ekcan-hero .content-short {
    display: -webkit-box;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

#ekcan-hero .content-place {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream, #f2efe8);
}

#ekcan-hero .content-title-1,
#ekcan-hero .content-title-2 {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

#ekcan-hero .content-start {
  display: none;
}

#ekcan-hero .details {
  z-index: 22;
  position: absolute;
  top: clamp(140px, 22vh, 240px);
  /* Align with header logo edge (.mainnav: min(100% - 72px, 1200px) centered) */
  left: calc(max(36px, (100vw - 1200px) / 2));
  max-width: min(560px, calc(100vw - 40px));
  pointer-events: none;
}
#ekcan-hero .details > .cta { pointer-events: auto; }

/* Masaüstü/laptop: metin bloğu dikey ortalanır. Üstte header, altta kart +
   sayfalama için pay bırakılır; böylece kısa ekranlarda (1440x700 gibi)
   başlık logoya yapışmaz, blok aşağıyla çakışmaz. */
@media (min-width: 901px) {
  #ekcan-hero .details {
    top: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* İçerik kutuya sığmazsa ortalama yerine üstten hizala — aksi hâlde
       blok yukarı taşıp header'ın altına giriyordu (kısa laptop ekranları). */
    justify-content: safe center;
    padding-top: 150px;
    padding-bottom: 120px;
    box-sizing: border-box;
  }
}
/* Kısa laptop ekranlarında dikey ritim sıkışır */
@media (min-width: 901px) and (max-height: 800px) {
  #ekcan-hero .details { padding-top: 166px; padding-bottom: 96px; }
  #ekcan-hero .details .title-1,
  #ekcan-hero .details .title-2 { font-size: clamp(1.7rem, 2.9vw, 2.7rem); }
  #ekcan-hero .details .title-box-1,
  #ekcan-hero .details .title-box-2 { height: clamp(34px, 3.4vw, 50px); }
  #ekcan-hero .details > .desc { margin-top: 14px; font-size: 15px; line-height: 1.55; }
  #ekcan-hero .details > .cta { margin-top: 18px; }
  #ekcan-hero .details > .logo-strip { margin-top: 22px; min-height: 32px; }
  #ekcan-hero .details > .logo-strip img { height: 28px; max-width: 100px; }
  #ekcan-hero .details > .logo-strip img[src*="kefaluka"] { height: 46px; max-width: 130px; }
}
/* Çok kısa laptop ekranları (≤700px): blok header'a değmesin diye daha sıkı */
@media (min-width: 901px) and (max-height: 700px) {
  #ekcan-hero .details { padding-top: 170px; padding-bottom: 76px; }
  #ekcan-hero .details .title-1,
  #ekcan-hero .details .title-2 { font-size: clamp(1.5rem, 2.5vw, 2.2rem); }
  #ekcan-hero .details .title-box-1,
  #ekcan-hero .details .title-box-2 { height: clamp(30px, 2.9vw, 40px); }
  #ekcan-hero .details > .desc { margin-top: 12px; font-size: 14.5px; line-height: 1.5; max-width: 40ch; }
  #ekcan-hero .details > .cta { margin-top: 15px; }
  #ekcan-hero .details > .cta > .discover { height: 42px; font-size: 11.5px; padding: 0 22px; }
  #ekcan-hero .details > .logo-strip { margin-top: 16px; min-height: 26px; }
  #ekcan-hero .details > .logo-strip img { height: 24px; max-width: 90px; }
  #ekcan-hero .details > .logo-strip img[src*="kefaluka"] { height: 38px; max-width: 110px; }
}
@media (max-width: 1024px) {
  #ekcan-hero .details { left: clamp(20px, 5vw, 36px); }
}
@media (max-width: 640px) {
  #ekcan-hero .details {
    top: clamp(112px, 16vh, 160px);
    max-width: calc(100vw - 32px);
  }
}
/* Hero'da başlık üstü etiket ve kırmızı çizgi kullanılmıyor — başlık
   doğrudan konuşuyor. (Öğeler DOM'da kalır; animasyon zinciri bozulmaz.) */
#ekcan-hero .details .place-box,
#ekcan-hero .details > .hero-rule {
  display: none;
}

#ekcan-hero .details .place-box {
  height: 26px;
  overflow: hidden;
  position: relative;
}
#ekcan-hero .details .place-box .text {
  padding-top: 0;
  font-size: clamp(12px, 1.2vw, 14px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 700;
  color: #fff;
  position: relative;
}

/* Single title scale for every slide (matched to the longest headline)
   so slide-to-slide type size stays consistent. Mobilde bir tık büyük. */
#ekcan-hero .details .title-1,
#ekcan-hero .details .title-2 {
  font-weight: 800;
  font-size: clamp(1.78rem, 5.4vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 1.0;
  font-family: inherit;
  white-space: nowrap;
  text-shadow: 0 2px 18px rgba(7, 17, 18, 0.35);
}
#ekcan-hero .details .title-box-1,
#ekcan-hero .details .title-box-2 {
  margin-top: 2px;
  height: clamp(38px, 6vw, 64px);
  overflow: hidden;
}
/* Gövde metni: daha yüksek kontrast, daha kalın, kontrollü satır uzunluğu */
#ekcan-hero .details > .desc {
  margin-top: 20px;
  width: 100%;
  max-width: 42ch;
  font-size: clamp(15px, 1.15vw, 16px);
  font-weight: 500;
  line-height: 1.62;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 12px rgba(7, 17, 18, 0.4);
}
#ekcan-hero .details > .cta {
  width: 100%;
  max-width: 500px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
/* Tek ve net eylem: dolu kırmızı CTA (kaydet/bookmark butonu kaldırıldı —
   işlevi olmayan ikinci bir kırmızı öge dikkati bölüyordu). */
#ekcan-hero .details > .cta > .discover {
  border: 0;
  background-color: var(--red, #c9242c);
  height: 48px;
  border-radius: 99px;
  color: #ffffff;
  padding: 0 26px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: background 200ms ease, transform 200ms ease;
  font-family: inherit;
  box-shadow: 0 14px 34px rgba(7, 17, 18, 0.34);
}
#ekcan-hero .details > .cta > .discover::after {
  content: "";
  width: 18px;
  height: 8px;
  flex: none;
  background: currentColor;
  clip-path: polygon(0 3px, 12px 3px, 9px 0, 12px 0, 18px 4px, 12px 8px, 9px 8px, 12px 5px, 0 5px);
  transition: transform 200ms ease;
}
#ekcan-hero .details > .cta > .discover:hover {
  background: var(--red-dark, #a91820);
  transform: translateY(-1px);
}
#ekcan-hero .details > .cta > .discover:hover::after { transform: translateX(3px); }

/* Per-slide partner logo strip (bottom-left, under the CTA).
   Logos render as uniform white marks via CSS filter. */
#ekcan-hero .details > .logo-strip {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-top: 38px;
  min-height: 40px;
}
#ekcan-hero .details > .logo-strip img {
  height: 34px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}
/* Kefaluka mark is stacked (emblem + text) — needs more height to
   read at the same visual weight as the wordmark logos. */
#ekcan-hero .details > .logo-strip img[src*="kefaluka"] {
  height: 56px;
  max-width: 160px;
}
@media (max-width: 640px) {
  #ekcan-hero .details > .logo-strip { gap: 20px; margin-top: 26px; min-height: 30px; }
  #ekcan-hero .details > .logo-strip img { height: 26px; max-width: 90px; }
  #ekcan-hero .details > .logo-strip img[src*="kefaluka"] { height: 42px; max-width: 120px; }
}

/* Static section label in the pagination bar */
#ekcan-hero .pg-label {
  z-index: 60;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.22em;
  margin-left: 24px;
  white-space: nowrap;
}
@media (max-width: 640px) {
  #ekcan-hero .pg-label { font-size: 11px; margin-left: 14px; letter-spacing: 0.16em; }
}

#ekcan-hero .indicator {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  z-index: 60;
  background-color: var(--red, #c9242c);
}

#ekcan-hero .pagination {
  position: absolute;
  left: 0px;
  top: 0px;
  display: inline-flex;
  align-items: center;
}
#ekcan-hero .pagination > .pg-arrow {
  z-index: 60;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.33);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
  background: rgba(13, 38, 31, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#ekcan-hero .pagination > .pg-arrow:hover {
  background: var(--red, #c9242c);
  border-color: var(--red, #c9242c);
}
#ekcan-hero .pagination > .pg-arrow:nth-child(2) {
  margin-left: 16px;
}
#ekcan-hero .pagination > .pg-arrow svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  color: rgba(255, 255, 255, 0.85);
}

#ekcan-hero .progress-sub-container {
  margin-left: 24px;
  z-index: 60;
  width: clamp(180px, 32vw, 500px);
  height: 48px;
  display: flex;
  align-items: center;
}
#ekcan-hero .progress-sub-background {
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.2);
}
#ekcan-hero .progress-sub-foreground {
  height: 2px;
  background-color: var(--red, #c9242c);
  width: 0;
}

#ekcan-hero .slide-numbers {
  width: 50px;
  height: 48px;
  overflow: hidden;
  z-index: 60;
  position: relative;
  margin-left: 16px;
}
#ekcan-hero .slide-numbers .item {
  width: 50px;
  height: 48px;
  position: absolute;
  color: white;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#ekcan-hero .cover {
  position: absolute;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100%;
  background-color: var(--green-deep, #0d261f);
  z-index: 100;
}

/* İçerik koruma alanı (content protection zone)
   Okunabilirlik fotoğrafın/videonun iyi niyetine bırakılamaz: metnin durduğu
   sol sütunun arkasına kalıcı, yumuşak bir degrade konur. Sağ taraf ve görselin
   büyük kısmı açık kalır — sinematik his korunur. z-index 21: aktif kartın (20)
   üstünde, metnin (22) altında. */
#ekcan-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 21;
  background:
    linear-gradient(90deg,
      rgba(7, 17, 18, 0.74) 0%,
      rgba(7, 17, 18, 0.52) 38%,
      rgba(7, 17, 18, 0.14) 72%,
      rgba(7, 17, 18, 0) 100%),
    linear-gradient(180deg,
      rgba(7, 17, 18, 0.34) 0%,
      rgba(7, 17, 18, 0) 26%,
      rgba(7, 17, 18, 0) 62%,
      rgba(7, 17, 18, 0.46) 100%);
  pointer-events: none;
}
/* Mobilde metin görselin oransal olarak daha büyük kısmını kapladığı için
   koruma biraz daha güçlü ve neredeyse tam genişlik. */
@media (max-width: 900px) {
  #ekcan-hero::after {
    background:
      linear-gradient(90deg,
        rgba(7, 17, 18, 0.80) 0%,
        rgba(7, 17, 18, 0.62) 46%,
        rgba(7, 17, 18, 0.30) 78%,
        rgba(7, 17, 18, 0.12) 100%),
      linear-gradient(180deg,
        rgba(7, 17, 18, 0.42) 0%,
        rgba(7, 17, 18, 0) 24%,
        rgba(7, 17, 18, 0) 52%,
        rgba(7, 17, 18, 0.58) 100%);
  }
}

@media (max-width: 900px) {
  #ekcan-hero .pagination > .pg-arrow { width: 40px; height: 40px; }
  #ekcan-hero .pagination > .pg-arrow svg { width: 16px; height: 16px; }
}
@media (max-width: 640px) {
  #ekcan-hero .pagination > .pg-arrow { width: 36px; height: 36px; }
  #ekcan-hero .pagination > .pg-arrow svg { width: 14px; height: 14px; }
  #ekcan-hero .pagination > .pg-arrow:nth-child(2) { margin-left: 8px; }
  /* Dar ekranda ilerleme çubuğu gizlenir; süre bilgisini üstteki
     indicator zaten veriyor ve satır ekrana sığıyor. */
  #ekcan-hero .progress-sub-container { display: none; }
  /* Oklar sağ kenara alınır — sağ başparmakla tek elle kullanım için.
     Sıra: SEKTÖRLER · ‹ › — slayt numarası mobilde gösterilmez, böylece
     etiket doğrudan okların yanında durur. */
  #ekcan-hero .slide-numbers { display: none; }
  #ekcan-hero .pg-label { order: 1; margin-left: 0; margin-right: 14px; }
  #ekcan-hero .pg-arrow-left { order: 3; }
  #ekcan-hero .pg-arrow-right { order: 4; }
  #ekcan-hero .details > .cta > .discover {
    padding: 0 22px;
    height: 46px;
    font-size: 11.5px;
  }
}
@media (max-width: 900px) {
  /* Mobilde gövde metni daha okunur ve dar bir kolonda */
  #ekcan-hero .details > .desc {
    font-size: 17px;
    line-height: 1.58;
    max-width: 30ch;
    margin-top: 18px;
  }
  #ekcan-hero .details > .cta { margin-top: 22px; }

}
