/* =========================================================
HOME FEATURE RAIL — PREMIUM v9
Scope: .home-feature-rail içindeki sol vitrin + sağ kartlar
"Neler Yapıyoruz" ve diğer bölümler ASLA etkilenmez.

YAKLAŞIM: Sabit çerçeve + Kırpmasız Görsel (Contain + Frame)
- media-frame: sabit 7:5 oran kilidi (tutarlı layout)
- media-frame-img: object-fit:contain ile kırpma riski minimuma indirilir
  (Teknik koruma: contain modu görseli çerçeveye sığdırır, crop uygulamaz;
   ancak çok dar/geniş oranlarda letterbox boşluğu oluşabilir.)
- Boş kalan alan: kurumsal koyu gradient (blur yok, temiz)
- Hover-band / oklar üst katmanda absolute olarak kalır

PREVIEW GÖRSEL: contain sayesinde dikey/yatay/kare görseller tam görünür
DETAY SAYFASI: contain modu — crop uygulanmaz, letterbox oluşabilir
========================================================= */

/* ══════════════════════════════════════════════════════════
   1. RAIL LAYOUT — Grid yapısı
   ══════════════════════════════════════════════════════════ */
.home-feature-rail {
  padding: 1.5rem 0 1.25rem;
  background: #fff;
}

.rail-container {
  max-width: 1580px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Rail grid layout managed by fluid-responsive.css */

@media (max-width: 1199px) {
  /* fluid-responsive.css handles grid-template-columns */
}

@media (max-width: 991px) {
  /* fluid-responsive.css handles single column switch */
}

/* ══════════════════════════════════════════════════════════
   2. RAIL-LEFT — Sol vitrin (hero slider)
   ══════════════════════════════════════════════════════════ */
/* Rail-left layout dimensions managed by fluid-responsive.css */
.rail-left {
  display: flex;
  border-radius: .85rem;
  overflow: hidden;
}

.rail-left-vitrin {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.rail-left-vitrin .hero-slider,
.rail-left-vitrin .hero-slider-loading,
.rail-left-vitrin .hero-slider-fallback {
  height: 100%;
  border-radius: .85rem;
}

.rail-left-vitrin .slider-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

@media (max-width: 991px) {
  .rail-left {
    height: auto;
  }
  .rail-left-vitrin .hero-slider,
  .rail-left-vitrin .hero-slider-loading,
  .rail-left-vitrin .hero-slider-fallback {
    min-height: 320px;
  }
}

/* ══════════════════════════════════════════════════════════
   3. RAIL-RIGHT — Sağ kolon (2 kart üst üste)
   ══════════════════════════════════════════════════════════ */
.rail-right {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  height: 100%;
  min-height: 0;
}

@media (max-width: 991px) {
  .rail-right {
    height: auto;
  }
}

/* ══════════════════════════════════════════════════════════
   4. FEATURED-CARD — Sağdaki her kart
   ══════════════════════════════════════════════════════════ */
.featured-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: .85rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.05);
  transition: box-shadow .3s ease;
  position: relative;
}

.featured-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,.10);
}

/* ── Badge — görselin üzerinde absolute konumda ── */
.featured-card .card-label-badge {
  position: absolute;
  top: .5rem;
  left: .6rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .55rem;
  border-radius: 6px;
  background: rgba(178,58,44,.88);
  color: #fff;
  font-weight: 700;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  width: fit-content;
  margin: 0;
  box-shadow: 0 1px 4px rgba(178,58,44,.18);
  pointer-events: none;
}

.featured-card .card-label-badge i {
  font-size: .72rem;
  color: #fff;
}

.featured-card .card-label-badge a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  pointer-events: auto;
}

/* ── Slider wrapper ── */
.featured-card-slider {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.featured-card-slide {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.featured-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  position: relative;
}

/* ══════════════════════════════════════════════════════════
   5. MEDIA-FRAME — 16:9 Cover (Backend Cover Pipeline ile)

   Backend'de upload anında 1600x900 center-crop cover üretilir.
   UI: coverUrl varsa coverUrl, yoksa orijinal kullanılır.
   object-fit:cover + 16:9 çerçeve → kart alanı tamamen dolar.
   Backend crop uygulanmışsa ek kırpma minimal olur;
   farklı oranlarda kenar kesimi olabilir.
   ══════════════════════════════════════════════════════════ */
.media-frame {
  position: relative;
  width: 100%;
  /* Desktop: aspect-ratio yok — flex:1 ile kart yüksekliğini doldurur.
     Rail grid stretch ile kart yüksekliği belirlenir;
     kendi aspect-ratio'su çakışma yaratır. */
  flex: 1;
  overflow: hidden;
  /* Siyah arka plan kaldırıldı — görsel yüklenmediğinde açık renk placeholder */
  background: #f0ede8;
  border-radius: 0;
}

/* Görsel: backend'den gelen cover 1600x900 → cover ile dolu kart.
   object-fit:cover görseli çerçeveye sığdırır ve kenarları kırpar.
   Backend'de cover crop yapılmışsa kırpma etkisi minimumdur;
   orijinal oran farklıysa kenar kesimi olabilir. */
.media-frame-img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  padding: 0;
  z-index: 1;
  transition: transform .45s cubic-bezier(.4,0,.2,1);
}

.featured-card:hover .media-frame-img {
  transform: scale(1.03);
}

/* Placeholder: görsel yoksa — media-frame 16:9 kendisi sabit */
.media-frame-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .4rem;
  color: rgba(255,255,255,.35);
  font-weight: 700;
  font-size: 1.2rem;
  z-index: 2;
}

.media-frame-placeholder i {
  font-size: 2.2rem;
  opacity: .5;
}

/* ══════════════════════════════════════════════════════════
   6. HOVER-BAND — Görselin ALTİNDA absolute (media-frame position:relative'dir)
   z-index: 5 (oklar z-index:60 ile her zaman üstte)
   pointer-events: none → tıklama kartın kendi linki ile çalışır
   ══════════════════════════════════════════════════════════ */
/* hover-band: .featured-card-link içinde absolute,
   .media-frame'in içine değil doğrudan .featured-card-link'e göre konumlanır.
   media-frame overflow:hidden olduğundan band görsel alanın altına yerleşir. */
.hover-band {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: .6rem .85rem .7rem;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0)   0%,
    rgba(0,0,0,.42) 45%,
    rgba(0,0,0,.68) 100%
  );
  color: #fff;
  z-index: 5;
  transform: translateY(0);
  opacity: 1;
  pointer-events: none;
}

/* hover-band is now always visible — no hover trigger needed */

.hover-band-title {
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
  margin-bottom: 0;
}

/* Altyazı: varsayılan gizli, hover'da accordion gibi açılır */
.hover-band-text {
  font-size: .75rem;
  line-height: 1.35;
  opacity: .88;
  max-height: 2.4em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  margin-top: .18rem;
}

/* hover-band-text is now always visible */

/* ══════════════════════════════════════════════════════════
   7. FEATURED-CARD NAV ARROWS — hover-only, en üst z-index
   Oklar .featured-card-link içinde absolute —
   görselin ortasında, hover-band ve görsel yüksekliğine göre konumlanır.
   ══════════════════════════════════════════════════════════ */
.featured-card-nav {
  position: absolute;
  /* Görselin tamamını kapsıyor; hover-band ile örtüşmez çünkü z-index:60 */
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 .5rem;
  z-index: 60;
}

.featured-card-nav-btn {
  pointer-events: auto;
  /* Varsayılan sıfır: yalnızca hover/focus-within'de belirir */
  opacity: 0;
  transition: opacity .22s ease, background .18s, transform .18s;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.28);
  color: #fff;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  position: relative;
  box-shadow: 0 1px 6px rgba(0,0,0,.25);
}

/* Hem kart hem slider hover'da oklar görünür */
.featured-card:hover .featured-card-nav-btn,
.featured-card:focus-within .featured-card-nav-btn,
.featured-card-slider:hover .featured-card-nav-btn,
.featured-card-slider:focus-within .featured-card-nav-btn {
  opacity: 1;
}

.featured-card-nav-btn:hover {
  background: rgba(0,0,0,.58);
  transform: scale(1.1);
}

.featured-card-nav-btn:active {
  transform: scale(.93);
}

/* ══════════════════════════════════════════════════════════
   8. SLIDE ANIMATION
   ══════════════════════════════════════════════════════════ */
.home-card-slide-container {
  animation: homeCardFadeSlide .6s cubic-bezier(.4,0,.2,1);
}

@keyframes homeCardFadeSlide {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobilde kart animasyonunu hızlandır + görsel transition kaldır */
@media (max-width: 767px) {
  .home-card-slide-container {
    animation-duration: .2s;
  }
  .featured-card .media-frame-img {
    transition: none;
  }
}

/* ══════════════════════════════════════════════════════════
   9. LOADING & EMPTY STATES (inherit from app.css)
   ══════════════════════════════════════════════════════════ */
.featured-card .three-col-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 140px;
}

.featured-card .three-col-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 140px;
  color: var(--text);
  background: rgba(0,0,0,.02);
}

/* ══════════════════════════════════════════════════════════
   10. MOBİL / RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
.featured-card {
  min-height: 0;
}
/* Tablet: 4:3 oran — 16:9'dan daha dengeli, daha az kenar crop */
.media-frame {
  aspect-ratio: 4 / 3;
  min-height: 0;
  flex: none;
}
  /* Touch cihazda hover yok → bant her zaman görünür ama ince kalır.
     max-height kaldırıldı — line-clamp metin sınırını yönetir,
     overflow:visible ile içerik kırpılması engellenir. */
  .hover-band {
    transform: translateY(0);
    opacity: 1;
    background: linear-gradient(
      180deg,
      rgba(0,0,0,0)   0%,
      rgba(0,0,0,.38) 45%,
      rgba(0,0,0,.62) 100%
    );
    padding: .5rem .75rem;
    pointer-events: none;
    max-height: none;
    overflow: visible;
  }
  /* Mobilde altyazı da görünür (hover olmadığı için) */
  .hover-band-text {
    opacity: .82;
    max-height: 1.6em;
    margin-top: .15rem;
  }
  .featured-card-nav-btn {
    opacity: 1;
  }

  /* Rail-right: side-by-side on tablet */
  .rail-right {
    flex-direction: row;
    max-height: none;
    gap: .75rem;
  }

  .rail-right .featured-card {
    flex: 1;
    min-height: 180px;
  }
}

@media (max-width: 575px) {
.rail-container {
  padding: 0 1rem;
}
.hover-band {
  padding: .4rem .65rem;
  max-height: none;
  overflow: visible;
}
  .hover-band-title {
    font-size: .78rem;
  }
  .hover-band-text {
    font-size: .7rem;
    -webkit-line-clamp: 1;
    max-height: 1.5em;
  }
  .featured-card .card-label-badge {
    font-size: .62rem;
    padding: .22rem .5rem;
    margin: .45rem 0 .3rem .6rem;
  }

  /* Phone: rail-right back to column */
  .rail-right {
    flex-direction: column;
  }

  .rail-right .featured-card {
    min-height: auto;
  }

  /* Küçük telefon: 4:3 — daha az crop */
  .media-frame {
    aspect-ratio: 4 / 3;
    flex: none;
  }
}

/* ══════════════════════════════════════════════════════════
   11. HOME-PAGE FULL-WIDTH OVERRIDE
   ══════════════════════════════════════════════════════════ */
body[data-page="home"] .home-feature-rail {
  padding-left: 0;
  padding-right: 0;
}

body[data-page="home"] .rail-container {
  max-width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (max-width: 767px) {
  body[data-page="home"] .rail-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ══════════════════════════════════════════════════════════
   12. BACKWARDS COMPAT — old class overrides
   Eski .home-top-grid, .three-col-card selectors hâlâ
   JS/public-enhancements'tan çağrılabiliyor.
   ══════════════════════════════════════════════════════════ */
.home-top-grid .three-col-card[data-module] .three-col-list-content {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════
   13. NEWS CARD (Haber/Duyuru listesi sayfaları)
   Blur-hybrid kaldırıldı. 16:9 cover standardı app.css'te.
   Burada yalnızca placeholder z-index korunur.
   ══════════════════════════════════════════════════════════ */
.news-card-img-wrap .news-card-img-placeholder {
  z-index: 2;
}

/* Bölüm 14 kaldırıldı — auto-fit heuristic'e gerek yok.
Tüm public görseller 16:9 cover standardı ile çalışır. */
