/* ===== MGP Awardees: Grid + Modal (starter) ===== */

/* Optional design tokens (tweak to your brand) */
:root {
    --mgp-gap: 1rem;
    --mgp-card-radius: 14px;
    --mgp-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    --mgp-shadow-hover: 0 10px 28px rgba(0, 0, 0, .16);
    --mgp-border: 1px solid rgba(0, 0, 0, .08);
    --mgp-backdrop: rgba(0, 0, 0, .55);
    --mgp-modal-radius: 18px;
    --mgp-max-modal-w: min(960px, 92vw);
}

/* Grid */
.mgp-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--mgp-gap);
    align-items: stretch;
}

/* Responsive columns */
@media (max-width: 599px) {
    .mgp-grid>.mgp-card {
        grid-column: span 12;
    }
}

@media (min-width: 600px) and (max-width: 959px) {
    .mgp-grid>.mgp-card {
        grid-column: span 6;
    }
}

@media (min-width: 960px) {
    .mgp-grid>.mgp-card {
        grid-column: span 4;
    }
}

/* Cards */
.mgp-card {
    display: grid;
    grid-template-rows: auto 1fr;
    background: #fff;
    border: var(--mgp-border);
    border-radius: var(--mgp-card-radius);
    overflow: hidden;
    box-shadow: var(--mgp-shadow);
    transition: transform .15s ease, box-shadow .15s ease;
    cursor: pointer;
}

.mgp-card:focus,
.mgp-card:hover {
    box-shadow: var(--mgp-shadow-hover);
    transform: translateY(-1px);
    outline: none;
}

/* Card image */
.mgp-photo {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

/* Card text */
.mgp-summary {
    padding: 0.9rem 1rem 1.1rem;
}

.mgp-summary h2 {
    margin: 0 0 .35rem 0;
    font-size: 1.05rem;
    line-height: 1.25;
}

.mgp-summary p {
    margin: 0 0 .5rem 0;
    line-height: 1.45;
}

.mgp-summary p:last-child {
    margin-bottom: 0;
}

/* ===== Modal ===== */
.mgp-modal {
    position: fixed;
    inset: 0;
    background: var(--mgp-backdrop);
    display: none;
    /* hidden by default */
    align-items: center;
    justify-content: center;
    padding: 4vmin;
    z-index: 1000;
}

.mgp-modal.is-open {
    display: flex;
}

/* Prevent body scroll when any modal is open */
.mgp-scroll-lock {
    overflow: hidden !important;
}

/* Modal panel */
.mgp-modal-content {
    width: var(--mgp-max-modal-w);
    max-height: 88vh;
    overflow: auto;
    background: #fff;
    border-radius: var(--mgp-modal-radius);
    box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 1.25rem;
    padding: 1.25rem;
}

/* Stack on small screens */
@media (max-width: 800px) {
    .mgp-modal-content {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}

/* Modal image/text */
.modal-photo {
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 12px;
}

.modal-text {
    min-width: 0;
}

.modal-text h2 {
    margin: 0 0 .5rem 0;
    font-size: 1.35rem;
}

.modal-text p {
    margin: 0 0 .75rem 0;
    line-height: 1.6;
}

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

/* Close button */
.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 28px;
    line-height: 1;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: .25rem .4rem;
    border-radius: 8px;
}

.modal-close:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: no-preference) {
    .mgp-modal.is-open .mgp-modal-content {
        animation: mgp-pop .16s ease-out;
    }
}

@keyframes mgp-pop {
    from {
        transform: translateY(6px);
        opacity: .92;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}