/**
 * IBR Events Page Styles
 * Styles pour la page événements de l'Institut Le Béret Rouge
 */

/* ========================================
   Events Content
   ======================================== */
.ibr-events-page {
    background: #ffffff;
}

.ibr-events-content {
    padding: 40px 20px;
}

.ibr-events-page .ibr-page-title {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    margin: 0 0 40px 0;
    padding: 0;
    text-align: center;
}

/* Post Content Styling */
.ibr-custom-content {
    font-family: var(--font-body, 'Crimson Text', serif);
    font-size: 1.125rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 60px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.ibr-custom-content p {
    margin-bottom: 1.5em;
    text-align: justify;
}

.ibr-custom-content p:first-child {
    font-size: 1.2rem;
    font-weight: 500;
    color: #65686f;
}

.ibr-custom-content h2,
.ibr-custom-content h3,
.ibr-custom-content h4 {
    font-family: var(--font-title, 'Cinzel', serif);
    color: var(--color-primary, #8B0000);
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3;
}

.ibr-custom-content h2 {
    font-size: 2rem;
    border-bottom: 3px solid var(--color-primary, #8B0000);
    padding-bottom: 10px;
}

.ibr-custom-content h3 {
    font-size: 1.6rem;
    color: var(--color-secondary, #0c1428);
}

.ibr-custom-content h4 {
    font-size: 1.3rem;
    font-weight: 600;
}

.ibr-custom-content a {
    color: var(--color-primary, #8B0000);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.ibr-custom-content a:hover {
    color: #D4AF37;
    text-decoration: none;
}

.ibr-custom-content ul,
.ibr-custom-content ol {
    margin: 1.5em 0;
    padding-left: 2em;
}

.ibr-custom-content li {
    margin-bottom: 0.75em;
    line-height: 1.7;
}

.ibr-custom-content blockquote {
    border-left: 4px solid var(--color-primary, #8B0000);
    padding: 1.5em 2em;
    margin: 2em 0;
    background: #f8f9fa;
    font-style: italic;
    color: #555;
    border-radius: 0 8px 8px 0;
}

.ibr-custom-content blockquote p {
    margin-bottom: 0.5em;
}

.ibr-custom-content strong {
    font-weight: 700;
    color: var(--color-secondary, #0c1428);
}

.ibr-custom-content em {
    font-style: italic;
}

.ibr-custom-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2em 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.ibr-custom-content .alignleft {
    float: left;
    margin: 0.5em 2em 1.5em 0;
    max-width: 45%;
}

.ibr-custom-content .alignright {
    float: right;
    margin: 0.5em 0 1.5em 2em;
    max-width: 45%;
}

.ibr-custom-content .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.ibr-custom-content hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 3em 0;
}

.ibr-custom-content code {
    background: #f4f4f4;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #c7254e;
}

.ibr-custom-content pre {
    background: #f4f4f4;
    padding: 1.5em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2em 0;
    border-left: 4px solid var(--color-primary, #8B0000);
}

.ibr-custom-content pre code {
    background: none;
    padding: 0;
    color: #333;
}

.ibr-custom-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 1rem;
}

.ibr-custom-content table th,
.ibr-custom-content table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

.ibr-custom-content table th {
    background: var(--color-primary, #8B0000);
    color: white;
    font-weight: 600;
}

.ibr-custom-content table tr:nth-child(even) {
    background: #f8f9fa;
}

/* Responsive adjustments for content */
@media (max-width: 768px) {
    .ibr-custom-content {
        font-size: 1rem;
        margin-bottom: 40px;
    }

    .ibr-custom-content p:first-child {
        font-size: 1.1rem;
    }

    .ibr-custom-content h2 {
        font-size: 1.6rem;
    }

    .ibr-custom-content h3 {
        font-size: 1.4rem;
    }

    .ibr-custom-content h4 {
        font-size: 1.2rem;
    }

    .ibr-custom-content .alignleft,
    .ibr-custom-content .alignright {
        float: none;
        max-width: 100%;
        margin: 1.5em 0;
    }

    .ibr-custom-content blockquote {
        padding: 1em 1.5em;
        margin: 1.5em 0;
    }
}

.ibr-section-title {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--color-primary);
}

.ibr-section-icon {
    font-size: 2.5rem;
}

/* ========================================
   Events Grid
   ======================================== */
.ibr-events-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 60px;
}

.ibr-upcoming-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.ibr-past-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ========================================
   Event Card
   ======================================== */
.ibr-event-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ibr-event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(139, 0, 0, 0.15);
}

.ibr-event-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.ibr-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ibr-event-card:hover .ibr-event-image img {
    transform: scale(1.1);
}

.ibr-event-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--color-primary);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
    z-index: 10;
}

.ibr-badge-upcoming {
    background: #D4AF37;
    color: var(--color-secondary);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    }

    50% {
        box-shadow: 0 4px 25px rgba(212, 175, 55, 0.6);
    }
}

.ibr-event-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(12, 20, 40, 0.5) 0%, transparent 50%);
}

.ibr-event-content {
    padding: 25px;
}

.ibr-event-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 12px;
}

.ibr-date-icon {
    font-size: 1.2rem;
}

.ibr-time-text {
    color: #666;
    font-weight: 400;
}

.ibr-past-date {
    color: #999;
}

.ibr-event-title {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.3;
}

.ibr-event-title a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ibr-event-title a:hover {
    color: var(--color-primary);
}

.ibr-event-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.ibr-location-icon {
    font-size: 1.1rem;
}

.ibr-event-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.ibr-event-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--color-primary);
    color: white;
    padding: 12px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.2);
}

.ibr-event-btn:hover {
    background: #D4AF37;
    color: var(--color-secondary);
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(115, 109, 89, 0.4);
}

.ibr-btn-arrow {
    transition: transform 0.3s ease;
}

.ibr-event-btn:hover .ibr-btn-arrow {
    transform: translateX(5px);
}

/* Past Event Cards - Smaller Style */
.ibr-past-card .ibr-event-image {
    aspect-ratio: 5/3;
    max-height: 160px;
}

.ibr-past-card .ibr-event-content {
    padding: 20px;
}

.ibr-past-card .ibr-event-title {
    font-size: 1.1rem;
}

/* Section "Tous nos événements" - Style compact */
/* Force 2 columns layout with !important */
.ibr-past-events-wrapper .qodef-grid-inner,
.ibr-past-events-wrapper .qodef-layout--columns .qodef-grid-inner,
.ibr-past-events-wrapper .qodef--col-num--two .qodef-grid-inner {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 30px !important;
}

/* Reset flex if applied */
.ibr-past-events-wrapper .qodef-grid-inner {
    flex-wrap: wrap !important;
}

/* Force grid items to fit */
.ibr-past-events-wrapper .qodef-e,
.ibr-past-events-wrapper .grid-item,
.ibr-past-events-wrapper .qodef-grid-item {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
}

/* Reduce image size drastically */
.ibr-past-events-wrapper img,
.ibr-past-events-wrapper .qodef-e-media-image img,
.ibr-past-events-wrapper .qodef-e-media img {
    max-height: 180px !important;
    height: 180px !important;
    width: 100% !important;
    object-fit: cover !important;
}

.ibr-past-events-wrapper .qodef-e-media,
.ibr-past-events-wrapper .qodef-e-media-image {
    height: 180px !important;
    max-height: 180px !important;
    overflow: hidden !important;
}

/* Compact event content */
.ibr-past-events-wrapper .qodef-e-content {
    padding: 15px !important;
}

.ibr-past-events-wrapper .qodef-e-title {
    font-size: 1rem !important;
    margin-bottom: 10px !important;
}

/* ========================================
   No Events Message
   ======================================== */
.ibr-no-events {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.ibr-no-events-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.ibr-no-events p {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
}

/* ========================================
   Gallery Section
   ======================================== */
.ibr-events-gallery {
    margin-top: 40px;
}

.ibr-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.ibr-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.ibr-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ibr-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(12, 20, 40, 0.9) 0%, rgba(12, 20, 40, 0.4) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ibr-gallery-item:hover .ibr-gallery-overlay {
    opacity: 1;
}

.ibr-gallery-item:hover img {
    transform: scale(1.15);
}

.ibr-gallery-icon {
    font-size: 3rem;
    color: white;
    margin-bottom: 15px;
}

.ibr-gallery-info {
    text-align: center;
    color: white;
    padding: 0 15px;
}

.ibr-gallery-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px;
}

.ibr-gallery-date {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ========================================
   Load More Button
   ======================================== */
.ibr-load-more-container {
    text-align: center;
    margin-top: 40px;
}

.ibr-load-more-btn {
    background: var(--color-secondary);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(12, 20, 40, 0.2);
}

.ibr-load-more-btn:hover {
    background: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.3);
}

.ibr-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .ibr-events-title {
        font-size: 2.5rem;
    }

    .ibr-section-title {
        font-size: 2rem;
    }

    .ibr-upcoming-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .ibr-events-page .ibr-page-title {
        font-size: 28px;
        margin: 0 0 30px 0;
    }

    .ibr-events-content {
        padding: 30px 15px;
    }

    .ibr-section-title {
        font-size: 1.6rem;
        margin-bottom: 30px;
    }

    .ibr-section-icon {
        font-size: 2rem;
    }

    .ibr-upcoming-grid,
    .ibr-past-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ibr-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .ibr-event-card {
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .ibr-events-page .ibr-page-title {
        font-size: 24px;
        margin: 0 0 25px 0;
    }

    .ibr-section-title {
        font-size: 1.4rem;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .ibr-event-content {
        padding: 20px;
    }

    .ibr-event-title {
        font-size: 1.2rem;
    }

    .ibr-event-btn {
        width: 100%;
        justify-content: center;
    }

    .ibr-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .ibr-events-hero {
        background: white;
        color: black;
        padding: 20px 0;
    }

    .ibr-event-btn,
    .ibr-load-more-container,
    .ibr-events-gallery {
        display: none !important;
    }

    .ibr-event-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}