/* ==========================================================================
   MEDINFO 2027 | Home page committee section
   Every class starts with "mi-cmt" or "mi-pc", so nothing here touches the
   rest of the site. Colours are the MEDINFO brand colours from medinfo.css.
   ========================================================================== */

.mi-cmts {
    --mi-navy: #12305c;
    --mi-navy-deep: #0c2447;
    --mi-blue: #1c4e9b;
    --mi-blue-mid: #2c79c4;
    --mi-cyan: #2f97d4;
    --mi-text-soft: #5b6c82;
    --mi-tint: #f2f7fd;
    /* Light band at rest, a darker MEDINFO blue on hover */
    --mi-band: linear-gradient(120deg, #e8f2fb 0%, #d0e4f5 100%);
    --mi-band-hover: linear-gradient(120deg, #2f97d4 0%, #2c79c4 45%, #1c4e9b 100%);
    --mi-ease: cubic-bezier(.2, .7, .2, 1);
    --mi-gap: clamp(12px, 1.4vw, 20px);

    position: relative;
    padding: 80px 0;
    font-family: "Inter", sans-serif;
    background: linear-gradient(180deg, #ffffff 0%, var(--mi-tint) 12%, var(--mi-tint) 100%);
}

.mi-cmts *,
.mi-cmts *::before,
.mi-cmts *::after { box-sizing: border-box; }

/* Same widths as the site's Bootstrap .container, so the section lines up with the rest of the page */
.mi-cmts__wrap { width: 100%; margin-inline: auto; padding-inline: 12px; }
@media (min-width: 576px)  { .mi-cmts__wrap { max-width: 540px; } }
@media (min-width: 768px)  { .mi-cmts__wrap { max-width: 720px; } }
@media (min-width: 992px)  { .mi-cmts__wrap { max-width: 960px; } }
@media (min-width: 1200px) { .mi-cmts__wrap { max-width: 1140px; } }
@media (min-width: 1400px) { .mi-cmts__wrap { max-width: 1320px; } }

/* Section title: matches the other home page section titles */
.mi-cmts .mi-cmts__title {
    margin: 10px 0 30px;
    font-family: "Inter", sans-serif;
    font-size: 50px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: normal;
    text-align: center;
    color: #000;
}

/* Group (committee) */
.mi-cmt + .mi-cmt { margin-top: clamp(40px, 5vw, 72px); }

.mi-cmts .mi-cmt__title {
    margin: 0;
    font-family: "Inter", sans-serif;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
    text-align: center;
    color: var(--mi-navy);
}

.mi-cmt__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--mi-gap);
    margin-top: clamp(18px, 2.2vw, 30px);
}

/* Desktop: 5 cards a row; the 4-member group keeps the same card width, centred */
.mi-pc { flex: 0 0 calc((100% - 4 * var(--mi-gap)) / 5); min-width: 0; }

/* Card */
.mi-pc__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 0 16px 22px;
    overflow: hidden;
    text-align: center;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 10px 28px rgba(18, 48, 92, .08);
    transition: transform .7s var(--mi-ease), box-shadow .7s var(--mi-ease);
}

.mi-pc__band {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 88px;
    background: var(--mi-band);
}

.mi-pc__band::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--mi-band-hover);
    opacity: 0;
    transition: opacity .7s ease;
}

.mi-pc__photo {
    position: relative;
    flex: 0 0 auto;
    display: block;
    width: 168px;
    aspect-ratio: 1 / 1;
    margin-top: 22px;
    overflow: hidden;
    background: #fff;
    border-radius: 26px;
    box-shadow: 0 0 0 5px #fff, 0 14px 30px rgba(18, 48, 92, .18);
}

.mi-pc__photo img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 50% 16%;
    transition: transform 1.1s var(--mi-ease);
}

.mi-cmts .mi-pc__name {
    position: relative;
    margin: 18px 0 0;
    font-family: "Inter", sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.24;
    letter-spacing: -0.012em;
    color: var(--mi-blue);
    transition: color .4s ease;
}

/* Committee role (Chair, Co-Chair) */
.mi-pc__role {
    position: relative;
    display: block;
    margin-top: 6px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--mi-blue);
}

/* Country, as on the live site */
.mi-pc__meta {
    position: relative;
    display: block;
    margin-top: 6px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--mi-text-soft);
}
.mi-pc__role + .mi-pc__meta { margin-top: 2px; }

/* Hover: card lifts, band turns a darker MEDINFO blue, photo zooms gently */
.mi-pc__card:hover { transform: translateY(-5px); box-shadow: 0 22px 46px rgba(18, 48, 92, .16); }
.mi-pc__card:hover .mi-pc__band::before { opacity: 1; }
.mi-pc__card:hover .mi-pc__photo img { transform: scale(1.05); }
.mi-pc__card:hover .mi-pc__name { color:var(--mi-navy-deep); }

/* Reveal on scroll (only when mi-committee.js runs) */
.mi-cmts.mi-js [data-mi-rise] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .9s var(--mi-ease) var(--mi-d, 0ms), transform .9s var(--mi-ease) var(--mi-d, 0ms);
}
.mi-cmts.mi-js [data-mi-rise].is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1399px) {
    .mi-cmts .mi-cmts__title { font-size: 42px; }
    .mi-cmts .mi-pc__name { font-size: 17px; }
}

/* Tablet: 3 cards a row; the 4-member group sits 2 + 2 at the same card width */
@media (max-width: 1199px) {
    .mi-cmts .mi-cmts__title { font-size: 36px; }
    .mi-cmts .mi-pc__name { font-size: 18px; }
    .mi-pc { flex-basis: calc((100% - 2 * var(--mi-gap)) / 3); }
    .mi-cmt__grid--4 { max-width: calc(2 * (100% - 2 * var(--mi-gap)) / 3 + var(--mi-gap)); margin-inline: auto; }
    .mi-cmt__grid--4 .mi-pc { flex-basis: calc((100% - var(--mi-gap)) / 2); }
}

@media (max-width: 991px) {
    .mi-cmts { padding: 40px 0 56px; }
    .mi-cmts .mi-cmts__title { font-size: 32px; margin-bottom: 24px; }
}

/* Phone: 2 cards a row, compact cards */
@media (max-width: 767px) {
    .mi-cmts .mi-cmts__title { font-size: 28px; margin-top: 5px; }
    .mi-cmts .mi-cmt__title { font-size: 26px; }
    .mi-pc,
    .mi-cmt__grid--4 .mi-pc { flex-basis: calc((100% - var(--mi-gap)) / 2); }
    .mi-cmt__grid--4 { max-width: none; }
    .mi-pc__card { padding: 0 8px 14px; border-radius: 16px; }
    .mi-pc__band { height: 62px; }
    .mi-pc__photo { width: min(100%, 118px); margin-top: 14px; border-radius: 20px; }
    .mi-cmts .mi-pc__name { margin-top: 12px; font-size: 15px; }
    .mi-pc__role,
    .mi-pc__meta { margin-top: 4px; font-size: 12px; }
}

@media (max-width: 575px) { .mi-cmts .mi-cmts__title { font-size: 25px; } }
@media (max-width: 479px) {
    .mi-cmts .mi-cmts__title { font-size: 22px; }
    .mi-cmts .mi-cmt__title { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .mi-cmts.mi-js [data-mi-rise] { opacity: 1; transform: none; transition: none; }
    .mi-pc__card,
    .mi-pc__photo img,
    .mi-pc__band::before { transition: none; }
}
