/* Home page operations map: an Asia-Pacific map beside a location panel. */

.ops-map-section {
    background: var(--white);
    padding: 64px 0 48px;
}

.ops-map-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.ops-map-header {
    max-width: 860px;
    margin: 0 auto 40px;
    text-align: center;
}

.ops-map-title {
    font-size: 36px;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 16px;
    line-height: 1.2;
}

.ops-map-subtitle {
    font-size: 18px;
    color: var(--gray-text);
    font-weight: 400;
}

.ops-map-frame {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}

/*
 * The world illustration is 2000 by 868. The crop shows one window of it
 * (position and size as percentages of the whole image). Pins are placed as
 * percentages of the whole image, so they stay on the right place at every
 * screen size.
 */
.ops-map-crop {
    --win-x: 23;
    --win-y: 10;
    --win-w: 40;
    --win-h: 86;
    position: relative;
    width: 100%;
    aspect-ratio: calc(var(--win-w) * 2000 / (var(--win-h) * 868));
    overflow: hidden;
    -webkit-mask-image:
        linear-gradient(to bottom, transparent 0%, black 8%, black 94%, transparent 100%),
        linear-gradient(to right, transparent 0%, black 10%, black 94%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to bottom, transparent 0%, black 8%, black 94%, transparent 100%),
        linear-gradient(to right, transparent 0%, black 10%, black 94%, transparent 100%);
    mask-composite: intersect;
}

.ops-map-stage {
    position: absolute;
    width: calc(10000% / var(--win-w));
    height: calc(10000% / var(--win-h));
    left: calc(var(--win-x) / var(--win-w) * -100%);
    top: calc(var(--win-y) / var(--win-h) * -100%);
}

.ops-map-image {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0.95;
}

.ops-marker {
    position: absolute;
    left: calc(var(--x) * 1%);
    top: calc(var(--y) * 1%);
    transform: translate(-50%, -100%);
    width: 26px;
    height: 26px;
    cursor: pointer;
    padding: 0;
    appearance: none;
    background: none;
    border: none;
    transition: transform 0.2s ease;
}

.ops-marker::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--mira-gold);
    -webkit-mask: url("../resources/icons/location-dot.svg") center / contain no-repeat;
    mask: url("../resources/icons/location-dot.svg") center / contain no-repeat;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition:
        background-color 0.2s ease,
        filter 0.2s ease;
}

.ops-marker-pin {
    display: none;
}

.ops-marker:hover {
    transform: translate(-50%, -100%) scale(1.15);
}

.ops-marker:hover::before {
    background: var(--mira-gold-hover);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.ops-marker.is-active {
    transform: translate(-50%, -100%) scale(1.25);
    z-index: 5;
}

.ops-marker.is-active::before {
    background: var(--black);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
}

.ops-marker-ring {
    position: absolute;
    left: 50%;
    bottom: -2px;
    width: 10px;
    height: 5px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    transform: translateX(-50%) scale(1);
    transition: all 0.2s ease;
}

.ops-marker:hover .ops-marker-ring {
    transform: translateX(-50%) scale(1.3);
    background: rgba(0, 0, 0, 0.1);
}

.ops-marker.is-active .ops-marker-ring {
    animation: ringPulse 1.5s ease-out infinite;
}

@keyframes ringPulse {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 0.5;
    }
    70% {
        transform: translateX(-50%) scale(1.8);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) scale(2);
        opacity: 0;
    }
}

.ops-marker:focus-visible {
    outline: 2px solid var(--mira-gold);
    outline-offset: 4px;
    border-radius: 4px;
}

.ops-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--gray-medium);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
}

.ops-panel-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 2px 24px 2px 2px;
    transition: opacity 0.25s ease;
}

.ops-panel-image.is-changing {
    opacity: 0;
}

.ops-panel-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 2px;
}

.ops-panel-country {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-text);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ops-panel-city {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--black);
}

.ops-places {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-medium);
}

.ops-place-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ops-place-country {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ops-place-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ops-chip {
    padding: 5px 12px;
    background: var(--white);
    border: 1px solid var(--gray-medium);
    border-radius: var(--radius-control);
    color: var(--black);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.ops-chip:hover {
    border-color: var(--black);
}

.ops-chip[aria-pressed="true"] {
    background: var(--black);
    border-color: var(--black);
    color: var(--white);
}

.ops-chip:focus-visible {
    outline: 2px solid var(--mira-gold);
    outline-offset: 2px;
}

@supports (corner-top-right-shape: squircle) {
    .ops-panel {
        border-radius: 2px 44px 2px 44px;
        corner-top-right-shape: squircle;
        corner-bottom-left-shape: squircle;
    }

    .ops-panel-image {
        border-radius: 2px 34px 2px 2px;
        corner-top-right-shape: squircle;
    }
}

@media (max-width: 1024px) {
    .ops-map-container {
        padding: 0 24px;
    }

    .ops-map-frame {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .ops-map-crop {
        max-width: 640px;
        margin: 0 auto;
    }

    .ops-panel {
        width: 100%;
        max-width: 640px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .ops-map-section {
        padding: 48px 0 32px;
    }

    .ops-map-container {
        padding: 0 16px;
    }

    .ops-map-header {
        margin-bottom: 28px;
    }

    .ops-map-title {
        font-size: 28px;
    }

    .ops-map-subtitle {
        font-size: 16px;
    }

    .ops-marker {
        width: 22px;
        height: 22px;
    }

    .ops-panel {
        padding: 16px;
    }

    .ops-panel-image {
        aspect-ratio: 2 / 1;
    }

}

@media (prefers-reduced-motion: reduce) {
    .ops-marker,
    .ops-marker::before,
    .ops-marker-ring,
    .ops-chip,
    .ops-panel-image {
        transition: none;
    }

    .ops-marker.is-active .ops-marker-ring {
        animation: none;
    }
}
