/* =========================================================
   BLOG-PUBLIC.CSS – ISATECH
   Stili per le pagine pubbliche del blog:
     • blog.php   (lista articoli)
     • articolo.php (singolo articolo)
   Dipende da pag_style.css (variabili CSS :root)
   ========================================================= */


/* =========================================================
   HERO BLOG
   Usa .page-hero di pag_style.css come base,
   qui sovrascriviamo solo i dettagli tipografici
   ========================================================= */
.blog-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;   /* coerente con h1 di pag_style.css */
  letter-spacing: 0.1px;
  margin-bottom: 8px;
}

.blog-hero p {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  max-width: 640px;
}

/* Contatore articoli sotto l'hero */
.blog-count {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 18px;
}


/* =========================================================
   GRIGLIA CARD
   ========================================================= */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}


/* =========================================================
   CARD
   ========================================================= */
.blog-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0 0 16px;          /* padding-top 0: l'immagine va a filo */
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;           /* tiene l'immagine dentro il border-radius */
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(1, 118, 184, 0.40);
}

/* Barra accent top (come page-hero) */
.blog-card::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--accent);
  flex-shrink: 0;
}


/* =========================================================
   IMMAGINE CARD  –  rapporto fisso 16:9 + max-height
   Risolve il problema delle foto verticali/ritratto
   ========================================================= */
.blog-card-image-wrapper {
  overflow: hidden;
  height: 180px;              /* altezza fissa - funziona con qualsiasi formato foto */
  background: var(--bg-alt);
  flex-shrink: 0;
}

.blog-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top; /* mostra la parte alta per le foto ritratto */
  display: block;
  transition: transform .28s ease;
}

.blog-card:hover .blog-card-image {
  transform: scale(1.04);
}


/* =========================================================
   HEADER CARD  (data + titolo)
   ========================================================= */
.blog-card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 4px;
}

.blog-card-date {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.blog-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  letter-spacing: -0.1px;

  /* Tronca a 2 righe */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.blog-card-title a {
  text-decoration: none;
  color: var(--text);
  transition: color .18s;
}

.blog-card-title a:hover {
  color: var(--accent-dark);
}


/* =========================================================
   BODY CARD  (estratto)
   ========================================================= */
.blog-card-body {
  padding: 6px 16px 0;
  flex: 1;                    /* spinge il footer sempre in fondo */
}

.blog-card-excerpt {
  margin: 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.55;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: calc(1.55em * 3);
}


/* =========================================================
   FOOTER CARD  (bottone "Leggi articolo")
   ========================================================= */
.blog-card-footer {
  padding: 12px 16px 0;
  display: flex;
  justify-content: flex-end;
}

.blog-card-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: background .18s, transform .18s;
}

.blog-card-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}


/* =========================================================
   EMPTY STATE
   ========================================================= */
.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.blog-empty i {
  font-size: 2.8rem;
  color: var(--line);
  display: block;
  margin-bottom: 14px;
}


/* =========================================================
   PAGINAZIONE
   ========================================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 8px 0 48px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all .18s;
}

.pagination a {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.pagination span.current {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.pagination span.dots {
  background: transparent;
  border: none;
  color: var(--muted);
  min-width: 20px;
}


/* =========================================================
   PAGINA SINGOLO ARTICOLO
   ========================================================= */

/* Immagine copertina articolo */
.article-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
}

/* Contenuto testuale */
.article-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.article-content h2 {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 700;
  margin: 32px 0 10px;
  color: var(--text);
}

.article-content h3 {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 700;
  margin: 24px 0 8px;
  color: var(--text);
}

.article-content p {
  margin: 0 0 16px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 16px 22px;
  padding: 0;
}

.article-content li {
  margin-bottom: 6px;
}

.article-content strong {
  font-weight: 700;
  color: var(--text);
}

.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.article-content a:hover {
  color: var(--accent-dark);
}

/* Immagine inline a sinistra con testo a contorno */
.article-thumb-left {
  float: left;
  width: 280px;
  max-width: 45%;
  margin: 4px 26px 18px 0;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

/* Clearfix */
.article-content::after {
  content: "";
  display: block;
  clear: both;
}

/* Meta articolo (autore, data, tag) */
.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.article-meta i {
  color: var(--accent);
  margin-right: 4px;
}

/* Tag / hashtag */
.article-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.article-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-decoration: none;
  border: 1px solid rgba(1, 118, 184, 0.20);
  transition: background .18s;
}

.article-tag:hover {
  background: rgba(1, 118, 184, 0.22);
}

/* Box CTA in fondo all'articolo */
.article-cta {
  margin-top: 36px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
}

.article-cta p {
  margin: 0 0 14px;
  font-size: 1rem;
  color: var(--muted);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-card-image-wrapper {
    max-height: 180px;
  }

  .article-thumb-left {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0 0 18px;
  }
}


/* =========================================================
   PAGINA SINGOLO ARTICOLO
   ========================================================= */

/* ── BREADCRUMB ── */
.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.article-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.article-breadcrumb a:hover {
  text-decoration: underline;
}

.article-breadcrumb span[aria-hidden] {
  color: var(--line);
}

/* ── HEADER ARTICOLO ── */
.article-header {
  margin-bottom: 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 14px;
}

.article-meta i {
  color: var(--accent);
  margin-right: 4px;
}

.article-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.3px;
  color: var(--text);
}

.article-lead {
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  font-style: italic;
  border-left: 4px solid var(--accent);
  padding-left: 14px;
}

/* ── IMMAGINE COPERTINA ── */
.article-figure {
  margin: 0 0 32px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.article-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ── CORPO ARTICOLO ── */
.article-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 32px;
}

.article-content h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 700;
  margin: 36px 0 10px;
  color: var(--text);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent-soft);
}

.article-content h3 {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  font-weight: 700;
  margin: 26px 0 8px;
  color: var(--text);
}

.article-content p {
  margin: 0 0 18px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 18px 6px;
  padding-left: 20px;
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.article-content strong {
  font-weight: 700;
}

.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-content a:hover {
  color: var(--accent-dark);
}

/* ── TAG ── */
.article-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.article-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid rgba(1, 118, 184, 0.20);
}

/* ── BOX CONDIVISIONE ── */
.share-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-sm);
}

.share-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-label i {
  color: var(--accent);
}

.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .16s ease, opacity .16s ease;
  white-space: nowrap;
}

.share-btn:hover {
  transform: translateY(-2px);
  opacity: 0.88;
}

/* Colori branded */
.share-wa    { background: #25d366; color: #fff; }
.share-li    { background: #0a66c2; color: #fff; }
.share-fb    { background: #1877f2; color: #fff; }
.share-tw    { background: #000;    color: #fff; }
.share-email { background: var(--accent); color: #fff; }
.share-copy  {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--line);
}

.share-copy:hover {
  border-color: var(--accent);
  background: #fff;
}

/* ── ARTICOLI CORRELATI ── */
.correlati-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.correlati-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.correlati-title i {
  color: var(--accent);
}

/* ── RESPONSIVE ARTICOLO ── */
@media (max-width: 640px) {
  .article-meta    { gap: 12px; }
  .share-btn span  { display: none; }   /* solo icone su mobile */
  .share-btn       { padding: 10px 14px; }
  .article-cover   { max-height: 240px; }
}