/**
 * category-pages.css
 * Styles pour les pages de catégories (cat.php et cat_root.php)
 * Externalisé le 2026-01-07 dans le cadre du refactoring CSS
 */

/* =====================================================
   MAIN CONTENT
===================================================== */
main {
    padding-top: 0.5rem;
    overflow-x: hidden;
}
main .main-content-header h1 {
    text-align: center;
    font-size: clamp(0.65rem, 3.5vw, 1.7rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    font-weight: normal;
    margin: 0;
    display: block;
    padding: 0 5px;
}
main .header-user-actions {
    margin-top: 0.8rem;
}

/* =====================================================
   COMPACT HEADER (cat.php)
===================================================== */
.compact-header-container {
    font-family: 'Nunito Sans', sans-serif;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 5px auto 15px auto;
    padding: 8px 15px;
    background: #f9f9f9;
    border-radius: 6px;
    text-align: left;
}
.compact-h1 {
    display: inline;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    padding: 0;
    color: #333;
    font-family: 'Nunito Sans', sans-serif;
}
.compact-intro {
    display: inline;
    margin: 0;
    padding: 0;
}

/* =====================================================
   HOME INTRO TEXT
===================================================== */
.home-intro-text {
    margin: 1.5rem 0;
}
.home-intro-text p {
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
    font-size: 1rem;
    color: #333;
    text-align: center;
}

/* =====================================================
   SILO SECTIONS
===================================================== */
.home-silo-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}
.silo-separator {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
    margin: 0.25rem auto;
    width: 80%;
}
.silo-block {
    width: 100%;
    position: relative;
}

/* =====================================================
   SILO BANNER
===================================================== */
.silo-banner-link {
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    text-decoration: none;
    margin-bottom: 0.8rem;
}
.silo-banner-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.silo-banner-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    min-height: 280px;
}

/* =====================================================
   SILO OVERLAY
===================================================== */
.silo-overlay-right {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 65%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
}
.silo-content-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
    padding-right: 0;
}
.overlay-title {
    font-family: 'Patrick Hand', cursive;
    font-size: clamp(1.6rem, 5vw, 3.5rem);
    margin: 0 0 0.5rem 0;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.overlay-text {
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    line-height: 1.4;
    color: #f8f9fa;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.overlay-btn-floating {
    display: inline-block;
    white-space: nowrap;
    background-color: rgba(255, 255, 255, 0.9);
    color: #ff0000;
    padding: 0.6em 1.5em;
    border-radius: 50px;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 800;
    font-size: clamp(0.8rem, 1.2vw, 1.1rem);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    transition: background-color 0.3s, box-shadow 0.3s;
    margin-top: 20px;
}
.silo-banner-link:hover .overlay-btn-floating {
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

/* =====================================================
   SILO CARDS GRID
===================================================== */
.silo-cards-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-top: 10px;
}
.silo-card-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: opacity 0.3s;
}
.silo-card-item:hover img {
    opacity: 0.9;
}

/* =====================================================
   SILO PILLS
===================================================== */
.silo-pills-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}
.silo-pill-link,
.silo-pill-link:visited,
.silo-pill-link:active,
.silo-pill-link:focus {
    display: inline-block;
    background-color: #4e9cd8;
    color: #ffffff !important;
    text-decoration: none !important;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 50px;
    transition: background-color 0.2s, transform 0.2s;
}
.silo-pill-link:hover {
    background-color: #3b7cb0;
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* =====================================================
   HUB SUBCAT GRID
===================================================== */
.hub-subcat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0 40px 0;
    width: 100%;
}
.hub-subcat-item {
    position: relative;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    transition: transform 0.2s;
    height: 100%;
}
.hub-subcat-item:hover {
    transform: translateY(-3px);
}
.hub-subcat-item img {
    border-radius: 8px 8px 0 0;
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: block;
}
.hub-text-content {
    padding: 10px 2px;
    text-align: center;
}
.hub-subcat-title {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.4rem;
    color: #222;
    margin: 5px 0;
    line-height: 1.2;
}
.hub-subcat-desc {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.85rem;
    color: #666;
    font-weight: 400;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* SEO OVERLAY LINK */
.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

/* =====================================================
   CARDS BLOCK GRID (Cartes populaires)
===================================================== */
.cards-block-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 30px auto;
    justify-content: center;
    max-width: 1200px;
}

/* =====================================================
   SECTION TITLES
===================================================== */
.section-title-standard {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    margin-top: 30px;
}

/* =====================================================
   CATEGORY FOOTER TEXT
===================================================== */
.category-footer {
    margin-top: 40px;
    padding: 0 10px;
    font-family: 'Nunito Sans', sans-serif;
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
    background: transparent;
    border: none;
}
.category-footer h3 {
    font-size: 1.1rem;
    color: #333;
    margin-top: 20px;
    font-weight: 700;
}
.category-footer ul {
    padding-left: 20px;
    margin-bottom: 20px;
}
.category-footer li {
    margin-bottom: 8px;
}

/* =====================================================
   CARD GALLERY (Endpoint)
===================================================== */
.card-gallery {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
}

/* =====================================================
   AD SLOTS (Pub dans grilles)
===================================================== */
.gallery-ad-slot,
.hub-ad-slot {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: center;
    margin: 10px 0;
}
.gallery-ad-slot-2,
.hub-ad-slot-2 {
    grid-column: 1 / -1;
    grid-row: 7;
    text-align: center;
    margin: 10px 0;
}

/* =====================================================
   FAQ SECTION
===================================================== */
.faq-section {
    max-width: 800px;
    margin: 3rem auto 2rem auto;
    padding: 0 1rem;
    font-family: 'Nunito Sans', sans-serif;
}
.faq-title {
    text-align: center;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
}
.faq-item {
    border-bottom: 1px solid #eee;
    margin-bottom: 0.5rem;
}
.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 1rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #4e9cd8;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
}
.faq-question::-webkit-details-marker {
    display: none;
}
.faq-question::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    transition: transform 0.2s;
}
details[open] .faq-question::after {
    transform: rotate(45deg);
}
.faq-answer {
    padding-bottom: 1rem;
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* =====================================================
   SEO FOOTER (cat_root.php)
===================================================== */
.seo-footer-container {
    background-color: #fdfdfd;
    padding: 4rem 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid #eee;
}
.seo-footer-content {
    max-width: 850px;
    margin: 0 auto;
    text-align: center;
    font-family: 'Nunito Sans', sans-serif;
    color: #4a4a4a;
    font-size: 1rem;
    line-height: 1.8;
}
.seo-footer-content h2 {
    font-family: 'Patrick Hand', cursive;
    color: #333;
    font-size: 2.2rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}
.seo-footer-content h2:first-child {
    margin-top: 0;
}
.seo-footer-content p {
    margin-bottom: 1.5rem;
}

/* =====================================================
   RESPONSIVE - TABLET
===================================================== */
@media (min-width: 600px) {
    .card-gallery {
        grid-template-columns: repeat(auto-fit, minmax(180px, 230px)) !important;
        gap: 20px !important;
    }
    .gallery-ad-slot-2,
    .hub-ad-slot-2 {
        grid-row: 5;
    }
    .hub-subcat-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 230px));
        gap: 20px;
    }
}

@media (max-width: 599px) {
    .hub-ad-slot-2 {
        grid-row: 7;
    }
}

@media (min-width: 768px) {
    .hub-subcat-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
    .cards-block-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* =====================================================
   RESPONSIVE - MOBILE
===================================================== */
@media (max-width: 767px) {
    main .header-user-actions {
        margin-top: 0.5rem;
    }
    .home-intro-text {
        margin: 0.5rem 0 1rem 0;
    }
    .home-intro-text p {
        font-size: 0.85rem;
        padding: 0 10px;
    }
    .silo-banner-img {
        min-height: 220px;
        object-position: 25% center;
    }
    .silo-overlay-right {
        width: 100%;
        box-sizing: border-box;
        position: absolute;
        left: 0;
        background: rgba(0,0,0,0.3);
        padding: 1rem;
    }
    .silo-content-centered {
        padding-right: 0;
        max-width: 95%;
        margin: 0 auto;
    }
    .overlay-btn-floating {
        font-size: 0.8rem;
        margin-top: 15px;
    }
    .silo-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .silo-block .silo-card-item:nth-child(n+3) {
        display: none;
    }
    .silo-pills-container {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 5px;
    }
    .silo-pills-container::-webkit-scrollbar {
        display: none;
    }
    .silo-pill-link {
        font-size: 0.8rem;
        padding: 4px 10px;
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

/* =====================================================
   PAGINATION
===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
    padding: 15px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
}

.pagination a {
    color: #555;
    background: #f5f5f5;
}

.pagination a:hover {
    background: #e0e0e0;
    color: #333;
}

.pagination-prev,
.pagination-next {
    font-weight: 600;
}

.pagination-prev.disabled,
.pagination-next.disabled {
    color: #bbb;
    background: transparent;
    cursor: default;
}

.pagination-numbers {
    display: flex;
    gap: 4px;
}

.pagination-numbers a,
.pagination-numbers span {
    min-width: 40px;
    padding: 8px 12px;
}

.pagination-current {
    background: #4a90a4;
    color: #fff;
    font-weight: 700;
}

.pagination-ellipsis {
    background: transparent;
    color: #999;
    padding: 8px 6px;
}

@media (max-width: 600px) {
    .pagination {
        gap: 4px;
    }
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    .pagination-numbers a,
    .pagination-numbers span {
        min-width: 34px;
        padding: 6px 8px;
    }
    .pagination-prev,
    .pagination-next {
        padding: 6px 8px;
    }
}
