/* research.css — filterable card gallery + detail modal for research.html.
   Light, Northeastern-branded theme to match the rest of the site. */

/* ---- Filter pills ---- */
.research-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 30px;
}

.research-filter {
    background: #fff;
    color: #555;
    border: 1px solid #d8d8d8;
    border-radius: 999px;
    padding: 7px 18px;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.research-filter:hover {
    border-color: #CC0000;
    color: #CC0000;
}

.research-filter.active {
    background: #CC0000;
    border-color: #CC0000;
    color: #fff;
    box-shadow: 0 4px 12px rgba(204,0,0,0.28);
}

/* ---- Card grid ---- */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 22px;
    margin-bottom: 20px;
}

.research-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.07);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    outline: none;
}

.research-card:hover,
.research-card:focus {
    transform: translateY(-6px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.16);
}

/* Flagship project (currently: The Variable Zoo Project) — a visually
   distinct treatment so it reads as the lead project, not just another card. */
.research-card--flagship {
    border: 2px solid #2ec4b6;
    box-shadow: 0 8px 26px rgba(46,196,182,0.22);
}
.research-card--flagship:hover,
.research-card--flagship:focus {
    box-shadow: 0 16px 36px rgba(46,196,182,0.3);
}
.rc-flagship-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #2ec4b6;
    color: #04120f;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
}

.rc-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0d0f18;
}

@supports not (aspect-ratio: 16 / 10) {
    .rc-thumb { height: 0; padding-bottom: 62.5%; }
    .rc-thumb img { position: absolute; top: 0; left: 0; }
}

.rc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

/* Variable Zoo card: its logo is square, so fit the whole thing (no crop) on the
   card's dark navy background, with a little breathing room. */
.rc-thumb img[src*="variablezoo.org"] {
    object-fit: contain;
    padding: 18px;
}

.research-card:hover .rc-thumb img,
.research-card:focus .rc-thumb img {
    transform: scale(1.06);
}

.rc-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(204,0,0,0.92);
    color: #fff;
    font-size: 10.5px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
}

.rc-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 18px 18px;
}

.rc-title {
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.35;
    color: #222;
    margin: 0 0 12px;
}

.rc-more {
    margin-top: auto;
    color: #CC0000;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: transform 0.2s ease;
}

.research-card:hover .rc-more {
    transform: translateX(3px);
}

/* ---- Detail modal ---- */
.research-modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(20,20,25,0.62);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.research-modal.open { display: flex; }

.rm-content {
    position: relative;
    display: flex;
    max-width: 1080px;
    width: 100%;
    max-height: 88vh;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4);
    animation: rmPop 0.28s ease;
}

@keyframes rmPop {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.rm-figure {
    flex: 0 0 46%;
    min-width: 0;
    background: #0d0f18;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rm-img {
    width: 100%;
    height: 100%;
    max-height: 88vh;
    object-fit: contain;
    display: block;
    transition: opacity 0.25s ease;
}

.rm-img.loading { opacity: 0.25; }

.rm-info {
    flex: 1 1 54%;
    padding: 34px 34px 30px;
    overflow-y: auto;
}

.rm-cat {
    display: inline-block;
    background: #CC0000;
    color: #fff;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.rm-title {
    color: #1d1d1d;
    font-size: 23px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 16px;
}

.rm-desc {
    font-size: 15px;
    line-height: 1.65;
    color: #3a3a3a;
}

.rm-desc ul {
    padding-left: 20px;
    margin-top: 10px;
}

.rm-desc li { margin-bottom: 8px; }

.rm-collab {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #444;
}

.rm-collab-label {
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 4px;
}

.rm-extras { margin-top: 20px; }
.rm-extras-label {
    font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
    color: #999; margin-bottom: 8px;
}
.rm-extras-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.rm-extra {
    width: 62px; height: 62px; object-fit: cover;
    border-radius: 6px; cursor: pointer; background: #fff;
    border: 1px solid #e2e2e2;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.rm-extra:hover { transform: scale(1.06); border-color: #CC0000; }

.rm-links {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rm-link {
    font-size: 12px !important;
    padding: 8px 16px !important;
}

.rm-counter {
    margin-top: 22px;
    font-size: 12px;
    letter-spacing: 1px;
    color: #aaa;
}

/* Modal controls */
.rm-close,
.rm-prev,
.rm-next {
    position: absolute;
    z-index: 2;
    background: rgba(255,255,255,0.9);
    border: 1px solid #e2e2e2;
    color: #333;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 22px;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.rm-close:hover,
.rm-prev:hover,
.rm-next:hover {
    background: #CC0000;
    color: #fff;
    transform: scale(1.08);
}

.rm-close { top: 14px; right: 14px; font-size: 20px; }
.rm-prev  { top: 50%; left: 14px; transform: translateY(-50%); }
.rm-next  { top: 50%; right: 14px; transform: translateY(-50%); }
.rm-prev:hover { transform: translateY(-50%) scale(1.08); }
.rm-next:hover { transform: translateY(-50%) scale(1.08); }

/* ---- Mobile ---- */
@media (max-width: 767px) {
    .rm-content { flex-direction: column; max-height: 92vh; }
    .rm-figure { flex: 0 0 auto; max-height: 40vh; }
    .rm-img { max-height: 40vh; }
    .rm-info { padding: 24px 22px; }
    .research-grid { grid-template-columns: 1fr; gap: 16px; }
    .rm-prev { left: 8px; }
    .rm-next { right: 8px; }
}
