/* ==========================================================================
   A. HEADING NORMALISATION
   Overrides Kadence/FSE design-token variables + body-prefixed selectors.
   ========================================================================== */

:root {
  --wp--preset--font-size--large: clamp(1.20rem, 1.1rem + 0.5vw, 1.40rem);
  --wp--preset--font-size--x-large: clamp(1.20rem, 1.1rem + 0.5vw, 1.40rem);
  --wp--preset--font-size--xx-large: clamp(1.20rem, 1.1rem + 0.5vw, 1.40rem);
  --wp--preset--font-size--huge: clamp(1.20rem, 1.1rem + 0.5vw, 1.40rem);
}

body .entry-content h2,
body .entry-content h3,
body .entry-content h4,
body .post-content h2,
body .post-content h3,
body .post-content h4,
body .wp-block-post-content h2,
body .wp-block-post-content h3,
body .wp-block-post-content h4,
body .wp-block-group h2,
body .wp-block-group h3,
body .wp-block-group h4 {
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
}

body .entry-content h1,
body .post-content h1,
body .wp-block-post-content h1,
body h1.wp-block-heading {
  font-size: clamp(1.50rem, 1.3rem + 1vw, 2.00rem) !important;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 0.75em;
}

body .entry-content h2,
body .post-content h2,
body .wp-block-post-content h2,
body .wp-block-group h2,
body h2.wp-block-heading {
  font-size: clamp(1.20rem, 1.1rem + 0.5vw, 1.40rem) !important;
}

body .entry-content h3,
body .post-content h3,
body .wp-block-post-content h3,
body .wp-block-group h3,
body h3.wp-block-heading {
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.20rem) !important;
}

body .entry-content h4,
body .post-content h4,
body .wp-block-post-content h4,
body .wp-block-group h4,
body h4.wp-block-heading {
  font-size: 1.00rem !important;
}


/* ==========================================================================
   B. LIST INDENT FIX  (regression from cc7840d on Kadence)
   Kadence inherits padding:0 from body reset; the body-prefixed selectors
   above triggered that inheritance and collapsed list indentation.
   Explicit values restore standard browser-default indent (~2em = 32px).
   ========================================================================== */

body .entry-content ul,
body .entry-content ol,
body .post-content ul,
body .post-content ol,
body .wp-block-post-content ul,
body .wp-block-post-content ol,
body .wp-block-list {
  padding-left: 2em !important;
  margin-bottom: 1.25em;
}

body .entry-content ul,
body .post-content ul,
body .wp-block-post-content ul,
body .wp-block-list:not(ol) {
  list-style-type: disc;
  list-style-position: outside;
}

body .entry-content ol,
body .post-content ol,
body .wp-block-post-content ol,
body ol.wp-block-list {
  list-style-type: decimal;
  list-style-position: outside;
}

body .entry-content li,
body .post-content li,
body .wp-block-post-content li {
  margin-bottom: 0.4em;
  padding-left: 0.25em;
  /* slight extra breathing room after bullet */
}


/* ==========================================================================
   C. RESPONSIVE TABLES  (Kadence does not add overflow container by default)
   .wp-block-table is a <figure>; setting it to display:block + overflow-x:auto
   creates a horizontal scroll container on mobile without breaking desktop.
   min-width on cells prevents word-break crushing on narrow viewports.
   ========================================================================== */

body .entry-content .wp-block-table,
body .post-content .wp-block-table,
body .wp-block-post-content .wp-block-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* smooth momentum scroll on iOS */
  max-width: 100%;
  margin-bottom: 1.5em;
}

body .entry-content .wp-block-table table,
body .post-content .wp-block-table table,
body .wp-block-post-content .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  /* let columns size to content */
}

body .entry-content .wp-block-table th,
body .entry-content .wp-block-table td,
body .post-content .wp-block-table th,
body .post-content .wp-block-table td,
body .wp-block-post-content .wp-block-table th,
body .wp-block-post-content .wp-block-table td {
  min-width: 80px;
  /* prevents single-character columns */
  padding: 0.5em 0.75em;
  vertical-align: top;
  word-break: normal;
  /* do not break words inside cells */
  overflow-wrap: anywhere;
  /* only wrap at natural break points */
  border: 1px solid #ddd;
}

body .entry-content .wp-block-table th,
body .post-content .wp-block-table th,
body .wp-block-post-content .wp-block-table th {
  font-weight: 700;
  white-space: nowrap;
  /* keep header labels on one line */
  background: #f5f5f5;
}

/* ==========================================================================
   D. POST TITLE (ENTRY HEADER) & METADATA STYLE
   ========================================================================== */

body h1.entry-title {
  font-size: clamp(2.00rem, 1.6rem + 1.5vw, 2.70rem) !important;
  line-height: 1.22;
  margin-top: 0;
  margin-bottom: 0.3em !important;
}

@media (max-width: 768px) {
  body h1.entry-title {
    font-size: 1.70rem !important;
    /* Leggermente aumentato per maggiore impatto su mobile */
  }
}

.wl-post-meta {
  font-size: clamp(0.85rem, 0.8rem + 0.1vw, 0.90rem);
  color: #718096;
  /* Slate gray elegante */
  margin: 0.6em 0;
  text-align: center;
  font-weight: 500;
}

.wl-post-meta span {
  display: inline-block;
  margin: 0 6px;
}

.wl-header-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  /* Gradiente sfumato elegante */
  margin: 0.8em auto 1.6em auto;
  /* Centrato */
  border-radius: 2px;
}

/* Riduci lo spazio bianco eccessivo su desktop tra l'header del titolo e l'immagine */
body.single-post .entry-header {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}


/* ==========================================================================
   E. SOCIAL SHARING BAR  (snippet-social-share)
   ========================================================================== */

.wl-share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 2rem 0 1.5rem;
  padding: 1.1rem 1.4rem;
  background: #fff;
  border: 1.5px solid #e8eaed;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  font-family: inherit;
}

.wl-share-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa0a6;
  margin-right: 4px;
  white-space: nowrap;
}

.wl-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none !important;
  color: #fff !important;
  border: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  white-space: nowrap;
  line-height: 1;
}

.wl-share-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  text-decoration: none !important;
}

.wl-share-btn:active {
  transform: translateY(0);
}

.wl-share-btn:focus-visible {
  outline: 2px solid #4285f4;
  outline-offset: 3px;
}

/* Brand colours */
.wl-share-btn--fb {
  background: #1877f2;
}

.wl-share-btn--x {
  background: #14171a;
}

.wl-share-btn--li {
  background: #0a66c2;
}

.wl-share-btn--wa {
  background: #25d366;
}

/* Copy link — ghost style */
.wl-share-btn--copy {
  background: #f1f3f4;
  color: #3c4043 !important;
  border: 1.5px solid #dadce0;
  margin-left: auto;
}

.wl-share-btn--copy:hover {
  background: #e8eaed;
  filter: none;
  box-shadow: none;
}

/* Mobile: testo nascosto, solo icona */
@media (max-width: 600px) {
  .wl-share-bar {
    gap: 7px;
    padding: 0.9rem 1rem;
  }

  .wl-share-btn {
    font-size: 0;
    padding: 10px 11px;
  }

  .wl-share-btn svg {
    width: 20px;
    height: 20px;
  }

  .wl-share-label {
    font-size: 0.72rem;
    width: 100%;
    margin-bottom: 2px;
  }

  .wl-share-btn--copy {
    margin-left: 0;
  }
}

@media print {
  .wl-share-bar {
    display: none !important;
  }
}

/* Nasconde l'autore e il punto separatore nei post correlati a fine articolo */
.entry-related-meta-wrap .posted-by,
.entry-related-meta-wrap .meta-separator {
  display: none !important;
}