@font-face {
    font-family: "Mushaf";
    src: url("/assets/fonts/ShaikhHamdullahMushaf.ttf") format("truetype");
    font-display: swap;
}

:root {
    --bg: #f6ecd6;
    --surface: #fffdf8;
    --ink: #262220;
    --muted: #6b625a;
    --brand: #2c7389;
    --brand-dark: #1f5668;
    --accent: #874a33;
    --line: #e6d8bb;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 4px 14px rgba(60, 40, 20, .06);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: -999px; top: 8px; background: var(--brand-dark); color: #fff;
    padding: 8px 14px; border-radius: 6px; z-index: 100;
}
.skip-link:focus { left: 8px; }

.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { padding: 22px 0 6px; }
.header-inner { text-align: center; }
.brand { display: inline-block; }
.brand img { width: 100%; max-width: 190px; height: auto; display: block; margin: 0 auto; }

/* Arapca metin */
.ar {
    font-family: "Mushaf", "Traditional Arabic", "Geeza Pro", "Noto Naskh Arabic", serif;
    direction: rtl;
    unicode-bidi: isolate;
    line-height: 1.9;
}

/* Arama */
main { flex: 1; padding-bottom: 32px; }

.search { position: relative; margin: 14px 0 24px; }
.search-field {
    display: flex;
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(44, 115, 137, .18); }
.search-field input {
    flex: 1; min-width: 0; border: 0; background: transparent;
    padding: 14px 16px; font-size: 19px; color: var(--ink);
    font-family: inherit; text-align: center;
    -webkit-appearance: none; appearance: none;
}
.search-field input:focus { outline: none; }
.search-field input::placeholder { color: var(--muted); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field button {
    border: 0; background: var(--brand); color: #fff; width: 56px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.search-field button:hover { background: var(--brand-dark); }

.suggest {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
    list-style: none; margin: 0; padding: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(60, 40, 20, .18); max-height: 70vh; overflow-y: auto;
}
.suggest[hidden] { display: none; }
.suggest li { margin: 0; }
.suggest a {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink);
}
.suggest a:hover, .suggest a[aria-selected="true"] { background: #f1e6cc; }
.suggest .ar { font-size: 22px; color: var(--accent); flex: none; order: 2; }
.suggest .tr { color: var(--brand-dark); font-size: 16px; order: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .all { justify-content: center; color: var(--brand-dark); font-weight: 600; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }
.suggest .none { padding: 12px; color: var(--muted); text-align: center; }

/* Baslik ve bolumler */
h1, h2 { line-height: 1.3; margin: 0 0 12px; }

/* Ana sayfa */
.hero-top { text-align: center; margin: 4px 0 16px; }
.hero-top h1 { font-size: 30px; margin-bottom: 8px; color: var(--ink); }
.hero-top .lead { margin: 0 auto; max-width: 600px; color: var(--muted); font-size: 18px; }
.hero-top + .search .search-field input { font-size: 21px; padding: 17px 16px; }
.hero { text-align: center; margin: -8px 0 30px; }
.ar-note { font-family: "Mushaf", "Geeza Pro", serif; font-size: 18px; margin: 0 0 10px; color: var(--muted); direction: rtl; }
.try { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: center; align-items: center; font-size: 15px; color: var(--muted); }
.try a {
    padding: 2px 14px; background: var(--surface); border: 1px solid var(--line);
    border-radius: 999px; text-decoration: none; font-size: 20px; line-height: 1.7;
}
.try a:hover { border-color: var(--brand); }
.count { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.count strong { color: var(--brand-dark); }

/* Gunun kelimesi */
.daily { margin: 0 0 30px; }
.daily-label { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-dark); margin: 0 0 8px; }
.daily-card {
    display: block; text-decoration: none; color: var(--ink); text-align: center;
    background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--brand);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px;
    transition: border-color .15s;
}
.daily-card:hover { border-color: var(--brand); }
.daily-ar { display: block; font-size: 44px; color: var(--accent); }
.daily-tr { display: block; font-size: 19px; color: var(--brand-dark); margin-top: 2px; }
.daily-ex { display: block; margin: 14px auto 0; padding-top: 12px; border-top: 1px solid var(--line); max-width: 560px; }
.daily-ex .ar { display: block; font-size: 22px; }
.daily-more { display: inline-block; margin-top: 12px; font-size: 14px; color: var(--accent); text-decoration: underline; }

/* Nasil kullanilir */
.steps { margin: 0 0 30px; }
.steps ol { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li {
    counter-increment: s; position: relative; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px 16px 14px 56px; color: var(--muted); font-size: 16px;
}
.steps li::before {
    content: counter(s); position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.steps li strong { color: var(--ink); }

.section-title { font-size: 20px; color: var(--ink); padding-bottom: 6px; border-bottom: 3px solid var(--brand); display: inline-block; margin-bottom: 14px; }
.section-title .root { color: var(--accent); font-size: 20px; font-weight: 400; }

/* Chips */
.chips { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips a {
    display: flex; flex-direction: column; align-items: center; min-width: 110px;
    padding: 10px 14px; background: var(--surface); border: 1px solid var(--line);
    border-radius: 10px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
    transition: border-color .15s, transform .15s;
}
.chips a:hover { border-color: var(--brand); transform: translateY(-1px); }
.chips .ar { font-size: 24px; color: var(--accent); line-height: 1.6; }
.tr-sm { font-size: 14px; color: var(--muted); }

/* Sonuc kartlari */
.results { margin-top: 6px; }
.result-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.result-title span { color: var(--accent); }
.result-count { margin: 0 0 14px; color: var(--muted); font-size: 15px; }

.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 14px;
}
.card-link { text-decoration: none; color: inherit; display: block; }
.card-head { display: flex; flex-direction: column-reverse; gap: 2px; }
.card-head .ar { font-size: 30px; color: var(--accent); }
.card-head .tr { color: var(--brand-dark); font-size: 18px; }
.card .more { display: inline-block; margin-top: 8px; font-size: 14px; }

.examples { list-style: none; margin: 10px 0 0; padding: 0; }
.examples li { padding: 8px 0; border-top: 1px solid var(--line); }
.examples .ar { display: block; font-size: 22px; }
.examples .tr-sm { display: block; font-size: 15px; }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; }
.empty .ar { font-size: 22px; margin: 0 0 8px; }
.tips { text-align: left; max-width: 420px; margin: 12px auto 0; color: var(--muted); font-size: 15px; }

/* Kelime sayfasi */
.crumbs { font-size: 14px; color: var(--muted); margin: -6px 0 14px; }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.entry-head { text-align: center; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.entry-ar { font-size: 48px; color: var(--accent); margin: 0; font-weight: 400; }
.plain { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.plain .ar { font-size: 20px; }
.meaning { font-size: 20px; color: var(--brand-dark); margin: 0 0 6px; white-space: pre-line; }
.meta { color: var(--muted); font-size: 14px; margin: 0; }
.entry section { margin-bottom: 22px; }
.entry section:last-child { margin-bottom: 0; }
.entry .chips { margin-bottom: 0; }

/* Tur gezinme */
.cats { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cats a {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; text-decoration: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: 15px;
}
.cats a .ar { color: var(--accent); font-size: 18px; line-height: 1.5; }
.cats a:hover { border-color: var(--brand); }
.cats a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cats a.on .ar { color: #fff; }
.browse { margin: 0 0 30px; }

.wordlist { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.wordlist a {
    display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 14px;
    padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    text-decoration: none; color: var(--ink);
}
.wordlist a:hover { border-color: var(--brand); }
.wordlist .ar { font-size: 26px; color: var(--accent); flex: none; }
.wordlist .tr { color: var(--brand-dark); font-size: 16px; text-align: left; flex: 1; min-width: 0; }

.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 8px 0 10px; }
.pager a, .pager .disabled {
    padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); text-decoration: none;
}
.pager a { color: var(--brand-dark); font-weight: 600; }
.pager a:hover { border-color: var(--brand); }
.pager .disabled { color: var(--muted); opacity: .55; }
.pager-info { color: var(--muted); font-size: 15px; }

/* Hakkinda */
.about { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 10px; }
.about-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.about-col h2 { font-size: 20px; color: var(--brand-dark); }
.about-col p { margin: 0; color: var(--muted); font-size: 16px; }
.about-col[lang="ar"] { font-family: "Mushaf", "Geeza Pro", serif; }
.about-col[lang="ar"] p { font-size: 18px; line-height: 1.9; }

/* Footer */
.site-footer { padding: 18px 0; text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; }

@media (min-width: 720px) {
    .about { grid-template-columns: 1fr 1fr; }
    .steps ol { grid-template-columns: repeat(3, 1fr); }
    .steps li { padding: 52px 16px 16px; text-align: center; }
    .steps li::before { left: 50%; top: 14px; transform: translateX(-50%); }
    .hero-top h1 { font-size: 34px; }
    .card-head { flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 16px; }
    .card-head .tr { flex: 1; }
    .site-header { padding-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
    .search, .site-header, .site-footer, .suggest { display: none; }
    body { background: #fff; }
}
