/* ══════════════════════════════════════════════════════
   Réseau Patrimoine — Public shortcode styles
   ══════════════════════════════════════════════════════ */

:root {
    --rp-primary: #3f8c80;
    --rp-primary-hover: #2d6b62;
    --rp-primary-light: #e8f5f1;
    --rp-text: #333;
    --rp-text-muted: #666;
    --rp-border: #e0e0e0;
    --rp-bg: #fafbfc;
    --rp-card-bg: #fff;
    --rp-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    --rp-radius: 12px;
}

/* ── Wrapper ── */
#pspa-reseau-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--rp-text);
}

/* ── Intro ── */
.pspa-reseau-intro {
    text-align: center;
    margin-bottom: 28px;
}
.pspa-reseau-intro h2 {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--rp-primary);
    margin: 0 0 8px;
}
.pspa-reseau-intro p {
    font-size: 1.05em;
    color: var(--rp-text-muted);
    margin: 0;
}

/* ── Filtres ── */
.pspa-reseau-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    background: var(--rp-card-bg);
    padding: 16px 20px;
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
}
.pspa-reseau-filter-group {
    flex: 1 1 180px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pspa-reseau-filter-group label {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--rp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pspa-reseau-filters select,
.pspa-reseau-filters input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--rp-border);
    border-radius: 8px;
    font-size: 0.95em;
    background: var(--rp-bg);
    color: var(--rp-text);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.pspa-reseau-filters select:focus,
.pspa-reseau-filters input[type="text"]:focus {
    border-color: var(--rp-primary);
    box-shadow: 0 0 0 3px rgba(63, 140, 128, .15);
}

/* ── Compteur ── */
.pspa-reseau-count-bar {
    margin-bottom: 16px;
    font-size: 0.9em;
    color: var(--rp-text-muted);
    font-weight: 600;
}

/* ── Liste ── */
#pspa-reseau-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Card lieu ── */
.pspa-reseau-card {
    display: flex;
    background: var(--rp-card-bg);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
    overflow: hidden;
    transition: box-shadow .2s, transform .15s;
}
.pspa-reseau-card:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, .12);
    transform: translateY(-1px);
}

/* ── Photos (gauche) ── */
.pspa-reseau-card-photos {
    flex: 0 0 320px;
    min-height: 220px;
    position: relative;
    background: #f0f0f0;
    overflow: hidden;
}

.pspa-reseau-no-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #aaa;
    font-size: 0.9em;
}
.pspa-reseau-no-photo span {
    font-size: 2.5em;
    margin-bottom: 4px;
}

/* ── Carousel ── */
.pspa-reseau-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 220px;
}
.pspa-reseau-carousel-track {
    width: 100%;
    height: 100%;
}
.pspa-reseau-carousel-slide {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
.pspa-reseau-carousel-slide.active {
    display: block;
}
.pspa-reseau-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity .2s;
}
.pspa-reseau-carousel-slide img:hover {
    opacity: .92;
}

.pspa-carousel-prev,
.pspa-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, .45);
    color: #fff;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
    z-index: 2;
}
.pspa-reseau-card:hover .pspa-carousel-prev,
.pspa-reseau-card:hover .pspa-carousel-next {
    opacity: 1;
}
.pspa-carousel-prev { left: 8px; }
.pspa-carousel-next { right: 8px; }
.pspa-carousel-prev:hover,
.pspa-carousel-next:hover {
    background: rgba(0, 0, 0, .7);
}

.pspa-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.pspa-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    cursor: pointer;
    transition: background .2s;
}
.pspa-carousel-dot.active {
    background: #fff;
    box-shadow: 0 0 4px rgba(0,0,0,.3);
}

/* ── Infos (droite) ── */
.pspa-reseau-card-info {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pspa-reseau-card-title {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--rp-primary);
    margin: 0 0 10px;
    line-height: 1.3;
}

.pspa-reseau-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.pspa-reseau-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    line-height: 1.4;
}
.pspa-reseau-tag-location {
    background: #e3f2fd;
    color: #1565c0;
}
.pspa-reseau-tag-region {
    background: #f3e5f5;
    color: #7b1fa2;
}
.pspa-reseau-tag-type {
    background: #fff3e0;
    color: #e65100;
}
.pspa-reseau-tag-cat {
    background: var(--rp-primary-light);
    color: var(--rp-primary);
}

.pspa-reseau-card-desc {
    font-size: 0.92em;
    color: var(--rp-text);
    line-height: 1.6;
    text-align: justify;
    flex: 1;
    overflow: hidden;
    max-height: 120px;
    position: relative;
    transition: max-height .3s ease;
}
.pspa-reseau-card-desc strong,
.pspa-reseau-card-desc b {
    font-weight: 700;
}
.pspa-reseau-card-desc em,
.pspa-reseau-card-desc i {
    font-style: italic;
}
.pspa-reseau-card-desc.expanded {
    max-height: none;
}
/* masque gradient retiré */
.pspa-reseau-desc-toggle {
    display: inline-block;
    margin-top: 4px;
    background: none;
    border: none;
    color: var(--rp-primary);
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.pspa-reseau-desc-toggle:hover {
    text-decoration: underline;
}

.pspa-reseau-card-actions {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--rp-border);
}

.pspa-reseau-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    background: var(--rp-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.92em;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.pspa-reseau-contact-btn:hover {
    background: var(--rp-primary-hover);
    transform: translateY(-1px);
}

/* ── Empty state ── */
.pspa-reseau-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--rp-text-muted);
    font-size: 1.05em;
    background: var(--rp-card-bg);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
}

/* ── Loader ── */
#pspa-reseau-loader {
    text-align: center;
    padding: 32px 0;
}
.pspa-reseau-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid var(--rp-border);
    border-top-color: var(--rp-primary);
    border-radius: 50%;
    animation: pspa-spin .7s linear infinite;
}
@keyframes pspa-spin {
    to { transform: rotate(360deg); }
}

/* ── Load more ── */
#pspa-reseau-load-more {
    text-align: center;
    padding: 24px 0;
}
#pspa-reseau-more-btn {
    padding: 10px 32px;
    background: transparent;
    color: var(--rp-primary);
    border: 2px solid var(--rp-primary);
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
#pspa-reseau-more-btn:hover {
    background: var(--rp-primary);
    color: #fff;
}

/* ── End message ── */
#pspa-reseau-end-msg {
    text-align: center;
    padding: 16px 0;
    color: var(--rp-text-muted);
    font-size: 0.9em;
    font-style: italic;
}

/* ══════════════════════════════════════════════════════
   MODALS (lightbox + contact)
   ══════════════════════════════════════════════════════ */

.pspa-reseau-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pspa-reseau-modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, .6);
    cursor: pointer;
}

/* ── Lightbox ── */
.pspa-reseau-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
#pspa-reseau-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .4);
    object-fit: contain;
}
.pspa-reseau-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: none;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    z-index: 2;
    color: #333;
}
.pspa-reseau-lightbox-close:hover {
    background: #f5f5f5;
}
.pspa-reseau-lightbox-prev,
.pspa-reseau-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .9);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    z-index: 2;
    color: #333;
}
.pspa-reseau-lightbox-prev { left: -56px; }
.pspa-reseau-lightbox-next { right: -56px; }
.pspa-reseau-lightbox-prev:hover,
.pspa-reseau-lightbox-next:hover {
    background: #fff;
}

/* ── Contact modal ── */
.pspa-reseau-contact-content {
    position: relative;
    background: #fff;
    border-radius: var(--rp-radius);
    padding: 32px;
    max-width: 520px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .25);
    z-index: 1;
}
.pspa-reseau-contact-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}
.pspa-reseau-contact-close:hover {
    background: #e0e0e0;
}
.pspa-reseau-contact-content h3 {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--rp-primary);
    margin: 0 0 4px;
}

.pspa-reseau-contact-notice {
    background: #fef9e7;
    border-left: 4px solid #f0c040;
    padding: 12px 14px;
    margin: 10px 0 14px;
    font-size: 0.92em;
    line-height: 1.5;
    color: #5a4e00;
    border-radius: 4px;
}

.pspa-reseau-form-row {
    display: flex;
    gap: 12px;
}
.pspa-reseau-form-row .pspa-reseau-form-field {
    flex: 1;
}
.pspa-reseau-form-field {
    margin-bottom: 14px;
}
.pspa-reseau-form-field label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--rp-text-muted);
    margin-bottom: 4px;
}
.pspa-reseau-form-field label .req {
    color: #c62828;
}
.pspa-reseau-form-field input,
.pspa-reseau-form-field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--rp-border);
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
    background: var(--rp-bg);
    color: var(--rp-text);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    box-sizing: border-box;
}
.pspa-reseau-form-field input:focus,
.pspa-reseau-form-field textarea:focus {
    border-color: var(--rp-primary);
    box-shadow: 0 0 0 3px rgba(63, 140, 128, .15);
}

#pspa-contact-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9em;
    margin-bottom: 12px;
    background: var(--rp-bg);
}

#pspa-contact-submit {
    width: 100%;
    padding: 11px;
    background: var(--rp-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
#pspa-contact-submit:hover {
    background: var(--rp-primary-hover);
}
#pspa-contact-submit:disabled {
    background: #aaa;
    cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .pspa-reseau-card {
        flex-direction: column;
    }
    .pspa-reseau-card-photos {
        flex: none;
        width: 100%;
        height: 220px;
    }
    .pspa-reseau-card-info {
        padding: 16px;
    }
    .pspa-reseau-filters {
        flex-direction: column;
        padding: 12px 14px;
    }
    .pspa-reseau-filter-group {
        flex: none;
        width: 100%;
    }
    .pspa-reseau-form-row {
        flex-direction: column;
        gap: 0;
    }
    .pspa-reseau-lightbox-prev { left: 8px; }
    .pspa-reseau-lightbox-next { right: 8px; }
    .pspa-reseau-contact-content {
        padding: 20px;
        margin: 8px;
    }
    .pspa-reseau-intro h2 {
        font-size: 1.4em;
    }
}

@media (max-width: 480px) {
    .pspa-reseau-card-photos {
        height: 180px;
    }
    .pspa-reseau-card-title {
        font-size: 1.1em;
    }
}

/* ══════════════════════════════════════════════════════
   BOUTON CARTE (filtre bar)
   ══════════════════════════════════════════════════════ */

.pspa-reseau-filter-map-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
}

#pspa-reseau-show-map {
    background: var(--rp-primary);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.95em;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
#pspa-reseau-show-map:hover {
    background: var(--rp-primary-hover);
}

/* ══════════════════════════════════════════════════════
   MINI-MAP (carrousel – dernière slide)
   ══════════════════════════════════════════════════════ */

.pspa-reseau-minimap {
    width: 100%;
    height: 100%;
    min-height: 200px;
    z-index: 1;
    cursor: pointer;
}

/* Click-to-expand overlay hint */
.pspa-reseau-carousel-slide-map {
    position: relative;
}
.pspa-reseau-carousel-slide-map::after {
    content: '\1F50D Agrandir';
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.75em;
    padding: 4px 10px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}
.pspa-reseau-carousel-slide-map:hover::after {
    opacity: 1;
}

.pspa-carousel-dot-map {
    width: 10px !important;
    height: 10px !important;
    background: var(--rp-primary) !important;
    border: 2px solid rgba(255, 255, 255, .6) !important;
    opacity: 0.8;
    cursor: pointer;
}
.pspa-carousel-dot-map.active {
    opacity: 1;
    background: var(--rp-primary) !important;
    box-shadow: 0 0 6px var(--rp-primary);
}

/* ══════════════════════════════════════════════════════
   MODAL CARTE GLOBALE
   ══════════════════════════════════════════════════════ */

.pspa-reseau-map-modal-content {
    background: #fff;
    width: 92vw;
    height: 82vh;
    max-width: 1400px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 1;
}

.pspa-reseau-map-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #2c3e50;
    color: #fff;
}

.pspa-reseau-map-modal-header h3 {
    margin: 0;
    font-size: 1.15em;
}

.pspa-reseau-map-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.8;
}
.pspa-reseau-map-modal-close:hover {
    opacity: 1;
}

#pspa-reseau-global-map {
    flex: 1;
    min-height: 0;
}

/* Prevent marker clipping at map edges */
.pspa-reseau-minimap .leaflet-marker-pane,
#pspa-reseau-global-map .leaflet-marker-pane {
    overflow: visible;
}

/* ══════════════════════════════════════════════════════
   POPUP CARTE GLOBALE
   ══════════════════════════════════════════════════════ */

.pspa-reseau-map-popup {
    display: flex;
    flex-direction: column;
    width: 220px;
}

.pspa-reseau-map-popup-img {
    width: 100%;
    height: 120px;
    overflow: hidden;
    border-radius: 6px 6px 0 0;
}

.pspa-reseau-map-popup-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pspa-reseau-map-popup-placeholder {
    width: 100%;
    height: 100%;
    background: #e0e0e0;
}

.pspa-reseau-map-popup-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pspa-reseau-map-popup-title {
    font-size: 0.95em;
    color: #2c3e50;
}

.pspa-reseau-map-popup-ville,
.pspa-reseau-map-popup-type {
    font-size: 0.82em;
    color: #777;
}

.pspa-reseau-map-popup-btn {
    margin-top: 6px;
    background: var(--rp-primary);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    text-align: center;
    transition: background 0.2s;
}
.pspa-reseau-map-popup-btn:hover {
    background: var(--rp-primary-hover);
}

/* Highlight effect when scrolling to a card from map */
.pspa-reseau-card-highlight {
    box-shadow: 0 0 0 3px var(--rp-primary), 0 4px 16px rgba(63, 140, 128, 0.3) !important;
    transition: box-shadow 0.3s ease;
}

/* Leaflet popup overrides in global map */
#pspa-reseau-global-map .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
}
#pspa-reseau-global-map .leaflet-popup-content {
    margin: 0;
    min-width: 200px;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE – carte
   ══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .pspa-reseau-map-popup {
        width: 180px;
    }
    .pspa-reseau-map-popup-img {
        height: 90px;
    }
    #pspa-reseau-show-map {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .pspa-reseau-map-modal-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}
