/* ────────────────────────────────────────────────────────────────────────────
   Minimal blog tasarimi - koyu tema
   ──────────────────────────────────────────────────────────────────────────── */

/* iA Writer Mono fontu */
@font-face {
    font-family: 'iA Writer Mono';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url(https://cdn.jsdelivr.net/fontsource/fonts/ia-writer-mono@latest/latin-400-normal.woff2) format('woff2'),
         url(https://cdn.jsdelivr.net/fontsource/fonts/ia-writer-mono@latest/latin-400-normal.woff) format('woff');
}
@font-face {
    font-family: 'iA Writer Mono';
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url(https://cdn.jsdelivr.net/fontsource/fonts/ia-writer-mono@latest/latin-700-normal.woff2) format('woff2'),
         url(https://cdn.jsdelivr.net/fontsource/fonts/ia-writer-mono@latest/latin-700-normal.woff) format('woff');
}
@font-face {
    font-family: 'iA Writer Mono';
    font-style: italic;
    font-display: swap;
    font-weight: 400;
    src: url(https://cdn.jsdelivr.net/fontsource/fonts/ia-writer-mono@latest/latin-400-italic.woff2) format('woff2'),
         url(https://cdn.jsdelivr.net/fontsource/fonts/ia-writer-mono@latest/latin-400-italic.woff) format('woff');
}
@font-face {
    font-family: 'iA Writer Mono';
    font-style: italic;
    font-display: swap;
    font-weight: 700;
    src: url(https://cdn.jsdelivr.net/fontsource/fonts/ia-writer-mono@latest/latin-700-italic.woff2) format('woff2'),
         url(https://cdn.jsdelivr.net/fontsource/fonts/ia-writer-mono@latest/latin-700-italic.woff) format('woff');
}

:root {
    --bg: #252525;
    --text: #f0f0f0;
    --text-dim: #999;
    --text-muted: #777;
    --accent: #e5ffc3;
    --green: #24d05a;
    --pink: #eb4888;
    --blue: #10a2f5;
    --yellow: #e9bc3f;
}

::selection {
    background-color: var(--accent);
    color: #252525;
}

html, body {
    margin: auto;
    padding: 20px;
    max-width: 70ch;
    background-color: var(--bg);
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: var(--text);
    scroll-behavior: smooth;
}

html, body, button, code, input {
    font-family: 'iA Writer Mono', monospace;
}

h1, h2, h3, h4, h5, h6, strong, b {
    color: var(--text);
}

h1 { font-weight: 400; }
h2 { font-weight: 400; margin: .5em 0; }
h3 { text-align: center; }

a {
    color: var(--text);
    text-decoration-thickness: .3ex;
    text-underline-offset: .3ex;
}

hr {
    border-top: 1px solid var(--text-dim);
    width: 75%;
    margin: 1rem auto;
}

/* Header */
header { position: relative; }
.header-section { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.header-frame { max-width: 350px; }
.header-frame h2 { margin: .5em 0; white-space: pre-wrap; }

.img-frame {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 10px 0;
    border-radius: 50%;
    overflow: hidden;
}
.img-frame img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 100%;
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    text-align: center;
    background: rgba(37, 37, 37, 0.85);
    backdrop-filter: blur(2px);
}
nav a {
    display: inline-block;
    text-decoration: none;
    margin: 1.5rem 0;
}
nav a:not(:last-child) { padding: 0 .75rem 0 0; }
nav a.active, nav a:hover {
    font-weight: bolder;
    text-decoration: underline;
    text-decoration-thickness: .3ex;
    text-underline-offset: .3ex;
}

@media (max-width: 650px) {
    nav { padding: 1.5rem 0 0; }
    nav a { margin: 0 0 1.5rem; }
}

/* Post listesi */
ul.posts-list, ul.tags-list, ul.year-list {
    padding: unset;
    list-style-type: none;
}
.post { margin: 0 0 30px; }
.post .title { font-size: 1.3em; }

time {
    font-style: italic;
    color: var(--text-dim);
}
ul li time { white-space: nowrap; }
.excerpt { line-height: 1.6; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; justify-content: center; }
.tags.center { max-width: 50ch; margin: 0 auto; color: var(--text); }
.tag-title { font-weight: 400; color: var(--text); }
.tag {
    display: inline-block;
    margin: auto 10px;
    color: var(--text);
    font-size: .8rem;
}
.tag:hover { cursor: pointer; font-weight: 700; }
.tag.posty { margin-left: 0; margin-right: 10px; }

/* Icerik */
main, content { line-height: 1.6; }

.blog-post {
    font-size: clamp(1rem, .96rem + .22vw, 1.125rem);
}
.blog-post > * + * { margin-block-start: 1em; }
.blog-post img {
    max-width: 100%;
    height: auto;
    cursor: zoom-in;
}
article :not(.article-title) { line-height: 1.8; }
.article-title { font-size: 2em; margin: .25em 0; }

/* Tablolar */
table { font-size: 1rem; }
.blog-post table {
    width: 100%;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
}
.blog-post table, .blog-post th, .blog-post td {
    line-height: 1.4;
    border: 1px solid var(--text-dim);
}
.blog-post th, .blog-post td { padding: 4px; }
.blog-post thead { background-color: rgba(240, 240, 240, 0.1); }

/* Kod bloklari */
code {
    padding: 2px 5px;
    background-color: rgba(240, 240, 240, 0.1);
    font-weight: 700;
}
pre {
    padding: 1rem;
    background-color: rgba(240, 240, 240, 0.1);
    overflow: auto;
}
pre > code { all: unset; }

/* Blockquote */
blockquote {
    background: rgba(240, 240, 240, 0.08);
    border-left: .5ex solid var(--text-dim);
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    color: var(--text);
    padding: 20px;
    margin: 0;
    font-style: italic;
}
blockquote p { margin: 0; }
blockquote > ul:last-child {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: right;
}
blockquote > ul:last-child > li:before { content: "— "; }

/* Input */
input[type=text], input[type=email] {
    background: var(--bg);
    color: var(--text);
    padding: 0 .3em;
    border: none;
    border-bottom: .2em solid var(--text-dim);
    font-size: 1rem;
    height: 1.4em;
    max-width: 173px;
}
input:focus { outline: transparent; }

/* Dialog */
dialog {
    max-width: 100ch;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--text-dim);
}
dialog::backdrop { backdrop-filter: blur(3px); background: rgba(0,0,0,0.6); }
dialog img { width: clamp(100%, auto, 95ch); max-height: 80vh; }
dialog button {
    display: block;
    margin: 10px auto;
    padding: 5px;
    background: rgba(240, 240, 240, 0.1);
    border: none;
    cursor: pointer;
    color: var(--text);
}
dialog[open] { animation: dialog-fade-in .3s ease-in-out; }
@keyframes dialog-fade-in {
    0% { opacity: 0; transform: scale(.8); }
    to { opacity: 1; transform: scale(1); }
}
body:has(dialog[open]) { overflow: hidden; }

/* Utility */
.center { text-align: center; }
img { max-width: 100%; height: auto; }

/* Mobil */
@media (max-width: 650px) {
    html, body { padding: 15px; }
    .img-frame { width: 150px; height: 150px; }
    .article-title { font-size: 1.5em; }
}
@media (max-width: 400px) {
    html, body { padding: 12px; }
    .img-frame { width: 120px; height: 120px; }
    .hide-small { display: none; }
}

/* Post navigasyonu */
.nav-posts {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2em 0;
    text-align: center;
}
.dot { margin: 0 .5em; }

/* Footer */
footer {
    padding: 25px;
    text-align: center;
    font-size: .8rem;
}

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 0.9rem;
    color: var(--text);
}
