/* ============================================================
   PEYSAN EXPORT — news-detail.css
   Dış bağlantısı olmayan haberler için sayfa değiştirmeden açılan
   detay katmanı — assets/css/product-detail.css'teki .pd-* ile aynı
   editoryal dil (fotoğraf + bilgi sütunu, büyük radius, ince gölge).
   ============================================================ */

.news-detail {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: var(--s-xl);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0.45s;
}
.news-detail.is-open { opacity: 1; visibility: visible; }

.nd-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 17, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.nd-close {
  position: absolute;
  z-index: 4;
  top: var(--s-lg);
  right: var(--s-lg);
  display: grid;
  place-items: center;
  width: 2.7em;
  height: 2.7em;
  border-radius: 50%;
  background: rgba(20, 17, 14, 0.5);
  color: var(--n-200);
  backdrop-filter: blur(6px);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.nd-close:hover { background: var(--b-500); transform: rotate(90deg); }
.nd-close svg { width: 1.05em; height: 1.05em; }

.nd-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 76em; /* .pd-panel (product-detail.css) ile birebir aynı boyut */
  height: min(85vh, 46em);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  background: var(--n-100);
  border-radius: 2em;
  box-shadow: 0 3em 8em rgba(0, 0, 0, 0.4);
  transform: translateY(1.2em) scale(0.985);
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}
.news-detail.is-open .nd-panel { transform: translateY(0) scale(1); opacity: 1; }

/* ---------- Fotoğraf sütunu — sabit yarı-yarıya bölmek yerine kutunun
   genişliği fotoğrafın kendi (dikey/yatay) oranına göre kendiliğinden
   ayarlanıyor: img'a "height:100%; width:auto" verilince kutu tam
   fotoğrafı saracak şekilde büyüyor — ne boşluk kalıyor ne taşma oluyor.
   Çok geniş/kare bir görselin bilgi sütununu sıkıştırmaması için üst
   sınır (max-width) var; dar/dikey görsellerde bu sınıra hiç değmez. */
.nd-media {
  position: relative;
  flex: 0 1 auto;
  max-width: 62%;
  height: 100%;
  min-width: 18em;
  overflow: hidden;
  background: var(--n-300);
  display: flex;
  flex-direction: column;
}
/* Afişlerde (ör. fuar duyurusu) tasarımın tamamı görünür kalır.
   Galerili haberlerde ise yatay fotoğraf alanı dengeli doldurur. */
.nd-main-image {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
}
.nd-main-image img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.03);
  opacity: 0;
  transition: opacity 1s var(--ease), transform 1.4s var(--ease);
}
.news-detail.is-open .nd-main-image img { opacity: 1; transform: scale(1); }
.nd-media.has-gallery .nd-main-image img { object-fit: cover; }
.nd-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(20,17,14,0.32) 0%, rgba(20,17,14,0) 22%);
  pointer-events: none;
}
.nd-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45em;
  padding: 0.7em;
  background: var(--n-200);
}
.nd-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 0.45em;
  opacity: 0.62;
  transition: border-color 0.25s var(--ease), opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.nd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nd-thumb:hover, .nd-thumb:focus-visible { opacity: 1; transform: translateY(-0.1em); }
.nd-thumb:focus-visible { outline: none; }
.nd-thumb.is-active { border-color: var(--b-400); opacity: 1; }

/* ---------- Bilgi sütunu ---------- */
.nd-info {
  position: relative;
  flex: 1 1 auto;
  min-width: 22em;
  height: 100%;
  overflow-y: auto;
  padding: var(--s-2xl) var(--s-2xl) var(--s-2xl);
  display: flex;
  flex-direction: column;
}
.nd-cat {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.4em 0.9em;
  border-radius: var(--r-full);
  background: var(--b-100);
  color: var(--b-400);
  font-size: var(--fs-body-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--s-md);
}
.nd-title {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  line-height: 1.12;
  margin-bottom: var(--s-md);
}
.nd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-lg);
  padding: var(--s-md) 0;
  margin-bottom: var(--s-lg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.nd-meta-item { display: flex; align-items: center; gap: 0.6em; }
.nd-meta-item svg { width: 1.3em; height: 1.3em; color: var(--b-400); flex: none; }
.nd-meta-item .lbl { display: flex; flex-direction: column; gap: 0.1em; line-height: 1.25; }
.nd-meta-item .lbl span:first-child { font-size: var(--fs-body-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.nd-meta-item .lbl span:last-child { font-weight: 600; color: var(--text); }

.nd-body { color: var(--text); line-height: var(--lh-160); }
.nd-body p { margin-bottom: var(--s-md); }
.nd-body p:last-child { margin-bottom: 0; }

.nd-actions { margin-top: var(--s-xl); display: flex; flex-wrap: wrap; gap: var(--s-md); }

@media (max-width: 900px) {
  .news-detail { padding: 0; }
  .nd-panel {
    flex-direction: column;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
    overflow-y: auto;
  }
  .nd-media { height: auto; max-width: none; min-height: 16em; max-height: 46vh; }
  .nd-main-image { height: min(36vh, 22em); flex: none; }
  .nd-main-image img { height: 100%; max-height: none; width: 100%; }
  .nd-info { height: auto; min-width: 0; overflow-y: visible; padding: var(--s-xl) var(--s-lg) var(--s-2xl); }
}

@media (prefers-reduced-motion: reduce) {
  .nd-media img { transition: opacity 0.3s linear !important; transform: none !important; }
  .nd-panel { transition: opacity 0.3s linear !important; transform: none !important; }
}
