/* ==========================================================================
   Gîte Haut-Jura – Attractions – Frontend Styles
   ========================================================================== */

/* ── Map container ────────────────────────────────────────────────────────── */
.ghj-map-wrap {
    position: relative;
    margin: 2em 0;
}

#ghj-main-map {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    background: #e8e8e8;
}

.ghj-no-map {
    padding: 2em;
    text-align: center;
    background: #f5f5f5;
    border-radius: 10px;
    color: #777;
}

/* ── InfoWindow (Google Maps popup) ─────────────────────────────────────── */
.ghj-infowindow {
    max-width: 240px;
    font-family: inherit;
    font-size: 14px;
}
.ghj-infowindow h4 {
    margin: 0 0 6px;
    font-size: 15px;
    color: #1a1a1a;
}
.ghj-infowindow p {
    margin: 0 0 8px;
    color: #555;
    font-size: 13px;
    line-height: 1.4;
}
.ghj-iw-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    display: block;
}
.ghj-iw-distances {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.ghj-iw-distances span {
    background: #f0f4f8;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    color: #444;
}
.ghj-iw-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ghj-btn-sm {
    display: inline-block;
    padding: 5px 12px;
    background: #2c7a4b;
    color: #fff !important;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 600;
    transition: background .2s;
}
.ghj-btn-sm:hover { background: #1e5c38; }
.ghj-btn-maps { background: #1a73e8; }
.ghj-btn-maps:hover { background: #1259c0; }

/* ── Filter bar ─────────────────────────────────────────────────────────── */
.ghj-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.2em;
}
.ghj-filter-btn {
    padding: 6px 14px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all .2s;
    color: #444;
}
.ghj-filter-btn:hover,
.ghj-filter-btn.active {
    border-color: #2c7a4b;
    background: #2c7a4b;
    color: #fff;
}

/* ── Map + list layout ──────────────────────────────────────────────────── */
.ghj-map-list-wrap {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 768px) {
    .ghj-map-list-wrap { grid-template-columns: 1fr; }
}

.ghj-side-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
}
.ghj-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    color: inherit;
}
.ghj-list-item:last-child { border-bottom: none; }
.ghj-list-item:hover,
.ghj-list-item.ghj-active { background: #f0f9f4; }
.ghj-list-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.ghj-list-item-info h5 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}
.ghj-list-item-info small {
    color: #777;
    font-size: 11px;
}

/* ── Attraction grid (shortcode liste) ──────────────────────────────────── */
.ghj-grid {
    display: grid;
    gap: 24px;
    margin: 1.5em 0;
}
.ghj-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ghj-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ghj-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
    .ghj-grid-cols-3,
    .ghj-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .ghj-grid-cols-2,
    .ghj-grid-cols-3,
    .ghj-grid-cols-4 { grid-template-columns: 1fr; }
}

/* ── Attraction card ────────────────────────────────────────────────────── */
.ghj-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.ghj-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.ghj-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.ghj-card-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}
.ghj-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.ghj-card-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}
.ghj-cat-tag {
    background: #e8f5e9;
    color: #2c7a4b;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.ghj-featured-badge {
    background: #fff3e0;
    color: #e65100;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}
.ghj-card-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}
.ghj-card-title a {
    color: #1a1a1a;
    text-decoration: none;
}
.ghj-card-title a:hover { color: #2c7a4b; }
.ghj-card-excerpt {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px;
    flex: 1;
}
.ghj-card-distances {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.ghj-dist-badge {
    background: #f5f5f5;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: #555;
}
.ghj-card-link {
    display: inline-block;
    padding: 8px 18px;
    background: #2c7a4b;
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: background .2s;
    margin-top: auto;
}
.ghj-card-link:hover { background: #1e5c38; }

/* ── Single attraction page ──────────────────────────────────────────────── */
.ghj-single-wrap {
    max-width: 900px;
    margin: 0 auto;
}
.ghj-single-header {
    margin-bottom: 2em;
}
.ghj-single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1em;
    align-items: center;
}
.ghj-breadcrumb {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}
.ghj-breadcrumb a { color: #2c7a4b; text-decoration: none; }
.ghj-breadcrumb a:hover { text-decoration: underline; }

.ghj-single-thumbnail {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.5em;
    display: block;
}

.ghj-distances-section {
    background: #f9fafb;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 1.5em 0;
}
.ghj-distances-section h3 {
    margin: 0 0 12px;
    font-size: 16px;
}
.ghj-distances-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.ghj-dist-card {
    flex: 1;
    min-width: 100px;
    background: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.ghj-dist-card .ghj-dist-icon { font-size: 24px; display: block; margin-bottom: 4px; }
.ghj-dist-card .ghj-dist-value { font-weight: 700; font-size: 15px; color: #1a1a1a; display: block; }
.ghj-dist-card .ghj-dist-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .5px; }

/* ── Itinerary map ───────────────────────────────────────────────────────── */
.ghj-itinerary-section {
    margin: 2em 0;
}
.ghj-travel-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.ghj-travel-btn {
    padding: 8px 18px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all .2s;
    color: #444;
}
.ghj-travel-btn:hover,
.ghj-travel-btn.active {
    border-color: #2c7a4b;
    background: #2c7a4b;
    color: #fff;
}
#ghj-single-map {
    width: 100%;
    height: 380px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    background: #e8e8e8;
}
#ghj-route-info {
    margin-top: 10px;
    padding: 10px 16px;
    background: #f0f9f4;
    border-radius: 8px;
    font-size: 15px;
    color: #2c7a4b;
    min-height: 42px;
}

/* ── Gallery lightbox ────────────────────────────────────────────────────── */
.ghj-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 1.5em 0;
}
.ghj-gallery-thumb {
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity .2s, transform .2s;
    width: 100%;
    display: block;
}
.ghj-gallery-thumb:hover {
    opacity: .9;
    transform: scale(1.02);
}

/* Lightbox overlay */
.ghj-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.ghj-lightbox.open { display: flex; }
.ghj-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
}
.ghj-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
}
.ghj-lightbox-prev,
.ghj-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    background: rgba(255,255,255,.1);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background .2s;
}
.ghj-lightbox-prev { left: 16px; }
.ghj-lightbox-next { right: 16px; }
.ghj-lightbox-prev:hover,
.ghj-lightbox-next:hover { background: rgba(255,255,255,.25); }

/* ── External links ──────────────────────────────────────────────────────── */
.ghj-links-section {
    margin: 1.5em 0;
}
.ghj-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.ghj-links-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f9fafb;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-decoration: none;
    color: #1a1a1a;
    font-size: 14px;
    transition: all .15s;
}
.ghj-links-list li a:hover {
    background: #e8f5e9;
    border-color: #2c7a4b;
    color: #2c7a4b;
}
.ghj-links-list li a::before {
    content: '🔗';
    font-size: 16px;
}

/* ── Archive page ────────────────────────────────────────────────────────── */
.ghj-archive-header {
    text-align: center;
    margin-bottom: 2em;
    padding: 2em 1em;
}
.ghj-archive-header h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    margin-bottom: .5em;
}
.ghj-archive-intro {
    font-size: 17px;
    color: #555;
    max-width: 640px;
    margin: 0 auto;
}

/* ── Related attractions ──────────────────────────────────────────────────── */
.ghj-related { margin-top: 3em; border-top: 1px solid #eee; padding-top: 2em; }
.ghj-related h3 { margin-bottom: 1em; font-size: 1.2em; }

/* ── Légende de la carte ────────────────────────────────────────────────────  */
.ghj-map-legend {
    margin: 0 0 10px 10px;  /* positionnée par Google Maps Controls */
}

.ghj-legend-inner {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    padding: 10px 14px;
    min-width: 185px;
    font-family: inherit;
    font-size: 13px;
    border: 1px solid rgba(0,0,0,.08);
}

.ghj-legend-title {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #888;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.ghj-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    color: #333;
    line-height: 1.3;
}

/* Pastille couleur pour les catégories */
.ghj-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.15);
    flex-shrink: 0;
    display: inline-block;
}

/* Icône sapin pour le gîte */
.ghj-legend-sapin {
    font-size: 16px;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.ghj-legend-label {
    font-size: 12.5px;
    color: #333;
    white-space: nowrap;
}
