/* Hayat Masalı — sade editoryal blog teması */

:root {
    --ink: #241f1c;
    --ink-soft: #5a524c;
    --paper: #fbf8f4;
    --paper-alt: #f2ece3;
    --line: #e6ddd1;
    --accent: #b5502e;
    --accent-soft: #f0dccf;
    --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Times New Roman', serif;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --max: 860px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #ece6df;
        --ink-soft: #b7ada1;
        --paper: #1b1815;
        --paper-alt: #242019;
        --line: #35302a;
        --accent: #e08a5f;
        --accent-soft: #3a2a20;
    }
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--sans);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.65;
}

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

img { max-width: 100%; height: auto; display: block; border-radius: 6px; }

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    position: sticky;
    top: 0;
    z-index: 10;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    padding-bottom: 18px;
    gap: 16px;
}
.site-header__logo {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
}
.site-header__logo:hover { text-decoration: none; color: var(--accent); }
.site-header__logo-img { max-height: 42px; width: auto; border-radius: 0; }

.site-nav {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    margin-left: auto;
}
.site-nav a {
    color: var(--ink-soft);
    font-size: 0.95rem;
    white-space: nowrap;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }

.site-nav__toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 1.1rem;
    padding: 6px 10px;
    color: var(--ink);
    cursor: pointer;
}

.site-header__search-toggle {
    background: none;
    border: none;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.site-header__search-toggle:hover { color: var(--accent); background: var(--accent-soft); }

@media (max-width: 640px) {
    .site-nav { display: none; width: 100%; flex-direction: column; gap: 10px; padding-bottom: 12px; margin-left: 0; order: 4; }
    .site-nav.is-open { display: flex; }
    .site-header__inner { flex-wrap: wrap; }
    .site-nav__toggle { display: block; }
    .site-header__search-toggle { order: 2; }
    .site-nav__toggle { order: 3; }
}

/* Arama popup */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
}
.search-modal[hidden] { display: none; }
.search-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 12, 0.5);
}
.search-modal__panel {
    position: relative;
    max-width: 560px;
    margin: 10vh auto 0;
    background: var(--paper);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    padding: 6px;
}
.search-modal__form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
}
.search-modal__form svg { color: var(--ink-soft); flex-shrink: 0; }
.search-modal__form input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.05rem;
    color: var(--ink);
    outline: none;
    font-family: inherit;
}
.search-modal__form button[data-search-close] {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 2px 6px;
}
.search-modal__suggestions {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
    border-top: 1px solid var(--line);
}
.search-modal__suggestions:empty { border-top: none; }
.search-modal__suggestions li a {
    display: block;
    padding: 12px 16px;
    color: var(--ink);
    font-size: 0.95rem;
}
.search-modal__suggestions li a:hover,
.search-modal__suggestions li a.is-active {
    background: var(--paper-alt);
    text-decoration: none;
    color: var(--accent);
}

/* Main */
.main-content { padding: 40px 20px 60px; }

.page-title {
    font-family: var(--serif);
    font-size: 1.7rem;
    margin: 0 0 28px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--accent-soft);
}

.hero {
    padding: 10px 0 36px;
}
.hero h1 {
    font-family: var(--serif);
    font-size: 2.1rem;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}
.hero p { color: var(--ink-soft); margin: 0; }

.category-intro {
    max-height: 150px;
    overflow-y: auto;
    margin: -14px 0 28px;
    padding-right: 6px;
    color: var(--ink-soft);
    font-size: 0.97rem;
}
.category-intro p { margin: 0 0 1em; }
.category-intro p:last-child { margin-bottom: 0; }

/* Post list / cards */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 34px;
}
.post-card {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 20px;
}
.post-card:not(.has-image) { grid-template-columns: 1fr; }
.post-card__thumb img {
    width: 130px;
    height: 130px;
    object-fit: cover;
}
.post-card__meta {
    font-size: 0.82rem;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.post-card__meta a { color: var(--accent); }
.post-card__title {
    font-family: var(--serif);
    font-size: 1.3rem;
    margin: 0 0 8px;
    line-height: 1.3;
}
.post-card__title a { color: var(--ink); }
.post-card__title a:hover { color: var(--accent); text-decoration: none; }
.post-card__excerpt {
    color: var(--ink-soft);
    font-size: 0.97rem;
    margin: 0;
}

@media (max-width: 520px) {
    .post-card { grid-template-columns: 90px 1fr; gap: 14px; }
    .post-card__thumb img { width: 90px; height: 90px; }
    .post-card__title { font-size: 1.1rem; }
}

/* Görünüm seçici (tekli / ikili / üçlü) */
.layout-toggle {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 3px;
    background: var(--paper-alt);
}
.layout-toggle__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--ink-soft);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.layout-toggle__btn:hover { color: var(--ink); }
.layout-toggle__btn.is-active { background: var(--paper); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

/* İkili / üçlü grid görünümü */
.post-list[data-cols="2"],
.post-list[data-cols="3"] {
    display: grid;
    gap: 28px;
}
.post-list[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.post-list[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.post-list[data-cols="2"] .post-card,
.post-list[data-cols="3"] .post-card {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.post-list[data-cols="2"] .post-card__thumb,
.post-list[data-cols="3"] .post-card__thumb {
    margin-bottom: 14px;
}
.post-list[data-cols="2"] .post-card__thumb img,
.post-list[data-cols="3"] .post-card__thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.post-list[data-cols="3"] .post-card__title { font-size: 1.1rem; }
.post-list[data-cols="3"] .post-card__excerpt { display: none; }

/* Mobilde de seçilen kolon sayısı korunur, sadece boşluklar/yazı boyutu daraltılır */
@media (max-width: 640px) {
    /* Tekli görünüm: görsel üstte tam genişlik, açıklama altta */
    .post-list[data-cols="1"] .post-card {
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    .post-list[data-cols="1"] .post-card__thumb {
        margin-bottom: 12px;
    }
    .post-list[data-cols="1"] .post-card__thumb img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 10;
        object-fit: cover;
    }

    .post-list[data-cols="2"],
    .post-list[data-cols="3"] {
        gap: 14px;
    }
    .post-list[data-cols="2"] .post-card__thumb,
    .post-list[data-cols="3"] .post-card__thumb {
        margin-bottom: 8px;
    }
    .post-list[data-cols="2"] .post-card__title { font-size: 1rem; }
    .post-list[data-cols="3"] .post-card__title { font-size: 0.85rem; line-height: 1.25; }
    /* İkili görünümde açıklama gösterilmez */
    .post-list[data-cols="2"] .post-card__excerpt { display: none; }
    .post-list[data-cols="2"] .post-card__meta,
    .post-list[data-cols="3"] .post-card__meta { font-size: 0.72rem; }
}

@media (max-width: 400px) {
    .post-list[data-cols="3"] { grid-template-columns: repeat(2, 1fr); }
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 44px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 0.92rem;
}
.pagination__current { color: var(--ink-soft); }

/* Single post */
.post {
    max-width: var(--max);
}
.post__category {
    display: inline-block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 14px;
}
.post__title {
    font-family: var(--serif);
    font-size: 2rem;
    line-height: 1.25;
    margin: 0 0 12px;
}
.post__meta {
    color: var(--ink-soft);
    font-size: 0.9rem;
    margin-bottom: 26px;
}
.post__featured {
    margin-bottom: 28px;
}
.post__featured img { width: 100%; height: auto; }

.post__content {
    font-size: 1.08rem;
    color: var(--ink);
}
.post__content p { margin: 0 0 1.3em; }
.post__content img { margin: 1.4em 0; }
.post__content figure { margin: 1.4em 0; }
.post__content figcaption {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 6px;
    text-align: center;
}
.post__content blockquote {
    margin: 1.4em 0;
    padding: 4px 20px;
    border-left: 3px solid var(--accent);
    color: var(--ink-soft);
    font-style: italic;
}
.post__content h2, .post__content h3 {
    font-family: var(--serif);
    margin: 1.6em 0 0.6em;
}
.post__content a { text-decoration: underline; }

.post__categories {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.post__categories a {
    background: var(--paper-alt);
    color: var(--ink-soft);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
}
.post__categories a:hover { color: var(--accent); text-decoration: none; }

/* Comments */
.comments {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
}
.comments__title {
    font-family: var(--serif);
    font-size: 1.4rem;
    margin: 0 0 24px;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment-list { margin-top: 16px; padding-left: 24px; border-left: 2px solid var(--line); }
.comment {
    margin-bottom: 22px;
}
.comment__author {
    font-weight: 600;
    margin-right: 8px;
}
.comment__date {
    color: var(--ink-soft);
    font-size: 0.82rem;
}
.comment__body { margin: 6px 0 0; }

.comment-form {
    margin-top: 34px;
    background: var(--paper-alt);
    padding: 22px;
    border-radius: 10px;
}
.comment-form h3 {
    font-family: var(--serif);
    margin: 0 0 16px;
}
.comment-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 4px;
}
.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 14px;
}
.comment-form textarea { min-height: 110px; resize: vertical; }
.comment-form .hp { position: absolute; left: -9999px; }
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
}
.btn:hover { opacity: 0.9; text-decoration: none; }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 0.92rem;
}
.alert--success { background: #dff3e3; color: #1e5c30; }
.alert--error { background: #fbdede; color: #7a1f1f; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--paper-alt);
    color: var(--ink-soft);
    font-size: 0.85rem;
}
.site-footer__inner { padding: 26px 20px; text-align: center; }
.site-footer p { margin: 4px 0; }

/* Empty state */
.empty-state { color: var(--ink-soft); padding: 40px 0; text-align: center; }
