/*
Theme Name: Twenty Fifteen Child
Theme URI: http://exemple.com/
Description: Thème enfant de Twenty Fifteen pour Attelages bovins d'aujourd'hui
Author: Léonnie
Author URI: http://exemple.com/
Template: twentyfifteen
Version: 1.0
Text Domain: twentyfifteen-child
*/

/* ========================================
   ZONES DE SAISIE — INPUT & SELECT — VRAIMENT MARQUÉES
   ======================================== */
#search-text,
.goto-page-form input[type="number"] {
    padding: 12px 14px;
    font-size: 12pt;
    border: 2px solid #1a1a1a;
    background-color: #d4d4d4;
    color: #555;
    font-style: italic;
    transition: all 0.2s ease;
    font-weight: 500;
}

#search-text:focus,
.goto-page-form input[type="number"]:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(168, 153, 104, 0.25);
    background-color: #c5c5c5;
}

#search-text:hover,
.goto-page-form input[type="number"]:hover {
    background-color: #c5c5c5;
}

/* Styles particuliers pour la recherche */
#search-text {
    flex: 1;
    min-width: 200px;
}

/* Masquer les flèches haut/bas de l'input number */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"][type="number"] {
    -moz-appearance: textfield;
}

/* ========== SELECTS DU TRI — STYLE BEIGE ==========*/
#sort-by,
#posts-per-page {
    padding: 12px 14px;
    font-size: 12pt;
    border: 2px solid #1a1a1a;
    background-color: #e6d8ad;
    color: #222;
    transition: all 0.2s ease;
    font-weight: 500;
}

#sort-by:focus,
#posts-per-page:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(168, 153, 104, 0.25);
    background-color: #f0e8c5;
}

#sort-by:hover,
#posts-per-page:hover {
    background-color: #f0e8c5;
}

/* ========== TOUS LES BOUTONS — STYLE UNIFIÉ ==========*/
button,
.button,
#search-button,
#reset-filters,
.goto-page-form .button {
    padding: 12px 20px;
    font-size: 12pt;
    font-weight: 600;
    background-color: #a89968;
    color: #fff;
    border: 2px solid #1a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0;
}

button:hover,
.button:hover,
#search-button:hover,
#reset-filters:hover,
.goto-page-form .button:hover {
    background-color: #8b7d5f;
}

button:active,
.button:active,
#search-button:active,
#reset-filters:active,
.goto-page-form .button:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ========================================
   PAGINATION — STYLES RESPONSIVE
   ======================================== */

.archive-pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 40px 0;
    padding: 20px;
}

/* ========== CONTENEUR DES NUMÉROS ==========*/
.pagination-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

/* ========== STYLES DES LIENS ET BOUTONS — COHÉRENT AVEC ACCORDÉONS ==========*/
.page-numbers,
.page-numbers.current,
.pagination-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    font-size: 12pt;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid #1a1a1a;
    background-color: #fff;
    color: #222;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 44px;
    text-align: center;
}

/* Lien actif sur hover */
.page-numbers:not(.current):not(.disabled):hover {
    background-color: #f9f7f1;
    color: #222;
}

/* Page courante */
.page-numbers.current {
    background-color: #a89968;
    color: #fff;
    border-color: #1a1a1a;
    cursor: default;
    font-weight: 700;
}

/* Boutons désactivés */
.page-numbers.disabled {
    background-color: #e6d8ad;
    color: #999;
    border-color: #1a1a1a;
    cursor: default;
    opacity: 0.6;
}

/* Points de suspension */
.pagination-dots {
    border: none;
    background: transparent;
    cursor: default;
    padding: 12px 4px;
    font-size: 14pt;
    color: #999;
}

.pagination-dots:hover {
    background: transparent;
    border: none;
}

/* ========== FORMULAIRE "ALLER À LA PAGE" ==========*/
.goto-page-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== ÉTAT DE CHARGEMENT — SPINNER ANIMÉ ==========*/
#filtered-results.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
    min-height: 200px;
}

#filtered-results.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 1000;
}

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

.error {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px;
    border-radius: 4px;
    font-size: 12pt;
    text-align: center;
}

.no-articles-found {
    text-align: center;
    color: #999;
    font-size: 12pt;
    padding: 20px;
}

/* ========================================
   RESPONSIVE — TABLETTE (768px et +)
   ======================================== */
@media (min-width: 768px) {
    .pagination-numbers {
        gap: 10px;
    }

    .page-numbers,
    .page-numbers.current {
        padding: 10px 12px;
        font-size: 12pt;
        min-width: 44px;
    }
}

/* ========================================
   RESPONSIVE — MOBILE (< 768px)
   ======================================== */
@media (max-width: 767px) {
    .archive-pagination-wrapper {
        padding: 15px;
        margin: 30px 0;
        gap: 12px;
    }

    .pagination-numbers {
        gap: 6px;
        justify-content: center;
    }

    .page-numbers,
    .page-numbers.current {
        padding: 6px 8px;
        font-size: 10pt;
        min-width: 34px;
        border-radius: 3px;
    }

    .pagination-dots {
        padding: 6px 3px;
        font-size: 12pt;
    }

    /* Réduire le formulaire sur mobile */
    .goto-page-form {
        gap: 6px;
    }

    .goto-page-form input[type="number"] {
        width: 70px;
        padding: 6px 8px;
        font-size: 11pt;
    }

    button,
    .button,
    #search-button,
    #reset-filters,
    .goto-page-form .button {
        padding: 6px 12px;
        font-size: 11pt;
    }
}

/* ========================================
   RESPONSIVE — TRÈS PETIT MOBILE (< 360px)
   ======================================== */
@media (max-width: 359px) {
    .page-numbers,
    .page-numbers.current {
        padding: 5px 6px;
        font-size: 9pt;
        min-width: 30px;
    }

    .pagination-numbers {
        gap: 4px;
    }

    input[type="number"] {
        width: 60px;
        font-size: 10pt;
    }

    button,
    .button,
    #search-button,
    #reset-filters,
    .goto-page-form .button {
        padding: 5px 10px;
        font-size: 10pt;
    }
}

/* ========================================
   ACCORDÉONS — COHÉRENT AVEC PAGINATION
   ======================================== */

.accordion {
    border: 2px solid #c9b896;
    margin-bottom: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.accordion:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.accordion:last-of-type {
    margin-bottom: 20px;
}

.accordion-title {
    font-weight: 600;
    font-size: 0.95em;
    padding: 14px 16px;
    cursor: pointer;
    background: #f5f5f5;
    border-bottom: none;
    position: relative;
    padding-left: 28px;
    transition: all 0.2s ease;
    color: #222;
    user-select: none;
}

.accordion-title:hover {
    background: #f9f7f1;
    color: #222;
}

.accordion-title.accordion-open {
    background: #e6d8ad;
    border-bottom: 2px solid #c9b896;
    color: #222;
}

.accordion-content {
    padding: 14px 16px;
    display: none;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

/* Sous-accordéons */
.accordion-content .accordion {
    margin: 10px 0;
    border: 2px solid #c9b896;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.accordion-content .accordion:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.accordion-content .accordion .accordion-title {
    font-weight: 500;
    font-size: 0.9em;
    background: #fafafa;
    padding: 11px 14px;
    padding-left: 24px;
    color: #555;
}

.accordion-content .accordion .accordion-title:hover {
    background: #f9f7f1;
    color: #222;
}

.accordion-content .accordion .accordion-title.accordion-open {
    background: #e6d8ad;
    color: #222;
}

/* Flèche animée */
.accordion-title::before {
    content: '▶';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 0.3s ease;
    font-size: 12px;
    color: #666;
}

.accordion-title.accordion-open::before {
    transform: translateY(-50%) rotate(90deg);
}

/* Checkbox styling */
.filter-tag {
    margin-right: 8px;
    cursor: pointer;
    accent-color: #a89968;
}

.accordion-content label {
    display: block;
    padding: 6px 0;
    cursor: pointer;
    font-size: 0.93em;
    color: #444;
    transition: color 0.2s ease;
}

.accordion-content label:hover {
    color: #a89968;
}

.accordion-content label:active {
    color: #8b7d5f;
}

/* ========== BOUTONS FLOTTANTS — HAUT ET BAS ==========*/
.scroll-buttons {
    position: fixed;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 998;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.scroll-buttons.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-button {
    width: 50px;
    height: 50px;
    background-color: #333;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.scroll-button:hover {
    background-color: #000;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.scroll-button:active {
    transform: translateY(0);
}

#scroll-to-top {
    bottom: 80px;
}

#scroll-to-bottom {
    bottom: 20px;
}

/* Responsive — Tablette */
@media (max-width: 768px) {
    .scroll-buttons {
        right: 15px;
        gap: 10px;
    }

    .scroll-button {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    #scroll-to-top {
        bottom: 75px;
    }

    #scroll-to-bottom {
        bottom: 15px;
    }
}

/* Responsive — Mobile */
@media (max-width: 480px) {
    .scroll-buttons {
        right: 12px;
        gap: 8px;
    }

    .scroll-button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    #scroll-to-top {
        bottom: 70px;
    }

    #scroll-to-bottom {
        bottom: 12px;
    }
}

/* ========== BOUTON FLOTTANT DOUBLE ==========*/
#dual-scroll-btn {
    position: fixed;
    bottom: 20px;
    right: -100px;
    width: 55px;
    height: 110px;
    background-color: rgba(51, 51, 51, 0.9);
    border: 2px solid #1a1a1a;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    transition: all 0.4s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    overflow: hidden;
}

#dual-scroll-btn.visible {
    right: 20px;
    opacity: 1;
}

/* Partie haute - Flèche haut */
#dual-scroll-btn .scroll-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    background-color: rgba(51, 51, 51, 0.9);
    transition: all 0.3s ease;
}

#dual-scroll-btn .scroll-top:hover {
    background-color: rgba(0, 0, 0, 0.95);
}

/* Ligne diagonale de séparation */
#dual-scroll-btn .separator {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, 
        transparent 0%, 
        #1a1a1a 20%, 
        #1a1a1a 80%, 
        transparent 100%
    );
    transform: translateY(-50%) rotate(-15deg);
    z-index: 1;
}

/* Partie basse - Flèche bas */
#dual-scroll-btn .scroll-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    background-color: rgba(51, 51, 51, 0.9);
    transition: all 0.3s ease;
}

#dual-scroll-btn .scroll-bottom:hover {
    background-color: rgba(0, 0, 0, 0.95);
}

/* Animation au hover global */
#dual-scroll-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Responsive - Tablette */
@media (max-width: 768px) {
    #dual-scroll-btn {
        width: 50px;
        height: 100px;
        bottom: 15px;
    }
    
    #dual-scroll-btn .scroll-top,
    #dual-scroll-btn .scroll-bottom {
        height: 50px;
        font-size: 22px;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    #dual-scroll-btn {
        width: 45px;
        height: 90px;
        bottom: 12px;
        border-width: 1.5px;
    }
    
    #dual-scroll-btn .scroll-top,
    #dual-scroll-btn .scroll-bottom {
        height: 45px;
        font-size: 20px;
    }
    
    /* Sur mobile, masquage plus rapide pour ne pas gêner */
    #dual-scroll-btn {
        transition: all 0.3s ease;
    }
}