/* ==========================================================================
   Shared Site Modal
   ========================================================================== */

.site-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4%;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    will-change: opacity, visibility;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.site-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.site-modal {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background-color: #fff;
    border-radius: var(--border-radius-medium);
    overflow: hidden;
    transform: translateY(40px);
    will-change: transform;
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
}

.site-modal[data-modal-type="experiencias"],
.site-modal[data-modal-type="projetos"] {
    max-width: 768px;
}

.site-modal-overlay.is-open .site-modal {
    transform: translateY(0);
}

/* Close button */
.site-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.4);
    border: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.15s ease-out;
    z-index: 10;
}

.site-modal-close svg {
    width: 14px;
    height: auto;
}

.site-modal-close:hover {
    background-color: var(--color-accent-primary);
}

/* Loading spinner */
.site-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    flex: 1;
}

.site-modal-spinner {
    width: 50px;
    height: 50px;
    animation: siteModalSpin 1.2s linear infinite;
}

@keyframes siteModalSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Content area */
.site-modal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-height: 90vh;
}

.site-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.site-modal[data-modal-type="agenda"] .site-modal-body {
    padding-top: 0;
}

/* Thumb */
.site-modal-thumb {
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    background-color: #f5f5f5;
    margin: 0 -25px 0 -25px;
    width: calc(100% + 50px);
}

.site-modal-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

/* Header (dates + title) */
.site-modal-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    justify-content: flex-start;
}

.site-modal-dates {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
}

.site-modal-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--color-accent-primary);
    color: #fff;
    padding: 10px 15px;
    border-radius: var(--border-radius-small);
    min-width: 60px;
}

.site-modal-date .day {
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
}

.site-modal-date .month {
    font-size: 12px;
    line-height: 1;
    text-transform: uppercase;
    font-weight: 400;
    margin-top: 4px;
}

.site-modal-date-separator {
    font-size: calc(var(--font-size-large) * 3);
    color: var(--color-accent-primary);
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Head block: title + description */
.site-modal-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-modal-title {
    font-weight: 700;
    text-wrap: balance;
}

.site-modal-description {
    color: var(--color-text-secondary);
}

/* Category badges swiper */
.site-modal-badges {
    width: 100%;
    padding-top: 5px;
}

.site-modal-badges-slider {
    position: relative;
    overflow: hidden;
}

.modal-badges-swiper {
    padding: 0;
}

.modal-badges-swiper .swiper-slide {
    width: auto;
    flex-shrink: 0;
}

.modal-badges-swiper .swiper-slide img {
    width: 70px;
    height: 70px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
}

.site-modal-badges-slider .swiper-button-prev,
.site-modal-badges-slider .swiper-button-next {
    position: absolute;
    top: 0 !important;
    transform: none;
    margin-top: 0;
    width: auto;
    height: 100%;
    border-radius: 0;
    background-color: transparent;
    z-index: 10;
    display: flex;
    align-items: center;
    pointer-events: none;
    --swiper-navigation-size: 0px;
}

.site-modal-badges-slider .swiper-button-prev svg,
.site-modal-badges-slider .swiper-button-next svg,
.site-modal-badges-slider .swiper-button-prev .swiper-navigation-icon,
.site-modal-badges-slider .swiper-button-next .swiper-navigation-icon {
    display: none !important;
}

.site-modal-badges-slider .swiper-button-prev::after,
.site-modal-badges-slider .swiper-button-next::after {
    display: none !important;
}

.site-modal-badges-slider .swiper-button-next {
    right: 0 !important;
    left: auto !important;
    padding-right: 8px;
    padding-left: 18px;
    background: linear-gradient(to right, transparent, #fff);
    justify-content: flex-end;
}

.site-modal-badges-slider .swiper-button-prev {
    left: 0 !important;
    right: auto !important;
    padding-left: 8px;
    padding-right: 18px;
    background: linear-gradient(to left, transparent, #fff);
    justify-content: flex-start;
}

.site-modal-badges-slider .swiper-button-prev::before,
.site-modal-badges-slider .swiper-button-next::before {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    min-width: 30px;
    pointer-events: auto;
    cursor: pointer;
    border-radius: 50%;
    background-color: var(--color-accent-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 13px;
    flex-shrink: 0;
}

.site-modal-badges-slider .swiper-button-prev::before {
    transform: rotate(180deg);
}

.site-modal-description p {
    margin: 0 0 10px 0;
}

.site-modal-description p:last-child {
    margin-bottom: 0;
}

.site-modal-description strong,
.site-modal-description b {
    font-weight: 700;
    color: var(--color-text-primary);
}

/* Slideshow inside modal */
.site-modal-slideshow {
    width: calc(100% + 50px);
    margin-left: -25px;
    margin-right: -25px;
}

.site-modal-slideshow .slideshow-component-wrapper {
    border-radius: 0;
}

/* Details block: intro + detalhes */
.site-modal-details-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Intro text (green, weight 500) */
.site-modal-intro {
    color: var(--color-green);
    font-weight: 500;
    font-size: 23px;
    line-height: 30px;
    text-wrap: balance;
}

/* Details (wysiwyg) */
.site-modal-detalhes {
    color: var(--color-text-secondary);
}

.site-modal-detalhes p {
    margin: 0 0 10px 0;
}

.site-modal-detalhes p:last-child {
    margin-bottom: 0;
}

.site-modal-detalhes ul,
.site-modal-detalhes ol {
    margin: 10px 0;
    padding-left: 20px;
}

.site-modal-detalhes li {
    margin-bottom: 5px;
}

/* Footer */
.site-modal-footer {
    padding: 15px 15px;
    background-color: #EFECE5;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.site-modal-footer .button-holder {
    margin-top: 0;
}

.site-modal-footer-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-modal-footer-buttons .button.modal-btn-orange {
    margin-left: auto;
}

.site-modal-footer-buttons .button {
    display: inline-flex;
    align-items: center;
    padding: 10px 25px;
    border-radius: 50px;
    color: #fff;
    font-size: 14px;
    line-height: 21px;
    -webkit-user-select: none;
    user-select: none;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    gap: 15px;
    text-wrap: nowrap;
    will-change: background-color, color;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.site-modal-footer-buttons .button.modal-btn-green {
    background-color: var(--color-green);
}

.site-modal-footer-buttons .button.modal-btn-green:hover {
    background-color: var(--color-green-hover);
}

.site-modal-footer-buttons .button.modal-btn-orange {
    background-color: var(--color-orange);
}

.site-modal-footer-buttons .button.modal-btn-orange:hover {
    background-color: var(--color-orange-hover);
}

/* Icon support for modal buttons */
.site-modal-footer-buttons .button.map-icon::before,
.site-modal-footer-buttons .button.pin-icon::before,
.site-modal-footer-buttons .button.zap-icon::before {
    content: '';
    display: inline-block;
    width: 22px;
    height: 22px;
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/* Responsive */
@media (max-width: 768px) {
    .site-modal-overlay {
        padding: 0;
    }
    .site-modal-content { height:100%; max-height:unset; }

    .site-modal {
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }

    .site-modal-close {
        width: 40px;
        height: 40px;
    }

    .site-modal-body {
        padding: 20px;
    }

    .site-modal-thumb {
        margin: 0 -20px 0 -20px;
        width: calc(100% + 40px);
    }

    .site-modal-slideshow {
        width: calc(100% + 40px);
        margin-left: -20px;
        margin-right: -20px;
    }


    .site-modal-footer {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 10px 15px;
    }

    .site-modal-footer::-webkit-scrollbar {
        display: none;
    }

    .site-modal-footer-buttons {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 5px;
        width: max-content;
        min-width: 100%;
    }

    .site-modal-footer-buttons .button {
        font-size: 13px;
    }

    .site-modal-intro {
        font-size: 20px;
        line-height: 27px;
    }

}
