/* Mapa Kapliczek i Krzyży Parafii — Frontend Styles */

.pmk-front-wrap {
    margin: 6px 0 18px;
    color: var(--kg-text, #1e293b);
    font-family: inherit;
}

.pmk-front-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.pmk-front-head-copy {
    flex: 1 1 480px;
}

.pmk-front-title {
    margin: 0 0 6px;
    font-size: 1.55rem;
    line-height: 1.25;
    color: var(--kg-primary, #1e3a5f);
    font-weight: 800;
}

.pmk-front-subtitle {
    margin: 0;
    color: var(--kg-text-muted, #475569);
    font-size: 0.98rem;
    line-height: 1.55;
}

.pmk-admin-quickbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pmk-admin-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--kg-primary, #1e3a5f);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.22);
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.pmk-admin-pill:hover {
    background: var(--kg-primary-dark, #152945);
    transform: translateY(-1px);
}

/* Toolbar */
.pmk-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid var(--kg-border, #e2e8f0);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.pmk-cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pmk-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.pmk-chip:hover {
    border-color: var(--pmk-cat-color, #1e3a5f);
    background: #f1f5f9;
}

.pmk-chip.is-active {
    background: var(--pmk-cat-color, #1e3a5f);
    border-color: var(--pmk-cat-color, #1e3a5f);
    color: #ffffff;
}

.pmk-chip-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--pmk-cat-color, #1e3a5f);
    display: inline-block;
}

.pmk-chip.is-active .pmk-chip-dot {
    background: #ffffff;
}

.pmk-chip-count {
    font-size: 0.78rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
}

.pmk-chip.is-active .pmk-chip-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.pmk-toolbar-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.pmk-select,
.pmk-search {
    height: 38px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    font-size: 0.9rem;
    min-width: 190px;
    box-sizing: border-box;
}

.pmk-search {
    flex: 1 1 auto;
    width: 220px;
}

.pmk-basemap-toggle {
    display: inline-flex;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.pmk-base-btn {
    height: 36px;
    padding: 0 12px;
    border: 0;
    background: transparent;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}

.pmk-base-btn + .pmk-base-btn {
    border-left: 1px solid #e2e8f0;
}

.pmk-base-btn.is-active {
    background: var(--kg-primary, #1e3a5f);
    color: #ffffff;
}

.pmk-fit-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--kg-primary, #1e3a5f);
    background: #ffffff;
    color: var(--kg-primary, #1e3a5f);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}

.pmk-fit-btn:hover {
    background: #eff6ff;
}

/* Map stage */
.pmk-map-stage {
    position: relative;
    z-index: 1;
    isolation: isolate;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--kg-border, #e2e8f0);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
    background: #e2e8f0;
}

.pmk-map-canvas {
    width: 100%;
    height: var(--pmk-map-height, 560px) !important;
    min-height: var(--pmk-map-height, 560px) !important;
}

.pmk-mymaps-box {
    position: relative;
    width: 100%;
    height: var(--pmk-map-height, 560px) !important;
    min-height: var(--pmk-map-height, 560px) !important;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--kg-border, #e2e8f0);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
}

.pmk-mymaps-box iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.pmk-map-status-note {
    padding: 10px 14px;
    background: #fffbeb;
    border-top: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.88rem;
}

.pmk-map-footer-note {
    margin-top: 8px;
    font-size: 0.82rem;
    color: #64748b;
    text-align: right;
}

/* Custom SVG Marker Pins */
.pmk-pin-wrapper {
    background: transparent !important;
    border: none !important;
}

.pmk-pin {
    width: 34px;
    height: 44px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 3px 5px rgba(15, 23, 42, 0.4));
    transition: transform 0.16s ease;
}

.pmk-pin:hover,
.pmk-pin.is-highlighted {
    transform: translateY(-2px) scale(1.12);
}

/* Popup / InfoWindow card */
.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 300px !important;
    max-width: 78vw;
}

.pmk-popup {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
    padding: 10px 12px 12px;
    max-width: 310px;
}

.pmk-popup-photo-wrap {
    margin: -10px -12px 8px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: #0f172a;
}

.pmk-popup-photo {
    width: 100%;
    height: 112px;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.pmk-popup-photo-wrap:hover .pmk-popup-photo {
    transform: scale(1.03);
}

.pmk-popup-zoom-hint {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
}

.pmk-popup-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.pmk-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    color: #ffffff;
}

.pmk-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
}

.pmk-popup-title {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.28;
    font-weight: 800;
    color: #0f172a;
}

.pmk-popup-address {
    margin: 0 0 4px;
    font-size: 12px;
    color: #475569;
}

.pmk-popup-desc {
    margin: 0 0 6px;
    font-size: 12.2px;
    line-height: 1.38;
    color: #334155;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pmk-popup-coords {
    font-size: 11px;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    margin-bottom: 8px;
}

.pmk-popup-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
}

.pmk-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 11.8px;
    font-weight: 700;
    text-decoration: none !important;
    line-height: 1.2;
    white-space: nowrap;
}

.pmk-popup-btn-primary {
    background: #1e3a5f;
    color: #ffffff !important;
}

.pmk-popup-btn-primary:hover {
    background: #152945;
}

.pmk-popup-btn-secondary {
    background: #f1f5f9;
    color: #1e293b !important;
    border: 1px solid #cbd5e1;
}

.pmk-popup-btn-secondary:hover {
    background: #e2e8f0;
}

/* Catalogue cards below map */
.pmk-catalogue-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 26px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--kg-border, #e2e8f0);
}

.pmk-catalogue-head h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--kg-primary, #1e3a5f);
}

.pmk-catalogue-counter {
    font-size: 0.92rem;
    color: #475569;
}

.pmk-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.pmk-card-item {
    background: #ffffff;
    border: 1px solid var(--kg-border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pmk-card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
}

.pmk-card-thumb {
    position: relative;
    height: 175px;
    background: linear-gradient(135deg, #1e3a5f 0%, #334155 100%);
    overflow: hidden;
}

.pmk-card-thumb.has-photo {
    cursor: pointer;
}

.pmk-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pmk-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.82);
}

.pmk-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.pmk-card-title {
    margin: 4px 0 6px;
    font-size: 1.05rem;
    line-height: 1.35;
    font-weight: 800;
    color: #0f172a;
}

.pmk-card-address {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: #475569;
}

.pmk-card-desc {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #334155;
    flex: 1;
}

.pmk-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.pmk-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 11px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
}

.pmk-card-btn-focus {
    background: var(--kg-primary, #1e3a5f);
    color: #ffffff !important;
}

.pmk-card-btn-focus:hover {
    background: var(--kg-primary-dark, #152945);
}

.pmk-card-btn-dir {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b !important;
}

.pmk-card-btn-dir:hover {
    background: #e2e8f0;
}

.pmk-empty-results {
    grid-column: 1 / -1;
    padding: 28px;
    text-align: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #475569;
}

/* Lightbox */
.pmk-lightbox[hidden] {
    display: none !important;
}

.pmk-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pmk-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.86);
}

.pmk-lightbox-dialog {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 960px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pmk-lightbox-dialog img {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    background: #0f172a;
}

.pmk-lb-caption {
    margin-top: 10px;
    color: #f8fafc;
    font-size: 0.95rem;
    text-align: center;
    font-weight: 600;
}

.pmk-lb-close,
.pmk-lb-nav {
    position: absolute;
    background: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pmk-lb-close {
    top: -14px;
    right: -14px;
    width: 38px;
    height: 38px;
    font-size: 18px;
}

.pmk-lb-nav {
    top: 44%;
    width: 42px;
    height: 42px;
    font-size: 26px;
}

.pmk-lb-prev {
    left: 10px;
}

.pmk-lb-next {
    right: 10px;
}

.pmk-lb-nav[hidden] {
    display: none !important;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .pmk-map-canvas,
    .pmk-mymaps-box {
        height: 420px !important;
        min-height: 420px !important;
    }

    .pmk-toolbar-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .pmk-select,
    .pmk-search,
    .pmk-fit-btn {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        height: 40px !important;
    }

    .pmk-basemap-toggle {
        width: 100%;
    }

    .pmk-base-btn {
        flex: 1;
    }
}

@media (max-width: 640px) {
    .pmk-cards-grid {
        grid-template-columns: 1fr;
    }

    .pmk-front-title {
        font-size: 1.3rem;
    }
}
