/**
 * Single Event Page Styles
 * Fixes for featured images and event display
 */

/* Featured Image in Sidebar - Square 1080x1080 optimized */
.single-events .wp-block-post-featured-image {
    margin-bottom: var(--wp--custom--spacing--md);
    overflow: hidden;
    border-radius: var(--wp--custom--borders--radius--sm);
    width: 100%;
}

.single-events .wp-block-post-featured-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

/* Sidebar context - ensure full width within sidebar */
.single-events .has-biscay-lightest-background-color .wp-block-post-featured-image {
    margin-left: 0;
    margin-right: 0;
}

/* Mobile - square images look great at any size */
@media (max-width: 768px) {
    .single-events .wp-block-post-featured-image img {
        aspect-ratio: 1 / 1;
    }
}

/* Event Details Sidebar */
.single-events .related-event-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.single-events .related-event-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Event Info Cards */
.single-events .has-biscay-lightest-background-color {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Share buttons hover effects */
.single-events .has-saffron-lightest-background-color .wp-block-button__link {
    transition: color 0.2s ease;
}

.single-events .has-saffron-lightest-background-color .wp-block-button__link:hover {
    opacity: 0.8;
}

/* Ensure proper spacing for event content */
.single-events .wp-block-post-content {
    line-height: 1.6;
}

.single-events .wp-block-post-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.single-events .wp-block-post-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.single-events .wp-block-post-content p {
    margin-bottom: 1rem;
}

.single-events .wp-block-post-content ul,
.single-events .wp-block-post-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

/* Fix for empty featured image container */
.single-events .wp-block-post-featured-image:empty {
    display: none;
}

/* Loading state improvements */
.single-events p[id^="event-"] {
    min-height: 1.5em;
    transition: opacity 0.3s ease;
}

.single-events p[id^="event-"]:empty::after {
    content: "Loading...";
    color: var(--wp--preset--color--cape-cod-light);
    font-style: italic;
}

/* =====================================================
   CALENDAR BUTTONS SECTION
   ===================================================== */

.calendar-buttons-section {
    margin-top: var(--wp--custom--spacing--sm);
}

.calendar-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wp--custom--spacing--xs);
    justify-content: center;
}

/* Calendar Button Base Styles */
.calendar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-family: var(--wp--preset--font-family--poppins);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    color: var(--wp--preset--color--cape-cod-darkest);
    background-color: var(--wp--preset--color--saffron);
    border: none;
    border-radius: 0.29rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.calendar-btn:hover {
    background-color: var(--wp--preset--color--saffron-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.calendar-btn:focus {
    outline: 2px solid var(--wp--preset--color--biscay);
    outline-offset: 2px;
}

.calendar-btn__icon {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

.calendar-btn__text {
    white-space: nowrap;
}

/* Calendar Button Variants */
.calendar-btn--google {
    background-color: var(--wp--preset--color--saffron);
}

.calendar-btn--google:hover {
    background-color: var(--wp--preset--color--saffron-dark);
}

.calendar-btn--ical {
    background-color: var(--wp--preset--color--neutral-lightest);
    color: var(--wp--preset--color--cape-cod-dark);
}

.calendar-btn--ical:hover {
    background-color: var(--wp--preset--color--neutral-lighter);
}

.calendar-btn--outlook {
    background-color: var(--wp--preset--color--biscay-lightest);
    color: var(--wp--preset--color--biscay-dark);
}

.calendar-btn--outlook:hover {
    background-color: var(--wp--preset--color--biscay-lighter);
}

/* =====================================================
   SHARE BUTTONS SECTION
   ===================================================== */

.share-section {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.share-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wp--custom--spacing--xs);
    justify-content: center;
}

/* Share Button Base Styles */
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-family: var(--wp--preset--font-family--poppins);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    color: var(--wp--preset--color--neutral-white);
    background-color: var(--wp--preset--color--biscay);
    border: none;
    border-radius: 0.29rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.share-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.share-btn:focus {
    outline: 2px solid var(--wp--preset--color--saffron);
    outline-offset: 2px;
}

.share-btn__icon {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

.share-btn__text {
    white-space: nowrap;
}

/* Share Button Variants */
.share-btn--facebook {
    background-color: var(--wp--preset--color--biscay);
}

.share-btn--facebook:hover {
    background-color: var(--wp--preset--color--biscay-dark);
}

.share-btn--twitter {
    background-color: var(--wp--preset--color--cape-cod-dark);
}

.share-btn--twitter:hover {
    background-color: var(--wp--preset--color--cape-cod-darker);
}

.share-btn--linkedin {
    background-color: var(--wp--preset--color--biscay-light);
}

.share-btn--linkedin:hover {
    background-color: var(--wp--preset--color--biscay);
}

.share-btn--email {
    background-color: var(--wp--preset--color--cerise-red);
}

.share-btn--email:hover {
    background-color: var(--wp--preset--color--cerise-red-dark);
}

/* Copy Link Button */
.copy-link-container {
    margin-top: var(--wp--custom--spacing--sm);
}

.copy-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-family: var(--wp--preset--font-family--poppins);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1;
    color: var(--wp--preset--color--cape-cod-dark);
    background-color: transparent;
    border: 1px dashed var(--wp--preset--color--cape-cod-light);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.copy-link-btn:hover {
    border-color: var(--wp--preset--color--biscay);
    color: var(--wp--preset--color--biscay);
    background-color: var(--wp--preset--color--biscay-lightest);
}

.copy-link-btn:focus {
    outline: 2px solid var(--wp--preset--color--biscay);
    outline-offset: 2px;
}

.copy-link-btn--copied {
    border-color: var(--wp--preset--color--saffron);
    color: var(--wp--preset--color--saffron-darker);
    background-color: var(--wp--preset--color--saffron-lightest);
}

.copy-link-btn__icon {
    flex-shrink: 0;
    width: 0.875rem;
    height: 0.875rem;
}

.copy-link-btn__text {
    white-space: nowrap;
}

/* =====================================================
   RESPONSIVE STYLES
   ===================================================== */

/* Tablet and below */
@media (max-width: 768px) {
    .calendar-buttons-container {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-btn {
        width: 100%;
        justify-content: center;
        padding: 0.625rem 1rem;
    }

    .share-buttons-container {
        flex-wrap: wrap;
        gap: 0.375rem;
    }

    .share-btn {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 0;
        justify-content: center;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .share-btn {
        flex: 1 1 100%;
    }

    .share-btn__text {
        flex: 1;
    }

    .calendar-btn__text {
        flex: 1;
    }
}