/* Banner Amazon mobile - cliccabile interamente */
#amazon-float-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  transform: translateY(100%);
  transition: transform 0.5s ease-out;
  z-index: 9999;
  font-family: inherit;
  cursor: pointer; /* tutto cliccabile */
}

/* Quando attivo */
#amazon-float-banner.show {
  transform: translateY(0);
}

/* Barra superiore */
#amazon-float-banner .top-bar {
  background-color: #b30000; /* rosso/bordeaux coerente col footer */
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 10px;
}

/* Barra inferiore */
#amazon-float-banner .bottom-bar {
  background-color: #ffcc00;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
  font-size: 15px;
  font-weight: 600;
}

/* Pulsante chiusura a sinistra */
#amazon-float-banner .close-banner {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  font-size: 16px;
  cursor: pointer;
  margin-right: 10px;
  flex-shrink: 0;
  user-select: none;
  z-index: 10000;
  position: relative;
}

/* Impedisci che la X erediti il click sul banner */
#amazon-float-banner .close-banner {
  pointer-events: auto;
}

/* Link Amazon nascosto ma mantiene focus accessibile */
#amazon-float-banner a {
  position: absolute;
  inset: 0;
  z-index: 1;
  text-decoration: none;
}

/* Evita che la X venga coperta dal link */
#amazon-float-banner .close-banner {
  z-index: 2;
}

/* Effetto hover */
#amazon-float-banner:active {
  opacity: 0.9;
}

/* Solo mobile */
@media (min-width: 768px) {
  #amazon-float-banner {
    display: none !important;
  }
}




/* ==============================
   FONT NITIDO E LEGGIBILE - BASE (Tutti i dispositivi)
   ============================== */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #000;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* TITOLI */
h1, h2, h3 {
  letter-spacing: 0.5px;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.8em;
}

/* PARAGRAFI */
p {
  margin-bottom: 1.2em;
}

/* ==============================
   OTTIMIZZAZIONE MOBILE (Sotto i 768px)
   ============================== */
@media (max-width: 768px) {
  /* TESTO PRINCIPALE: più grande e leggibile */
  body {
    line-height: 1.7;
    font-size: 19px;
  }

  /* TITOLI: ottimizzati per schermi piccoli */
  h1, h2, h3 {
    letter-spacing: 0;
    line-height: 1.4;
  }

  /* OTTIMIZZAZIONE SPECIFICA PER ELENCHI WORDPRESS */
  .wp-block-list li {
    font-size: 17px !important;
    line-height: 1.3 !important;
    margin-bottom: 0.5em !important;
    word-break: break-word !important;
  }

  /* Targetta specificamente il testo tra parentesi */
  .wp-block-list li em {
    font-size: 14px !important;
    opacity: 0.9;
    font-style: italic !important;
  }

  /* Rendiamo il nome della carta in grassetto più evidente */
  .wp-block-list li strong {
    font-weight: 700 !important;
  }
}




/* Barra di lettura fissa in alto */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;              /* altezza barra, puoi cambiare */
  z-index: 9999;
  background: transparent;
  pointer-events: none;
}

.reading-progress::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, #e11d48, #22c55e); /* rosso → verde */
  animation: fill linear both;
  animation-timeline: scroll(root);
  animation-range: 0% 100%;
}

@keyframes fill { from { width: 0%; } to { width: 100%; } }

/* Nascondi barra se il browser non supporta animation-timeline */
@supports not (animation-timeline: scroll()) {
  .reading-progress { display: none; }
}




@media (prefers-reduced-motion: reduce) {
  .motion-ok {
    animation: none !important;
    transition: none !important;
  }
}




/* Contenitore del post */
article.post-has-image {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 9px 10px rgba(0,0,0,0.15);
  margin-bottom: 20px;
  transition: transform 0.3s ease;
  position: relative;
}



article.post-has-image .entry-title a {
  font-size: 0.9rem;
  font-weight: bold;
  text-shadow: 1px 2px 3px rgba(0,0,0,0.7);
  text-decoration: none;
}




/* === BLOCCO AMAZON COMPACT === */
.amazon-box-compact {
  background: #fafafa;
  border: 2px solid #ddd;
  border-radius: 12px;
  padding: 12px;
  margin: 14px 0;
  text-align: center;
  font-family: inherit;
  font-size: 0.9em;
}

.amazon-box-compact .amazon-box-header {
  font-size: 1em;
  font-weight: 500;
  margin-bottom: 10px;
  color: #222;
}

.amazon-box-compact .amazon-box-grid {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.amazon-box-compact .amazon-product {
  flex: 1;
  min-width: 160px;
  max-width: 32%;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.amazon-box-compact .product-name {
  font-weight: 600;
  font-size: 0.85em;
  margin-bottom: 6px;
}

.amazon-box-compact img {
  max-width: 100%;
  border-radius: 8px;
  transition: transform 0.2s ease-in-out;
}

.amazon-box-compact img:hover {
  transform: scale(1.03);
}

.amazon-box-compact .amazon-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 10px;
  background: #ff9900;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85em;
  transition: background 0.2s;
}

.amazon-box-compact .amazon-btn:hover {
  background: #e08800;
}

.amazon-box-compact .amazon-box-footer {
  margin-top: 12px;
  font-size: 0.8em;
  color: #555;
  font-style: italic;
}

/* === MOBILE === */
@media (max-width: 768px) {
  .amazon-box-compact .amazon-box-grid {
    flex-direction: column;
    align-items: center;
  }

  .amazon-box-compact .amazon-product {
    max-width: 90%;
  }
}
.amazon-box-compact .amazon-product {
  flex: 1;
  min-width: 160px;
  max-width: 32%;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  text-align: center;

  /* NUOVO: altezza uniforme per tutte le card */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.amazon-box-compact img {
  width: 100%;
  height: 200px; /* altezza fissa come immagine tappetino */
  object-fit: cover; /* taglia l'immagine senza distorcerla */
  border-radius: 12px;
  margin-bottom: 6px;
  transition: transform 0.2s ease-in-out;
}