/*
 * Standalone research-map styles.
 * Kept separate from the legacy theme so the component is not affected by
 * cached copies of main.css and remains compatible with older browsers.
 */
.research-map {
    --research-map-line: #e2e2ef;
    --research-map-ink: #303044;
    --research-map-muted: #73738a;
    margin-top: clamp(2rem, 4vw, 3.5rem);
    overflow-x: auto;
    border: 1px solid var(--research-map-line);
    border-radius: 10px;
    background: #fcfcff;
    scrollbar-width: thin;
    scrollbar-color: #9588d5 transparent;
    overscroll-behavior-inline: contain;
}

.research-map:focus-visible {
    outline: 3px solid rgba(82, 113, 255, 0.35);
    outline-offset: 3px;
}

.research-map-grid {
    min-width: 1080px;
    display: grid;
    grid-template-columns: 190px repeat(5, minmax(168px, 1fr));
}

.research-map-corner,
.research-map-phase,
.research-map-lane,
.research-map-cell {
    min-height: 84px;
    padding: 12px;
    border-right: 1px solid var(--research-map-line);
    border-bottom: 1px solid var(--research-map-line);
}

.research-map-corner,
.research-map-phase {
    min-height: 66px;
    display: grid;
    align-content: center;
    color: var(--research-map-ink);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.015em;
}

.research-map-corner {
    background: #fafaff;
    color: var(--research-map-muted);
}

.research-map-phase {
    background: #f0effa;
}

.research-map-lane {
    display: grid;
    align-content: center;
    gap: 4px;
    background: #fbf8fd;
    color: var(--research-map-ink);
}

.research-map-lane strong {
    font-size: 0.82rem;
    line-height: 1.25;
}

.research-map-lane span {
    color: var(--research-map-muted);
    font-size: 0.69rem;
    line-height: 1.35;
}

.research-map-cell {
    position: relative;
    display: flex;
    align-items: flex-start;
    background: #fefeff;
}

.research-map-tall {
    min-height: 128px;
}

.research-map-span-2,
.research-map-span-3 {
    z-index: 2;
}

.research-map-under-span {
    padding-top: 82px;
}

.research-work {
    width: 100%;
    min-height: 58px;
    padding: 9px 10px;
    display: grid;
    align-content: center;
    justify-content: center;
    gap: 3px;
    border: 1px solid currentColor;
    border-radius: 6px;
    color: var(--research-map-ink);
    text-align: center;
    text-decoration: none;
    transition: transform 180ms ease-out, filter 180ms ease-out;
}

.research-work:hover {
    color: inherit;
    transform: translateY(-2px);
    filter: saturate(1.08);
}

.research-work:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.research-work strong {
    font-size: 0.72rem;
    line-height: 1.25;
}

.research-work span {
    font-size: 0.62rem;
    line-height: 1.2;
    opacity: 0.72;
}

.research-work-wide-2,
.research-work-wide-3 {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
}

.research-work-wide-2 {
    width: calc(200% - 23px);
}

.research-work-wide-3 {
    width: calc(300% - 22px);
}

.work-blue {
    color: #3f64c8;
    background: #f0f4ff;
}

.work-green {
    color: #34805f;
    background: #eef9f3;
}

.work-amber {
    color: #a06418;
    background: #fff7e8;
}

.work-pink {
    color: #a83d78;
    background: #fff0f7;
}

.work-purple {
    color: #7650b6;
    background: #f7f0ff;
}

@media (max-width: 767px) {
    .research-map {
        margin-inline: -18px;
        border-radius: 8px;
    }

    .research-map-grid {
        min-width: 980px;
        grid-template-columns: 174px repeat(5, minmax(160px, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .research-work {
        transition: none;
    }
}
