/* Forums - Grille de cartes */

.ids-forums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 40px 0;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .ids-forums-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 24px 0;
    }
}

.ids-forum-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ids-forum-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.ids-forum-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ids-forum-card-image {
    position: relative;
    width: 100%;
    height: 240px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    padding: 24px;
}

.ids-forum-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 1;
}

.ids-forum-card-title {
    position: relative;
    z-index: 2;
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .ids-forum-card-image {
        height: 200px;
        padding: 16px;
    }
    
    .ids-forum-card-title {
        font-size: 20px;
    }
}

.ids-forum-card-description {
    padding: 16px 24px;
    color: #64748B;
    font-size: 16px;
    line-height: 1.6;
    flex-grow: 1;
}

.ids-forum-card-stats {
    display: flex;
    gap: 16px;
    padding: 12px 24px;
    border-top: 1px solid #E5E7EB;
    background: #F8FAFC;
}

.ids-forum-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748B;
    font-size: 14px;
    font-weight: 500;
}

.ids-forum-stat svg {
    width: 16px;
    height: 16px;
    color: #000091;
}

.ids-forum-card-cta {
    padding: 16px 24px;
}

.ids-forum-card-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #000091;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s ease;
    width: 100%;
    justify-content: center;
}

.ids-forum-card-button::after {
    content: "→";
    font-size: 18px;
    transition: transform 0.3s ease;
}

.ids-forum-card:hover .ids-forum-card-button {
    background: #000070;
}

.ids-forum-card:hover .ids-forum-card-button::after {
    transform: translateX(4px);
}

.ids-forum-card.no-image .ids-forum-card-image {
    background: linear-gradient(135deg, #000091 0%, #000070 100%);
}

.ids-forum-card.is-new::before {
    content: "Nouveau";
    position: absolute;
    top: 16px;
    right: 16px;
    background: #10B981;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 3;
}

.page-v2 .ids-forums-grid {
    font-family: 'Afacad', sans-serif;
}

.page-v2 .ids-forum-card-title {
    font-family: 'Afacad', sans-serif;
}

.ids-forums-grid.is-loading .ids-forum-card {
    opacity: 0.5;
    pointer-events: none;
}

@media (min-width: 1024px) {
    .ids-forums-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .ids-forums-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ids-forum-card-link:focus {
    outline: 2px solid #000091;
    outline-offset: 4px;
}

.ids-forum-card-link:focus:not(:focus-visible) {
    outline: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ids-forum-card {
    animation: fadeInUp 0.5s ease backwards;
}

.ids-forum-card:nth-child(1) { animation-delay: 0.1s; }
.ids-forum-card:nth-child(2) { animation-delay: 0.2s; }
.ids-forum-card:nth-child(3) { animation-delay: 0.3s; }
.ids-forum-card:nth-child(4) { animation-delay: 0.4s; }
.ids-forum-card:nth-child(5) { animation-delay: 0.5s; }
.ids-forum-card:nth-child(6) { animation-delay: 0.6s; }

/* ========================================
   HERO SECTION - Page Index des Forums
   Bandeau bleu full-width
   ======================================== */

.ids-forums-index-hero {
    background: linear-gradient(135deg, #4169E1 0%, #0000FF 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    padding: 64px 80px;
    margin: 0;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.ids-forums-index-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 145, 0.95) 0%, rgba(65, 105, 225, 0.9) 100%);
    z-index: 1;
}

.ids-forums-index-hero-content,
.ids-forums-index-hero-image {
    position: relative;
    z-index: 2;
}

.ids-forums-index-hero-title {
    color: #FFFFFF;
    font-size: 50px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 24px 0;
    font-family: 'Afacad', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ids-forums-index-hero-description {
    color: #F8FAFC;
    font-size: 20px;
    line-height: 1.6;
    margin: 0;
    font-family: 'Afacad', sans-serif;
    font-weight: 400;
}

.ids-forums-index-hero-description p {
    margin: 0 0 16px 0;
}

.ids-forums-index-hero-description p:last-child {
    margin-bottom: 0;
}

.ids-forums-index-hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ids-forums-index-hero-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}


/* Responsive */
@media (max-width: 1200px) {
    .ids-forums-index-hero {
        padding: 48px 40px;
        gap: 48px;
    }
}

@media (max-width: 1024px) {
    .ids-forums-index-hero {
        padding: 48px 32px;
        gap: 40px;
    }
    
    .ids-forums-index-hero-title {
        font-size: 40px;
    }
    
    .ids-forums-index-hero-description {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .ids-forums-index-hero {
        grid-template-columns: 1fr;
        padding: 40px 24px;
        gap: 32px;
    }
    
    .ids-forums-index-hero-title {
        font-size: 32px;
        margin-bottom: 16px;
    }
    
    .ids-forums-index-hero-description {
        font-size: 16px;
    }
    
    .ids-forums-index-hero-image {
        order: -1;
    }
    
    .ids-forums-index-hero-image img {
        max-height: 240px;
    }
}

/* Masquer le titre par défaut de WordPress sur la page forum */
body.bbpress .entry-header,
body.bbpress .entry-title,
body.bbpress h1.page-title,
#bbpress-forums + .entry-header {
    display: none !important;
}

/* Titre gris au-dessus du contenu bbPress - Le masquer complètement */
body.bbpress .page-title,
body.single-forum .page-title,
body.post-type-archive-forum .page-title,
.bbpress-breadcrumb,
body.bbpress #bbpress-forums::before,
body.single-forum .entry-content > h1:first-of-type:not(.elementor-heading-title) {
    display: none !important;
}

/* Si un titre apparaît quand même, le rendre petit et discret */
body.bbpress #bbpress-forums > h1:first-child:not(.elementor-heading-title),
body.bbpress .bbp-forum-title:not(.elementor-heading-title) {
    font-size: 16px !important;
    line-height: 1.4 !important;
    color: #94A3B8 !important;
    font-weight: 400 !important;
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
}

/* Forcer padding/margin à zéro sur toutes les pages bbPress */
body.bbpress .site-main,
body.bbpress .content-area,
body.bbpress main,
body.bbpress article,
body.bbpress .entry-content {
    padding: 0 !important;
    margin: 0 !important;
}

body.bbpress #bbpress-forums {
    margin: 0 !important;
    padding: 0 !important;
}

/* Forcer le container Blocksy à ne pas ajouter de padding */
body.bbpress .ct-container,
body.bbpress .ct-container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Neutraliser la classe WordPress Gutenberg qui ajoute des contraintes */
body.bbpress .is-layout-constrained {
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Surcharger la variable Blocksy qui limite la largeur */
body.bbpress {
    --theme-block-width: 100% !important;
}

body.bbpress .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    max-width: none !important;
    width: 100% !important;
}

/* ========================================
   HERO BBPRESS - Style Elementor
   ======================================== */

/* Supporter la structure e-con-inner au lieu de elementor-container */
.design-v2-hero .e-con-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.design-v2-hero .hero-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.design-v2-hero .hero-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Forcer les couleurs et tailles dans le hero bbPress */
.design-v2-hero .hero-left h1,
.design-v2-hero .hero-left h2,
.design-v2-hero .hero-left h3,
.design-v2-hero .hero-left .elementor-text-editor,
.design-v2-hero .hero-left blockquote,
.design-v2-hero .hero-left p {
    color: var(--ids-text-white) !important;
}

.design-v2-hero .hero-left h1 {
    font-size: 50px !important;
    line-height: 1.2 !important;
}

.design-v2-hero .hero-left .elementor-text-editor,
.design-v2-hero .hero-left blockquote,
.design-v2-hero .hero-left p {
    font-size: 24px !important;
    line-height: 1.5 !important;
}

/* Responsive : réduire les tailles de texte */
@media (max-width: 1024px) {
    .design-v2-hero .hero-left h1 {
        font-size: 40px !important;
    }
    
    .design-v2-hero .hero-left .elementor-text-editor,
    .design-v2-hero .hero-left blockquote,
    .design-v2-hero .hero-left p {
        font-size: 20px !important;
    }
}

@media (max-width: 768px) {
    .design-v2-hero .hero-left h1 {
        font-size: 28px !important;
    }
    
    .design-v2-hero .hero-left .elementor-text-editor,
    .design-v2-hero .hero-left blockquote,
    .design-v2-hero .hero-left p {
        font-size: 16px !important;
    }
}

/* Boutons dans le hero bbPress */
.design-v2-hero .hero-left .elementor-button {
    background-color: #FFFFFF !important;
    color: var(--ids-blue-dark) !important;
    border: 2px solid #FFFFFF !important;
    border-radius: 50px;
    padding: 12px 28px;
    font-weight: 600;
    font-size: 18px;
    line-height: 1.2;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.design-v2-hero .hero-left .elementor-button:hover {
    background-color: var(--ids-blue-light);
    color: #FFFFFF !important;
    border-color: var(--ids-blue-light);
    transform: translateY(-2px);
}

/* Responsive hero bbPress */
@media (max-width: 1024px) {
    .design-v2-hero .e-con-inner {
        gap: 48px;
        padding: 0 32px;
    }
}

@media (max-width: 768px) {
    .design-v2-hero .e-con-inner {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 0 24px;
    }
    
    .design-v2-hero .hero-right {
        order: -1;
    }
}

/* Wrapper pour centrer le contenu des forums (après le hero) */
.ids-forums-grid {
    background: #FFFFFF;
    padding: 64px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .ids-forums-grid {
        padding: 40px 24px;
    }
}

/* Message "Pas encore de sujet" */
.ids-no-topics-message {
    display: block;
    text-align: center;
    padding: 80px 40px;
    color: #64748B;
    font-size: 18px;
    font-weight: 400;
    font-style: italic;
    background: #FFFFFF;
    max-width: 1200px;
    margin: 0 auto;
}

/* Si aucun topic, centrer le message */
.bbp-topics .ids-no-topics-message {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}
