/* =========================================================================
   books.css — /books sayfası (Apartena Books)
   site.css'in tokenları, butonları, navbar'ı ve kartları üstüne kurulur.
   Ana siteyle aynı renkler; kitap başlıklarında Newsreader (serif) ile
   kitap hissi verilir. Kapaklar 2:3, sırtı ışıklı ve gölgeli.
   ========================================================================= */

:root { --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif; }

.bk-serif, .bk-hero__title, .bk-card__title, .bk-detail__title, .bk-author__name, .bk-cover__blank-title, .bk-quote {
  font-family: var(--serif); font-weight: 500; letter-spacing: -.015em;
}
.bk-brand-sub {
  margin-inline-start: .4rem; padding-inline-start: .45rem; border-inline-start: 1px solid var(--border-strong);
  font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--brand-text);
}
.bk-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; font-size: .86rem; font-weight: 500; letter-spacing: .02em; color: var(--accent-text);
}
.bk-eyebrow::before { content: ''; width: 22px; height: 1px; background: currentColor; opacity: .7; }

/* Giriş animasyonu (yüklenince sırayla yükselir) */
.bk-rise { animation: bk-rise .8s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 90ms + 60ms); }
@keyframes bk-rise { from { opacity: 0; transform: translateY(22px); } }

/* -------------------------------------------------------------------------
   Kapak
   ------------------------------------------------------------------------- */
.bk-cover {
  position: relative; display: block; aspect-ratio: 2 / 3; width: 100%; overflow: hidden;
  border-radius: 4px 10px 10px 4px; background: var(--raised);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 22px 44px -18px rgba(0, 0, 0, .7), 0 6px 14px -6px rgba(0, 0, 0, .5);
}
[data-theme='light'] .bk-cover { box-shadow: 0 22px 44px -20px rgba(11, 27, 52, .45), 0 6px 14px -8px rgba(11, 27, 52, .3); }
.bk-cover img { width: 100%; height: 100%; object-fit: cover; }
/* Kitap sırtı: soldaki ince ışık ve gölge */
.bk-cover::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .35) 0, rgba(255, 255, 255, .16) 3px, rgba(0, 0, 0, .12) 7px, transparent 14px, transparent 92%, rgba(0, 0, 0, .12));
}
.bk-cover__blank {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 14% 12% 12%;
  background: radial-gradient(120% 80% at 20% 0%, rgba(14, 165, 233, .45), transparent 60%), radial-gradient(100% 70% at 100% 100%, rgba(16, 185, 129, .4), transparent 60%), #0b1730;
  color: #eef4ff;
}
.bk-cover__blank-title { font-size: clamp(1.1rem, 2.2vw, 1.6rem); line-height: 1.15; overflow-wrap: anywhere; }
.bk-cover--xl .bk-cover__blank-title { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.bk-cover__blank-author { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }

/* -------------------------------------------------------------------------
   Giriş (hero)
   ------------------------------------------------------------------------- */
.bk-hero, .bk-detail { position: relative; overflow: hidden; isolation: isolate; }
.bk-hero { padding: calc(var(--nav-h) + 80px) 0 96px; }
.bk-hero__lights { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.bk-hero__lights span { position: absolute; border-radius: 50%; filter: blur(80px); animation: bk-drift 18s ease-in-out infinite alternate; }
.bk-hero__lights span:first-child { width: 560px; height: 560px; top: -180px; right: -80px; background: var(--light-a); }
.bk-hero__lights span:last-child { width: 460px; height: 460px; bottom: -220px; left: -120px; background: var(--light-b); animation-delay: -9s; }
@keyframes bk-drift { to { transform: translate(-60px, 40px) scale(1.08); } }

.bk-hero__layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 64px; align-items: center; }
.bk-hero__layout--solo { grid-template-columns: minmax(0, 760px); justify-content: center; text-align: center; }
.bk-hero__layout--solo .bk-hero__actions { justify-content: center; }
.bk-hero__title { margin-top: 1rem; font-size: clamp(2.8rem, 6vw, 5rem); line-height: 1.02; }
.bk-hero__intro { margin-top: 1.4rem; max-width: 50ch; font-size: 1.15rem; color: var(--muted); }
.bk-hero__layout--solo .bk-hero__intro { margin-inline: auto; }
.bk-hero__actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2.2rem; }
.bk-hero__count { margin-top: 1.8rem; font-size: .92rem; color: var(--muted); }
.bk-hero__count strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Kapak yelpazesi: üst üste, hafif dönük ve süzülen kitaplar */
.bk-hero__stack { position: relative; height: clamp(360px, 40vw, 500px); }
.bk-hero__book {
  position: absolute; top: 50%; left: 50%; width: clamp(180px, 19vw, 250px);
  transform: translate(-50%, -50%) translateX(var(--x, 0)) rotate(var(--r, 0deg));
  animation: bk-book-in 1s var(--ease-out) both, bk-float 7s ease-in-out infinite;
  animation-delay: calc(var(--i) * 140ms + 200ms), calc(var(--i) * -2.3s);
  transition: transform .4s var(--ease-out);
}
.bk-stack--1 .bk-hero__book { --x: 0; --r: -3deg; }
.bk-stack--2 .bk-hero__book:nth-child(1) { --x: -26%; --r: -7deg; z-index: 1; }
.bk-stack--2 .bk-hero__book:nth-child(2) { --x: 26%; --r: 5deg; z-index: 2; }
.bk-stack--3 .bk-hero__book:nth-child(1) { --x: 0; --r: -2deg; z-index: 3; }
.bk-stack--3 .bk-hero__book:nth-child(2) { --x: -48%; --r: -10deg; z-index: 2; top: 54%; }
.bk-stack--3 .bk-hero__book:nth-child(3) { --x: 48%; --r: 9deg; z-index: 1; top: 54%; }
@keyframes bk-book-in { from { opacity: 0; scale: .9; } }
@keyframes bk-float { 50% { translate: 0 -12px; } }
@media (hover: hover) and (pointer: fine) {
  .bk-hero__book:hover { z-index: 5; transform: translate(-50%, -50%) translateX(var(--x, 0)) rotate(0deg) scale(1.05); }
}

/* -------------------------------------------------------------------------
   Kitap kartları
   ------------------------------------------------------------------------- */
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 282px)); justify-content: center; gap: 24px; }
.bk-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
  transition: transform .3s var(--ease-out), border-color .2s, box-shadow .3s;
}
.bk-card__media {
  display: grid; place-items: center; padding: 34px 34px 28px;
  background: radial-gradient(90% 70% at 50% 100%, var(--light-a), transparent 72%), var(--raised);
  border-bottom: 1px solid var(--border);
}
.bk-card__media .bk-cover { width: min(78%, 210px); transition: transform .45s var(--ease-out); }
.bk-card__body { display: flex; flex-direction: column; gap: .5rem; flex: 1; padding: 20px 22px 22px; }
.bk-card__meta { font-size: .84rem; color: var(--muted); }
.bk-card__title { font-size: 1.45rem; line-height: 1.18; }
.bk-card__title a { transition: color .16s; }
.bk-card__summary { font-size: .95rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bk-card__stores { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.bk-store-pill {
  display: inline-flex; align-items: center; gap: .3rem; padding: .32rem .75rem; border-radius: var(--pill);
  font-size: .82rem; font-weight: 600; color: var(--ink); background: var(--mint);
  transition: background-color .16s, transform .14s var(--ease-out);
}
.bk-store-pill svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bk-store-pill--more { color: var(--text); background: var(--raised); border: 1px solid var(--border-strong); }
.bk-store-pill:active { transform: scale(.96); }
.bk-card__more {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border);
  font-size: .9rem; font-weight: 600; color: var(--brand-text);
}
.bk-card__more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .bk-card:hover { transform: translateY(-5px); border-color: rgba(96, 165, 250, .55); box-shadow: 0 26px 60px -30px rgba(37, 99, 235, .7); }
  .bk-card:hover .bk-card__media .bk-cover { transform: translateY(-4px) rotate(-1.5deg) scale(1.03); }
  .bk-card__title a:hover { color: var(--brand-text); }
  .bk-card__more:hover svg { transform: translateX(3px); }
  .bk-store-pill:not(.bk-store-pill--more):hover { background: #a7f3d0; }
  .bk-store-pill--more:hover { border-color: var(--blue-400); }
}

.bk-empty { display: grid; place-items: center; gap: .6rem; padding: 56px 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.bk-empty__icon { font-size: 2rem; }

/* -------------------------------------------------------------------------
   Yazar
   ------------------------------------------------------------------------- */
.bk-author {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 40px; align-items: start; max-width: 940px; margin-inline: auto; padding: 44px;
  background: linear-gradient(140deg, rgba(37, 99, 235, .12), transparent 55%), var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.bk-author__photo { width: 148px; height: 148px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-strong); box-shadow: 0 0 0 6px rgba(96, 165, 250, .08); }
.bk-author__photo--blank { display: grid; place-items: center; font-family: var(--serif); font-size: 3.4rem; color: #fff; background: var(--grad); }
.bk-author__name { margin: .5rem 0 1rem; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.bk-author__links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }

.bk-prose { color: var(--muted); font-size: 1.05rem; line-height: 1.8; }
.bk-prose p + p { margin-top: 1rem; }

/* -------------------------------------------------------------------------
   Kitap sayfası
   ------------------------------------------------------------------------- */
.bk-detail { padding: calc(var(--nav-h) + 40px) 0 96px; }
.bk-detail__layout { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 64px; align-items: start; }
.bk-detail__cover { position: sticky; top: calc(var(--nav-h) + 32px); padding: 40px; border-radius: var(--r-lg); background: radial-gradient(90% 70% at 50% 100%, var(--light-a), transparent 72%), var(--raised); border: 1px solid var(--border); }
.bk-detail__title { margin-top: .9rem; font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1.04; }
.bk-detail__subtitle { margin-top: .6rem; font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--muted); }
.bk-detail__author { margin-top: 1rem; font-weight: 500; color: var(--brand-text); }
.bk-detail__lead { margin-top: 1.4rem; max-width: 60ch; font-size: 1.15rem; line-height: 1.7; }
.bk-detail__desc { margin-top: 2rem; max-width: 68ch; }

.bk-buy { margin-top: 2rem; padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.bk-buy__title { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: .9rem; }
.bk-buy__list { display: grid; gap: .5rem; }
.bk-buy__row {
  display: flex; align-items: center; gap: 1rem; padding: .85rem 1rem .85rem 1.2rem; border-radius: var(--r);
  background: var(--raised); border: 1px solid var(--border); transition: border-color .16s, background-color .16s, transform .14s var(--ease-out);
}
.bk-buy__row:active { transform: scale(.985); }
.bk-buy__store { flex: 1; font-weight: 600; }
.bk-buy__price { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.bk-buy__go { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--mint); }
.bk-buy__go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease-out); }
.bk-buy__row.is-first { border-color: rgba(110, 231, 183, .4); background: linear-gradient(90deg, rgba(16, 185, 129, .12), transparent 70%), var(--raised); }
.bk-buy__none { color: var(--muted); font-size: .95rem; }
@media (hover: hover) and (pointer: fine) {
  .bk-buy__row:hover { border-color: var(--mint); }
  .bk-buy__row:hover .bk-buy__go svg { transform: translate(2px, -2px); }
}

.bk-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 2rem; overflow: hidden; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); }
/* Hücre çizgileri: sağ ve alt kenar; dış kenardakiler kapsayıcıda kırpılır */
.bk-facts div { padding: .9rem 1.1rem; margin: 0 -1px -1px 0; border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.bk-facts dt { font-size: .8rem; color: var(--muted); }
.bk-facts dd { margin-top: .15rem; font-weight: 500; overflow-wrap: anywhere; }

.bk-quote {
  position: relative; margin-top: 2.2rem; padding: 1.4rem 1.6rem 1.4rem 1.8rem; border-radius: 0 var(--r) var(--r) 0;
  font-style: italic; font-size: 1.3rem; line-height: 1.55; color: var(--text);
  background: linear-gradient(90deg, rgba(96, 165, 250, .08), transparent); border-inline-start: 2px solid var(--sky);
}
.bk-quote p + p { margin-top: .8rem; }

.bk-missing { padding-top: calc(var(--nav-h) + 96px); min-height: 70vh; }

/* -------------------------------------------------------------------------
   Duyarlı düzen
   ------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .bk-hero { padding: calc(var(--nav-h) + 48px) 0 72px; }
  .bk-hero__layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .bk-hero__stack { height: clamp(320px, 70vw, 440px); max-width: 520px; width: 100%; margin-inline: auto; }
  .bk-hero__book { width: clamp(150px, 34vw, 220px); }
  .bk-detail__layout { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .bk-detail__cover { position: static; max-width: 360px; width: 100%; margin-inline: auto; padding: 32px; }
}
@media (max-width: 640px) {
  .bk-hero__title { font-size: clamp(2.4rem, 11vw, 3.2rem); }
  .bk-hero__actions .btn { flex: 1 1 100%; }
  .bk-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .bk-card__media { padding: 28px 28px 22px; }
  .bk-card__media .bk-cover { width: min(56%, 200px); }
  .bk-author { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 28px 22px; text-align: center; }
  .bk-author__photo { width: 112px; height: 112px; margin-inline: auto; }
  .bk-author .bk-eyebrow, .bk-author__links { justify-content: center; }
  .bk-buy { padding: 16px; }
  .bk-quote { font-size: 1.15rem; padding: 1.1rem 1.2rem 1.1rem 1.3rem; }
  .bk-brand-sub { margin-inline-start: .3rem; padding-inline-start: .35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bk-rise, .bk-hero__book, .bk-hero__lights span { animation: none; }
  .bk-card, .bk-card__media .bk-cover, .bk-hero__book { transition: none; }
  .bk-card:hover, .bk-card:hover .bk-card__media .bk-cover { transform: none; }
}
