/* ═══════════════════════════════════════════════════════════
   TOGETHERHELP – BLOG STYLES
   Stilizza il Query Loop nativo di Gutenberg in griglia card
   coerente col design del sito (sage, cream, Cormorant).
   ═══════════════════════════════════════════════════════════ */

/* ── SEZIONE WRAPPER (il gruppo/sezione che contiene il Query Loop) ── */
.th-blog-section {
  padding: 7rem 0;
  background: var(--cream);
}
.th-blog-section__header {
  margin-bottom: 3rem;
}

/* ── QUERY LOOP: griglia ─────────────────────────────────── */
.wp-block-query {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Il contenitore interno della griglia */
.wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1.8rem !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Forza 2 colonne su tablet */
@media (max-width: 1024px) {
  .wp-block-post-template {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* 1 colonna su mobile */
@media (max-width: 640px) {
  .wp-block-post-template {
    grid-template-columns: 1fr !important;
  }
}

/* ── CARD SINGOLA ────────────────────────────────────────── */
.wp-block-post-template li,
.wp-block-post {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.25s;
}

.wp-block-post-template li:hover,
.wp-block-post:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.09);
  transform: translateY(-4px);
}

/* ── IMMAGINE IN EVIDENZA ────────────────────────────────── */
.wp-block-post .wp-block-post-featured-image,
.wp-block-post-featured-image {
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.wp-block-post .wp-block-post-featured-image img,
.wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.wp-block-post:hover .wp-block-post-featured-image img {
  transform: scale(1.04);
}

/* Placeholder se non c'è immagine */
.wp-block-post .wp-block-post-featured-image:empty,
.wp-block-post-featured-image a:empty {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--sage-pale);
}

/* ── CORPO CARD ──────────────────────────────────────────── */
.wp-block-post .wp-block-post-title,
.wp-block-post-title {
  font-family: var(--serif) !important;
  font-size: 1.25rem !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  color: var(--ink) !important;
  margin: 0 !important;
}

.wp-block-post .wp-block-post-title a,
.wp-block-post-title a {
  color: var(--ink) !important;
  text-decoration: none !important;
  transition: color 0.2s !important;
}

.wp-block-post .wp-block-post-title a:hover,
.wp-block-post-title a:hover {
  color: var(--sage) !important;
}

/* ── DATA ────────────────────────────────────────────────── */
.wp-block-post .wp-block-post-date,
.wp-block-post-date {
  font-family: var(--sans) !important;
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--sage) !important;
  margin: 0 !important;
}

.wp-block-post .wp-block-post-date time,
.wp-block-post-date time {
  color: var(--sage) !important;
}

/* ── ESTRATTO ────────────────────────────────────────────── */
.wp-block-post .wp-block-post-excerpt,
.wp-block-post-excerpt {
  margin: 0 !important;
  flex: 1;
}

.wp-block-post .wp-block-post-excerpt__excerpt,
.wp-block-post-excerpt__excerpt {
  font-family: var(--sans) !important;
  font-size: 0.88rem !important;
  color: var(--ink-soft) !important;
  line-height: 1.65 !important;
  margin: 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Nascondi il link "Leggi di più" dell'estratto se non serve */
.wp-block-post-excerpt__more-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sage) !important;
  text-decoration: none !important;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.wp-block-post-excerpt__more-link:hover {
  color: #5e8862 !important;
}

/* ── PADDING INTERNO CARD ────────────────────────────────── */
/* Applica padding a tutto tranne l'immagine */
.wp-block-post .wp-block-post-date,
.wp-block-post .wp-block-post-title,
.wp-block-post .wp-block-post-excerpt {
  padding: 0 1.4rem !important;
}

.wp-block-post .wp-block-post-date {
  padding-top: 1.2rem !important;
}

.wp-block-post .wp-block-post-excerpt {
  padding-bottom: 1.4rem !important;
}

/* Gap tra elementi dentro la card */
.wp-block-post .wp-block-post-date  { margin-bottom: 0.5rem !important; }
.wp-block-post .wp-block-post-title { margin-bottom: 0.6rem !important; }

/* ── NAVIGAZIONE PAGINE (paginazione) ────────────────────── */
.wp-block-query-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.wp-block-query-pagination-previous-arrow,
.wp-block-query-pagination-next-arrow,
.wp-block-query-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  color: var(--ink-mid);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.wp-block-query-pagination .page-numbers:hover,
.wp-block-query-pagination-previous-arrow:hover,
.wp-block-query-pagination-next-arrow:hover {
  background: var(--sage-pale);
  border-color: var(--sage);
  color: var(--sage);
}

.wp-block-query-pagination .page-numbers.current {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--white);
}

/* ── SEZIONE HEADER BLOG (titolo sopra la griglia) ──────── */
.th-blog-header {
  max-width: 1160px;
  margin: 0 auto 3rem;
  padding: 0 2rem;
}

.th-blog-header .section-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.8rem;
}

.th-blog-header h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.th-blog-header p {
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* ── LINK "TUTTI I POST" ─────────────────────────────────── */
.th-blog-more {
  text-align: center;
  margin-top: 3rem;
}

.th-blog-more a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.88rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}

.th-blog-more a:hover {
  border-color: var(--sage);
  background: var(--sage-pale);
  color: var(--sage);
}

/* ── EDITOR GUTENBERG: preview decente nell'editor ──────── */
.editor-styles-wrapper .wp-block-post-template {
  grid-template-columns: repeat(3, 1fr) !important;
}


/* ═══════════════════════════════════════════════════════════
   PAGINA SINGOLO POST (single.php)
   ═══════════════════════════════════════════════════════════ */

/* ── HERO TESTUALE ───────────────────────────────────────── */
.th-single__hero {
  background: var(--sage-pale);
  padding: 8rem 0 4rem;
  margin-top: 64px; /* altezza nav */
}
.th-single__hero-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Categoria badge */
.th-single__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.th-single__cat {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  border: 1px solid var(--sage-light);
  border-radius: var(--r-pill);
  padding: 0.3rem 0.9rem;
  text-decoration: none;
  transition: background 0.2s;
}
.th-single__cat:hover {
  background: var(--sage-pale);
}

/* Titolo */
.th-single__title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 300;
  line-height: 1.18;
  color: var(--ink);
  margin-bottom: 1.4rem;
}

/* Meta: data + tempo lettura */
.th-single__meta-hero {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.th-single__sep { color: var(--sage-light); }
.th-single__date { font-weight: 500; }
.th-single__readtime {
  color: var(--sage);
  font-weight: 500;
}

/* ── IMMAGINE COVER ──────────────────────────────────────── */
.th-single__cover {
  background: var(--cream);
  padding: 0 2rem;
}
.th-single__cover-inner {
  max-width: 860px;
  margin: 0 auto;
  transform: translateY(-2rem);
}
.th-single__cover-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--r-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  display: block;
}

/* ── BODY: CONTENUTO + SIDEBAR ───────────────────────────── */
.th-single__body {
  padding: 1rem 0 5rem;
  background: var(--cream);
}
.th-single__body-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  align-items: start;
}

/* ── CONTENUTO PRINCIPALE ────────────────────────────────── */
.th-single__content {
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--ink-mid);
}

.th-single__content h2 {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--ink);
  margin: 2.5rem 0 1rem;
}
.th-single__content h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ink);
  margin: 2rem 0 0.8rem;
}
.th-single__content p {
  margin-bottom: 1.4rem;
  color: var(--ink-mid);
}
.th-single__content strong { color: var(--ink); font-weight: 500; }
.th-single__content em { color: var(--sage); font-style: italic; }
.th-single__content a {
  color: var(--sage);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.th-single__content a:hover { color: #5e8862; }
.th-single__content ul,
.th-single__content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}
.th-single__content li { margin-bottom: 0.4rem; }
.th-single__content blockquote {
  border-left: 3px solid var(--sage);
  padding: 0.8rem 1.4rem;
  margin: 2rem 0;
  background: var(--sage-pale);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink);
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.th-single__sidebar {
  position: sticky;
  top: 90px;
}

.th-single__sidebar-block {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
}
.th-single__sidebar-block:first-child {
  padding-top: 0;
}
.th-single__sidebar-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.th-single__sidebar-value {
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 400;
}
.th-single__sidebar-cat {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--sage);
  text-decoration: none;
  border: 1px solid var(--sage-light);
  border-radius: var(--r-pill);
  padding: 0.2rem 0.7rem;
  margin-top: 0.2rem;
  transition: background 0.2s;
}
.th-single__sidebar-cat:hover {
  background: var(--sage-pale);
}

/* CTA nella sidebar */
.th-single__sidebar-cta {
  margin-top: 1.8rem;
  background: var(--sage-pale);
  border-radius: var(--r-md);
  padding: 1.4rem;
  text-align: center;
}
.th-single__sidebar-cta p {
  font-size: 0.88rem;
  color: var(--ink-mid);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.th-single__sidebar-cta .btn-primary {
  font-size: 0.8rem;
  padding: 0.7rem 1.4rem;
  width: 100%;
  justify-content: center;
}

/* ── NAVIGAZIONE PREV / NEXT ─────────────────────────────── */
.th-single__nav {
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 3rem 0;
}
.th-single__nav-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.th-single__nav-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.2s, background 0.2s;
}
.th-single__nav-item:hover {
  border-color: var(--sage);
  background: var(--sage-pale);
}
.th-single__nav-item--next {
  text-align: right;
}
.th-single__nav-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage);
}
.th-single__nav-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .th-single__hero { padding: 7rem 0 3rem; }
  .th-single__body-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .th-single__sidebar { position: static; }
  .th-single__nav-inner { grid-template-columns: 1fr; }
  .th-single__nav-item--next { text-align: left; }
}


/* ═══════════════════════════════════════════════════════════
   PAGINA ARCHIVIO APPROFONDIMENTI (page-approfondimenti.php)
   ═══════════════════════════════════════════════════════════ */

.th-archive {
  padding: 7rem 0 5rem;
  background: var(--cream);
}

.th-archive__header {
  margin-bottom: 3rem;
  padding-top: 2rem;
}

.th-archive__title {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.th-archive__subtitle {
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* ── LISTA ───────────────────────────────────────────────── */
.th-archive__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.th-archive__item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.8rem;
  align-items: start;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}

.th-archive__item:first-child {
  border-top: 1px solid var(--line);
}

/* ── MINIATURA ───────────────────────────────────────────── */
.th-archive__thumb-link {
  display: block;
  flex-shrink: 0;
}

.th-archive__thumb {
  width: 140px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--r-sm);
  display: block;
  transition: transform 0.3s ease;
}

.th-archive__item:hover .th-archive__thumb {
  transform: scale(1.03);
}

.th-archive__thumb-placeholder {
  width: 140px;
  height: 100px;
  background: var(--sage-pale);
  border-radius: var(--r-sm);
}

/* ── CONTENUTO ───────────────────────────────────────────── */
.th-archive__content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.th-archive__post-title {
  font-family: var(--serif) !important;
  font-size: 1.3rem !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  margin: 0 !important;
}

.th-archive__post-title a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

.th-archive__post-title a:hover {
  color: var(--sage);
}

.th-archive__excerpt {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── META ────────────────────────────────────────────────── */
.th-archive__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.th-archive__meta-item {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
}

.th-archive__meta-sep {
  color: var(--sage-light);
  font-size: 0.72rem;
}

.th-archive__meta-cat {
  color: var(--sage);
}

.th-archive__read-more {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sage);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
  white-space: nowrap;
}

.th-archive__read-more:hover {
  color: #5e8862;
}

/* ── PAGINAZIONE ─────────────────────────────────────────── */
.th-archive__pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.th-archive__pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  color: var(--ink-mid);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.th-archive__pagination .page-numbers:hover {
  background: var(--sage-pale);
  border-color: var(--sage);
  color: var(--sage);
}

.th-archive__pagination .page-numbers.current {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--white);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .th-archive__item {
    grid-template-columns: 100px 1fr;
    gap: 1rem;
  }
  .th-archive__thumb,
  .th-archive__thumb-placeholder {
    width: 100px;
    height: 80px;
  }
}

/* Tempo di lettura — stesso stile della data */
.wp-block-post .wp-block-post-time-to-read {
  font-family: var(--sans) !important;
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--sage) !important;
  padding: 0 1.4rem !important;
  margin: 0 0 0.3rem 0 !important;
  display: block !important;
}

.wp-block-post .wp-block-post-time-to-read::before {
  content: "Lettura: ";
}
