.mou-listing {
    padding: 85px 0 100px;
    background: #f5f9fc;
}

.mou-container {
    width: min(calc(100% - 48px), 1380px);
    margin-inline: auto;
}

.mou-section-heading {
    max-width: 750px;
    margin: 0 auto 48px;
    text-align: center;
}

.mou-section-heading > span {
    color: #1686a7;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: capitalize;
}

.mou-section-heading h2 {
    margin: 10px 0 12px;
    color: #0d4f80;
    font-size: clamp(2rem, 3.2vw, 2.8rem);
}

.mou-section-heading p {
    margin: 0;
    color: #617583;
    line-height: 1.7;
}

.mou-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 23px;
}

.mou-card {
    height: 460px;
    display: grid;
    grid-template-rows: 220px 1fr;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(13, 79, 128, 0.11);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(16, 62, 94, 0.08);
    transition:
        transform 220ms ease,
        box-shadow 220ms ease;
}

.mou-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(16, 62, 94, 0.14);
}

.mou-card-image {
    position: relative;
    overflow: hidden;
    height: 220px;
    background: #e8f0f5;
}

.mou-card-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 400ms ease;
}

.mou-card:hover .mou-card-image img {
    transform: scale(1.04);
}

.mou-country {
    display: flex;
    align-items: center;
    margin-top: 6px;
    margin-bottom: 6px;
    color: #1686a7;
    font-size: 0.82rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
}

.mou-card-content {
    min-height: 0;
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mou-card-content h3 {
    height: 3em;          /* exactly 2 lines reserved */
    min-height: 3em;
    max-height: 3em;
    margin: 0;
    display: -webkit-box;
    overflow: hidden;
    color: #123f60;
    font-size: 1rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    flex-shrink: 0;
}

.mou-card-footer {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #e7eef2;
    flex-shrink: 0;
}

.mou-card-footer time {
    color: #6a7d89;
    font-size: 0.76rem;
}

.mou-know-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 7px 18px;
    color: var(--primary-deep);
    background: transparent;
    border: 1.5px solid var(--primary-deep);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: background 200ms ease, color 200ms ease;
}

.mou-know-more:hover {
    background: var(--primary-deep);
    color: #ffffff;
}

.mou-empty {
    padding: 35px;
    color: #627582;
    text-align: center;
}

@media (max-width: 1199px) {
    .mou-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 899px) {
    .mou-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .mou-listing {
        padding: 55px 0 65px;
    }

    .mou-container {
        width: min(calc(100% - 28px), 1380px);
    }

    .mou-grid {
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .mou-card {
        height: 390px;
        grid-template-rows: 200px 1fr;
    }

    .mou-card-image {
        height: 200px;
    }
}

/* ==================== MOU DETAILS PAGE ==================== */

.mou-detail-page {
    padding: 135px 0 90px;
    background: #f4f8fb;
}

.mou-detail-container {
    width: min(calc(100% - 48px), 1150px);
    margin-inline: auto;
}

.mou-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    color: #0b5c91;
    font-weight: 600;
    text-decoration: none;
    transition: color 200ms ease;
}

.mou-back-link:hover {
    color: #083c61;
}

.mou-detail-header {
    margin-bottom: 30px;
}

.mou-detail-header > span {
    color: #1685a7;
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: capitalize;
}

.mou-detail-header h1 {
    max-width: 950px;
    margin: 9px 0 14px;
    color: #123e5d;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.25;
}

.mou-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    color: #657984;
    font-size: 0.88rem;
}

/* ── Hero image (first image, shown prominently) ── */
.mou-hero-image {
    width: 100%;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 36px;
    background: #dfe9ef;
    box-shadow: 0 8px 28px rgba(13, 79, 128, 0.13);
}

.mou-hero-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.mou-slider {
    position: relative;
    height: clamp(310px, 52vw, 630px);
    overflow: hidden;
    background: #dfe9ef;
    border-radius: 16px;
}

.mou-slider-track {
    height: 100%;
    display: flex;
    transition: transform 550ms ease;
}

.mou-slide {
    flex: 0 0 100%;
    height: 100%;
}

.mou-slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.mou-slider-arrow {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    transform: translateY(-50%);
    color: #0d4f80;
    background: rgba(255, 255, 255, 0.92);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: background 200ms ease, transform 200ms ease;
}

.mou-slider-arrow:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.08);
}

.mou-slider-arrow.previous {
    left: 18px;
}

.mou-slider-arrow.next {
    right: 18px;
}

.mou-slider-dots {
    position: absolute;
    right: 0;
    bottom: 17px;
    left: 0;
    display: flex;
    justify-content: center;
    gap: 7px;
}

.mou-slider-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: width 300ms ease, background 300ms ease;
}

.mou-slider-dot.active {
    width: 24px;
    border-radius: 10px;
    background: #ffffff;
}

.mou-description {
    max-width: 940px;
    margin: 42px auto 0;
    padding-top: 30px;
    border-top: 2px solid #d8a41f;
}

.mou-description h2 {
    margin: 0 0 17px;
    color: #123e5d;
    font-size: 1.75rem;
}

.mou-description p {
    margin: 0 0 17px;
    color: #344f61;
    font-size: 1rem;
    line-height: 1.85;
}

.mou-document-link {
    display: inline-flex;
    margin-top: 12px;
    padding: 11px 17px;
    color: #ffffff;
    background: #0b5c91;
    border-radius: 7px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 200ms ease;
}

.mou-document-link:hover {
    background: #084873;
}

/* Gallery slider (shown only when >1 image) */
.mou-gallery-slider {
    margin-top: 48px;
}

.mou-gallery-label {
    position: absolute;
    top: 16px;
    left: 20px;
    z-index: 2;
    margin: 0;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.45);
    text-transform: uppercase;
}

@media (max-width: 575px) {
    .mou-detail-page {
        padding: 105px 0 60px;
    }

    .mou-detail-container {
        width: min(calc(100% - 28px), 1150px);
    }

    .mou-slider {
        height: 280px;
        border-radius: 12px;
    }

    .mou-slider-arrow {
        width: 36px;
        height: 36px;
    }

    .mou-slider-arrow.previous {
        left: 10px;
    }

    .mou-slider-arrow.next {
        right: 10px;
    }

    .mou-description {
        margin-top: 30px;
    }

    .mou-description p {
        font-size: 0.9rem;
        line-height: 1.75;
    }

    .mou-hero-image {
        aspect-ratio: 4 / 3;
        border-radius: 10px;
        margin-bottom: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mou-card,
    .mou-card-image img,
    .mou-slider-track {
        transition: none !important;
    }
    .mou-card:hover {
        transform: none !important;
    }
}

/* ==================== ADMIN PREVIEW STYLES ==================== */
.admin-image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.admin-preview-item {
    position: relative;
    width: 110px;
    height: 95px;
    border: 1px solid #d0dfe8;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
}

.admin-preview-item img {
    width: 100%;
    height: 65px;
    object-fit: cover;
    display: block;
}

.admin-preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 30px;
    padding: 0 4px;
    background: #eef4f8;
    border-top: 1px solid #dce7ee;
}

.admin-preview-btn {
    border: none;
    background: transparent;
    color: #0b5c91;
    cursor: pointer;
    font-size: 0.72rem;
    padding: 2px 4px;
    border-radius: 3px;
}

.admin-preview-btn:hover {
    background: rgba(11, 92, 145, 0.15);
}

.admin-preview-btn.remove-btn {
    color: #dc3545;
}

.admin-preview-btn.remove-btn:hover {
    background: rgba(220, 53, 69, 0.15);
}
