/**
 * Styles frontend minimalistes pour Simone Eventcal.
 * Le thème ou Elementor peut tout surcharger sans effort.
 */

.eventcal-archive .eventcal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.eventcal-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.eventcal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
}
.eventcal-card__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #f3f4f6;
    overflow: hidden;
}
.eventcal-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.eventcal-card__icon {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255,255,255,.9);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111;
}
.eventcal-card__body {
    padding: 12px 14px 14px;
}
.eventcal-card__title {
    font-size: 1.05rem;
    line-height: 1.25;
    margin: 0 0 .35rem;
}
.eventcal-card__title a { color: inherit; text-decoration: none; }
.eventcal-card__date {
    margin: 0 0 .25rem;
    font-size: .9rem;
    color: #4b5563;
}
.eventcal-card__location {
    margin: 0;
    font-size: .85rem;
    color: #6b7280;
}

/* Badge "Annulé" */
.eventcal-badge-cancelled {
    display: inline-block;
    padding: 2px 8px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 4px;
    margin-bottom: .35rem;
}

/* Effet visuel des events annulés */
.eventcal-cancelled .eventcal-card__thumb,
body.eventcal-cancelled .entry-thumbnail {
    filter: grayscale(.6) opacity(.85);
}
.eventcal-cancelled .eventcal-card__title,
body.eventcal-cancelled .entry-title {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    text-decoration-color: #b91c1c;
}

/* =================================================================
 * Filter pills & search
 * Variables CSS surchargeables par le thème (theme.json ou :root global).
 * !important utilisé uniquement sur les props visuelles que les thèmes
 * agressifs (Arise, GeneratePress, etc.) écrasent via .button, a, etc.
 * ================================================================= */

:root {
    --eventcal-pill-border:        #111;
    --eventcal-pill-border-width:  1.5px;
    --eventcal-pill-bg:            transparent;
    --eventcal-pill-color:         #111;
    --eventcal-pill-hover-bg:      rgba(0,0,0,.04);
    --eventcal-pill-active-bg:     #b66744;
    --eventcal-pill-active-color:  #fff;
    --eventcal-pill-radius:        999px;
    --eventcal-pill-pad-y:         12px;
    --eventcal-pill-pad-x:         24px;
    --eventcal-pill-font-size:     1.0625rem;
    --eventcal-pill-font-weight:   500;
    --eventcal-pill-gap:           12px;
}

/* Conteneur */
.eventcal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 1.25rem 0 1.5rem;
    align-items: center;
    justify-content: center;
}

/* Pills — sélecteur doublé pour battre la spécificité du thème.
   On utilise .eventcal-filters > a.eventcal-pill pour viser explicitement les liens. */
.eventcal-filters .eventcal-pill,
.eventcal-filters a.eventcal-pill,
.eventcal-filters a.eventcal-pill:link,
.eventcal-filters a.eventcal-pill:visited {
    display: inline-flex !important;
    align-items: center !important;
    gap: var(--eventcal-pill-gap) !important;
    padding: var(--eventcal-pill-pad-y) var(--eventcal-pill-pad-x) !important;
    border-radius: var(--eventcal-pill-radius) !important;
    border: var(--eventcal-pill-border-width) solid var(--eventcal-pill-border) !important;
    background-color: var(--eventcal-pill-bg) !important;
    color: var(--eventcal-pill-color) !important;
    text-decoration: none !important;
    font-size: var(--eventcal-pill-font-size) !important;
    font-weight: var(--eventcal-pill-font-weight) !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease !important;
    cursor: pointer;
    white-space: nowrap;
}

.eventcal-filters a.eventcal-pill:hover,
.eventcal-filters a.eventcal-pill:focus {
    background-color: var(--eventcal-pill-hover-bg) !important;
    color: var(--eventcal-pill-color) !important;
    border-color: var(--eventcal-pill-border) !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

.eventcal-filters a.eventcal-pill.is-active,
.eventcal-filters a.eventcal-pill.is-active:link,
.eventcal-filters a.eventcal-pill.is-active:visited,
.eventcal-filters a.eventcal-pill.is-active:hover,
.eventcal-filters a.eventcal-pill.is-active:focus {
    background-color: var(--eventcal-pill-active-bg) !important;
    color: var(--eventcal-pill-active-color) !important;
    border-color: var(--eventcal-pill-active-bg) !important;
}

.eventcal-filters .eventcal-pill__icon {
    font-size: 1.05em;
    line-height: 1;
}

.eventcal-filters .eventcal-pill__count {
    font-size: .82em;
    opacity: .7;
    font-weight: 400;
}

/* =================================================================
 * Badge catégorie (shortcode [eventcal_badge])
 * Variant compact des pills, conçu pour position:absolute sur les cards.
 * ================================================================= */

:root {
    --eventcal-badge-bg:        var(--eventcal-pill-active-bg, #b66744);
    --eventcal-badge-color:     #fff;
    --eventcal-badge-radius:    999px;
    --eventcal-badge-pad-y:     6px;
    --eventcal-badge-pad-x:     14px;
    --eventcal-badge-font-size: .85rem;
    --eventcal-badge-gap:       8px;
}

.eventcal-badge,
a.eventcal-badge,
a.eventcal-badge:link,
a.eventcal-badge:visited {
    display: inline-flex !important;
    align-items: center !important;
    gap: var(--eventcal-badge-gap) !important;
    padding: var(--eventcal-badge-pad-y) var(--eventcal-badge-pad-x) !important;
    border-radius: var(--eventcal-badge-radius) !important;
    background-color: var(--eventcal-badge-bg) !important;
    color: var(--eventcal-badge-color) !important;
    border: 0 !important;
    text-decoration: none !important;
    font-size: var(--eventcal-badge-font-size) !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    letter-spacing: .02em !important;
    text-transform: uppercase !important;
    white-space: nowrap;
    box-shadow: none !important;
    text-shadow: none !important;
}

a.eventcal-badge:hover,
a.eventcal-badge:focus {
    color: var(--eventcal-badge-color) !important;
    opacity: .92;
    text-decoration: none !important;
}

.eventcal-badge__icon {
    font-size: 1em;
    line-height: 1;
}

/* =================================================================
 * Search form
 * ================================================================= */

:root {
    --eventcal-search-border:       #d1d5db;
    --eventcal-search-radius:       999px;
    --eventcal-search-bg:           #fff;
    --eventcal-search-color:        #111;
    --eventcal-search-pad-y:        12px;
    --eventcal-search-pad-x:        18px;
    --eventcal-search-submit-bg:    #b66744;
    --eventcal-search-submit-color: #fff;
    --eventcal-search-label-color:  #6b7280;
}

.eventcal-search {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    margin: 1rem 0 1.5rem;
    justify-content: center;
}

.eventcal-search .eventcal-search__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .85rem;
    color: var(--eventcal-search-label-color);
}

.eventcal-search .eventcal-search__field > span:not(.screen-reader-text) {
    font-size: .85rem;
    color: var(--eventcal-search-label-color);
}

.eventcal-search input[type="search"],
.eventcal-search input[type="date"],
.eventcal-search input[type="text"] {
    padding: var(--eventcal-search-pad-y) var(--eventcal-search-pad-x) !important;
    border: 1px solid var(--eventcal-search-border) !important;
    border-radius: var(--eventcal-search-radius) !important;
    background: var(--eventcal-search-bg) !important;
    color: var(--eventcal-search-color) !important;
    font-size: 1rem !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
}

.eventcal-search .eventcal-search__field--s input {
    min-width: 280px;
}

.eventcal-search .eventcal-search__submit,
.eventcal-search button.eventcal-search__submit {
    padding: var(--eventcal-search-pad-y) calc(var(--eventcal-search-pad-x) + 6px) !important;
    border-radius: var(--eventcal-search-radius) !important;
    background-color: var(--eventcal-search-submit-bg) !important;
    color: var(--eventcal-search-submit-color) !important;
    border: 1px solid var(--eventcal-search-submit-bg) !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
    transition: opacity .15s ease, transform .15s ease;
}
.eventcal-search button.eventcal-search__submit:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.eventcal-search .eventcal-search__reset {
    align-self: center;
    color: var(--eventcal-search-label-color);
    text-decoration: underline;
    font-size: .9rem;
}

@media (max-width: 640px) {
    .eventcal-filters { justify-content: flex-start; }
    .eventcal-search { flex-direction: column; align-items: stretch; }
    .eventcal-search .eventcal-search__field--s input { min-width: 0; width: 100%; }
}

/* Single */
.eventcal-single .entry-header {
    margin: 1rem 0 1.25rem;
}
.eventcal-single .eventcal-meta {
    color: #4b5563;
    font-size: 1rem;
}
.eventcal-single .entry-thumbnail img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}
