/* ==========================================================================
   ADM, scheda del socio.
   ========================================================================== */

/* --------------------------------------------------------------- Profilo */
.profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px 36px; align-items: start; margin-top: 8px; }
.profile-photo {
  position: relative; display: block; width: 132px; height: 165px; overflow: hidden;
  border: 1.5px solid var(--ink); background: #fff;
}
.profile-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-photo.is-initials { display: grid; place-items: center; background: var(--teal-soft); color: var(--teal-dark); font-family: var(--f-display); font-size: 42px; font-weight: 700; }
.profile-main h1 { margin: 0; font-size: clamp(2rem, 4.2vw, 3.3rem); font-weight: 750; font-stretch: 85%; line-height: 1.02; letter-spacing: -.02em; }
.profile-role { margin: 10px 0 0; font-size: 19px; color: var(--text); }
.profile-univ { margin: 4px 0 0; font-size: 17px; color: var(--muted); }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 16px 0 0; padding: 0; }
.profile-tags li { padding: 3px 11px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: 13px; font-weight: 600; }
.profile-tags li.is-ssd { background: #fff; border: 1px solid var(--line); color: var(--muted); }
.profile-links { display: grid; gap: 8px; min-width: 230px; }
.profile-links .btn-adm { justify-content: flex-start; padding: 10px 14px; font-size: 15px; background: #fff; }
.profile-links .btn-adm:hover { background: var(--ink); }
.profile-id { margin-left: auto; padding-left: 10px; font-family: var(--f-text); font-weight: 400; font-size: 14px; color: var(--muted); }
.profile-links .btn-adm:hover .profile-id { color: #c9d3db; }
.profile-mail { margin: 4px 0 0; font-size: 15px; color: var(--muted); word-break: break-all; }

.socio-empty { padding: 56px 0 24px; color: var(--muted); }
.socio-section { padding-top: 64px; }
.socio-h2 { margin: 0 0 16px; font-size: 1.5rem; font-weight: 700; font-stretch: 88%; }

/* Indicatori sopra una linea di quota, come in home */
.socio-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 36px; border-top: 1px solid var(--line); }
.socio-facts .fact { position: relative; padding: 18px 20px 0 0; }
.socio-facts .fact::before { content: ""; position: absolute; top: -6px; left: 0; width: 1px; height: 11px; background: var(--graphite); }
.socio-facts .fact-n { display: block; font-family: var(--f-display); font-size: clamp(1.7rem, 2.8vw, 2.4rem); font-weight: 700; font-stretch: 85%; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.socio-facts .fact-l { display: block; margin-top: 6px; font-size: 15px; color: var(--muted); }

/* --------------------------------------------------------------- Grafico */
.chart { margin: 0; padding: 20px 20px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-bottom: 12px; }
.chart-title { font-family: var(--f-display); font-weight: 600; color: var(--ink); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 14px; }
.lg { display: inline-flex; align-items: center; gap: 7px; padding: 2px 0; border: 0; background: none; color: var(--text); }
button.lg { cursor: pointer; }
.lg::before { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-radius: 2px; }
.lg-art::before { color: var(--teal-dark); background: var(--teal-dark); }
.lg-conf::before { color: var(--teal); background: var(--teal); }
.lg-altri::before { color: var(--graphite); background: var(--graphite); }
.lg-cum { color: var(--muted); }
.lg-cum::before { width: 16px; height: 0; border-width: 2px 0 0; border-radius: 0; color: var(--ink); }
.lg[aria-pressed="false"] { color: var(--muted); text-decoration: line-through; }
.lg[aria-pressed="false"]::before { background: transparent; }
.chart-canvas { position: relative; min-height: 240px; }
.chart-canvas svg { display: block; width: 100%; height: auto; font-family: var(--f-display); font-size: 12px; }
.chart-canvas .ax text { fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-canvas .ax text.cum { fill: var(--ink); }
.chart-canvas .grid { stroke: var(--line); stroke-dasharray: 3 3; }
.chart-canvas .base { stroke: var(--ink); stroke-width: 1.2; }
.chart-canvas .s-art { fill: var(--teal-dark); }
.chart-canvas .s-conf { fill: var(--teal); }
.chart-canvas .s-altri { fill: var(--graphite); }
.chart-canvas .line { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.chart-canvas .pt { fill: #fff; stroke: var(--ink); stroke-width: 1.4; }
.chart-canvas .hl { fill: var(--teal-soft); }
.chart-tip {
  position: absolute; top: 4px; z-index: 5; min-width: 190px; padding: 10px 12px; border-radius: 4px;
  background: var(--ink); color: #fff; font-size: 13px; line-height: 1.5; pointer-events: none;
}
.chart-tip b { display: block; margin-bottom: 2px; font-family: var(--f-display); font-size: 15px; }
.chart-tip span { display: flex; justify-content: space-between; gap: 16px; }
.chart-tip em { font-style: normal; font-variant-numeric: tabular-nums; }
.chart-data { margin-top: 10px; font-size: 14px; }
.chart-data summary { color: var(--muted); cursor: pointer; }
.chart-data table { width: 100%; margin-top: 10px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart-data th, .chart-data td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.chart-data th:first-child { text-align: left; }

/* --------------------------------------------------------------- Pubblicazioni e parole chiave */
.socio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; padding: 56px 0 24px; }
.pubs-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 20px; }
.pubs-search { position: relative; flex: 1 1 260px; margin: 0; }
.pubs-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pubs-search input { width: 100%; height: 42px; padding: 0 12px 0 38px; border: 1.5px solid var(--line); border-radius: 4px; font-size: 15px; }
.pubs-search input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.pubs-types { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; }
.pubs-types button { padding: 9px 13px; border: 0; background: #fff; color: var(--ink); font-family: var(--f-display); font-size: 14px; font-weight: 600; }
.pubs-types button + button { border-left: 1.5px solid var(--ink); }
.pubs-types button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.pubs-active { display: flex; align-items: center; gap: 6px; margin: 0; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--teal-dark); color: #fff; font-size: 14px; }
.pubs-active[hidden] { display: none; }
.pubs-active button { border: 0; background: none; color: #fff; padding: 0 4px; }
.pubs-count { flex-basis: 100%; margin: 0; font-size: 14px; color: var(--muted); }

.pubs-year h3 { margin: 28px 0 0; padding-bottom: 6px; border-bottom: 1.5px solid var(--ink); font-size: 1.6rem; font-weight: 700; font-stretch: 80%; color: var(--teal-dark); font-variant-numeric: tabular-nums; }
.pubs-year:first-of-type h3 { margin-top: 0; }
.pubs-list { list-style: none; margin: 0; padding: 0; }
.pub { padding: 16px 0; border-bottom: 1px solid var(--line); }
.pub-type { font-size: 13px; font-weight: 600; color: var(--muted); }
.pub-type--art { color: var(--teal-dark); }
.pub-type--conf { color: #0d7f94; }
.pub-title { margin: 3px 0 5px; font-size: 17px; font-weight: 600; line-height: 1.35; }
.pub-title a { color: var(--ink); text-decoration: none; }
.pub-title a:hover { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }
.pub-authors, .pub-source { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.pub-authors mark { padding: 0; background: none; color: var(--ink); font-weight: 700; }
.pub-abstract { margin-top: 8px; font-size: 15px; }
.pub-abstract summary { width: max-content; color: var(--teal-dark); font-weight: 600; cursor: pointer; }
.pub-abstract > p { margin: 10px 0 0; padding-left: 14px; border-left: 2px solid var(--teal); color: var(--text); line-height: 1.6; }
.pub-kw { display: flex; flex-wrap: wrap; gap: 6px; border: 0 !important; padding-left: 0 !important; }
.pub-kw button { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text); font-size: 13px; }
.pub-kw button:hover { border-color: var(--teal); color: var(--teal-dark); }
.pubs-none { padding: 32px 0; color: var(--muted); }

.keywords { position: sticky; top: calc(var(--header-h) + 24px); }
.keywords-note { margin: -8px 0 14px; font-size: 14px; color: var(--muted); }
.kw-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.kw-list button {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; width: 100%; padding: 9px 0;
  border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; color: var(--ink);
}
.kw-list button:hover .kw-label, .kw-list button[aria-pressed="true"] .kw-label { color: var(--teal-dark); }
.kw-list button[aria-pressed="true"] .kw-label { font-weight: 700; }
.kw-label { font-size: 15px; line-height: 1.3; }
.kw-n { font-family: var(--f-display); font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.kw-bar { grid-column: 1 / -1; height: 3px; background: var(--paper); }
.kw-bar span { display: block; height: 100%; background: var(--teal); }
.kw-toggle { margin-top: 12px; padding: 0; border: 0; background: none; color: var(--teal-dark); font-weight: 600; }

/* --------------------------------------------------------------- Responsive */
@media (max-width: 1199.98px) {
  .profile { grid-template-columns: auto minmax(0, 1fr); }
  .profile-links { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(220px, max-content)); }
}
@media (max-width: 991.98px) {
  .socio-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .socio-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 40px; }
  .keywords { position: static; order: -1; }
}
@media (max-width: 575.98px) {
  .profile { grid-template-columns: minmax(0, 1fr); }
  .profile-photo { width: 104px; height: 130px; }
  .profile-links { grid-template-columns: minmax(0, 1fr); }
  .chart { padding: 14px 10px 8px; }
  .pubs-types { width: 100%; }
  .pubs-types button { flex: 1; }
}
