/*
Theme Name: Cyltr Clean
Description: Warm, crisp editorial & indie-developer blog theme for cyltr.com.
Version: 1.1.0
Author: Cyltr
Text Domain: cyltr-clean
*/

*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --bg: #f5f3ef;
    --surface: #ffffff;
    --surface-hover: #fffdfb;
    --dark: #1c1917;
    --dark-muted: #a8a29e;
    --dark-border: #292524;
    --text: #1c1917;
    --text-muted: #57534e;
    --text-faint: #78716c;
    --border: #e5e1d8;
    --border-strong: #c9c3b8;
    --accent: #c2410c;
    --accent-hover: #9a3412;
    --accent-soft: #fff7ed;
    --teal: #0f766e;
    --teal-soft: #f0fdfa;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    --max-wide: 1040px;
    --max-reading: 820px;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: var(--max-wide);
    margin: 0 auto;
    padding: 0 24px;
}

.container-reading {
    max-width: var(--max-reading);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    background: var(--dark);
    color: #fafaf9;
    border-top: 3px solid var(--accent);
    border-bottom: 1px solid var(--dark-border);
    padding: 20px 0;
    margin-bottom: 36px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--accent);
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.04em;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.site-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.site-title a {
    color: #fafaf9;
    text-decoration: none;
}

.site-title a:hover {
    color: #fed7aa;
}

.site-tagline {
    margin: 0;
    font-size: 12.5px;
    color: var(--dark-muted);
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.site-nav a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 5px;
    color: #d6d3d1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Main */
.site-main {
    min-height: 62vh;
}

/* Category bar */
.cat-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    align-items: center;
}

.cat-pill {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.cat-pill:hover,
.cat-pill.is-active {
    border-color: var(--dark);
    background: var(--dark);
    color: #ffffff;
}

/* Featured latest post */
.featured-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 28px 32px;
    margin-bottom: 28px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: center;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.featured-card.has-thumb {
    grid-template-columns: 1.35fr 0.85fr;
}

.featured-card:hover {
    border-color: var(--border-strong);
    border-left-color: var(--accent);
    box-shadow: 0 8px 24px rgba(28, 25, 23, 0.06);
}

.badge-latest {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid #fed7aa;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.featured-title {
    margin: 10px 0 12px;
    font-size: 28px;
    font-weight: 750;
    line-height: 1.22;
    letter-spacing: -0.025em;
}

.featured-title a {
    color: var(--text);
    text-decoration: none;
}

.featured-title a:hover {
    color: var(--accent);
}

.featured-thumb img {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.btn-primary {
    display: inline-block;
    margin-top: 6px;
    padding: 9px 16px;
    border-radius: 6px;
    background: var(--accent);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #ffffff;
}

/* 2-Column Post Grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 8px 20px rgba(28, 25, 23, 0.05);
}

.post-card-thumb {
    margin: -22px -24px 16px;
    overflow: hidden;
    border-radius: 7px 7px 0 0;
    border-bottom: 1px solid var(--border);
}

.post-card-thumb img {
    display: block;
    width: 100%;
    height: 165px;
    object-fit: cover;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
    margin-bottom: 8px;
}

.post-meta a {
    color: var(--teal);
    background: var(--teal-soft);
    padding: 1px 7px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}

.post-meta a:hover {
    text-decoration: underline;
}

.post-item-title {
    margin: 0 0 10px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.post-item-title a {
    color: var(--text);
    text-decoration: none;
}

.post-item-title a:hover {
    color: var(--accent);
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.6;
    margin: 0 0 16px;
    flex-grow: 1;
}

.post-excerpt p {
    margin: 0;
}

.read-more {
    margin-top: auto;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* Archive header */
.archive-header {
    margin-bottom: 24px;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--dark);
    border-radius: 8px;
}

.archive-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.archive-desc {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 14.5px;
}

/* Single Post & Page Reading Sheet */
.back-link {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
}

.back-link:hover {
    color: var(--accent);
}

.reading-sheet {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 36px 44px 44px;
}

.entry-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.entry-title {
    margin: 0 0 12px;
    font-size: 32px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.entry-thumbnail {
    margin: 0 0 28px;
}

.entry-thumbnail img {
    display: block;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.entry-content {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    overflow-wrap: break-word;
}

.entry-content > * + * {
    margin-top: 1.15em;
}

.entry-content h2 {
    margin-top: 2em;
    margin-bottom: 0.5em;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.entry-content h3 {
    margin-top: 1.6em;
    margin-bottom: 0.4em;
    font-size: 18px;
    font-weight: 650;
    line-height: 1.35;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.4em;
}

.entry-content li + li {
    margin-top: 0.35em;
}

.entry-content blockquote {
    margin: 1.5em 0;
    padding: 10px 18px;
    border-left: 3px solid var(--accent);
    background: var(--bg);
    border-radius: 0 6px 6px 0;
    color: var(--text-muted);
}

.entry-content code {
    font-family: var(--font-mono);
    font-size: 0.87em;
    background: #f0ede6;
    color: #9a3412;
    padding: 2px 6px;
    border-radius: 4px;
}

.entry-content pre {
    background: var(--dark);
    color: #f5f5f4;
    border-radius: 6px;
    padding: 18px 20px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.55;
}

.entry-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.entry-content figure {
    margin: 1.5em 0;
}

.entry-content figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-faint);
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}

.entry-content th,
.entry-content td {
    padding: 9px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.entry-content th {
    background: var(--bg);
    font-weight: 600;
}

.entry-content hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2em 0;
}

.entry-content .wp-block-button__link {
    background-color: var(--accent);
    color: #ffffff;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
}

.entry-content .wp-block-button__link:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
}

/* Tags & Post Nav */
.entry-tags {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.entry-tags a {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3px 9px;
    border-radius: 4px;
    text-decoration: none;
}

.entry-tags a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.post-nav {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.post-nav a {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.15s ease;
}

.post-nav a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.post-nav-next {
    text-align: right;
}

/* Pagination */
.pagination {
    margin-top: 36px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 5px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
}

.pagination .page-numbers.current,
.pagination a.page-numbers:hover {
    border-color: var(--dark);
    color: var(--dark);
}

.pagination .page-numbers.current {
    background: var(--dark);
    color: #ffffff;
}

/* Comments */
.comments-area {
    margin-top: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px 36px;
}

.comments-title,
.comment-reply-title {
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 700;
}

.comment-list {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
}

.comment-list .comment {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.comment-list .children {
    list-style: none;
    padding-left: 24px;
    margin: 0;
}

.comment-meta {
    font-size: 13px;
    color: var(--text-faint);
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    color: var(--text);
}

.comment-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--dark);
    background: var(--surface);
}

.comment-form .submit,
.search-form button {
    padding: 8px 16px;
    border: 1px solid var(--accent);
    border-radius: 5px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.comment-form .submit:hover,
.search-form button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Search form */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 320px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 7px 11px;
    border: 1px solid #44403c;
    border-radius: 5px;
    font: inherit;
    font-size: 13.5px;
    color: #fafaf9;
    background: #292524;
}

.search-form input[type="search"]::placeholder {
    color: #a8a29e;
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
}

/* Footer */
.site-footer {
    margin-top: 64px;
    background: var(--dark);
    color: var(--dark-muted);
    border-top: 1px solid var(--dark-border);
    padding: 32px 0 40px;
    font-size: 13.5px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-inner a {
    color: #e7e5e4;
    text-decoration: none;
}

.footer-inner a:hover {
    color: #fed7aa;
    text-decoration: underline;
}

@media (max-width: 760px) {
    .featured-card.has-thumb,
    .post-grid,
    .post-nav {
        grid-template-columns: 1fr;
    }
    .reading-sheet {
        padding: 24px 20px 28px;
    }
    .comments-area {
        padding: 22px 20px;
    }
    .featured-card {
        padding: 22px 20px;
    }
    .featured-title,
    .entry-title {
        font-size: 24px;
    }
}

@media (max-width: 520px) {
    .container,
    .container-reading {
        padding: 0 16px;
    }
    .site-header {
        margin-bottom: 24px;
    }
}
