/* ============================================================
   AydinBlog — Frontend CSS  v2.0  (Bold Modern / Mobile-First)
   ============================================================ */

/* ─── Local Fonts: Inter ──────────────────────────────────── */
/* font-display:optional = tarayıcı ilk render'da font yoksa sistem fontunu kullanır, swap yapmaz → CLS sıfır */
@font-face { font-family:'Inter'; src:url('../fonts/Inter_18pt-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:optional; }
@font-face { font-family:'Inter'; src:url('../fonts/Inter_18pt-Medium.woff2') format('woff2'); font-weight:500; font-style:normal; font-display:optional; }
@font-face { font-family:'Inter'; src:url('../fonts/Inter_18pt-SemiBold.woff2') format('woff2'); font-weight:600; font-style:normal; font-display:optional; }
@font-face { font-family:'Inter'; src:url('../fonts/Inter_18pt-Bold.woff2') format('woff2'); font-weight:700; font-style:normal; font-display:optional; }
@font-face { font-family:'Inter'; src:url('../fonts/Inter_18pt-ExtraBold.woff2') format('woff2'); font-weight:800; font-style:normal; font-display:optional; }
@font-face { font-family:'Inter'; src:url('../fonts/Inter_18pt-Black.woff2') format('woff2'); font-weight:900; font-style:normal; font-display:optional; }

/* ─── Reset & Custom Properties ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-bg:        #ffffff;
  --c-surface:   #f8fafc;
  --c-border:    #e2e8f0;
  --c-text:      #1e293b;
  --c-muted:     #64748b;
  --c-accent:    #4f46e5;
  --c-accent-h:  #4338ca;
  --c-success:   #059669;
  --c-error:     #dc2626;
  --c-warning:   #d97706;
  --radius:      10px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:   'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --max-width:   1180px;
  --sidebar-w:   300px;
}

html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { font-family: var(--font); font-size: 1rem; line-height: 1.7; color: var(--c-text); background: var(--c-bg); }
img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--c-accent); text-decoration: none; }
a:hover { color: var(--c-accent-h); }
ul   { list-style: none; }

/* ─── Typography ─────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { line-height: 1.25; font-weight: 700; color: var(--c-text); }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h3 { font-size: 1.25rem; }
p  { margin-bottom: 1rem; }

/* ─── Layout ─────────────────────────────────────────────── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

.layout-main {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 48px;
  padding: 48px 0;
}
@media (max-width: 900px) {
  .layout-main { grid-template-columns: 1fr; }
}

/* ─── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.site-title   { font-size: 1.4rem; font-weight: 800; color: var(--c-text); letter-spacing: -.5px; }
.site-logo    { height: 36px; }

.main-nav ul  { display: flex; gap: 4px; align-items: center; }
.main-nav a   { padding: 6px 14px; border-radius: 6px; color: var(--c-text); font-weight: 500; font-size: .9rem; transition: background .15s; }
.main-nav a:hover { background: var(--c-surface); color: var(--c-accent); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.search-toggle  { padding: 8px; border-radius: 6px; color: var(--c-muted); transition: color .15s, background .15s; }
.search-toggle:hover { background: var(--c-surface); color: var(--c-text); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; z-index: 400; position: relative; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--c-text); border-radius: 2px; transition: transform .25s, opacity .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile Nav Panel (fullscreen overlay) ──────────────── */
.mobile-nav-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(6px);
  z-index: 300;
  overflow-y: auto;
}
.mobile-nav-panel.open { display: block; }
.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  padding: 80px 28px 40px;
}
.mobile-nav-inner ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.mobile-nav-inner a  { display: block; padding: 14px 0; font-size: 1.35rem; font-weight: 700; color: var(--c-text); border-bottom: 1px solid var(--c-border); text-decoration: none; }
.mobile-nav-inner a:hover { color: var(--c-accent); }

/* ── Site Header ────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 200; background: #fff; }
.site-header.scrolled { box-shadow: 0 1px 12px rgba(0,0,0,.08); }

/* ── Reading Progress Bar ───────────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--c-accent, #5046e4), #7c3aed);
  z-index: 9999;
  transition: width .1s linear;
  pointer-events: none;
}

/* ── Back-to-Top ────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 28px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--c-accent, #5046e4);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(80,70,228,.35);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .25s, transform .25s;
  z-index: 500;
  pointer-events: none;
}
#back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
#back-to-top:hover { background: #4338ca; }

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .main-nav   { display: none; }
}

/* ─── Hero Section ───────────────────────────────────────── */
.hero-section { background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%); border-bottom: 1px solid var(--c-border); padding: 64px 0; }
.hero-content { max-width: 680px; }
.hero-content h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 16px; }
.hero-body { font-size: 1.1rem; color: var(--c-muted); }

/* ─── Post Cards ─────────────────────────────────────────── */
.section-heading { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--c-muted); margin-bottom: 24px; }

.posts-grid { display: grid; gap: 32px; }

.post-card { border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s; background: var(--c-bg); }
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.post-card--featured .post-card-title a { font-size: 1.5rem; }
.post-card--featured { border-color: var(--c-accent); border-width: 2px; }

.post-thumb { display: block; overflow: hidden; aspect-ratio: 16/9; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-card:hover .post-thumb img { transform: scale(1.04); }

.post-card-body { padding: 20px; }
.post-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.badge { background: #eff6ff; color: var(--c-accent); font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; }

.post-card-title a { color: var(--c-text); font-size: 1.15rem; font-weight: 700; }
.post-card-title a:hover { color: var(--c-accent); }
.post-excerpt { color: var(--c-muted); font-size: .92rem; margin: 8px 0; }
.post-meta { font-size: .8rem; color: var(--c-muted); display: flex; gap: 6px; align-items: center; }
.dot { opacity: .4; }

/* ─── Archive Header ─────────────────────────────────────── */
.archive-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--c-border); }
.archive-label  { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--c-accent); }
.archive-header h1 { margin-top: 4px; }

/* ─── Single Post ─────────────────────────────────────────── */
.single-post { min-width: 0; }
/* aspect-ratio rezerv alanı → yüklenmeden önce yer ayırır, CLS olmaz */
.post-hero-image { border-radius: var(--radius); overflow: hidden; margin-bottom: 32px; aspect-ratio: 16/9; background: var(--c-surface); }
.post-hero-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-header { margin-bottom: 32px; }
.post-header h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); margin: 12px 0 16px; }

.post-content { font-size: 1.075rem; line-height: 1.8; }
.post-content h2 { margin: 2rem 0 1rem; }
.post-content h3 { margin: 1.5rem 0 .75rem; }
.post-content p  { margin-bottom: 1.25rem; }
.post-content img { border-radius: 8px; margin: 1rem 0; }
.post-content a  { text-decoration: underline; }
.post-content blockquote { border-left: 4px solid var(--c-accent); padding: 12px 20px; background: var(--c-surface); margin: 1.5rem 0; border-radius: 0 8px 8px 0; }
.post-content pre  { background: #1e293b; color: #e2e8f0; padding: 20px; border-radius: 8px; overflow-x: auto; font-size: .88rem; margin: 1.5rem 0; }
.post-content code { font-family: var(--font-mono); font-size: .88em; background: var(--c-surface); padding: 2px 6px; border-radius: 4px; }
.post-content pre code { background: none; padding: 0; }
.post-content ul,
.post-content ol  { padding-left: 1.5rem; margin-bottom: 1rem; list-style: initial; }
.post-content ol  { list-style: decimal; }
.post-content li  { margin-bottom: .4rem; }
.post-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.post-content th,
.post-content td  { padding: 10px 14px; border: 1px solid var(--c-border); }
.post-content th  { background: var(--c-surface); font-weight: 700; }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0; }
.tag-pill  { background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-muted); font-size: .8rem; padding: 4px 12px; border-radius: 99px; transition: all .15s; }
.tag-pill:hover,
.tag-pill.active { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }

.post-share { display: flex; align-items: center; gap: 8px; margin: 24px 0; flex-wrap: wrap; }
.post-share span { font-size: .85rem; font-weight: 600; color: var(--c-muted); }
.share-btn { padding: 6px 16px; border-radius: 6px; font-size: .8rem; font-weight: 600; color: #fff !important; }
.share-twitter  { background: #000; }
.share-facebook { background: #1877f2; }
.share-whatsapp { background: #25d366; }

.post-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 40px 0; }
.nav-prev, .nav-next { padding: 16px; border: 1px solid var(--c-border); border-radius: var(--radius); color: var(--c-text); transition: border-color .2s, box-shadow .2s; }
.nav-prev:hover, .nav-next:hover { border-color: var(--c-accent); box-shadow: var(--shadow-sm); color: var(--c-text); }
.nav-next { text-align: right; }
.nav-prev span, .nav-next span { display: block; font-size: .75rem; color: var(--c-muted); margin-bottom: 4px; }
.nav-prev strong, .nav-next strong { font-size: .9rem; }

/* ─── Comments ───────────────────────────────────────────── */
.comments-section { margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--c-border); }
.comments-title   { font-size: 1.3rem; margin-bottom: 32px; }
.comment-list     { display: flex; flex-direction: column; gap: 24px; margin-bottom: 40px; counter-reset: comments; }
.comment          { display: flex; gap: 16px; }
.comment-avatar img { border-radius: 50%; width: 48px; height: 48px; flex-shrink: 0; }
.comment-body     { flex: 1; background: var(--c-surface); border-radius: var(--radius); padding: 16px; }
.comment-meta     { display: flex; justify-content: space-between; margin-bottom: 8px; }
.comment-meta strong { font-size: .9rem; }
.comment-meta time   { font-size: .8rem; color: var(--c-muted); }

.comment-form-wrap h3 { margin-bottom: 20px; }

/* ─── Forms ──────────────────────────────────────────────── */
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 20px; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--c-text); margin-bottom: 6px; }
label span { color: var(--c-error); }
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
select,
textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--c-border); border-radius: 8px;
  font-size: .95rem; font-family: inherit; line-height: 1.5;
  outline: none; transition: border-color .2s, box-shadow .2s;
  background: var(--c-bg); color: var(--c-text);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
textarea { resize: vertical; min-height: 120px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px; border-radius: 8px; font-size: .95rem; font-weight: 600; border: none; cursor: pointer; transition: all .15s; text-decoration: none; }
.btn-primary { background: var(--c-accent); color: #fff; }
.btn-primary:hover { background: var(--c-accent-h); color: #fff; }
.btn-secondary { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); }
.btn-secondary:hover { background: var(--c-border); }

@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ─── Search Form ────────────────────────────────────────── */
.search-form { display: flex; gap: 8px; }
.search-form input { flex: 1; }
.search-form button { padding: 10px 20px; background: var(--c-accent); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }
.search-form--large input { font-size: 1.1rem; padding: 14px 18px; }
.search-summary { margin: 24px 0 16px; color: var(--c-muted); font-size: .9rem; }

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
.widget  { background: var(--c-surface); border-radius: var(--radius); padding: 24px; border: 1px solid var(--c-border); }
.widget-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--c-muted); margin-bottom: 16px; }
.category-list li { border-bottom: 1px solid var(--c-border); }
.category-list li:last-child { border-bottom: none; }
.category-list a  { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; color: var(--c-text); font-size: .9rem; }
.category-list a:hover { color: var(--c-accent); }
.category-list a.active { color: var(--c-accent); font-weight: 700; }
.badge-count { background: var(--c-border); color: var(--c-muted); font-size: .7rem; padding: 2px 7px; border-radius: 99px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 40px 0; }
.pagination a { padding: 8px 14px; border: 1px solid var(--c-border); border-radius: 8px; color: var(--c-text); font-size: .9rem; font-weight: 500; transition: all .15s; }
.pagination a:hover,
.pagination a.active { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert { padding: 14px 18px; border-radius: 8px; font-size: .9rem; line-height: 1.6; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert ul      { list-style: disc; padding-left: 1.2rem; }

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer { background: #0f172a; color: #94a3b8; margin-top: auto; border-top: 1px solid #1e293b; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; padding: 56px 0 32px; }
.footer-title { color: #f1f5f9; font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.footer-about p { font-size: .88rem; line-height: 1.7; }
.social-links   { display: flex; gap: 10px; margin-top: 16px; }
.social-links a { color: #94a3b8; transition: color .15s; }
.social-links a:hover { color: #f1f5f9; }
.footer-links ul li,
.footer-recent ul li { border-bottom: 1px solid #1e293b; }
.footer-links ul li:last-child,
.footer-recent ul li:last-child { border-bottom: none; }
.footer-links a,
.footer-recent a { display: block; padding: 8px 0; color: #94a3b8; font-size: .88rem; transition: color .15s; }
.footer-links a:hover,
.footer-recent a:hover { color: #f1f5f9; }
.footer-links a span { float: right; font-size: .75rem; }
.footer-recent small { display: block; font-size: .75rem; color: #94a3b8; margin-top: 2px; }
.footer-bottom { border-top: 1px solid #1e293b; padding: 20px 0; text-align: center; font-size: .82rem; color: #94a3b8; }

/* ─── Static Page ────────────────────────────────────────── */
.static-page   { padding: 48px 0; max-width: 800px; margin: 0 auto; }
.page-header h1 { margin-bottom: 24px; }
.page-content  { font-size: 1.05rem; line-height: 1.8; }
.page-content h2,
.page-content h3 { margin: 1.5rem 0 .75rem; }
.page-content p   { margin-bottom: 1rem; }
.narrow-content { max-width: 680px; margin: 48px auto; }
.page-heading   { margin-bottom: 32px; }

/* ─── Contact ────────────────────────────────────────────── */
.contact-form { margin-top: 8px; }
.contact-info { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--c-border); font-size: .93rem; }

/* ─── Error Page ─────────────────────────────────────────── */
.error-page   { text-align: center; padding: 80px 0; }
.error-code   { font-size: 8rem; font-weight: 900; color: var(--c-border); line-height: 1; }
.error-page h1 { font-size: 1.6rem; margin: 8px 0 16px; }
.error-page p  { color: var(--c-muted); }

/* ─── Empty ──────────────────────────────────────────────── */
.empty-message { text-align: center; padding: 48px; color: var(--c-muted); border: 2px dashed var(--c-border); border-radius: var(--radius); }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .post-navigation { grid-template-columns: 1fr; }
  .hero-section { padding: 40px 0; }
  .comment { flex-direction: column; }
}

/* ─── Lazy Image — Shimmer Skeleton + Blur-up ────────────── */
@keyframes img-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

/* Parent container animasyonu: resim yüklenirken kayıp ışığı efekti */
.img-loading {
  position: relative;
  background: linear-gradient(90deg,
    var(--c-border) 25%,
    #e6e6ef         50%,
    var(--c-border) 75%);
  background-size: 1200px 100%;
  animation: img-shimmer 1.6s infinite linear;
}

/* Resim başlangıç durumu: görünmez + bulanık */
img.lazy {
  opacity: 0;
  filter: blur(8px);
  transform: scale(1.03);
  will-change: opacity, filter, transform;
  transition: opacity .5s ease, filter .5s ease, transform .5s ease;
}

/* Resim yüklenince yumuşak geçiş */
img.lazy.loaded {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

/* Resim boyutu sabit kalsın (layout shift yok) */
.post-thumb,
.post-hero-image,
.related-card-img,
.media-thumb,
.widget img { overflow: hidden; }

/* ─── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb { margin: 12px 0 20px; font-size: 0.82rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb a { color: var(--c-accent); text-decoration: none; transition: color .2s; }
.breadcrumb a:hover { color: var(--c-accent-2); text-decoration: underline; }
.breadcrumb li:last-child span { color: var(--c-muted); }
.bc-sep { margin: 0 4px; color: var(--c-border); font-size: 1rem; line-height: 1; }

/* ─── Related Posts ──────────────────────────────────────── */
.related-posts { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--c-border); }
.related-posts-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 20px; color: var(--c-heading); }
.related-posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.related-card { display: flex; flex-direction: column; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .2s, transform .2s; background: var(--c-surface); }
.related-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); }
.related-card-img { aspect-ratio: 16/9; overflow: hidden; }
.related-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.related-card:hover .related-card-img img { transform: scale(1.04); }
.related-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.related-card-body h4 { font-size: 0.93rem; font-weight: 600; margin: 0; line-height: 1.4; color: var(--c-heading); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-card-body p { font-size: 0.8rem; color: var(--c-muted); margin: 0; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-card-date { font-size: 0.75rem; color: var(--c-muted); margin-top: auto; }
@media (max-width: 600px) { .related-posts-grid { grid-template-columns: 1fr; } }
