/* ═══════════════════════════════════════════════════════════
   D&CLab Presentation — Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ──────────────────────────────────────────── */
:root {
  --blue:    #0E509A;
  --blue2:   #1565c0;
  --accent:  #ff6f00;
  --dark:    #06214a;
  --light:   #eef2f9;
  --grey:    #556;
  --border:  #dde2ee;
  --white:   #ffffff;
  --fs-base: 1em;        /* body scale controlled by Reveal */
}

/* ── BASE ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

.reveal {
  font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
  font-size: 26px;
}

.reveal .slides section {
  padding: 28px 48px;
  text-align: left;
}

.reveal h1, .reveal h2, .reveal h3 { margin: 0; }

.reveal h1,
.cover-title {
  text-transform: none !important;
}

#jump-select {
  position: fixed;
  right: 120px;          /* vicino alle frecce */
  bottom: 18px;
  z-index: 10000;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #0E509A;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  cursor: pointer;
}

#jump-select:hover {
  border-color: #0E509A;
}
/* ════════════════════════════════════════════════════════════
   SLIDE TYPES
   ════════════════════════════════════════════════════════════

   1. .slide-cover   — title / closing: dark bg, logos, QR
   2. .slide-chapter — chapter divider: bg photo + overlay
   3. .slide-content — default white content slide
   4. .slide-dark    — dark content (stats, etc.)

   ══════════════════════════════════════════════════════════ */

/* ── 1. COVER ────────────────────────────────────────────────
   Used for TITLE and CLOSING — intentionally near-identical.
   Background image set inline on the section element.         */
.slide-cover {
  position: relative;
  display: flex !important;
  align-items: stretch;
  padding: 0 !important;
  color: #fff !important;
}
.slide-cover .cover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(6,33,74,.96) 55%, rgba(14,80,154,.82) 100%);
  z-index: 0;
}
.slide-cover .cover-body {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 70% 30%;
  gap: 2em;
  align-items: center;
  width: 100%;
  padding: 44px 54px;
}

.reveal .slide-cover a,
.reveal .slide-cover a:visited {
  color: #fff !important;
}

.reveal .slide-cover a:hover,
.reveal .slide-cover a:focus {
  color: #fff !important;
  text-decoration: underline;
}


.cover-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 6px;
  padding: .2em .75em;
  font-size: .52em;
  color: rgba(255,255,255,.8);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: .7em;
}
.cover-title {
  color: #fff !important;
  font-size: 1.7em;
  font-weight: 800;
  line-height: 1.18;
  margin: .08em 0 .45em;
}
.cover-sub {
  color: rgba(255,255,255,.85) !important;
  font-size: .54em;
  line-height: 1.9;
  margin-bottom: 18px;
}
.cover-sub a {
  color: #fff !important;
}
.cover-logos {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}
.cover-logo-box {
  background: transparent;
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cover-logo-box img { 
  height: 36px; 
  display: block; 
  margin: 0;
  padding: 0;
}

/* Right column of cover */
.cover-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.cover-lab-logo {
  background: transparent;
  border-radius: 14px;
  padding: 16px 22px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  overflow: hidden;
}
.cover-lab-logo img { 
  height: 140px; 
  display: block;
  margin: 0;
  padding: 0;
}

.cover-logos {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cover-logo-box {
  height: 60px;              /* altezza comune */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 8px;
}

.cover-logo-box img {
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.cover-right {
  width: 80%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-img {
  width: 85%;        /* più armonico del 100% */
  max-width: 420px;
  height: auto;
  object-fit: contain;
}


/* Social links (closing slide) */
.social-links { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.social-link {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.78); font-size: .52em;
  text-decoration: none; transition: color .18s;
}
.social-link:hover { color: #fff; }
.social-icon {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.social-icon svg { width: 14px; height: 14px; }


/* ── 2. CHAPTER ──────────────────────────────────────────────
   Chapter dividers: photo left, text+accent right.
   NO full-page image with giant text.                         */
.slide-chapter {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0 !important;
  overflow: hidden;
}
.chapter-photo {
  position: relative;
  overflow: hidden;
  min-height: 100%;
}
.chapter-photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
.chapter-photo::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to right, transparent 70%, rgba(6,33,74,.15));
}
.chapter-text {
  background: var(--dark);
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff !important;
}
.chapter-text * {
  color: inherit !important;
}
.chapter-eyebrow {
  font-size: .46em;
  color: rgba(255,255,255,.55) !important;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 600;
  margin-bottom: 10px;
}
.chapter-title {
  color: #fff !important;
  font-size: 1.55em;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: .4em;
}
.chapter-accent {
  width: 42px; height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin: 14px 0 16px;
}
.chapter-desc {
  color: rgba(255,255,255,.62) !important;
  font-size: .52em;
  line-height: 1.75;
}


/* ── 3. CONTENT (default) ────────────────────────────────────
   White slide with standard header                            */
.slide-content { background: var(--white); }

/* Slide heading — blue title with accent underline */
.slide-h {
  color: var(--blue);
  font-size: 1.05em;
  font-weight: 700;
  padding-bottom: .18em;
  margin-bottom: .55em;
  border-bottom: 3px solid var(--accent);
}

/* ── 4. DARK CONTENT ─────────────────────────────────────────*/
.slide-dark { background: var(--light); }


/* ════════════════════════════════════════════════════════════
   COMMON COMPONENTS
   ════════════════════════════════════════════════════════════ */

/* Info card: bordered left accent */
.info-card {
  background: var(--white);
  border-radius: 9px;
  padding: 10px 13px;
  border-left: 3px solid var(--blue);
  font-size: .54em;
  color: var(--grey);
  line-height: 1.55;
}
.info-card.accent  { border-color: var(--accent); }
.info-card.dark    { background: var(--dark); color: rgba(255,255,255,.85); border: none; }
.info-card strong  { color: var(--blue); }
.info-card.accent strong { color: var(--accent); }
.info-card.dark strong   { color: #fff; }

/* Filled stat box */
.stat-box {
  background: var(--blue);
  color: #fff;
  border-radius: 11px;
  padding: 14px 12px;
  text-align: center;
  flex: 1;
}
.stat-box.accent { background: var(--accent); }
.stat-box .num { font-size: 2em; font-weight: 800; line-height: 1; }
.stat-box .lbl { font-size: .44em; opacity: .82; margin-top: 4px; line-height: 1.3; }

/* Stats row */
.stats-row { display: flex; gap: 9px; justify-content: stretch; margin: 8px 0; }

/* Photo image box: consistent border-radius + object-fit */
.img-box {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: block;
  position: relative;
}
.img-box img { 
  width: 100%; 
  height: 100%; 
  min-width: 110%;
  min-height: 110%;
  object-fit: cover;
  object-position: center center;   
  display: block;
  margin: 0;
  padding: 0;
}

/* Small number callout */
.kpi {
  background: var(--light);
  border-radius: 9px;
  padding: 10px 12px;
  text-align: center;
  font-size: .5em;
}
.kpi .kpi-n { font-size: 2em; font-weight: 800; color: var(--blue); line-height: 1; }
.kpi .kpi-n.accent { color: var(--accent); }
.kpi .kpi-l { color: var(--grey); margin-top: 4px; }

/* Tag pill */
.tag {
  display: inline-block; border-radius: 4px;
  padding: 2px 7px; margin: 2px 2px 0 0;
  font-size: .78em; font-weight: 600; color: #fff;
}
.tag-nat { background: var(--blue); }
.tag-int { background: #6a1b9a; }
.tag-reg { background: #00695c; }
.tag-uni { background: #bf360c; }
.tag-year{ background: var(--accent); }

/* Badge */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .8em; font-weight: 600; }
.badge.active { background: #e8f5e9; color: #2e7d32; }
.badge.closed { background: #fce4ec; color: #c62828; }

/* Loading placeholder */
.loading { color: #aaa; font-size: .6em; font-style: italic; }


/* ════════════════════════════════════════════════════════════
   PEOPLE
   ════════════════════════════════════════════════════════════ */

/* Faculty 3-column grid */
.faculty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 18px;
  align-items: start;
}
.faculty-col { display: flex; flex-direction: column; gap: 20px; }
.faculty-col h3 {
  font-size: .58em; font-weight: 700; color: var(--blue);
  text-transform: uppercase; letter-spacing: .8px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px; margin: 5 5 15px;
}
.faculty-chip {
  background: var(--light); border-radius: 10px;
  padding: 13px 14px; font-size: .56em;
  border-left: 3px solid var(--blue);
  display: flex; align-items: center; gap: 13px;
  margin-bottom: 18px;
}
.faculty-photo {
  width: 110px; height: 110px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--blue);
  flex-shrink: 0;
}
.faculty-chip .pname { font-weight: 700; font-size: 1.3em; color: var(--blue); line-height: 1.2; }
.faculty-chip .prole { color: var(--grey); font-size: .88em; margin-top: 2px; }

/* Photo grid (PhD / Previous) */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 12px;
}
/* PhD grid — 4 per row, bigger cards */
#people-phd.photo-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
#people-phd .photo-chip {
  padding: 16px 10px;
}
#people-phd .photo-chip img {
  width: 105px; height: 105px;
  border-radius: 50%;
  object-fit: cover; border: 2px solid var(--blue);
  margin: 0 auto 10px; display: block;
}
#people-phd .photo-chip .pname { font-size: .58em; }
.photo-chip {
  background: var(--light); border-radius: 10px;
  padding: 12px 8px; text-align: center;
}
.photo-chip img {
  width: 85px; height: 85px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--blue);
  margin: 0 auto 8px; display: block;
}
.photo-chip .pname { font-weight: 700; color: var(--blue); font-size: .54em; line-height: 1.2; }

/* ── Soft Blue Highlight Box ───────────────────────────── */

.info-card.soft-blue {
  background: rgba(14,80,154,.10);      /* blu molto chiaro */
  border: 1px solid rgba(14,80,154,.22);
  border-left: 3px solid var(--accent);
  color: var(--grey);
}

.info-card.soft-blue strong {
  color: var(--blue);
}

/* Variante leggermente più intensa */
.info-card.soft-blue-strong {
  background: linear-gradient(
    135deg,
    rgba(14,80,154,.16),
    rgba(14,80,154,.06)
  );
  border: 1px solid rgba(14,80,154,.25);
  border-left: 3px solid var(--accent);
}

.info-card.soft-blue-strong strong {
  color: var(--blue);
}

/* ════════════════════════════════════════════════════════════
   RESEARCH AREAS
   ════════════════════════════════════════════════════════════ */
.area-des { color: var(--grey); font-size: .52em; line-height: 1.6; margin-bottom: 8px; }

.area-img-box {
  width: 100%;
  height: 100%;
  min-height: 100px;
  max-height: 300px;   /* ← limite massimo */
  border-radius: 10px;
  overflow: hidden;
}

.area-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.kw-cloud { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.kw-tag {
  background: rgba(14,80,154,.1); color: var(--blue);
  border-radius: 4px; padding: 3px 8px;
  font-size: .46em; font-weight: 600;
  border: 1px solid rgba(14,80,154,.18);
}
.pub-mini {
  border-left: 3px solid var(--accent);
  padding: 5px 9px; margin-bottom: 5px;
  background: #fffbf5; border-radius: 0 7px 7px 0;
  font-size: .46em;
}
.pub-mini .pt { font-weight: 700; color: var(--blue); line-height: 1.3; margin-bottom: 1px; }
.pub-mini .pv { color: var(--grey); font-size: .9em; }
.pub-mini .pa { color: #999; font-size: .85em; }



/* ════════════════════════════════════════════════════════════
   PROJECTS
   ════════════════════════════════════════════════════════════ */
.proj-card {
  background: var(--light); border-radius: 8px;
  padding: 8px 11px; border-left: 3px solid var(--blue);
  font-size: .43em; line-height: 1.1;
}
.proj-card strong {
  color: var(--blue);
  display: block;
  margin-bottom: 2px;
  font-size: 1.15em;   /* aumenta qui */
  line-height: 1.25;
}

/* ════════════════════════════════════════════════════════════
   TOOLS
   ════════════════════════════════════════════════════════════ */
.tool-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 14px; margin-bottom: 8px;
  font-size: .52em; background: #fff;
}
.tool-logo-box {
  width: 56px; height: 56px; border-radius: 10px;
  background: var(--light); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; overflow: hidden;
}
.tool-logo-box img { width: 100%; height: 100%; object-fit: contain; }
.tool-name { font-weight: 700; color: var(--blue); }
.tool-des  { color: var(--grey); line-height: 1.4; margin-top: 2px; }


/* ════════════════════════════════════════════════════════════
   EVENTS
   ════════════════════════════════════════════════════════════ */
/* container in 2 colonne */
#events-list{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* la card non deve avere margin-bottom, il gap lo gestisce la grid */
#events-list .event-card{
  margin-bottom: 0;
}

.event-card {
  display: flex; align-items: center; gap: 15px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-size: .52em;
  margin-bottom: 9px; background: #fff;
}
.event-logo {
  width: 100px; height: 100px; border-radius: 10px;
  background: var(--light); flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.event-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.event-year-badge {
  background: var(--blue); color: #fff;
  border-radius: 5px; padding: 3px 8px;
  font-weight: 700; font-size: 1em; white-space: nowrap;
}
.event-year-badge.accent { background: var(--accent); }
.event-title { font-weight: 700; color: var(--blue); line-height: 1.3; font-size: 1em; }
.event-meta  { color: var(--grey); margin-top: 3px; line-height: 1.4; font-size: 0.8em; }
.ev-link {
  color: var(--blue); font-size: .9em; padding: 4px 10px;
  background: rgba(14,80,154,.1); border-radius: 5px;
  text-decoration: none; white-space: nowrap;
  flex-shrink: 0; margin-left: auto;
}

#ws-list{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#ws-list .event-card{
  margin-bottom: 0;
}

/* ════════════════════════════════════════════════════════════
   NETWORK / MAP
   ════════════════════════════════════════════════════════════ */
#collab-map{
  min-height: 420px;
}

.map-legend {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 6px; font-size: .43em; color: var(--grey);
}

/* Forza le dimensioni anche al container interno di Leaflet */
#collab-map .leaflet-container {
  width: 100% !important;
  height: 100% !important;
}

.collab-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 12px;
  font-size: .40em; display: flex;
  flex-direction: column; gap: 6px; align-items: flex-start;
}
.collab-logo-big {
  width: 100%; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--light); border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 2px;
}
.collab-logo-big img { max-height: 38px; max-width: 90%; object-fit: contain; }
.collab-flag-name { display: flex; align-items: center; gap: 5px; }
.collab-flag-name .flag { font-size: 1.3em; flex-shrink: 0; }
.ccn { font-weight: 700; color: var(--blue); font-size: .92em; line-height: 1.2; }
.ccc { color: var(--grey); font-size: .82em; }
.cca { color: #999; font-size: .6em; }

/* Industry logo cloud — grid style like academic */
.logo-cloud {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 6px;
}
.logo-item {
  background: white; border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 10px; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  min-height: 100px;
}
.logo-item-img {
  width: 100%; height: 45px;
  display: flex; align-items: center; justify-content: center;
}
.logo-item img { max-height: 50px; max-width: 90%; object-fit: contain; }

.logo-item .lbl,
.logo-item .name{
  font-size: .46em;
  line-height: 1.15;
  margin-top: 4px;
}

/* ════════════════════════════════════════════════════════════
   WORD CLOUD
   ════════════════════════════════════════════════════════════ */
#wordcloud-canvas {
  display: block; margin: 0 auto;
  border-radius: 10px; background: #fafbfe;
  border: 1px solid var(--border);
}


/* ════════════════════════════════════════════════════════════
   PDF BUTTON
   ════════════════════════════════════════════════════════════ */
#dl-btn {
  position: fixed; bottom: 16px; left: 16px; z-index: 9999;
  background: var(--blue); color: #fff;
  border: none; border-radius: 7px;
  padding: 7px 14px; font-size: 13px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 5px;
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
  transition: background .2s;
  font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
}
#dl-btn:hover { background: var(--accent); }
#dl-toast {
  position: fixed; bottom: 52px; left: 16px;
  background: #333; color: #fff; border-radius: 6px;
  padding: 5px 12px; font-size: 11px; z-index: 9999;
  opacity: 0; transition: opacity .3s; pointer-events: none;
  font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
}

/* PDF buttons */
.dl-btn {
  position: fixed;
  bottom: 16px;
  z-index: 9999;
  border: none;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
  transition: background .2s, transform .05s;
  font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
  color: #fff;
  text-decoration: none;
  line-height: 1;
}

.dl-btn:active { transform: translateY(1px); }

.dl-btn.blue   { left: 16px;  background: var(--blue); }
.dl-btn.blue:hover { background: var(--accent); }

.dl-btn.orange { left: 170px; background: var(--accent); }
.dl-btn.orange:hover { background: var(--blue2); }

.dl-btn svg { display: block; }

.dl-btn .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dl-btn .icon svg {
  width: 14px;
  height: 14px;
  display: block;
  overflow: visible;
}

.dl-btn .icon{
  width:14px;
  height:14px;
  flex:0 0 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.dl-btn .icon svg{
  width:14px;
  height:14px;
  display:block;
}
/* ════════════════════════════════════════════════════════════
   TIMELINE
   ════════════════════════════════════════════════════════════ */
.timeline { position: relative; }
.timeline-line {
  position: absolute; left: 64px; top: 14px; bottom: 14px;
  width: 3px;
  background: linear-gradient(to bottom, var(--blue), var(--accent));
}
.timeline-rows { display: flex; flex-direction: column; gap: 13px; padding-left: 104px; }
.timeline-row  { display: flex; align-items: center; position: relative; }
.tl-year {
  position: absolute; left: -104px; width: 46px;
  text-align: right; font-size: .6em;
  font-weight: 800; color: var(--blue);
}
.tl-dot {
  position: absolute; left: -40px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--blue); border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--blue);
}
.tl-dot.accent { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tl-year.accent { color: var(--accent); }
.tl-card {
  background: var(--light); border-radius: 8px;
  padding: 9px 13px; font-size: .52em; flex: 1;
  border-left: 3px solid var(--blue);
}
.tl-card.accent  { background: #fff8f0; border-color: var(--accent); }
.tl-card strong  { color: var(--blue); }
.tl-card.accent strong { color: var(--accent); }


/* ════════════════════════════════════════════════════════════
   DEPARTMENTS GRID
   ════════════════════════════════════════════════════════════ */
.dept-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px; margin-top: 8px;
}
.dept-card {
  background: var(--light); border-radius: 10px;
  padding: 14px 10px; text-align: center;
  font-size: .5em; border-top: 4px solid var(--blue);
}
.dept-card.highlight { background: var(--blue); border-top-color: var(--accent); }
.dept-code {
  font-size: 1.5em; font-weight: 800;
  color: var(--blue); margin-bottom: 4px;
}
.dept-card.highlight .dept-code { color: #fff; }
.dept-name { color: var(--grey); line-height: 1.4; }
.dept-card.highlight .dept-name { color: rgba(255,255,255,.85); }


/* ════════════════════════════════════════════════════════════
   POLIBA / GENERAL LAYOUTS
   ════════════════════════════════════════════════════════════ */
.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.stack     { display: flex; flex-direction: column; gap: 9px; }


/* ════════════════════════════════════════════════════════════
   PRINT / PDF
   ════════════════════════════════════════════════════════════ */
@media print {
  #dl-btn, #dl-toast { display: none !important; }
  .reveal .slides section { page-break-after: always; }
  @page { size: 1280px 720px; margin: 0; }
  body, html { margin: 0 !important; padding: 0 !important; }
  .reveal, .reveal .slides {
    width: 1280px !important; height: 720px !important;
  }
}


/* ════════════════════════════════════════════════════════════
   MARIAGRAZIA DOTOLI SPECIAL SLIDE
   ════════════════════════════════════════════════════════════ */
.dotoli-slide {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 26px;
  align-items: start;
}
.dotoli-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dotoli-photo-box img{
  width: 100% !important; 
  height: 300px !important;
  border-radius: 12px;
  object-fit:cover;
  object-position:center;
  display:block;
  overflow: hidden;
  border: 3px solid var(--blue);
  box-shadow: 0 4px 6px rgba(0,0,0,.12);
}
.dotoli-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dotoli-logos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.dotoli-logo-item {
  background: #fff;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px;
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
}

.dotoli-logo-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.dotoli-right {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.dotoli-name {
  font-size: 1.35em;
  font-weight: 800;
  color: var(--blue);
  line-height: 1.2;
  margin-bottom: 1px;
}
.dotoli-title {
  font-size: .58em;
  color: var(--grey);
  font-weight: 600;
  margin-bottom: 6px;
}
.dotoli-bio {
  font-size: .47em;
  color: var(--grey);
  line-height: 1.7;
  margin-bottom: 8px;
}
.dotoli-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dotoli-fact {
  background: var(--light);
  border-radius: 8px;
  padding: 7px 10px;
  border-left: 3px solid var(--blue);
  font-size: .45em;
  line-height: 1.2;
}
.dotoli-fact strong {
  color: var(--blue);
  display: block;
  margin-bottom: 3px;
  font-size: 1.1em;
}

/* Fix any unwanted spacing around images in white boxes */
.cover-logo-box img,
.cover-lab-logo img,
.cover-qr-inner img {
  vertical-align: middle;
  line-height: 1;
}

/* ── RESEARCH DETAIL SLIDES ─────────────────────────────────── */
.research-detail {
  font-size: 0.7em; /* Scala tutto il contenuto delle slide di dettaglio */
}

.refs-box {
  background: var(--light);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 0.85em;
  line-height: 1.6;
  color: var(--grey);
  font-style: italic;
}

.refs-box strong {
  font-style: normal;
  color: var(--blue);
}

/* Ensure detail slide content has proper spacing */
.research-detail h2 {
  color: var(--blue);
  font-size: 1.3em;
  font-weight: 700;
  margin-bottom: 0.6em;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.3em;
}

.research-detail ul {
  margin-top: 0;
  margin-bottom: .3em;
  padding-left: 1.2em;
}

.research-detail li {
  margin: 0.4em 0;
  line-height: 1.5;
}

.research-detail p {
  margin: 0.5em 0;
  line-height: 1.6;
}

.research-detail b,
.research-detail strong {
  color: var(--blue);
  font-weight: 600;
}

/* ── MAP TOOLTIP STYLING ────────────────────────────────────── */
.leaflet-tooltip.custom-tooltip {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 13px;
  line-height: 1.5;
}

.leaflet-tooltip.custom-tooltip strong {
  color: var(--blue);
  font-weight: 600;
}

/* ── PRINT PDF FIX ──────────────────────────────── */
/* ════════════════════════════════════════════════════════════
   PRINT / PDF — UNICO BLOCCO
   ════════════════════════════════════════════════════════════ */
@media print {
  @page { size: 1280px 720px; margin: 0; }
  body, html { margin: 0 !important; padding: 0 !important; }

  .reveal, .reveal .slides {
    width: 1280px !important;
    height: 720px !important;
  }

  .reveal .slides section {
    page-break-after: always !important;
    page-break-inside: avoid !important;
    width: 1280px !important;
    height: 720px !important;
    min-height: 720px !important;
    max-height: 720px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  /* Chapter slides */
  .reveal .slides section.slide-chapter {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  .slide-chapter .chapter-photo {
    height: 720px !important;
    max-height: 720px !important;
    overflow: hidden !important;
  }

  .slide-chapter .chapter-photo img {
    height: 720px !important;
    object-fit: cover !important;
  }

  .slide-chapter .chapter-text {
    height: 720px !important;
    max-height: 720px !important;
    overflow: hidden !important;
  }

  /* Nascondi UI */
  #dl-btn, #dl-toast, #pdf-help-overlay, #pwd-gate {
    display: none !important;
  }

  /* Research detail */
  .reveal .slides section.research-detail {
    overflow: hidden !important;
  }
}

/* ── FIX CHAPTER SLIDES IN PRINT-PDF MODE ──────── */
.reveal-full-page .slide-chapter,
.print-pdf .slide-chapter {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: 1fr !important;
  gap: 0 !important;
  padding: 0 !important;
  height: 720px !important;
  max-height: 720px !important;
  overflow: hidden !important;
}

.print-pdf .slide-chapter .chapter-photo,
.print-pdf .slide-chapter .chapter-text {
  height: 720px !important;
  max-height: 720px !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.print-pdf .slide-chapter .chapter-photo img {
  height: 720px !important;
  width: 100% !important;
  object-fit: cover !important;
}

/* ===== Reveal print-pdf: preserva grid/flex e evita split pagina ===== */
.print-pdf .reveal .slides section{
  width: 1280px !important;
  height: 720px !important;
  min-height: 720px !important;
  max-height: 720px !important;
  overflow: hidden !important;

  break-after: page !important;
  break-inside: avoid-page !important;
}

/* ripristina i layout sui section "speciali" */
.print-pdf .reveal .slides section.slide-cover{
  display: flex !important;
  align-items: stretch !important;
}

.print-pdf .reveal .slides section.slide-chapter{
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: 1fr !important;
  padding: 0 !important;
}

/* se usi display:grid direttamente sul section (es. .dotoli-slide su section) */
.print-pdf .reveal .slides section.dotoli-slide{
  display: grid !important;
}

/* evita che i contenuti “spezzino” dentro le griglie */
.print-pdf .two-col,
.print-pdf .three-col,
.print-pdf .faculty-grid,
.print-pdf #events-list,
.print-pdf #ws-list{
  display: grid !important;
  break-inside: avoid-page !important;
}

.print-pdf .event-card,
.print-pdf .proj-card,
.print-pdf .info-card,
.print-pdf .photo-chip,
.print-pdf .faculty-chip{
  break-inside: avoid-page !important;
}

@media print {
  body > .dl-btn,
  body > #dl-btn,
  body > #dl-toast {
    display: none !important;
  }
}

.print-pdf .dl-btn,
.print-pdf #dl-btn,
.print-pdf #dl-toast {
  display: none !important;
}

@media print {
  .dl-btn,
  #dl-btn,
  #dl-toast,
  #jump-select {
    display: none !important;
  }
}

.print-pdf .dl-btn,
.print-pdf #dl-btn,
.print-pdf #dl-toast,
.print-pdf #jump-select {
  display: none !important;
}