/* ===== Kodukac.com — "Kod Arşivi" Tasarım Sistemi ===== */

:root {
    /* Renk: koyu çini mavisi (mühür mürekkebi), sıcak yeşilimsi kağıt, hardal sarısı vurgu */
    --ink: #1B2F33;
    --ink-deep: #0F1E21;
    --paper: #F6F4ED;
    --paper-card: #FFFFFE;
    --accent: #D98E2B;
    --accent-deep: #B8721A;
    --line: #DCD6C4;
    --muted: #6B6A5F;
    --text: #20231F;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(15,30,33,.06), 0 8px 24px rgba(15,30,33,.05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
    background: var(--paper);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent-deep); }

h1, h2, h3 {
    font-family: 'Fraunces', Georgia, serif;
    color: var(--ink-deep);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
}
h1 { font-size: 2.1rem; margin: .4rem 0 .6rem; }
h2 { font-size: 1.4rem; margin: 2.4rem 0 .9rem; padding-top: .2rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
h2:first-of-type { border-top: none; padding-top: 0; }

code, .kod-mono { font-family: 'IBM Plex Mono', monospace; }

/* ===== Header ===== */
.site-header {
    background: var(--ink-deep);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 3px solid var(--accent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.logo {
    color: #fff;
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: baseline;
    gap: 2px;
}
.logo::before {
    content: '#';
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 700;
    margin-right: 4px;
}
.logo span { color: rgba(255,255,255,.45); font-weight: 400; font-family: 'IBM Plex Sans', sans-serif; font-size: 1rem; }
.main-nav > ul { list-style: none; display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav > ul > li { position: relative; }
.main-nav a {
    color: rgba(255,255,255,.82);
    font-size: .86rem;
    font-weight: 500;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    display: inline-block;
    transition: background .15s, color .15s;
}
.main-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; }

/* Açılır menü grupları (details/summary) */
.nav-grup details { position: relative; }
.nav-grup summary {
    color: rgba(255,255,255,.82);
    font-size: .86rem;
    font-weight: 500;
    padding: 8px 26px 8px 11px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    list-style: none;
    position: relative;
    user-select: none;
    transition: background .15s, color .15s;
}
.nav-grup summary::-webkit-details-marker { display: none; }
.nav-grup summary::after {
    content: '▾';
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .7rem;
    opacity: .7;
}
.nav-grup summary:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-grup details[open] summary { background: rgba(255,255,255,.14); color: #fff; }
.nav-altmenu {
    list-style: none;
    display: block;
    margin: 0;
    padding: 6px;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: var(--ink-deep);
    border: 1px solid rgba(255,255,255,.12);
    border-top: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 30px rgba(0,0,0,.3);
    z-index: 60;
}
.nav-altmenu li { margin: 0; }
.nav-altmenu a { display: block; padding: 9px 12px; font-size: .85rem; border-radius: 5px; }

@media (max-width: 980px) {
    .main-nav > ul { display: none; flex-direction: column; align-items: stretch; gap: 0; background: var(--ink-deep); position: absolute; left: 0; right: 0; top: 58px; padding: 8px 20px 16px; border-bottom: 3px solid var(--accent); max-height: calc(100vh - 58px); overflow-y: auto; }
    .main-nav > ul.open { display: flex; }
    .main-nav > ul > li > a { display: block; padding: 10px 8px; }
    .nav-toggle { display: block; }
    .nav-grup summary { padding: 10px 26px 10px 8px; }
    .nav-altmenu { display: block; position: static; box-shadow: none; border: none; border-top: none; background: rgba(255,255,255,.04); margin: 2px 0 6px; min-width: 0; }
    .nav-altmenu a { padding: 9px 8px 9px 20px; }
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 64px 20px 40px;
    background: linear-gradient(180deg, var(--paper) 0%, #EFEADA 100%);
    border-bottom: 1px solid var(--line);
}
.hero h1 {
    font-size: 2.5rem;
    max-width: 720px;
    margin: 0 auto .7rem;
}
.hero p { color: var(--muted); max-width: 580px; margin: 0 auto 28px; font-size: 1.04rem; }
.hero-search {
    display: flex;
    max-width: 620px;
    margin: 0 auto;
    gap: 0;
    background: var(--paper-card);
    border: 2px solid var(--ink-deep);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.hero-search input {
    flex: 1;
    padding: 16px 18px;
    border: none;
    font-size: 1rem;
    font-family: 'IBM Plex Sans', sans-serif;
    background: transparent;
    color: var(--text);
}
.hero-search input:focus { outline: none; }
.hero-search button, .search-form button, #qr-generate, #qr-download {
    background: var(--accent);
    color: #1B1304;
    border: none;
    padding: 0 26px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif;
    transition: background .15s;
}
.hero-search button:hover, .search-form button:hover { background: var(--accent-deep); color: #fff; }
.search-form button, #qr-generate, #qr-download { border-radius: var(--radius-sm); padding: 13px 22px; }

/* ===== Module grid (dosya kartı / index card signature) ===== */
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 36px 0 44px; }
.module-card {
    position: relative;
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 20px 18px 18px;
    display: block;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    overflow: hidden;
}
.module-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    border-width: 0 16px 16px 0;
    border-style: solid;
    border-color: transparent var(--paper) transparent transparent;
    transition: border-color .15s;
}
.module-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
    text-decoration: none;
}
.module-card:hover::before { border-color: transparent var(--accent) transparent transparent; }
.module-card h3 { margin: 0 0 6px; font-size: 1.05rem; font-family: 'IBM Plex Sans', sans-serif; font-weight: 700; color: var(--ink-deep); }
.module-card p { margin: 0; color: var(--muted); font-size: .88rem; }

/* ===== İl listesi chip grid ===== */
.il-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.il-chip {
    background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 10px 12px; display: flex; justify-content: space-between; align-items: center;
    font-size: .86rem; transition: border-color .15s;
}
.il-chip:hover { border-color: var(--accent); text-decoration: none; }
.il-chip strong { font-family: 'IBM Plex Mono', monospace; color: var(--ink-deep); }
.il-chip span { color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: .8rem; }

/* ===== Tablo ===== */
table { width: 100%; border-collapse: collapse; margin: 18px 0; background: var(--paper-card); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
table th, table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: .92rem; }
table th { background: var(--ink-deep); color: #fff; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
table tbody tr:hover { background: #FBF8EE; }
table strong, table code { font-family: 'IBM Plex Mono', monospace; color: var(--ink-deep); }

/* ===== Breadcrumb ===== */
.breadcrumb { margin: 16px 0 4px; }
.breadcrumb ol { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.breadcrumb li a { color: var(--muted); }
.breadcrumb li a:hover { color: var(--accent-deep); }
.breadcrumb li:not(:last-child)::after { content: '/'; margin-left: 6px; opacity: .5; }
.breadcrumb li[aria-current] { color: var(--ink-deep); font-weight: 600; }

/* ===== Bilgi kartları (stamp/tab tasarımı) ===== */
.bilgi-kartlari { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 22px 0; }
.bilgi-karti {
    background: var(--paper-card); border: 1px dashed var(--line); border-radius: var(--radius-sm);
    padding: 14px; text-align: center;
}
.bilgi-karti .etiket { display: block; font-size: .74rem; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.bilgi-karti .deger { display: block; font-size: 1.25rem; font-weight: 700; color: var(--accent-deep); font-family: 'IBM Plex Mono', monospace; }

/* ===== İlçe grid ===== */
.ilce-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 16px 0; }
.ilce-chip { background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; display: flex; flex-direction: column; font-size: .9rem; transition: border-color .15s; }
.ilce-chip:hover { border-color: var(--accent); text-decoration: none; }
.ilce-chip span { color: var(--muted); font-size: .78rem; margin-top: 4px; font-family: 'IBM Plex Mono', monospace; }

/* ===== Kod listesi (kart + rozet stamp tasarımı) ===== */
.kod-liste { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 18px 0 32px; }
.kod-karti {
    position: relative;
    background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 18px; display: block; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.kod-karti:hover { box-shadow: var(--shadow); border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.kod-rozet {
    display: inline-block; background: var(--ink-deep); color: #fff;
    font-family: 'IBM Plex Mono', monospace; font-size: .76rem; font-weight: 600;
    padding: 4px 11px; border-radius: 3px; margin-bottom: 10px; letter-spacing: .02em;
}
.kod-karti h3 { margin: 4px 0 6px; font-size: 1rem; font-family: 'IBM Plex Sans', sans-serif; font-weight: 700; color: var(--ink-deep); }
.kod-karti p { margin: 0; color: var(--muted); font-size: .87rem; }

/* ===== Renk grid ===== */
.renk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin: 20px 0; }
.renk-karti { background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; text-align: center; padding-bottom: 10px; transition: border-color .15s; }
.renk-karti:hover { border-color: var(--accent); text-decoration: none; }
.renk-ornek { display: block; width: 100%; height: 90px; }
.renk-karti h3 { margin: 8px 0 2px; font-size: .95rem; font-family: 'IBM Plex Sans', sans-serif; }
.renk-karti p { margin: 0; color: var(--muted); font-size: .82rem; font-family: 'IBM Plex Mono', monospace; }
.renk-buyuk-ornek { width: 100%; max-width: 320px; height: 160px; border-radius: var(--radius); margin: 14px 0; border: 1px solid var(--line); }

/* ===== Search form ===== */
.search-form { display: flex; gap: 8px; margin: 16px 0 24px; flex-wrap: wrap; }
.search-form input, .search-form select {
    flex: 1; min-width: 200px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-size: .95rem; font-family: 'IBM Plex Sans', sans-serif; background: var(--paper-card);
}
.search-form input:focus, .search-form select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ===== Pagination ===== */
.pagination { display: flex; gap: 6px; margin: 20px 0; flex-wrap: wrap; }
.pagination a { padding: 6px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .88rem; background: var(--paper-card); font-family: 'IBM Plex Mono', monospace; }
.pagination a.active { background: var(--ink-deep); color: #fff; border-color: var(--ink-deep); }
.pagination a:hover { border-color: var(--accent); text-decoration: none; }

/* ===== QR tool ===== */
.qr-tool { display: flex; gap: 30px; flex-wrap: wrap; margin: 24px 0 40px; }
.qr-form { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 10px; }
.qr-form label { font-size: .85rem; font-weight: 600; color: var(--ink-deep); }
.qr-form textarea, .qr-form select, .qr-form input {
    padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .95rem;
    font-family: 'IBM Plex Sans', sans-serif; background: var(--paper-card);
}
.qr-output { flex: 1; min-width: 280px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
#qr-canvas-wrap { background: #fff; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); min-height: 60px; box-shadow: var(--shadow); }

/* ===== Footer ===== */
.site-footer { background: var(--ink-deep); color: #C9CCC4; margin-top: 56px; border-top: 3px solid var(--accent); }
.footer-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; padding: 44px 20px; }
.footer-col h4 { color: #fff; margin-bottom: 12px; font-size: .92rem; font-family: 'IBM Plex Sans', sans-serif; text-transform: uppercase; letter-spacing: .05em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 7px; }
.footer-col a { color: #B7BAB0; font-size: .87rem; }
.footer-col a:hover { color: var(--accent); }
.footer-col p { color: #9CA098; font-size: .87rem; }
.footer-bottom { background: var(--ink); text-align: center; padding: 14px 0; font-size: .8rem; color: #8C9088; }

/* ===== Yorumlar bölümü ===== */
.yorumlar-bolumu { margin-top: 44px; padding-top: 8px; border-top: 1px solid var(--line); }
.yorum-bos { color: var(--muted); }
.yorum-listesi { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.yorum-karti { background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.yorum-ust { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 10px; flex-wrap: wrap; }
.yorum-ust strong { color: var(--ink-deep); font-family: 'IBM Plex Sans', sans-serif; }
.yorum-tarih { color: var(--muted); font-size: .78rem; font-family: 'IBM Plex Mono', monospace; }
.yorum-karti p { margin: 0; color: var(--text); font-size: .92rem; }
.yorum-form { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.yorum-form input[type="text"], .yorum-form textarea {
    padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-family: 'IBM Plex Sans', sans-serif; font-size: .94rem; background: var(--paper-card);
}
.yorum-form input:focus, .yorum-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.captcha-satir { display: flex; align-items: center; gap: 10px; background: #FBF8EE; border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.captcha-satir label { font-family: 'IBM Plex Mono', monospace; font-weight: 600; color: var(--ink-deep); font-size: 1.05rem; white-space: nowrap; }
.captcha-satir input { max-width: 110px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: 'IBM Plex Mono', monospace; }
.yorum-form button {
    align-self: flex-start; background: var(--accent); color: #1B1304; border: none;
    padding: 11px 24px; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif; transition: background .15s;
}
.yorum-form button:hover { background: var(--accent-deep); color: #fff; }
.yorum-basari { background: #EAF5EA; border: 1px solid #B7DDB7; color: #28602B; padding: 12px 16px; border-radius: var(--radius-sm); }
.yorum-hata { background: #FBEAEA; border: 1px solid #E8B7B7; color: #8A2B2B; padding: 12px 16px; border-radius: var(--radius-sm); }
.yorum-not { color: var(--muted); }
.guncelleme-notu, .yasal-not { color: var(--muted); font-size: .82rem; margin-top: 20px; }
.not-found { text-align: center; padding: 70px 0; }
.sonuc-sayisi { color: var(--muted); font-size: .9rem; font-family: 'IBM Plex Mono', monospace; }
.lead { color: var(--muted); font-size: 1.04rem; max-width: 760px; }
.alt-baslik { color: var(--muted); margin-top: -10px; font-size: .95rem; }
.kod-detay article p { max-width: 760px; }

/* Kargo takip butonu */
.btn-takip { display: inline-block; background: var(--accent); color: #1B1304; font-weight: 700; padding: 11px 20px; border-radius: var(--radius-sm); transition: background .15s; }
.btn-takip:hover { background: var(--accent-deep); color: #fff; text-decoration: none; }


/* ===== Canlı Arama (Live Search) Kutusu ===== */
.live-search-box {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-top: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 28px rgba(15,30,33,.13);
    z-index: 100;
    max-height: 380px;
    overflow-y: auto;
}
.ls-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--text);
    transition: background .1s;
    flex-wrap: wrap;
}
.ls-item:last-child { border-bottom: none; }
.ls-item:hover, .ls-item.ls-aktif { background: #FBF8EE; }
.ls-rozet {
    flex-shrink: 0;
    background: var(--ink-deep);
    color: #fff;
    font-family: 'IBM Plex Mono', monospace;
    font-size: .72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
    min-width: 36px;
    text-align: center;
    border: 1px solid transparent;
}
.ls-baslik {
    flex: 1;
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink-deep);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ls-alt {
    font-size: .78rem;
    color: var(--muted);
    font-family: 'IBM Plex Mono', monospace;
    flex-shrink: 0;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ls-empty {
    padding: 14px;
    color: var(--muted);
    font-size: .88rem;
    text-align: center;
}
/* Mobil: rozet ve alt alta gitsin */
@media (max-width: 600px) {
    .ls-item { gap: 6px; }
    .ls-alt { max-width: 100%; }
}

/* ---- Canlı arama: kategori grupları ---- */
.ls-grup{
    display:flex; align-items:baseline; justify-content:space-between;
    gap:10px; padding:9px 14px 5px;
    background:#EFEBE0; border-top:1px solid var(--line);
    position:sticky; top:0; z-index:1;
}
.ls-grup:first-child{border-top:none}
.ls-grup-ad{
    font-size:.74rem; font-weight:700; letter-spacing:.5px;
    text-transform:uppercase; color:var(--ink); opacity:.75;
}
.ls-grup-tum{
    font-size:.75rem; color:#0f6d7a; text-decoration:none; white-space:nowrap; flex-shrink:0;
}
.ls-grup-tum:hover{text-decoration:underline}
.ls-not{
    padding:9px 14px; font-size:.78rem; color:var(--muted);
    background:#FBF8EE; border-top:1px solid var(--line); text-align:center;
}
