/* ============================================================
   hero.css — Hero Banner Stilleri
   Ana sayfa hero bölümü: tam genişlik, arka plan görseli/gradient,
   ken burns animasyonu, başlık, alt başlık ve CTA butonları.
   ============================================================ */

/* --- Ana Hero Container --- */

/* Hero bölümü — tam genişlik, yüksek bölüm */
.hero {
  position: relative;
  /* Minimum yükseklik — viewport'un %90'ı */
  min-height: 90vh;
  /* Header altından başlasın */
  margin-top: -80px;
  /* İçerik header üzerine binmesin */
  padding-top: 80px;
  /* Taşan içerik/görsel gizlenir */
  overflow: hidden;
  /* İçeriği dikey ortalar */
  display: flex;
  align-items: center;
}

/* --- Hero Slider --- */

/* Slider container — tüm slaytları içerir */
.hero-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Tek bir slayt */
.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  will-change: opacity;
}

/* Aktif slayt */
.hero-slide.active {
  opacity: 1;
}

/* Slayt videosu — görselle aynı kaplama, ama Ken Burns YOK:
   video zaten hareketli, üstüne zoom eklemek baş döndürücü oluyor. */
.hero-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Slayt görseli */
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Ken Burns animasyonu */
  animation: kenburns 12s ease-in-out infinite alternate;
  will-change: transform;
}

/* Aktif slaytlarda ken burns çalışsın */
.hero-slide.active img {
  animation: kenburns 12s ease-in-out infinite alternate;
}

/* Ken Burns zoom-in animasyonu */
@keyframes kenburns {
  0%   { transform: scale(1)    translate(0, 0); }
  100% { transform: scale(1.08) translate(-1.5%, -0.8%); }
}

/* --- Slider Navigasyon Noktaları --- */

.hero-dots {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Nokta görünüşte 8 px; dokunma/tıklama alanı 24 px (WCAG 2.5.8). Görsel ::before ile çizilir. */
.hero-dot {
  position: relative;
  width: 24px;
  height: 24px;
  margin: 0 -6px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

.hero-dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: all var(--transition-normal);
}

.hero-dot.active {
  width: 36px;
}

.hero-dot.active::before {
  background: var(--color-white);
  width: 24px;
  border-radius: 4px;
}

.hero-dot:hover::before {
  background: rgba(255, 255, 255, 0.8);
}

.hero-dot:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 0;
  border-radius: 6px;
}

/* Otomatik geçişi durdur / oynat (WCAG 2.2.2). */
.hero-pause {
  width: 28px;
  height: 28px;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: var(--color-white);
  cursor: pointer;
  padding: 0;
}

.hero-pause svg {
  width: 12px;
  height: 12px;
}

.hero-pause:hover {
  background: rgba(0, 0, 0, 0.45);
}

.hero-pause:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

/* --- Slider Ok Butonları --- */

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
  padding: 0;
}

.hero-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.hero-arrow svg {
  width: 20px;
  height: 20px;
}

.hero-arrow-prev { left: 1.5rem; }
.hero-arrow-next { right: 1.5rem; }

@media (min-width: 768px) {
  .hero-arrow-prev { left: 2.5rem; }
  .hero-arrow-next { right: 2.5rem; }
}

/* --- Hero Gradient Arka Plan (görsel yoksa) --- */

/* Gradient arka plan alternatifi */
.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Koyu gradient — metin okunabilirliği için */
  background: linear-gradient(
    135deg,
    #0A0A0A 0%,
    #1A1A2E 40%,
    #16213E 70%,
    #0F3460 100%
  );
}

/* Gradient üzerine animasyonlu parlama efekti */
.hero-gradient::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  /* Radial gradient — ışık efekti — gri/beyaz ton */
  background: radial-gradient(
    circle at 30% 50%,
    rgba(145, 147, 150, 0.12) 0%,
    transparent 50%
  );
  /* Yavaş dönme animasyonu */
  animation: hero-glow 15s ease-in-out infinite alternate;
}

/* Işık efekti animasyonu */
@keyframes hero-glow {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 0.5;
  }
  100% {
    transform: rotate(30deg) scale(1.2);
    opacity: 1;
  }
}

/* --- Hero Overlay --- */

/* Koyu overlay — görsel üzerinde metin okunabilirliği.

   Önceki hâli yalnızca yukarıdan aşağı %30→%60 bir gradyandı ve yetmiyordu:
   alt başlık tam olarak açık renkli şişe görsellerinin üstüne denk geliyor,
   yazı kayboluyordu (kullanıcı geri bildirimi: "slider üstündeki yazı
   okunmuyor").

   Çözüm iki katmanlı: metin SOLA yaslı olduğu için soldan sağa bir perde
   eklendi — yazının arkası kararır, görselin sağ tarafı açık kalır, yani
   fotoğraf boğulmaz. Dikey gradyan da butonların/okların altını korumak için
   korunuyor.

   --hero-scrim: slayt başına admin'den ayarlanabilir (Hero.js satır içi
   değişken olarak geçirir); tanımlı değilse 0.72 kullanılır. */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    /* Soldan sağa perde — metin sütununun arkasını karartır */
    linear-gradient(
      90deg,
      rgba(0, 0, 0, var(--hero-scrim, 0.72)) 0%,
      rgba(0, 0, 0, calc(var(--hero-scrim, 0.72) * 0.75)) 38%,
      rgba(0, 0, 0, 0.15) 72%,
      rgba(0, 0, 0, 0.05) 100%
    ),
    /* Dikey gradyan — üst/alt kenarları dengeler */
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.35) 0%,
      rgba(0, 0, 0, 0.2) 45%,
      rgba(0, 0, 0, 0.55) 100%
    );
}

/* Açık görseller için: admin slaytı "koyu yazı" moduna alırsa perde beyaza
   döner ve yazılar koyulaşır (aşağıdaki .hero-text-dark kuralları). */
.hero.hero-text-dark .hero-overlay {
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, var(--hero-scrim, 0.78)) 0%,
      rgba(255, 255, 255, calc(var(--hero-scrim, 0.78) * 0.75)) 38%,
      rgba(255, 255, 255, 0.2) 72%,
      rgba(255, 255, 255, 0.05) 100%
    );
}

/* --- Hero İçerik --- */

/* Hero metin içeriği — overlay üzerinde */
.hero-content {
  position: relative;
  /* Overlay'ın üstünde */
  z-index: 2;
  /* İçerik boyutu */
  max-width: 700px;
  /* Animasyon — sayfa yüklendiğinde yukarı kayarak görünür */
  animation: heroFadeIn 1s ease-out forwards;
}

/* Hero yüklenme animasyonu */
@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero üst etiketi */
.hero-label {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  /* Eskiden --color-accent (gri #919396) idi ve fotoğraf üstünde okunmuyordu.
     Hero her zaman görsel üzerinde durduğu için burada tam beyaz kullanılır;
     kenarlık gri kalarak marka vurgusunu korur. */
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  /* Logo griyle uyumlu sol kenarık */
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-sm);
  margin-bottom: var(--space-lg);
  /* Gecikmelir görünme animasyonu */
  animation: heroFadeIn 1s ease-out 0.2s both;
}

/* Hero ana başlık */
.hero-title {
  font-size: var(--font-size-hero);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-lg);
  /* Görselin açık bir yerine denk gelse de okunsun */
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
  /* Gecikmeli animasyon */
  animation: heroFadeIn 1s ease-out 0.4s both;
}

/* Hero alt başlık / açıklama */
.hero-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  /* Eskiden %80 opaklıktaydı; şişe görsellerinin üstünde kayboluyordu.
     Tam beyaz + gölge ile her zeminde okunur. */
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  line-height: var(--line-height-loose);
  margin-bottom: var(--space-xl);
  /* Gecikmeli animasyon */
  animation: heroFadeIn 1s ease-out 0.6s both;
}

/* --- Açık görseller için koyu yazı modu (slayt başına admin ayarı) --- */
.hero.hero-text-dark .hero-label,
.hero.hero-text-dark .hero-title,
.hero.hero-text-dark .hero-subtitle {
  color: var(--color-gray-900);
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.75);
}

.hero.hero-text-dark .hero-label {
  border-left-color: var(--color-gray-900);
}

.hero.hero-text-dark .hero-subtitle.rich-text a {
  color: var(--color-gray-900);
}

/* Slayt alt basligi admin'den zengin metin olarak gelebiliyor: RichText bir
   <div> uretir ve paragraflari icine koyar, tek <p> ile ayni gorunmeli. */
.hero-subtitle.rich-text > :first-child { margin-top: 0; }
.hero-subtitle.rich-text > :last-child { margin-bottom: 0; }
.hero-subtitle.rich-text p { margin-bottom: var(--space-sm); }
.hero-subtitle.rich-text a { color: #fff; text-decoration: underline; }

/* Hero buton grubu */
.hero-actions {
  display: flex;
  /* Butonlar arası boşluk */
  gap: var(--space-md);
  /* Mobilde alt alta */
  flex-wrap: wrap;
  /* Gecikmeli animasyon */
  animation: heroFadeIn 1s ease-out 0.8s both;
}

/* --- Hero Alt Şerit (Scroll İndikatörü) --- */

/* "Aşağı kaydır" göstergesi */
.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  /* Yatay ortala */
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  /* Yukarı-aşağı zıplama animasyonu */
  animation: bounce 2s ease-in-out infinite;
}

/* Scroll ok görseli/ikonu */
.hero-scroll-indicator svg {
  width: 24px;
  height: 24px;
  color: rgba(255, 255, 255, 0.6);
}

/* Zıplama animasyonu */
@keyframes bounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

/* --- Hero Parçacık Efekti Arka Planı --- */

/* Dekoratif yüzen parçacıklar */
.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* İçeriğin altında */
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

/* Tek bir parçacık */
.particle {
  position: absolute;
  /* Yuvarlak */
  border-radius: 50%;
  /* Logo griyle uyumlu neredeyse saydam beyaz parçacıklar */
  background-color: rgba(255, 255, 255, 0.12);
  /* Yukarı süzülme animasyonu */
  animation: float-up linear infinite;
}

/* Parçacık yukarı süzülme */
@keyframes float-up {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-20vh) scale(1);
    opacity: 0;
  }
}

/* --- Responsive --- */

@media (min-width: 768px) {
  /* Tablet'te hero daha yüksek */
  .hero {
    min-height: 85vh;
  }
}

@media (min-width: 1024px) {
  /* Masaüstünde hero tam ekran */
  .hero {
    min-height: 100vh;
  }

  /* İçerik biraz daha geniş */
  .hero-content {
    max-width: 800px;
  }
}

/* --- Slayt Mobil Görseli --- */

/* Ana medya VIDEO olan slaytlarda telefon görseli video yerine geçer.
   Seçim CSS'te yapılır: JS ile ekran genişliği ölçülseydi sunucu render'ı
   yanlış medyayı basar, hero LCP öğesi olduğu için gecikme görünür olurdu.
   (Görsel slaytlarda aynı işi <picture> + <source media> yapıyor.) */
.hero-slide .hero-mobil {
  display: none;
}

/* Telefon gorseli telefonlarda VE dikey tabletlerde kullanilir: dikey tablette
   yatay 16:9 gorsel uzun alana basildiginda yanlarindan yarisi kesiliyordu. */
@media (max-width: 767px), (max-width: 1023px) and (orientation: portrait) {
  .hero-slide video.hero-masaustu {
    display: none;
  }

  .hero-slide .hero-mobil {
    display: block;
  }
}
