/* ---------- Global Reset & Variables ---------- */
html { scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) {
  html { overflow-y: scroll; } /* always show (or reserve) the scrollbar */
}

*, *::before, *::after { box-sizing: border-box; }

:root {
  --accent:       #2563eb;
  --accent-dark:  #1e40af;
  --accent-cont:  #992323;
  --gray-light:   #f1f5f9;
  --border:       #e5e7eb;
  --muted:        #6b7280;
  --radius:       .25rem;
  --space:        .75rem;
}

/* ---------- Layout ---------- */
body {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", Arial,
               "Noto Sans", sans-serif;
}

.tagline {
  margin: .5rem 0 1.25rem;
  font-size: clamp(1rem, 1.1rem + 0.4vw, 1rem);
  color: var(--muted, #6b7280);
  line-height: 1.5;
  text-align: center;
}


/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1000;
  padding: 1rem 0;
  text-align: center;
}

.hero-search { max-width: 640px; margin: 0 auto; }

/* Input + buton “pill” grubu */
.searchbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #fff;
  border-radius: 9999px;
  padding: .375rem .375rem .375rem 1.125rem;
  box-shadow:
    0 1px 2px rgba(0,0,0,.04),
    0 8px 24px rgba(2, 6, 23, .06);
}

.searchbar input[type="search"] {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  padding: .9rem .75rem;
  background: transparent;
  color: #0f172a;
}
.searchbar input::placeholder { color: #9ca3af; }

/* Rastgele butonu: sizin değişkenler ile */
#random-word {
  border: 0;
  cursor: pointer;
  padding: .9rem 1.1rem;
  font-weight: 600;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  transition: transform .06s ease, background-color .15s ease, box-shadow .15s ease;
  box-shadow:
    0 1px 1px rgba(0,0,0,.04),
    0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
#random-word:hover,
#random-word:focus-visible {
  background: var(--accent-dark);
  transform: translateY(1px);
}

/* Otomatik tamamlama (site.js göster/gizle) */
.autocomplete {
  display: none;
  margin-top: .5rem;
  text-align: left;
  list-style: none;
  padding: .25rem;
  border-radius: .75rem;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(2, 6, 23, .10);
  max-height: 22rem;
  overflow: auto;
}
.autocomplete li a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  padding: .625rem .75rem;
  border-radius: .5rem;
  text-decoration: none;
  color: #0f172a;
}
.autocomplete li a:hover,
.autocomplete li a:focus-visible { background: var(--gray-light); }

/* Search result subtitle (slug) */
.res-title { font-weight: 600; }
.res-desc  { color: var(--muted); font-size: .75rem; }

/* ---------- Typography ---------- */
.site-title a,
.site-title a:visited {
  text-decoration: none;
  color: var(--accent-dark);
  font-size: clamp(2.25rem, 5vw, 2.5rem);
  font-weight: 700;
  transition: color .25s ease;
}

.site-title a:hover,
.site-title a:focus-visible,
.site-title a:active {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 4px;
}

/* ---------- Term Page Elements ---------- */
.term-title {
  font-family: Georgia, "Times New Roman", serif;
}

.term-title {
  font-size: 2.4rem;
  margin: 1.5rem 0 .5rem;
  line-height: 1.2;
}

.ozellikler {
  font-weight: 600;
  color: #2c596b;
}

.ornekler {
  padding: 1rem;
}

.orneklerkaynak {
  font-weight: 550;
  font-style: italic;
}

/* ---- Footer ---- */
.site-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border, #e5e7eb);
  text-align: center;
  font-size: .95rem;
  color: var(--muted, #6b7280);
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 .5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  justify-content: center;
}

.footer-nav a {
  color: var(--accent-dark, #1e40af);
  text-decoration: none;
  font-weight: 600;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--accent, #2563eb);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-tagline {
  margin: .25rem 0 .5rem;
}

.footer-meta {
  margin: 0;
  font-size: .9rem;
}

.footer-meta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.footer-meta a:hover,
.footer-meta a:focus-visible {
  text-decoration: underline;
  border-bottom: none;
}

.footer-meta .sep {
  margin: 0 .5rem;
  opacity: .6;
}

/* ---------- 404 Error Box ---------- */
.error-box {
  padding-top: 2rem;
  padding-bottom: 2rem;
  text-align: center;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius, .5rem);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 6px 24px rgba(0,0,0,0.06);
}

.error-box > * + * {
  margin-top: .75rem; /* compact, consistent spacing between children */
}

.error-code {
  margin: 0;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .04em;
  font-size: clamp(3.5rem, 10vw, 7rem);
  color: #bb2350;
}

.error-box h1 {
  margin: .25rem 0 0;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
}

.error-message {
  margin: 0;
  color: var(--muted, #6b7280);
  font-size: clamp(.95rem, .9rem + .2vw, 1.05rem);
}

/* Button-like link */
.btn-home {
  display: inline-block;
  margin-top: 1rem;
  padding: .8rem 1rem;
  min-height: 44px; /* touch target */
  border-radius: calc(var(--radius, .5rem) + .25rem);
  background: var(--accent, #2563eb);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  transition: transform .06s ease, background-color .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 6px 16px rgba(37,99,235,0.25);
}

.btn-home:hover,
.btn-home:active {
  background: var(--accent-dark, #1e40af);
}

.btn-home:active {
  transform: translateY(1px);
}

.btn-home:focus-visible {
  outline: 2px solid transparent;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--accent, #2563eb);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn-home { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .header-controls {
    flex-direction: column;
    align-items: stretch;
  }
  #search{
    width: 100%;
  }
}

/* ---------- Letters page ---------- */
.letter-nav{
  text-align:center;
  margin:1rem 0 .5rem;
  font-size:1.05rem;
}
.letter-nav a{
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 500;
}

.letter-nav a:hover,
.letter-nav a:focus-visible,
.letter-nav a:active {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.letter-nav a.current{
  font-weight:700;
  text-decoration:underline;
  text-underline-offset: 4px;
}

.letter-list a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 500;
}

.letter-list a:hover,
.letter-list a:focus-visible,
.letter-list a:active {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}
