/*
Theme Name: Kurumsal Minimal
Theme URI: https://example.com/
Author: Bülent Özçetin
Description: Kurumsal, ultra-minimal, mobil uyumlu, PageSpeed odaklı WordPress teması.
Version: 2.5.3
Requires at least: 6.3
Tested up to: 6.6
Requires PHP: 8.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kurumsal-minimal
*/

/* Minimal reset */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; line-height: 1.6; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; }
.container { width: min(1100px, 92vw); margin-inline: auto; }
.skip-link { position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }
.skip-link:focus { left: 1rem; top: 1rem; width:auto; height:auto; padding:.5rem .75rem; background:#fff; border:1px solid #000; z-index:9999; }

.site-header { padding: 1rem 0; border-bottom: 1px solid rgba(0,0,0,.08); }
.site-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.site-title a { text-decoration: none; }
.site-nav { margin-top: .5rem; }
.site-nav ul { display:flex; flex-wrap:wrap; gap:.75rem 1rem; list-style:none; padding:0; margin:.5rem 0 0; }
.site-nav a { text-decoration: none; opacity: .9; }
.site-nav a:hover { opacity: 1; text-decoration: underline; }

main { padding: 1.25rem 0 2rem; }
.entry-title { margin: 0 0 .5rem; line-height: 1.25; }
.entry-meta { font-size: .9rem; opacity: .75; margin-bottom: 1rem; }
.breadcrumbs { font-size: .9rem; opacity: .75; margin: .75rem 0 1rem; }
.card { padding: 1rem 0; border-bottom: 1px solid rgba(0,0,0,.08); }
.card:last-child { border-bottom: 0; }
.excerpt { margin: .35rem 0 0; opacity: .9; }

.site-footer { padding: 1.5rem 0; border-top: 1px solid rgba(0,0,0,.08); font-size: .95rem; opacity: .9; }
.footer-row { display:flex; flex-wrap:wrap; gap:.5rem 1rem; align-items:center; justify-content:space-between; }

/* Header layout */
.site-brand { display:flex; align-items:center; justify-content:space-between; gap: 1rem; }
.brand-left { display:flex; align-items:center; gap: .75rem; min-width: 0; }
.custom-logo { max-width: 261px; height: 100px; width: auto; display: block; }
.site-title { margin: 0; font-size: 1.05rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-nav { margin-top: 0; }
.site-nav ul { justify-content: flex-end; }

/* Hero */
.hero { margin: 0; padding: 0; }
.hero-inner { padding: 2.25rem 0 2rem; }
.hero.has-bg { position: relative; border-bottom: 1px solid rgba(0,0,0,.08); }
.hero.has-bg .hero-bg { position:absolute; inset:0; background-size:cover; background-position:center; }
.hero.has-bg .container { position: relative; z-index: 1; }
.hero-title { margin: 0 0 .5rem; line-height: 1.2; font-size: 1.75rem; }
.hero-lead { margin: 0; max-width: 60ch; opacity: .9; }
.hero-actions { margin-top: 1rem; display:flex; flex-wrap:wrap; gap:.75rem; }
.btn { display:inline-block; padding:.6rem .9rem; border:1px solid rgba(0,0,0,.18); border-radius: 999px; text-decoration:none; }
.btn:hover { border-color: rgba(0,0,0,.35); }

/* Responsive */
@media (max-width: 720px) {
  .site-brand { align-items:flex-start; flex-direction:column; }
  .site-nav ul { justify-content:flex-start; }
  .hero-title { font-size: 1.5rem; }
}

/* Breadcrumbs (aesthetic) */
.breadcrumbs { font-size: .9rem; opacity: .85; margin: .75rem 0 0; }
.breadcrumbs a { text-decoration: none; border-bottom: 1px solid rgba(0,0,0,.18); }
.breadcrumbs a:hover { border-bottom-color: rgba(0,0,0,.35); }
.breadcrumbs span { opacity: .9; }

/* Hero refinements (less tall, page-friendly) */
.hero-inner { padding: 1.65rem 0 1.4rem; }
.hero-title { font-size: 1.65rem; }
.hero-lead { margin-top: .25rem; }
/* Color bar when no image */
.hero.no-bg { border-bottom: 1px solid rgba(0,0,0,.08); background: linear-gradient(to bottom, rgba(17,17,17,.04), rgba(17,17,17,0)); }

@media (max-width: 720px) {
  .hero-inner { padding: 1.25rem 0 1.1rem; }
  .hero-title { font-size: 1.35rem; }
}

/* Global accent (Customizer) */
:root { --km-accent: #111111; --km-accent-contrast: #ffffff; }

/* Sticky header */
.site-header { position: sticky; top: 0; z-index: 999; background: color-mix(in srgb, var(--km-accent) 6%, #ffffff); backdrop-filter: saturate(120%) blur(6px); }

/* Mobile logo center without affecting menu */
.brand-spacer { display:none; }
@media (max-width: 720px) {
  .site-brand { display:grid; grid-template-columns: 1fr auto 1fr; align-items:center; gap:.75rem; }
  .brand-spacer { display:block; }
  .brand-left { justify-self:center; }
  .nav-toggle { justify-self:end; }
  .site-nav { grid-column: 1 / -1; }
}

/* Hero background as real img for retina sharpness */
.hero.has-bg .hero-bg-img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center; }
.hero.has-bg .hero-bg { display:none; } /* legacy fallback */
/* Breadcrumb inside hero */
.hero .breadcrumbs { margin-top: .65rem; }

/* Bottom sticky contact bar (mobile) */
.km-contactbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: none;
  border-top: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px) saturate(120%);
}
.km-contactbar .inner { width: min(1100px, 92vw); margin: 0 auto; padding: .6rem 0; display:flex; gap:.75rem; }
.km-contactbar a { flex: 1; text-align:center; padding: .65rem .75rem; border: 1px solid rgba(0,0,0,.16); border-radius: 999px; text-decoration:none; }
.km-contactbar a:hover { border-color: rgba(0,0,0,.32); }
/* Blog layout mapping */
.km-blog.km-layout-desktop-grid .km-loop { display:grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.km-blog.km-layout-desktop-media .card { display:grid; grid-template-columns: 160px 1fr; gap: 1rem; align-items:start; }
.km-blog.km-layout-desktop-list .km-loop { display:block; }
.km-thumb { aspect-ratio: 16 / 10; width: 100%; border-radius: 12px; overflow:hidden; border:1px solid rgba(0,0,0,.08); }
.km-thumb img { width:100%; height:100%; object-fit:cover; display:block; }

@media (max-width: 900px) {
  .km-blog.km-layout-desktop-grid .km-loop { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .km-blog.km-layout-mobile-grid .km-loop { display:grid; grid-template-columns: 1fr; gap: 1rem; }
  .km-blog.km-layout-mobile-media .card { display:grid; grid-template-columns: 1fr; }
  .km-blog.km-layout-mobile-list .km-loop { display:block; }
}

/* Mobile menu (accessible toggle) */
.nav-toggle{
  display:none;
  padding:.55rem .75rem;
  border:1px solid rgba(0,0,0,.18);
  border-radius:999px;
  background:transparent;
  cursor:pointer;
}
.nav-toggle:focus{ outline:2px solid rgba(0,0,0,.35); outline-offset:2px; }

@media (max-width: 720px){
  .nav-toggle{ display:inline-flex; align-items:center; justify-content:center; }
  .site-nav ul{ display:none !important; flex-direction:column; gap:.35rem; padding-top:.75rem; }
  .site-nav.is-open ul{ display:flex !important; }
  .site-nav a{ padding:.35rem 0; }
}

/* Mobile menu: hide primary links until toggle (tablet+mobile) */
@media (max-width: 992px){
  .nav-toggle{ display:inline-flex !important; align-items:center; justify-content:center; }
  .site-nav ul{ display:none !important; flex-direction:column; gap:.35rem; padding-top:.75rem; }
  .site-nav.is-open ul{ display:flex !important; }
  .site-nav a{ padding:.35rem 0; }

  /* Center logo without affecting menu button */
  .site-brand{ display:grid; grid-template-columns: 1fr auto 1fr; align-items:center; gap:.75rem; }
  .brand-spacer{ display:block; }
  .brand-left{ justify-self:center; }
  .nav-toggle{ justify-self:end; }
  .site-nav{ grid-column: 1 / -1; }
}

/* Mobile menu overlay (does not push content) */
@media (max-width: 992px){
  .site-header .container.site-brand{ position: relative; }

  .site-nav{
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    padding: 0;
    margin: 0;
    background: rgba(255,255,255,.98);
    border-top: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 12px 28px rgba(0,0,0,.08);
    display: none;
  }
  .site-nav.is-open{ display:block; }
  .site-nav ul{ display:flex !important; padding: .85rem 1.1rem .95rem; }
  .site-nav li{ margin: 0; }
  .site-nav a{ padding: .5rem 0; }

  /* Hamburger icon */
  .nav-toggle{
    width: 44px; height: 44px;
    padding: 0;
    border-radius: 12px;
    display:inline-flex !important;
  }
  .nav-icon{ width: 22px; height: 16px; display:inline-flex; flex-direction:column; justify-content:space-between; }
  .nav-icon span{ height: 2px; width: 100%; background: rgba(0,0,0,.75); border-radius: 2px; display:block; }
}

/* Backdrop overlay for mobile menu */
@media (max-width: 992px){
  .km-nav-backdrop{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.28);
    display: none;
    z-index: 998;
  }
  .site-header{ z-index: 999; }
  .site-nav{ z-index: 999; }
  .km-nav-backdrop.is-open{ display:block; }
}

/* Sticky rules:
   - Desktop: header sticky (logo + menu)
   - Mobile/tablet: header NOT sticky; only hamburger button is sticky
*/
@media (min-width: 993px){
  .site-header{ position: sticky; top: 0; z-index: 999; }
}
@media (max-width: 992px){
  .site-header{ position: static !important; top: auto; }
}

/* Mobile sticky menu button (user-friendly) */
@media (max-width: 992px){
  .km-mobile-menu-btn{
    position: fixed;
    top: 12px;
    right: 12px;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 14px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(8px) saturate(120%);
    box-shadow: 0 10px 24px rgba(0,0,0,.10);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    cursor: pointer;
  }
  .km-mobile-menu-btn:focus{ outline: 2px solid rgba(0,0,0,.35); outline-offset: 2px; }

  .km-hamburger{
    width: 22px;
    height: 16px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .km-hamburger span{
    height: 2.5px;
    width: 100%;
    background: rgba(0,0,0,.78);
    border-radius: 3px;
    display: block;
  }

  /* Off-canvas panel for primary menu */
  .site-nav{
    position: fixed !important;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(320px, 86vw);
    background: rgba(255,255,255,.98);
    box-shadow: -18px 0 40px rgba(0,0,0,.14);
    border-left: 1px solid rgba(0,0,0,.08);
    transform: translateX(110%);
    transition: transform .22s ease;
    z-index: 1099;
    display: block !important; /* keep in DOM, hidden by transform */
    padding: 16px 16px 18px;
  }
  .site-nav.is-open{ transform: translateX(0); }
  .site-nav ul{ display:flex !important; flex-direction:column; gap: .35rem; padding-top: 46px; }
  .site-nav a{ padding: .55rem 0; font-size: 1.05rem; }

  /* Hide header inline toggle on mobile */
  .nav-toggle{ display:none !important; }
}

@media (max-width: 992px){
  .km-nav-backdrop{ z-index: 1098; }
}

/* FIX: ensure mobile menu button visible */
@media (max-width: 992px){
  .km-mobile-menu-btn{ display:inline-flex !important; }
}

/* FIX: keep contact bar above content */
@media (max-width: 720px){
  .km-contactbar{
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
  }
}

/* Admin bar offsets (when logged in) */
@media (max-width: 992px){
  body.admin-bar .km-mobile-menu-btn{ top: calc(12px + 46px); }
}

/* Contact bar should follow same breakpoint as mobile menu */
@media (max-width: 992px){
  body{ padding-bottom: 64px; }
  .km-contactbar{ display:block; }
}
@media (min-width: 993px){
  body{ padding-bottom: 0; }
}

/* HARD OVERRIDES (ensure mobile menu button visible and no layout conflicts) */
.km-mobile-menu-btn{ display:none; }
@media (max-width: 992px){
  .km-mobile-menu-btn{ display:inline-flex !important; z-index: 2000; }
  .site-nav{ z-index: 1999 !important; }
  .km-nav-backdrop{ z-index: 1998 !important; }

  /* make sure header inline elements don't interfere */
  .nav-toggle{ display:none !important; }
}

@media (max-width: 992px){
  .km-contactbar{ z-index: 1200; }
}

/* === MOBILE MENU CLEAN OVERRIDE (v2.1.3) === */
@media (max-width: 992px){
  html, body{ overflow-x: hidden; }

  /* Force off-canvas panel, regardless of earlier rules */
  .site-nav{
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    height: 100vh !important;
    width: min(320px, 86vw) !important;
    margin: 0 !important;
    padding: 16px 16px 18px !important;

    background: rgba(255,255,255,.98) !important;
    border-left: 1px solid rgba(0,0,0,.08) !important;
    box-shadow: -18px 0 40px rgba(0,0,0,.14) !important;

    display: block !important;

    transform: translateX(110%) !important;
    visibility: hidden !important;
    pointer-events: none !important;

    z-index: 1999 !important;
  }
  .site-nav.is-open{
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .site-nav ul{
    display: flex !important;
    flex-direction: column !important;
    gap: .35rem !important;
    padding: 46px 0 0 !important;
  }

  /* Ensure header inline menu toggle doesn't appear */
  .nav-toggle{ display:none !important; }

  /* Backdrop sits under panel & button */
  .km-nav-backdrop{ z-index: 1998 !important; }

  /* Menu button always visible */
  .km-mobile-menu-btn{ display:inline-flex !important; z-index: 2000 !important; }

  /* Contact bar stable */
  .km-contactbar{ left:0 !important; right:0 !important; bottom:0 !important; transform:none !important; z-index:1200 !important; }
  body{ padding-bottom: 64px !important; }
}
@media (min-width: 993px){
  body{ padding-bottom: 0 !important; }
}

/* Z-INDEX LAYERING (mobile off-canvas)
   - button stays on top
   - menu panel sits under button but above everything else
   - backdrop under panel
   - contactbar under panel
*/
@media (max-width: 992px){
  .km-mobile-menu-btn{ z-index: 3000 !important; }
  .site-nav{ z-index: 2900 !important; }
  .km-nav-backdrop{ z-index: 2800 !important; }
  .km-contactbar{ z-index: 1200 !important; }

  /* Ensure panel content starts below the icon area */
  .site-nav ul{ padding-top: 72px !important; }
}

/* FIX: ensure off-canvas menu stacks above hero/content (mobile)
   Some browsers create stacking contexts; make header a high z-index context without being sticky.
*/
@media (max-width: 992px){
  .site-header{
    position: relative !important;
    z-index: 3500 !important;
    backdrop-filter: none !important; /* avoid stacking/context bugs */
  }
}

@media (max-width: 992px){
  .km-mobile-menu-btn{ z-index: 3600 !important; }
  .site-nav{ z-index: 3550 !important; }
  .km-nav-backdrop{ z-index: 3540 !important; }
}

/* km-contactbar color system (mobile) */
@media (max-width: 992px){
  .km-contactbar{
    background: rgba(15, 23, 42, .92); /* slate-900 */
    border-top: 1px solid rgba(255,255,255,.10);
  }
  .km-contactbar .inner{ padding: .65rem 0; }
  .km-contactbar a{
    border: 0;
    color: #ffffff;
    font-weight: 700;
  }
  .km-contactbar a[href^="tel:"]{
    background: rgba(37, 99, 235, .98); /* blue-600 */
  }
  .km-contactbar a[href*="wa.me"], .km-contactbar a[href*="whatsapp"]{
    background: rgba(37, 211, 102, .98); /* WhatsApp green */
  }
  .km-contactbar a:focus{
    outline: 2px solid rgba(255,255,255,.65);
    outline-offset: 2px;
  }
}

/* Blog: Görsel (image-forward) layout */
.km-blog.km-layout-desktop-media .card{
  display:block !important;
}
.km-blog.km-layout-desktop-media .km-thumb{
  margin-bottom: .85rem;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
}
.km-blog.km-layout-desktop-media .entry-title a{
  text-decoration: none;
}

/* Hero actions buttons */
.hero-actions{ display:flex; gap:.75rem; flex-wrap:wrap; margin-top: 1rem; }
.hero-actions .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: .70rem 1.05rem;
  border-radius: 999px;
  text-decoration:none;
  font-weight: 700;
  border: 1px solid rgba(0,0,0,.10);
  background: var(--km-accent);
  color: var(--km-accent-contrast);
}
.hero-actions .btn:hover{ filter: brightness(0.96); }
@media (max-width: 720px){
  .hero-actions{ gap:.6rem; }
  .hero-actions .btn{ width: 100%; }
}

/* Hero background overlay (Customizer-controlled) */
.hero.has-bg::after{
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.78),
    rgba(255, 255, 255, 0.96)
  );
}

/* Hero background image visibility (Customizer) */
.hero-bg-img{ opacity: var(--km-hero-img-op, 0.75); }

/* km-contactbar (mobile) – modern, high-contrast */
@media (max-width: 992px){
  .km-contactbar{
    background: rgba(15, 23, 42, .92);
    border-top: 1px solid rgba(255,255,255,.10);
  }
  .km-contactbar a{ border:0; color:#fff; font-weight:700; }
  .km-contactbar a[href^="tel:"]{ background: rgba(37, 99, 235, .98); }
  .km-contactbar a[href*="wa.me"], .km-contactbar a[href*="whatsapp"]{ background: rgba(37, 211, 102, .98); }
}

/* Blog: Görsel (Büyük Görsel) layout */
.km-blog.km-layout-desktop-media .card{ display:block !important; }
.km-blog.km-layout-desktop-media .km-thumb{
  margin-bottom: .85rem;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
}

/* Hero actions buttons */
.hero-actions{ display:flex; gap:.75rem; flex-wrap:wrap; margin-top:1rem; }
.hero-actions .btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:.70rem 1.05rem; border-radius:999px;
  text-decoration:none; font-weight:700;
  border:1px solid rgba(0,0,0,.10);
  background: var(--km-accent);
  color: var(--km-accent-contrast);
}
@media (max-width: 720px){ .hero-actions .btn{ width:100%; } }




/* Hero breadcrumbs visibility (esp. on featured image) */
.hero.has-bg .breadcrumbs{
  opacity: 1;
  display: inline-block;
  margin-top: .75rem;
  padding: .35rem .6rem;
  border-radius: 999px;
}
.hero.has-bg .breadcrumbs a{ opacity: 1; }
