/* ==========================================================================
   Paradise Home — blog, archivi, ricerca, 404
   Caricato da inc/enqueue.php su is_home(), is_singular('post'), is_archive(),
   is_search(). Dipende dai token di main.css.
   ========================================================================== */

:root {
  /* Ombre e bordi dedicati all'editoriale: le card degli articoli sono più leggere di
     quelle dei trattamenti e vivono su un bordo viola trasparente, non grigio. */
  --ph-blog-line: rgba(105, 42, 152, 0.15);
  --ph-blog-tint: rgba(105, 42, 152, 0.06);
  --ph-blog-shadow-sm: 0 4px 14px rgba(105, 42, 152, 0.07);
  --ph-blog-shadow-md: 0 12px 28px rgba(105, 42, 152, 0.13);
  --ph-blog-shadow-lg: 0 18px 40px rgba(105, 42, 152, 0.18);

  /* Misura di lettura: circa 70 caratteri, il resto della colonna resta aria. */
  --ph-measure: 70ch;
}

/* --------------------------------------------------------------------------
   Intestazioni degli archivi
   -------------------------------------------------------------------------- */

.page-hero--blog {
  padding: 48px 0 32px;
}

.page-hero__eyebrow {
  margin: 0 0 8px;
  font-family: var(--ph-font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ph-accent-ink);
}

.page-hero__desc {
  max-width: var(--ph-measure);
  margin: 12px 0 0;
  font-size: 17px;
  color: var(--ph-text-soft);
}

.page-hero__desc > *:last-child {
  margin-bottom: 0;
}

.page-hero__search {
  max-width: 560px;
  margin-top: 24px;
}

.blog-intro {
  max-width: var(--ph-measure);
  font-size: 17px;
}

.blog-intro > *:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Filtro per argomento
   -------------------------------------------------------------------------- */

.filter-bar--blog {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 28px 0 4px;
}

.filter-bar--blog .filter-bar__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--ph-blog-line);
  border-radius: 999px;
  font-family: var(--ph-font-heading);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ph-text);
  transition: background-color var(--ph-transition), border-color var(--ph-transition), color var(--ph-transition);
}

.filter-bar--blog .filter-bar__item:hover,
.filter-bar--blog .filter-bar__item:focus-visible {
  background: var(--ph-blog-tint);
  border-color: var(--ph-primary);
  color: var(--ph-primary);
}

.filter-bar--blog .filter-bar__item.is-current {
  background: var(--ph-primary);
  border-color: var(--ph-primary);
  color: var(--ph-white);
}

.filter-bar__count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 5px;
  border-radius: 999px;
  background: var(--ph-blog-tint);
  font-size: 11px;
  font-weight: 600;
  color: var(--ph-primary);
}

.filter-bar--blog .filter-bar__item.is-current .filter-bar__count {
  background: rgba(255, 255, 255, 0.22);
  color: var(--ph-white);
}

/* --------------------------------------------------------------------------
   Collegamenti alle pagine di servizio dell'argomento
   -------------------------------------------------------------------------- */

.argomento-links {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 24px;
}

.argomento-links__item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  padding: 16px 20px;
  background: var(--ph-white);
  border: 1px solid var(--ph-blog-line);
  border-left: 4px solid var(--ph-primary);
  border-radius: var(--ph-radius-lg);
  box-shadow: var(--ph-blog-shadow-sm);
  transition: transform var(--ph-transition), box-shadow var(--ph-transition);
}

.argomento-links__item:hover,
.argomento-links__item:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--ph-blog-shadow-md);
}

.argomento-links__kind {
  grid-column: 1;
  font-family: var(--ph-font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ph-accent-ink);
}

.argomento-links__label {
  grid-column: 1;
  font-family: var(--ph-font-heading);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ph-primary);
}

.argomento-links__icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 18px;
  height: 18px;
  color: var(--ph-primary);
  transition: transform var(--ph-transition);
}

.argomento-links__item:hover .argomento-links__icon {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Griglia e card degli articoli
   -------------------------------------------------------------------------- */

.post-grid--blog {
  gap: 28px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 8px;
}

@media (max-width: 991px) {
  .post-grid--blog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .post-grid--blog {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card--articolo {
  border-color: var(--ph-blog-line);
  box-shadow: var(--ph-blog-shadow-sm);
}

.card--articolo:hover {
  transform: translateY(-3px);
  box-shadow: var(--ph-blog-shadow-md);
}

.card__media--articolo {
  aspect-ratio: 16 / 9;
}

/* Nessuna immagine in evidenza: un piano viola, non un buco bianco. */
.card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(105, 42, 152, 0.1), rgba(43, 45, 105, 0.05));
}

.card--articolo .card__title {
  font-size: 18px;
  line-height: 1.35;
}

.card--articolo .card__title a,
.card--articolo .card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.card--articolo .card__title a {
  color: var(--ph-primary);
}

.card--articolo .card__excerpt {
  font-size: 14.5px;
  line-height: 1.65;
}

.card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--ph-border);
  font-size: 13px;
  color: var(--ph-text-muted);
}

/* --------------------------------------------------------------------------
   Articolo singolo — intestazione
   -------------------------------------------------------------------------- */

.post-single__header {
  padding: 40px 0 24px;
}

.post-single__title {
  max-width: 28ch;
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: -0.01em;
}

.post-single__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--ph-text-muted);
}

.post-single__cat a {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ph-blog-tint);
  font-family: var(--ph-font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ph-primary);
}

.post-single__media {
  max-width: var(--ph-container);
  margin: 0 auto 8px;
  padding-inline: var(--ph-gutter);
}

.post-single__media img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--ph-radius-lg);
  box-shadow: var(--ph-blog-shadow-md);
}

/* --------------------------------------------------------------------------
   Articolo singolo — corpo del testo
   -------------------------------------------------------------------------- */

.post-single .entry-content {
  max-width: var(--ph-measure);
  font-size: 17px;
  line-height: 1.8;
  color: var(--ph-text);
}

/* Scala tipografica editoriale: gli h2 da 38px dei titoli di sezione sono troppo
   dentro un articolo di mille parole. */
.post-single .entry-content h2 {
  margin-top: 2em;
  font-size: 26px;
  line-height: 1.3;
}

.post-single .entry-content h3 {
  margin-top: 1.7em;
  font-size: 21px;
  line-height: 1.35;
  color: var(--ph-heading-alt);
}

.post-single .entry-content h4 {
  margin-top: 1.6em;
  font-size: 18px;
}

/* L'header è sticky: senza questo margine l'ancora dell'indice porta il titolo
   sotto la barra. */
.post-single .entry-content h2[id],
.post-single .entry-content h3[id] {
  scroll-margin-top: 96px;
}

.post-single .entry-content a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--ph-primary-pale);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.post-single .entry-content a:hover {
  text-decoration-color: var(--ph-primary);
}

.post-single .entry-content ul,
.post-single .entry-content ol {
  padding-left: 1.2em;
}

.post-single .entry-content li {
  margin-bottom: 0.5em;
}

.post-single .entry-content blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 24px;
  border-left: 4px solid var(--ph-primary-pale);
  font-size: 19px;
  font-style: italic;
  color: var(--ph-primary-deep);
}

/* --------------------------------------------------------------------------
   Strumenti di lettura: tempo stimato e indice dei contenuti
   -------------------------------------------------------------------------- */

.article-tools {
  margin: 0 0 36px;
}

.article-tools__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin: 0 0 20px;
  font-family: var(--ph-font-heading);
  font-size: 13px;
  font-weight: 500;
  color: var(--ph-text-muted);
}

.article-tools__lettura {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ph-primary);
}

.article-tools__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.toc {
  padding: 4px 24px 20px;
  background: linear-gradient(135deg, rgba(105, 42, 152, 0.04), rgba(105, 42, 152, 0.07));
  border: 1px solid var(--ph-blog-line);
  border-radius: var(--ph-radius-lg);
}

.toc__summary {
  padding: 16px 0;
  font-family: var(--ph-font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ph-primary);
  cursor: pointer;
}

.toc__summary::marker,
.toc__summary::-webkit-details-marker {
  color: var(--ph-primary);
}

.toc__list {
  margin: 0;
  padding-left: 1.3em;
  font-size: 15px;
}

.toc__list--sub {
  margin-top: 6px;
  padding-left: 1.2em;
  font-size: 14px;
}

.toc__item {
  margin-bottom: 8px;
  color: var(--ph-text-muted);
}

.toc__item::marker {
  color: var(--ph-accent-ink);
  font-family: var(--ph-font-heading);
  font-size: 13px;
}

.toc__link {
  color: var(--ph-text);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--ph-transition), text-decoration-color var(--ph-transition);
}

.toc__link:hover,
.toc__link:focus-visible {
  color: var(--ph-primary);
  text-decoration-color: var(--ph-primary);
}

/* --------------------------------------------------------------------------
   FAQ dell'articolo
   -------------------------------------------------------------------------- */

.article-faq {
  margin: 48px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--ph-border);
}

.article-faq__title {
  margin: 0 0 20px;
  font-size: 24px;
}

.article-faq__list {
  display: grid;
  gap: 10px;
}

.article-faq__item {
  background: var(--ph-white);
  border: 1px solid var(--ph-blog-line);
  border-radius: var(--ph-radius-lg);
  overflow: hidden;
}

.article-faq__item[open] {
  box-shadow: var(--ph-blog-shadow-sm);
}

.article-faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  font-family: var(--ph-font-heading);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ph-primary);
  cursor: pointer;
  list-style: none;
}

.article-faq__question::-webkit-details-marker {
  display: none;
}

.article-faq__chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  transition: transform var(--ph-transition);
}

.article-faq__item[open] .article-faq__chevron {
  transform: rotate(180deg);
}

.article-faq__answer {
  padding: 0 22px 18px;
  font-size: 16px;
  line-height: 1.75;
}

.article-faq__answer > *:last-child {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .article-faq__chevron {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Richiamo in coda all'articolo
   -------------------------------------------------------------------------- */

.article-cta {
  margin: 48px 0 0;
  padding: 32px;
  background: linear-gradient(135deg, var(--ph-primary) 0%, var(--ph-primary-deep) 100%);
  border-radius: var(--ph-radius-lg);
  box-shadow: var(--ph-blog-shadow-lg);
  color: var(--ph-white);
}

.article-cta__eyebrow {
  margin: 0 0 8px;
  font-family: var(--ph-font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.article-cta__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  color: var(--ph-white);
}

.article-cta__text {
  max-width: 46ch;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.88);
}

.article-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.article-cta__btn {
  background: var(--ph-white);
  color: var(--ph-primary);
  font-weight: 500;
}

.article-cta__btn:hover,
.article-cta__btn:focus-visible {
  background: var(--ph-primary-pale);
  color: var(--ph-primary);
}

.article-cta__btn--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: var(--ph-white);
}

.article-cta__btn--ghost:hover,
.article-cta__btn--ghost:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--ph-white);
  color: var(--ph-white);
}

.article-cta__icon {
  width: 15px;
  height: 15px;
}

.article-cta :focus-visible {
  outline-color: var(--ph-white);
}

/* --------------------------------------------------------------------------
   Colonna laterale
   -------------------------------------------------------------------------- */

@media (min-width: 1025px) {
  .blog-aside {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.widget__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget__item + .widget__item {
  border-top: 1px solid var(--ph-border);
}

.widget__link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 10px 0;
  font-size: 15px;
  color: var(--ph-text);
}

.widget__link:hover,
.widget__link:focus-visible,
.widget__link.is-current {
  color: var(--ph-primary);
}

.widget__label {
  flex: 1 1 auto;
  min-width: 0;
}

.widget__link.is-current .widget__label {
  font-weight: 600;
}

.widget__count {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--ph-blog-tint);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--ph-primary);
}

.widget__kind {
  flex: 0 0 100%;
  font-family: var(--ph-font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ph-accent-ink);
}

.widget__data {
  flex: 0 0 100%;
  font-size: 12px;
  color: var(--ph-text-muted);
}

.widget--links .widget__link {
  font-family: var(--ph-font-heading);
  font-weight: 600;
  color: var(--ph-primary);
}

/* --------------------------------------------------------------------------
   Risultati di ricerca
   -------------------------------------------------------------------------- */

.gruppo-risultati {
  margin-bottom: 40px;
}

.gruppo-risultati__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ph-primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gruppo-risultati__count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: 999px;
  background: var(--ph-blog-tint);
  font-size: 11px;
  letter-spacing: 0;
}

.gruppo-risultati__list {
  display: grid;
  gap: 8px;
}

.risultato {
  padding: 20px 22px;
  background: var(--ph-white);
  border: 1px solid var(--ph-blog-line);
  border-radius: var(--ph-radius-lg);
  transition: transform var(--ph-transition), box-shadow var(--ph-transition);
}

.risultato:hover {
  transform: translateY(-2px);
  box-shadow: var(--ph-blog-shadow-sm);
}

.risultato__tipo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--ph-text-muted);
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--ph-blog-line);
  border-radius: 999px;
  background: var(--ph-blog-tint);
  font-family: var(--ph-font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ph-primary);
}

.tag--page {
  border-color: var(--ph-border-soft);
  background: var(--ph-surface);
  color: var(--ph-heading-alt);
}

.risultato__title {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.35;
}

.risultato__excerpt {
  margin: 0 0 6px;
  font-size: 15px;
}

.risultato__url {
  margin: 0;
  font-size: 12px;
  color: var(--ph-accent-ink);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Stati vuoti: ricerca senza esiti, 404, categoria senza articoli
   -------------------------------------------------------------------------- */

.vuoto {
  padding-block: 24px 56px;
}

.vuoto__title {
  margin: 0 0 8px;
  font-size: var(--ph-h3);
}

.vuoto__text {
  max-width: var(--ph-measure);
  margin: 0 0 24px;
}

.vuoto__search {
  max-width: 560px;
  margin-bottom: 40px;
}

.vuoto__subtitle {
  margin: 0 0 16px;
  font-family: var(--ph-font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ph-accent-ink);
}

.vuoto__list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin: 0 0 48px;
  padding: 0;
  list-style: none;
}

.vuoto__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--ph-white);
  border: 1px solid var(--ph-blog-line);
  border-radius: var(--ph-radius-lg);
  font-family: var(--ph-font-heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--ph-primary);
  transition: transform var(--ph-transition), box-shadow var(--ph-transition);
}

.vuoto__link:hover,
.vuoto__link:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--ph-blog-shadow-sm);
}

.vuoto__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  transition: transform var(--ph-transition);
}

.vuoto__link:hover .vuoto__icon {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Modulo di ricerca
   -------------------------------------------------------------------------- */

.search-form__field {
  border-color: var(--ph-blog-line);
}

.search-form__submit {
  flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   Correlati in coda all'articolo
   -------------------------------------------------------------------------- */

.related {
  padding-block: 64px 0;
}

.related__title {
  font-size: var(--ph-h3);
}

/* --------------------------------------------------------------------------
   Movimento ridotto
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .card--articolo,
  .risultato,
  .vuoto__link,
  .argomento-links__item,
  .vuoto__icon,
  .argomento-links__icon {
    transition: none;
  }

  .card--articolo:hover,
  .risultato:hover,
  .vuoto__link:hover,
  .argomento-links__item:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Adattamenti su schermo piccolo
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .page-hero--blog {
    padding: 32px 0 24px;
  }

  .article-cta {
    padding: 24px 20px;
  }

  .article-cta__actions .btn {
    width: 100%;
  }

  .toc {
    padding-inline: 18px;
  }

  .post-single .entry-content {
    font-size: 16px;
  }

  .search-form {
    flex-wrap: wrap;
  }

  .search-form__submit {
    width: 100%;
  }
}
