/* ============================================================
   YKA Teknoloji — Blog (blog.css)
   ============================================================
   Premium dark-tech blog surface. Loads AFTER components.css so
   it intentionally overrides the legacy .blog-* rules there.
   Uses ONLY real design tokens from variables.css.
   Pages: blog.html (list) + yazi.html (single article).
   ============================================================ */

/* ------------------------------------------------------------
   0. LOCAL TOKENS  (scoped aliases built on the real system)
   ------------------------------------------------------------ */
:root {
  --blog-bg-deep:    #060B16;
  --blog-bg-base:    #0A1322;
  --blog-ink:        #EAF0FA;            /* primary text on dark   */
  --blog-ink-muted:  rgba(234, 240, 250, 0.66);
  --blog-ink-faint:  rgba(234, 240, 250, 0.42);
  --blog-glass:      rgba(255, 255, 255, 0.045);
  --blog-glass-2:    rgba(255, 255, 255, 0.07);
  --blog-hairline:   rgba(255, 255, 255, 0.09);
  --blog-hairline-2: rgba(255, 255, 255, 0.16);
  --blog-gold:       var(--color-accent-glow);   /* #F0B54A */
  --blog-cyan:       var(--color-cyan);          /* #38BDF8 */
  --blog-ease:       cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   1. SHARED DARK SHELL + ATMOSPHERE
   ============================================================ */
.blog-shell {
  position: relative;
  background:
    radial-gradient(120% 80% at 50% -10%, #112647 0%, transparent 55%),
    linear-gradient(180deg, var(--blog-bg-base) 0%, var(--blog-bg-deep) 100%);
  color: var(--blog-ink);
  overflow: hidden;       /* fallback */
  overflow: clip;         /* avoids creating a scroll container where supported */
  isolation: isolate;
}

/* Slowly drifting ambient glow blobs (gold + cyan). */
.blog-shell::before,
.blog-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 46vw;
  height: 46vw;
  max-width: 640px;
  max-height: 640px;
  border-radius: var(--radius-full);
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}
.blog-shell::before {
  top: -8%;
  left: -10%;
  background: radial-gradient(circle, rgba(196, 137, 26, 0.55), transparent 70%);
  animation: blog-drift-a 22s var(--blog-ease) infinite alternate;
}
.blog-shell::after {
  top: 30%;
  right: -14%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.4), transparent 70%);
  animation: blog-drift-b 26s var(--blog-ease) infinite alternate;
}

@keyframes blog-drift-a {
  to { transform: translate3d(8%, 12%, 0) scale(1.15); }
}
@keyframes blog-drift-b {
  to { transform: translate3d(-10%, -8%, 0) scale(1.1); }
}

/* Fine grid texture overlay for "tech" feel. */
.blog-shell .blog-grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 0%, transparent 78%);
}

/* ============================================================
   2. BLOG LIST — HERO
   ============================================================ */
.blog-hero {
  position: relative;
  text-align: center;
  padding: clamp(120px, 18vh, 180px) var(--space-lg) clamp(48px, 7vw, 80px);
}

.blog-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blog-gold);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(196, 137, 26, 0.08);
  border: 1px solid rgba(196, 137, 26, 0.25);
  margin-bottom: var(--space-lg);
}
.blog-hero-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--blog-gold);
  box-shadow: 0 0 10px var(--blog-gold);
}

.blog-hero-title {
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 auto var(--space-md);
  max-width: 16ch;
  background: linear-gradient(180deg, #ffffff 0%, #b9c6dc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.blog-hero-title .accent {
  background: linear-gradient(120deg, var(--color-accent), var(--blog-gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blog-hero-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--blog-ink-muted);
  max-width: 56ch;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================================
   3. BLOG LIST — LAYOUT
   ============================================================ */
.blog-main {
  position: relative;
  padding: 0 0 clamp(64px, 10vw, 120px);
}

.blog-featured-wrap { margin-bottom: clamp(40px, 6vw, 72px); }

/* ---- Featured (newest) post ------------------------------- */
.blog-featured {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: stretch;
  padding: clamp(16px, 1.6vw, 24px);
  border-radius: var(--radius-xl);
  background: var(--blog-glass);
  border: 1px solid var(--blog-hairline);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-decoration: none;
  color: inherit;
  transition: transform var(--duration-slow) var(--blog-ease),
              border-color var(--duration-normal) ease,
              box-shadow var(--duration-slow) var(--blog-ease);
}
.blog-featured:hover {
  transform: translateY(-6px);
  border-color: rgba(196, 137, 26, 0.4);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(196, 137, 26, 0.15),
              var(--glow-gold);
}

.blog-featured-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 320px;
  background: #0d1a30 center/cover no-repeat;
}
.blog-featured-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(8, 14, 26, 0.15), rgba(8, 14, 26, 0.55));
}
.blog-featured-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--blog-ease);
}
.blog-featured:hover .blog-featured-img { transform: scale(1.06); }

.blog-featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(16px, 2vw, 36px) clamp(12px, 2vw, 32px) clamp(16px, 2vw, 36px) 0;
}

.blog-featured-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: #fff;
  margin: var(--space-md) 0 var(--space-md);
  transition: color var(--duration-normal) ease;
}
.blog-featured:hover .blog-featured-title { color: var(--blog-gold); }

.blog-featured-excerpt {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--blog-ink-muted);
  margin-bottom: var(--space-xl);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Badges ----------------------------------------------- */
.blog-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  width: fit-content;
}
.blog-badge--featured {
  color: #1a1206;
  background: linear-gradient(120deg, var(--color-accent-light), var(--blog-gold));
  box-shadow: 0 4px 18px rgba(196, 137, 26, 0.4);
}
.blog-badge--date {
  color: var(--blog-cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

/* ---- CTA pill --------------------------------------------- */
.blog-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--blog-gold);
  width: fit-content;
}
.blog-cta i { transition: transform var(--duration-normal) var(--blog-ease); }
.blog-featured:hover .blog-cta i,
.blog-card:hover .blog-read-more i { transform: translateX(6px); }

/* ============================================================
   4. BLOG LIST — CARD GRID  (overrides components.css)
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: clamp(20px, 2.4vw, 32px);
  padding: 0;
}

.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--blog-glass);
  border: 1px solid var(--blog-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.6);
  transition: transform var(--duration-slow) var(--blog-ease),
              border-color var(--duration-normal) ease,
              box-shadow var(--duration-slow) var(--blog-ease);
}
.blog-card:hover {
  transform: translateY(-8px);
  border-color: rgba(196, 137, 26, 0.38);
  box-shadow: 0 26px 50px -24px rgba(0, 0, 0, 0.75),
              var(--glow-gold);
}
/* Gold top hairline that lights up on hover */
.blog-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blog-gold), transparent);
  opacity: 0;
  transition: opacity var(--duration-normal) ease;
  z-index: 3;
}
.blog-card:hover::before { opacity: 0.9; }

.blog-cover-wrap {
  position: relative;
  height: 210px;
  overflow: hidden;
}
.blog-cover {
  width: 100%;
  height: 100%;
  /* longhands only — never reset the inline background-image */
  background-color: #0d1a30;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: transform 0.6s var(--blog-ease);
}
.blog-card:hover .blog-cover { transform: scale(1.07); }
.blog-cover-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(6, 11, 22, 0.6));
}

.blog-date-badge {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 2;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--blog-cyan);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(6, 11, 22, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.blog-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: clamp(20px, 2.2vw, 28px);
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0 0 var(--space-sm);
  transition: color var(--duration-normal) ease;
}
.blog-card:hover .blog-card-title { color: var(--blog-gold); }

.blog-excerpt {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--blog-ink-muted);
  margin-bottom: var(--space-lg);
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--blog-hairline);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--blog-gold);
}
.blog-read-more i { transition: transform var(--duration-normal) var(--blog-ease); }

/* ============================================================
   5. STATES — skeleton / empty / error
   ============================================================ */
.blog-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: clamp(48px, 8vw, 96px) var(--space-lg);
  color: var(--blog-ink-muted);
}
.blog-state i { color: var(--blog-gold); margin-bottom: var(--space-md); }
.blog-state h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: #fff;
  margin: 0 0 var(--space-sm);
}
.blog-state--error i { color: var(--color-danger); }

/* Shimmer skeleton cards */
.blog-skel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--blog-hairline);
  background: var(--blog-glass);
  overflow: hidden;
}
.blog-skel-cover { height: 210px; }
.blog-skel-body { padding: 28px; }
.blog-skel-line {
  height: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.blog-skel-line.lg { height: 22px; width: 80%; }
.blog-skel-line.sm { width: 50%; }
.blog-skel-cover,
.blog-skel-line {
  background: linear-gradient(100deg,
    rgba(255, 255, 255, 0.04) 30%,
    rgba(255, 255, 255, 0.11) 50%,
    rgba(255, 255, 255, 0.04) 70%);
  background-size: 220% 100%;
  animation: blog-shimmer 1.5s linear infinite;
}
@keyframes blog-shimmer {
  to { background-position: -220% 0; }
}

/* ============================================================
   6. ENTRANCE ANIMATION (staggered reveal)
   ============================================================ */
.blog-reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: blog-rise 0.7s var(--blog-ease) forwards;
}
@keyframes blog-rise {
  to { opacity: 1; transform: none; }
}

/* ============================================================
   7. SINGLE ARTICLE — yazi.html
   ============================================================ */
.post-hero {
  position: relative;
  padding: clamp(110px, 16vh, 168px) var(--space-lg) clamp(124px, 13vw, 158px);
  text-align: center;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--blog-ink-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--blog-hairline);
  background: var(--blog-glass);
  transition: color var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              transform var(--duration-fast) ease;
  margin-bottom: var(--space-xl);
}
.post-back:hover {
  color: var(--blog-gold);
  border-color: rgba(196, 137, 26, 0.4);
}
.post-back i { transition: transform var(--duration-fast) ease; }
.post-back:hover i { transform: translateX(-4px); }

.post-title {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 20ch;
  margin: 0 auto var(--space-lg);
}

.post-meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--blog-ink-muted);
}
.post-meta i { color: var(--blog-cyan); margin-right: 6px; }

/* ---- Reading surface (light for comfort) ------------------ */
/* Overlap math (height-independent):
   reading.padding-top (P=120) keeps a white zone AND blocks margin-collapse.
   cover.margin-top = -(P + D) where D=110 is how far the cover rises onto the
   dark hero. Because the offset is fixed, the dark overlap is constant for ANY
   cover height; body text simply flows below the real image bottom. */
.post-reading {
  position: relative;
  z-index: 1;
  background: var(--color-surface);
  padding-top: 120px;            /* P */
}
.post-cover-frame {
  position: relative;
  z-index: 2;
  max-width: 920px;
  width: 100%;
  margin: -230px auto 8px;       /* -(P + D) = -(120 + 110) */
  padding: 0 var(--space-lg);
}
.post-cover {
  display: none;
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-xl);
  border: 1px solid var(--blog-hairline-2);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.85);
}

.post-content {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 64px) var(--space-lg) clamp(48px, 8vw, 88px);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.8;
  color: #28303f;
}

/* No cover → drop the white zone and overlap entirely */
.post-reading--nocover { padding-top: 0; }
.post-reading--nocover .post-content { padding-top: clamp(48px, 8vw, 80px); }
.post-content > *:first-child { margin-top: 0; }

.post-content h1,
.post-content h2,
.post-content h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--color-primary);
  margin: 2.4em 0 0.7em;
}
.post-content h2 { font-size: var(--text-3xl); }
.post-content h3 { font-size: var(--text-2xl); }
.post-content h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-accent), var(--blog-gold));
}

.post-content p { margin: 0 0 1.4em; }

.post-content a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(196, 137, 26, 0.35);
  transition: border-color var(--duration-fast) ease, color var(--duration-fast) ease;
}
.post-content a:hover {
  color: var(--color-accent-light);
  border-bottom-color: var(--color-accent);
}

.post-content ul,
.post-content ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.post-content li { margin-bottom: 0.6em; }
.post-content ul li::marker { color: var(--color-accent); }
.post-content ol li::marker { color: var(--color-accent); font-weight: 700; }

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 2em 0;
  box-shadow: var(--shadow-lg);
}

.post-content blockquote {
  margin: 1.8em 0;
  padding: var(--space-md) var(--space-xl);
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface-alt);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--color-text);
}

.post-content pre {
  background: var(--blog-bg-deep);
  color: #e6edf6;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.6em 0;
  font-size: 0.95rem;
  line-height: 1.6;
}
.post-content code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(196, 137, 26, 0.12);
  color: #8a5a08;
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}
.post-content pre code { background: none; color: inherit; padding: 0; }

.post-content hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 2.4em 0;
}

/* Loading / error state inside hero */
.post-loading {
  text-align: center;
  color: var(--blog-ink-muted);
  padding: var(--space-2xl) 0;
}
.post-loading i { color: var(--blog-gold); }

/* ============================================================
   8. RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .blog-featured {
    grid-template-columns: 1fr;
  }
  .blog-featured-media { min-height: 220px; }
  .blog-featured-body { padding: 0 var(--space-lg) var(--space-lg); }
  .blog-featured-title { font-size: var(--text-3xl); }
}

@media (max-width: 768px) {
  .blog-hero { padding-top: 120px; }
  .blog-grid { grid-template-columns: 1fr; }
  .post-content { font-size: 1.0625rem; }
  .post-reading { padding-top: 80px; }              /* P = 80 */
  .post-cover-frame { margin-top: -150px; }         /* -(80 + 70) */
  .post-reading--nocover .post-content { padding-top: clamp(36px, 8vw, 56px); }
}

@media (max-width: 480px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-featured { padding: var(--space-sm); }
}

/* ============================================================
   9. ACCESSIBILITY
   ============================================================ */
.blog-card:focus-visible,
.blog-featured:focus-visible,
.post-back:focus-visible {
  outline: 2px solid var(--blog-gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .blog-shell::before,
  .blog-shell::after,
  .blog-skel-cover,
  .blog-skel-line { animation: none !important; }
  .blog-reveal { opacity: 1; transform: none; animation: none; }
  .blog-card,
  .blog-featured,
  .blog-cover,
  .blog-featured-img { transition: none; }
}

/* ============================================================
   10. QUILL EDİTÖR ÇIKTISI (admin paneli yazıları)
   Hizalama ve blok stillerinin yayın sayfasında da render olması
   ============================================================ */
.post-content .ql-align-center  { text-align: center; }
.post-content .ql-align-right   { text-align: right; }
.post-content .ql-align-justify { text-align: justify; }
.post-content blockquote {
  border-left: 3px solid var(--blog-gold);
  margin: 1.4em 0;
  padding: 0.5em 0 0.5em 1.1em;
  color: var(--blog-ink-muted);
  font-style: italic;
}
.post-content pre,
.post-content .ql-syntax {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 16px;
  overflow: auto;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  white-space: pre-wrap;
}
