﻿/* =================================================================
   STILI CSS PER PAGINA SEGNALETICA / BLOG - CARTELLI.IT
   ================================================================= */

/* -----------------------------------------------------------------
   0. VARIABILI ROOT & BASE UTILITY
   ----------------------------------------------------------------- */
:root {
    --cs-primary: #2e7d32;        
    --cs-primary-dark: #1b5e20;
    --cs-primary-light: #e8f5e9;
    --cs-dark: #666666;
    --cs-grey-bg: #f8f9fa;
    --cs-border: #e0e0e0;
    --cs-border-hover: #999999;
    --cs-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --cs-shadow-lg: 0 12px 20px -5px rgba(0, 0, 0, 0.08);
    --cs-radius: 0px;
    --cs-text-color: #666666;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* -----------------------------------------------------------------
   1. LAYOUT GENERALE
   ----------------------------------------------------------------- */
.cs-container {
    color: var(--cs-text-color);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px 10px 25px;
    line-height: 1.6;
    box-sizing: border-box;
}

.cs-container *, 
.cs-container *::before, 
.cs-container *::after {
    box-sizing: border-box;
}

.cs-section {
    margin-bottom: 5px;
}

.cs-section-title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: #666666;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 0;
}

.cs-responsive-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* -----------------------------------------------------------------
   2. HERO BLOCK
   ----------------------------------------------------------------- */
.cs-about-alternate {
    background-color: #ffffff;
    padding: 0 0 5px 0;
}

.cs-hero-block {
    margin-top: 0;
    margin-bottom: 20px;
    width: 100%;
}

.cs-hero-img-wrapper {
    width: 100%;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--cs-border);
    border-radius: 0 !important;
    margin-bottom: 25px;
}

.cs-hero-img-wrapper .cs-responsive-img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.cs-hero-title {
    font-size: 32px !important;
}

.cs-hero-content {
    text-align: left;
}

.cs-hero-content p {
    font-size: 15px;
    color: var(--cs-text-color);
    line-height: 1.7;
    margin-bottom: 0;
}

.cs-hero-content p:last-child {
    margin-bottom: 0;
}

.cs-row-title {
    font-size: 22px;
    font-weight: 700;
    color: #666666;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: left;
}

/* -----------------------------------------------------------------
   3. CARDS CLICCABILI (Spaziatura Aumentata tra Immagine e Testo)
   ----------------------------------------------------------------- */
#settore-wrapper {
    width: 100%;
    display: block;
    clear: both;
}

.filtro-wrapper {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.cards-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 0.5rem 0;
    margin: 0.5rem auto 1rem auto;
    max-width: 1200px;
    width: 100%;
}

.card {
    border: 1px solid var(--cs-border) !important;
    width: 100%;
    max-width: 100% !important;
    overflow: hidden;
    margin: 0;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--cs-border-hover) !important;
    box-shadow: var(--cs-shadow-lg);
}

.card-body {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
    flex-grow: 1;
}

/* Immagine a filo bordo superiore/laterale e senza fondo grigio */
.card .img-wrapper {
    width: 100%;
    max-width: 100%;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0 !important;
    background-color: transparent;
}

.card .img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.card:hover .img-wrapper img {
    transform: scale(1.04);
}

/* Aumentato il margine superiore del testo (20px) per staccarlo dall'immagine */
.card .text-wrapper {
    width: 100%;
    padding: 30px 14px 0 14px !important;
    margin: 0 !important;
    max-width: 100% !important;
    text-align: left !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    box-sizing: border-box;
}

.card .text-wrapper h4 {
    margin: 0 0 0.5rem 0 !important;
    text-align: left !important;
    font-size: 0.95rem;
    font-weight: 700;
    color: #666666; 
    line-height: 1.25;
}

.card .text-wrapper p {
    margin: 0 !important;
    font-size: 0.88rem;
    line-height: 1.4;
    color: #666666;
    flex-grow: 1;
    text-align: left !important;
}

/* Footer Card "Dettagli" */
.card .card-footer {
    padding: 12px 14px 14px 14px;
    margin-top: auto;
    font-size: 0.9rem !important;
    font-weight: 600;
    color: #666666;
    display: flex;
    align-items: center;
    gap: 4px;
    text-align: left;
    transition: color 0.2s ease;
}

.card:hover .card-footer {
    color: #333333;
}

.card .card-footer i {
    color: #4caf50;
}

/* -----------------------------------------------------------------
   4. MEDIA QUERIES & RESPONSIVE
   ----------------------------------------------------------------- */
@media only screen and (max-width: 1050px) {
    .cards-wrapper {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media only screen and (max-width: 768px) {
    .cs-container {
        padding: 0 15px 10px 15px !important;
    }

    .cs-hero-title,
    .cs-row-title {
        font-size: 20px !important;
        line-height: 1.35 !important;
        margin-bottom: 12px !important;
    }

    .cards-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media only screen and (max-width: 576px) {
    #settore-wrapper {
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box;
    }

    .cards-wrapper {
        grid-template-columns: repeat(1, 1fr);
    }
}