/* ==========================================================================
   1. UTILITY & LAYOUT GENERALI
   ========================================================================== */
.text-center {
  text-align: center;
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}


/* ==========================================================================
   HEADER STICKY & NAVIGAZIONE RESPONSIVE
   ========================================================================== */
header.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--pico-background-color);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--pico-muted-border-color);
  padding: 0.75rem 0;
  margin-bottom: 1.5rem;
}

/* Stile pulsanti nav desktop */
.main-nav ul.nav-desktop li a[role="button"] {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Gestione visibilità Mobile / Desktop */
.nav-mobile {
  display: none;
}

@media (max-width: 768px) {
  .nav-desktop {
    display: none !important;
  }
  
  .nav-mobile {
    display: block;
  }

  .nav-mobile details.dropdown {
    margin-bottom: 0;
  }

  .nav-mobile summary[role="button"] {
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   2. HOME PAGE / HERO
   ========================================================================== */
.home-hero {
  padding: 3rem 0;
}

.home-content {
  max-width: 650px;
  margin: 0 auto;
}

.avatar-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.role-description {
  font-size: 1.25rem;
  color: var(--pico-muted-color);
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.social-icon {
  color: var(--pico-color);
  transition: transform 0.2s ease, color 0.2s ease;
}

.social-icon:hover {
  transform: translateY(-3px);
  color: var(--pico-primary);
}

/* ==========================================================================
   3. COMPETENZE (SKILLS)
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.skills-category {
  margin-bottom: 1rem;
}

.skills-category h3 {
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--pico-muted-border-color);
}

.skill-item {
  margin-bottom: 1.25rem;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.skill-name {
  font-weight: 600;
}

.skill-percentage {
  color: var(--pico-muted-color);
  font-size: 0.85rem;
}

/* Barre di progresso */
progress.skill-bar {
  height: 8px;
  border-radius: 4px;
  margin-bottom: 0;
  border: none;
  background-color: var(--pico-muted-border-color);
}

/* Colori barre di progresso per Pico CSS v2 e fallback cross-browser */
progress.bar-red    { color: #e53935; --pico-color: #e53935; }
progress.bar-green  { color: #4caf50; --pico-color: #4caf50; }
progress.bar-blue   { color: #1e88e5; --pico-color: #1e88e5; }
progress.bar-yellow { color: #fdd835; --pico-color: #fdd835; }
progress.bar-teal   { color: #00acc1; --pico-color: #00acc1; }
progress.bar-grey   { color: #607d8b; --pico-color: #607d8b; }
progress.bar-black  { color: #000000; --pico-color: #000000; }

/* Regole separate per WebKit (Chrome/Safari) e Gecko (Firefox) */
progress.bar-red::-webkit-progress-value { background-color: #e53935; }
progress.bar-red::-moz-progress-bar { background-color: #e53935; }

progress.bar-green::-webkit-progress-value { background-color: #4caf50; }
progress.bar-green::-moz-progress-bar { background-color: #4caf50; }

progress.bar-blue::-webkit-progress-value { background-color: #1e88e5; }
progress.bar-blue::-moz-progress-bar { background-color: #1e88e5; }

progress.bar-yellow::-webkit-progress-value { background-color: #fdd835; }
progress.bar-yellow::-moz-progress-bar { background-color: #fdd835; }

progress.bar-teal::-webkit-progress-value { background-color: #00acc1; }
progress.bar-teal::-moz-progress-bar { background-color: #00acc1; }

progress.bar-grey::-webkit-progress-value { background-color: #607d8b; }
progress.bar-grey::-moz-progress-bar { background-color: #607d8b; }

progress.bar-black::-webkit-progress-value { background-color: #000000; }
progress.bar-black::-moz-progress-bar { background-color: #000000; }

/* ==========================================================================
   4. PAGINA PROGETTI
   ========================================================================== */
.projects-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.project-card {
  padding: 1.5rem;
  margin-bottom: 0; /* Annulla il margin-bottom standard degli article in Pico */
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  background-color: var(--pico-card-background-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.project-title {
  margin-bottom: 0.2rem;
  font-size: 1.25rem;
}

.project-role {
  margin-bottom: 0;
  color: var(--pico-muted-color);
}

.period-badge {
  color: var(--pico-muted-color);
  white-space: nowrap;
}

.project-body {
  margin-bottom: 1.25rem;
}

.project-body p {
  margin-bottom: 0;
  line-height: 1.6;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--pico-muted-border-color);
}

/* Badge Tecnologie */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background-color: var(--pico-secondary-background);
  color: var(--pico-secondary-inverse);
  border-radius: 4px;
  font-weight: 500;
}

/* ==========================================================================
   5. CERTIFICAZIONI
   ========================================================================== */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.cert-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  margin-bottom: 0;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  background-color: var(--pico-card-background-color);
}

.cert-logo-wrapper {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cert-details {
  flex: 1;
  min-width: 0;
}

.cert-title {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  line-height: 1.35;
}

.cert-meta {
  margin-bottom: 0;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  line-height: 1.4;
}

.cert-status {
  font-size: inherit;
}

.cert-valid {
  color: #2e7d32;
  font-weight: bold;
}

.cert-expired {
  color: #d32f2f;
  font-weight: normal;
}

/* ==========================================================================
   6. BLOG & POSTS
   ========================================================================== */
/* Lista Articoli */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.post-card {
  padding: 1.25rem 1.5rem;
  margin-bottom: 0;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  background-color: var(--pico-card-background-color);
  transition: border-color 0.2s ease;
}

.post-card:hover {
  border-color: var(--pico-primary);
}

.post-card-title {
  font-size: 1.3rem;
  margin-bottom: 0.2rem;
}

.post-card-meta {
  color: var(--pico-muted-color);
  margin-bottom: 0.75rem;
}

.post-card-excerpt p {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.post-card-readmore a {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

/* Singolo Articolo */
.post-single {
  max-width: 800px;
  margin: 0 auto;
}

.post-header {
  text-align: center;
  margin-bottom: 1rem;
}

.post-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.post-meta {
  color: var(--pico-muted-color);
}

.post-tag {
  font-weight: 500;
}

.post-content {
  line-height: 1.7;
  font-size: 1.05rem;
}

.post-content h2, 
.post-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-content pre {
  padding: 1rem;
  border-radius: var(--pico-border-radius);
  background-color: var(--pico-code-background-color);
  overflow-x: auto;
}

.post-footer {
  margin-top: 2.5rem;
}

/* Stili comuni per i collegamenti testuali nelle schede */
.cert-title a,
.post-card-title a {
  text-decoration: none;
  color: var(--pico-color);
}

.cert-title a:hover,
.post-card-title a:hover {
  color: var(--pico-primary);
}

/* Paginazione */
.pagination-container {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.pagination-info {
  color: var(--pico-muted-color);
  font-weight: 500;
}

/* ==========================================================================
   7. MEDIA QUERIES
   ========================================================================== */
@media (max-width: 480px) {
  .cert-card {
    gap: 1rem;
    padding: 1rem;
  }
  
  .cert-logo-wrapper {
    width: 55px;
    height: 55px;
  }

  .pagination-wrapper {
    flex-direction: column;
    gap: 0.75rem;
  }
}