/* DIN AFAM – stile del sito pubblico
   I colori principali arrivano da Admin › Impostazioni (variabili in <head>). */

:root {
  --primary: #1d3557;
  --accent: #b5121b;
  --ink: #1a1a1a;
  --paper: #ffffff;
  --muted: #5d6470;
  --line: #d9dce1;
  --tint: #f1f3f6;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --wrap: 1180px;
  --gap: clamp(1rem, 2.5vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--primary); text-underline-offset: .18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--sans); line-height: 1.15; margin: 0 0 .6em; letter-spacing: -.01em; }

.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* ---------- Header ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.header-row { display: flex; align-items: center; justify-content: space-between; padding-block: .9rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand img { width: 54px; height: 55px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; margin-left: .35rem; font-family: var(--sans); }
.brand-title { font-weight: 800; font-size: 1.45rem; letter-spacing: .01em; color: var(--primary); }
.brand-sub { font-size: .9rem; color: var(--muted); }

.site-nav { background: var(--primary); }
.site-nav > ul { list-style: none; display: flex; flex-wrap: wrap; padding: 0; margin-block: 0; }
.site-nav li { position: relative; }
.site-nav a {
  display: block; padding: .8rem .6rem; color: #fff; text-decoration: none;
  font-family: var(--sans); font-size: .9rem; font-weight: 500;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #fff; }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); }
.site-nav .sub {
  list-style: none; margin: 0; padding: .3rem 0; position: absolute; left: 0; top: 100%; min-width: 220px;
  background: var(--paper); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(20, 30, 50, .14);
  display: none;
}
.site-nav .sub a { color: var(--ink); }
.site-nav .sub a:hover { background: var(--tint); color: var(--primary); }
.site-nav li.has-sub:hover > .sub, .site-nav li.has-sub:focus-within > .sub, .site-nav li.open > .sub { display: block; }
.sub-toggle { display: none; }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    background: none; border: 1px solid var(--line); border-radius: 4px; cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    content: ""; display: block; width: 20px; height: 2px; background: var(--ink); position: relative; transition: transform .2s;
  }
  .nav-toggle-bars::before { position: absolute; top: -6px; }
  .nav-toggle-bars::after { position: absolute; top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }
  .site-nav { display: none; }
  .site-nav.open { display: block; }
  .site-nav > ul { flex-direction: column; }
  .site-nav li { border-top: 1px solid rgba(255, 255, 255, .12); }
  .site-nav li.has-sub { display: grid; grid-template-columns: 1fr 48px; }
  .sub-toggle { display: block; background: none; border: 0; color: #fff; cursor: pointer; font-size: 1.2rem; }
  .sub-toggle::before { content: "+"; }
  .site-nav li.open > .sub-toggle::before { content: "–"; }
  .site-nav .sub { position: static; grid-column: 1 / -1; box-shadow: none; border: 0; background: rgba(0, 0, 0, .15); display: none; }
  .site-nav li.has-sub:hover > .sub, .site-nav li.has-sub:focus-within > .sub { display: none; }
  .site-nav li.open > .sub { display: block; }
  .site-nav .sub a { color: #fff; padding-left: 1.8rem; }
  .brand-title { font-size: 1.2rem; }
  .brand img { width: 42px; height: 43px; }
}

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 600; font-size: .95rem;
  padding: .7rem 1.25rem; background: var(--primary); color: #fff; text-decoration: none; border: 2px solid var(--primary);
  border-radius: 2px; cursor: pointer; transition: background .15s, color .15s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-light { background: #fff; color: var(--primary); border-color: #fff; }
.btn-light:hover { background: transparent; color: #fff; border-color: #fff; }
.btn-small { padding: .4rem .9rem; font-size: .85rem; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; background: var(--primary); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 20, 40, .82) 0%, rgba(10, 20, 40, .45) 70%, rgba(10, 20, 40, .25)); }
.hero-inner { position: relative; z-index: 1; padding-block: clamp(4rem, 12vw, 9rem); }
.hero h1 { font-size: clamp(1.9rem, 4.4vw, 3.6rem); font-weight: 800; max-width: 22ch; margin-bottom: 1.6rem; letter-spacing: -.02em; }
.hero-cycle { display: block; font-weight: 400; font-size: .55em; margin-top: .7rem; letter-spacing: 0; opacity: .9; }

/* ---------- Blocchi home ---------- */
.block { padding-block: clamp(3rem, 7vw, 5rem); }
.block-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 800; color: var(--primary); }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.more { font-family: var(--sans); font-weight: 600; font-size: .9rem; text-decoration: none; }

/* Curricula: le iniziali sono l'elemento tipografico della home */
.letters { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.letters li { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.letters a {
  display: flex; flex-direction: column; justify-content: space-between; min-height: 15rem; height: 100%;
  padding: 1.4rem 1.4rem 1.6rem; text-decoration: none; color: var(--ink); transition: background .2s, color .2s;
}
.letter { font-family: var(--sans); font-weight: 800; font-size: clamp(4rem, 8vw, 7rem); line-height: .85; color: var(--primary); transition: color .2s; }
.letter-name { font-family: var(--sans); font-weight: 600; font-size: 1rem; line-height: 1.3; max-width: 22ch; }
.letters a:hover, .letters a:focus-visible { background: var(--primary); color: #fff; }
.letters a:hover .letter, .letters a:focus-visible .letter { color: #fff; }
.bando { margin-top: 2rem; }
@media (max-width: 900px) { .letters { grid-template-columns: repeat(2, 1fr); } .letters a { min-height: 11rem; } }

/* News */
.news-block { background: var(--tint); }
.news-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.4rem; margin-top: 1.4rem; }
.news-grid-wide { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.news-grid-3 { grid-template-columns: repeat(3, 1fr); }
.post-card a { text-decoration: none; color: var(--ink); }
.post-card-img { aspect-ratio: 1; background: var(--line); overflow: hidden; margin-bottom: .8rem; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card a:hover img { transform: scale(1.04); }
.post-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .35rem; }
.post-card a:hover h3 { color: var(--primary); text-decoration: underline; }
.post-card time { font-family: var(--sans); font-size: .85rem; color: var(--muted); }
@media (max-width: 1000px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .news-grid, .news-grid-wide, .news-grid-3 { grid-template-columns: repeat(2, 1fr); gap: 1rem; } }

/* Cifre */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin: 1.5rem 0 0; }
.stat { display: flex; flex-direction: column; border-top: 3px solid var(--accent); padding-top: .8rem; }
.stat dd { margin: 0; }
.stat dd:first-of-type { order: -1; font-family: var(--sans); font-weight: 800; font-size: clamp(2.6rem, 5vw, 4rem); line-height: 1; color: var(--primary); }
.stat dt { font-family: var(--sans); font-size: 1.05rem; margin: .3rem 0 .5rem; }
.stat-link a { font-family: var(--sans); font-size: .85rem; font-weight: 600; text-decoration: none; }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; } }

/* Galleria */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); }
.gallery figure { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; position: relative; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: .5rem .8rem; background: rgba(0, 0, 0, .55); color: #fff; font-size: .85rem; }
@media (max-width: 640px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

/* Banner */
.banner { background: var(--primary); color: #fff; padding-block: clamp(3rem, 7vw, 5rem); text-align: center; }
.banner h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; margin-bottom: .2em; }
.banner p { font-style: italic; font-size: 1.25rem; margin: 0 0 1.6rem; opacity: .9; }

/* Istituzioni */
.institutions { padding-block: 3rem; text-align: center; font-size: .95rem; line-height: 1.9; color: var(--muted); }
.institutions p { max-width: 75ch; margin-inline: auto; }
.institutions .slash { color: var(--accent); }
.institutions a { color: inherit; }

/* ---------- Pagine interne ---------- */
.page-head { background: var(--primary); color: #fff; position: relative; overflow: hidden; }
.page-head .wrap { position: relative; z-index: 1; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; margin: 0; max-width: 28ch; }
.page-head-sub { margin: .6rem 0 0; font-size: 1.15rem; opacity: .9; }
/* testate con animazione: un terzo più alte */
.page-head.has-video .wrap { padding-block: clamp(3.7rem, 8.9vw, 6.6rem); }
.page-head-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-head.has-image::after { content: ""; position: absolute; inset: 0; background: rgba(10, 20, 40, .6); }

.content-wrap { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem); }
.prose { max-width: 72ch; }
.prose h2 { font-size: 1.6rem; margin-top: 1.6em; color: var(--primary); }
.prose h3 { font-size: 1.25rem; margin-top: 1.4em; }
.prose img { margin: 1.5rem 0; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; vertical-align: top; }
.prose th { background: var(--tint); font-family: var(--sans); }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.prose blockquote { margin: 1.5rem 0; padding-left: 1.2rem; border-left: 3px solid var(--accent); font-style: italic; }
.prose .lead, .lead { font-size: 1.2rem; }
.intro { margin-bottom: 2rem; }
.empty { color: var(--muted); font-style: italic; }
.crumb { font-family: var(--sans); font-size: .9rem; margin: 0 0 1.5rem; }
.crumb a::before { content: "‹ "; }
.subnav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.subnav a { font-family: var(--sans); font-size: .9rem; padding: .35rem .8rem; border: 1px solid var(--primary); text-decoration: none; }
.section-title { font-size: 1.4rem; color: var(--primary); margin-top: 2rem; }

/* Curricula */
.cur-list { display: grid; gap: 2.5rem; }
.cur-item { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; align-items: start; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.cur-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--tint); }
.cur-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cur-thumb .letter { display: grid; place-items: center; height: 100%; }
.cur-item h2 { font-size: 1.5rem; }
.cur-item h2 a { text-decoration: none; }
@media (max-width: 700px) { .cur-item { grid-template-columns: 1fr; gap: 1rem; } }

.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; }
.aside h2 { font-size: 1rem; color: var(--muted); }
.aside ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.aside li { border-bottom: 1px solid var(--line); }
.aside a { display: flex; gap: .7rem; align-items: baseline; padding: .6rem 0; font-family: var(--sans); font-size: .92rem; text-decoration: none; color: var(--ink); }
.aside a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.mini-letter { font-weight: 800; color: var(--primary); width: 1.2rem; flex: none; }
@media (max-width: 900px) { .with-aside { grid-template-columns: 1fr; } }

/* Persone, filtri e schede */
.people-tools { display: grid; gap: 1rem; margin-bottom: 2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-family: var(--sans); font-size: .82rem; padding: .4rem .75rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 99px; cursor: pointer; }
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.people-count { font-family: var(--sans); font-size: .9rem; color: var(--muted); margin: 0; }
.person-photo { flex: none; }
.person h3 a { text-decoration: none; color: var(--ink); }
.person h3 a:hover { color: var(--primary); text-decoration: underline; }
.person-cur { font-family: var(--sans); font-size: .78rem !important; color: var(--primary) !important; margin-top: .25rem !important; }
.person-research { font-style: italic; }
.person-page .person-head { display: grid; grid-template-columns: 180px 1fr; gap: 2.5rem; align-items: start; }
.person-big { width: 220px; aspect-ratio: 1; object-fit: cover; }
.person-page h1 { font-size: clamp(2rem, 4vw, 2.8rem); color: var(--primary); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 1rem 0 1.5rem; font-size: 1rem; }
.facts dt { font-family: var(--sans); font-size: .82rem; color: var(--muted); padding-top: .15rem; }
.facts dd { margin: 0; }
.research-label { font-size: .9rem; color: var(--muted); margin: 1.5rem 0 .3rem; font-weight: 600; }
.research-title { font-size: 1.2rem; font-style: italic; margin: 0; max-width: 60ch; }
.bio { margin-top: 3rem; }
@media (max-width: 700px) { .person-page .person-head { grid-template-columns: 1fr; } .person-big { width: 160px; } }
.course-meta { font-family: var(--sans); font-size: .8rem; color: var(--primary); margin: 0 0 .3rem; }
.course-teacher { font-weight: 600; }
.event-date .h { font-size: .75rem; color: var(--muted); }
.people-mini { list-style: none; padding: 0; }
.people-mini li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.people-mini .muted, .muted { color: var(--muted); font-size: .92em; }
.count { font-size: .6em; color: var(--muted); font-weight: 500; }
.doc-list { list-style: none; padding: 0; }
.doc-list li { padding: .85rem 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; }
.doc-list a { font-family: var(--sans); font-weight: 600; }
.doc-list a::before { content: "PDF"; font-size: .65rem; font-weight: 700; color: #fff; background: var(--accent); padding: .1rem .35rem; margin-right: .6rem; vertical-align: middle; }
.doc-kind { font-family: var(--sans); font-size: .82rem; color: var(--muted); }
.prose iframe + h2 { margin-top: 2.5rem; }
.prose ul:has(> li > a > img) { list-style: none; padding: 0; display: flex; gap: .6rem; }
.prose ul:has(> li > a > img) img { width: 28px; height: 28px; margin: 0; }

/* Persone */
.filter { display: flex; flex-direction: column; gap: .3rem; max-width: 360px; margin-bottom: 2rem; font-family: var(--sans); font-size: .9rem; }
.filter input { padding: .6rem .8rem; border: 1px solid var(--line); font: inherit; font-size: 1rem; }
.group-title { font-size: 1.3rem; color: var(--primary); margin-top: 2.5rem; padding-bottom: .4rem; border-bottom: 2px solid var(--primary); }
.people { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem 2rem; }
.person { display: grid; grid-template-columns: 72px 1fr; gap: 1rem; align-items: start; }
.person img, .person .avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.person .avatar { display: grid; place-items: center; background: var(--tint); color: var(--primary); font-family: var(--sans); font-weight: 800; font-size: 1.6rem; }
.person h3 { font-size: 1.02rem; margin: 0 0 .15rem; }
.person p { margin: 0; font-size: .92rem; }
.person-inst { color: var(--muted); }
.person details { margin-top: .4rem; font-size: .9rem; }
.people-mini { padding-left: 1.2rem; }

/* FAQ */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--line); }
.tabs button { font-family: var(--sans); font-size: .95rem; padding: .7rem 1rem; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--primary); border-color: var(--accent); font-weight: 600; }
.faq { border-bottom: 1px solid var(--line); max-width: 80ch; }
.faq summary { font-family: var(--sans); font-weight: 600; font-size: 1.08rem; padding: 1.1rem 2rem 1.1rem 0; cursor: pointer; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .2rem; top: .9rem; font-size: 1.4rem; color: var(--accent); }
.faq[open] summary::after { content: "–"; }
.faq .prose { padding-bottom: 1.2rem; }

/* News */
.post-wrap { max-width: 860px; }
.post-head h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); color: var(--primary); }
.post-meta { font-family: var(--sans); font-size: .9rem; color: var(--muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.post-cover { margin: 1.5rem 0 2rem; width: 100%; max-height: 520px; object-fit: cover; }
.recent { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.recent h2 { font-size: 1.3rem; }
.pager { display: flex; gap: .4rem; margin-top: 3rem; font-family: var(--sans); }
.pager a { padding: .45rem .8rem; border: 1px solid var(--line); text-decoration: none; }
.pager a[aria-current="page"] { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Eventi */
.events { list-style: none; padding: 0; margin: 0; }
.event { display: grid; grid-template-columns: 90px 1fr; gap: 1.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.event-date { display: flex; flex-direction: column; font-family: var(--sans); text-align: center; border: 2px solid var(--primary); padding: .5rem; align-self: start; }
.event-date .d { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--primary); }
.event-date .m { font-size: .8rem; }
.event h3 { margin-bottom: .3rem; }
.event p { margin: 0; }
.event-loc { color: var(--muted); font-family: var(--sans); font-size: .9rem; }
.events.past .event-date { border-color: var(--line); }

/* Contatti */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.form { display: grid; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; font-family: var(--sans); font-size: .9rem; }
.field input, .field textarea { font: inherit; font-family: var(--serif); font-size: 1rem; padding: .65rem .8rem; border: 1px solid #b9bec7; border-radius: 2px; }
.field.has-error input, .field.has-error textarea { border-color: var(--accent); }
.field small { color: var(--accent); }
.form .btn { justify-self: start; }
.notice { padding: 1rem 1.2rem; font-family: var(--sans); margin-bottom: 1rem; }
.notice.ok { background: #e7f4ec; color: #145a32; }
.notice.err { background: #fdecec; color: #8a1414; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #e8e8e8; font-family: var(--sans); font-size: .92rem; }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 2rem; padding-block: 1.6rem; }
.footer-row p { margin: 0; }
.site-footer a { color: #fff; }
.site-footer .sep { margin-inline: .4rem; opacity: .5; }


/* ---------- Rubrica Collegio / Dottorandi ---------- */
.dir-tools {
  position: sticky; top: 0; z-index: 5; background: var(--paper);
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr) auto; gap: 1rem; align-items: end;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.dir-field { display: flex; flex-direction: column; gap: .3rem; font-family: var(--sans); font-size: .8rem; color: var(--muted); }
.dir-field input, .dir-field select {
  font-family: var(--sans); font-size: .95rem; color: var(--ink); padding: .6rem .75rem;
  border: 1px solid #c4c9d1; border-radius: 4px; background: var(--paper); width: 100%;
}
.dir-count { margin: 0; font-family: var(--sans); font-size: .9rem; color: var(--muted); white-space: nowrap; padding-bottom: .6rem; }
.dir-count strong { color: var(--primary); font-size: 1.15rem; }
.az { display: flex; flex-wrap: wrap; gap: .15rem; margin: 1rem 0 .5rem; font-family: var(--sans); font-size: .85rem; }
.az a, .az span { width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 4px; }
.az a { color: var(--primary); text-decoration: none; font-weight: 600; }
.az a:hover { background: var(--primary); color: #fff; }
.az span, .az a.off { color: #c2c6cc; pointer-events: none; font-weight: 400; }
.dir-group { scroll-margin-top: 6rem; }
.dir-letter {
  font-size: 1.4rem; font-weight: 800; color: var(--primary); margin: 1.8rem 0 0;
  padding-bottom: .35rem; border-bottom: 2px solid var(--primary);
}
.dir-list { list-style: none; margin: 0; padding: 0; }
.dir-link {
  display: grid; gap: .3rem 1.25rem; align-items: center; padding: .7rem .5rem;
  border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.is-coll .dir-link { grid-template-columns: 56px minmax(0, 2.1fr) minmax(0, 1.6fr) minmax(0, 1.3fr); }
.is-dott .dir-link { grid-template-columns: 56px minmax(0, 3fr) minmax(0, 1.3fr); }
.dir-link:hover { background: var(--tint); color: var(--ink); }
.dir-link:hover .dir-name { color: var(--primary); text-decoration: underline; }
.dir-photo img, .dir-initials { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: block; }
.dir-initials { display: grid; place-items: center; background: var(--tint); color: var(--primary); font-family: var(--sans); font-weight: 700; font-size: .95rem; letter-spacing: .02em; }
.dir-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.dir-name { font-family: var(--sans); font-weight: 600; font-size: 1.02rem; line-height: 1.25; }
.dir-sub { font-family: var(--sans); font-size: .84rem; color: var(--muted); }
.dir-research {
  font-size: .95rem; font-style: italic; color: #3d434c; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dir-inst { font-size: .93rem; line-height: 1.35; }
.dir-cur {
  font-family: var(--sans); font-size: .78rem; line-height: 1.3; color: var(--primary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 760px) {
  .dir-tools { grid-template-columns: 1fr; position: static; }
  .is-coll.no-cur .dir-link, .is-dott.no-cur .dir-link { grid-template-columns: 48px minmax(0, 1fr); }
  .dir-count { padding-bottom: 0; }
  .is-coll .dir-link, .is-dott .dir-link { grid-template-columns: 48px minmax(0, 1fr); align-items: start; }
  .dir-photo { grid-row: span 3; }
  .dir-photo img, .dir-initials { width: 48px; height: 48px; }
  .dir-inst, .dir-cur { grid-column: 2; }
}
.dir-tools { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.3fr) auto auto; }
.seg { display: inline-flex; border: 1px solid #c4c9d1; border-radius: 4px; overflow: hidden; }
.seg a { font-family: var(--sans); font-size: .9rem; padding: .58rem .85rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.seg a + a { border-left: 1px solid #c4c9d1; }
.seg a[aria-pressed="true"] { background: var(--primary); color: #fff; }
.seg a:hover:not([aria-pressed="true"]) { background: var(--tint); }
.cur-index { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 .5rem; }
.cur-index a { font-family: var(--sans); font-size: .82rem; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--primary); }
.cur-index a:hover { border-color: var(--primary); }
.cur-index a span { color: var(--muted); margin-left: .2rem; }
.cur-index a.off { opacity: .35; pointer-events: none; }
.dir-cur-title { font-size: 1.2rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.dir-cur-title a { color: var(--primary); text-decoration: none; }
.dir-cur-title a:hover { text-decoration: underline; }
.dir-cur-title small { font-family: var(--sans); font-size: .85rem; font-weight: 500; color: var(--muted); }
.is-coll.no-cur .dir-link { grid-template-columns: 56px minmax(0, 2fr) minmax(0, 1.5fr); }
.is-dott.no-cur .dir-link { grid-template-columns: 56px minmax(0, 1fr); }
.person-big { width: 180px; }
@media (max-width: 700px) { .person-big { width: 140px; } }


/* ---------- Scheda docente / dottorando ---------- */
.profile-head { background: var(--tint); border-bottom: 1px solid var(--line); padding: 1.6rem 0 2.2rem; }
.profile-crumb { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: 1.4rem; }
.profile-crumb a::before { content: none; }
.profile-crumb span { color: var(--muted); }
.profile-id { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 2.2rem; align-items: center; }
.profile-photo img, .profile-initials { width: 200px; height: 200px; object-fit: cover; border-radius: 6px; display: block; background: #fff; }
.profile-initials { display: grid; place-items: center; background: var(--primary); color: #fff; font-family: var(--sans); font-weight: 800; font-size: 3.4rem; }
.profile-kicker { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin: 0 0 .3rem; }
.profile-text h1 { font-size: clamp(2rem, 4.2vw, 3rem); color: var(--primary); margin: 0 0 .5rem; }
.profile-role { font-family: var(--sans); font-size: 1.05rem; margin: 0 0 .2rem; }
.profile-inst { font-size: 1.05rem; color: #3d434c; margin: 0 0 1rem; }
.profile-cur {
  display: inline-flex; align-items: center; gap: .55rem; font-family: var(--sans); font-size: .9rem; font-weight: 600;
  padding: .35rem .8rem .35rem .35rem; background: #fff; border: 1px solid var(--line); border-radius: 99px; text-decoration: none;
}
.profile-cur:hover { border-color: var(--primary); }
.profile-cur-letter { width: 1.7rem; height: 1.7rem; display: grid; place-items: center; background: var(--primary); color: #fff; border-radius: 50%; font-weight: 800; font-size: .85rem; }
.profile-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; padding-block: 2.5rem 3rem; }
.profile-section + .profile-section { margin-top: 2.5rem; }
.profile-section h2 { font-size: 1.3rem; color: var(--primary); padding-bottom: .4rem; border-bottom: 2px solid var(--primary); margin-bottom: 1rem; }
.research-box .research-title { font-size: 1.35rem; line-height: 1.45; font-style: italic; max-width: 60ch; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li { padding: .75rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .2rem; }
.lesson-list a { font-family: var(--sans); font-weight: 600; text-decoration: none; }
.lesson-list a:hover { text-decoration: underline; }
.lesson-meta { font-family: var(--sans); font-size: .84rem; color: var(--muted); }
.profile-aside { border-left: 1px solid var(--line); padding-left: 1.8rem; align-self: start; }
.profile-facts { grid-template-columns: 1fr; gap: .1rem; margin-top: 0; }
.profile-facts dt { margin-top: .8rem; }
.profile-facts dt:first-child { margin-top: 0; }
.profile-cur-summary { font-size: .92rem; color: #3d434c; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.profile-colleagues { background: var(--tint); padding: 2.2rem 0 2.6rem; }
.profile-colleagues h2 { font-size: 1.2rem; color: var(--primary); }
.colleague-grid { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.colleague-grid a { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: .75rem; align-items: center; padding: .6rem; background: #fff; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); height: 100%; }
.colleague-grid a:hover { border-color: var(--primary); }
.colleague-grid img, .colleague-grid .dir-initials { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.colleague-grid strong { display: block; font-family: var(--sans); font-size: .92rem; line-height: 1.25; }
.colleague-grid small { display: block; font-family: var(--sans); font-size: .78rem; color: var(--muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; padding-block: 1.6rem 3rem; font-family: var(--sans); }
.profile-pager a { text-decoration: none; }
.profile-pager .prev, .profile-pager .next { display: flex; flex-direction: column; font-weight: 600; }
.profile-pager .next { text-align: right; }
.profile-pager span { font-size: .78rem; font-weight: 400; color: var(--muted); }
.profile-pager .prev span::before { content: "‹ "; }
.profile-pager .next span::after { content: " ›"; }
.profile-pager .all { font-size: .9rem; padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 4px; }
@media (max-width: 900px) {
  .profile-body { grid-template-columns: 1fr; gap: 2rem; }
  .profile-aside { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 1.4rem; }
  .colleague-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .profile-id { grid-template-columns: 1fr; gap: 1.2rem; }
  .profile-photo img, .profile-initials { width: 140px; height: 140px; }
  .profile-initials { font-size: 2.4rem; }
  .colleague-grid { grid-template-columns: 1fr; }
  .profile-pager { grid-template-columns: 1fr 1fr; }
  .profile-pager .all { grid-column: 1 / -1; grid-row: 2; text-align: center; }
}


/* ---------- Video di testata ---------- */
.bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: reduce) { .bg-video { display: none; } }

/* ---------- Cronoprogramma ---------- */
.tl-intro { max-width: 60ch; margin-bottom: 2rem; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 1.2rem; font-family: var(--sans); font-size: .85rem; color: var(--muted); margin: 0 0 2rem; padding: 0; list-style: none; }
.tl-legend li { display: flex; align-items: center; gap: .45rem; }
.tl-legend i { width: .8rem; height: .8rem; border-radius: 50%; display: inline-block; border: 2px solid var(--primary); }
.tl-legend .l-done i { background: var(--primary); }
.tl-legend .l-next i { background: var(--accent); border-color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 8.4rem; top: .6rem; bottom: .6rem; width: 2px; background: var(--line); }
.tl-item { display: grid; grid-template-columns: 7.4rem 2rem minmax(0, 1fr); align-items: start; gap: 0; padding: .9rem 0; position: relative; }
.tl-date { font-family: var(--sans); text-align: right; padding-right: .2rem; line-height: 1.15; }
.tl-day { display: block; font-size: 1.7rem; font-weight: 800; color: var(--primary); }
.tl-month { display: block; font-size: .8rem; color: var(--muted); }
.tl-dot { width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--paper); border: 3px solid var(--primary); justify-self: center; margin-top: .55rem; position: relative; z-index: 1; }
.tl-body { padding: .45rem 0 0 .4rem; }
.tl-title { font-family: var(--sans); font-size: 1.08rem; font-weight: 600; margin: 0; max-width: 60ch; }
.tl-text { margin: .3rem 0 0; color: #3d434c; }
.tl-status { display: inline-block; margin-top: .35rem; font-family: var(--sans); font-size: .72rem; font-weight: 600; padding: .12rem .5rem; border-radius: 99px; background: var(--tint); color: var(--muted); }
.tl-item.is-done .tl-dot { background: var(--primary); }
.tl-item.is-done .tl-title { color: #4a515b; }
.tl-item.is-next .tl-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px rgba(181, 18, 27, .15); }
.tl-item.is-next .tl-status { background: var(--accent); color: #fff; }
.tl-item.is-next .tl-title { color: var(--ink); }
@media (max-width: 600px) {
  .timeline::before { left: 5.9rem; }
  .tl-item { grid-template-columns: 4.9rem 2rem minmax(0, 1fr); }
  .tl-day { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
