/* 
  CRUVIA BLOG STYLES
  Premium Grid & Article Layout
*/

.blog-hero {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    text-align: center;
    border-bottom: 1px solid var(--navbar-border);
}

.blog-title {
    font-size: 3.5rem;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Bento Grid Archive */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-top: 4rem;
}

@media (min-width: 992px) {
    .blog-layout {
        grid-template-columns: 1fr 340px;
    }
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Premium Article Card */
.article-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.article-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.article-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    position: relative;
}

.article-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.08);
}

.article-badge {
    position: absolute;
    top: 1rem; left: 1rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.article-body {
    padding: 1.5rem;
}

.article-meta {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 1rem;
}

.article-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-title a { color: #0f172a; }
.article-title a:hover { color: var(--primary-color); }

.article-excerpt {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Single Article Layout */
.single-article-header {
    max-width: 900px;
    margin: 0 auto 3rem;
    text-align: center;
}

.single-featured-image {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    border-radius: 32px;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
}

.article-entry-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    color: #334155;
}

/* Restored Social Share Box (Gray Design) */
.share-box-gray {
    margin-top: 4rem;
    padding: 2.5rem;
    border-radius: 24px;
    background: #f1f5f9; /* Original gray background */
    text-align: center;
    border: 1px solid #e2e8f0;
}

.share-box-gray h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #0f172a;
    font-weight: 700;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.social-btn-dark {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #1e293b; /* Navy / Dark style as requested */
    color: white !important;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-btn-dark:hover {
    background: #0f172a;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.social-btn-dark .cruvai-svg-icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: white !important;
}

.article-entry-content h2 { margin-top: 2.5rem; font-size: 2rem; }
.article-entry-content h3 { margin-top: 2rem; font-size: 1.5rem; }
.article-entry-content p { margin-bottom: 1.5rem; line-height: 1.8; }

/* Sidebar Premium */
.sidebar {
    display: flex; flex-direction: column; gap: 2rem;
}

.widget {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.03);
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.widget-title::after {
    content: '';
    position: absolute; bottom: 0; left: 0;
    width: 40px; height: 3px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* Tool CTAs Premium Styling */
.widget-cta-tool {
    text-align: center;
    border: none;
    background: white;
    position: relative;
    padding: 1.25rem;
    z-index: 1;
}

.widget-cta-tool::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: var(--primary-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
}

.cta-icon .cruvai-svg-icon-cta {
    width: 2.2rem;
    height: 2.2rem;
    margin-bottom: 0.5rem;
}

.widget-cta-tool p {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Sidebar Wrapper (Natural Scroll) */
.sidebar-sticky-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.widget-toc {
    /* Rimosso sticky da qui per usare il wrapper */
}

/* Scroll-Spy Active State */
.toc-list a.active {
    color: var(--primary-color);
    font-weight: 700;
    padding-left: 8px;
    border-left: 3px solid var(--accent-color);
}

.toc-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 0.75rem;
}

.toc-list a {
    color: #475569;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: block;
    padding: 4px 0;
}

.toc-list a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

/* In-Content Table of Contents (Premium Card) */
.cruvai-in-content-toc {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 2rem;
    margin: 2.5rem 0;
    box-shadow: var(--shadow-sm);
}

.cruvai-in-content-toc .toc-header {
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.cruvai-in-content-toc .widget-title {
    margin-bottom: 0;
    font-size: 1.25rem;
}

.cruvai-in-content-toc .toc-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.cruvai-in-content-toc .toc-body li {
    font-size: 0.95rem;
    color: #475569;
}

.cruvai-in-content-toc .toc-body a {
    color: #334155;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cruvai-in-content-toc .toc-body a::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--accent-color);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z'/%3E%3C/svg%3E") no-repeat center / contain;
    flex-shrink: 0;
}

.cruvai-in-content-toc .toc-body a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Category Chips */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    padding: 6px 14px;
    background: #f1f5f9;
    border-radius: 99px;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

.chip:hover {
    background: var(--primary-gradient);
    color: white;
}
