/* ============================================================
   base.css
   Ana site stilleri - base.njk tarafından yüklenir
============================================================ */

/* ============================================================
   0. RESET & BASE
============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background-color: #0d0d0d;
  color: #fff;
  font-family: system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   1. DESIGN TOKENS
============================================================ */
:root {
  --p-lightness: 85%;
  --base-color: hsl(0, 0%, var(--p-lightness));
  --bright-top: hsl(0, 0%, calc(var(--p-lightness) + 8%));
  --shadow-bottom: hsl(0, 0%, calc(var(--p-lightness) - 25%));
  --text-color: hsl(0, 0%, calc(var(--p-lightness) - 45%));
  --gap-color: #121212;

  --border-subtle: #222;
  --surface-1: #111;
  --surface-2: #1a1a1a;
  --text-muted: #888;
  --text-dim: #555;
  --text-body: #d1d1d1;
  --text-heading: #d8d8d8;
  --accent: #38bdf8;
  --accent-purple: #400cc3;

/* --- TYPOGRAPHY SCALE ------------------------------------------------ */
/* Tek kontrol noktası: bunları değiştir, hiyerarşi tamamen yeniden hesaplanır */

/* Boyut ölçeği — body referansı, modüler ratio iki yöne */
--type-base: 1rem;        /* 16px — body referansı */
--type-ratio: 1.2;        /* modüler oran (Major Third)
                             1.2   = Minor Third (yumuşak)
                             1.25  = Major Third (dengeli, modern default)
                             1.333 = Perfect Fourth (güçlü hiyerarşi) */

--fs-body: var(--type-base);
--fs-h6:   calc(var(--type-base) / var(--type-ratio));    /* body'den küçük */
--fs-h5:   var(--type-base);                              /* body ile eşit, weight/renk ile ayrılır */
--fs-h4:   calc(var(--type-base) * var(--type-ratio));
--fs-h3:   calc(var(--fs-h4)    * var(--type-ratio));
--fs-h2:   calc(var(--fs-h3)    * var(--type-ratio));
--fs-h1:   calc(var(--fs-h2)    * var(--type-ratio));

/* Parlaklık ölçeği — koyu zemin üzerinde HSL lightness */
--type-hue: 0;
--type-sat: 0%;
--type-l-top:  86%;       /* h1 — en parlak */
--type-l-step:  4%;       /* step küçüldü: 7 seviye (h1..h6 + body) aynı range içinde kalsın */

--color-h1:   hsl(var(--type-hue), var(--type-sat), var(--type-l-top));
--color-h2:   hsl(var(--type-hue), var(--type-sat), calc(var(--type-l-top) - var(--type-l-step) * 1));
--color-h3:   hsl(var(--type-hue), var(--type-sat), calc(var(--type-l-top) - var(--type-l-step) * 2));
--color-h4:   hsl(var(--type-hue), var(--type-sat), calc(var(--type-l-top) - var(--type-l-step) * 3));
--color-h5:   hsl(var(--type-hue), var(--type-sat), calc(var(--type-l-top) - var(--type-l-step) * 4));
--color-h6:   hsl(var(--type-hue), var(--type-sat), calc(var(--type-l-top) - var(--type-l-step) * 5));
--color-body: hsl(var(--type-hue), var(--type-sat), calc(var(--type-l-top) - var(--type-l-step) * 6));

/* Satır yüksekliği — başlık büyüdükçe sıkılaşır */
--lh-tight: 1.15;         /* h1, h2 */
--lh-snug:  1.3;          /* h3, h4 */
--lh-body:  1.6;          /* h5, h6, p */

/* Ağırlık */
--fw-heading: 700;
--fw-body:    400;
}

/* ============================================================
   2. LAYOUT UTILITY
============================================================ */
.container {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   3. HEADER & NAV
============================================================ */
header {
  background-color: var(--gap-color);
  border-bottom: 3px solid #000;
}

header .container {
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.nav-links {
  display: contents;
}

.skew-unit {
  transform: skew(-25deg);
  border: none;
  text-decoration: none;
}

/* Dekoratif slat şeritleri */
.side-slats {
  width: 120px;
  flex-shrink: 0;
  background:
    linear-gradient(
      to bottom,
      transparent 0%,
      transparent 82%,
      rgba(0, 0, 0, 0.2) 92%,
      rgba(0, 0, 0, 0.5) 100%
    ),
    repeating-linear-gradient(
      to right,
      var(--base-color),
      var(--base-color) 4px,
      var(--gap-color) 5px,
      var(--gap-color) 8px
    );
}

.left-slats {
  mask-image: linear-gradient(to right, transparent 0%, black 90%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 90%);
}

.right-slats {
  mask-image: linear-gradient(to left, transparent 0%, black 90%);
  -webkit-mask-image: linear-gradient(to left, transparent 0%, black 90%);
}

.btn {
  padding: 18px 40px;
  margin: 0 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: linear-gradient(
    to bottom,
    var(--bright-top) 0%,
    var(--base-color) 8%,
    var(--base-color) 82%,
    var(--shadow-bottom) 94%,
    rgba(0, 0, 0, 0.4) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 5px 8px rgba(0, 0, 0, 0.4);
}

.btn span {
  display: block;
  transform: skew(25deg);
  color: var(--text-color);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn:hover span {
  color: #333;
}

.btn:active {
  transform: skew(-25deg) translateY(2px);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   4. MAIN LAYOUT
============================================================ */
main {
  padding: 32px 0;
}

main .container {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 24px;
  align-items: start;
}

/* ============================================================
   5. CARD GRID
============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  font-weight: 600;
  color: #b4b4b4;
}

.card-body {
  padding: 4px 0;
}

/* Tek kolonlu grid item (özel layout) */
.card-item0 {
  display: grid;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--surface-2);
}

.card-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--surface-2);
  transition: background 0.15s;
}

.card-item:last-child {
  border-bottom: none;
}

.card-item:hover {
  background: var(--surface-2);
  color: #fff;
}

.card-item-label {
  flex: 0 0 auto;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.6;
  font-size: 0.9rem;
  min-width: 80px;
}

.card-item-value {
  color: #c0c0c0;
  font-weight: 500;
  min-width: 0;
  flex: 1;
}

.card-item-icon {
  flex-shrink: 0;
}

.card-item-slug {
  flex-shrink: 0;
  color: var(--text-dim);
}

.card-item-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-dim);
}

.card-empty {
  padding: 12px 16px;
  font-size: 14px;
  color: #444;
}

/* ============================================================
   6. SIDEBAR
============================================================ */
.sidebar {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.sidebar h3 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.sidebar p {
  margin: 0 0 0.75rem;
}

.sidebar p:last-child {
  margin-bottom: 0;
}

.sidebar a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.sidebar a:hover {
  color: #aaa;
}

/* ============================================================
   7. ARTICLE / PROSE
============================================================ */
article h1,
article h2,
article h3,
article h4 {
  font-weight: var(--fw-heading);
  letter-spacing: -0.01em;     /* büyük puntoda optik düzeltme */
  margin: 1.5em 0 0.5em;
}

article h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  color: var(--color-h1);
  letter-spacing: -0.02em;     /* h1'de biraz daha sıkı */
}

article h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  color: var(--color-h2);
}

article h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  color: var(--color-h3);
}

article h4 {
  font-size: var(--fs-h4);
  line-height: var(--lh-snug);
  color: var(--color-h4);
}
article h5 {
  font-size: var(--fs-h5);
  line-height: var(--lh-snug);
  color: var(--color-h5);
}
article h6 {
  font-size: var(--fs-h6);
  line-height: var(--lh-snug);
  color: var(--color-h6);
}

article p {
  margin: 1.25em 0 0;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-body);
  letter-spacing: 0.011em;
  color: var(--color-body);
}

article ul {
  list-style: none;
  padding: 0;
}

article li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-body);
}

article li::before {
  content: "•";
  color: var(--accent);
  position: absolute;
  left: 0;
  font-weight: bold;
}

article a {
  color: #aaa;
  text-decoration: underline;
}

article a:hover {
  color: #fff;
}

/* Resim overflow önleme - ÖNEMLI */
article img,
article picture,
.content img,
.content picture {
  max-width: 100%;
  height: auto;
  display: block;
}
article hr {
  border: none;
  border-top: 1px solid #ccc;
  text-align: center;
  margin-top: 1em;
  margin-bottom: 0em;
}

blockquote {
  border-left: 4px solid var(--accent-purple);
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  font-style: italic;
  background-color: #1d0c2f;
  color: #c4b5fd;
}

/* ============================================================
   8. BOOK CARD
============================================================ */
.book-card {
  display: block;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.book-card-inner {
  display: flex;
  gap: 1rem;
  padding: 1rem;
}

.book-card img {
  width: 100px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.book-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.book-meta h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.book-meta p {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
}

.rating {
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.status {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  width: fit-content;
  text-transform: capitalize;
}

.status-reading {
  color: orange;
  background-color: rgba(255, 165, 0, 0.1);
}

.status-completed {
  color: green;
  background-color: rgba(0, 128, 0, 0.1);
}

.status-to-read {
  color: gray;
  background-color: rgba(128, 128, 128, 0.1);
}

/* ============================================================
   9. GRID WRAPPER (yaşam takvimi vb.)
============================================================ */
.grid-wrapper {
  --size: 18px;
  --color: #cfc8f5;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 2rem;
}

.grid-wrapper .box {
  position: relative;
  min-width: var(--size);
  min-height: 30px;
  background: var(--color);
  border: 1px solid #333;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: #222;
}

.grid-wrapper .box[data-tooltip-text]:hover::after {
  content: attr(data-tooltip-text);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #1a1a2e;
  color: #f0f0f0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  width: max-content;
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
  text-align: left;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.grid-wrapper .box[data-tooltip-text]:hover::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  border: 6px solid transparent;
  border-top-color: #1a1a2e;
  pointer-events: none;
}

.grid-wrapper .box.filled {
  --size: 118px;
  color: #381dcf;
  z-index: 1;
}

.grid-wrapper .box.filled:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  z-index: 50;
  background-color: #a4c8ff;
}

.grid-wrapper .box.Birthday {
  --color: #c2ac6b;
  --size: 98px;
}

.grid-wrapper .box.World .box.History .box.Education {
  --size: 198px;
}

.grid-wrapper .box.Education {
  --size: 198px;
}

/* ============================================================
   10. DECADE DIVIDER
============================================================ */
.decade-title {
  font-size: 1rem;
  font-weight: 700;
  color: #444;
  margin: 2rem 0 0.3rem;
  letter-spacing: 0.05em;
}

.decade-divider {
  border: none;
  border-top: 2px solid #ddd;
  margin: 0 0 0.5rem;
}

/* ============================================================
   11. UTILITY
============================================================ */
.detail-link {
  display: inline-block;
  margin-top: 0.2em;
  color: #1a73e8;
  text-decoration: underline;
  transition: color 0.3s;
}

.detail-link:hover,
.detail-link:focus {
  color: #0c47b7;
  outline: none;
  text-decoration: none;
}

.return-btn {
  margin-left: auto;
  display: inline-block;
  padding: 6px 12px;
  background-color: #333;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.3s;
}

.return-btn:hover {
  background-color: #555;
}

/* ============================================================
   12. FOOTER
============================================================ */
footer {
  background: var(--surface-1);
  border-top: 1px solid var(--border-subtle);
  padding: 16px 0;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* ============================================================
   13. COVER IMAGE
============================================================ */
.cover-wrapper {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s ease;
}

.cover-wrapper:hover .cover-image {
  transform: scale(1.02);
}

/* ============================================================
   14. POST HEADER
============================================================ */
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.post-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
}

.post-category,
.post-lang {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.post-title {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.post-description {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  font-style: italic;
}

/* ============================================================
   15. POST BODY — picture transform çıktısını yakalar
============================================================ */
.post-body picture {
  display: block;
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.post-body picture img {
  width: 100%;
  height: auto;
  display: block;
}

/* ============================================================
   16. RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
  main .container {
    grid-template-columns: 7fr 3fr;
  }

  .side-slats {
    width: 60px;
  }

  .btn {
    padding: 18px 24px;
  }
}

@media (max-width: 768px) {
  main .container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .cover-wrapper {
    border-radius: 0;
    margin-left: -24px;
    margin-right: -24px;
    width: calc(100% + 48px);
  }
}

@media (max-width: 600px) {
  footer .container {
    flex-direction: column;
    gap: 8px;
  }

  .side-slats {
    display: none;
  }

  .btn {
    padding: 18px 16px;
  }
  /* ============================================================
   17. DIVIDER
============================================================ */
  .beauty-divider {
    display: block;
    margin: 2.5rem auto;
    max-width: 420px;
    color: var(--text-muted);
  }

  .beauty-divider svg {
    display: block;
    width: 100%;
    height: auto;
  }
}