/* ========== Tasarım Değişkenleri ========== */
:root {
  --primary: #8f0f0f;
  --primary-2: #b71c1c;
  --ink: #0f1115;
  --muted: #6b7280;
  --bg: #ffffff;
  --bgcard: #e1dddd;
  --bgsection-alt: #fafafa;

  --radius: 12px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* Karanlık Mod */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e5e7eb;
    --bg: #0b0d11;
    --bgcard: #141820;
    --bgsection-alt: #0f131a;
    --muted: #94a3b8;
  }
}

/* ========== Reset ve Temel Ayarlar ========== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Hareketi azaltmayı tercih eden kullanıcılar için animasyon/transition kapatma */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

/* Performans: Bölümleri gerektiğinde boya (opsiyonel) */
.section {
  content-visibility: auto;
  contain-intrinsic-size: 600px;
}

/* ========== Yerleşim Konteyneri ========== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ========== Üst Şerit (Topbar) ========== */
.topbar {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 0.95rem;
  padding: 8px 0;
}
.topbar .sep {
  opacity: 0.8;
  margin: 0 8px;
}

/* ========== Başlık / Navigasyon ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.header-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(12px, 2vw, 16px);
  align-items: center;
  padding: 12px 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.brand img {
  height: 70px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.brand .brand-text { line-height: 1; }
.brand .brand-text strong {
  display: block;
  font-weight: 800;
}
.brand .brand-text span {
  font-size: 0.85rem;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
}
.nav a:hover {
  background: color-mix(in srgb, var(--primary-2) 12%, transparent);
}

.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 6px 10px;
}

/* Erişilebilirlik: Odak stilleri */
a, button { outline: none; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary-2);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ========== Bölümler / Kartlar ========== */
.section {
  padding: clamp(48px, 6vw, 96px) 0;
}
.section.alt {
  background: var(--bgsection-alt);
}
.section h2 {
  margin: 0 0 16px;
  font-size: 1.8rem;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}
.card.donate {
  position: relative;
  overflow: visible;
}
.card.donate ul {
  margin: 0;
  padding-left: 18px;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ========== Vakitler (Namaz Saatleri) ========== */
.times-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.time-item {
  background: var(--bgcard);
  border: 1px solid #eee;
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.time-item h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--primary-2);
}
.time-item .val {
  font-size: 1.6rem;
  font-weight: 800;
}

.date-row {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ========== Günlük Kartlar ========== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: clamp(12px, 2vw, 16px);
}
.card-title {
  font-weight: 800;
  color: var(--primary-2);
  margin: 0 0 8px;
}
.card small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
}

/* ========== Foto/Video Galeri ========== */
.gallery-card {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
  align-items: center;
  min-height: 520px;
  height: 720px;
}

.gallery-card .viewport {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none; /* Yakınlaştırma/pan sırasında JS ile kullanılacak */
}

#galleryViewport {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 320px;
  overflow: hidden;
  background: #fff;
  border-radius: var(--radius);
}

/* Medyalar için birleştirilmiş kurallar */
#galleryViewport > img,
#galleryViewport > video {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  transform-origin: center center;
  transition: transform 0.25s ease, opacity 0.3s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
  background: transparent;
  will-change: transform;
}

/* Görünürlük sadece .visible sınıfı ile yönetilir */
#galleryViewport > .visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

/* İmleç (cursor) davranışı */
#galleryViewport img { cursor: zoom-in; }
#galleryViewport img.zoomed,
#galleryViewport video.zoomed { cursor: grab; }

/* Gerekirse resim/video için farklı z-index */
#galleryImage.visible { z-index: 10; }
#galleryVideo.visible { z-index: 20; }

/* Resim/Video için tekrar eden display:none kaldırıldı */

/* Altyazı/Etiket */
.gallery-card .caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 10px;
  background: #ffffff;
  color: #302a2a;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  gap: 8px;
  z-index: 999;
}

/* Galeri yön düğmeleri */
.nav-btn {
  width: 20px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.nav-btn:hover { transform: scale(1.05); }
.nav-btn:active { transform: scale(0.98); }

/* Galeri kontrol düğmeleri */
.gallery-card .controls {
  grid-column: 1 / -1;
  margin-top: 8px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.gallery-card .controls button {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  margin: 4px 6px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(7, 123, 63, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.2s ease;
}
.gallery-card .controls button:hover {
  background: linear-gradient(90deg, #43c07a 0%, #077b3f 100%);
  transform: translateY(-2px) scale(1.04);
}
.gallery-card .controls button:active { transform: scale(0.98); }

/* ========== Harita ========== */
.map-wrap {
  margin-top: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}
.map-wrap iframe {
  width: 100%;
  height: 380px;
  border: 0;
}

/* ========== Altbilgi (Footer) ========== */
.site-footer {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  color: #d1d5db;
  padding: 26px 0;
  margin-top: 40px;
}
.site-footer a { color: #fff; }

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px;
  gap: 12px;
}

.footer-left { text-align: left; }
.footer-center { text-align: center; flex: 1; }
.footer-right { text-align: right; }

/* ========== Duyarlı (Responsive) ========== */
@media (max-width: 840px) {
  .nav {
    display: none;
    grid-column: 1/-1;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav.show { display: flex; }
  .nav-toggle { display: block; justify-self: end; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }
  .footer-left,
  .footer-right { text-align: inherit; }
}