/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

/* ==========================================================================
   TABLE DES MATIÈRES
   ==========================================================================
   1. GÉNÉRAL
   2. SINGLE ANIMAL (Page détail)
   3. ARCHIVE ANIMALS (Liste des animaux)
   4. FILTRES ANIMAUX
   5. RESPONSIVE
   6. SHORTCODES ANIMAUX
   7. CATEGORY TARIF
   ========================================================================== */


/* ==========================================================================
   1. GÉNÉRAL
   ========================================================================== */

.nolist {
    list-style-type: none;
    margin: 0;
}

.display-none {
    display: none;
}


/* ==========================================================================
   2. SINGLE ANIMAL (Page détail)
   ========================================================================== */

/* --- En-tête --- */
.animal-entry-header,
.page-header {
    background-color: var(--e-global-color-blocksy_palette_4);
    background-image: url(https://descoeursasauver.fr/wp-content/uploads/2021/12/paw-pattern-2.svg);
    background-size: cover;
    padding: 2vh 2vw;
}

.animal-entry-title {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 1vh 0.3vw 0.3vh 0.3vw;
    color: var(--e-global-color-blocksy_palette_7);
}

.animal-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10%;
    margin: 1vh 0.3vw;
}

.animal-buttons a {
    margin: 1vh 0;
}

/* --- Contenu principal --- */
.animal-main-image {
    display: none;
}

.animal-entry-content {
    display: flex;
    margin: 3vh 1% 1vh 1%;
    gap: 2%;
}

.animal-sidebar {
    width: 26%;
}

.animal-main-content {
    width: 70%;
}

/* --- Galerie --- */
.animal-gallery {
    margin-left: auto;
    margin-right: auto;
}

#animal-splide .splide__track {
    text-align: center;
}

/* --- Localisation --- */
.animal-location-desktop h4, .animal-location-mobile h4 {
    text-align: center;
    margin: 4vh 0 1vh 0;
}

.animal-location-desktop p, .animal-location-mobile p {
    text-align: center;
}

.animal-location-mobile{
    display: none;
}

/* --- Informations --- */
.animal-information {
    display: flex;
    gap: 4%;
    flex-wrap: wrap;
    margin-bottom: 1vh;
}

.animal-information h3 {
    margin-bottom: 0.3rem;
    color: var(--e-global-color-blocksy_palette_7);
}

.animal-information div {
    margin-bottom: 2vh;
    background-color: var(--e-global-color-blocksy_palette_4);
    padding: 2vh 2vw;
    border-radius: 8px;
    color: var(--e-global-color-blocksy_palette_5);
}

.animal-information p {
    margin: 0;
}

.animal-information .animal-age {
    font-style: italic;
}

/* --- Termes (catégories, statuts, etc.) --- */
.animal-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 6%;
    margin-bottom: 2vh;
    font-weight: bold;
}

.animal-terms > span > span {
    color: var(--theme-link-initial-color);
}

/* --- Description --- */
.animal-description {
    margin-top: 3vh;
}

.animal-description h4 {
    margin-bottom: 1rem;
}


/* ==========================================================================
   3. ARCHIVE ANIMALS (Liste des animaux)
   ========================================================================== */

/* --- En-tête de page --- */
.page-header h1 {
    text-align: center;
    margin-bottom: 1vh;
    color: var(--e-global-color-blocksy_palette_7);
}

.page-header p {
    text-align: center;
    color: var(--e-global-color-blocksy_palette_5);
}

.page-header > span {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10%;
    margin-bottom: 1vh;
}

/* --- Conteneur principal --- */
.animaux-content {
    padding-top: 3vh;
    display: flex;
    gap: 30px;
    /* align-items: flex-start; */
}

/* --- Grille d'animaux --- */
.animaux-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 30px;
    justify-content: center;
}

.animaux-grid-wrapper {
    flex-grow: 1;
    margin-bottom: 3vh;
}

/* État de chargement */
.animaux-grid-wrapper.loading {
    position: relative;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.animaux-grid-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--e-global-color-blocksy_palette_4);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Cartes d'animaux --- */
.animal-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    text-decoration: none;
    flex: 0 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.animal-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.animal-card > a {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.animal-card a,
.animal-card a:hover {
    text-decoration: none;
    color: inherit;
}

/* Image de la carte */
.animal-card-image {
    position: relative;
    margin: 0 0.5vw;
    overflow: hidden;
    height: 250px;
    width: 250px;
}

.animal-card-image img {
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.3s;
}

/* Contenu de la carte */
.animal-card-content {
    padding: 1vh 1vw;
}

.animal-card-name {
    margin: 0;
    font-size: 1.3rem;
    text-align: center;
    font-weight: bold;
}

.animal-card-status {
    margin: 1vh 1vw;
    font-size: 1.1rem;
    text-align: center;
    font-weight: bold;
}

.animal-card-meta {
    list-style: none;
    padding: 0;
    font-size: 0.9rem;
}

.animal-card-meta li {
    display: flex;
    justify-content: center;
    padding: 2px 0;
}

/* Couleurs des cartes selon le statut */
.animal-card-grayed {
    background-color: #c1c1c1;
    opacity: 0.3;
}

.animal-card-sponsorship,
.animal-card-retirement {
    background-color: var(--e-global-color-blocksy_palette_1);
    color: #333;
}

.animal-card-sos,
.animal-card-emergency {
    background-color: var(--e-global-color-blocksy_palette_2);
    color: white;
}

/* Badges sur les cartes */
.animal-card-span-category {
    position: absolute;
    top: 1vh;
    right: 1vw;
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    background-color: var(--e-global-color-blocksy_palette_1);
}

.animal-card-sos .animal-card-span-category {
    background-color: var(--e-global-color-blocksy_palette_2);
    color: white;
}

.animal-card-span-sponsorship {
    position: absolute;
    top: 1vh;
    left: 1vw;
    background-color: var(--e-global-color-blocksy_palette_1);
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.animal-card-span-emergency {
    position: absolute;
    bottom: 1vh;
    left: 1vw;
    background-color: var(--e-global-color-blocksy_palette_2);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}


/* ==========================================================================
   4. FILTRES ANIMAUX
   ========================================================================== */

/* --- Bouton toggle pour mobile --- */
.filters-toggle-btn {
    display: none;
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 20px;
    background-color: var(--e-global-color-blocksy_palette_4);
    color: var(--e-global-color-blocksy_palette_7);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* .filters-toggle-btn:hover {
    background-color: var(--e-global-color-blocksy_palette_5);
} */

.filters-toggle-btn::before {
    content: "▼";
    transition: transform 0.3s ease;
}

.filters-toggle-btn.active::before {
    transform: rotate(180deg);
}

/* --- Barre latérale des filtres --- */
.filters-sidebar {
    width: 280px;
    flex-shrink: 0;
    padding: 20px;
    border: 1px solid var(--e-global-color-blocksy_palette_5);
    border-radius: 8px;
    background-color: var(--e-global-color-blocksy_palette_7);
    transition: all 0.3s ease;
}

/* --- Formulaire de filtres --- */
#animal-filters h3,
#animal-filters h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5vh;
}

#animal-filters h3 {
    margin-top: 2vh;
}

.filter-group {
    margin-bottom: 1.5rem;
}

/* Contrôles de tri */
.sort-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#sort-by-select,
#categorie-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--e-global-color-blocksy_palette_5);
    border-radius: 4px;
    background-color: white;
    font-size: 1rem;
}

/* Toggle Switch pour ordre croissant/décroissant */
.sort-order-toggle {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--e-global-color-blocksy_palette_4);
    transition: 0.4s;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--e-global-color-blocksy_palette_4);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.order-asc,
.order-desc {
    font-size: 18px;
    font-weight: bold;
    z-index: 1;
}

.order-desc {
    color: var(--e-global-color-blocksy_palette_4);
}

.order-asc {
    color: white;
}

.order-label {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Bouton réinitialiser */
#reset-filters-button {
    width: 100%;
    margin-top: 0.7vh;
}


/* ==========================================================================
   5. RESPONSIVE
   ========================================================================== */

/* --- Desktop large (> 992px) --- */
@media (min-width: 993px) {
    /* Les filtres restent en barre latérale */
    .filters-sidebar {
        display: block !important;
    }
}

/* --- Tablette (769px - 992px) --- */
@media (max-width: 992px) and (min-width: 769px) {
    .animaux-content {
        flex-direction: column;
    }

    .filters-sidebar {
        width: 100%;
        display: block !important;
    }

    .filter-form {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .filter-group {
        margin-bottom: 0;
    }

    .sort-group {
        grid-column: 1 / -1;
    }

    #reset-filters-button {
        grid-column: 1 / -1;
    }

    .filter-form hr {
        grid-column: 1 / -1;
        margin: 0;
    }
}

/* --- Mobile (≤ 768px) --- */
@media (max-width: 768px) {
    /* Affiche le bouton toggle */
    .filters-toggle-btn {
        display: flex;
    }

    /* Réorganisation du contenu */
    .animaux-content {
        flex-direction: column;
    }

    /* Filtres masqués par défaut */
    .filters-sidebar {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        padding: 0 20px;
        margin-bottom: 0;
        border: none;
    }

    /* Filtres visibles quand actifs */
    .filters-sidebar.active {
        max-height: 2000px;
        opacity: 1;
        padding: 20px;
        margin-bottom: 20px;
        border: 1px solid var(--e-global-color-blocksy_palette_5);
    }

    .filter-form {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .filter-group {
        margin-bottom: 0;
    }

    .filter-form hr {
        margin: 10px 0;
    }
}

/* --- Tablette et mobile pour SINGLE ANIMAL (≤ 1150px) --- */
@media (max-width: 1150px) {
    .animal-entry-title {
        font-size: 2rem;
    }

    .animal-main-image {
        display: flex;
        justify-content: center;
        margin-bottom: 1rem;
    }

    .animal-entry-content {
        flex-wrap: wrap;
        margin-top: 0;
    }

    .animal-gallery {
        margin-bottom: 2vh;
    }
    
    .animal-location-desktop{
        display: none;
    }

    .animal-location-mobile{
        display: block;
    }

    .enimal-location-mobile{
        display: block;
    }

    .animal-sidebar,
    .animal-main-content {
        width: 100%;
    }

    .animal-gallery {
        width: 60%;
    }

    .animal-terms {
        justify-content: center;
        text-align: center;
    }

    .animal-information {
        justify-content: center;
    }

    .animal-information div {
        width: 50%;
    }

    .animal-description {
        text-align: center;
    }
}

/* --- Petit mobile pour SINGLE ANIMAL (≤ 875px) --- */
@media (max-width: 875px) {

    .animal-information {
        justify-content: center;
    }

    .animal-information div {
        width: 100%;
    }

    .animal-gallery {
        width: 100%;
    }
}

/* --- Très petit mobile (≤ 480px) --- */
@media (max-width: 480px) {
    .page-header > span > a:first-child{
        margin-bottom: 1.5vh;
    }

    .filters-toggle-btn {
        font-size: 1rem;
        padding: 10px 16px;
    }

    .filters-sidebar.active {
        padding: 15px;
    }

    #animal-filters h3,
    #animal-filters h4 {
        font-size: 1.1rem;
    }
}

/* ==========================================================================
   6. SHORTCODES ANIMAUX
   ========================================================================== */

/* --- Grille normale (responsive) --- */
.animaux-shortcode-grid {
    display: grid;
    grid-template-columns: repeat(var(--colonnes, 4), 1fr);
    gap: 30px;
    margin: 30px 0;
}

/* --- Scroll horizontal --- */
.animaux-shortcode-scroll {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 10px;
    margin: 30px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.animaux-shortcode-scroll::-webkit-scrollbar {
    height: 12px;
}

.animaux-shortcode-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.animaux-shortcode-scroll::-webkit-scrollbar-thumb {
    background: var(--e-global-color-blocksy_palette_4);
    border-radius: 10px;
}

.animaux-shortcode-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--e-global-color-blocksy_palette_5);
}

.animaux-shortcode-scroll .animal-card {
    flex: 0 0 280px;
    min-width: 280px;
}

/* --- Message quand aucun animal trouvé --- */
.no-animals-found {
    text-align: center;
    padding: 40px 20px;
    background: #f5f5f5;
    border-radius: 8px;
    color: #666;
    font-size: 1.1rem;
}

/* --- Responsive pour la grille --- */
@media (max-width: 1200px) {
    .animaux-shortcode-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .animaux-shortcode-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .animaux-shortcode-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .animaux-shortcode-scroll {
        gap: 20px;
    }

    .animaux-shortcode-scroll .animal-card {
        flex: 0 0 250px;
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .animaux-shortcode-scroll .animal-card {
        flex: 0 0 220px;
        min-width: 220px;
    }
}

/* ==========================================================================
   7. CATEGORY TARIF
   ========================================================================== */

.category-name{
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--e-global-color-blocksy_palette_2);
}

.category-price{
    font-size: 1.5rem;
    font-weight: bold;
}

.category-desc{
    font-size: 1rem;
    color: var(--e-global-color-blocksy_palette_3);
}

