/* ==========================================
   BLOG STYLES
   File: /assets/css/blog.css
   ========================================== */

/* ==========================================
   BLOG HERO
   ========================================== */
.blog-hero {
    padding: 80px 0 40px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fc 0%, #e8f4f8 100%);
}

.page-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.page-title.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================
   BLOG LIST
   ========================================== */
.blog-list {
    padding: 60px 0 80px;
    background: #fff;
}

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

/* ==========================================
   POST CARD (Lista blog)
   ========================================== */
.post-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.post-card .post-image {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f1f5f9;
}

.post-card .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-card .post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card .post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.post-card .post-date {
    font-size: 0.875rem;
    color: #64748b;
}

.post-card .post-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 0.75rem 0;
}

.post-card .post-title a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-card .post-title a:hover {
    color: #667eea;
}

.post-card .post-excerpt {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

/* ==========================================
   POST SINGLE (Articolo singolo)
   ========================================== */
.post-single {
    background: #fff;
}

.post-header {
    padding: 80px 0 40px;
    background: linear-gradient(135deg, #f8f9fc 0%, #e8f4f8 100%);
}

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

.post-single .post-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.2;
    margin: 0 0 1.5rem 0;
}

.post-meta-full {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-info .post-date {
    font-size: 0.95rem;
    color: #64748b;
}

.featured-image {
    margin-top: 2rem;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   POST BODY
   ========================================== */
.post-body {
    padding: 60px 0 80px;
}

/* ==========================================
   MARKDOWN CONTENT
   ========================================== */
.markdown-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #374151;
}

.markdown-content h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 2.5rem 0 1rem 0;
    line-height: 1.3;
}

.markdown-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 2rem 0 1rem 0;
    line-height: 1.3;
}

.markdown-content h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 1.75rem 0 0.75rem 0;
}

.markdown-content h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 1.5rem 0 0.5rem 0;
}

.markdown-content p {
    margin: 0 0 1.5rem 0;
}

.markdown-content a {
    color: #667eea;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.markdown-content a:hover {
    color: #764ba2;
}

.markdown-content strong {
    font-weight: 700;
    color: #1a1a2e;
}

.markdown-content em {
    font-style: italic;
}

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

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

.markdown-content li::marker {
    color: #667eea;
}

.markdown-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #667eea;
    background: #f8f9fc;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4a5568;
}

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

.markdown-content code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    background: #f1f5f9;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: #e11d48;
}

.markdown-content pre {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: #1a1a2e;
    border-radius: 12px;
    overflow-x: auto;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.6;
}

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

.markdown-content hr {
    border: none;
    height: 1px;
    background: #e2e8f0;
    margin: 2.5rem 0;
}

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

.markdown-content th,
.markdown-content td {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.markdown-content th {
    background: #f8f9fc;
    font-weight: 700;
    color: #1a1a2e;
}

.markdown-content tr:nth-child(even) {
    background: #fafafa;
}

/* ==========================================
   POST FOOTER
   ========================================== */
.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #764ba2;
}

/* ==========================================
   TAGS (se presenti)
   ========================================== */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.post-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.post-tag:hover {
    background: #667eea;
    color: white;
}

/* ==========================================
   EMPTY STATE
   ========================================== */
.blog-empty {
    text-align: center;
    padding: 80px 20px;
    color: #64748b;
}

.blog-empty h3 {
    font-size: 1.5rem;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.blog-empty p {
    margin: 0;
}

/* ==========================================
   PAGINATION
   ========================================== */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.blog-pagination a,
.blog-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.blog-pagination a {
    color: #64748b;
    background: #f1f5f9;
}

.blog-pagination a:hover {
    background: #667eea;
    color: white;
}

.blog-pagination span.current {
    background: #667eea;
    color: white;
}

.blog-pagination span.dots {
    background: transparent;
    color: #94a3b8;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .blog-hero {
        padding: 60px 0 30px;
    }

    .page-title {
        font-size: 2.25rem;
    }

    .page-subtitle {
        font-size: 1.1rem;
    }

    .blog-list {
        padding: 40px 0 60px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .post-header {
        padding: 60px 0 30px;
    }

    .post-single .post-title {
        font-size: 1.75rem;
    }

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

    .markdown-content {
        font-size: 1rem;
    }

    .markdown-content h1 {
        font-size: 1.5rem;
    }

    .markdown-content h2 {
        font-size: 1.375rem;
    }

    .markdown-content h3 {
        font-size: 1.125rem;
    }

    .markdown-content pre {
        padding: 1rem;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.875rem;
    }

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

    .container-narrow {
        padding: 0 1rem;
    }
}