/* micromodal.css */

/* Hide by default, show when .is-open is added */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.modal.is-open {
    display: block;
}

/* Semi-transparent dark overlay */
.modal__overlay {
    background-color: rgba(0, 0, 0, 0);
    position: fixed;
    inset: 0;
    cursor: pointer;
}

/* Centered container with slide-in */
.modal__container {
    background: #fff;
    position: absolute;
    max-width: 320px;
    width: auto;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    animation: micromodal-slide-in 0.3s ease-out forwards;
    box-shadow: 0px 0px 10px 2px rgba(0,0,0,0.5);
    -webkit-box-shadow: 0px 0px 10px 2px rgba(0,0,0,0.5);
    -moz-box-shadow: 0px 0px 10px 2px rgba(0,0,0,0.5);
}

/* Header layout */
.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Close button (“X”) */
.modal__close {
    background: none;
    border: none;
    font-size: 0.8rem;
    line-height: 1;
    color: #000;
    cursor: pointer;
}
.modal__close:hover {
    background: none;
    color: #000;
}

    /* Content area */
.modal__content {
    margin-top: 1rem;
    font-size: 1rem;
    line-height: 1.4;
}

/* Modal Positioning */
#state-info-modal,
#state-info-modal .modal__overlay {
    position: absolute !important;
}

/* Ensure the overlay still covers the entire page */
#state-info-modal .modal__overlay {
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh * 5);
    cursor: auto;
}

/* Slide-in animation keyframes */
@keyframes micromodal-slide-in {
    from {
        transform: translateY(-10%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* -------------------------------- */
/* Truly center the modal on phones */
/* -------------------------------- */
@media (max-width: 600px) {
    /* Make sure the overlay and modal wrapper are fixed in the viewport */
    #state-info-modal,
    #state-info-modal .modal__overlay {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    /* Center the container by its midpoint */
    #state-info-modal .modal__container {
        position: fixed !important;
        top: 50%    !important;
        left: 50%   !important;
        transform: translate(-50%, -50%) !important;
        /* give a little breathing room on the sides */
        max-width: 90% !important;
        margin: 0 5%   !important;
    }
}
