/* =========================================================================
   La Librairie des Jardins — Événements
   Charte alignée sur le site mère « Hortum in Bibliotheca »
   (vert olive / crème / vert-sapin, serif Cormorant, boutons rose pilule)
   ========================================================================= */

:root {
    --teal:       #2f5a48;   /* titres, marque */
    --teal-dark:  #244839;
    --olive:      #9fae66;   /* bandeaux / accents */
    --olive-dark: #7d8c4d;
    --olive-soft: #eef1dd;   /* fonds clairs */
    --cream:      #f6f1c9;   /* jaune pâle */
    --rose:       #e39aa3;   /* boutons d'action */
    --rose-dark:  #d47e8b;
    --ink:        #33372d;
    --muted:      #71776a;
    --line:       #e5e6da;
    --paper:      #fbfaf3;
    --white:      #ffffff;
    --danger:     #b23a3a;
    --footer-bg:  #45463a;
    --footer-ink: #d9d8c6;
    --radius:     14px;
    --shadow:     0 1px 2px rgba(0,0,0,.04), 0 10px 30px rgba(45,50,35,.07);
    --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --font-sans:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: var(--teal); }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* --- En-tête public --- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
}
.site-header__inner { padding: 18px 20px; display: flex; align-items: baseline; gap: 32px; }
.site-header__brand { text-decoration: none; display: inline-flex; align-items: center; flex-shrink: 0; }
.site-header__logo { height: 96px; width: auto; max-width: 100%; display: block; }
.site-header__pagetitle {
    flex: 1;
    font-family: "Comfortaa", var(--font-sans);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 600;
    color: var(--teal);
    line-height: 1;
    letter-spacing: .005em;
}
@media (max-width: 640px) {
    .site-header__inner { gap: 18px; }
    .site-header__logo { height: 66px; }
    .site-header__pagetitle { font-size: clamp(1.6rem, 7vw, 2.2rem); }
}

/* --- Pied de page public --- */
.site-footer {
    margin-top: 72px;
    padding: 32px 0;
    background: var(--footer-bg);
    color: var(--footer-ink);
    font-size: .92rem;
}
.site-footer a { color: #fff; }

/* --- Hero --- */
.hero {
    margin: 40px 0 8px;
    padding: 52px 40px;
    background: var(--olive-soft);
    border-radius: 22px;
    text-align: center;
}
.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    font-weight: 600;
    margin: 0 0 .2em;
    color: var(--teal);
    letter-spacing: .005em;
}
.hero__lead {
    font-size: 1.12rem;
    color: var(--muted);
    max-width: 52ch;
    margin: 0 auto;
}

/* --- Sections d'événements --- */
.events-section { margin-top: 56px; }
.events-section__title {
    font-family: var(--font-serif);
    font-size: clamp(1.7rem, 3.5vw, 2.2rem);
    font-weight: 600;
    color: var(--teal);
    text-align: center;
    margin: 0 0 32px;
}
.events-section__title::after {
    content: "";
    display: block;
    width: 54px;
    height: 3px;
    margin: 14px auto 0;
    border-radius: 3px;
    background: var(--olive);
}
.events-section--past { opacity: .97; }
.events-section--past .events-section__title { color: var(--olive-dark); }
.events-section--past .events-section__title::after { background: #c7cdb0; }

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 28px;
}

/* --- Carte événement --- */
.event-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}
.event-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(45,50,35,.14); }
.event-card__link { text-decoration: none; color: inherit; display: block; height: 100%; }
.event-card__media { position: relative; aspect-ratio: 16 / 10; background: var(--olive-soft); }
.event-card__media img { width: 100%; height: 100%; object-fit: cover; }
.event-card__placeholder {
    width: 100%; height: 100%;
    background:
        radial-gradient(circle at 30% 28%, rgba(159,174,102,.35), transparent 62%),
        linear-gradient(135deg, var(--olive-soft), #e2e8cd);
}
.event-card--past .event-card__media img { filter: grayscale(.4); }
.event-card__body { padding: 18px 20px 22px; }
.event-card__date {
    color: var(--olive-dark);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin: 0 0 8px;
}
.event-card__title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--teal);
    margin: 0 0 6px;
    line-height: 1.15;
}
.event-card__lieu { color: var(--muted); font-size: .92rem; margin: 0 0 12px; }
.event-card__excerpt { color: var(--ink); font-size: .93rem; margin: 0; }

.badge {
    position: absolute; top: 12px; left: 12px;
    background: var(--rose); color: #fff;
    font-size: .72rem; font-weight: 700;
    padding: 5px 12px; border-radius: 999px;
    letter-spacing: .03em;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.badge--inscription { background: var(--rose); }
.badge--full { background: #7a1f1f; }

.capacity-note { color: var(--muted); font-size: .95rem; margin: 12px 0 0; }

/* --- Fiche événement --- */
.back { margin: 28px 0 14px; }
.back a { text-decoration: none; color: var(--muted); font-size: .95rem; }
.back a:hover { color: var(--teal); }

.event-detail {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 48px;
}
.event-detail__media { background: var(--olive-soft); text-align: center; }
.event-detail__media img { width: 100%; height: auto; display: block; }
.event-detail__body { padding: 40px clamp(22px, 5vw, 56px); }
.event-detail__title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    color: var(--teal);
    margin: 0 0 26px;
    line-height: 1.1;
}
.event-meta {
    list-style: none; margin: 0 0 30px; padding: 0 0 0 22px;
    display: grid; gap: 13px;
    border-left: 3px solid var(--olive);
}
.event-meta__label {
    display: inline-block; min-width: 92px;
    color: var(--olive-dark);
    font-weight: 700;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.event-detail__description { font-size: 1.08rem; color: #2e332b; }
.event-detail__cta { margin-top: 34px; }

/* --- Boutons (pilule) --- */
.btn {
    display: inline-block;
    background: var(--white);
    color: var(--ink);
    border: 1px solid #d4d7cb;
    padding: 12px 24px;
    border-radius: 999px;
    text-decoration: none;
    font: inherit;
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .05s ease, box-shadow .15s ease;
}
.btn:hover { border-color: var(--olive); background: var(--olive-soft); }
.btn:active { transform: translateY(1px); }
.btn--primary {
    background: var(--rose); border-color: var(--rose); color: #fff;
    box-shadow: 0 6px 16px rgba(211,124,138,.28);
}
.btn--primary:hover { background: var(--rose-dark); border-color: var(--rose-dark); }
.btn--block { width: 100%; text-align: center; }
.btn--sm { padding: 7px 15px; font-size: .85rem; }
.btn--danger { color: var(--danger); border-color: #e6c9c9; background: #fbf1f1; }
.btn--danger:hover { background: #f6e2e2; border-color: #d9a9a9; }
.btn--full { background: #eceae4; color: #8a8f83; border-color: #dcd9d0; cursor: not-allowed; box-shadow: none; }
.btn--full:hover { background: #eceae4; border-color: #dcd9d0; }

/* --- Formulaires --- */
.form-page { max-width: 660px; margin: 8px auto 60px; }
.form-page--center { text-align: center; padding-top: 28px; }
.form-page h1 { font-family: var(--font-serif); font-weight: 600; color: var(--teal); font-size: 2.2rem; margin: 0 0 6px; }
.form-page__event { color: var(--muted); margin: 0 0 26px; }

.field { margin-bottom: 20px; }
.field label,
.field legend { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field .hint, .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.field .req, .req { color: var(--rose-dark); }
.field input[type=text],
.field input[type=email],
.field input[type=url],
.field input[type=date],
.field input[type=number],
.field input[type=password],
.field select,
.field textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cfd3c6;
    border-radius: 11px;
    font: inherit;
    background: var(--white);
    color: var(--ink);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--olive);
    box-shadow: 0 0 0 3px rgba(159,174,102,.22);
}
.field textarea { resize: vertical; }
.field--narrow input { max-width: 180px; }
.field__error { color: var(--danger); font-size: .85rem; margin: 6px 0 0; }
fieldset.field { border: 0; padding: 0; margin: 0 0 20px; }

.radio, .check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; cursor: pointer; margin-bottom: 6px; }
.radio input, .check input { margin-top: 3px; }
.field--check .check span { font-size: .95rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 540px) { .grid-2 { grid-template-columns: 1fr; } }

.form-actions { margin-top: 30px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.alert { padding: 13px 17px; border-radius: 11px; margin: 0 0 22px; font-size: .95rem; }
.alert--error { background: #fbeeef; color: #9a3340; border: 1px solid #eccace; }
.alert--success { background: var(--olive-soft); color: var(--teal-dark); border: 1px solid #cdd8b6; }

.success-mark {
    width: 70px; height: 70px; line-height: 70px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--olive); color: #fff;
    font-size: 2.1rem;
}

.empty { color: var(--muted); font-style: italic; padding: 26px 0; text-align: center; }

/* =========================================================================
   Administration (back-office — palette cohérente, sobre)
   ========================================================================= */
body.admin { background: #f3f4ee; }

.admin-header { background: var(--teal-dark); color: #fff; }
.admin-header__inner {
    max-width: 1100px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    min-height: 58px; flex-wrap: wrap;
}
.admin-header__brand { color: #fff; text-decoration: none; font-weight: 600; font-family: var(--font-serif); font-size: 1.25rem; }
.admin-nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.admin-nav a { color: #d7e2d7; text-decoration: none; font-size: .95rem; }
.admin-nav a:hover { color: #fff; }
.admin-nav__logout { color: #f4d3d0 !important; }

.admin-main { max-width: 1100px; margin: 0 auto; padding: 32px 20px 60px; }
.admin-page__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-page h1 { font-family: var(--font-serif); font-weight: 600; color: var(--teal); margin: 0; font-size: 2rem; }
.admin-page--form { max-width: 720px; }
.admin-page--form form {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

/* Login */
.admin--bare { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.admin-login-wrap { width: 100%; padding: 24px; }
.admin-login {
    max-width: 380px; margin: 0 auto;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}
.admin-login h1 { font-family: var(--font-serif); font-weight: 600; color: var(--teal); margin: 0 0 2px; }
.admin-login__sub { color: var(--muted); margin: 0 0 22px; font-size: .92rem; }

/* Tables */
.table-wrap {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:nth-child(1) { min-width: 250px; }
.table th:nth-child(2) { min-width: 140px; white-space: nowrap; }
.table th:nth-child(6) { min-width: 180px; }
.table thead th { background: #fafbf6; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbf5; }
.table__actions { white-space: nowrap; }
.icon-link { cursor: pointer; text-decoration: none; opacity: .7; transition: opacity .2s; margin-right: 8px; display: inline-flex; align-items: center; }
.icon-link i { font-size: 1.1rem; }
.icon-link:hover { opacity: 1; }
.table__actions form { display: inline; margin: 0; }
.row--muted td { color: var(--muted); }

.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; background: #ecefe4; color: var(--muted); }
.tag--yes { background: var(--olive-soft); color: var(--teal-dark); }
.tag--full { background: #f3dede; color: #7a1f1f; margin-left: 6px; }

.stats { color: var(--ink); margin: 0 0 20px; }
.muted { color: var(--muted); }

.current-image { margin-bottom: 12px; }
.current-image img { max-width: 240px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }

/* Registrations page */
.registrations-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
}
.registrations-header h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 600;
    color: var(--teal);
    margin: 0 0 6px;
    line-height: 1.2;
}
.registrations-meta {
    color: var(--muted);
    font-size: .95rem;
    margin: 0;
    line-height: 1.4;
}
.btn--secondary {
    background: #f0f0ef;
    color: var(--ink);
    border: 1px solid var(--line);
    flex-shrink: 0;
    margin-top: 4px;
}
.btn--secondary:hover {
    background: #e6e6e5;
    color: var(--ink);
}

.registrations-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--teal);
    line-height: 1;
    margin-bottom: 8px;
}
.stat-label {
    font-size: .85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    line-height: 1.4;
}

.stat-capacity {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.stat-progress {
    width: 100%;
    height: 6px;
    background: #e5e6da;
    border-radius: 999px;
    margin-bottom: 12px;
    overflow: hidden;
}
.stat-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--olive-dark), var(--olive));
    transition: width .3s ease;
}

.advanced summary { cursor: pointer; font-weight: 600; color: var(--teal); }
.advanced[open] { padding-top: 8px; }
