/* ==========================================================================
   v2 — Corpus arama paneli (front/v2/_search.blade.php · js/v2/search.js)
   İçerik alanını kaplar: sol menü ve sağdaki cetvel açıkta. Renkler tema değişkenlerinden.
   ========================================================================== */

.v2-search {
  --v2s-bg: color-mix(in srgb, var(--main-c) 90%, transparent);
  --v2s-line: var(--line-2);
  position: fixed; z-index: 40;
  top: 0; bottom: 0; left: var(--side-w); right: 0;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--v2s-bg);
  -webkit-backdrop-filter: blur(18px) saturate(.8); backdrop-filter: blur(18px) saturate(.8);
  color: var(--fg);
  /* açılış: yukarıdan aşağı perde */
  clip-path: inset(0 0 100% 0);
  transition: clip-path .55s cubic-bezier(.65, 0, .25, 1);
}
.v2-search[hidden] { display: none; }
.v2-search.is-open { clip-path: inset(0 0 0 0); }
.v2-search.is-page {
  background: var(--main-paint);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  clip-path: none; transition: none;
}
[data-theme="light"] .v2-search.is-page { background: var(--main-paint); }

.v2s-in {
  width: min(760px, 100% - 2 * clamp(20px, 5vw, 72px));
  margin: 0 auto;
  padding: clamp(64px, 17vh, 180px) 0 80px;
  opacity: 0; transform: translateY(18px);
  transition: opacity .45s ease .15s, transform .6s cubic-bezier(.2, .7, .2, 1) .15s;
}
.v2-search.is-open .v2s-in { opacity: 1; transform: none; }

.v2s-kicker {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 22px;
  font-size: 11px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--fg-3);
}
.v2s-kicker::after { content: ""; width: 34px; height: 1px; background: currentColor; opacity: .6; }

/* arama çubuğu: alt çizgili, büyük */
.v2s-form { position: relative; }
.v2s-bar {
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--v2s-line);
  transition: border-color .25s;
}
.v2s-bar:focus-within { border-color: var(--fg-2); }
.v2s-input {
  flex: 1; min-width: 0;
  padding: 10px 0 14px;
  border: 0; outline: 0; background: none;
  font: inherit; font-size: clamp(26px, 2.6vw, 40px); line-height: 1.2;
  color: var(--fg);
}
.v2s-input:focus-visible { outline: 0; }
.v2s-input::placeholder { color: var(--fg-3); opacity: .8; }
.v2s-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.v2s-btn {
  flex: 0 0 auto;
  padding: 7px 13px;
  border: 1px solid var(--v2s-line); border-radius: 2px;
  background: none; color: var(--fg-2);
  font: inherit; font-size: 14px; letter-spacing: .04em;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.v2s-btn:hover, .v2s-btn.is-on { color: var(--fg); border-color: var(--fg-2); }
.v2s-btn.is-on { background: rgba(var(--tint), .06); }
.v2s-go { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.v2s-go:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* öneriler: türü etiketli (corpus.js çizer) */
.v2s-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 2;
  max-height: min(420px, 60vh); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 18px 44px var(--shadow);
}
.v2s-list[hidden] { display: none; }
.v2s-list .cp-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n t" "s t";
  align-items: center; column-gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(var(--tint), .05);
}
.v2s-list .cp-row:last-child { border-bottom: 0; }
.v2s-list .cp-n { grid-area: n; font-size: 18px; color: var(--fg); }
.v2s-list .cp-sub { grid-area: s; font-size: 12.5px; color: var(--fg-3); }
.v2s-list .cp-t {
  grid-area: t;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-3);
}
.v2s-list .cp-row:hover, .v2s-list .cp-row.is-on { background: rgba(var(--tint), .06); }
.v2s-list .cp-row.is-on .cp-t, .v2s-list .cp-row:hover .cp-t { color: var(--fg-2); }

/* Yunanca klavye (eski _keyboard.blade.php işaretlemesi, yeni giysi) */
.v2-search .lx-kb { display: none; margin-top: 18px; }
.v2-search .lx-kb.is-open { display: block; }
.v2-search .lx-kb-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; }
.v2-search .lx-kb button {
  min-width: 40px; height: 40px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 2px;
  background: rgba(var(--tint), .03); color: var(--fg);
  font: inherit; font-size: 19px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.v2-search .lx-kb button:hover { background: rgba(var(--tint), .09); border-color: var(--line-2); }
.v2-search .lx-kb .lx-kb-fn { font-size: 13px; color: var(--fg-2); }
/* işaret tuşları: harf yazmaz, son harfe işaret ekler → kesik çerçeve, soluk */
.v2-search .lx-kb .lx-kb-mark { border-style: dashed; color: var(--fg-2); }
.v2-search .lx-kb .lx-kb-fn.is-on { background: var(--fg); color: var(--bg); }
.v2-search .lx-kb-hint { margin: 8px 0 0; font-size: 12.5px; color: var(--fg-3); }

/* örnek aramalar */
.v2s-ex { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 22px 0 0; }
.v2s-ex button {
  all: unset; cursor: pointer;
  font-size: 15px; color: var(--fg-2);
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.v2s-ex button:hover, .v2s-ex button:focus-visible { color: var(--fg); border-color: var(--fg-3); }

/* açıklama */
.v2s-help { margin-top: clamp(40px, 7vh, 72px); columns: 2 300px; column-gap: 40px; }
.v2s-help p { margin: 0 0 14px; break-inside: avoid; font-size: 14px; line-height: 1.6; color: var(--fg-3); }
.v2s-help code {
  font-family: inherit; font-size: .95em; color: var(--fg-2);
  background: rgba(var(--tint), .05); padding: 0 4px; border-radius: 2px;
}

/* kapat */
.v2s-x {
  position: absolute; top: 18px; right: 20px;
  width: 42px; height: 42px;
  border: 0; background: none; cursor: pointer;
  font-size: 30px; line-height: 1; color: var(--fg-3);
  transition: color .2s, transform .3s;
}
.v2s-x:hover { color: var(--fg); transform: rotate(90deg); }

@media (max-width: 768px) {
  .v2-search { left: 0; right: 0 !important; top: var(--top-h); }   /* üst çubuk (menü) açık kalır */
  .v2s-in { padding-top: 28px; }
  .v2-search .lx-kb button { min-width: 34px; height: 38px; font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .v2-search, .v2s-in { transition: none; }
}
