/* Deaf Gospel World Map Block Styles */

.wp-block-deaf-gospel-map {
    width: 100%;
}

.dg-map-widget {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    background: #e8f4fc;
    border-radius: 1rem;
    border: solid 1px #ccc;
    aspect-ratio: 16 / 9;
}

.dg-map-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    aspect-ratio: 4138 / 2524;
    overflow: hidden;
}

.dg-map-image {
    position: absolute;
    width: 125%;
    height: 125%;
    top: -20%;
    left: -12.5%;
    object-fit: cover;
    transition: transform 0.6s ease-in-out, top 0.6s ease-in-out;
    transform-origin: center center;
}

.dg-map-image.zoomed {
    top: -12.5%;
}

/* Region markers (pink circles with arrow) */
.dg-region-marker {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #F06292;
    border: 3px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, opacity 0.3s ease;
    z-index: 10;
}

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

.dg-region-marker span {
    color: white;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    margin-left: 2px;
}

.dg-region-marker.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Country markers (circular flags) */
.dg-country-marker {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid white;
    cursor: pointer;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.dg-country-marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.dg-country-marker.visible {
    opacity: 1;
    pointer-events: auto;
}

.dg-country-marker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Back button */
.dg-back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.2s ease;
    color: #333;
}

.dg-back-btn:hover {
    transform: scale(1.1);
}

.dg-back-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.dg-back-btn svg {
    width: 24px;
    height: 24px;
}

/* Fullscreen button */
.dg-fullscreen-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 20;
    transition: transform 0.2s ease;
    color: #333;
}

.dg-fullscreen-btn:hover {
    transform: scale(1.1);
}

.dg-fullscreen-btn svg {
    width: 20px;
    height: 20px;
}

.dg-fullscreen-btn .exit-icon {
    display: none;
}

.dg-map-widget.fullscreen .dg-fullscreen-btn .enter-icon {
    display: none;
}

.dg-map-widget.fullscreen .dg-fullscreen-btn .exit-icon {
    display: block;
}

.dg-map-widget.fullscreen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Scale to fit viewport while keeping 16:9 - use !important to override any inline/external width */
    width: min(100vw, calc(100vh * 16 / 9)) !important;
    height: min(100vh, calc(100vw * 9 / 16)) !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    border-radius: 0;
    z-index: 9999;
    /* Keep 16:9 aspect ratio so markers stay aligned */
    aspect-ratio: 16 / 9;
    overflow: visible;
}

.dg-map-widget.fullscreen .dg-map-container {
    overflow: visible;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dg-region-marker {
        width: 36px;
        height: 36px;
    }
    .dg-region-marker span {
        font-size: 20px;
    }
    .dg-country-marker {
        width: 40px;
        height: 40px;
    }
    .dg-back-btn {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .dg-region-marker {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }
    .dg-region-marker span {
        font-size: 16px;
    }
    .dg-country-marker {
        width: 32px;
        height: 32px;
        border-width: 2px;
    }
}
