/* AJC06 — espace membres : profils, annuaire, amis, notifications, événements proposés par les membres.
   S'appuie sur les variables et composants de site.css. */

/* Couleurs de profil choisies par chaque membre (classes, pas de style en ligne : CSP). */
.accent-azur { --accent: #1460a6; --on-accent: #fff; }
.accent-mimosa { --accent: #f6c431; --on-accent: #1d1704; }
.accent-corail { --accent: #d9533f; --on-accent: #fff; }
.accent-olive { --accent: #557a35; --on-accent: #fff; }
.accent-lavande { --accent: #7357a6; --on-accent: #fff; }
.accent-nuit { --accent: #0f1d2e; --on-accent: #f6c431; }

.avatar {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%; object-fit: cover;
  background: var(--accent, var(--azur)); color: var(--on-accent, #fff);
  font-weight: 900; font-stretch: 70%; line-height: 1; overflow: hidden;
}
.avatar-sm { width: 32px; height: 32px; font-size: .8125rem; }
.avatar-md { width: 44px; height: 44px; font-size: 1rem; }
.avatar-lg { width: 88px; height: 88px; font-size: 2rem; }
.avatar-xl { width: 136px; height: 136px; font-size: 3.25rem; border: 5px solid var(--paper); }

.help { font-size: .875rem; color: var(--ink-2); }
.form-error { padding: 12px 16px; border: 1px solid #f0b4ae; background: #fdeceb; color: #8a1c12; border-radius: var(--radius); font-weight: 600; }
.form-error ul { margin: 8px 0 0; padding-left: 1.2em; font-weight: 500; }
.form-error a { color: inherit; font-weight: 700; }
.form-error .help { color: inherit; margin-top: 8px; }
.form-error:focus { outline: 2px solid #b42318; outline-offset: 2px; }
.btn-danger { background: #b42318; color: #fff; }
.btn-danger:hover { background: #912018; }
.danger-link { color: #b42318 !important; font-weight: 600; }
.muted { color: var(--ink-2); }

/* Connexion, inscription */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: clamp(32px, 6vw, 96px); align-items: start; padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(56px, 8vw, 112px); }
.auth-card { padding: clamp(22px, 3vw, 32px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.auth-card h2 { font-size: 1.75rem; margin-bottom: 18px; }
.auth-card .btn { justify-content: center; }
.auth-switch { display: block; margin-top: 16px; font-size: .9375rem; color: var(--ink-2); }
.auth-perks { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 18px; }
.auth-perks li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; }
.auth-perks .icon { color: var(--azur); margin-top: 2px; }
.auth-perks strong { display: block; font-size: 1.125rem; }
.auth-perks span { color: var(--ink-2); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } }

/* Réglages du profil et formulaire d'événement */
.settings { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.settings-form { gap: 16px; }
.settings-block { padding: 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 14px; }
.settings-block h2 { font-size: 1.375rem; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.settings-grid-wide { grid-template-columns: 2fr 1fr; }
.settings-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.settings-grid .field { margin-bottom: 14px; align-content: start; }
.settings-side { display: grid; gap: 16px; position: sticky; top: 96px; }
.settings-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-weight: 600; }
.settings-links a { text-decoration: none; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.avatar-field { display: flex; gap: 18px; align-items: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.swatch { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .9375rem; background: var(--paper); }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch-color { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); }
.swatch:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--azur-2); outline-offset: 2px; }
.community-form { max-width: 900px; gap: 16px; }
@media (max-width: 960px) { .settings { grid-template-columns: 1fr; } .settings-side { position: static; } }
@media (max-width: 640px) { .settings-grid, .settings-grid-wide, .settings-grid-4 { grid-template-columns: 1fr; } }

/* Annuaire */
.members-search { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.members-search input { flex: 1 1 280px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); font: inherit; }
.members-search select { min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); font: inherit; }
.members-section + .members-section { margin-top: 40px; }
.members-h { font-size: 1.5rem; margin-bottom: 14px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color .15s; }
.person:hover { border-color: var(--ink); }
.person-text { display: grid; min-width: 0; }
.person-text strong { font-size: 1.0625rem; }
.person-text span { font-size: .875rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.request-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.request-list .person { flex: 1 1 280px; }
.request-actions { display: flex; gap: 8px; }

/* Page de profil */
.profile-cover { height: clamp(120px, 18vw, 200px); background: var(--accent); overflow: hidden; position: relative; }
.profile-cover span {
  position: absolute; right: 4%; bottom: -0.18em; font-size: clamp(8rem, 22vw, 16rem); font-weight: 900; font-stretch: 62%;
  line-height: 1; color: var(--on-accent); opacity: .16; letter-spacing: -.02em;
}
.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 24px; align-items: start; padding-top: 18px; position: relative; }
.profile-head > .avatar { margin-top: -86px; }
.profile-name { font-size: clamp(2.25rem, 5vw, 3.75rem); font-weight: 900; font-stretch: 65%; line-height: .95; }
.profile-sub { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; color: var(--ink-2); font-size: .9375rem; }
.profile-headline { margin-top: 10px; font-size: 1.125rem; font-weight: 600; }
.profile-headline::before { content: "« "; color: var(--ink-2); }
.profile-headline::after { content: " »"; color: var(--ink-2); }
.profile-actions { padding-bottom: 6px; }
.profile-chips, .interest-chips { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.profile-chips li { padding: .35em .8em; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-weight: 600; font-size: .9375rem; }
.interest-chips { margin: 0; }
.interest-chips a { display: inline-block; padding: .35em .8em; border-radius: 999px; background: var(--azur-soft); color: var(--azur); text-decoration: none; font-weight: 600; font-size: .9375rem; }
.interest-chips a:hover { text-decoration: underline; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(24px, 4vw, 56px); margin-top: 32px; align-items: start; }
.profile-main, .profile-side { display: grid; gap: 28px; }
.profile-block h2 { font-size: .75rem; font-stretch: 100%; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px; }
.profile-block h2 small { font-size: inherit; color: var(--ink); margin-left: 4px; }
.profile-thesis { padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: var(--radius); }
.profile-thesis p { font-size: 1.25rem; font-weight: 700; font-stretch: 85%; line-height: 1.3; }
.profile-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.profile-links a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.friend-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.friend-grid a { display: grid; justify-items: center; gap: 4px; text-decoration: none; color: var(--ink); font-size: .75rem; text-align: center; }
.friend-grid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.report-link { font-size: .875rem; }
.report-link a { color: var(--ink-2); }
@media (max-width: 860px) {
  .profile-head { grid-template-columns: auto minmax(0, 1fr); }
  .profile-head > .avatar { margin-top: -70px; }
  .profile-actions { grid-column: 1 / -1; }
  .profile-layout { grid-template-columns: 1fr; }
  .avatar-xl { width: 104px; height: 104px; font-size: 2.5rem; }
}

/* Notifications */
.notif-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-width: 860px; }
.notif { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.notif.is-new { border-left: 4px solid var(--mimosa); }
.notif-text time { font-size: .8125rem; color: var(--ink-2); }
@media (max-width: 560px) { .notif { grid-template-columns: auto minmax(0, 1fr); } .notif-go { grid-column: 2; } }

/* Événements proposés par les membres */
.tag-community { background: var(--ink); color: var(--paper); }
.row-by { font-size: .875rem; font-weight: 600; color: var(--azur); margin-top: 2px; }
.filter-groups { display: grid; gap: 8px; }
.section-lede { margin-top: 10px; color: var(--ink-2); max-width: 38em; }
.more-line { margin-top: 18px; }
.organizer { display: inline-flex; align-items: center; gap: 12px; margin: -8px 0 20px; color: var(--ink); text-decoration: none; }
.organizer small { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.organizer strong { font-size: 1.0625rem; }
.organizer:hover strong { text-decoration: underline; }
.owner-tools { margin: -8px 0 20px; font-size: .9375rem; }
.owner-tools a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.attend { margin: 8px 0 32px; padding: 22px; border: 2px solid var(--ink); border-radius: var(--radius); display: grid; gap: 14px; scroll-margin-top: 96px; }
.attend-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.attend-head h2 { font-size: 1.625rem; }
.friends-going { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--azur); }
.attendee-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.attendee-list a { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none; font-size: .9375rem; font-weight: 600; }
.attendee-list a:hover { border-color: var(--ink); }
.invite summary { cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; color: var(--azur); }
.invite form { display: grid; gap: 12px; margin-top: 12px; justify-items: start; }
.invite-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; width: 100%; }
.invite-list .check { align-items: center; color: var(--ink); font-weight: 600; }
.invite-list .check input { margin: 0; }

/* Menu de compte dans l'en-tête */
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.account summary::-webkit-details-marker { display: none; }
.account-label { display: none; }
.account summary .avatar { width: 36px; height: 36px; }
.account[open] summary .avatar, .account summary:hover .avatar { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--azur-2); }
.badge { position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--mimosa); color: var(--mimosa-ink); font-size: .6875rem; font-weight: 800; line-height: 18px; text-align: center; }
.badge-inline { position: static; display: inline-block; margin-left: 4px; }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 220px; display: grid; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 32px -16px rgb(15 29 46 / .35);
}
.account-name { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-weight: 800; }
.nav .account-menu a, .account-menu button {
  display: block; width: 100%; padding: .55em .7em; border-radius: 6px; text-align: left; background: none; border: 0; box-shadow: none;
  color: var(--ink); font: inherit; font-weight: 600; font-size: .9375rem; cursor: pointer; text-decoration: none;
}
.nav .account-menu a:hover, .account-menu button:hover { background: var(--paper-2); }
.nav .login-link { font-weight: 700; white-space: nowrap; }

/* L'en-tête compte plus d'entrées : le menu replié s'applique plus tôt. */
@media (max-width: 1100px) {
  .nav-toggle { display: inline-grid; }
  /* Menu déplié : fixé entre le bas de l'en-tête et le bas de l'écran, il défile seul. */
  .nav {
    display: none; position: fixed; left: 0; right: 0; top: var(--nav-top, 72px); bottom: 0; z-index: 30;
    flex-direction: column; align-items: stretch; gap: 0; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 8px var(--gutter) calc(24px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line);
  }
  .nav.is-open { display: flex; }
  html.menu-open { overflow: hidden; }
  .nav > a { padding: .9em 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1.125rem; }
  .nav > a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--azur); padding-left: 12px; }
  .nav .nav-cta { margin: 16px 0 0; text-align: center; border-radius: var(--radius); border: 0; padding: .9em; }
  .nav-tools { margin: 12px 0 0; flex-wrap: wrap; }
  .nav-tools .theme-toggle { margin: 0; width: auto; flex: 1; }
  .account { order: -1; width: 100%; }
  .account summary { display: flex; justify-content: flex-start; gap: 10px; width: 100%; height: auto; padding: 8px 0; border-radius: 0; font-weight: 700; }
  .account-label { display: inline; }
  .account summary .badge { position: static; }
  .account-menu { position: static; box-shadow: none; min-width: 0; margin-bottom: 4px; }
  .nav .login-link { padding: .7em 0; }
}
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { font-weight: 700; padding: 0; }

/* Types d'événement (cases à cocher) et demande de soutien */
.type-choices label { font-size: .875rem; }
.other-type { display: none; }
.settings-block:has(input[name="type_list"][value="autre"]:checked) .other-type,
.g-fieldset:has(input[name="type_list"][value="autre"]:checked) .other-type { display: block; }
.support-details { display: none; gap: 14px; }
.support-block:has(.support-toggle input:checked) .support-details { display: grid; }
.support-block:has(.support-toggle input:checked) { border-color: var(--azur); box-shadow: inset 0 0 0 1px var(--azur); }
.support-rules { padding: 14px 16px; background: var(--azur-soft); border-radius: var(--radius); font-size: .9375rem; }
.support-rules ul { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 6px; }
.choices input[type="checkbox"] { accent-color: var(--mimosa); }

/* Photos */
.photo-wall { columns: 4 220px; }
.photo-view { margin: 0; display: grid; gap: 16px; max-width: 1000px; }
.photo-view img { width: 100%; max-height: 78vh; object-fit: contain; background: var(--paper-2); border-radius: var(--radius); }
.photo-caption { font-size: 1.25rem; font-weight: 700; }
.photo-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 600; margin-top: 6px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.event-photos { margin-top: 40px; display: grid; gap: 14px; }
.event-photos h2 { font-size: 1.625rem; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.photo-strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.consent-box { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 16px 18px; border: 2px solid var(--mimosa); border-radius: var(--radius); background: var(--card); }
.consent-box .icon { color: var(--azur); }
.consent-box p + p { margin-top: 4px; color: var(--ink-2); }
.consent-field { padding: 14px 16px; background: var(--paper-2); border-radius: var(--radius); }
.tag-supported { background: var(--mimosa); color: var(--mimosa-ink); }
.pending-note { border-left-color: var(--azur); }

/* Couleurs des nouveaux types */
.tag-rentree, .tag-meetup { background: var(--azur-soft); color: var(--azur); }
.tag-afterwork, .tag-soiree, .tag-coworking { background: #fdf0c4; color: #6b4e00; }
.tag-sport { background: #e3efd9; color: #2f5d1c; }
.tag-conference, .tag-mediation, .tag-soutenance { background: #e8e4f4; color: #4a3a7a; }
.tag-autre { background: var(--paper-2); color: var(--ink-2); }

/* Filtres et alertes */
.link-btn { border: 0; background: none; padding: 0; color: var(--azur-ink, var(--azur)); font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; }

/* Partage d'un événement (« Fais tourner ! ») */
.share { margin: 8px 0 28px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); display: grid; gap: 12px; }
.share-title { font-size: 1.375rem; margin: 0; }
.share p { margin: 0; color: var(--ink-2); }
.share-native { justify-self: start; }
.share-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.share-grid a, .share-grid button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); font: inherit; font-size: .9375rem; text-decoration: none; cursor: pointer; }
.share-grid a:hover, .share-grid button:hover { border-color: var(--azur); color: var(--azur); }
.share-story { justify-self: start; display: inline-flex; align-items: center; gap: 6px; color: var(--azur); font-weight: 600; }

/* Commentaires */
.event-comments { margin-top: 40px; display: grid; gap: 14px; scroll-margin-top: 96px; }
.event-comments h2 { font-size: 1.625rem; }
.event-comments h2 small { font-size: 1rem; color: var(--ink-2); }
.comments { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.comment { display: grid; grid-template-columns: auto 1fr; gap: 10px; scroll-margin-top: 96px; }
.comment-body p { margin: 0 0 4px; overflow-wrap: anywhere; }
.comment-meta { font-size: .9rem; color: var(--ink-2); }
.comment-meta strong { color: var(--ink); }
.comment-tools { display: flex; gap: 12px; font-size: .8125rem; }
.comment-tools form { display: inline; }
.comment-tools button, .comment-tools a { background: none; border: 0; padding: 0; color: var(--ink-2); font: inherit; cursor: pointer; text-decoration: underline; }
.comment-form { display: grid; gap: 10px; max-width: 640px; }
.comment-form .btn { justify-self: start; }

/* Vignettes de vidéos et de liens externes, lecteurs chargés au clic */
.media-tile { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 4px; background: var(--night); color: var(--on-night); text-align: center; }
.wall .media-tile { aspect-ratio: 4 / 3; margin-bottom: 0; }
.media-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; pointer-events: none; }
.media-tile svg { position: relative; fill: currentColor; }
.media-tile-link { gap: 6px; align-content: center; padding: 8px; background: var(--azur-soft); color: var(--ink); }
.media-tile-link b { font-size: .875rem; }
.photo-view video { width: 100%; max-height: 78vh; background: #000; border-radius: var(--radius); }
.embed { display: grid; place-items: center; align-content: center; gap: 8px; width: 100%; aspect-ratio: 16 / 9; padding: 16px; text-align: center; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.embed.is-playing { padding: 0; border: 0; background: #000; }
.embed iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.embed-play { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; background: none; border: 0; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.embed-play svg { fill: currentColor; width: 56px; height: 56px; padding: 12px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); }
.embed-note { font-size: .8125rem; color: var(--ink-2); margin: 0; }
.media-link span { color: var(--ink-2); font-size: .875rem; }
