/* ========================================================================
   Custom CMS BSG - Unified Modern Corporate Theme
   Palette:
   - Primary Corporate Navy: #01468b
   - Hover Navy: #025bb5
   - Header Gradient: linear-gradient(135deg, #01468b 0%, #002d5a 100%)
   - Accent Amber/Gold: #f59e0b
   - Page Outer Margin: #ebebeb
   - Main Body BG: #f8fafc (Unified clean slate background for all sections)
   - Card Background: #ffffff
   - Card Border: 1px solid #e2e8f0
   - Card Shadow: 0 4px 15px rgba(1, 70, 139, 0.06)
   ======================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,400;1,600&display=swap');

/* --- GLOBAL BODY & OUTER BACKGROUND --- */
body {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    color: #475569;
    background-color: #ebebeb;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* --- CENTERED BOXED SITE WRAPPER (1200px MAX WIDTH) --- */
.site-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Open Sans', sans-serif;
    color: #0f172a;
}

h1 { font-weight: 800; }
h2 { font-weight: 700; color: #01468b; }
h3, h4 { font-weight: 600; }
h5, h6 { font-weight: 600; }

a {
    color: #01468b;
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #025bb5;
}

/* --- HEADER BAR WITH LOGO & NAVIGATION (STICKY HEADER) --- */
.header-wrapper {
    /* background: linear-gradient(135deg, #01468b 0%, #002d5a 100%); */
    background-color: #01468b;
    color: #ffffff;
    padding: 0;
    margin-bottom: 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-wrapper.is-sticky {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    z-index: 99999;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    animation: stickySlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes stickySlideDown {
    from { transform: translate(-50%, -100%); }
    to { transform: translate(-50%, 0); }
}

.header-placeholder {
    display: none;
}

.header-wrapper.is-sticky + .header-placeholder {
    display: block;
}

.logo-container img {
    max-height: 52px;
    height: auto;
    transition: transform 0.2s ease;
}

.logo-container img:hover {
    transform: scale(1.02);
}

/* --- MAIN MENU NAVIGATION --- */
.main-nav {
    background: transparent;
    padding: 0;
}

.main-nav .nav-link {
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 18px 12px !important;
    line-height: 30px;
    white-space: nowrap !important;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: 3px solid transparent;
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border-bottom-color: #f59e0b !important;
}

/* --- HERO SLIDER BANNER --- */
#sp-section-4 {
    background-color: #f8fafc;
    padding: 20px 20px 10px 20px;
}

.hero-slider-container {
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(1, 70, 139, 0.08);
}

.hero-slider-container img {
    width: 100%;
    height: 350px !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block;
    border-radius: 8px;
}

/* --- UNIFIED MAIN BODY CONTAINER --- */
.main-body-container {
    background-color: #f8fafc;
    padding-top: 25px;
    padding-bottom: 40px;
    flex: 1;
}

/* --- UNIFIED CENTER CONTENT COLUMN (#sp-component) --- */
#sp-component {
    background-color: #ffffff;
    padding: 28px 32px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(1, 70, 139, 0.05);
}

.entry-header h2,
#sp-component .entry-header h2 {
    color: #01468b;
    font-size: 22px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 18px;
    padding-left: 12px;
    border-left: 4px solid #01468b;
    line-height: 1.3;
}

/* --- CATEGORY VIEW UNIFICATION --- */
.category-view #sp-component {
    background-color: transparent !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.category-header-title {
    background-color: #ffffff;
    padding: 20px 28px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(1, 70, 139, 0.05);
}

.category-header-title h2 {
    color: #01468b;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    padding-left: 12px;
    border-left: 4px solid #01468b;
}

.article-item {
    background-color: #ffffff;
    padding: 28px 32px;
    border-radius: 10px;
    margin-top: 0;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(1, 70, 139, 0.05);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-item:last-child {
    margin-bottom: 0;
}

.article-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(1, 70, 139, 0.10);
}

.article-item .entry-header h2 {
    padding-left: 0 !important;
    border-left: none !important;
}

.article-item .entry-header h2 a {
    color: #01468b;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-item .entry-header h2 a:hover {
    color: #025bb5;
}

.article-date-badge {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
}

.article-date-badge i {
    color: #f59e0b;
}

.article-body-text {
    font-size: 14px;
    line-height: 1.75;
    color: #334155;
}

.article-body-text h5,
.article-body-text table {
    margin-left: 0 !important;
}

.article-body-text img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Standard article images */
.article-body-text img:not(.image-transition) {
    max-width: 100%;
    height: auto !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    display: inline-block;
}

/* Image transition class SPECIFIC to homepage service links */
.article-body-text a:has(img.image-transition) {
    display: inline-block !important;
    width: 48% !important;
    max-width: 260px !important;
    margin-right: 1.5% !important;
    margin-bottom: 15px !important;
    vertical-align: top !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

.article-body-text img.image-transition {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 270 / 198 !important;
    object-fit: cover !important;
    border-radius: 6px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.article-body-text a:hover img.image-transition {
    transform: scale(1.05) !important;
    box-shadow: 0 10px 25px rgba(1, 70, 139, 0.18) !important;
    z-index: 5;
    position: relative;
}

/* Article Image Gallery / Side-by-Side Images */
.article-image-gallery {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 16px !important;
    margin: 24px 0 !important;
    justify-content: center !important;
    align-items: stretch !important;
}

.article-image-gallery img {
    flex: 1 1 50% !important;
    width: 50% !important;
    max-width: 50% !important;
    height: 195px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.article-image-gallery img:hover {
    transform: scale(1.03) !important;
    box-shadow: 0 8px 24px rgba(1, 70, 139, 0.18) !important;
}



/* 2x2 Grid Service Buttons (Chi Siamo page) */
.service-btn-card {
    display: block;
    width: 100%;
    padding: 14px 12px;
    text-align: center;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 14px;
    border-radius: 6px;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.service-btn-card:hover {
    transform: translateY(-2px);
    opacity: 0.94;
    color: #ffffff !important;
}

.btn-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #ffffff;
    color: #01468b;
    border: 1.5px solid #01468b;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 18px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-readmore:hover {
    background-color: #01468b;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 70, 139, 0.25);
}

/* --- SIDEBAR MODULES & CARDS (UNIFIED MODERN STYLE) --- */
.sidebar-title {
    position: relative;
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #01468b;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.sidebar-title i {
    color: #f59e0b;
    font-size: 18px;
}

.search-box input {
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 14px;
    width: 100%;
    font-size: 14px;
    box-shadow: none;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.search-box input:focus {
    border-color: #01468b;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(1, 70, 139, 0.12) !important;
}

/* Unified Card Styling for Left News & Right Service Modules */
.div_lnd_intro,
.right-sidebar-card {
    clear: both;
    margin-bottom: 16px;
}

.lnd_head {
    margin-bottom: 6px;
}

.lnd_head a.lndtitle {
    font-size: 14px;
    line-height: 1.35;
    color: #01468b;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}

.lnd_head a.lndtitle:hover {
    color: #025bb5;
}

.lnd_introdate {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
}

/* Modern Unified Card Component for Sidebar Items */
.lnd_introtxt {
    font-size: 13px;
    line-height: 1.55;
    color: #475569 !important;
    padding: 14px 16px;
    background-color: #ffffff !important;
    border-radius: 8px;
    border: 1px solid #e2e8f0 !important;
    border-left: 4px solid #01468b !important;
    box-shadow: 0 2px 8px rgba(1, 70, 139, 0.04);
    margin: 6px 0;
    text-shadow: none !important;
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.lnd_introtxt:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(1, 70, 139, 0.10);
    border-left-color: #f59e0b !important;
}

.lnd_introtxt img {
    float: left;
    margin: 0 12px 6px 0;
    border-radius: 6px;
    background-color: transparent;
    width: 60px;
    height: 60px;
    object-fit: cover;
}

/* Remove old mismatched row colors for uniform visual harmony */
.lastnews_row_1,
.lastnews_row_2,
.lastnews_row_3 {
    background-color: #ffffff !important;
}

.clrfix {
    clear: both;
}

/* --- CONSOCIATI FOOTER BANNER --- */
.footer-banner {
    background-color: #ffffff;
    padding: 25px 15px;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.footer-banner .logo-col {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
}

.footer-banner img {
    max-height: 75px;
    width: auto;
    filter: grayscale(15%);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.footer-banner img:hover {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* --- BOTTOM COPYRIGHT FOOTER --- */
.footer-bottom {
    background: linear-gradient(135deg, #01468b 0%, #002d5a 100%);
    color: #ffffff;
    padding: 18px 20px;
    font-size: 12px;
    text-align: center;
}

.footer-bottom a {
    color: #f59e0b;
    text-decoration: none;
    font-weight: 600;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* --- BOOTSTRAP PAGINATION --- */
.pagination {
    gap: 4px;
}

.pagination > li > a,
.pagination > li > span {
    color: #01468b;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 14px;
    font-weight: 600;
    background-color: #ffffff;
}

.pagination > li > a:hover,
.pagination > li > a:focus {
    background: #01468b !important;
    color: #ffffff !important;
    border-color: #01468b !important;
}

.pagination > .active > a,
.pagination > .active > span {
    background: #01468b !important;
    color: #ffffff !important;
    border-color: #01468b !important;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 991px) {
    .site-wrapper {
        box-shadow: none;
        margin: 0;
    }
    .main-nav .nav-link {
        padding: 10px 15px !important;
        line-height: normal;
    }
    .footer-banner img {
        max-height: 50px;
    }
}
