/* Stili principali ereditati dal portale */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.5rem;
    border: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Stili per la navigazione */
.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: calc(100% - 2rem);
    left: 1rem;
}

/* Stili specifici per WordPress */
.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.wp-block-image img {
    max-width: 100%;
    height: auto;
}

/* Stili per la paginazione */
.pagination .page-numbers {
    margin: 0 5px;
}

.pagination .current {
    font-weight: bold;
}


/* ==============================================
   Single Article Styles
   ============================================== */

.article-full {
    background: #fff;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.article-featured-image {
    overflow: hidden;
    border-radius: 0.5rem;
}

.article-content {
    line-height: 1.8;
}

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

.article-content iframe {
    max-width: 100%;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
}

.article-content blockquote {
    border-left: 4px solid var(--bs-primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--bs-gray-600);
}

.article-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

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

.article-content table th,
.article-content table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

.article-content table th {
    background-color: #f8f9fa;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-cloud a {
    display: inline-block;
    background-color: #f8f9fa;
    padding: 0.35rem 0.75rem;
    border-radius: 50rem;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag-cloud a:hover {
    background-color: var(--bs-primary);
    color: white;
}

.article-navigation a {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.article-navigation a:hover {
    background-color: #f8f9fa;
}

/* Commenti */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.comment-author {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.comment-author img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 1rem;
}

.comment-meta {
    font-size: 0.875rem;
    color: var(--bs-gray-600);
}

.comment-reply-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.comment-respond {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .article-full {
        padding: 1.5rem;
    }
    
    .article-content {
        font-size: 0.9375rem;
    }
}

/* Sidebar Styles */
.sidebar .widget {
    margin-bottom: 1.5rem;
}

.sidebar .card {
    border: none;
    border-radius: 0.5rem;
}

.sidebar .card-header {
    background-color: var(--bs-primary);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

.sidebar ul {
    list-style: none;
    padding-left: 0;
}

.sidebar li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.sidebar li:last-child {
    border-bottom: none;
}

.sidebar a {
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar a:hover {
    color: var(--bs-primary);
}

.sidebar.sticky-top {
    position: sticky;
    z-index: 1019; /* Sotto il dropdown */
    top: 20px;
    height: fit-content;
    overflow-y: auto;
}

/* ==============================================
   Fix Menu Dropdown vs Sidebar
   ============================================== */

/* Rimuovi sticky-top dalla sidebar */
.sidebar {
    position: static; /* Rimuove il posizionamento sticky */
    z-index: auto;
    top: auto;
}

/* Se vuoi mantenere la sidebar sticky solo su desktop */
@media (min-width: 992px) {
    .sidebar-sticky-wrapper {
        position: sticky;
        top: 20px;
        height: 100vh;
        overflow-y: auto;
    }
    
    .sidebar {
        position: relative;
        z-index: 1; /* Valore basso */
    }
}

.navbar {
    position: relative;
    z-index: 1030; /* Valore originale di Bootstrap */
}

.dropdown-menu {
    z-index: 1040 !important; /* Sopra la navbar */
    position: absolute;
    margin-top: 0;
    border: 1px solid rgba(0,0,0,.15);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Fix per mobile */
@media (max-width: 991.98px) {
    .navbar-collapse {
        position: static;
    }
    
    .dropdown-menu {
        position: static;
        margin-top: 0.5rem;
        box-shadow: none;
    }
}

/* Stile specifico per i badge delle categorie */
.category-badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

.category-badge .category-link {
    color: white !important;
    text-decoration: none;
    display: inline-block;
}

.category-badge .category-link:hover {
    opacity: 0.9;
}
