/* ============================================================
   QueFaireIci — CSS principal
   Mobile first, breakpoint 1000px
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --beige:       #f5f0e8;
    --beige-dark:  #ede7da;
    --blue-dark:   #1a2b4a;
    --blue:        #2563eb;
    --blue-light:  #dbeafe;
    --pink:        #f43f8e;
    --orange:      #f59e0b;
    --green:       #10b981;
    --text:        #1e293b;
    --text-muted:  #64748b;
    --white:       #ffffff;
    --radius:      12px;
    --shadow:      0 2px 12px rgba(0,0,0,.08);
    --shadow-lg:   0 8px 32px rgba(0,0,0,.12);
    --header-h:    56px;
}

html { scroll-behavior: smooth; }

body {
    font-family: "DM Sans", system-ui, sans-serif;
    background: var(--beige);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.55;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ── header ── */
.qfi-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--white);
    border-bottom: 1px solid var(--beige-dark);
    height: var(--header-h);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
}

.qfi-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    text-decoration: none;
}

.qfi-logo__icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--orange), var(--pink));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.qfi-logo__text {
    font-family: "DM Serif Display", Georgia, serif;
    font-size: 19px;
    color: var(--blue-dark);
    white-space: nowrap;
}

.qfi-logo__text span { color: var(--orange); }

/* barre de recherche */
.qfi-search {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--beige);
    border: 1.5px solid var(--beige-dark);
    border-radius: 50px;
    padding: 0 8px 0 14px;
    gap: 6px;
    height: 40px;
    min-width: 0;
    max-width: 480px;
    transition: border-color .15s;
}

.qfi-search:focus-within { border-color: var(--blue); }

.qfi-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text);
    outline: none;
    min-width: 0;
}

.qfi-search input::placeholder { color: var(--text-muted); }

.qfi-btn-geo {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--beige-dark);
    border: none;
    border-radius: 50px;
    padding: 5px 10px;
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
    transition: background .15s;
}

.qfi-btn-geo:hover { background: #ddd; }

.qfi-btn-radius {
    display: none;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 6px;
    border-radius: 6px;
    white-space: nowrap;
}

.qfi-btn-search {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s;
    flex-shrink: 0;
}

.qfi-btn-search:hover { background: #1d4ed8; }

.qfi-btn-publish {
    display: none;
    border: 1.5px solid var(--blue);
    background: none;
    color: var(--blue);
    border-radius: 50px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    transition: all .15s;
}

.qfi-btn-publish:hover {
    background: var(--blue);
    color: var(--white);
}

/* ── barre de filtres ── */
.qfi-filters {
    background: var(--white);
    border-bottom: 1px solid var(--beige-dark);
    padding: 7px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}

.qfi-filters::-webkit-scrollbar { display: none; }

.qfi-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    padding: 4px 0;
    border: none;
    background: none;
    font-family: inherit;
    transition: color .15s;
    user-select: none;
}

.qfi-filter input[type="radio"] { display: none; }

.qfi-filter__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    flex-shrink: 0;
    transition: background .15s;
}

.qfi-filter.is-active { color: var(--text); font-weight: 600; }
.qfi-filter.is-active .qfi-filter__dot { background: var(--blue); }
.qfi-filter[data-period="1"].is-active .qfi-filter__dot { background: var(--orange); }
.qfi-filter[data-period="2"].is-active .qfi-filter__dot { background: #64748b; }
.qfi-filter[data-period="3"].is-active .qfi-filter__dot { background: #94a3b8; }

/* ── layout principal (carte + liste) ── */
.qfi-main {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-h) - 37px);
}

/* mobile : liste en haut, carte en bas */
.qfi-list-panel {
    overflow-y: auto;
    background: var(--beige);
    padding: 14px;
    flex: 0 0 auto;
    max-height: 55vh;
}

.qfi-map-panel {
    flex: 1 1 auto;
    position: relative;
    min-height: 40vh;
}

#qfi-map {
    width: 100%;
    height: 100%;
}

/* ── en-tête liste ── */
.qfi-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
}

.qfi-list-title {
    font-size: 16px;
    font-weight: 700;
}

.qfi-list-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 1px;
}

.qfi-sort-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1.5px solid var(--beige-dark);
    background: var(--white);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
}

/* ── cards événements ── */
.qfi-events { display: flex; flex-direction: column; gap: 10px; }

.qfi-event-card {
    display: flex;
    gap: 12px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 12px;
    cursor: pointer;
    transition: box-shadow .2s, transform .15s;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    text-decoration: none;
    color: inherit;
}

.qfi-event-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.qfi-event-card.is-active { border-color: var(--blue); }

.qfi-event-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--beige-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    overflow: hidden;
}

.qfi-event-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qfi-event-body { flex: 1; min-width: 0; }

.qfi-event-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.qfi-event-city {
    font-size: 11px;
    font-weight: 700;
    color: var(--pink);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.qfi-event-date {
    font-size: 11px;
    color: var(--text-muted);
}

.qfi-event-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.qfi-event-foot {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.qfi-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 3px 8px;
    border-radius: 50px;
    background: var(--orange);
    color: var(--white);
}

/* couleurs par type */
.qfi-tag--culture  { background: #7c3aed; }
.qfi-tag--sport    { background: #10b981; }
.qfi-tag--musique  { background: #ec4899; }
.qfi-tag--theatre  { background: #dc2626; }
.qfi-tag--marche   { background: var(--orange); }
.qfi-tag--expo     { background: #0891b2; }
.qfi-tag--fete     { background: var(--pink); }
.qfi-tag--brocante { background: #92400e; }

.qfi-event-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    margin-left: auto;
    white-space: nowrap;
}

/* ── CTA bas de liste ── */
.qfi-cta {
    background: var(--white);
    border-top: 1px solid var(--beige-dark);
    padding: 20px 16px;
    text-align: center;
}

.qfi-cta p {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.qfi-btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid var(--blue);
    background: none;
    color: var(--blue);
    border-radius: 50px;
    padding: 9px 22px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s;
}

.qfi-btn-cta:hover {
    background: var(--blue);
    color: var(--white);
}

/* ── section articles blog ── */
.qfi-blog {
    padding: 28px 16px 36px;
    background: var(--beige);
}

.qfi-blog h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 18px;
}

.qfi-blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.qfi-blog-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: box-shadow .2s, transform .15s;
}

.qfi-blog-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.qfi-blog-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--beige-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    overflow: hidden;
}

.qfi-blog-img img { width: 100%; height: 100%; object-fit: cover; }

.qfi-blog-body { padding: 14px; }

.qfi-blog-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
}

.qfi-blog-city {
    font-size: 11px;
    font-weight: 700;
    background: var(--pink);
    color: var(--white);
    border-radius: 50px;
    padding: 2px 9px;
}

.qfi-blog-date {
    font-size: 11px;
    color: var(--text-muted);
}

.qfi-blog-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 7px;
}

.qfi-blog-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.qfi-blog-more {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    display: block;
    font-style: italic;
}

/* ── popup leaflet ── */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    font-family: "DM Sans", system-ui, sans-serif;
}

.qfi-popup { font-size: 13px; min-width: 180px; }
.qfi-popup strong { display: block; margin-bottom: 3px; font-size: 14px; }
.qfi-popup__city { color: var(--pink); font-weight: 700; font-size: 11px; text-transform: uppercase; }
.qfi-popup__date { color: var(--text-muted); font-size: 12px; }
.qfi-popup__price { color: var(--green); font-weight: 600; font-size: 12px; }
.qfi-popup__link {
    display: block;
    margin-top: 7px;
    background: var(--blue);
    color: var(--white) !important;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.qfi-popup__link:hover { background: #1d4ed8; }

/* ── footer ── */
.qfi-footer {
    border-top: 1px solid var(--beige-dark);
    background: var(--beige);
    padding: 20px 16px;
    text-align: center;
}

.qfi-footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.qfi-footer a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s;
}

.qfi-footer a:hover { color: var(--blue); }

.qfi-footer__copy {
    font-size: 12px;
    color: #aaa;
    margin-top: 10px;
}

/* ── état vide ── */
.qfi-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 0;
    font-size: 14px;
}

/* ── single event ── */
.qfi-single { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; }

.qfi-single__head { margin-bottom: 20px; }

.qfi-single__badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.qfi-single__badge {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    color: var(--white);
}

.qfi-single__badge--city { background: var(--pink); }
.qfi-single__badge--date { background: var(--blue); }
.qfi-single__badge--type { background: var(--orange); }

.qfi-single__title {
    font-family: "DM Serif Display", Georgia, serif;
    font-size: clamp(22px, 5vw, 34px);
    line-height: 1.2;
    margin-bottom: 10px;
}

.qfi-single__thumb {
    width: 100%;
    border-radius: var(--radius);
    aspect-ratio: 16/9;
    object-fit: cover;
    margin-bottom: 20px;
}

.qfi-single__meta-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.qfi-single__meta-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
}

.qfi-single__meta-label {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
    min-width: 80px;
    padding-top: 1px;
}

.qfi-single__content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
}

.qfi-single__content p { margin-bottom: 1em; }
.qfi-single__content h2, .qfi-single__content h3 { margin: 1.4em 0 .5em; font-weight: 700; }

.qfi-single__back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 18px;
}

.qfi-single__back:hover { color: var(--blue); }

/* ── page archive ── */
.qfi-archive { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }

.qfi-archive__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
}

.qfi-archive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

/* ── desktop ── */
@media (min-width: 1000px) {

    .qfi-btn-radius  { display: flex; }
    .qfi-btn-publish { display: inline-flex; }

    .qfi-main { flex-direction: row; }

    .qfi-list-panel {
        width: 460px;
        flex: 0 0 460px;
        max-height: none;
        height: 100%;
        border-right: 1px solid var(--beige-dark);
    }

    .qfi-map-panel { flex: 1 1 auto; min-height: auto; }

    /* scrollbar liste desktop */
    .qfi-list-panel::-webkit-scrollbar { width: 5px; }
    .qfi-list-panel::-webkit-scrollbar-track { background: transparent; }
    .qfi-list-panel::-webkit-scrollbar-thumb { background: var(--beige-dark); border-radius: 3px; }

    .qfi-blog { padding: 36px 40px 52px; }
    .qfi-blog-grid { grid-template-columns: repeat(3, 1fr); }

    .qfi-single { padding: 36px 24px 64px; }
    .qfi-single__meta-box { flex-direction: row; flex-wrap: wrap; gap: 20px; }
    .qfi-single__meta-row { flex: 0 0 calc(50% - 10px); }

    .qfi-archive-grid { grid-template-columns: repeat(2, 1fr); }
}
