/**
 * SC&MS Framework - Blog Styles
 */

/* Blog Container */
.blog-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 8rem 2rem 4rem;
}

/* Blog Header */
.blog-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.blog-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.blog-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Blog Posts List */
.blog-posts {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-card {
    padding: 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
}

.post-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(139, 115, 85, 0.1);
}

.post-card time {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.post-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.5rem 0;
    line-height: 1.3;
}

.post-card h2 a {
    color: var(--text-primary);
    text-decoration: none;
}

.post-card h2 a:hover {
    color: var(--primary);
}

.post-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.post-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    background: rgba(139, 115, 85, 0.1);
    color: var(--primary);
    border-radius: 4px;
    font-weight: 500;
}

/* Individual Post Styles */
.post-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 8rem 2rem 4rem;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.post-header time {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: 0.5rem;
}

.post-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.post-header .post-meta {
    margin-top: 1rem;
}

/* Post Content */
.post-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-primary);
    max-width: 70ch;
}

.post-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    color: var(--text-primary);
}

.post-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: var(--text-primary);
}

.post-content p {
    margin-bottom: 1.25rem;
}

.post-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content a:hover {
    color: var(--primary-dark);
}

.post-content ul,
.post-content ol {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: rgba(139, 115, 85, 0.05);
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    background: rgba(139, 115, 85, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

.post-content pre {
    background: #1a1614;
    color: #f0ebe3;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    font-size: 0.875rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-content th,
.post-content td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

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

/* Post Footer */
.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.post-nav a {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
    max-width: 44ch;
}

.post-nav a.post-nav-prev {
    align-items: flex-start;
    text-align: left;
}

.post-nav a.post-nav-next {
    margin-left: auto;
    align-items: flex-end;
    text-align: right;
}

.post-nav .post-nav-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

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

@media (max-width: 640px) {
    .post-nav {
        flex-direction: column;
        gap: 1.25rem;
    }

    .post-nav a.post-nav-next {
        margin-left: 0;
        align-items: flex-start;
        text-align: left;
    }
}

/* Back to Blog Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

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

/* Active Nav State */
.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

/* Forms */
.subscribe-form,
.contact-form {
    margin: 1.5rem 0;
}

.form-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.form-row input[type="email"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

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

.form-row .btn {
    white-space: nowrap;
}

.form-note {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.contact-form .form-group,
.form-group {
    margin-bottom: 1.25rem;
    display: block;
}

.contact-form .form-group label,
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
}

.contact-form .form-group input[type="text"],
.contact-form .form-group input[type="email"],
.contact-form .form-group textarea,
.contact-form .form-group select,
.form-group input,
.form-group textarea,
.form-group select {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    transition: border-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.contact-form .form-group input:focus,
.contact-form .form-group textarea:focus,
.contact-form .form-group select:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.contact-form .form-group textarea,
.form-group textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.6;
}

.contact-form .form-group select,
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6762' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-color: var(--bg-elevated);
    padding-right: 2.5rem;
}

.form-submit {
    margin-top: 1.5rem;
}

.form-status {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    display: none;
}

.form-status.success {
    display: block;
    background: rgba(34, 139, 34, 0.08);
    border: 1px solid rgba(34, 139, 34, 0.2);
    color: #1a6b1a;
}

.form-status.error {
    display: block;
    background: rgba(180, 50, 50, 0.08);
    border: 1px solid rgba(180, 50, 50, 0.2);
    color: #8b2020;
}

.form-fallback {
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
}

/* Follow CTA Block */
.follow-cta {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(139, 115, 85, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
}

.follow-cta h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.follow-cta p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.follow-cta .cta-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.follow-cta .cta-links a {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.follow-cta .cta-links a.cta-primary {
    background: var(--primary);
    color: white;
}

.follow-cta .cta-links a.cta-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.follow-cta .cta-links a.cta-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
}

.follow-cta .cta-links a.cta-secondary:hover {
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .blog-container,
    .post-container {
        padding: calc(var(--nav-height) + 2rem) 1.5rem 3rem;
    }
    
    .blog-header h1,
    .post-header h1 {
        font-size: 1.75rem;
    }
    
    .post-content {
        font-size: 1rem;
    }

    .post-card {
        padding: 1.25rem;
    }
}
