/* ============================================
   AGENDA CULTUREL — Full Width — Rounded
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --color-bg: #FFFFFF;
    --color-text: #1A1A1A;
    --color-muted: #888888;
    --color-border: #E8E8E8;
    --color-badge-bg: #1A1A1A;
    --color-badge-text: #FFFFFF;
    --color-accent: #E85D3A;
    --color-overlay: rgba(0,0,0,.03);
    --font-main: 'Libre Franklin', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --gap: 28px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 50px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { font-family: var(--font-main); background: var(--color-bg); color: var(--color-text); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font-family: inherit; }

/* ============================================
   HEADER — Unified element heights
   ============================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0 var(--gap);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    width: 100%;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-text);
    white-space: nowrap;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-muted);
    transition: color .2s;
    line-height: 1;
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--color-text);
}

.nav-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    transition: background .2s, color .2s, border-color .2s;
    letter-spacing: .05em;
}

.nav-add:hover {
    background: var(--color-text);
    color: #fff;
    border-color: var(--color-text);
}

.nav-add svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.btn-filters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 18px;
    border-radius: var(--radius-pill);
    background: var(--color-badge-bg);
    color: var(--color-badge-text);
    font-size: .9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity .2s;
    white-space: nowrap;
}

.btn-filters:hover { opacity: .8; }
.btn-filters svg { width: 15px; height: 15px; }

.filter-count {
    background: #fff;
    color: var(--color-text);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    margin-left: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-date {
    height: 38px;
    padding: 0 18px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--color-border);
    background: none;
    font-size: .9rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.btn-date:hover {
    background: var(--color-text);
    color: #fff;
    border-color: var(--color-text);
}

/* ---- Switch Toggle (exposition temporaire) ---- */
.switch-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    white-space: nowrap;
    height: 38px;
    padding: 0 16px 0 6px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--color-border);
    transition: border-color .2s;
    user-select: none;
    box-sizing: border-box;
}

.switch-toggle:has(input:checked) {
    border-color: var(--color-text);
}

.switch-toggle input {
    display: none;
}

.switch-slider {
    position: relative;
    width: 46px;
    height: 28px;
    background: var(--color-border);
    border-radius: 28px;
    transition: background .3s;
    flex-shrink: 0;
}

.switch-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: transform .3s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.switch-toggle input:checked + .switch-slider {
    background: var(--color-text);
}

.switch-toggle input:checked + .switch-slider::after {
    transform: translateX(18px);
    background: #fff;
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .6rem;
    color: var(--color-text);
    line-height: 1;
}

.switch-label {
    font-size: .88rem;
    color: var(--color-muted);
    transition: color .2s;
}

.switch-toggle:has(input:checked) .switch-label {
    color: var(--color-text);
}

/* ---- Calendar button ---- */
.btn-date-calendar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    width: 100%;
    padding-bottom: 100px;
}

/* ---- Search ---- */
.search-bar {
    padding: 0 var(--gap);
    margin: 24px 0 12px;
}

.search-form {
    display: flex;
    gap: 12px;
    align-items: center;
    max-width: 800px;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input-wrap input {
    width: 100%;
    padding: 14px 18px 14px 44px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--color-bg);
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
}

.search-input-wrap input:focus { border-color: var(--color-text); }

.search-bar .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
}

.museum-select {
    height: 48px;
    padding: 0 36px 0 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: .92rem;
    font-family: inherit;
    background: var(--color-bg);
    color: var(--color-text);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color .2s;
    max-width: 350px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.museum-select:focus { border-color: var(--color-text); }

/* ---- Month row ---- */
.month-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 18px var(--gap) 10px;
}

.month-label {
    font-size: 1.05rem;
    color: var(--color-muted);
}

.events-count {
    font-size: .92rem;
    color: var(--color-accent);
}

/* ============================================
   MASONRY GRID
   ============================================ */
.events-grid {
    padding: 0 var(--gap);
    column-count: 5;
    column-gap: 20px;
    margin-bottom: 48px;
}

.event-card {
    break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
    cursor: pointer;
    transition: opacity .2s;
}

.event-card:hover { opacity: .82; }

.card-image {
    position: relative;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f0f0f0;
}

.card-image img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.card-date {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    font-size: .85rem;
    font-weight: 600;
    line-height: 1;
}

.card-date-label {
    background: var(--color-badge-bg);
    color: var(--color-badge-text);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    letter-spacing: .01em;
    white-space: nowrap;
}

.card-date-venue {
    margin-left: 10px;
    font-weight: 400;
    color: var(--color-muted);
    font-size: .82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.card-title {
    margin-top: 8px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--color-text);
}

.card-museum {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-size: .8rem;
    font-weight: 500;
    color: var(--color-muted);
    line-height: 1.3;
}

.card-museum svg {
    flex-shrink: 0;
    color: var(--color-muted);
}

.card-museum-loc {
    font-weight: 400;
    opacity: .75;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    white-space: nowrap;
}

.tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ---- Placeholder (no image) ---- */
.card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #F0EFEC;
    border-radius: var(--radius-md);
    color: #C0BDB6;
}

.card-placeholder svg {
    width: 36px;
    height: 36px;
}

.event-detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    aspect-ratio: 16 / 7;
    background: #F0EFEC;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    color: #C0BDB6;
}

.event-detail-placeholder svg {
    width: 48px;
    height: 48px;
}

.event-detail-placeholder span {
    font-size: .85rem;
    font-weight: 500;
}

/* ============================================
   VIEW SWITCHER
   ============================================ */
.view-switcher {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    background: #fff;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 28px rgba(0,0,0,.1);
    overflow: hidden;
    z-index: 100;
}

.view-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 14px 24px;
    background: none;
    border: none;
    font-size: .75rem;
    color: var(--color-muted);
    cursor: pointer;
    transition: background .15s;
    border-right: 1px solid var(--color-border);
}

.view-btn:last-child { border-right: none; }
.view-btn.active { background: var(--color-overlay); color: var(--color-text); font-weight: 600; }
.view-btn svg { width: 22px; height: 22px; }

/* ============================================
   FILTERS PANEL — Dark theme
   ============================================ */
.filters-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

.filters-overlay.open { opacity: 1; pointer-events: auto; }

.filters-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 340px;
    height: 100vh;
    background: #1A1A1A;
    color: #FFFFFF;
    z-index: 201;
    transform: translateX(-100%);
    transition: transform .3s ease;
    overflow-y: auto;
    padding: 28px;
    display: flex;
    flex-direction: column;
}

.filters-overlay.open .filters-panel { transform: translateX(0); }

.filters-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.filters-top h2 { font-size: 1.3rem; font-weight: 700; color: #fff; }

.filters-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #fff;
    padding: 6px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: background .15s;
}

.filters-close:hover { background: rgba(255,255,255,.1); }

.filter-section { margin-bottom: 26px; }

.filter-section h3 {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 12px;
    color: #fff;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    font-size: .95rem;
    cursor: pointer;
    color: #ccc;
    transition: color .15s;
}

.filter-check:hover { color: #fff; }

.filter-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #fff;
    cursor: pointer;
    border-radius: 4px;
}

.filter-check input[type="date"] {
    padding: 10px 14px;
    border: 1px solid #444;
    border-radius: var(--radius-sm);
    font-size: .95rem;
    width: 100%;
    background: #2A2A2A;
    color: #fff;
    color-scheme: dark;
}

.filter-actions {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-apply {
    width: 100%;
    padding: 14px;
    background: #FFFFFF;
    color: #1A1A1A;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}

.btn-apply:hover { opacity: .85; }

.btn-reset {
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    font-size: .9rem;
    color: #999;
    cursor: pointer;
    text-decoration: underline;
    text-align: center;
}

/* ============================================
   EVENT DETAIL
   ============================================ */
.event-detail {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px var(--gap) 100px;
}

.event-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .95rem;
    font-weight: 500;
    color: var(--color-muted);
    margin-bottom: 32px;
    transition: color .2s;
}

.event-detail-back:hover { color: var(--color-text); }

.event-detail-label {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted);
    margin-bottom: 8px;
}

.event-detail-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.event-detail h1 {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
    margin-bottom: 28px;
}

.event-detail-image {
    width: 100%;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 32px;
}

.detail-info-cell { background: #fff; padding: 20px 22px; }

.detail-info-label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted);
    margin-bottom: 5px;
}

.detail-info-value { font-size: 1.05rem; font-weight: 500; }
.detail-info-sub { font-size: .9rem; color: var(--color-muted); margin-top: 3px; }

.event-detail-description {
    font-size: 1.1rem;
    line-height: 1.75;
    margin-bottom: 32px;
}

.event-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--color-badge-bg);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    transition: opacity .2s;
}

.event-detail-link:hover { opacity: .8; }

.edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
    color: var(--color-muted);
    transition: background .2s, color .2s, border-color .2s;
    flex-shrink: 0;
}

.edit-link:hover {
    background: var(--color-text);
    color: #fff;
    border-color: var(--color-text);
}

.report-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
    color: var(--color-muted);
    transition: background .2s, color .2s, border-color .2s;
    flex-shrink: 0;
}

.report-link:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: var(--color-muted);
}

.empty-state h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 1rem;
}

.empty-reset {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 1rem;
    margin-top: 14px;
    display: inline-block;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1400px) { .events-grid { column-count: 4; } }
@media (max-width: 1050px) { .events-grid { column-count: 3; } }

@media (max-width: 768px) {
    .events-grid { column-count: 2; column-gap: 14px; }
    .topbar { flex-wrap: wrap; height: auto; padding: 12px var(--gap); gap: 10px; }
    .topbar-right { display: none; }
    .switch-toggle { display: none; }
    .detail-info-grid { grid-template-columns: 1fr; }
    .event-detail h1 { font-size: 1.8rem; }
    .search-form { flex-direction: column; }
    .museum-select { max-width: 100%; width: 100%; }
    .search-input-wrap { max-width: 100%; width: 100%; }
}

@media (max-width: 480px) {
    .events-grid { column-count: 1; }
    .header-nav { gap: 14px; }
    .header-nav a { font-size: .9rem; }
    .btn-filters { height: 34px; padding: 0 14px; font-size: .85rem; }
    .nav-add { width: 34px; height: 34px; }
}
