/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Mooli:wght@400;500;600;700&family=Montserrat:wght@400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
    --ctg-accent: #11A3D2;
    --ctg-accent-light: rgba(17, 163, 210, 0.08);
    --ctg-gold: #C5BA90;
    --ctg-dark: #303A54;
    --ctg-text-gray: #64748B;
    --ctg-border: #E9ECEF;
    --ctg-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.04);
    --ctg-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* --- Main Layout --- */
.ctg-wrapper {
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 20px 0;
    flex-direction: row-reverse;
    /* Sidebar à droite */
}

/* ==========================================================================
   1. RESTAURATION DU STYLE ORIGINAL DU FILTRE
   ========================================================================== */

.ctg-filter-sidebar {
    width: 100%;
    max-width: 350px;
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    height: fit-content;
}

.filter-main-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 600;
    color: #000;
    border-bottom: 1px solid var(--ctg-border);
    padding-bottom: 20px;
}

.filter-accordion,
.filter-group {
    padding: 20px 0;
    border-bottom: 1px solid #D9D9D9;
}

.filter-group-title {
    display: block;
    color: #545F71;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18px;
    margin-bottom: 15px;
}

.filter-accordion-header {
    width: 100%;
    text-align: left;
    color: #434F6D;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-icon {
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236c757d'%3E%3Cpath d='M11.9997 13.1714L16.9495 8.22168L18.3637 9.63589L11.9997 15.9999L5.63574 9.63589L7.04996 8.22168L11.9997 13.1714Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    transition: transform 0.3s ease;
}

.filter-accordion-header:not(.active) .accordion-icon {
    transform: rotate(180deg);
}

.filter-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.filter-accordion-content.open {
    padding-top: 15px;
}

/* Bouton Appliquer (Style Tan Original) */
.ctg-filter-button {
    width: 100% !important;
    padding: 14px !important;
    border: 1px solid var(--ctg-gold) !important;
    border-radius: 50px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    background: transparent !important;
    color: var(--ctg-dark) !important;
    margin-top: 20px !important;
}

.ctg-filter-button:hover {
    background-color: var(--ctg-gold) !important;
    color: #fff !important;
}

/* ==========================================================================
   2. NOUVEAU STYLE "PREMIUM" POUR LA GRILLE ET LES CARTES
   ========================================================================== */

.ctg-grid-area {
    flex: 1;
    min-width: 60%;
    padding: 10px;
}

.ctg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 35px;
}

.ctg-card {
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: var(--ctg-shadow-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
        box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    position: relative;
}

/* Effet Hover Correct (Ne casse plus le design) */
.ctg-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--ctg-shadow-hover);
}

.ctg-card-image-container {
    height: 220px;
    background-color: #f0f0f0;
    overflow: hidden;
    position: relative;
}

.ctg-card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.ctg-card:hover .ctg-card-image-container img {
    transform: scale(1.1);
    /* Zoom de l'image uniquement */
}

.ctg-card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: #fff;
}

.ctg-card-title {
    margin: 0 0 12px 0;
    height: 84px;
    /* Aligne les titres sur 2 lignes */
    overflow: hidden;
}

.ctg-card-title a {
    color: #1A2B48;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.3s ease;
}

.ctg-card:hover .ctg-card-title a {
    color: var(--ctg-accent);
}

.ctg-card-description {
    color: var(--ctg-text-gray);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 25px;
    height: 62px;
    /* Aligne les descriptions sur 3 lignes */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* --- Footer & Badge Date --- */
.ctg-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #F1F5F9;
}

.ctg-card-date {
    background-color: var(--ctg-accent-light);
    color: var(--ctg-accent);
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ctg-card-date::before {
    content: '🗓';
    font-size: 14px;
}

.ctg-card-button {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--ctg-dark);
    text-decoration: none;
    padding: 8px 18px;
    border: 1.5px solid var(--ctg-gold);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.ctg-card-button:hover {
    background-color: var(--ctg-gold);
    color: #fff;
    transform: translateX(3px);
}

/* ==========================================================================
   3. PAGINATION & RESPONSIVE
   ========================================================================== */

.ctg-pagination-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.ctg-pagination-container .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ctg-pagination-container .page-numbers.current {
    background-color: var(--ctg-dark);
    color: #fff;
    border-color: var(--ctg-dark);
}

.btn-voir-plus {
    display: inline-inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 35px;
    background-color: #C5BA90;
    color: #fff;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-voir-plus .btn-arrow {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.btn-voir-plus:hover {
    background-color: #b5a97d;
    color: #fff;
    box-shadow: 0 4px 15px rgba(197, 186, 144, 0.3);
}

.btn-voir-plus:hover .btn-arrow {
    transform: translateX(5px);
}

@media (max-width: 1100px) {
    .ctg-wrapper {
        flex-direction: column;
    }

    .ctg-filter-sidebar {
        max-width: 100%;
        order: -1;
    }
}

@media (max-width: 768px) {
    .ctg-grid {
        grid-template-columns: 1fr;
    }

    .ctg-card-title {
        height: auto;
    }
}

/* ==========================================================================
   4. DESIGN MODERNE DES INPUTS & SELECTS (SIDEBAR FILTRES)
   ========================================================================== */

/* --- 1. Champs de Date & Selects --- */
.ctg-date-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.ctg-filter-sidebar input[type="date"],
.ctg-filter-sidebar input[type="text"],
.ctg-filter-sidebar select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #E9ECEF;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: var(--ctg-dark);
    background-color: #F8F9FA;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* Customisation de la flèche du Select (au cas où vous en ajoutez un) */
.ctg-filter-sidebar select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23C5BA90%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px top 50%;
    background-size: 10px auto;
    padding-right: 30px;
}

/* Effet Focus & Hover pour Dates et Selects */
.ctg-filter-sidebar input[type="date"]:focus,
.ctg-filter-sidebar input[type="date"]:hover,
.ctg-filter-sidebar input[type="text"]:focus,
.ctg-filter-sidebar input[type="text"]:hover,
.ctg-filter-sidebar select:focus,
.ctg-filter-sidebar select:hover {
    border-color: var(--ctg-gold);
    /* #c5ba90 */
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(197, 186, 144, 0.15);
}

.date-separator {
    color: #A0AABF;
    font-weight: 600;
}

/* --- 2. Checkboxes & Boutons Radio (Design sur-mesure) --- */
.ctg-checkbox-wrapper,
.ctg-radio-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
}

/* Cacher les inputs par défaut */
.ctg-checkbox-wrapper input[type="checkbox"],
.ctg-radio-wrapper input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 1.5px solid #D1D5DB;
    border-radius: 5px;
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #fff;
    flex-shrink: 0;
    position: relative;
}

/* Arrondir les boutons radio */
.ctg-radio-wrapper input[type="radio"] {
    border-radius: 50%;
}

/* Effet Hover & Focus sur Checkbox/Radio */
.ctg-checkbox-wrapper input[type="checkbox"]:hover,
.ctg-radio-wrapper input[type="radio"]:hover,
.ctg-checkbox-wrapper input[type="checkbox"]:focus,
.ctg-radio-wrapper input[type="radio"]:focus {
    border-color: var(--ctg-gold);
    box-shadow: 0 0 0 4px rgba(197, 186, 144, 0.15);
    outline: none;
}

/* État "Coché" (Checked) */
.ctg-checkbox-wrapper input[type="checkbox"]:checked,
.ctg-radio-wrapper input[type="radio"]:checked {
    border-color: var(--ctg-gold);
    background-color: var(--ctg-gold);
}

/* Icône "Check" pour la checkbox */
.ctg-checkbox-wrapper input[type="checkbox"]::after {
    content: "";
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease-in-out;
    position: absolute;
    top: 2px;
}

.ctg-checkbox-wrapper input[type="checkbox"]:checked::after {
    transform: rotate(45deg) scale(1);
}

/* Point central pour le bouton radio */
.ctg-radio-wrapper input[type="radio"]::after {
    content: "";
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.2s ease-in-out;
}

.ctg-radio-wrapper input[type="radio"]:checked::after {
    transform: scale(1);
}

/* --- 3. Style des Labels --- */
.ctg-checkbox-wrapper label,
.ctg-radio-wrapper label {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #434F6D;
    cursor: pointer;
    line-height: 1.4;
    transition: color 0.2s ease;
    user-select: none;
}

/* Changement de couleur du texte au survol */
.ctg-checkbox-wrapper:hover label,
.ctg-radio-wrapper:hover label {
    color: var(--ctg-gold);
}