/* ==========================================================================
   Arkhaion v2 — temel: renk değişkenleri, fontlar, iskelet (sol çubuk + gövde)
   Eski style.css / arkhaion.css'ten tamamen bağımsız.
   ========================================================================== */

/* ---------- Yunanca: harf aralığına göre ayrı font ----------
   Latin harfler Optima'dan, Yunanca harfler (politonik dahil) GFS Neohellenic'ten gelir.
   Metinde tek bir Yunanca sözcük geçse bile sözcüğün tamamı aynı fonttan çıkar.
   Dosyalar: public/fonts/gfs-neohellenic/ (woff2). Yoksa tarayıcı sistemde kurulu olanı dener. */
/* Dört kesim: normal, kalın, italik, kalın italik (Google Fonts'tan, OFL; TTF'den woff2'ye çevrildi).
   U+0300–036F: birleşen aksanlar (ayrık yazılmış Yunanca aksan da GFS'den çıksın). */
@font-face {
  font-family: "ar-greek";
  src: local("GFS Neohellenic"), local("GFSNeohellenic"),
       url("../../fonts/gfs-neohellenic/GFSNeohellenic.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0300-036F, U+0370-03FF, U+1F00-1FFF;
}
@font-face {
  font-family: "ar-greek";
  src: local("GFS Neohellenic Bold"), local("GFSNeohellenic-Bold"),
       url("../../fonts/gfs-neohellenic/GFSNeohellenic-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0300-036F, U+0370-03FF, U+1F00-1FFF;
}
@font-face {
  font-family: "ar-greek";
  src: local("GFS Neohellenic Italic"), local("GFSNeohellenic-Italic"),
       url("../../fonts/gfs-neohellenic/GFSNeohellenic-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0300-036F, U+0370-03FF, U+1F00-1FFF;
}
@font-face {
  font-family: "ar-greek";
  src: local("GFS Neohellenic Bold Italic"), local("GFSNeohellenic-BoldItalic"),
       url("../../fonts/gfs-neohellenic/GFSNeohellenic-BoldItalic.woff2") format("woff2");
  font-weight: 700; font-style: italic; font-display: swap;
  unicode-range: U+0300-036F, U+0370-03FF, U+1F00-1FFF;
}

/* ---------- Renkler ---------- */
:root,
[data-theme="dark"] {
  --bg:        #1b1b1b;
  --bg-2:      #222221;     /* kenar çubuğu, paneller */
  --bg-3:      #2b2a28;
  --line:      rgba(255, 255, 255, .12);
  --line-2:    rgba(255, 255, 255, .22);
  --fg:        #d9d6cf;     /* ana yazı */
  --fg-2:      #a19d94;     /* ikincil */
  --fg-3:      #6f6b64;     /* soluk */
  --accent:    #c7c1b4;
  --tag-bg:    rgba(20, 20, 20, .82);   /* "View" etiketi */
  --tag-fg:    #e8e4dc;

  /* dönem renkleri (cetvel) — tarayıcıda ayarlanacak */
  --p0: #9fb5a8;  /* Geometrik */
  --p1: #d9a994;  /* Arkaik */
  --p2: #8fb8d6;  /* Klasik */
  --p3: #c9b37a;  /* Hellenistik */
  --p4: #b48a9c;  /* Roma */
  --p5: #9a9a92;  /* Geç Antik */
  --p6: #77736c;  /* Sonrası */

  --font-ui: "ar-greek", "optima-lt-pro", Optima, Candara, "Segoe UI", sans-serif;

  /* sol çubuk (çizim 2000 px genişlikte: çubuk 137, yazı 16, etiket 34) */
  --side-w: clamp(118px, 6.85vw, 160px);
  --side-pad-r: clamp(12px, 1.1vw, 22px);
  --side-fs: clamp(12.5px, .82vw, 17px);
  --label-fs: clamp(24px, 1.75vw, 38px);
  --side-bg: #191919;
  --side-fg: #bdbab3;
  --label-fg: #b3b0a9;

  /* sağdaki cetvel sütunu: her sayfada aynı genişlik */
  --rail-w: clamp(210px, 13.1vw, 300px);

  /* ortadaki içerik alanının zemini (masaüstündeki background-repeat.jpg) */
  --noise: url("../../images/v2/bg-noise.jpg");
  --main-c: #1d1d1d;          /* içerik zemininin rengi (noise yüklenene kadar) */
  --side-noise: none;         /* kenar çubukları: koyuda düz */
  --rail-bg: #1b1b1b;         /* sağdaki cetvel */
  /* ===== AYAR: zeminin açıklığı (noise görselini değiştirmeden) =====
     Noise'un üstüne yarı saydam bir katman: beyaz açar, siyah koyulaştırır, 0 = görsel olduğu gibi.
       --side-veil: kenarlar (sol menü + sağdaki cetvel) · --main-veil: içerik alanı
     Örnek: rgba(255, 255, 255, .25) → %25 açık · rgba(0, 0, 0, .15) → %15 koyu
     Tarayıcıda denemek için: Geliştirici araçları → <html> → bu değişkeni değiştir. */
  --side-veil: rgba(255, 255, 255, 0);
  --main-veil: rgba(255, 255, 255, 0);

  /* zemin = katman + noise + renk (yukarıdaki ayarlardan; sayfalar bunları kullanır) */
  --side-paint: linear-gradient(var(--side-veil), var(--side-veil)), var(--side-bg) var(--side-noise) repeat;
  --rail-paint: linear-gradient(var(--side-veil), var(--side-veil)), var(--rail-bg) var(--side-noise) repeat;
  --main-paint: linear-gradient(var(--main-veil), var(--main-veil)), var(--main-c) var(--noise) repeat;
  --gutter: clamp(20px, 1.8vw, 36px);

  /* temalar arası ortak adlar: sayfa CSS'leri sabit renk yerine bunları kullanır */
  --tint: 255, 255, 255;      /* çizgi/hover tonu: rgba(var(--tint), .06) — koyuda beyaz, açıkta siyah */
  --surface: #232323;         /* açılır pencereler (sözcük penceresi, öneri listesi) */
  --surface-2: #202020;       /* yan panel (Khronos tüm adlar) */
  --field: #161616;           /* giriş kutusu zemini */
  --card-bg: #141414;         /* görsel yüklenene kadar kart zemini */
  --text-card: #1c1c1c;       /* yazı kartı (yazar, isim kartı) karışım zemini */
  --on-fg: #1b1b1b;           /* --fg zeminli düğme üstündeki yazı */
  --bar-bg: rgba(29, 29, 29, .94);   /* yapışık arama çubuğu */
  --shadow: rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* Light — Cengiz'in iki noise'u: içerik light-light-noise (~#ddd), kenarlar light-dark-noise (~#b8b8b8) */
[data-theme="light"] {
  --bg:        #dddddd;
  --bg-2:      #d2d1ce;
  --bg-3:      #c6c4bf;
  --line:      rgba(0, 0, 0, .14);
  --line-2:    rgba(0, 0, 0, .26);
  --fg:        #1f1d1a;
  --fg-2:      #4a4640;
  --fg-3:      #6e6a62;
  --accent:    #2c2925;
  --tag-bg:    rgba(240, 239, 236, .92);
  --tag-fg:    #1f1d1a;

  --side-bg: #b8b8b8;
  --side-fg: #2a2825;
  --label-fg: #34312d;
  --noise: url("../../images/v2/light-light-noise.jpg");
  --side-noise: url("../../images/v2/light-dark-noise.jpg");
  --main-c: #dddddd;
  --rail-bg: #b8b8b8;
  /* ===== AYAR: zeminin açıklığı (noise görselini değiştirmeden) =====
     Noise'un üstüne yarı saydam bir katman: beyaz açar, siyah koyulaştırır, 0 = görsel olduğu gibi.
       --side-veil: kenarlar (sol menü + sağdaki cetvel) · --main-veil: içerik alanı
     Örnek: rgba(255, 255, 255, .25) → %25 açık · rgba(0, 0, 0, .15) → %15 koyu
     Tarayıcıda denemek için: Geliştirici araçları → <html> → bu değişkeni değiştir. */
  --side-veil: rgba(255, 255, 255, 0);
  --main-veil: rgba(255, 255, 255, 0);

  /* zemin = katman + noise + renk (yukarıdaki ayarlardan; sayfalar bunları kullanır) */
  --side-paint: linear-gradient(var(--side-veil), var(--side-veil)), var(--side-bg) var(--side-noise) repeat;
  --rail-paint: linear-gradient(var(--side-veil), var(--side-veil)), var(--rail-bg) var(--side-noise) repeat;
  --main-paint: linear-gradient(var(--main-veil), var(--main-veil)), var(--main-c) var(--noise) repeat;

  --tint: 0, 0, 0;
  --surface: #eeedea;
  --surface-2: #e7e6e2;
  --field: #f6f5f2;
  --card-bg: #c8c6c1;
  --text-card: #e8e7e3;
  --on-fg: #f1f0ec;
  --bar-bg: rgba(221, 221, 221, .94);
  --shadow: rgba(0, 0, 0, .18);
  color-scheme: light;
}

/* ---------- Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.v2 {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.v2 a { color: inherit; text-decoration: none; }
.v2 img { display: block; max-width: 100%; }
.v2 :focus-visible { outline: 1px solid var(--fg-2); outline-offset: 3px; }

/* ---------- Sol kenar çubuğu (Illustrator çizimi) ----------
   Yukarıdan aşağı: + CORPUS · bölümler · dikey dönem adı (üstte/altta çizgi) · site menüsü.
   Yazılar sağa yaslı, sonlarında ok. Zemin düz koyu; ortadaki içerik alanı noise zeminli. */
.v2-side {
  position: fixed; inset: 0 auto 0 0;
  width: var(--side-w);
  background: var(--side-paint);
  padding: clamp(40px, 8.4vh, 90px) var(--side-pad-r) clamp(40px, 7.4vh, 80px) 6px;
  display: flex; flex-direction: column; align-items: stretch;
  z-index: 20;
  font-size: var(--side-fs);
}
.v2-brand {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 0 7px 8px;
  border-bottom: 1px solid var(--line-2);
  color: var(--fg-2);
  font-size: .82em; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  line-height: 1;
}
.v2-brand i { font-style: normal; font-weight: 400; color: var(--fg-3); }
.v2-brand:hover { color: var(--fg); }

.v2-nav { display: flex; flex-direction: column; align-items: flex-end; margin-top: clamp(28px, 5vh, 52px); }
.v2-nav a {
  display: flex; align-items: baseline; gap: .7em;
  color: var(--side-fg); line-height: 1.45;
  white-space: nowrap;
  transition: color .2s;
}
.v2-nav a i { font-style: normal; font-size: .8em; color: var(--fg-3); transition: transform .2s, color .2s; }
.v2-nav a:hover, .v2-nav a.is-on { color: var(--fg); }
.v2-nav a:hover i { transform: translateX(3px); color: var(--fg-2); }
.v2-nav--foot { margin-top: 0; line-height: 1.6; }
.v2-nav--foot a { line-height: 1.6; }

/* dikey etiket (ör. "Klasik Dönem") — aşağıdan yukarı okunur; üstünde ve altında ince çizgi */
.v2-side-label {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  gap: clamp(14px, 2.6vh, 28px);
  padding: clamp(18px, 4vh, 40px) 0;
  overflow: hidden;
  pointer-events: none;
}
.v2-side-label::before,
.v2-side-label::after {
  content: ""; flex: 0 1 clamp(40px, 8.5vh, 92px);
  width: 1px; margin-right: calc(var(--label-fs) * .5);
  background: var(--line-2);
}
.v2-side-label > span {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  max-height: 46vh; overflow: hidden; text-overflow: ellipsis;
  font-size: var(--label-fs);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  color: var(--label-fg);
  transition: opacity .45s ease, translate .45s ease;
}
.v2-side-label > span:empty { display: none; }
.v2-side-label > span.is-out { opacity: 0; translate: 0 -24px; }
.v2-side-label > span.is-in  { opacity: 0; translate: 0 24px; transition: none; }

/* ---------- Gövde ---------- */
.v2-main {
  margin-left: var(--side-w); min-height: 100vh;
  background: var(--main-paint);
}
.v2.has-rail .v2-main { margin-right: var(--rail-w); }

/* ---------- Tema düğmesi (sol çubuğun altında; js: layout'taki küçük betik) ---------- */
.v2-theme {
  display: flex; align-items: center; justify-content: flex-end; gap: .55em;
  margin-top: clamp(14px, 2.4vh, 26px); padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: .86em; letter-spacing: .04em; color: var(--fg-3);
  transition: color .2s;
}
.v2-theme:hover { color: var(--fg); }
.v2-theme svg { width: 1.15em; height: 1.15em; flex: none; }
/* tema değişirken renkler yumuşak geçsin (ilk yüklemede değil) */
html.theme-anim, html.theme-anim * { transition: background-color .35s ease, color .35s ease, border-color .35s ease !important; }

/* ---------- Telefon (≤768px) ----------
   Üstte ince çubuk: + CORPUS (arama) · sayfa/dönem adı · hamburger.
   Hamburger, sol çubuğun KENDİSİNİ tam ekran menü olarak açar (aynı işaretleme, iki menü yok).
   Sağda ince dikey cetvel (--rail-w: 32px): dokununca açılır (css/v2/khronos.css, pagerail.css). */
.v2-top { display: none; }
@media (max-width: 768px) {
  :root { --side-w: 0px; --rail-w: 32px; --top-h: 52px; }
  .v2-main { padding-top: var(--top-h); }

  .v2-top {
    position: fixed; top: 0; left: 0; right: 0; z-index: 46; height: var(--top-h);
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
    padding: 0 6px 0 16px;
    background: color-mix(in srgb, var(--side-bg) 92%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .v2-top-brand { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-2); }
  .v2-top-brand i { font-style: normal; font-weight: 400; color: var(--fg-3); margin-right: 4px; }
  .v2-top-label {
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center;
    font-size: 15px; font-weight: 700; color: var(--label-fg);
    transition: opacity .3s;
  }
  .v2-burger {
    position: relative; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; color: var(--fg);
  }
  .v2-burger span {
    position: absolute; left: 12px; right: 12px; height: 1.5px; background: currentColor;
    transition: transform .3s ease, top .3s ease;
  }
  .v2-burger span:first-child { top: 18px; }
  .v2-burger span:last-child { top: 25px; }
  .menu-open .v2-burger span:first-child { top: 21.5px; transform: rotate(45deg); }
  .menu-open .v2-burger span:last-child { top: 21.5px; transform: rotate(-45deg); }

  /* sol çubuk = tam ekran menü */
  .v2-side {
    inset: var(--top-h) 0 0 0; width: auto;
    z-index: 45;   /* arama paneli (40) ve açık cetvelin (40–41) üstünde: panel açıkken de menü görünür */
    padding: 34px 28px calc(30px + env(safe-area-inset-bottom));
    font-size: 24px;
    overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .28s ease, transform .28s ease, visibility 0s linear .28s;
  }
  .menu-open .v2-side { opacity: 1; visibility: visible; transform: none; transition: opacity .28s ease, transform .28s ease; }
  .menu-open { overflow: hidden; }
  .v2-side .v2-brand { display: none; }   /* üst çubukta zaten var */
  .v2-side .v2-nav { margin-top: 30px; }
  .v2-side .v2-nav a { line-height: 1.7; }
  .v2-side-label { display: none; }
  .v2-side .v2-nav--foot { margin-top: auto; padding-top: 40px; font-size: 17px; }
  .v2-side .v2-theme { font-size: 15px; margin-top: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
