:root {
    --bg: #f6f1e9;
    --paper: #fffdf9;
    --ink: #2b2a27;
    --muted: #8a8377;
    --line: #e6ddcf;
    --accent: #3f607a;       /* bleu ardoise (rappel iWeb d'origine) */
    --accent-deep: #2c4863;
    --gold: #b08847;
    --shadow: 0 8px 30px rgba(43, 42, 39, .10);
    --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }

h1, h2, h3, .brand-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: .01em;
}

a { color: var(--accent); }

/* ── Header ── */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; gap: 20px; }
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 1.7rem; letter-spacing: .04em; }
.brand-sub { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .18em; }
.main-nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.main-nav a { text-decoration: none; font-size: .92rem; font-weight: 500; color: var(--ink); }
.main-nav a:hover { color: var(--accent); }
.nav-cta { padding: 7px 16px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent) !important; }
.nav-cta:hover { background: var(--accent); color: #fff !important; }
.inline-form { display: inline; }
.link-btn { background: none; border: none; font: inherit; color: var(--muted); cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--accent); }

/* ── Hero ── */
.hero {
    background: linear-gradient(160deg, var(--accent-deep), var(--accent));
    color: #fff; padding: 78px 0 64px; text-align: center;
}
.hero.compact { padding: 52px 0 40px; }
.hero h1 { font-size: clamp(2.8rem, 6vw, 4.4rem); }
.hero .lead { max-width: 620px; margin: 14px auto 0; font-size: 1.15rem; color: #e7eef4; }
.eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: .72rem; font-weight: 600; opacity: .85; }
.hero .eyebrow { color: #cdddea; }

/* ── Narrative ── */
.narrative { padding: 48px 22px 12px; max-width: 760px; }
.narrative p { font-size: 1.12rem; margin-bottom: 16px; }
.narrative em { color: var(--accent-deep); }

/* ── Section titles ── */
.section-title {
    font-size: 2rem; text-align: center; color: var(--accent-deep);
    margin: 48px 0 26px; position: relative;
}
.section-title::after {
    content: ""; display: block; width: 54px; height: 2px;
    background: var(--gold); margin: 14px auto 0;
}

/* ── Members grid ── */
.members-section { padding-bottom: 70px; }
.member-grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
.member-card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px 16px; text-align: center; text-decoration: none; color: var(--ink);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.member-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d8ccb8; }
.avatar {
    width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
    background: linear-gradient(135deg, #d9e2ea, #b9c8d6);
    display: flex; align-items: center; justify-content: center; margin-bottom: 6px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.initials { font-family: 'Cormorant Garamond', serif; font-size: 2rem; color: var(--accent-deep); }
.initials.big { font-size: 4rem; }
.member-name { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 600; }
.member-meta { font-size: .78rem; color: var(--muted); }

/* ── Member page ── */
.member-head { display: flex; gap: 28px; align-items: center; padding: 48px 22px 10px; flex-wrap: wrap; }
.member-portrait {
    width: 150px; height: 150px; border-radius: 50%; overflow: hidden; flex: none;
    background: linear-gradient(135deg, #d9e2ea, #b9c8d6); display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow);
}
.member-portrait img { width: 100%; height: 100%; object-fit: cover; }
.member-headtext h1 { font-size: 3rem; color: var(--accent-deep); }
.member-body { padding: 18px 22px 0; }
.profile-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; max-width: 760px; }
.profile { display: grid; gap: 2px; }
.profile-row { display: grid; grid-template-columns: 200px 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.profile-row:last-child { border-bottom: none; }
.profile dt { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; align-self: center; }
.profile dd { font-size: 1.05rem; }
.bio { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.bio p { margin-bottom: 12px; }
.empty-note { color: var(--muted); font-style: italic; max-width: 760px; }

/* ── Gallery ── */
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); padding-bottom: 10px; }
.shot {
    display: block; overflow: hidden; border-radius: 12px; aspect-ratio: 4/3;
    box-shadow: 0 2px 12px rgba(43,42,39,.10); background: #e9e2d6;
}
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.shot:hover img { transform: scale(1.07); }

.back-row { padding: 36px 22px 70px; }
.back-link { text-decoration: none; font-weight: 600; }

/* ── Buttons / forms ── */
.btn {
    display: inline-block; background: var(--accent); color: #fff; border: none;
    padding: 11px 22px; border-radius: 999px; font: 500 .95rem 'Inter', sans-serif;
    cursor: pointer; text-decoration: none; transition: background .2s;
}
.btn:hover { background: var(--accent-deep); }
.btn.small { padding: 8px 16px; font-size: .85rem; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 5px; }
.stack label > span { font-size: .82rem; color: var(--muted); font-weight: 600; }
input[type=text], input[type=email], input[type=password], textarea, select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
    font: inherit; background: var(--paper); color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: .9rem; }

/* ── Flash / alerts ── */
.flash { background: #e7f1e8; border: 1px solid #bcd9c0; color: #2f6b3a; padding: 12px 16px; border-radius: 10px; margin: 18px auto; }
.alert { background: #fbe7e7; border: 1px solid #e6b8b8; color: #a13838; padding: 11px 14px; border-radius: 10px; }

/* ── Auth ── */
.auth-wrap { display: flex; justify-content: center; padding: 64px 22px; }
.auth-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 2.2rem; color: var(--accent-deep); }
.auth-card .muted { margin-bottom: 18px; }

/* ── Espace / admin ── */
.space-head { padding: 44px 22px 8px; }
.space-head h1 { font-size: 2.6rem; color: var(--accent-deep); }
.edit-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); padding-top: 18px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; }
.panel h2 { font-size: 1.5rem; color: var(--accent-deep); margin-bottom: 14px; }
.panel h3 { font-size: 1.15rem; margin: 22px 0 10px; }
.avatar-edit { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar-edit .avatar { width: 110px; height: 110px; }
.add-photos { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.add-photos input[type=text] { flex: 1; min-width: 160px; }
.edit-gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.edit-gallery figure { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.edit-gallery img { width: 100%; height: 130px; object-fit: cover; display: block; }
.edit-gallery figcaption { font-size: .78rem; padding: 6px 8px; color: var(--muted); }
.edit-gallery .del { width: 100%; border: none; border-top: 1px solid var(--line); background: #fff; color: #a13838; padding: 7px; font-size: .8rem; cursor: pointer; }
.edit-gallery .del:hover { background: #fbe7e7; }
.row-form { display: flex; gap: 10px; flex-wrap: wrap; }
.row-form input { flex: 1; min-width: 180px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
small.muted { font-weight: 400; }

/* ── Arbre / SOSA ── */
.sosa-section { padding-top: 36px; }
.sosa { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); max-width: 860px; margin: 0 auto; }
.sosa a { display: block; }
.sosa img { width: 100%; height: auto; border-radius: 8px; display: block; }
.sosa figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: .9rem; color: var(--muted); }
.children-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.child-chip {
    font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-weight: 600;
    text-decoration: none; color: var(--accent-deep);
    background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px;
    transition: background .2s, color .2s;
}
.child-chip:hover { background: var(--accent); color: #fff; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); margin-top: 40px; padding: 30px 0; text-align: center; }
.site-footer p { font-size: .85rem; }
.muted { color: var(--muted); }

/* ── Lightbox ── */
.lb-overlay {
    position: fixed; inset: 0; background: rgba(20,18,15,.92); display: none;
    align-items: center; justify-content: center; z-index: 100; flex-direction: column;
}
.lb-overlay.open { display: flex; }
.lb-overlay img { max-width: 92vw; max-height: 82vh; border-radius: 6px; box-shadow: 0 10px 50px rgba(0,0,0,.5); }
.lb-cap { color: #eee; margin-top: 14px; font-size: .95rem; }
.lb-close, .lb-prev, .lb-next {
    position: absolute; background: rgba(255,255,255,.12); color: #fff; border: none;
    width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; cursor: pointer;
}
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.28); }

@media (max-width: 640px) {
    .profile-row { grid-template-columns: 1fr; gap: 2px; }
    .member-head { justify-content: center; text-align: center; }
}

/* ── Footer maillage (liens internes + réseau du groupe) ── */
.ft { background: #1a140d; color: #d9cdb4; border-top: 3px solid #8a5a2b; margin-top: 48px; }
.ft-wrap { max-width: 1100px; margin: 0 auto; padding: 44px 24px 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.ft-h { font-size: 1.1rem; letter-spacing: .03em; color: #e6d6a8; margin: 0 0 14px; font-weight: 600; }
.ft-col a { color: #d9cdb4; text-decoration: none; display: block; padding: 3px 0; transition: color .2s; }
.ft-col a:hover { color: #f2e4bd; text-decoration: underline; }
.ft-links { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 20px; }
.ft-links li { break-inside: avoid; }
.ft-about p { margin: 0 0 10px; line-height: 1.5; color: #cabfa6; }
.ft-by { font-size: .88rem; color: #a8987a; }
.ft-legal { border-top: 1px solid rgba(255,255,255,.08); text-align: center; padding: 14px; font-size: .85rem; color: #8f8161; }
@media (max-width: 720px) { .ft-wrap { grid-template-columns: 1fr; gap: 24px; } }

/* Signature auteur + date (crédibilité / GEO) */
.byline { font-size: .85rem; color: var(--label, #6a5f4c); margin-top: 6px; font-style: italic; }
