/* Cainty Default Theme — Dark Editorial */

:root {
    --bg: #000000;
    --surface: #111111;
    --border: #2a2a2a;
    --text: #cccccc;
    --text-muted: #888888;
    --heading: #ffffff;
    --accent: #ffe454;
    --link: #4a9eff;
    --radius: 8px;
    --max-width: 1200px;
    --content-width: 780px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--accent); }

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

h1, h2, h3, h4 {
    color: var(--heading);
    line-height: 1.3;
    font-weight: 600;
}

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

/* Header */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}

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

.site-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}
.site-logo:hover { color: var(--accent); opacity: 0.8; }

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
}
.nav-links a { color: var(--text-muted); font-size: 0.9rem; }
.nav-links a:hover { color: var(--accent); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    transition: 0.3s;
}

/* Page Header */
.page-header {
    padding: 48px 0 32px;
}
.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
}
.tagline, .archive-description {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Post Grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-bottom: 48px;
}
.post-grid-small {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Post Card */
.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}
.post-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.post-card-link {
    display: block;
    color: inherit;
}
.post-card-link:hover { color: inherit; }

.post-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--border);
}
.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-body { padding: 16px 20px 20px; }

.post-card-title {
    font-size: 1.15rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.post-card-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    gap: 8px;
}

/* Single Post */
.single-post {
    max-width: var(--content-width);
    padding-top: 32px;
    padding-bottom: 64px;
}

.post-header {
    margin-bottom: 32px;
}
.post-header h1 {
    font-size: 2.4rem;
    line-height: 1.2;
    margin-bottom: 16px;
}

.post-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.meta-sep { opacity: 0.4; }

.featured-image {
    margin-bottom: 32px;
    border-radius: var(--radius);
    overflow: hidden;
}
.featured-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Post Content */
.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
}
.post-content h2 {
    font-size: 1.6rem;
    margin: 40px 0 16px;
}
.post-content h3 {
    font-size: 1.25rem;
    margin: 32px 0 12px;
}
.post-content p {
    margin-bottom: 20px;
}
.post-content ul, .post-content ol {
    margin: 0 0 20px 24px;
}
.post-content li { margin-bottom: 6px; }
.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 24px 0;
    color: var(--text-muted);
    font-style: italic;
}
.post-content a { color: var(--accent); }
.post-content a:hover { text-decoration: underline; }
.post-content img {
    border-radius: var(--radius);
    margin: 24px 0;
}
.post-content strong { color: var(--heading); }

/* Shortcode: Table */
.cainty-table-wrapper {
    margin: 24px 0;
    overflow-x: auto;
}
.cainty-table-caption {
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 8px;
    font-size: 0.95rem;
}
.cainty-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.cainty-table th, .cainty-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.cainty-table th {
    color: var(--accent);
    font-weight: 600;
    background: var(--surface);
    white-space: nowrap;
}
.cainty-table td.highlight {
    color: var(--accent);
    font-weight: 600;
}

/* Tags & Categories */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 32px 0;
}
.tag {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.post-categories {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
}
.post-categories a { color: var(--accent); }

/* Related Posts */
.related-posts {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.related-posts h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 32px 0;
}
.pagination-link {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.pagination-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pagination-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Search */
.search-form {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    max-width: 500px;
}
.search-input {
    flex: 1;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
}
.search-input:focus {
    outline: none;
    border-color: var(--accent);
}
.search-meta {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-accent {
    background: var(--accent);
    color: #000;
}

/* 404 */
.error-page {
    text-align: center;
    padding: 100px 20px;
}
.error-page h1 {
    font-size: 6rem;
    color: var(--accent);
    margin-bottom: 16px;
}
.error-page p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* No posts */
.no-posts {
    color: var(--text-muted);
    text-align: center;
    padding: 48px 0;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: 48px;
}
.footer-inner {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.site-footer a { color: var(--accent); }

/* Responsive */
@media (max-width: 768px) {
    .post-grid { grid-template-columns: 1fr; }
    .post-header h1 { font-size: 1.8rem; }
    .page-header h1 { font-size: 1.6rem; }

    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 16px 20px;
        gap: 12px;
    }
    .nav-links.active { display: flex; }
    .site-header { position: relative; }
}
