/* ==========================================================================
   Scribano Blog — Shared styles (listing + article + 404)
   Extracted from inline <style> blocks to reduce template size and enable
   browser caching across pages.
   ========================================================================== */

/* --- Listing hero --- */
.listing-hero {
    padding: 60px 0 40px;
    text-align: center;
}
.listing-hero h1 {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    margin-bottom: 12px;
}
.listing-hero p {
    font-size: 18px;
    color: var(--t3);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Listing layout: sidebar + grid --- */
.listing-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    padding-bottom: 60px;
}

/* --- Sidebar filters --- */
.sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}
.sidebar h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--t4);
    margin-bottom: 12px;
    font-weight: 600;
}
.sidebar ul { list-style: none; margin-bottom: 32px; }
.sidebar li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--t3);
    transition: all .2s;
}
.sidebar li a:hover { background: var(--surface2); color: var(--t1); }
.sidebar li a.active { background: var(--surface3); color: var(--accent); font-weight: 600; }
.filter-clear {
    display: inline-block;
    font-size: 13px;
    color: var(--p2);
    margin-bottom: 16px;
}

/* Tag pills */
.tag-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.tag-pill {
    padding: 4px 14px;
    border-radius: 100px;
    border: 1px solid var(--border2);
    font-size: 13px;
    color: var(--t3);
    transition: all .2s;
}
.tag-pill:hover { border-color: var(--p2); color: var(--t1); }
.tag-pill.active { background: var(--p1); border-color: var(--p1); color: #fff; }

/* Language toggle */
.lang-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
}
.lang-toggle a {
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border2);
    color: var(--t3);
}
.lang-toggle a.active {
    background: var(--p1);
    border-color: var(--p1);
    color: #fff;
}

/* --- Article cards grid --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.article-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .3s, box-shadow .3s, border-color .3s;
}
.article-card:hover {
    transform: translateY(-4px);
    border-color: var(--border2);
    box-shadow: 0 12px 40px rgba(108,92,231,.15);
}

.card-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--bg3), var(--bg2));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-image-placeholder {
    font-size: 48px;
    opacity: .15;
}

.card-body { padding: 20px; }

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--t4);
}
.card-category {
    padding: 3px 10px;
    border-radius: 100px;
    background: rgba(108,92,231,.15);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.card-type {
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid var(--border2);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.card-body h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-body h2 a { color: var(--t1); }
.card-body h2 a:hover { color: var(--accent); }

.card-excerpt {
    font-size: 14px;
    color: var(--t3);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--t4);
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--t4);
}
.empty-state h2 { font-size: 24px; margin-bottom: 12px; color: var(--t3); }

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}
.pagination a, .pagination span {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
}
.pagination a {
    background: var(--surface2);
    color: var(--t2);
    transition: all .2s;
}
.pagination a:hover { background: var(--surface3); color: var(--t1); }
.pagination .current {
    background: var(--p1);
    color: #fff;
}
.pagination .disabled {
    color: var(--t4);
    pointer-events: none;
}

/* --- Article detail --- */
.article-header {
    max-width: 780px;
    margin: 0 auto;
    padding: 48px 0 32px;
}
.article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--t4);
    margin-bottom: 24px;
}
.article-breadcrumb a { color: var(--t3); }

.article-header h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}
.article-subtitle {
    font-size: 20px;
    color: var(--t3);
    margin-bottom: 20px;
    line-height: 1.5;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--t4);
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.article-meta-author { font-weight: 600; color: var(--t2); }
.article-meta-dot { color: var(--t4); }
.article-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}
.article-badge {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.badge-category { background: rgba(108,92,231,.15); color: var(--accent); }
.badge-type { border: 1px solid var(--border2); color: var(--t4); }

/* Language switch banner */
.lang-banner {
    max-width: 780px;
    margin: 0 auto 24px;
    padding: 12px 20px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--t3);
    display: flex;
    align-items: center;
    gap: 12px;
}
.lang-banner a {
    font-weight: 600;
    color: var(--accent);
}

/* Featured image */
.article-featured-image {
    max-width: 900px;
    margin: 0 auto 32px;
    border-radius: var(--radius);
    overflow: hidden;
    /* Reserve space for image to prevent CLS */
    aspect-ratio: 16 / 9;
}
.article-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Article body */
.article-body {
    max-width: 780px;
    margin: 0 auto;
    padding-bottom: 48px;
}
.article-body h2 {
    font-size: 26px;
    margin: 40px 0 16px;
    padding-top: 16px;
}
.article-body h3 {
    font-size: 20px;
    margin: 32px 0 12px;
}
.article-body p {
    margin-bottom: 16px;
    font-size: 17px;
    line-height: 1.8;
}
.article-body ul, .article-body ol {
    margin: 0 0 16px 24px;
    font-size: 17px;
    line-height: 1.8;
}
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 3px solid var(--p1);
    background: var(--surface);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--t3);
}
.article-body code {
    background: var(--surface2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 15px;
}
.article-body pre {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
}
.article-body pre code {
    background: none;
    padding: 0;
}
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}
.article-body th, .article-body td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.article-body th {
    background: var(--surface2);
    font-weight: 600;
    color: var(--t1);
}
.article-body img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--accent2); }
.article-body strong { color: var(--t1); }

/* Share + CTA footer */
.article-footer {
    max-width: 780px;
    margin: 0 auto;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.share-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}
.share-row span { font-size: 14px; color: var(--t4); font-weight: 500; }
.share-btn {
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid var(--border2);
    font-size: 13px;
    color: var(--t3);
    transition: all .2s;
    cursor: pointer;
    background: none;
}
.share-btn:hover { border-color: var(--p2); color: var(--t1); background: var(--surface); }

/* CTA banner */
.article-cta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    margin-bottom: 48px;
}
.article-cta h3 {
    font-size: 24px;
    margin-bottom: 12px;
}
.article-cta p {
    color: var(--t3);
    margin-bottom: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.article-cta .cta-btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 100px;
    background: var(--grad);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    transition: transform .2s, box-shadow .2s;
}
.article-cta .cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(168,85,247,.4);
}

/* Related articles */
.related-section {
    max-width: 1000px;
    margin: 0 auto;
    padding-bottom: 60px;
}
.related-section h2 {
    font-size: 24px;
    margin-bottom: 24px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.related-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: transform .2s, border-color .2s;
}
.related-card:hover {
    transform: translateY(-3px);
    border-color: var(--border2);
}
.related-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    line-height: 1.4;
}
.related-card h3 a { color: var(--t1); }
.related-card h3 a:hover { color: var(--accent); }
.related-card p {
    font-size: 14px;
    color: var(--t3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-card .related-meta {
    font-size: 12px;
    color: var(--t4);
    margin-top: 12px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .listing-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
    }
    .sidebar > div { flex: 1; min-width: 200px; }
}

@media (max-width: 768px) {
    .article-header { padding: 32px 0 24px; }
    .article-body p, .article-body li { font-size: 16px; }
    .article-cta { padding: 28px 20px; }
}

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