/* ==================================================================
   EMEA Technology | CODESYS Türkiye
   header.css — üst şerit, ana başlık, menü ve dar ekran çekmecesi.

   Kendi kendine yeten dosya: başlıkla ilgili HER kural burada.
   main.css içinde başlık kuralı bırakılmadı.

   Yapı kararı — önemli:
   Çekmece (dar ekran menüsü) <header> ETİKETİNİN İÇİNDE DEĞİL, KARDEŞİ.
   Daha önce içeride olduğu için başlığın kapsayıcı bloğuna ve iç içe
   geçmiş kabuk genişliğine takılıyor, panel eziliyor/taşıyordu.
   ================================================================== */

/* ---------- Ortak kabuk — TEK seviye, iç içe kullanılmaz ---------- */
.wrap {
  width: min(100% - 2.4rem, 1300px);
  margin-inline: auto;
}

/* ---------- 1. Üst şerit ----------------------------------------- */
.topbar {
  background: var(--ink);
  color: #93a7b6;
  font-size: .82rem;
}
.topbar__in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 40px; flex-wrap: wrap;
    width: 100%;
    padding: 0 30px;
}
.topbar__claim { margin: 0; letter-spacing: .01em; }
.topbar__links { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.topbar__links li { margin: 0; }
.topbar__links a { color: #d3e0ea; font-weight: 500; text-decoration: none; }
.topbar__links a:hover { color: #fff; }

/* ---------- 2. Ana başlık ---------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 60;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-head.is-stuck { box-shadow: 0 6px 24px -18px rgba(11, 26, 36, .55); }

.site-head__in {
  display: flex; align-items: center; justify-content: space-between;
  gap: clamp(1rem, 2.5vw, 2.4rem);
  min-height: 78px;
    width: 100%;
    padding: 0 30px;
}

/* ---------- 3. Marka --------------------------------------------- */
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; flex: none; }
.brand__mark { width: 40px; height: 40px; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.16rem; font-weight: 700; letter-spacing: -.04em; color: var(--ink);
  white-space: nowrap;
}
.brand__sub {
  font-size: .7rem; font-weight: 500; color: var(--muted);
  letter-spacing: .085em; white-space: nowrap;
}

/* ---------- 4. Menü — görünen kısım ------------------------------ */
.mainnav { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }
.mainnav__list {
  display: flex; align-items: center; flex-wrap: nowrap;
  /* Tek aralık kaynağı: gap. (Ayrıca margin verilirse toplam genişlik
     şişip menü markanın üstüne taşıyor.) */
  gap: clamp(.3rem, .7vw, .7rem);
  list-style: none; margin: 0; padding: 0;
}
.mainnav__item { margin: 0; position: relative; }

.mainnav__link {
  position: relative;
  display: inline-flex; align-items: center; gap: .38rem;
  padding: .62rem .3rem;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-display);
  font-size: .94rem; font-weight: 500; letter-spacing: -.02em;
  color: var(--body);
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s var(--ease);
}
/* Ortadan açılan ince vurgu çizgisi */
.mainnav__link::after {
  content: "";
  position: absolute; left: .3rem; right: .3rem; bottom: -.1rem;
  height: 2px; border-radius: 2px; background: var(--acc);
  transform: scaleX(0); transform-origin: center;
  transition: transform .28s var(--ease);
}
.mainnav__link:hover { color: var(--ink); }
.mainnav__link:hover::after { transform: scaleX(1); }
.mainnav__link.is-on { color: var(--ink); font-weight: 600; }
.mainnav__link.is-on::after { transform: scaleX(1); }

.mainnav__arrow { width: 10px; height: 6px; opacity: .5; transition: transform .22s var(--ease), opacity .22s var(--ease); }
/* menü sığmıyorsa çekmeceye geçilir; sıkışma/örtüşme olmaz */
.mainnav__item--sub.is-open .mainnav__arrow { transform: rotate(180deg); opacity: 1; }
.mainnav__item--sub.is-open .mainnav__link { color: var(--ink); }

/* ---------- 5. Açılır kart — sade, mega değil -------------------- */
.drop {
  position: absolute; top: calc(100% + .7rem); left: 50%;
  width: 340px; margin-left: -170px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 48px -20px rgba(11, 26, 36, .3);
  padding: .4rem;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
/* Küçük ok ucu */
.drop::before {
  content: "";
  position: absolute; top: -5px; left: 50%; margin-left: -5px;
  width: 10px; height: 10px; background: #fff;
  border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.mainnav__item--sub.is-open .drop { opacity: 1; visibility: visible; transform: none; }

.drop__list { list-style: none; margin: 0; padding: 0; }
.drop__list li { margin: 0; }

.drop__link {
  display: block; padding: .7rem .8rem;
  border-radius: 9px; text-decoration: none;
  transition: background .16s var(--ease);
}
.drop__link:hover, .drop__link.is-on { background: var(--bg-2); }
.drop__title {
  display: block;
  font-family: var(--font-display);
  font-size: .93rem; font-weight: 600; letter-spacing: -.025em; color: var(--ink);
}
.drop__desc {
  display: block; margin-top: .15rem;
  font-size: .82rem; line-height: 1.5; color: var(--muted);
}
.drop__link:hover .drop__title, .drop__link.is-on .drop__title { color: var(--acc-deep); }

/* ---------- 6. Sağdaki eylemler ---------------------------------- */
.site-head__actions { display: flex; align-items: center; gap: .7rem; flex: none; }

.cta {
  display: inline-flex; align-items: center;
  padding: .68rem 1.25rem;
  background: var(--ink); color: #fff;
  border-radius: 8px; text-decoration: none;
  font-family: var(--font-display);
  font-size: .9rem; font-weight: 600; letter-spacing: -.02em;
  white-space: nowrap;
  transition: background .18s var(--ease);
}
.cta:hover { background: var(--acc-deep); color: #fff; }

.menu-btn {
  display: none; align-items: center; gap: .55rem;
  padding: .58rem .9rem;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-display); font-size: .88rem; font-weight: 600;
}
.menu-btn:hover { border-color: var(--ink); }
.menu-btn__bars { position: relative; width: 16px; height: 2px; background: currentColor; border-radius: 2px; }
.menu-btn__bars::before, .menu-btn__bars::after {
  content: ""; position: absolute; left: 0; width: 16px; height: 2px;
  background: currentColor; border-radius: 2px;
}
.menu-btn__bars::before { top: -5px; }
.menu-btn__bars::after  { top:  5px; }

/* ---------- 7. Çekmece (dar ekran) ------------------------------- */
/* header'ın kardeşi olduğu için sabit konumu hiçbir şeye takılmaz */
.cekmece {
  position: fixed; inset: 0; z-index: 90;
  background: #fff;
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
  animation: cekmeceAc .24s var(--ease) both;
}
.cekmece[hidden] { display: none; }

@keyframes cekmeceAc {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

.cekmece__head {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0 1.2rem; min-height: 66px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.cekmece__brand {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 700; letter-spacing: -.035em; color: var(--ink);
}
.cekmece__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 50%;
  cursor: pointer;
}
.cekmece__close svg { width: 14px; height: 14px; }
.cekmece__close:hover { border-color: var(--ink); }

.cekmece__nav { padding: .6rem 1.2rem 2.4rem; }
.cekmece__list { list-style: none; margin: 0; padding: 0; }
.cekmece__item { margin: 0; border-bottom: 1px solid var(--line); }

.cekmece__link {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%;
  padding: 1.05rem 0;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.12rem; font-weight: 600; letter-spacing: -.03em;
  color: var(--ink); text-align: left; text-decoration: none;
}
.cekmece__link.is-on { color: var(--acc-deep); }

/* Artı / eksi işareti */
.cekmece__plus { position: relative; width: 14px; height: 14px; flex: none; }
.cekmece__plus::before, .cekmece__plus::after {
  content: ""; position: absolute; background: var(--acc); border-radius: 2px;
  transition: transform .22s var(--ease);
}
.cekmece__plus::before { top: 6px; left: 0; width: 14px; height: 2px; }
.cekmece__plus::after  { left: 6px; top: 0; width: 2px; height: 14px; }
.cekmece__item.is-open .cekmece__plus::after { transform: scaleY(0); }

.cekmece__sub {
  display: none;
  list-style: none; margin: 0 0 .9rem; padding: .3rem 0 0 .9rem;
  border-left: 2px solid var(--acc);
}
.cekmece__item.is-open .cekmece__sub { display: block; }
.cekmece__sub li { margin: 0; }
.cekmece__sublink {
  display: block; padding: .7rem 0;
  font-size: .99rem; color: var(--body); text-decoration: none;
}
.cekmece__sublink.is-on { color: var(--acc-deep); font-weight: 600; }

.cekmece__cta {
  display: block; margin-top: 1.6rem;
  padding: 1rem 1.3rem;
  background: var(--ink); color: #fff;
  border-radius: 10px; text-align: center; text-decoration: none;
  font-family: var(--font-display); font-size: 1rem; font-weight: 600;
}

.cekmece__contact { display: grid; gap: .55rem; margin-top: 1.2rem; }
.cekmece__contact a {
  display: block; padding: .85rem 1rem;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; text-decoration: none;
  font-family: var(--font-display); font-weight: 600; color: var(--ink);
  text-align: center;
}

/* ---------- 8. Duyarlılık ---------------------------------------- */
/* Menü sığmadığı anda çekmeceye geçilir; sıkışık görünüm yok. */
@media (max-width: 1300px) {
  .mainnav { display: none; }
  .menu-btn { display: inline-flex; }
  .site-head__in { justify-content: space-between; }
}

@media (max-width: 560px) {
  .topbar__in { justify-content: center; text-align: center; gap: .3rem; }
  .topbar__links { gap: 1.1rem; }
  .brand__sub { display: none; }
  .cta { display: none; }          /* çekmecede zaten var */
  .site-head__in { min-height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  .cekmece { animation: none; }
  .mainnav__link::after, .mainnav__arrow, .drop { transition: none; }
}
