/* ============================================================
   CepSanayi — Sözleşmeler ve metinler (/sozlesmeler)
   2026-10-07 yeniden tasarım. Renkler admin.css token'larının
   herkese açık sayfadaki karşılığı (lacivert bant, turuncu vurgu,
   TR plaka kimliği). Yazı tipi: kendi sunucumuzdaki Barlow seti.
   ============================================================ */

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/barlow-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/barlow-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/barlow-500-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/barlow-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/barlow-600-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/barlow-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Token'lar ---------- */
:root {
    color-scheme: light dark;

    --navy-900: #0B1220;
    --navy-800: #0F172A;
    --navy-line: #24324D;
    --navy-ink: #F8FAFC;
    --navy-muted: #B6C2D4;

    --bg: #F1F5F9;
    --surface: #FFFFFF;
    --surface-muted: #F8FAFC;
    --border: #E2E8F0;
    --border-strong: #CBD5E1;
    --text: #0F172A;
    --text-secondary: #334155;
    --muted: #475569;

    --accent: #F97316;
    --accent-text: #C2410C;
    --accent-bg: #FFF7ED;
    --accent-line: #FED7AA;

    --info-bg: #EFF6FF;
    --info-line: #BFDBFE;
    --info-fg: #1D4ED8;
    --warn-bg: #FEF3C7;
    --warn-line: #FCD34D;
    --warn-fg: #92400E;
    --ok-fg: #15803D;
    --ok-bg: #DCFCE7;

    --plate-blue: #002D91;
    --plate-ink: #12161F;

    --ring: #2563EB;

    --font-sans: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Barlow Condensed", "Barlow", system-ui, sans-serif;

    --radius-sm: 8px;
    --radius-md: 12px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --dur: 180ms;

    --gutter: 16px;
    --page: 1180px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0B1220;
        --surface: #111A2E;
        --surface-muted: #0E1628;
        --border: #1E2A44;
        --border-strong: #33415E;
        --text: #F1F5F9;
        --text-secondary: #CBD5E1;
        --muted: #A3B0C2;

        --accent-text: #FDBA74;
        --accent-bg: #2A1708;
        --accent-line: #6B3A12;

        --info-bg: #0F1F3A;
        --info-line: #1E3A6B;
        --info-fg: #93C5FD;
        --warn-bg: #2E2206;
        --warn-line: #6B4E0B;
        --warn-fg: #FDE68A;
        --ok-fg: #86EFAC;
        --ok-bg: #123524;

        --ring: #93C5FD;
        --navy-800: #070D19;
        --navy-line: #1B2740;
    }
    .band { border-bottom: 1px solid var(--navy-line); }
}

/* ---------- Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 17px/1.6 var(--font-sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; }
.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 28px; } }

.skip {
    position: absolute; left: 12px; top: -60px; z-index: 10;
    background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: var(--radius-sm);
}
.skip:focus { top: 12px; }

/* ---------- Üst bant ---------- */
.band { background: var(--navy-800); color: var(--navy-ink); }
.band a { color: inherit; }
.band :focus-visible { outline-color: #93C5FD; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.topbar .back { font-size: 15px; font-weight: 500; color: var(--navy-muted); text-decoration: none; padding: 10px 0; }
.topbar .back:hover { color: var(--navy-ink); text-decoration: underline; }

.plate {
    display: inline-flex; align-items: stretch; height: 36px; overflow: hidden;
    border: 2px solid var(--plate-ink); border-radius: 6px; background: #FFFFFF;
    text-decoration: none; flex: none;
}
.plate .tr {
    display: flex; align-items: center; justify-content: center; width: 19px;
    background: var(--plate-blue); color: #FFFFFF; font-size: 9px; font-weight: 600; letter-spacing: .02em;
}
.plate .name {
    display: flex; align-items: center; padding: 0 10px 0 9px;
    font: 700 22px/1 var(--font-display); letter-spacing: .02em; color: var(--plate-ink);
}
.plate .name span { color: #C2410C; }

.hero { padding: 28px 0 40px; border-top: 1px solid var(--navy-line); }
.hero h1 {
    margin: 0; font: 700 clamp(2rem, 1.4rem + 2.4vw, 3rem)/1.05 var(--font-display);
    letter-spacing: .005em;
}
.hero p { margin: 12px 0 0; max-width: 62ch; color: var(--navy-muted); font-size: 18px; }
.hero .facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 20px 0 0; padding: 0; list-style: none; font-size: 15px; color: var(--navy-muted); }
.hero .facts strong { color: var(--navy-ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.doc-title { padding: 0 0 32px; }
.doc-title h1 { margin: 0; max-width: 40ch; font: 700 clamp(1.9rem, 1.4rem + 2vw, 2.75rem)/1.08 var(--font-display); letter-spacing: .005em; }
.crumbs { padding: 14px 0 14px; border-top: 1px solid var(--navy-line); font-size: 15px; color: var(--navy-muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.crumbs a { color: var(--navy-ink); }
.crumbs [aria-current] { color: var(--navy-muted); }
@media (max-width: 639px) { .crumbs li:last-child { display: none; } }

/* ---------- Bilgi kutuları ---------- */
.note {
    display: flex; gap: 12px; align-items: flex-start;
    border: 1px solid var(--info-line); background: var(--info-bg); color: var(--text);
    border-radius: var(--radius-md); padding: 14px 16px; font-size: 15.5px; line-height: 1.55;
}
.note svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--info-fg); }
.note p { margin: 0; }
.note.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.note.warn svg { color: var(--warn-fg); }

/* ---------- Rozetler ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px;
    border-radius: 999px; font-size: 13.5px; font-weight: 500; line-height: 1.3; white-space: nowrap;
    background: var(--surface-muted); color: var(--text-secondary); border: 1px solid var(--border);
}
.chip.version { font-variant-numeric: tabular-nums; }
.chip.accept { background: var(--accent-bg); color: var(--accent-text); border-color: var(--accent-line); }
.chip.draft { background: transparent; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Dizin ---------- */
.index-main { padding: 28px 0 56px; }
.group { margin-top: 40px; }
.group:first-of-type { margin-top: 28px; }
.group-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; }
.group-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.005em; }
.group-head .count { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
@media (min-width: 1024px) {
    .group { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; padding-top: 28px; border-top: 1px solid var(--border); }
    .group:first-of-type { margin-top: 32px; }
    .group-head { flex-direction: column; gap: 2px; margin: 0; position: sticky; top: 20px; }
    .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.doc-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); margin: 0; padding: 0; list-style: none; }
.doc {
    position: relative; display: flex; flex-direction: column; gap: 12px; height: 100%;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 18px 18px 16px;
    transition: border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.doc:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.doc:focus-within { border-color: var(--ring); }
.doc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.doc-audience { font-size: 14px; font-weight: 600; color: var(--muted); }
@media (max-width: 479px) { .doc-top { flex-direction: column; gap: 8px; } .topbar .back { font-size: 14px; } }
.doc h3 { margin: 0; font-size: 19px; line-height: 1.3; font-weight: 600; }
.doc h3 a { color: var(--text); text-decoration: none; }
.doc h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.doc h3 a:focus-visible { outline: none; }
.doc h3 a:focus-visible::after { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-md); }
.doc-line { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.doc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.doc-foot .meta { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.read {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
    border-radius: var(--radius-sm); background: var(--navy-800); color: #FFFFFF; font-size: 15px; font-weight: 600;
    transition: background-color var(--dur) var(--ease-out);
}
.read svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease-out); }
.doc:hover .read { background: #1E293B; }
.doc:hover .read svg { transform: translateX(2px); }
@media (prefers-color-scheme: dark) {
    .read { background: #E2E8F0; color: var(--navy-900); }
    .doc:hover .read { background: #FFFFFF; }
}

.empty { padding: 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); color: var(--muted); }

/* ---------- Alt bilgi ---------- */
.foot { border-top: 1px solid var(--border); padding: 22px 0 36px; font-size: 14.5px; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.foot p { margin: 0; }
.foot a { color: var(--text-secondary); }

/* ---------- Okuma sayfası ---------- */
.reader { display: grid; gap: 20px; padding-top: 24px; padding-bottom: 56px; grid-template-areas: "head" "side" "article"; }
.reader > .doc-head { grid-area: head; margin-bottom: 0; }
.reader > .side { grid-area: side; }
.reader > .article { grid-area: article; }
@media (min-width: 1024px) {
    .reader { grid-template-columns: 270px minmax(0, 860px); grid-template-rows: auto 1fr; grid-template-areas: "side head" "side article"; column-gap: 48px; row-gap: 20px; align-items: start; padding-top: 32px; }
    .side { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
}

.side { display: flex; flex-direction: column; gap: 18px; font-size: 15px; }
.side h2 { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 14px 12px; }

.panel.toc { padding: 4px 12px; }
.toc details[open] { padding-bottom: 8px; }
.toc details > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: 44px; cursor: pointer; list-style: none; font-weight: 600; font-size: 16px;
}
.toc details > summary::-webkit-details-marker { display: none; }
.toc summary .count { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.toc summary svg { width: 18px; height: 18px; color: var(--muted); transition: transform var(--dur) var(--ease-out); }
.toc details[open] summary svg { transform: rotate(180deg); }
.toc ol { margin: 6px 0 0; padding: 0; list-style: none; }
.toc li a {
    display: block; padding: 6px 8px; border-radius: 6px; color: var(--text-secondary); text-decoration: none; line-height: 1.35;
    transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.toc li a:hover { background: var(--surface-muted); color: var(--text); }
.toc li a[aria-current="location"] { background: var(--accent-bg); color: var(--accent-text); font-weight: 600; }
.toc li.d1 a { padding-left: 22px; font-size: 14.5px; }
.toc li.d2 a { padding-left: 34px; font-size: 14px; }

.versions ul { margin: 0; padding: 0; list-style: none; }
.versions li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.versions li + li { border-top: 1px solid var(--border); }
.versions ul { margin-top: 4px; }
.versions li a, .versions .here, .versions .old { display: flex; align-items: center; min-height: 40px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.versions .here { font-weight: 600; color: var(--text); }
.versions .old { color: var(--text-secondary); }
.versions-note { margin: 8px 8px 4px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.versions .tag { font-size: 13px; color: var(--muted); padding-right: 4px; }
.side > .btn { display: none; }
@media (min-width: 1024px) { .side > .btn { display: inline-flex; align-self: flex-start; } .article .to-top { display: none; } }

.side-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px;
    border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    font: 600 15px/1 var(--font-sans); text-decoration: none; cursor: pointer;
    transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.btn:hover { background: var(--surface-muted); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn[hidden] { display: none; }

.doc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.doc-head .who { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }

.changes { border: 1px solid var(--accent-line); background: var(--accent-bg); border-radius: var(--radius-md); padding: 16px 18px; }
.changes-title { margin: 0 0 6px; font-size: 16px; color: var(--muted); }
.changes-title strong { color: var(--text); font-weight: 600; font-size: 17px; }
.changes ul { margin: 0; padding-left: 20px; }
.changes li { margin: 6px 0; font-size: 15.5px; line-height: 1.55; color: var(--text); }
.changes li::marker { color: var(--accent-text); }

.article { min-width: 0; }
.sheet { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 28px 20px 36px; }
@media (min-width: 720px) { .sheet { padding: 40px 48px 48px; } }

/* Belge tipografisi: satır ~70ch, başlık hiyerarşisi, madde numaraları. */
.prose { max-width: 70ch; font-size: 17px; line-height: 1.7; color: var(--text); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font: 700 clamp(1.75rem, 1.4rem + 1.4vw, 2.35rem)/1.12 var(--font-display); letter-spacing: .005em; margin: 2.2em 0 .6em; }
.prose h1:first-child { margin-top: 0; }
.prose h2 { font-size: 1.3rem; line-height: 1.3; font-weight: 600; margin: 2.1em 0 .6em; padding-top: .9em; border-top: 1px solid var(--border); }
.prose h1 + h2, .prose h1 + p + h2, .prose > h2:first-child, .prose > p:first-child + h2 { border-top: 0; padding-top: 0; }
.prose h3 { font-size: 1.08rem; line-height: 1.35; font-weight: 600; margin: 1.6em 0 .4em; }
.prose h4 { font-size: 1rem; font-weight: 600; margin: 1.4em 0 .3em; }
.prose h1, .prose h2, .prose h3, .prose h4 { scroll-margin-top: 20px; }
.prose p { margin: 0 0 1em; text-wrap: pretty; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.5em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.prose ol > li::marker { font-weight: 600; }
.prose strong { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose code { font-size: .9em; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.prose blockquote {
    margin: 1.2em 0; padding: 12px 16px; border-radius: var(--radius-sm);
    background: var(--surface-muted); border: 1px solid var(--border); color: var(--text-secondary);
}
.prose blockquote > :last-child { margin-bottom: 0; }
.table-wrap { margin: 1.2em 0 1.4em; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prose table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.prose th { background: var(--surface-muted); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.prose td + td, .prose th + th { border-left: 1px solid var(--border); }

.to-top { display: inline-flex; align-items: center; gap: 6px; margin-top: 24px; font-size: 15px; font-weight: 500; min-height: 44px; }
.to-top svg { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
    .doc:hover { transform: none; }
}

/* ---------- Yazdırma ---------- */
@media print {
    :root { --text: #000; --muted: #333; --border: #bbb; }
    body { background: #fff; color: #000; font-size: 11pt; }
    .band, .side, .foot nav, .to-top, .skip, .doc-head .actions { display: none !important; }
    .reader { display: block; padding: 0; }
    .sheet { border: 0; padding: 0; }
    .prose { max-width: none; font-size: 11pt; }
    .prose h2 { break-after: avoid; }
    .prose a { color: #000; }
    .note, .changes { border-color: #999; background: #fff; }
    .print-only { display: block !important; font-size: 10pt; color: #333; }
    .print-title { display: block !important; font: 700 20pt/1.2 var(--font-display); margin: 0 0 12pt; }
}
.print-only, .print-title { display: none; }
