/**
 * adamkarga - Özel Bileşenler, Animasyonlar, Tipografi ve Editoryal Stiller
 */

/* Karakalem Tuval Katmanı */
#pencil-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.95;
}

/* Tavandan Sarkan Nostaljik Yağ Kandili (Mobilde köşede güvenli durur, menüyü örtmez) */
.kandil-fixture {
  position: fixed;
  top: 0;
  right: 8px;
  z-index: 60;
  transform-origin: top center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (min-width: 640px) {
  .kandil-fixture {
    right: 36px;
  }
}

.kandil-fixture:hover {
  transform: translateY(4px);
}

.kandil-fixture.swinging {
  animation: kandilSwing 1.6s ease-in-out;
}

/* WordPress Özelleştirilebilir Ana Menü (.adamkarga-nav-list) */
.adamkarga-nav-list {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 640px) {
  .adamkarga-nav-list {
    gap: 0.75rem;
  }
}
.adamkarga-nav-list li {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
}
.adamkarga-nav-list li:not(:last-child)::after {
  content: "·";
  margin-left: 0.5rem;
  color: #d6d3d1;
  pointer-events: none;
}
@media (min-width: 640px) {
  .adamkarga-nav-list li:not(:last-child)::after {
    margin-left: 0.75rem;
  }
}
.dark .adamkarga-nav-list li:not(:last-child)::after {
  color: #44403c;
}
.adamkarga-nav-list li a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.adamkarga-nav-list li a:hover {
  color: #0c0a09;
}
.dark .adamkarga-nav-list li a:hover {
  color: #ffffff;
}

/* Yatay Sürükleme Şeritleri (Kategoriler & Arşiv Yılları) */
.drag-scroll-strip {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-overflow-scrolling: touch;
}
.drag-scroll-strip:active {
  cursor: grabbing;
}

@keyframes kandilSwing {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(16deg); }
  40% { transform: rotate(-12deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-4deg); }
  92% { transform: rotate(2deg); }
  100% { transform: rotate(0deg); }
}

/* Kandil Alevi Titreme Hareketi */
.flame-flicker {
  animation: flameMotion 2.2s infinite ease-in-out alternate;
  transform-origin: 50% 90%;
}

@keyframes flameMotion {
  0% { transform: scale(1) skewX(0deg); opacity: 0.95; }
  25% { transform: scale(1.05, 0.96) skewX(-2deg); opacity: 0.88; }
  50% { transform: scale(0.96, 1.04) skewX(2deg); opacity: 1; }
  75% { transform: scale(1.03, 0.98) skewX(-1deg); opacity: 0.92; }
  100% { transform: scale(0.98, 1.02) skewX(1deg); opacity: 0.97; }
}

.kandil-glow-active {
  filter: drop-shadow(0 0 16px rgba(249, 115, 22, 0.65)) drop-shadow(0 0 35px rgba(251, 191, 36, 0.4));
}

.kandil-glow-extinguished {
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.1));
}

/* Kandil Çift Görsel (Işık Açık vs Işık Kapalı) Yumuşak Geçiş & Sıfır FOUC */
.kandil-custom-imgs {
  position: relative;
  display: block;
}
.kandil-custom-imgs .kandil-img-on,
.kandil-custom-imgs .kandil-img-off {
  transition: opacity 0.35s ease-in-out, filter 0.35s ease-in-out;
  backface-visibility: hidden;
}
.kandil-custom-imgs.has-dual-images .kandil-img-off {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
html:not(.dark) .kandil-custom-imgs.has-dual-images .kandil-img-on {
  opacity: 1 !important;
  visibility: visible !important;
}
html:not(.dark) .kandil-custom-imgs.has-dual-images .kandil-img-off {
  opacity: 0 !important;
  visibility: hidden !important;
}
html.dark .kandil-custom-imgs.has-dual-images .kandil-img-on {
  opacity: 0 !important;
  visibility: hidden !important;
}
html.dark .kandil-custom-imgs.has-dual-images .kandil-img-off {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Sürüklenebilir Fotoğraf & Çıkartma Sahnesi */
.draggable-photo-stage {
  position: relative;
  z-index: 10;
  isolation: isolate;
  touch-action: pan-y;
  user-select: none;
  min-height: 390px;
  background: transparent;
  overflow: visible;
}

@media (max-width: 640px) {
  .draggable-photo-stage {
    min-height: 360px;
  }
}

.draggable-photo {
  position: absolute;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform, left, top;
  transform-origin: center center;
}

.draggable-photo:active {
  cursor: grabbing;
}

/* 1. Klasik Beyaz Kenarlık Fotoğraf Baskısı */
.photo-framed {
  background-color: #ffffff;
  padding: 6px 6px 14px 6px;
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.18), 0 2px 5px -1px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.photo-framed img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.draggable-photo:hover .photo-framed {
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.28), 0 6px 12px -2px rgba(0, 0, 0, 0.15);
}

/* 2. Kesim Hatlı Şeffaf PNG / Sticker Tipi (Die-cut Kontur) */
.sticker-cutout {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  filter: drop-shadow(2px 0 0 #ffffff) 
          drop-shadow(-2px 0 0 #ffffff) 
          drop-shadow(0 2px 0 #ffffff) 
          drop-shadow(0 -2px 0 #ffffff) 
          drop-shadow(0 6px 12px rgba(0, 0, 0, 0.26));
  transition: filter 0.2s ease, transform 0.15s ease;
}

.draggable-photo:hover .sticker-cutout {
  filter: drop-shadow(2.5px 0 0 #ffffff) 
          drop-shadow(-2.5px 0 0 #ffffff) 
          drop-shadow(0 2.5px 0 #ffffff) 
          drop-shadow(0 -2.5px 0 #ffffff)
          drop-shadow(0 12px 20px rgba(0, 0, 0, 0.34));
}

/* Yazılan Kitaplar - Doğal En-Boy Oranı & 3D Kapak */
.authored-book-card {
  position: relative;
  flex-shrink: 0;
  perspective: 1000px;
  cursor: pointer;
  user-select: none;
  width: 140px;
  max-width: 175px;
  min-width: 115px;
  box-sizing: border-box;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.authored-book-cover-img-wrap {
  position: relative;
  height: 210px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.3s ease;
}

.authored-book-img {
  height: 210px;
  width: auto;
  max-height: 210px;
  max-width: 100%;
  object-fit: contain;
  display: block;
  border-radius: 2px 5px 5px 2px;
  box-shadow: 
    -3px 0 6px -2px rgba(0,0,0,0.25),
    5px 8px 18px -2px rgba(0, 0, 0, 0.22),
    0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform-origin: left center;
}

.authored-book-card:hover .authored-book-img {
  transform: translateY(-5px) rotateY(-3deg);
  box-shadow: 
    -5px 0 10px -2px rgba(0,0,0,0.32),
    12px 18px 28px -3px rgba(0, 0, 0, 0.28),
    0 4px 10px rgba(0,0,0,0.15);
}

.authored-book-meta {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.authored-book-meta h3 {
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* Kitaplar Arası Saydam Dikey Ayrıcı */
.authored-book-divider {
  width: 1px;
  height: 200px;
  flex-shrink: 0;
  align-self: flex-start;
}

/* Fallback Tipografik Kapak (Özel Görsel Yüklenmemişse) */
.authored-book-cover-fallback {
  position: relative;
  width: 140px;
  height: 210px;
  border-radius: 2px 7px 7px 2px;
  box-shadow: 
    -4px 0 6px -2px rgba(0,0,0,0.3),
    6px 10px 20px -3px rgba(0, 0, 0, 0.22),
    0 2px 6px rgba(0,0,0,0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform-origin: left center;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 12px;
}

.authored-book-cover-fallback::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 8px;
  background: linear-gradient(90deg, rgba(0,0,0,0.25) 0%, rgba(255,255,255,0.15) 50%, rgba(0,0,0,0.18) 100%);
  pointer-events: none;
  z-index: 10;
}

.authored-book-cover-fallback::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 2px;
  bottom: 3px;
  width: 2px;
  background: repeating-linear-gradient(180deg, #f5f5f4 0px, #e7e5e4 2px);
  box-shadow: 1px 0 2px rgba(0,0,0,0.2);
  pointer-events: none;
}

.authored-book-card:hover .authored-book-cover-fallback {
  transform: translateY(-8px) rotateY(-8deg);
  box-shadow: 
    -6px 0 10px -2px rgba(0,0,0,0.35),
    14px 22px 32px -4px rgba(0, 0, 0, 0.32),
    0 4px 10px rgba(0,0,0,0.15);
}

/* Okunan Kitaplar - Kitap Sırtları & Raf */
.book-spine {
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, filter 0.25s ease;
  transform-origin: bottom center;
  flex-shrink: 0;
  box-shadow: 
    inset 4px 0 6px -2px rgba(0, 0, 0, 0.35),
    inset -3px 0 5px -2px rgba(255, 255, 255, 0.2),
    2px 4px 8px -2px rgba(0, 0, 0, 0.25);
}

.book-spine:hover {
  transform: translateY(-14px) scale(1.02);
  z-index: 30;
  box-shadow: 
    inset 4px 0 6px -2px rgba(0, 0, 0, 0.25),
    inset -3px 0 5px -2px rgba(255, 255, 255, 0.3),
    0 14px 24px -4px rgba(0, 0, 0, 0.35),
    0 0 12px rgba(251, 191, 36, 0.25);
  filter: brightness(1.05);
}

/* Gerçek sırt görseli olan kitaplarda iç gölgeleri kaldır, saf görseli koru */
.book-spine.has-spine-img {
  box-shadow: 2px 4px 8px -2px rgba(0, 0, 0, 0.25);
}
.book-spine.has-spine-img:hover {
  box-shadow: 0 14px 24px -4px rgba(0, 0, 0, 0.35);
}

.book-vertical-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-orientation: sideways;
  -webkit-text-orientation: sideways;
  unicode-bidi: isolate;
  font-feature-settings: "vert" 0, "vkrn" 0;
  white-space: nowrap;
}

/* Ahşap / Taş Raf Çıtası */
.bookshelf-ledge {
  position: relative;
  height: 12px;
  background: linear-gradient(180deg, #d6d3d1 0%, #a8a29e 60%, #78716c 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}

.dark .bookshelf-ledge {
  background: linear-gradient(180deg, #292524 0%, #1c1917 60%, #0c0a09 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   EDİTORYAL BELİRGİN ALINTI (BLOCKQUOTE) TASARIMI
   ========================================================================== */
article blockquote,
.editorial-pullquote {
  position: relative;
  margin: 2rem 0;
  padding: 1.25rem 1.5rem 1.25rem 2rem;
  border-left: 3px solid #d97706; /* Kehribar Sol Çizgi */
  background: rgba(245, 245, 244, 0.5);
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.65;
  color: #292524;
  border-radius: 0 6px 6px 0;
}

.dark article blockquote,
.dark .editorial-pullquote {
  background: rgba(28, 25, 23, 0.6);
  color: #e7e5e4;
  border-left-color: #f59e0b;
}

article blockquote::before,
.editorial-pullquote::before {
  content: '“';
  position: absolute;
  top: -0.5rem;
  left: 0.5rem;
  font-size: 3rem;
  font-family: 'Newsreader', Georgia, serif;
  color: #d97706;
  opacity: 0.25;
  line-height: 1;
  pointer-events: none;
}

article blockquote cite,
.editorial-pullquote cite {
  display: block;
  font-style: normal;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #78716c;
  margin-top: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dark article blockquote cite,
.dark .editorial-pullquote cite {
  color: #a8a29e;
}

/* ==========================================================================
   İÇİNDEKİLER TABLOSU (TOC) & OKUMA İLERLEME ÇUBUĞU
   ========================================================================== */
.article-toc {
  backdrop-blur-sm: 4px;
}

#readingProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #d97706, #f59e0b);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
  z-index: 100;
  transition: width 0.08s ease-out;
  pointer-events: none;
}

/* ==========================================================================
   METİN SEÇİLİNCE ALINTILA & PAYLAŞ ARAÇ ÇUBUĞU
   ========================================================================== */
#quoteHighlightToolbar {
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   YORUMLAR (COMMENTS) ALANI VE YORUM YANIT FORMU
   ========================================================================== */
.comment-list .children {
  margin-left: 1.5rem;
  padding-left: 1rem;
  border-left: 1px dashed rgba(168, 162, 158, 0.4);
}

.logged-in-as {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #78716c;
}

.comment-notes {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: #a8a29e;
}

/* Scrollbar Gizleyici */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Kategori & Yıl Hapları — Tek Satır Zorla */
.cat-pill,
.year-pill {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Minimalist Bağlantı Stili */
.minimal-link {
  position: relative;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(140, 140, 150, 0.4);
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}
.minimal-link:hover {
  text-decoration-color: currentColor;
}

/* ==========================================================================
   Gutenberg Blok & Görsel Hizalama Stilleri (Align Left, Right, Center)
   ========================================================================== */

/* Clearfix */
.entry-content::after {
  content: "";
  display: table;
  clear: both;
}

/* Paragraf & Tipografi Akışı */
.entry-content > p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
}
.entry-content > *:last-child {
  margin-bottom: 0;
}

/* Sola Yaslı Görsel / Bloklar */
.alignleft,
.wp-block-image.alignleft,
figure.alignleft {
  float: left;
  margin-top: 0.35rem !important;
  margin-right: 1.5rem !important;
  margin-bottom: 1.25rem !important;
  margin-left: 0 !important;
  max-width: calc(50% - 0.75rem);
  clear: left;
}

/* Sağa Yaslı Görsel / Bloklar */
.alignright,
.wp-block-image.alignright,
figure.alignright {
  float: right;
  margin-top: 0.35rem !important;
  margin-left: 1.5rem !important;
  margin-bottom: 1.25rem !important;
  margin-right: 0 !important;
  max-width: calc(50% - 0.75rem);
  clear: right;
}

/* Ortalanmış Görsel / Bloklar */
.aligncenter,
.wp-block-image.aligncenter,
figure.aligncenter {
  display: block;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 1.5rem !important;
  margin-bottom: 1.5rem !important;
  text-align: center;
  clear: both;
}

/* Mobilde Float Kırılma (Yazıyı aşırı dar alana sıkıştırmamak için) */
@media (max-width: 639px) {
  .alignleft,
  .wp-block-image.alignleft,
  figure.alignleft,
  .alignright,
  .wp-block-image.alignright,
  figure.alignright {
    float: none !important;
    margin: 1.25rem auto !important;
    max-width: 100% !important;
    display: block;
    clear: both;
  }
}

/* WordPress Resim & Figure Stilleri */
.wp-block-image {
  margin-bottom: 1.5rem;
}
.wp-block-image img {
  height: auto;
  max-width: 100%;
  vertical-align: middle;
  border-radius: 4px;
}
.wp-block-image.is-resized img {
  box-sizing: border-box;
}
.wp-block-image figcaption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #78716c;
  margin-top: 0.5rem;
  text-align: center;
}
.dark .wp-block-image figcaption {
  color: #a8a29e;
}

/* ==========================================================================
   SAYFALAMA (PAGINATION) - Editoryal Minimalist Tasarım
   ========================================================================== */
.adamkarga-pagination,
.navigation.pagination {
  width: 100%;
  padding-top: 2rem;
  padding-bottom: 0.5rem;
  border-top: 1px solid rgba(231, 229, 228, 0.8);
}

.dark .adamkarga-pagination,
.dark .navigation.pagination {
  border-top-color: rgba(41, 37, 36, 0.8);
}

.adamkarga-pagination .screen-reader-text,
.navigation.pagination .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.adamkarga-pagination .nav-links,
.navigation.pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 0.75rem; /* 12px */
  line-height: 1;
}

.adamkarga-pagination .nav-links .page-numbers,
.navigation.pagination .nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.125rem;
  height: 2.125rem;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #e7e5e4; /* stone-200 */
  color: #78716c; /* stone-500 */
  background-color: transparent;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.dark .adamkarga-pagination .nav-links .page-numbers,
.dark .navigation.pagination .nav-links .page-numbers {
  border-color: #292524; /* stone-800 */
  color: #a8a29e; /* stone-400 */
}

.adamkarga-pagination .nav-links a.page-numbers:hover,
.navigation.pagination .nav-links a.page-numbers:hover {
  border-color: #d6d3d1; /* stone-300 */
  background-color: #f5f5f4; /* stone-100 */
  color: #1c1917; /* stone-900 */
  transform: translateY(-1px);
}

.dark .adamkarga-pagination .nav-links a.page-numbers:hover,
.dark .navigation.pagination .nav-links a.page-numbers:hover {
  border-color: #44403c; /* stone-700 */
  background-color: #292524; /* stone-800 */
  color: #fafaf9; /* stone-50 */
}

.adamkarga-pagination .nav-links .page-numbers.current,
.navigation.pagination .nav-links .page-numbers.current {
  background-color: #1c1917; /* stone-900 */
  color: #fafaf9; /* stone-50 */
  border-color: #1c1917;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.dark .adamkarga-pagination .nav-links .page-numbers.current,
.dark .navigation.pagination .nav-links .page-numbers.current {
  background-color: #f5f5f4; /* stone-100 */
  color: #1c1917; /* stone-900 */
  border-color: #f5f5f4;
}

.adamkarga-pagination .nav-links .page-numbers.dots,
.navigation.pagination .nav-links .page-numbers.dots {
  border: none;
  background: transparent;
  color: #a8a29e; /* stone-400 */
  min-width: 1.25rem;
  padding: 0;
  letter-spacing: 0.1em;
  pointer-events: none;
}

.adamkarga-pagination .nav-links .prev.page-numbers,
.adamkarga-pagination .nav-links .next.page-numbers,
.navigation.pagination .nav-links .prev.page-numbers,
.navigation.pagination .nav-links .next.page-numbers {
  padding: 0 0.75rem;
  font-weight: 500;
  gap: 0.25rem;
}

/* Kavram Dizini Hareketli Serbest Etiket Çerçevesi */
.concept-canvas {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  z-index: 10;
  isolation: isolate;
}
.concept-canvas.concept-canvas-active .floating-concept-tag {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}
.floating-concept-tag {
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.floating-concept-tag:hover {
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

/* Global Modallar - Görünürlük & Z-Index Güvencesi */
#authoredBookModal.hidden,
#videoModal.hidden {
  display: none !important;
}

#authoredBookModal:not(.hidden),
#videoModal:not(.hidden) {
  display: flex !important;
  z-index: 99999 !important;
}
