/* Charity page: uniform welfare program cards + details modal -------------- */

/* ── Uniform cards ─────────────────────────────────────────────────────────── */
.company-donations-swiper .swiper-slide {
    height: auto; /* slides stretch to the same height inside the slider row */
    display: flex;
}

.company-donations-swiper .company-donation-card {
    width: 100%;
    cursor: pointer;
}

.company-donation-card:focus-visible {
    outline: 3px solid var(--primary-green, #4caf50);
    outline-offset: 3px;
}

/* Fixed-proportion image frame */
.donation-img-wrapper {
    height: auto;
    aspect-ratio: 16 / 10;
    flex: 0 0 auto;
}

/* Titles: at most two lines, always reserving two lines so descriptions line up */
.donation-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

/* Description excerpt: three lines, then an ellipsis */
.donation-card-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 0 0 auto;
    margin-bottom: 12px;
}

.donation-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-green, #4caf50);
}

.donation-read-more i {
    font-size: 11px;
    transition: transform 0.25s;
}

.company-donation-card:hover .donation-read-more i,
.company-donation-card:focus-visible .donation-read-more i {
    transform: translateX(4px);
}

/* Meta block sticks to the bottom and keeps the same height whether one or two lines are filled */
.donation-meta {
    margin-top: auto;
    min-height: 66px;
}

.donation-meta-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ── Details modal ─────────────────────────────────────────────────────────── */
.program-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(10, 24, 16, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.program-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease, visibility 0s;
}

.program-modal__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    transform: translateY(24px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.program-modal.is-open .program-modal__dialog {
    transform: none;
}

.program-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.program-modal__close:hover,
.program-modal__close:focus-visible {
    background: #000;
    transform: rotate(90deg);
}

.program-modal__media {
    position: relative;
    flex: 0 0 auto;
    aspect-ratio: 16 / 8;
    background: #e8efe4;
}

.program-modal__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.program-modal__badge {
    top: 14px;
    right: auto;
    left: 14px; /* the close button sits on the right */
}

.program-modal__body {
    padding: 24px 28px 28px;
    overflow-y: auto; /* only the text area scrolls when a description is very long */
}

.program-modal__title {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.3;
    color: #1a1a1a;
}

.program-modal__subtitle {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-green, #4caf50);
}

.program-modal__subtitle:empty {
    display: none;
}

.program-modal__text {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.8;
    color: #555;
    white-space: pre-line; /* keep paragraph breaks entered in the admin */
}

.program-modal__meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 16px 0 0;
    list-style: none;
    border-top: 1px solid #eee;
}

.program-modal__meta li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #444;
}

.program-modal__meta li[hidden] {
    display: none;
}

.program-modal__meta i {
    margin-top: 3px;
    color: var(--primary-green, #4caf50);
}

body.program-modal-open {
    overflow: hidden;
}

@media (max-width: 575px) {
    .program-modal__dialog {
        border-radius: 18px;
    }

    .program-modal__media {
        aspect-ratio: 16 / 10;
    }

    .program-modal__body {
        padding: 18px 18px 22px;
    }

    .program-modal__title {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .program-modal,
    .program-modal__dialog,
    .program-modal__close {
        transition-duration: 0.01s;
    }
}
