/* =========================================================================
   Portail Réservation — Commune de Lens (VS)
   Palette reprise du logo officiel de la commune (extrait du site source) :
   bleu #0092D0 et jaune #FFE32F. Les teintes ci-dessous sont des variantes
   assombries/éclaircies dérivées de ces deux couleurs exactes, utilisées
   pour garantir un contraste suffisant (WCAG AA) en fond plein ou en texte.
   Typo : Source Serif 4 (display, sobre/institutionnel) + Inter (texte)
          + JetBrains Mono (données, dates)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --forest: #0C3A5A;        /* bleu profond dérivé du logo officiel (#0092D0), assombri pour l'accessibilité en fond plein */
    --forest-light: #14547E;
    --stone: #EAF1F6;         /* gris-bleu clair */
    --stone-dark: #D3E1EA;
    --paper: #F7F8FA;
    --ink: #16202B;
    --ink-soft: #55636F;
    --saffron: #FFE32F;       /* jaune exact du logo officiel */
    --saffron-dark: #E0C400;
    --wood: #0077AC;          /* bleu accent du logo, assombri pour rester lisible en texte */
    --alert: #B0402E;
    --ok: #2F6B4F;
    --line: rgba(12, 58, 90, 0.14);
    --radius: 4px;
    --shadow: 0 4px 18px rgba(12, 58, 90, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 600;
    line-height: 1.18;
    margin: 0 0 0.5em;
    color: var(--forest);
}

a { color: var(--forest); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 3px solid var(--saffron);
    outline-offset: 2px;
}

.mono { font-family: 'JetBrains Mono', monospace; }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Signature : motif blasonné (étoiles à 5 rais) ---------- */
.crest-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 10px 0;
}
.crest-divider .rule { flex: 1; height: 1px; background: currentColor; opacity: 0.35; max-width: 220px; }
.crest-divider svg { width: 14px; height: 14px; color: var(--saffron); }
.crest-divider-footer { color: var(--stone-dark); }

/* Logo officiel de la commune (extrait du site source) */
.crest-mark { display: block; height: 42px; width: auto; }

/* ---------- Header ---------- */
.site-header {
    background: var(--forest);
    color: var(--paper);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 3px solid var(--saffron);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--paper);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-mark {
    font-family: 'Source Serif 4', serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.01em;
}
.brand-sub {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--saffron);
}
.header-contact {
    font-size: 0.85rem;
    color: var(--stone);
    text-align: right;
}
.header-contact a { color: var(--stone); text-decoration: none; }
.header-contact a:hover { color: var(--saffron); }

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(180deg, var(--forest) 0%, var(--forest-light) 100%);
    color: var(--paper);
    padding: 60px 0 0;
    overflow: hidden;
}
.hero .container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
    padding-bottom: 40px;
}
.hero h1 {
    color: var(--paper);
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 0.35em;
}
.hero .eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--saffron);
    margin-bottom: 14px;
    display: block;
}
.hero p.lead {
    color: var(--stone);
    font-size: 1.08rem;
    max-width: 46ch;
}
.hero-stats {
    display: flex;
    gap: 28px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.hero-stat { min-width: 90px; }
.hero-stat .num {
    font-family: 'Source Serif 4', serif;
    font-size: 2rem;
    color: var(--saffron);
    display: block;
}
.hero-stat .label {
    font-size: 0.76rem;
    color: var(--stone);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.hero-art { width: 100%; height: auto; max-width: 260px; margin: 0 auto; display: block; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease;
    font-family: 'Inter', sans-serif;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--saffron); color: var(--forest); }
.btn-primary:hover { background: var(--saffron-dark); }
.btn-outline { background: transparent; border-color: var(--stone); color: var(--paper); }
.btn-outline:hover { border-color: var(--saffron); color: var(--saffron); }
.btn-dark { background: var(--forest); color: var(--paper); }
.btn-dark:hover { background: var(--forest-light); }
.btn-danger { background: transparent; border-color: var(--alert); color: var(--alert); }
.btn-danger:hover { background: var(--alert); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #23543d; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Sections & venue cards ---------- */
.section { padding: 56px 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 8px;}
.section-title p { color: var(--ink-soft); margin: 0; }
.category-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 44px 0 18px;
}
.category-heading:first-of-type { margin-top: 0; }
.category-heading h3 { margin: 0; font-size: 1.15rem; color: var(--forest); }
.category-heading .rule { flex: 1; height: 1px; background: var(--line); }

.venue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}
.venue-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.venue-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(27,58,99,0.14); }
.venue-photo {
    height: 150px;
    background: var(--stone) center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    position: relative;
}
.venue-photo svg { width: 38px; height: 38px; opacity: 0.35; }
.venue-photo .disabled-badge {
    position: absolute; top: 10px; right: 10px;
    background: var(--alert); color: #fff; font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 20px;
}
.venue-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.venue-body h3 { margin-bottom: 0; font-size: 1.2rem; }
.venue-subtitle { color: var(--ink-soft); font-size: 0.88rem; margin: 0; }
.venue-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.82rem; color: var(--ink-soft); margin-top: 2px; }
.venue-meta span { display: flex; align-items: center; gap: 5px; }
.venue-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag {
    background: var(--stone);
    color: var(--forest);
    font-size: 0.72rem;
    padding: 4px 9px;
    border-radius: 20px;
    font-weight: 500;
}
.venue-footer { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; }
.venue-price { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--wood); }

/* ---------- Venue detail ---------- */
.detail-hero {
    background: var(--stone);
    padding: 36px 0;
    border-bottom: 1px solid var(--stone-dark);
}
.breadcrumb { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 14px; }
.breadcrumb a { color: var(--ink-soft); text-decoration: underline; }
.detail-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 36px;
    align-items: start;
    margin-top: 36px;
}
@media (max-width: 860px) { .detail-grid, .hero .container { grid-template-columns: 1fr; } }

.info-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 18px;
}
.info-box h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--wood); margin-bottom: 12px; }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 0.92rem; }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--ink-soft); }
.info-row .v { font-weight: 600; text-align: right; }
.amenity-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Calendar ---------- */
.calendar-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px 20px;
    box-shadow: var(--shadow);
}
.calendar-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.calendar-nav h4 { margin: 0; font-size: 1.08rem; }
.calendar-nav a { color: var(--forest); text-decoration: none; font-size: 1.1rem; padding: 4px 10px; border-radius: var(--radius); }
.calendar-nav a:hover { background: var(--stone); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekday { text-align: center; font-size: 0.7rem; color: var(--ink-soft); text-transform: uppercase; padding-bottom: 4px; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 4px; font-size: 0.85rem; font-family: 'JetBrains Mono', monospace; }
.cal-day.empty { visibility: hidden; }
.cal-day.free { background: #E9F1EC; color: var(--ok); }
.cal-day.pending { background: #FAF1DC; color: var(--saffron-dark); }
.cal-day.booked { background: #F5E1DD; color: var(--alert); text-decoration: line-through; }
.cal-day.past { background: transparent; color: #C7CBD3; }
.cal-legend { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; font-size: 0.78rem; color: var(--ink-soft); }
.cal-legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.free { background: var(--ok); }
.dot.pending { background: var(--saffron); }
.dot.booked { background: var(--alert); }

/* ---------- Forms ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--forest); margin-bottom: 6px; }
input, textarea, select {
    width: 100%; padding: 11px 12px; border: 1px solid var(--stone-dark); border-radius: var(--radius);
    font-family: inherit; font-size: 0.95rem; background: var(--paper); color: var(--ink);
}
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 16px; }
.field-hint { font-size: 0.76rem; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Alerts / flash ---------- */
.alert { padding: 14px 18px; border-radius: var(--radius); font-size: 0.9rem; margin-bottom: 20px; border-left: 4px solid; }
.alert-success { background: #E9F1EC; border-color: var(--ok); color: #1F4A34; }
.alert-error { background: #FBEAE6; border-color: var(--alert); color: #7A2A1C; }
.alert-info { background: #FAF1DC; border-color: var(--saffron); color: #6B4E1B; }

/* ---------- Status badge ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-pending { background: #FAF1DC; color: var(--saffron-dark); }
.badge-confirmed { background: #E4EEE8; color: var(--ok); }
.badge-refused { background: #F5E1DD; color: var(--alert); }
.badge-cancelled { background: var(--stone); color: var(--ink-soft); }
.badge-active { background: #E4EEE8; color: var(--ok); }
.badge-inactive { background: var(--stone); color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest); color: var(--stone); padding: 36px 0 24px; margin-top: 56px; }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-grid h4 { color: var(--paper); font-size: 0.95rem; margin-bottom: 10px; }
.footer-grid a { color: var(--stone); text-decoration: none; font-size: 0.88rem; }
.footer-grid a:hover { color: var(--saffron); }
.footer-bottom { text-align: center; margin-top: 24px; font-size: 0.76rem; color: rgba(247,248,250,0.5); }

/* ---------- Admin ---------- */
.admin-bar { background: var(--forest); color: var(--paper); padding: 12px 0; }
.admin-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.admin-bar a { color: var(--stone); text-decoration: none; font-size: 0.85rem; margin-left: 16px; }
.admin-bar a:hover { color: var(--saffron); }
.admin-tabs { display: flex; gap: 6px; margin: 24px 0; border-bottom: 1px solid var(--line); }
.admin-tabs a { padding: 10px 16px; text-decoration: none; color: var(--ink-soft); font-size: 0.88rem; font-weight: 600; border-bottom: 2px solid transparent; }
.admin-tabs a.active, .admin-tabs a:hover { color: var(--forest); border-color: var(--saffron); }
.login-wrap { max-width: 380px; margin: 90px auto; }
table.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.data-table th, table.data-table td { padding: 12px 14px; text-align: left; font-size: 0.87rem; border-bottom: 1px solid var(--line); }
table.data-table th { background: var(--stone); color: var(--forest); font-weight: 700; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.data-table tr:last-child td { border-bottom: none; }
.actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-soft); }

@media (max-width: 640px) {
    .site-header .container { flex-direction: column; align-items: flex-start; gap: 6px; }
    .header-contact { text-align: left; }
    .hero { padding-top: 36px; }
}
