/* Gnoke CMS — public site styles (blog index + article page) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

a {
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Header ---------- */

.site-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 60px 0 80px;
    text-align: center;
}

.logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.logo-header img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}

.logo-header span {
    font-weight: 700;
    font-size: 1.3rem;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.site-subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
}

.site-nav {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.nav-links a {
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #3b82f6;
}

/* ---------- Blog index ---------- */

.blog-main {
    padding: 48px 0 80px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

.post-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.post-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #e2e8f0;
}

.post-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.post-card-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-card-excerpt {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 16px;
    flex-grow: 1;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #94a3b8;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.post-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.state-message {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.state-message.error {
    color: #dc2626;
    background: #fef2f2;
    border-radius: 12px;
}

.load-more {
    text-align: center;
    margin-top: 48px;
}

.load-more-btn {
    background: white;
    border: 2px solid #1e293b;
    color: #1e293b;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: #1e293b;
    color: white;
}

/* ---------- Article page ---------- */

.breadcrumb {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    background: white;
}

.breadcrumb a {
    color: #1e293b;
    text-decoration: none;
}

.breadcrumb span {
    margin: 0 8px;
    color: #64748b;
}

.post-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 40px 0;
}

.post-header .logo-header {
    justify-content: flex-start;
    margin-bottom: 24px;
}

.post-header .logo-header img {
    width: 40px;
    height: 40px;
}

.post-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.post-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.3;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    opacity: 0.85;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.featured-image-wrap {
    width: 100%;
    max-height: 420px;
    overflow: hidden;
    background: #0f172a;
}

.featured-image {
    width: 100%;
    height: 420px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.post-body {
    background: white;
    padding: 40px 0;
}

.post-content {
    font-size: 1.05rem;
    color: #334155;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content h2 {
    font-size: 1.4rem;
    color: #1e293b;
    margin: 32px 0 16px;
}

.post-content ul {
    margin: 0 0 20px 20px;
}

.post-content li {
    margin-bottom: 10px;
}

.post-content a {
    color: #3b82f6;
    text-decoration: underline;
}

.post-content .content-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 24px 0;
}

.post-content .content-empty {
    color: #94a3b8;
    font-style: italic;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.back-link {
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.related-section {
    padding: 40px 0 60px;
}

.related-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.related-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.related-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    background: #e2e8f0;
}

.related-card-content {
    padding: 14px;
}

.related-card-content h3 {
    font-size: 0.95rem;
    color: #1f2937;
}

/* ---------- Footer ---------- */

.site-footer {
    background: #0f172a;
    color: white;
    padding: 48px 0;
    text-align: center;
}

.footer-tagline {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 8px;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .site-title {
        font-size: 1.8rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .nav-links {
        gap: 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-title {
        font-size: 1.5rem;
    }

    .featured-image,
    .featured-image-wrap {
        height: 260px;
    }

    .post-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---------- About Page ---------- */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.info-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.info-card h3 {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.stack-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stack-list li {
    padding: 8px 0;
    color: #475569;
    font-size: 0.95rem;
    border-bottom: 1px dashed #e2e8f0;
}

.stack-list li:last-child {
    border-bottom: none;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #1e293b;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.contact-btn:hover {
    background: #3b82f6;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}
