/* ============================================================
   BYTE AKADEMİ — yazı sayfası + etiket sayfası eklentileri (v3)
   Sahibi: yazi.php / etiket.php ekibi. main.css'e dokunmadan üstüne biner.
   ============================================================ */

/* ---------- Okuma ilerleme çubuğu (üstte ince fosfor çizgi) ---------- */
.read-bar { position: fixed; left: 0; top: 0; width: 100%; height: 3px; z-index: 9990; pointer-events: none; background: transparent; }
.read-bar i {
  display: block; height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0);
  background: var(--phosphor); box-shadow: 0 0 10px var(--phosphor-soft), 0 0 2px var(--phosphor);
}

/* ---------- Okuma odaklı gövde: ~70 karakter satır, rahat boyut ---------- */
.yazi-article .article-body { max-width: 70ch; }
.yazi-article .article-body p { font-size: 1.1rem; line-height: 1.85; color: #CED3DF; }
.yazi-article .article-body li { font-size: 1.07rem; line-height: 1.75; }
.yazi-article .article-body > * + * { margin-top: 1.3em; }
.yazi-article .article-body h2 { scroll-margin-top: 100px; }
.yazi-article .article-body h3 { scroll-margin-top: 100px; font-size: 1.25rem; }
.yazi-article .article-body img { cursor: zoom-in; }
.yazi-article .article-body a img { cursor: pointer; }
.yazi-article .article-cover img { cursor: zoom-in; }

/* ---------- Meta satırı ve etiket çipleri ---------- */
.article-meta .m-item { display: inline-flex; align-items: center; gap: 7px; }
.article-meta .m-loc { color: var(--ink-dim); text-transform: none; letter-spacing: 0.06em; }
.article-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* Etiket çipi: renkli kenar, # işareti, sayı rozeti, hover parıltısı.
   Renk tonu --h (0-359) ile etiket başına sabit gelir. */
.tag-chip {
  --h: 160;
  --c: hsl(var(--h) 85% 64%);
  --s: 1;
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  border: 1px solid hsl(var(--h) 80% 60% / 0.42);
  background: linear-gradient(135deg, hsl(var(--h) 80% 60% / 0.12), hsl(var(--h) 80% 60% / 0.02));
  font-family: var(--font-mono); font-size: calc(11.5px * var(--s)); letter-spacing: 0.04em; line-height: 1.2;
  color: var(--ink); white-space: nowrap;
  transition: transform 0.35s var(--ease), border-color 0.3s var(--ease), box-shadow 0.35s var(--ease), background-color 0.3s var(--ease);
}
.tag-chip .hash { color: var(--c); font-weight: 700; }
.tag-chip .n {
  min-width: 22px; padding: 2px 7px; margin-right: -6px; border-radius: 999px; text-align: center;
  background: hsl(var(--h) 80% 60% / 0.2); color: var(--c); font-size: 0.82em; font-weight: 600;
}
.tag-chip:hover, .tag-chip:focus-visible {
  transform: translateY(-2px); border-color: var(--c); color: #fff; outline: none;
  box-shadow: 0 0 0 1px hsl(var(--h) 85% 60% / 0.35), 0 8px 26px -6px hsl(var(--h) 90% 60% / 0.65), inset 0 0 18px hsl(var(--h) 90% 60% / 0.12);
}
.tag-chip.is-on { background: hsl(var(--h) 85% 62%); border-color: hsl(var(--h) 85% 62%); color: #07110D; }
.tag-chip.is-on .hash, .tag-chip.is-on .n { color: #07110D; }
.tag-chip.is-on .n { background: rgba(0, 0, 0, 0.14); }

/* ---------- Başlık çapaları ---------- */
.h-anchor {
  margin-left: 0.5em; font-family: var(--font-mono); font-size: 0.7em; font-weight: 400;
  color: var(--ink-faint) !important; border: 0 !important; opacity: 0; text-decoration: none;
  transition: opacity 0.25s var(--ease), color 0.25s var(--ease);
}
.article-body h2:hover .h-anchor, .article-body h3:hover .h-anchor, .h-anchor:focus-visible { opacity: 1; }
.h-anchor:hover { color: var(--phosphor) !important; }
.h-anchor.is-copied::after { content: " kopyalandı"; font-size: 0.8em; color: var(--phosphor); }
@media (hover: none) { .h-anchor { opacity: 0.45; } }

/* ---------- Kod blokları + Kopyala ---------- */
.code-wrap { position: relative; }
.article-body pre {
  background: var(--void-2); border: 1px solid var(--hairline-2); border-radius: var(--r-core);
  padding: 18px 20px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.7;
  color: #D6DBE6; tab-size: 4;
}
.article-body pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.code-copy {
  position: absolute; top: 9px; right: 9px; z-index: 2;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 7px; cursor: pointer;
  color: var(--ink-dim); background: rgba(9, 10, 15, 0.85); border: 1px solid var(--hairline-2);
  opacity: 0; transition: opacity 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.code-wrap:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { color: var(--phosphor); border-color: var(--phosphor-soft); }
.code-copy.is-done { color: var(--phosphor); border-color: var(--phosphor-soft); opacity: 1; }
@media (hover: none) { .code-copy { opacity: 1; } }

/* ---------- Lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 9995; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
  background: rgba(5, 6, 10, 0.92); backdrop-filter: blur(6px); padding: 28px; cursor: zoom-out;
}
.lb.is-open { display: flex; animation: lbIn 0.25s var(--ease-out); }
.lb img { max-width: min(96vw, 1500px); max-height: 82vh; border-radius: 10px; border: 1px solid var(--hairline-2); box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6); cursor: default; object-fit: contain; }
.lb-cap { max-width: 80ch; text-align: center; font-size: 0.9rem; color: var(--ink-dim); }
.lb-x {
  position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--ink); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--hairline-2);
}
.lb-x:hover { border-color: var(--phosphor-soft); color: var(--phosphor); }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Tepki ("faydalı buldun mu?") ---------- */
.react-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: clamp(36px, 5vw, 54px);
  padding: 18px 22px; border: 1px solid var(--hairline-2); border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008));
}
.react-q { font-weight: 600; font-size: 1.02rem; }
.react-btns { display: flex; gap: 8px; }
.react-btns button {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; color: var(--ink-dim); border: 1px solid var(--hairline-2); background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.react-btns button:hover { border-color: var(--phosphor-soft); color: var(--ink); }
.react-btns button.is-on { background: var(--phosphor); border-color: var(--phosphor); color: #04120C; font-weight: 600; }
.react-thanks { font-size: 0.9rem; color: var(--phosphor); min-height: 1.3em; }

/* ---------- Yazar kutusu (veriden) ---------- */
.author-box .a-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--ink-faint); margin-top: 6px; }
.author-social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.author-social a {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 5px 10px; border: 1px solid var(--hairline-2); border-radius: 999px; color: var(--ink-dim);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.author-social a:hover { border-color: var(--phosphor-soft); color: var(--phosphor); }

/* ---------- İlgili yazılar ---------- */
.related .grid-12 .span-4 { display: flex; }
.related .grid-12 .span-4 > .card { width: 100%; }

/* ---------- Etiket sayfası ---------- */
.tag-hero-title { font-family: var(--font-mono); font-size: clamp(1.6rem, 4vw, 3rem); font-weight: 500; letter-spacing: 0.04em; line-height: 1.1; }
.tag-hero-title .hash { color: hsl(var(--h, 160) 85% 64%); margin-right: 0.12em; text-shadow: 0 0 22px hsl(var(--h, 160) 90% 60% / 0.55); }
.tag-count { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; color: var(--ink-faint); text-transform: uppercase; margin-top: 14px; }
.tag-count b { color: var(--phosphor); font-weight: 600; }
.tag-cloud-wrap { margin-top: clamp(60px, 8vw, 100px); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 12px 12px; align-items: center; margin-top: 28px; }

@media (max-width: 900px) {
  .yazi-article .article-body p { font-size: 1.06rem; }
  .react-box { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tag-chip, .code-copy, .h-anchor { transition: none; }
  .lb.is-open { animation: none; }
}
