/**
 * Travel Maps - Frontend Styles
 * Zoptymalizowane pod Astra Theme
 */

/* ================================
   Hero: Featured Image + Mapa
   ================================ */

.travel-maps-hero {
    display: flex;
    gap: 20px;
    margin-bottom: 2em;
    align-items: stretch;
}

.travel-maps-featured {
    flex: 2; /* 2/3 szerokości */
    min-width: 0;
}

.travel-maps-featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

.travel-maps-map {
    flex: 1; /* 1/3 szerokości */
    min-width: 0;
}

.travel-maps-map a {
    display: block;
    height: 100%;
}

.travel-maps-map img.travel-map-static {
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.travel-maps-map img.travel-map-static:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.travel-maps-location-name {
    display: block;
    margin-top: 8px;
    font-size: 0.9em;
    color: #555;
    text-align: center;
}

/* ================================
   Responsywność
   ================================ */

@media (max-width: 768px) {
    .travel-maps-hero {
        flex-direction: column;
    }
    
    /* Na mobile: najpierw zdjęcie, potem mapa */
    .travel-maps-featured {
        order: 1;
        width: 100%;
    }
    
    .travel-maps-map {
        order: 2;
        width: 100%;
        justify-content: center;
    }
    
    .travel-maps-map a {
        width: 100%;
        height: auto;
    }
    
    .travel-maps-map img.travel-map-static {
        width: 100%;
        height: auto;
        max-width: 100%;
    }
}

/* ================================
   Integracja z Astra
   ================================ */

.ast-article-single .travel-maps-hero {
    margin-top: 0;
}

.entry-header + .travel-maps-hero,
.ast-entry-content .travel-maps-hero:first-child {
    margin-top: 0;
}

/* ================================
   Lightbox
   ================================ */

.travel-maps-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}

.travel-maps-lightbox.active {
    display: flex;
}

.travel-maps-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    height: 80%;
    max-height: 700px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.travel-maps-lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.travel-maps-lightbox-close:hover {
    background: #555;
    transform: scale(1.1);
}

#travel-maps-lightbox-map {
    width: 100%;
    height: 100%;
}

/* Leaflet popup w lightbox */
.travel-maps-lightbox .leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.travel-maps-lightbox .leaflet-popup-content {
    margin: 12px 15px;
    font-size: 14px;
}

/* ================================
   Archiwum - interaktywna mapa
   ================================ */

.travel-archive-map {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* Popup na mapie Leaflet */
.travel-map-popup {
    text-align: center;
    min-width: 150px;
}

.travel-map-popup img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.travel-map-popup-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
}

.travel-map-popup-title a {
    color: #0073aa;
    text-decoration: none;
}

.travel-map-popup-title a:hover {
    text-decoration: underline;
}

.travel-map-popup-location {
    font-size: 12px;
    color: #666;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 12px 15px;
}

/* Popup pokazywany w dół (strzałka na górze) */
.travel-popup-bottom .leaflet-popup-tip-container {
    top: 0;
    bottom: auto;
    margin-top: -20px;
}

.travel-popup-bottom .leaflet-popup-tip {
    box-shadow: none;
    transform: rotate(180deg);
    margin-top: 11px;
}
