/* Variabili Colori e Font */
:root {
    --primary-color: #0056a6;
    /* Blu Unipa/Istituzionale */
    --secondary-color: #cf142b;
    /* Rosso accento (opzionale) */
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --card-bg: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

/* Enforce Primary Color on Bootstrap classes */
.text-primary {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover {
    background-color: #004485 !important;
    /* A slightly darker shade for hover */
    border-color: #004485 !important;
}

.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

body {
    font-family: 'Segoe UI', Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
    min-height: 100Vh;
    display: flex;
    flex-direction: column;
}

/* --- Header e Brand --- */
header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    /* border-bottom: 1px solid #eaeaea; */
    margin-bottom: 0.5rem;
}

/* Gestione Loghi Responsive */
.brand-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    justify-content: space-between;
}

.logo-img {
    height: 60px;
    width: auto;
    transition: transform 0.3s ease;
}

.brand-text {
    text-align: center;
    flex-grow: 1;
}

.site-title {
    font-weight: 700;
    font-size: 1.8rem;
    color: #0056ae;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.sub-title {
    color: #0056ae;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Navbar Bootstrap Customization --- */
.navbar-custom {
    background-color: #0056ae;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--card-bg) !important;
}

.navbar-custom .nav-link {
    color: #fff !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.2s, background-color 0.2s;
    border-radius: 5px;
}

/* .navbar-custom .nav-link:hover, 
.navbar-custom {
    color: var(--primary-color);
    background-color: #fff;
} */

.nav-link.active {
    color: var(--primary-color);
    background-color: #013e89;
}

/* --- Hero & Cards --- */
.hero-section {
    margin-bottom: 2rem;
}

.custom-card {
    background: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: transform 0.2s ease;
}

.custom-card h3 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--secondary-color);
    padding-left: 1rem;
}

/* --- Accordion Styling --- */
.accordion-item {
    border: none;
    border-radius: var(--radius) !important;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.accordion-button {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
    background-color: #fff;
    padding: 1.25rem;
}

.accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background-color: #eef6ff;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .125);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0, 0, 0, .125);
}

.accordion-body {
    background-color: #fff;
    padding: 1.5rem 2rem;
}

/* Liste dentro l'accordion */
.accordion-body ul {
    list-style: none;
    padding-left: 0;
}

.accordion-body ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.accordion-body ul li::before {
    content: "•";
    color: var(--secondary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 1.2em;
    line-height: 1;
}

/* Sottotitoli nelle liste */
.list-category {
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* --- Footer --- */
footer {
    margin-top: auto;
    padding: 2rem 0;
    background-color: var(--primary-color);
    color: #ccc;
    font-size: 0.9rem;
}

footer strong {
    color: #fff;
    display: block;
    margin-bottom: 0.5rem;
}

footer a {
    color: #fff;
    text-decoration: underline;
    opacity: 0.8;
}

footer a:hover {
    opacity: 1;
}

/* --- News & Eventi Dropdown --- */
.dropdown-menu-news {
    min-width: 360px;
    max-width: 420px;
    padding: 0.5rem 0;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-item {
    display: flex !important;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    white-space: normal;
    transition: background-color 0.2s ease;
}

.news-item:hover {
    background-color: #eef6ff;
}

.news-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.news-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.news-item-title {
    color: var(--primary-color);
    font-size: 0.9rem;
    line-height: 1.3;
}

.news-item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.news-item-date {
    font-size: 0.75rem;
    color: var(--primary-color);
    opacity: 0.7;
    margin-top: 2px;
}

.dropdown-menu-news .dropdown-divider {
    margin: 0.25rem 0;
    border-color: #eaeaea;
}

/* Navbar dropdown toggle override */
.navbar-custom .dropdown-toggle::after {
    margin-left: 0.35em;
}

/* --- Media Queries --- */
@media (max-width: 992px) {
    .site-title {
        font-size: 1.4rem;
    }

    .logo-img {
        height: 50px;
    }
}

@media (max-width: 768px) {
    .brand-container {
        flex-direction: column;
        gap: 1rem;
    }

    .site-title {
        font-size: 1.5rem;
    }

    .header-top {
        border-bottom: none;
    }

    /* Su mobile il menu diventa standard bootstrap collapsed */
    .navbar-custom {
        padding: 0.5rem;
    }
}