/* =========================================================
   CITY MISSION
   ADVENTURES / MISSION SELECTION
   ========================================================= */


/* =========================================================
   MISSION LIST
   ========================================================= */

.mission-list {
    display: grid;
    grid-template-columns: 1fr;

    gap: 18px;
}


/* =========================================================
   MISSION CARD
   ========================================================= */

.mission-card {
    position: relative;

    padding: 28px;

    display: flex;
    flex-direction: column;

    background: #ffffff;

    border: 1px solid #e4ddd2;
    border-top: 5px solid #f6c445;
    border-radius: 8px;

    box-shadow:
        0 8px 24px rgba(24, 49, 83, 0.08);
}

.mission-card-top {
    margin-bottom: 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}

.mission-code {
    color: #78899a;

    font-size: 0.68rem;
    font-weight: 800;

    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.mission-card h2 {
    margin-bottom: 12px;

    color: #183153;

    font-size: 1.5rem;
    line-height: 1.15;
}

.mission-card > p:not(.mission-code) {
    margin-bottom: 20px;

    color: #52677c;

    font-size: 0.9rem;
    line-height: 1.65;
}

/* =========================================================
   MISSION DETAILS
   ========================================================= */

.mission-details {
    margin-bottom: 25px;

    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}

.mission-details span {
    padding: 7px 10px;

    background: #f4f7f8;

    border: 1px solid #dce4e8;
    border-radius: 20px;

    color: #52677c;

    font-size: 0.65rem;
    font-weight: 700;

    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/*
 * Push the primary mission action to the bottom
 * so cards remain visually aligned when descriptions
 * have different lengths.
 */

.mission-card > .btn {
    width: 100%;

    margin-top: auto;
}


/* =========================================================
   RACE INFO BUTTON
   ========================================================= */
.race-info-button {
    flex-shrink: 0;

    padding: 6px 10px;

    display: inline-flex;
    align-items: center;

    gap: 6px;

    border: 1px solid #ccd7de;
    border-radius: 20px;

    background: #f4f7f8;
    color: #52677c;

    cursor: pointer;

    font-size: 0.65rem;
    font-weight: 800;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.race-info-button:hover {
    border-color: #20a39e;

    color: #16817d;
}

.race-info-icon {
    width: 18px;
    height: 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid currentColor;
    border-radius: 50%;

    font-size: 0.7rem;
    font-weight: 900;

    line-height: 1;
}


/* =========================================================
   RACE INFORMATION MODAL
   ========================================================= */

.race-modal {
    position: fixed;
    inset: 0;

    z-index: 2000;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;
}


.race-modal.is-open {
    display: flex;
}


.race-modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.82);
}

.race-modal-window {
    position: relative;

    z-index: 1;

    width: 100%;
    max-width: 650px;
    max-height: 85vh;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #dce4e8;
    border-top: 5px solid #f6c445;
    border-radius: 8px;

    box-shadow:
        0 30px 90px rgba(24, 49, 83, 0.22);
}

/* =========================================================
   MODAL HEADER
   ========================================================= */
.race-modal-header {
    padding: 22px 22px 18px;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    background: #fff8ed;

    border-bottom: 1px solid #eadfce;
}

.race-modal-header h2 {
    color: #183153;

    font-size: 1.7rem;
    line-height: 1.1;
}

.race-modal-header .eyebrow {
    margin-bottom: 5px;
}
.race-modal-close {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #d5dee4;
    border-radius: 50%;

    background: #ffffff;
    color: #52677c;

    cursor: pointer;

    font-size: 1.5rem;
    line-height: 1;
}

.race-modal-close:hover {
    border-color: #f45b4f;

    color: #f45b4f;
}
/* =========================================================
   MODAL SCROLLABLE CONTENT
   ========================================================= */
.race-modal-content {
    padding: 22px;

    overflow-y: auto;

    background: #ffffff;

    color: #52677c;

    overscroll-behavior: contain;
}
.race-info-section {
    padding: 0 0 24px;
    margin-bottom: 24px;

    border-bottom: 1px solid #e3e8eb;
}

.race-info-section h3 {
    margin-bottom: 9px;

    color: #183153;

    font-size: 1rem;
}

.race-info-section p {
    margin-bottom: 10px;

    color: #52677c;

    font-size: 0.88rem;
    line-height: 1.7;
}

.race-info-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;

    border-bottom: 0;
}

.race-info-section p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   DATABASE-DRIVEN RACE DETAILS
   ========================================================= */
.race-info-details {
    display: grid;

    gap: 10px;
}

.race-info-detail {
    padding: 13px 15px;

    background: #f4f7f8;

    border: 1px solid #dce4e8;
    border-radius: 6px;
}

.race-info-detail-label {
    display: block;

    margin-bottom: 3px;

    color: #16817d;

    font-size: 0.65rem;
    font-weight: 800;

    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.race-info-detail-value {
    color: #183153;

    font-size: 0.88rem;
    line-height: 1.5;
}
/* =========================================================
   MODAL FOOTER
   ========================================================= */
.race-modal-footer {
    padding: 16px 22px;

    border-top: 1px solid #e3e8eb;

    background: #f4f7f8;
}

.race-modal-footer .btn {
    width: 100%;
}

/* =========================================================
   MODAL BODY STATE
   ========================================================= */

body.modal-open {
    overflow: hidden;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (min-width: 500px) {

    .race-modal-window {
        max-height: 80vh;
    }

}


@media (min-width: 700px) {

    .mission-list {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (min-width: 1000px) {

    .mission-list {
        grid-template-columns: repeat(3, 1fr);
    }

}