/* ========== Reset & Base ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; overflow-x: hidden; } /* yatay taşmayı kes */
img, video, svg, canvas { display: block; max-width: 100%; height: auto; }
iframe { max-width: 100%; border: 0; }
body {
  font-family: 'Aboreto', system-ui;
  line-height: 1.6;
  color: #312d2d;
  background: #fff;
}
a:focus-visible, button:focus-visible { outline: 3px solid #3b82f6; outline-offset: 2px; }

/* menü açıkken arka plan kaymasın */
body.nav-open { overflow: hidden; }

/* ========== Header ========== */
header {
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 1px 0 #e0e0e0;
  background: #fff;
}
.containerbar {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Logo */
.logo {
  display: flex;
  justify-content: center;
  color: #666565;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(30px, 4.5vw, 55px);
  margin: 24px 0 10px;
  letter-spacing: .2px;
  padding: 0 64px 0 16px; /* mobilde burger için sağ boşluk */
}

/* ========== AdSense ========== */
.ad-wrap,
.ad-in-article,
.adsense-header {
  width: 100%;
  margin: 12px auto;
  text-align: center;
}
.ad-wrap ins.adsbygoogle,
.ad-in-article ins.adsbygoogle,
.adsense-header ins.adsbygoogle {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 120px; /* CLS azalt */
  overflow: hidden;  /* iframe taşması olmasın */
}

/* ========== Navbar ========== */
.navbar {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative; /* referans */
  gap: 8px;
  padding-bottom: 8px;
}

/* Hamburger */
.menu-toggle {
  display: none;               /* desktop/tablet’te gizli */
  position: fixed;             /* mobilde her zaman görünür */
  right: 12px;
  top: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 10010;              /* reklamların üstünde */
}
.menu-toggle .bar {
  display: block;
  width: 30px; height: 3px;
  background: #666565;
  border-radius: 2px;
  margin: 6px auto;
}

/* Desktop/Tablet menü */
.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  position: static;
  z-index: 1;
}
.nav-links li a {
  text-decoration: none;
  color: #312d2d;
  font-size: 18px;
  font-weight: 300;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background-color .2s ease, color .2s ease;
  white-space: nowrap;
}
.nav-links li a:hover { background: #424242; color: #fff; }

/* ========== Main ========== */
main { padding: 16px 0 24px; }

/* Grid (EN sayfada kullanılıyor) */
.grid-container {
  display: grid;
  gap: 20px;
  padding: 20px;
  margin: 10px auto 24px;
  width: min(92%, 1600px);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}

/* Flex (TR sayfada kullanılabilir) */
.card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(16px, 2vw, 32px);
  width: min(92%, 1200px);
  margin: 20px auto 0;
}

.card, .cards {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  overflow: hidden;
  min-width: 0;  /* flex/grid overflow fix */
}
.card { max-width: 600px; flex: 1 1 320px; transition: .25s; }
.cards { transition: .25s; }
.card:hover, .cards:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,.15); }

.card-img img,
.cards img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-bottom: 1px solid #ddd;
}

.cardtext, .card-content {
  color: #666565;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: clamp(10px, 2vw, 18px);
  font-family: Arial, Helvetica, sans-serif;
  overflow-wrap: anywhere;     /* uzun kelime/URL kır */
}
.cardtext h2,
.card-content h3 { font-size: clamp(18px, 2.2vw, 22px); margin-bottom: 10px; }
.cardtext p,
.card-content p  { font-size: clamp(14px, 2vw, 16px); line-height: 1.7; padding: 6px 4px; }

.cardtext a, .btn {
  display: inline-block;
  max-width: 100%;
  margin-top: 10px;
  padding: 10px 20px;
  background: #fff;
  border: 1px solid #9b9b9b;
  color: #666565;
  border-radius: 8px;
  text-decoration: none;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
  font-family: 'Aboreto', system-ui;
  cursor: pointer;
}
.cardtext a:hover, .btn:hover { background: #f6f6f6; border-color: #7c7c7c; transform: translateY(-1px); }

/* ========== PROJELER (tamamen responsive) ========== */
.araBaşlık { text-align: center; margin: 28px 0 6px; padding: 0 16px; }
.araBaşlık h2 { font-size: clamp(28px, 6vw, 70px); color: #666565; font-weight: 300; }

/* Grid tabanlı, auto-fit: mobil tek sütun → tablet/desktop çok sütun */
.container-proje {
  width: min(92%, 1600px);
  margin: 20px auto 40px;
  display: grid;
  gap: clamp(16px, 2vw, 28px);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: stretch;
}

.card-proje {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  overflow: hidden;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
  min-width: 0; /* grid overflow fix */
}
.card-proje:hover { transform: translateY(-6px); box-shadow: 0 10px 24px rgba(0,0,0,.12); }

.card-proje .projebox {
  width: 100%;
  overflow: hidden;
}
.card-proje .projebox img {
  width: 100%;
  aspect-ratio: 4/3;     /* tutarlı oran */
  object-fit: cover;
  display: block;
}

.card-proje .projetext {
  padding: 16px;
  text-align: center;
}
.card-proje .projetext h4 {
  font-size: clamp(16px, 2vw, 20px);
  color: #666565;
  font-weight: 400;
}

/* ========== Popup (değişmedi) ========== */
.popup {
  display: none;
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0,0,0,.8);
  padding: 20px;
  border-radius: 8px;
  z-index: 1000;
  width: 80%; max-width: 600px;
}
.popup video { width: 100%; height: auto; }
.popup .close {
  position: absolute; top: 10px; right: 20px;
  font-size: 24px; color: #fff; cursor: pointer;
}

/* ========== Responsive ========== */
/* Mobil ≤600px */
@media (max-width: 600px) {
  /* Hamburger görünür ve sabit */
  .menu-toggle { display: block; }

  /* Tam ekran overlay menü (reklamların üstünde) */
  .nav-links {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh; /* mobil chrome adres çubuğu değişimlerinde stabil */
    z-index: 10000;
    background: rgba(255,255,255,.98);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 80px 16px 24px;
    gap: 16px;
    overflow: auto;
  }
  .nav-links.active { display: flex; }

  /* Logo – burger ile çakışmasın */
  .logo { font-size: 28px; margin: 20px 0 8px; padding-right: 72px; }

  /* Kartlar tek sütun */
  .grid-container { width: 95%; grid-template-columns: 1fr; gap: 16px; }
  .card-container { width: min(94%, 700px); gap: 16px; }
  .card { flex: 1 1 100%; }

  /* Projeler tek sütun */
  .container-proje { grid-template-columns: 1fr; }
}

/* Tablet 601–1024px */
@media (min-width: 601px) and (max-width: 1024px) {
  .menu-toggle { display: none; }
  .nav-links {
    display: flex; position: static; transform: none;
    width: auto; background: transparent; border: 0; box-shadow: none; padding: 0;
  }
  .logo { font-size: 36px; padding-right: 0; }
  .grid-container { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .container-proje { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* Desktop ≥1280 */
@media (min-width: 1280px) {
  .containerbar { max-width: 1360px; }
}

/* 1080p/2K ≥1920 */
@media (min-width: 1920px) {
  body { font-size: 18px; }
  .logo { font-size: 60px; }
  .container-proje { width: min(88%, 1600px); }
}

/* 4K/TV ≥2560 */
@media (min-width: 2560px) {
  body { font-size: 20px; }
  .logo { font-size: 72px; }
  .card-container, .grid-container, .container-proje {
    width: min(80%, 1600px);
    gap: 32px;
  }
  .grid-container { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .container-proje { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
