/* ==========================================================================
   ADM, elenco dei soci.
   ========================================================================== */

.page-head-split { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 48px; flex-wrap: wrap; }
.page-head-aside { max-width: 320px; }
.page-head-aside p { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

/* --------------------------------------------------------------- Barra dei filtri */
.soci-bar { padding: 20px 0; background: #fff; border-bottom: 1px solid var(--line); }
.soci-bar-main { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.soci-search { position: relative; flex: 1 1 320px; max-width: 520px; margin: 0; }
.soci-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.soci-search input {
  width: 100%; height: 46px; padding: 0 14px 0 40px; border: 1.5px solid var(--line); border-radius: 4px;
  font-size: 16px; color: var(--ink); background: #fff;
}
.soci-search input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.soci-toggle {
  display: none; align-items: center; gap: 6px; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 4px;
  background: #fff; color: var(--ink); font-family: var(--f-display); font-weight: 600;
}
.soci-toggle-n:not(:empty) { margin-left: 2px; padding: 1px 7px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; }
.soci-views { display: inline-flex; margin-left: auto; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; }
.soci-views a { padding: 11px 16px; color: var(--ink); font-family: var(--f-display); font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; }
.soci-views a + a { border-left: 1.5px solid var(--ink); }
.soci-views a[aria-current="true"] { background: var(--ink); color: #fff; }
.soci-views a:not([aria-current]):hover { background: var(--paper); }

.soci-bar-extra { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 2fr) auto; gap: 14px 20px; align-items: end; margin-top: 16px; }
.soci-field { margin: 0; }
.soci-field span, .soci-types legend { display: block; margin: 0 0 5px; font-family: var(--f-display); font-size: 13px; font-weight: 600; color: var(--muted); }
.soci-field .form-select { height: 42px; border-color: var(--line); border-radius: 4px; font-size: 15px; }
.soci-field .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.soci-types { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.soci-types legend { float: none; width: 100%; padding: 0; }
.soci-chip { position: relative; margin: 0; cursor: pointer; }
.soci-chip input { position: absolute; opacity: 0; pointer-events: none; }
.soci-chip span { display: inline-block; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text); font-size: 14px; line-height: 1.2; }
.soci-chip:hover span { border-color: var(--graphite); }
.soci-chip input:checked + span { border-color: var(--teal-dark); background: var(--teal-dark); color: #fff; }
.soci-chip input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.soci-bar-actions { display: flex; align-items: center; gap: 14px; }
.soci-apply { padding: 10px 18px; }
.soci-reset { font-size: 15px; font-weight: 600; white-space: nowrap; }
.js .soci-apply { display: none; }

/* --------------------------------------------------------------- Elenco */
.soci-body { padding: 28px 0 24px; }
.soci-count { margin: 0 0 18px; font-size: 15px; color: var(--muted); }

/* Indice delle iniziali: richiama le zone di riferimento sul bordo di una tavola. */
.soci-index {
  position: sticky; top: var(--header-h); z-index: 20; display: flex; margin: 0 0 32px;
  border: 1px solid var(--ink); background: rgba(255, 255, 255, .95);
}
.soci-index a { flex: 1 1 0; min-width: 26px; padding: 7px 0; border-left: 1px solid var(--line); text-align: center; color: var(--ink); font-family: var(--f-display); font-size: 14px; font-weight: 600; text-decoration: none; }
.soci-index a:first-child { border-left: 0; }
.soci-index a:hover { background: var(--teal-soft); color: var(--teal-dark); }
.soci-index a[aria-disabled="true"] { color: #b8c2ca; pointer-events: none; }

.soci-group { margin-bottom: 40px; scroll-margin-top: calc(var(--header-h) + 56px); }
.soci-group-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1.5px solid var(--ink); }
.soci-group-head h2 { margin: 0; font-size: 1.4rem; font-weight: 700; font-stretch: 88%; line-height: 1.15; }
.soci-group.is-letter .soci-group-head h2 { font-size: 2.2rem; font-stretch: 80%; line-height: 1; color: var(--teal-dark); }
.soci-group-n { font-size: 14px; color: var(--muted); }

.soci-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.member {
  display: flex; gap: 14px; align-items: flex-start; height: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: inherit; text-decoration: none; transition: border-color .15s, background-color .15s;
}
.member:hover { border-color: var(--teal); background: #fbfdfd; color: inherit; }
.portrait { flex: none; display: block; width: 56px; height: 70px; overflow: hidden; border-radius: 3px; background: var(--paper); }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portrait.is-initials { display: grid; place-items: center; background: var(--teal-soft); color: var(--teal-dark); font-family: var(--f-display); font-size: 18px; font-weight: 700; }
.member-text { min-width: 0; padding-top: 2px; }
.member-name { display: block; font-family: var(--f-display); font-size: 17px; line-height: 1.25; color: var(--ink); }
.member-name b { font-weight: 700; }
.member:hover .member-name { color: var(--teal-dark); }
.member-role { display: block; margin-top: 2px; font-size: 14px; line-height: 1.35; color: var(--muted); }
.member-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.member-tags span { padding: 1px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: 12px; font-weight: 600; }

.soci-empty { padding: 56px 20px; border: 1px dashed var(--line); border-radius: 6px; text-align: center; color: var(--muted); }
.soci-empty i { font-size: 28px; }
.soci-empty p { margin: 8px 0 18px; }

/* --------------------------------------------------------------- Responsive */
@media (max-width: 991.98px) {
  .soci-toggle { display: inline-flex; }
  .soci-views { margin-left: 0; }
  .soci-bar-extra { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .soci-types, .soci-bar-actions { grid-column: 1 / -1; }
  .js .soci-bar-extra[data-chiuso] { display: none; }
}
@media (max-width: 575.98px) {
  .soci-search { flex-basis: 100%; }
  .soci-views { flex: 1; }
  .soci-views a { flex: 1; text-align: center; padding-inline: 8px; }
  .soci-bar-extra { grid-template-columns: minmax(0, 1fr); }
  .soci-index { overflow-x: auto; scrollbar-width: none; }
  .soci-index a { flex: 0 0 34px; }
  .soci-grid { grid-template-columns: minmax(0, 1fr); }
}
