/* ============================================================
   mutk.us /git - Haftalık GitHub Trending
   Bağımsız stil dosyası. CDN yok, sistem font yığını, dark/light.
   ============================================================ */

:root {
    --bg: #f8fafc;
    --bg-elev: #ffffff;
    --bg-soft: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: #eff6ff;
    --star: #d97706;
    --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1220;
        --bg-elev: #111a2e;
        --bg-soft: #0f1c33;
        --text: #e2e8f0;
        --muted: #94a3b8;
        --border: #1e293b;
        --accent: #3b82f6;
        --accent-hover: #2563eb;
        --accent-soft: #0f1c33;
        --star: #fbbf24;
        --shadow: 0 1px 3px rgba(0, 0, 0, .5);
    }
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    line-height: 1.6;
    font-size: 16px;
}

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

.gt-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Header ---------- */
.gt-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev);
    position: sticky;
    top: 0;
    z-index: 10;
}
.gt-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
    flex-wrap: wrap;
}
.gt-brand {
    font-weight: 700;
    color: var(--text);
    font-size: 1.15rem;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.gt-brand:hover { text-decoration: none; }
.gt-brand > span { color: var(--accent); }
.gt-brand small {
    font-weight: 500;
    font-size: .75rem;
    color: var(--muted);
}
.gt-nav { display: flex; gap: 16px; font-size: .92rem; }
.gt-nav a { color: var(--muted); }
.gt-nav a:hover { color: var(--accent); text-decoration: none; }
.gt-nav a.is-active { color: var(--accent); font-weight: 600; }

/* ---------- Hero (ana sayfa) ---------- */
.gt-hero { margin: 8px 0 22px; }
.gt-hero-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 10px;
    margin-bottom: 10px;
}
.gt-hero-sub { margin: 0; color: var(--muted); font-size: 1rem; }

/* ---------- Main ---------- */
.gt-main { padding: 28px 0 48px; }

.gt-title { font-size: 1.7rem; line-height: 1.25; margin: 12px 0 4px; }
.gt-muted { color: var(--muted); font-size: .9rem; margin: 4px 0 18px; }
.gt-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: .9rem;
    margin: 4px 0 18px;
}

.gt-crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.gt-crumbs a { color: var(--muted); }

/* ---------- Trend box ---------- */
.gt-trend {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    padding: 16px 18px;
    margin: 18px 0 24px;
}
.gt-trend h2 { margin: 0 0 6px; font-size: 1.05rem; }
.gt-trend p { margin: 0; }

/* ---------- Repo cards ---------- */
.gt-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.gt-card {
    display: flex;
    gap: 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    scroll-margin-top: 84px;
}
.gt-card:target {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}
.gt-rank {
    flex: 0 0 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
}
.gt-card-body { flex: 1; min-width: 0; }
.gt-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gt-repo { font-weight: 600; font-size: 1.05rem; word-break: break-word; }
.gt-summary { margin: 8px 0; color: var(--text); }
.gt-card-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.gt-stars { color: var(--muted); }
.gt-star { color: var(--star); }
.gt-history {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: .8rem;
    color: var(--muted);
}
.gt-history:hover { color: var(--accent); text-decoration: none; }

/* ---------- Kart paylaşım butonları ---------- */
.gt-share {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.gt-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--muted);
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.gt-share-btn[hidden] { display: none; }
.gt-share-btn:hover { background: var(--bg-elev); color: var(--accent); border-color: var(--accent); }
.gt-share-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gt-share-btn svg { width: 18px; height: 18px; fill: currentColor; display: block; }

/* ---------- Toast ---------- */
.gt-toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%) translateY(12px);
    max-width: calc(100% - 32px);
    background: #0f172a;
    color: #e2e8f0;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: .88rem;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 50;
}
.gt-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Badges ---------- */
.gt-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--muted);
    border: 1px solid var(--border);
}
.lang-python { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.lang-ts     { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.lang-js     { background: #fef9c3; color: #854d0e; border-color: #fef08a; }
.lang-go     { background: #cffafe; color: #155e75; border-color: #a5f3fc; }
.lang-rust   { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
.lang-java   { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.lang-c      { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
.lang-cpp    { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.lang-cs     { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.lang-php    { background: #e9d5ff; color: #6b21a8; border-color: #d8b4fe; }
.lang-ruby   { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.lang-swift  { background: #ffedd5; color: #c2410c; border-color: #fdba74; }
.lang-kotlin { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }
.lang-default { background: var(--bg-soft); color: var(--muted); }

@media (prefers-color-scheme: dark) {
    .gt-badge { background: #16233a; color: #cbd5e1; border-color: #24344f; }
}

/* ---------- Buttons / navigation ---------- */
.gt-btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: .9rem;
    font-weight: 500;
    border: 1px solid transparent;
}
.gt-btn:hover { text-decoration: none; background: var(--accent-hover); }
.gt-btn-ghost { background: transparent; color: var(--accent); border-color: var(--border); }
.gt-btn-disabled { background: var(--bg-soft); color: var(--muted); cursor: not-allowed; }
.gt-weeknav, .gt-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 22px;
    flex-wrap: wrap;
}
.gt-pager-info { color: var(--muted); font-size: .85rem; }

/* ---------- Archive ---------- */
.gt-archive { list-style: none; margin: 0 0 28px; padding: 0; }
.gt-archive li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-elev);
    margin-bottom: 8px;
}
.gt-archive-count { color: var(--muted); font-size: .82rem; white-space: nowrap; }

/* ---------- Panels (archive blocks) ---------- */
.gt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.gt-panel {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    box-shadow: var(--shadow);
}
.gt-panel h2 { margin: 0 0 12px; font-size: 1.05rem; }
.gt-toplist { list-style: none; margin: 0; padding: 0; }
.gt-toplist li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.gt-toplist li:last-child { border-bottom: 0; }
.gt-topcount { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }

.gt-langlist { list-style: none; margin: 0; padding: 0; }
.gt-langlist li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.gt-langbar { flex: 1; height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.gt-langbar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.gt-langpct { color: var(--muted); font-size: .8rem; width: 42px; text-align: right; }

/* ---------- Table (repo history) ---------- */
.gt-table { width: 100%; border-collapse: collapse; margin-top: 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.gt-table th, .gt-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: top; }
.gt-table th { background: var(--bg-soft); color: var(--muted); font-weight: 600; }
.gt-table tr:last-child td { border-bottom: 0; }
.gt-table-summary { color: var(--muted); }

/* ---------- Notice (disabled / empty / 404) ---------- */
.gt-notice {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px 24px;
    text-align: center;
    margin: 20px 0;
}
.gt-notice h1 { margin-top: 0; font-size: 1.4rem; }
.gt-notice p { color: var(--muted); }

/* ---------- Footer ---------- */
.gt-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-elev);
    padding: 20px 0;
    margin-top: 40px;
    font-size: .85rem;
    color: var(--muted);
}
.gt-footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.gt-footer a { color: var(--muted); }
.gt-footer a:hover { color: var(--accent); }
.gt-footer-brand { display: flex; flex-direction: column; gap: 2px; }
.gt-footer-copy { color: var(--text); }
.gt-footer-tagline { font-size: .8rem; }
.gt-footer-links { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.gt-footer-nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

/* ---------- Social ---------- */
.gt-social { display: inline-flex; align-items: center; gap: 10px; }
.gt-social a { display: inline-flex; color: var(--muted); }
.gt-social a:hover { color: var(--accent); }
.gt-social svg { width: 18px; height: 18px; fill: currentColor; display: block; }

/* ---------- Layout (içerik + yan panel) ---------- */
.gt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.gt-layout-full { grid-template-columns: minmax(0, 1fr); }
.gt-content { min-width: 0; }
.gt-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 76px; }
.gt-sidepanel {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}
.gt-sidepanel-title { margin: 0 0 10px; font-size: .95rem; }

/* "Bu hafta": başlık/değer çiftleri (etiket solda gri, değer sağda mono + kalın) */
.gt-stats { margin: 0; padding: 0; display: flex; flex-direction: column; }
.gt-stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
}
.gt-stat:last-child { border-bottom: 0; }
.gt-stat dt { color: var(--muted); font-size: .85rem; }
.gt-stat dd {
    margin: 0;
    font-weight: 700;
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Dil dağılımı: yığılı çubuk + renkli nokta listesi */
.gt-langwrap { margin-top: 14px; }
.gt-langbar-stack {
    display: flex;
    gap: 2px;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg-soft);
}
.gt-langbar-stack > span { display: block; height: 100%; }
.gt-langdots { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gt-langdots li { display: flex; align-items: center; gap: 8px; font-size: .8rem; }
.gt-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.gt-langname { color: var(--text); }
.gt-langcount {
    margin-left: auto;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* RSS kutusu (koyu kart) */
.gt-rssbox { background: #0f172a; border-color: #0f172a; color: #cbd5e1; }
.gt-rssbox-title { margin: 0 0 8px; font-size: .95rem; color: #f8fafc; }
.gt-rssbox-text { margin: 0 0 12px; font-size: .85rem; color: #94a3b8; }
.gt-rssbtn {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .8rem;
    color: #e2e8f0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 7px 12px;
    word-break: break-all;
}
.gt-rssbtn:hover { background: #334155; color: #fff; text-decoration: none; }

.gt-sourcenote { font-size: .78rem; color: var(--muted); margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .gt-layout { grid-template-columns: minmax(0, 1fr); }
    .gt-sidebar { position: static; }
}
@media (max-width: 720px) {
    .gt-grid { grid-template-columns: 1fr; }
    .gt-footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
    .gt-title { font-size: 1.4rem; }
    .gt-card { padding: 14px; }
    .gt-table-summary { display: none; }
}

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