/* ============================================================
   LA MAISON DE LECTOURE — Location saisonnière
   ============================================================ */

:root {
    --primary: #2A79B2;        /* bleu de Lectoure : boutons, selections */
    --primary-dark: #226291;   /* bleu profond : en-tete, titres de page, liens */
    --primary-light: #B2E7FF;  /* bleu ciel : touches legeres uniquement */
    --accent: #c98b2b;         /* ocre : contrepoint chaud */
    --heading: #2c3034;        /* titres de cartes */
    --bg: #f8f6f1;             /* pierre claire */
    --text: #2c3034;
    --border: #e4e0d7;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.bold { font-weight: 600; }
.mt-25 { margin-top: 25px; }
.hint { color: #6b6760; font-size: .92rem; margin-bottom: 12px; }

/* ---------- Header ---------- */
header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-container { max-width: 1200px; margin: 0 auto; width: 100%; }
.header-inner { display: flex; flex-direction: column; }
.header-topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; }
.site-logo { font-size: 1.4rem; font-weight: bold; }
.site-logo a { color: white; text-decoration: none; }
.menu-toggle { display: none; background: none; border: none; color: white; font-size: 1.8rem; cursor: pointer; padding: 10px; }
.header-nav { border-top: 1px solid rgba(255,255,255,.2); }
nav ul { list-style: none; display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; padding: 0 10px; }
nav ul li a { color: white; padding: 12px 14px; display: block; border-radius: 4px; font-size: .95rem; transition: background .2s; }
nav ul li a:hover { background: rgba(255,255,255,.15); text-decoration: none; }
nav ul li a.active { background: rgba(255,255,255,.2); font-weight: bold; }
.nav-separator { border-left: 1px solid rgba(255,255,255,.3); margin: 5px 8px; }

/* ---------- Contenu ---------- */
main { max-width: 1200px; margin: 20px auto; padding: 0 20px; width: 100%; flex: 1; }
.page-title { color: var(--primary-dark); margin-bottom: 20px; font-size: 1.9rem; }
.section-title { color: var(--primary-dark); margin: 10px 0 15px; font-size: 1.4rem; }
.card {
    background: white;
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(25,45,60,.08);
}
.card p { margin-bottom: 10px; }
.card-title { color: var(--heading); margin-bottom: 12px; font-size: 1.25rem; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.info-grid > .card { margin-bottom: 0; min-width: 0; }
/* Coordonnées (page Contact) : libellés longs (« Correo electrónico ») sur deux lignes si besoin, email coupé plutôt que débordant */
.table-coord td.bold { white-space: normal; width: 40%; }
.table-coord td:last-child { overflow-wrap: anywhere; }

/* ---------- Hero / accueil ---------- */
.hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 90px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}
.hero h1 { font-size: 2.6rem; margin-bottom: 10px; text-shadow: 0 2px 6px rgba(0,0,0,.4); }
.hero p { font-size: 1.25rem; margin-bottom: 25px; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.features-grid, .activities-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 20px; }
.features-grid .card, .activities-grid .card { margin-bottom: 0; }
.feature, .activity { text-align: center; }
.activity { text-align: left; display: flex; flex-direction: column; }
.activity p { flex: 1; }
.feature-icon { font-size: 2.2rem; margin-bottom: 6px; }
.feature h3, .activity h3 { color: var(--heading); margin-bottom: 8px; font-size: 1.1rem; }
.activity .lieux { list-style: none; font-size: .9rem; margin: 0 0 10px; flex: 1; }
.activity .lieux li { margin-bottom: 8px; }
.activity .lieu-nom { font-weight: 600; color: var(--heading); }
.activity a.lieu-nom { color: var(--primary-dark); }
.activity-link { font-weight: 600; font-size: .92rem; }
.cta { text-align: center; }
.cta .btn { margin: 4px; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, opacity .2s;
    font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #ece9e2; color: var(--primary-dark); }
.btn-secondary:hover { background: #dfdbd1; }
.btn-success { background: #2e7d4f; color: white; }
.btn-danger { background: #b3261e; color: white; }
.btn-danger:hover { background: #8c1d17; }
.btn-sm { padding: 5px 12px; font-size: .88rem; }
.btn-lg { padding: 14px 30px; font-size: 1.1rem; }
.btn-block { display: block; width: 100%; }

/* ---------- Formulaires ---------- */
.form-group { margin-bottom: 15px; flex: 1; min-width: 0; }
.form-group label { display: block; font-weight: 600; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfcac0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42,121,178,.18);
}
.form-row { display: flex; gap: 15px; flex-wrap: wrap; }
.form-row .form-group { min-width: 160px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.checkbox input { margin-top: 5px; flex-shrink: 0; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 15px; }
.alert-success { background: #e4f4ea; color: #1f5b37; border: 1px solid #b6dfc5; }
.alert-error { background: #fbe7e5; color: #8c1d17; border: 1px solid #f0bcb7; }

/* ---------- Tableaux ---------- */
.table-simple { width: 100%; border-collapse: collapse; }
.table-simple td { padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-simple td:last-child { text-align: right; }
.table-simple td.bold { text-align: left; white-space: nowrap; }
.table-simple tr.total td { font-weight: 700; border-bottom: none; }
.table-scroll { overflow-x: auto; }
.table-admin { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table-admin th { text-align: left; padding: 8px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.table-admin td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-admin .actions { white-space: nowrap; }
.table-admin .actions form { display: inline-block; margin: 0 4px 4px 0; }
.table-admin summary { cursor: pointer; font-weight: 600; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: .8rem; background: #eee; white-space: nowrap; }
.badge-paid { background: #fff0cc; color: #7a5200; }
.badge-confirmed { background: #d6f0df; color: #1f5b37; }
.badge-refunded { background: #e0e7f5; color: #2a3f73; }
.badge-demande { background: #fff0cc; color: #7a5200; }
.badge-langue { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; font-size: .72rem; margin-left: 4px; }
.badge-acceptee { background: #e0e7f5; color: #2a3f73; }
.badge-confirmee { background: #d6f0df; color: #1f5b37; }
.badge-refusee, .badge-annulee { background: #f6d9d6; color: #8c1d17; }
.input-sm { padding: 5px 8px; border: 1px solid #cfcac0; border-radius: 6px; font-size: .88rem; font-family: inherit; width: 100%; margin-bottom: 5px; }
.table-admin form .btn { margin-top: 2px; }
.check-sm { font-size: .85rem; gap: 6px; margin-bottom: 4px; white-space: normal; }
.check-sm input { margin-top: 3px; }
.row-muted { opacity: .55; }
/* Historique : formulaire de modification sur toute la largeur, sous la ligne concernée */
.table-admin .actions > .btn { margin: 0 4px 4px 0; vertical-align: top; }
.table-admin tr.hist-edit > td { background: #f1f9fd; border-left: 4px solid var(--primary); padding: 14px 16px; }
.hist-edit-titre { font-weight: 600; margin: 0 0 10px; }
.hist-edit .form-group { margin-bottom: 10px; }
.hist-edit .form-row .hist-montant { flex: 0 1 170px; min-width: 140px; }
.hist-edit .form-row .hist-note { flex: 2 1 260px; }
.bank-box { border-left: 4px solid var(--accent); }
.param-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; }
.param-grid .param-wide { grid-column: 1 / -1; }
.param-grid .hint { margin: 4px 0 0; font-size: .82rem; }
.choix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 15px; }
.choix-grid .checkbox { font-weight: normal; }
.choix-grid .checkbox input { margin-top: 4px; }
.lang-switch { display: flex; gap: 6px; align-items: center; }
.lang-switch a { color: white; font-size: .85rem; padding: 3px 7px; border-radius: 4px; opacity: .75; }
.lang-switch a.active, .lang-switch a:hover { background: rgba(255,255,255,.2); opacity: 1; text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.house-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 10px 0 5px; font-weight: 600; color: var(--primary-dark); }
.amenities { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 20px; list-style: none; margin-top: 8px; }
.amenities li::before { content: "✓ "; color: var(--primary); font-weight: bold; }
.reviews-card { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.reviews-score { font-size: 2.6rem; font-weight: 700; color: var(--primary-dark); line-height: 1; }
.reviews-score small { font-size: 1rem; font-weight: normal; color: #6b6760; }
.reviews-score-box { display: inline-block; background: var(--primary-dark); color: white; font-size: 1.9rem; padding: 6px 10px; border-radius: 8px 8px 8px 0; }
.reviews-link { margin: 16px 0 0; }
.reviews-badge { background: #fff0cc; color: #7a5200; padding: 4px 12px; border-radius: 14px; font-weight: 600; font-size: .9rem; }
.paliers { display: flex; flex-direction: column; gap: 6px; }
.palier-row { display: flex; align-items: center; gap: 6px; font-size: .95rem; }
.palier-row input { width: 70px !important; padding: 6px 8px; text-align: right; }
.ical-row { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.ical-row span { width: 120px; flex-shrink: 0; font-size: .92rem; }
.legal .card-title { margin-top: 18px; font-size: 1.1rem; }
.legal .card-title:first-child { margin-top: 0; }
.plain-list { margin: 8px 0 8px 22px; }
.plain-list li { margin-bottom: 6px; }
.sync-url { font-size: .8rem; word-break: break-all; display: block; max-width: 460px; }
code { background: #efece5; padding: 1px 5px; border-radius: 4px; font-size: .88em; }

/* ---------- Admin : fiches de réservation ---------- */
.tab-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: #b3261e; color: white; font-size: .78rem; font-weight: 700; text-align: center; }
.resa-card { background: white; border-radius: 10px; box-shadow: 0 1px 4px rgba(25,45,60,.08); margin-bottom: 18px; border-left: 5px solid var(--border); overflow: hidden; }
.resa-card.resa-demande { border-left-color: #e0a800; }
.resa-card.resa-acceptee { border-left-color: var(--primary); }
.resa-card.resa-confirmee { border-left-color: #2e7d4f; }
.resa-card.resa-refusee, .resa-card.resa-annulee { border-left-color: #b3261e; opacity: .85; }
.resa-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); background: #fbfaf7; }
.resa-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.resa-ref { font-family: Consolas, 'Courier New', monospace; font-size: 1.1rem; font-weight: 700; color: var(--heading); letter-spacing: .5px; }
.resa-total { font-size: 1.3rem; font-weight: 700; color: var(--primary-dark); }
.resa-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 16px 20px; }
.resa-body h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .8px; color: #8a857c; margin-bottom: 6px; }
.resa-body p { margin-bottom: 6px; font-size: .95rem; }
.resa-dates { font-size: 1.05rem !important; font-weight: 600; color: var(--heading); }
.resa-nom { font-size: 1.05rem !important; font-weight: 600; color: var(--heading); }
.resa-muted { color: #6b6760; font-size: .88rem !important; }
.resa-prix { width: 100%; border-collapse: collapse; font-size: .92rem; margin-bottom: 8px; }
.resa-prix td { padding: 2px 0; }
.resa-prix td:last-child { text-align: right; }
.resa-prix tr.total td { font-weight: 700; border-top: 1px solid var(--border); padding-top: 4px; }
.resa-info { font-size: .88rem !important; color: #5f5b54; }
.resa-notes { margin: 0 20px 14px; padding: 10px 14px; background: #f6f4ef; border-radius: 8px; font-size: .92rem; }
.resa-notes p { margin: 2px 0; }
.resa-actions { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--border); background: #fbfaf7; }
.resa-actions .checkbox { margin: 0; font-size: .95rem; }
.resa-actions .checkbox input { margin-top: 4px; }
.resa-sep { flex: 1; }
.resa-motif { flex: 1 1 260px; padding: 9px 12px; border: 1px solid #cfcac0; border-radius: 6px; font-family: inherit; font-size: .95rem; }
.resa-modif { padding: 12px 20px; border-top: 1px dashed var(--border); }
.resa-modif-form { margin-top: 4px; }
.resa-modif-champs { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.resa-modif-champs label { display: flex; flex-direction: column; font-size: .85rem; font-weight: 600; color: #5f5b54; gap: 4px; }
.resa-modif-champs input { padding: 8px 10px; border: 1px solid #cfcac0; border-radius: 6px; font-family: inherit; font-size: .95rem; }
.resa-modif-champs input[type=number] { width: 90px; }
.resa-estim { font-weight: 600; color: var(--primary-dark); margin-bottom: 6px; }
.resa-modif-form .btn { margin: 4px 6px 0 0; }
.resa-simu { display: block; margin-top: 8px; padding: 8px 10px; background: #fff7e6; border: 1px solid #f0dcae; border-radius: 6px; color: #5f4b1e; }
.resa-motif-zone { resize: vertical; min-height: 6.5em; line-height: 1.4; align-self: stretch; }
@media (max-width: 900px) {
    .resa-body { grid-template-columns: 1fr; gap: 12px; }
    .resa-sep { display: none; }
}

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 15px; }
.tab { padding: 8px 16px; border-radius: 20px; background: #ece9e2; color: var(--primary-dark); }
.tab:hover { text-decoration: none; background: #dfdbd1; }
.tab.active { background: var(--primary); color: white; }

/* ---------- Galerie ---------- */
.gallery-section { margin-bottom: 30px; }
.gallery-rubrique { font-size: 1.3rem; font-weight: 700; color: var(--heading); margin-bottom: 12px; padding-bottom: 6px; border-bottom: 2px solid var(--primary-light); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.gallery-item img { width: 100%; height: 190px; object-fit: cover; border-radius: 8px; display: block; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.gallery-item img:hover { transform: scale(1.03); box-shadow: 0 4px 14px rgba(0,0,0,.25); }

.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 2000; align-items: center; justify-content: center; }
.lightbox.active { display: flex; }
.lightbox-img { max-width: 92vw; max-height: 88vh; border-radius: 4px; }
.lightbox-close, .lightbox-prev, .lightbox-next { position: absolute; background: none; border: none; color: white; cursor: pointer; padding: 12px; opacity: .8; }
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { opacity: 1; }
.lightbox-close { top: 10px; right: 20px; font-size: 2.5rem; }
.lightbox-prev { left: 15px; top: 50%; font-size: 2.2rem; }
.lightbox-next { right: 15px; top: 50%; font-size: 2.2rem; }
.lightbox-counter { position: absolute; bottom: 15px; color: white; font-size: .95rem; }

/* ---------- Carte dessinée ---------- */
.map-wrap { margin: 15px 0 5px; }
.map { width: 100%; height: auto; max-height: 420px; display: block; margin: 0 auto; border-radius: 14px; }
.map text { font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; fill: #3a2e26; }
.map-city { font-size: 17px; }
.map-city-main { font-size: 22px; font-weight: bold; fill: #1b2f4d !important; }
.map-city-home { font-size: 26px; font-weight: bold; fill: #9a3f22 !important; }
.map-city-small { font-size: 14px; }
.map-note { font-size: 15px; font-style: italic; }
.map-river { font-size: 15px; font-style: italic; fill: #3b78a8 !important; }
.map-route { font-size: 16px; fill: #9a3f22 !important; font-weight: bold; }

/* ---------- Calendrier de réservation ---------- */
.calendar { margin: 10px 0; }
.cal-nav { display: flex; justify-content: space-between; margin-bottom: 10px; }
.cal-months { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.cal-title { text-align: center; font-weight: 700; margin-bottom: 8px; color: var(--heading); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-size: .78rem; color: #8a857c; padding: 3px 0; }
.cal-day {
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border);
    background: #f1fbf4;
    border-radius: 6px;
    cursor: pointer;
    font-size: .95rem;
    font-family: inherit;
    color: var(--text);
}
.cal-day:hover:not(:disabled) { border-color: var(--primary); }
.cal-day.busy { background: #ece9e2; color: #aaa59b; text-decoration: line-through; }
.cal-day.past, .cal-day:disabled { background: #f6f4ef; color: #ccc; text-decoration: none; cursor: default; }
.cal-day.sel { background: var(--primary); color: white; text-decoration: none; border-color: var(--primary); }
.cal-day.mid { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; border-color: var(--primary-light); }
.calendar-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .88rem; margin: 10px 0; color: #5f5b54; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; margin-right: 4px; border: 1px solid var(--border); }
.lg-free { background: #f1fbf4; }
.lg-busy { background: #ece9e2; }
.lg-sel { background: var(--primary); }
.stay-summary { background: #f1f9fd; border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-top: 10px; }
.table-simple tr.remise td, .resa-prix tr.remise td { color: #2e7d4f; font-weight: 600; }
.remises-info { display: inline-block; background: #e4f4ea; color: #1f5b37; border-radius: 6px; padding: 6px 12px; font-weight: 600; font-size: .92rem; margin-bottom: 10px; }
.stay-summary .table-simple { margin-top: 8px; max-width: 420px; }

/* ---------- Footer ---------- */
footer { background: #528DB7; color: #ffffff; text-align: center; padding: 20px; margin-top: 30px; font-size: .92rem; }
.footer-link { color: #fff; }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .header-nav { display: none; }
    .header-nav.open { display: block; }
    nav ul { flex-direction: column; gap: 0; }
    .nav-separator { display: none; }
    .hero { padding: 60px 15px; }
    .hero h1 { font-size: 1.9rem; }
    .cal-months { grid-template-columns: 1fr; }
    .page-title { font-size: 1.5rem; }
    .map-city { font-size: 20px; }
}
