/**
 * Frontend styles for WP Map H2 plugin
 */

.wp-map-h2-wrapper {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.wp-map-h2-button {
    background: none;
    border: none;
    padding: 4px;
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: currentColor;
    opacity: 0.7;
    vertical-align: middle;
}

.wp-map-h2-button:hover,
.wp-map-h2-button:focus {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.wp-map-h2-button:active {
    transform: scale(0.95);
}

.wp-map-h2-icon {
    width: 30px;
    height: 30px;
    display: block;
    color: #007cba;
    transition: color 0.2s ease;
}

.wp-map-h2-button:hover .wp-map-h2-icon,
.wp-map-h2-button:focus .wp-map-h2-icon {
    color: #005a87;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wp-map-h2-button:hover,
    .wp-map-h2-button:focus {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .wp-map-h2-icon {
        color: #00a0d2;
    }
    
    .wp-map-h2-button:hover .wp-map-h2-icon,
    .wp-map-h2-button:focus .wp-map-h2-icon {
        color: #0073a8;
    }
}

/* Ensure proper spacing in different heading contexts */
h1 .wp-map-h2-wrapper,
h2 .wp-map-h2-wrapper,
h3 .wp-map-h2-wrapper,
h4 .wp-map-h2-wrapper,
h5 .wp-map-h2-wrapper,
h6 .wp-map-h2-wrapper {
    font-size: 0.6em;
    line-height: 1;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wp-map-h2-button {
        border: 1px solid currentColor;
    }
    
    .wp-map-h2-button:hover,
    .wp-map-h2-button:focus {
        background-color: currentColor;
        color: white;
    }
}
