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

.ghje-agenda-widget {
    margin: 2em 0;
    font-size: 15px;
    color: #1a1a1a;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.ghje-agenda-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1em;
}
.ghje-events-count {
    color: #2c7a4b;
    font-weight: 600;
    font-size: 14px;
}

/* ── Filtres ───────────────────────────────────────────────────────────── */
.ghje-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 1.5em;
    padding: 14px 18px;
    background: #f8faf9;
    border-radius: 12px;
    border: 1px solid #e8efeb;
}
.ghje-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.ghje-filter-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
    margin-right: 4px;
}
.ghje-filter-range {
    padding: 7px 14px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all .2s;
    color: #444;
    font-weight: 500;
}
.ghje-filter-range:hover {
    border-color: #2c7a4b;
    color: #2c7a4b;
}
.ghje-filter-range.active {
    border-color: #2c7a4b;
    background: #2c7a4b;
    color: #fff;
}
.ghje-filter-cat {
    padding: 7px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #444;
    cursor: pointer;
}

/* ── Grille principale liste + carte ───────────────────────────────────── */
.ghje-agenda-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}
.ghje-agenda-grid.ghje-no-map-layout {
    grid-template-columns: 1fr;
}
@media (max-width: 900px) {
    .ghje-agenda-grid { grid-template-columns: 1fr; }
}

/* ── Liste des événements ──────────────────────────────────────────────── */
.ghje-events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 720px;
    overflow-y: auto;
    padding-right: 4px;
}
.ghje-events-list::-webkit-scrollbar {
    width: 6px;
}
.ghje-events-list::-webkit-scrollbar-thumb {
    background: #c8d6cc;
    border-radius: 3px;
}

.ghje-loading,
.ghje-empty {
    padding: 2em;
    text-align: center;
    color: #888;
    background: #f8faf9;
    border-radius: 10px;
}

/* ── Item d'événement ──────────────────────────────────────────────────── */
.ghje-event-item {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 14px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8efeb;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    transition: all .15s;
    cursor: pointer;
    position: relative;
}
.ghje-event-item:hover,
.ghje-event-item.ghje-active {
    border-color: #2c7a4b;
    box-shadow: 0 4px 16px rgba(44,122,75,.15);
    transform: translateY(-1px);
}
.ghje-event-item .ghje-event-thumb {
    grid-column: 1 / -1;
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 4px;
}

/* Pavé date à gauche */
.ghje-event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c7a4b, #1e5c38);
    color: #fff;
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
    height: fit-content;
}
.ghje-date-day {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}
.ghje-date-month {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 3px;
}
.ghje-date-dow {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    opacity: .85;
}
.ghje-date-recur {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 14px;
    background: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.ghje-event-date { position: relative; }

/* Badge récurrent dans le titre/single */
.ghje-recurring-badge {
    display: inline-block;
    background: linear-gradient(135deg, #2c7a4b, #1e5c38);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-right: 6px;
}
.ghje-recurring-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f8faf9;
    border-left: 4px solid #2c7a4b;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin: 1em 0;
    font-size: 14.5px;
}
.ghje-recurring-summary strong {
    color: #2c7a4b;
}
.ghje-occurrences-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}
.ghje-occurrences-list li {
    background: #fff;
    border: 1px solid #d9e6dd;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #2c7a4b;
    font-weight: 500;
}
.ghje-exceptions-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.ghje-exception-chip {
    background: #fff3e0;
    color: #e65100;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
}

.ghje-event-body {
    min-width: 0;
}
.ghje-event-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.ghje-event-cat {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.ghje-event-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    color: #1a1a1a;
}
.ghje-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}
.ghje-event-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.ghje-event-excerpt {
    color: #555;
    font-size: 13px;
    line-height: 1.45;
    margin: 6px 0 10px;
}
.ghje-event-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ghje-btn-link {
    color: #2c7a4b !important;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none !important;
}
.ghje-btn-link:hover { text-decoration: underline !important; }
.ghje-btn-locate {
    background: transparent;
    border: 1px solid #2c7a4b;
    color: #2c7a4b;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all .15s;
}
.ghje-btn-locate:hover {
    background: #2c7a4b;
    color: #fff;
}

/* ── Carte ─────────────────────────────────────────────────────────────── */
.ghje-events-map {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    background: #e8e8e8;
    position: sticky;
    top: 20px;
}
@media (max-width: 900px) {
    .ghje-events-map { position: static; height: 400px !important; }
}
.ghje-no-map {
    padding: 2em;
    text-align: center;
    color: #777;
    background: #f5f5f5;
    border-radius: 10px;
}

/* ── InfoWindow ────────────────────────────────────────────────────────── */
.ghje-iw {
    max-width: 260px;
    font-family: inherit;
    font-size: 13px;
}
.ghje-iw-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    display: block;
}
.ghje-iw-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.ghje-iw-cat {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 12px;
    text-transform: uppercase;
}
.ghje-iw h4 {
    margin: 0 0 6px;
    font-size: 15px;
    color: #1a1a1a;
}
.ghje-iw-when,
.ghje-iw-where,
.ghje-iw-price {
    color: #555;
    font-size: 12.5px;
    margin: 2px 0;
}
.ghje-iw-excerpt {
    margin: 6px 0;
    color: #666;
    font-size: 12.5px;
    line-height: 1.4;
}
.ghje-iw-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.ghje-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;
}
.ghje-btn-sm:hover { background: #1e5c38; }
.ghje-btn-maps { background: #1a73e8; }
.ghje-btn-maps:hover { background: #1259c0; }

/* ── Page single (template-event) ─────────────────────────────────────── */
.ghje-single-wrap {
    max-width: 900px;
    margin: 0 auto;
}
.ghje-breadcrumb {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}
.ghje-breadcrumb a { color: #2c7a4b; text-decoration: none; }
.ghje-breadcrumb a:hover { text-decoration: underline; }

.ghje-single-header {
    margin-bottom: 1.5em;
}
.ghje-single-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    margin: 8px 0;
}
.ghje-single-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.ghje-single-thumbnail {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.5em;
    display: block;
}

.ghje-single-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    background: #f8faf9;
    border-radius: 12px;
    padding: 18px 22px;
    margin: 1.5em 0;
}
.ghje-info-block {
    display: flex;
    flex-direction: column;
}
.ghje-info-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 3px;
}
.ghje-info-value {
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 600;
}
.ghje-info-value-sm { font-size: 14px; font-weight: 500; }

.ghje-section-title {
    font-size: 1.2rem;
    margin: 1.5em 0 .8em;
    color: #1a1a1a;
}

/* Galerie */
.ghje-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin: 1em 0;
}
.ghje-gallery-thumb {
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: transform .2s, opacity .2s;
}
.ghje-gallery-thumb:hover {
    transform: scale(1.02);
    opacity: .92;
}

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

/* Carte single */
#ghje-single-map {
    width: 100%;
    height: 380px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    background: #e8e8e8;
    margin: 1em 0;
}

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

/* ── Mini-liste (shortcode_liste) ─────────────────────────────────────── */
.ghje-mini-grid {
    display: grid;
    gap: 16px;
    margin: 1.5em 0;
}
.ghje-mini-grid.cols-1 { grid-template-columns: 1fr; }
.ghje-mini-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.ghje-mini-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) {
    .ghje-mini-grid.cols-2,
    .ghje-mini-grid.cols-3 { grid-template-columns: 1fr; }
}

.ghje-mini-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.ghje-mini-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.ghje-mini-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.ghje-mini-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.ghje-mini-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.ghje-mini-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.25;
}
.ghje-mini-title a { color: #1a1a1a; text-decoration: none; }
.ghje-mini-title a:hover { color: #2c7a4b; }
.ghje-mini-when {
    color: #2c7a4b;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}
.ghje-mini-where {
    color: #666;
    font-size: 13px;
    margin-bottom: 6px;
}
.ghje-mini-link {
    margin-top: auto;
    font-size: 13px;
    color: #2c7a4b !important;
    font-weight: 600;
    text-decoration: none !important;
}

/* ── Lightbox ─────────────────────────────────────────────────────────── */
.ghje-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.ghje-lightbox.open { display: flex; }
.ghje-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
}
.ghje-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

/* ── Badge "passé" ────────────────────────────────────────────────────── */
.ghje-event-item.ghje-past {
    opacity: .7;
}
.ghje-event-item.ghje-past .ghje-event-date {
    background: linear-gradient(135deg, #888, #666);
}
