/* ==========================================================================
   MDFCAD — ortak site üst barı (bütün sayfalarda aynı header)
   demo.css / egitim.css ile birlikte yüklenir; renkleri sayfa değişkenlerinden
   alır (yoksa aşağıdaki güvenli değerler kullanılır).
   Yapı: .mheader > .mheader-in > .mbrand + nav.mnav + .mcta + details.mmenu
   ========================================================================== */

.mheader {
  position: sticky;
  top: 0;
  z-index: 70;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line, #e6e9ee);
  transition: box-shadow 0.2s ease;
}

/* Önizleme şeridinin altındaki sayfalarda (demo.html) bar yüksekliği kadar it */
.mheader--below-bar {
  top: var(--bar-h, 0px);
}

.mheader.scrolled {
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.07);
}

.mheader-in {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 24px;
  min-height: 64px;
}

.mbrand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink, #111827);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  flex: 0 0 auto;
}

.mbrand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent, #1a64e4);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 800;
}

.mbrand-name {
  font-size: 1.125rem;
}

/* --- Masaüstü menü -------------------------------------------------------- */

.mnav {
  display: none;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.mnav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted, #5f6b7a);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.mnav a:hover {
  color: var(--ink, #111827);
  background: var(--bg-alt, #f7f8fa);
}

.mnav a[aria-current="page"] {
  color: var(--accent-strong, #1453c4);
  background: var(--accent-soft, #eef3fe);
  font-weight: 600;
}

.mcta {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  flex: 0 0 auto;
}

/* --- Mobil menü (JS'siz <details> ile çalışır) ---------------------------- */

.mmenu {
  position: relative;
  margin-left: auto;
}

.mburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-2, #d3d9e0);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  list-style: none;
}

.mburger::-webkit-details-marker {
  display: none;
}

.mburger > span,
.mburger > span::before,
.mburger > span::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink, #111827);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.mburger > span {
  position: relative;
}

.mburger > span::before,
.mburger > span::after {
  content: "";
  position: absolute;
  left: 0;
}

.mburger > span::before {
  top: -6px;
}

.mburger > span::after {
  top: 6px;
}

.mmenu[open] .mburger > span {
  background: transparent;
}

.mmenu[open] .mburger > span::before {
  transform: translateY(6px) rotate(45deg);
}

.mmenu[open] .mburger > span::after {
  transform: translateY(-6px) rotate(-45deg);
}

.mpanel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, calc(100vw - 32px));
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line, #e6e9ee);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

.mpanel nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mpanel nav a {
  display: block;
  padding: 11px 12px;
  border-radius: 9px;
  color: var(--slate, #334155);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.mpanel nav a:hover {
  background: var(--bg-alt, #f7f8fa);
  color: var(--ink, #111827);
}

.mpanel nav a[aria-current="page"] {
  background: var(--accent-soft, #eef3fe);
  color: var(--accent-strong, #1453c4);
  font-weight: 600;
}

.mpanel .btn {
  width: 100%;
  margin-top: 8px;
}

/* --- Kırılımlar ----------------------------------------------------------- */

@media (min-width: 1024px) {
  .mnav {
    display: flex;
  }

  .mcta {
    display: flex;
  }

  .mmenu {
    display: none;
  }
}

@media (max-width: 559px) {
  .mheader-in {
    padding-inline: 16px;
  }
}

@media print {
  .mheader {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mheader,
  .mburger > span,
  .mburger > span::before,
  .mburger > span::after {
    transition: none;
  }
}
