/**
 * Events styles
 */

.event {
    display: flex;
    flex-wrap: wrap;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: calc(var(--spacing-md) + var(--spacing-xs));
    margin-bottom: var(--spacing-md);

    @media screen and (max-width: 768px) {
        flex-direction: column-reverse;
    }
    &:last-of-type {
        margin-bottom: 0px;
    }
    .event-content {
        width: 66.66%;

        @media screen and (max-width: 768px) {
            width: 100%;
        }
        a:not(.btn) {
            color: var(--color-blue-light);
        }
        .event-title {
            font-size: clamp(1.5rem, 1.25rem + 0.75vw, 2.5rem);
            margin-bottom: .3rem;
        }
        .event-datetime {
            margin-bottom: 1rem;

            p {
                color: var(--color-blue-light);
                font-size: clamp(1rem, 0.95rem + 0.25vw, 1.2rem);
                font-weight: bold;
            }
        }
        .event-location-address {
            margin-bottom: 1rem;

            .event-location {
                color: var(--color-blue-dark);
                font-weight: bold;
            }
        }
        .event-details {
            p {
                font-size: clamp(1rem, 0.95rem + 0.25vw, 1rem);
                margin-bottom: 1rem;

                strong {
                    font-weight: bold;
                }
            }
        }
        .event-actions {
            .event-buttons {
                display: flex;

                .event-flyer-link {
                    margin-bottom: var(--spacing-sm);
                    display: none;

                    @media screen and (max-width: 768px) {
                        display: block;
                    }
                }
                .event-link {
                    margin-bottom: var(--spacing-sm);

                    @media screen and (max-width: 768px) {
                        margin-left: calc(var(--spacing-xs) + 4px);
                    }
                    a {
                        display: inline-block;
                    }
                }
            }
            .document-links {
                .document-link {
                    display: inline-block;
                    margin-right: var(--spacing-xs);
                    margin-bottom: var(--spacing-sm);

                    &:last-of-type {
                        margin-right: 0;
                    }
                }
            }
        }
    }
    .event-img {
        width: 33.33%;
        padding-left: 20px;
        text-align: center;

        @media screen and (max-width: 768px) {
            width: 100%;
            padding-left: 0;
            margin-bottom: var(--spacing-md);
        }
        .event-img-wrapper {
            width: 100%;
            height: 230px;
            overflow: hidden;
            border: 1px solid rgba(0, 0, 0, 0.1);
            transition: height 0.3s ease-out;

            a {
                width: 100%;
                height: 100%;
                display: block;
            }
        }
        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: top center;
            transition: object-fit 0.3s ease-out;
        }
        .event-flyer-link {
            margin-top: var(--spacing-sm);
            
            @media screen and (max-width: 768px) {
                display: none;
            }
        }
    }
    
    /* When event details are expanded, make image full height */
    &:has(.event-details-container[style*="display: block"]) .event-img,
    &.expanded .event-img {        
        img {
            height: auto;
            object-fit: initial;

            @media screen and (max-width: 768px) {
                height: 100%;
                object-fit: cover;
            }
        }
    }
}