/* Article page restyling */
body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f5f6fa;
    color: #2d3142;
}

.article-main {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    padding: 1.5rem 2rem 2rem;
    margin: 1.5rem 0;
}

.article-main .breadcrumb {
    background: transparent;
    padding-left: 0;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.article-title {
    font-weight: 800;
    font-size: 2.3rem;
    line-height: 1.2;
    color: #1f2333;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.2rem;
    align-items: center;
    padding: .8rem 0;
    margin: 1rem 0 1.5rem;
    border-top: 1px solid #e6e8f0;
    border-bottom: 1px solid #e6e8f0;
    color: #6b7189;
    font-size: .92rem;
}
.article-meta i {
    color: #007bff;
    margin-right: .3rem;
}
.article-meta .article-author {
    font-weight: 800;
    color: #1f2333;
}

.article-cover {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
}

#testoArticolo {
    margin-top: 1.8rem;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: left;
    overflow-wrap: break-word;
}
#testoArticolo img,
#testoArticolo iframe,
#testoArticolo video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}
#testoArticolo p:first-of-type::first-letter {
    font-size: 3rem;
    font-weight: 800;
    float: left;
    line-height: 1;
    padding-right: .5rem;
    color: #007bff;
}

.article-signature {
    text-align: right;
    font-weight: 800;
    color: #1f2333;
}

.article-section-title {
    display: flex;
    align-items: center;
    margin: 2rem 0 1.2rem;
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.article-section-title::before {
    content: "";
    width: 6px;
    height: 1.5rem;
    margin-right: .7rem;
    border-radius: 3px;
    background: var(--section-color, #007bff);
}
.article-section-title.warning { --section-color: #f0ad00; }

/* Gallery */
.gallery-grid .pop {
    margin-bottom: 1rem;
}
.gallery-grid .img-thumbnail {
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    transition: transform .25s ease, box-shadow .25s ease;
}
.gallery-grid .img-thumbnail:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
}

/* Cards and sidebar */
.article-page .card {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}
.article-page .related-card {
    transition: transform .25s ease, box-shadow .25s ease;
}
.article-page .related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .16);
}
.article-page .card-footer {
    background: #fff;
    border-top: 0;
}
.article-page .btn {
    border-radius: 50rem;
    font-weight: 700;
}
.article-page .card-header {
    background: #007bff;
    color: #fff;
    font-weight: 800;
    border: 0;
}
.sidebar-item {
    padding: .8rem 0;
}
.sidebar-item h6 {
    font-weight: 800;
}
.sidebar-item img {
    border-radius: 8px;
}
.article-sidebar {
    position: sticky;
    top: 1rem;
}

@media (max-width: 767.98px) {
    .article-main { padding: 1rem; }
    .article-title { font-size: 1.6rem; }
    #testoArticolo { font-size: 1rem; }
    .article-sidebar { position: static; }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-grid .img-thumbnail, .article-page .related-card { transition: none; }
}
