/* =========================================================
   THEME CLEAN-UP — GiovanniFederico.net (Bludit)
   - Palette centralizzata
   - Tipografia più snella (Raleway 400/600)
   - Gerarchie coerenti senza !important superflui
   - Card & link più leggeri
   ========================================================= */

/* ---------- Palette & tokens ---------- */
:root{
  --brand-accent: #43a7e2;        /* azzurro .net */
  --brand-accent-2:#53a7e3;       /* variante link */
  --text-900:   #222;
  --text-700:   #444;
  --text-600:   #555;
  --text-500:   #666;
  --muted-50:   #f8f9fa;
  --muted-100:  #f1f3f5;
  --muted-200:  rgba(0,0,0,.12);
  --shadow-s:   0 1px 4px rgba(0,0,0,.08);
  --shadow-m:   0 8px 24px rgba(0,0,0,.08);
  --radius-s:   8px;
  --radius-m:   10px;
  --radius-l:   16px;
}

/* Logo header */
.navbar-brand img {
    max-height: 55px;   /* aumenta rispetto al valore attuale (es. 40px) */
    height: auto;
}

@media (max-width: 768px) {
    .navbar-brand img {
        max-height: 50px; /* leggermente più piccolo su mobile */
    }
}


/* ---------- Link & utilità di colore ---------- */
.bg-soft-orange { background-color:#FFE6DD; }
.btn-orange     { background-color:#FFE6DD; color:#111; } /* testo scuro: migliore contrasto */
.text-orange    { color: var(--brand-accent-2); }
.link-text      { color:#8A9A5B; }

p a, .txt-link {
  color: var(--brand-accent-2);
  text-decoration: none;
}
p a:hover, .txt-link:hover {
  color: var(--brand-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Solo paginazione in home ---------- */
.pagination-wrap{
  padding: 24px 0;
  background-color: var(--muted-50);
}

/* ---------- Tipografia globale ---------- */
body{
  font-family: 'Raleway', sans-serif; /* link a Google Fonts nell’HTML */
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-700);
}

/* Scala titoli: più snella */
h1, .site-title{
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1.25;
  color: var(--text-900);
  margin: 0 0 .5rem;
}

/* Evita conflitti: sottotitoli/ruoli NON usano h2 */
.subtitle, .tagline{
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-600);
  margin: 0 0 .5rem;
}

p{
  font-size: .95rem;
  margin: 0 0 1rem;
  color: var(--text-700);
}

/* Scala headings coerente */
h2{ font-size: 1.5rem; padding-bottom: 10px; line-height: 1.3; font-weight: 600; color: var(--text-900); }
h3{ font-size: 1.25rem; padding-bottom: 10px; line-height: 1.3; font-weight: 600; color: var(--text-900); }
h4{ font-size: 1rem;   padding-bottom: 10px; line-height: 1.3; font-weight: 600; color: var(--text-900); }

/* ---------- Bottoni & call-to-action ---------- */
button, .btn, a.button{
  font-weight: 500;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---------- Sezioni & spaziature verticali ---------- */
section, .section{
  margin: 1.25rem 0;
}

/* ---------- Card generiche ---------- */
.card{
  border: none;
  box-shadow: var(--shadow-s);
  border-radius: var(--radius-m);
  padding: 1rem;
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover{
  box-shadow: var(--shadow-m);
  transform: translateY(-1px);
}
.card-title{ font-weight: 600; font-size: .95rem; color: var(--text-900); }
.card-text { font-size: .875rem; color: var(--text-600); }
.card-link { text-decoration: none; }

/* ---------- UI generali ---------- */
.bd-links-link{
  padding: .1875rem .5rem;
  margin-top: .125rem;
  margin-left: 0;
  color: var(--text-900);
  text-decoration: none;
}
.bd-links-link:hover{ background-color: var(--brand-accent-2); color: #fff; }

.copyright{ color:#585c5e; }
.list-unstyled{ padding-left:0; list-style:none; }
.rounded{ border-radius: var(--radius-s) !important; }
.d-inline-block{ display:inline-block !important; }
.tsm{ font-size:13px; }
.active{ font-weight:700; }
.sticky{ position: sticky; top: 90px; }

/* ---------- Tipografia contenuti & immagini ---------- */
blockquote{
  padding: 22px;
  font-size: 20px;
  font-style: italic;
}
blockquote:before{
  content: url('../img/blockquote.png');
  display: inline-block;
  padding-right: 10px;
  vertical-align: middle;
}

.post-content img,
.page-content img,
.content img,
.article img,
.markdown-body img,
p img,
img{
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-m);
}
p img{ padding: 10px 0; }

/* ---------- Pulsanti share (fix px) ---------- */
.st-custom-button[data-network]{
  display: inline-block;
  padding: 14px;
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  text-align: center;
  font-size: 20px;
}
.st-custom-button[data-network=facebook]{  background-color:#1877F2; }
.st-custom-button[data-network=twitter]{   background-color:#0ADEFF; }
.st-custom-button[data-network=pinterest]{ background-color:#E60023; }
.st-custom-button[data-network=whatsapp]{  background-color:#128c7e; }
.st-custom-button[data-network]:hover,
.st-custom-button[data-network]:focus{
  text-decoration: none;
  background-color:#2e363c;
}

/* ---------- Chip & headline ricerca ---------- */
.hero-chip{ border-radius:14px; }
.research-headline{ letter-spacing:.1px; }

/* ---------- Separatore sottile ---------- */
hr.thin, .whitebox hr{
  border: 0;
  border-top: 1px solid var(--muted-200);
  margin: 1.25rem 0;
}

/* =========================================================
   Pubblicazioni (responsive)
   ========================================================= */
.pub-rail{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

/* Card pubblicazioni */
.pub-card{
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
  background: #fff;
}
.pub-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-m);
}
.pub-card .card-body{
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Testo pubblicazioni */
.pub-card h6{
  font-size: 1rem;
  line-height: 1.3;
  margin: 0 0 .25rem;
  color: var(--text-900);
}
.pub-link{
  text-decoration: underline;
  text-underline-offset: 2px;
  color: inherit;
}
.pub-link:hover{ color: var(--brand-accent-2); }

/* ---------- Profilo / avatar ---------- */
.avatar-circle{
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
}

/* Header profilo: avatar a sinistra, no wrap */
.profile-header{
  flex-wrap: nowrap;
}
.profile-header .avatar-circle{
  flex: 0 0 auto;
}
.profile-header .min-w-0{
  min-width: 0;
}

/* Mobile stretto: impila e centra */
@media (max-width: 600px){
  .profile-header{
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .profile-header .avatar-circle{ margin-bottom:12px; }
  .profile-header .min-w-0{ min-width:100%; }
}

/* ---------- Footer ---------- */
.site-footer{ background:#1f2529; }
.site-footer .footer-links a{ color:#9aa3aa; }
.site-footer .footer-links a:hover{
  color: var(--brand-accent);
}

/* ---------- Icone social ---------- */
.social-icons i{
  font-size: 24px;
  width: 44px; height: 44px; line-height: 44px;
  text-align: center;
  border-radius: 50%;
  display: inline-block;
  transition: transform .2s ease, color .2s ease, box-shadow .2s ease, background-color .2s ease;
  color: #fff;
  background: transparent;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
  margin: 0 .25rem;
}
.social-icons a:hover i{
  color: var(--brand-accent);
  box-shadow: inset 0 0 0 2px var(--brand-accent), 0 6px 14px rgba(67,167,226,.25);
  transform: translateY(-2px);
  background: rgba(67,167,226,.08);
}
@media (max-width:576px){
  .social-icons i{ font-size:22px; width:40px; height:40px; line-height:40px; }
}

/* ===== Selected publications — responsive & gap-proof ===== */
*, *::before, *::after { box-sizing: border-box; }

.pubs-grid-5{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* auto-fit = niente colonne fantasma */
  gap: 16px;
  width: 100%;
  max-width: 100%;
}
.pubs-grid-5 > * { min-width: 0; }

/* Card */
.pubs-grid-5 .pub-card{
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,.05);
  box-shadow: var(--shadow-s);
  background:#fff;
  display:flex; flex-direction:column; height:100%;
  transition: box-shadow .15s ease, transform .15s ease;
  container-type: inline-size; /* per il micro-tuning sotto */
}
.pubs-grid-5 .pub-card:hover{ box-shadow: var(--shadow-m); transform: translateY(-2px); }

/* Cover */
.pubs-grid-5 .pub-cover{ width:100%; aspect-ratio:4/5; background:var(--muted-100);
  display:flex; align-items:center; justify-content:center; overflow:hidden; }
.pubs-grid-5 .pub-cover img{ width:100%; height:100%; object-fit:cover; display:block; }

/* Testi */
.pubs-grid-5 .pub-meta{ padding:12px 14px 16px; }
.pubs-grid-5 .pub-title{
  margin:0 0 6px; font-weight:700; font-size:16px; line-height:1.35;
  white-space:normal; overflow:visible; word-break:break-word; hyphens:auto;
}
.pubs-grid-5 .pub-authors{ margin:0; font-size:13.5px; line-height:1.45; color:var(--text-600); font-style:italic; }
.pubs-grid-5 .pub-authors strong{ font-style:normal; font-weight:600; color:var(--text-700); }

/* Breakpoint progressivi: evitiamo card troppo strette su schermi larghi */
@media (min-width: 1200px){
  .pubs-grid-5{ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
@media (min-width: 1600px){
  .pubs-grid-5{ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* Micro-tuning quando la card scende davvero sotto i 180px */
@container (max-width: 180px){
  .pub-title{ font-size:14px; }
  .pub-authors{ font-size:12px; }
  .pub-meta{ padding:10px 12px 12px; }
}

/* ===== Link in tutta la pagina ===== */
/* Contenuti principali: post, pagine, articoli, griglie pubblicazioni */
.post-content a,
.page-content a,
.content a,
.article a,
.markdown-body a,
.pub-card a,
.pubs-grid-5 a,
.pub-rail a,
.blog-card a {
  color: var(--text-900);          /* come i titoli delle card */
  text-decoration: none;           /* niente sottolineatura */
  transition: color .15s ease, opacity .15s ease;
}
.post-content a:visited,
.page-content a:visited,
.content a:visited,
.article a:visited,
.markdown-body a:visited,
.pub-card a:visited,
.pubs-grid-5 a:visited,
.pub-rail a:visited,
.blog-card a:visited {
  color: var(--text-900);          /* niente viola visited */
  text-decoration: none;
}
.post-content a:hover,
.page-content a:hover,
.content a:hover,
.article a:hover,
.markdown-body a:hover,
.pub-card a:hover,
.pubs-grid-5 a:hover,
.pub-rail a:hover,
.blog-card a:hover {
  color: var(--text-900);          /* resta scuro come nei box blog */
  text-decoration: none;
  opacity: .85;                    /* feedback leggero come le card */
}

.badge.text-wrap {
  white-space: normal; 
  word-break: break-word; 
}