/* Catalogue: brief introduction and one toolbar, followed immediately by activities. */
.tbp-catalogo-header {
  max-width: 1160px;
  margin: 0 auto 20px;
  padding: 16px 20px 0;
  color: var(--tbp-night-text, #084828);
}
.tbp-catalogo-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .85fr);
  align-items: center;
  gap: 24px;
}
.tbp-catalogo-heading__copy { min-width: 0; }
.tbp-catalogo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 18px;
  padding: 16px 0;
  border-block: 1px solid var(--tbp-night-line, #dbe5df);
}
.tbp-catalogo-views { min-width: 0; }
.tbp-catalogo-download {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 380px;
}
.tbp-catalogo-download > span { max-width: 180px; color: var(--tbp-night-muted, #536d60); }
@layer tbp-catalogo {
  html body .tbp-catalogo-header h1 {
    font-size: clamp(26px, 2.5vw, 32px) !important;
    line-height: 1.15 !important;
    margin: 0 0 8px !important;
    text-align: left !important;
    letter-spacing: -.5px !important;
    color: inherit !important;
  }
  html body .tbp-catalogo-header .tbp-catalogo-lead {
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: var(--tbp-night-muted, #536d60) !important;
  }
  html body .tbp-catalogo-caption {
    margin: 0 0 8px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    font-weight: 650 !important;
  }
  html body .tbp-catalogo-header .tbp-viste {
    width: auto !important;
    max-width: none !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 6px !important;
  }
  html body .tbp-catalogo-header .tbp-viste__btn {
    min-width: 96px !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
  }
  html body .tbp-catalogo-download { margin: 0 !important; }
  html body .tbp-catalogo-download button {
    margin: 0 !important;
    padding: 10px 18px !important;
    min-height: 44px !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    border-radius: 12px !important;
    text-transform: none !important;
    white-space: nowrap;
    width: max-content !important;
    flex: 0 0 auto;
  }
  html body .tbp-catalogo-download > span { font-size: 12px !important; line-height: 1.4 !important; }
}
/* I due numeri sono il filtro: Tutto, Mestieri, Esperienze. Un controllo solo,
   a tre spicchi, con il numero grande e il nome sotto (Elind, 19/9). */
.tbp-catalogo-filtri {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--tbp-night-line, #cfdcd4);
  border-radius: 16px;
  background: var(--tbp-night-raised, #f3f7f4);
}
@layer tbp-catalogo {
  html body .tbp-catalogo-filtri .tbp-catalogo-filtri__voce {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px !important;
    margin: 0 !important;
    padding: 6px 4px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--tbp-night-text, #084828) !important;
    -webkit-text-fill-color: currentColor !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.1 !important;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
  }
  html body .tbp-catalogo-filtri .tbp-catalogo-filtri__numero {
    font-size: 21px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }
  html body .tbp-catalogo-filtri .tbp-catalogo-filtri__nome {
    font-size: 12px;
    font-weight: 600;
  }
  html body .tbp-catalogo-filtri .tbp-catalogo-filtri__voce:hover {
    background: rgba(8, 72, 40, .08) !important;
  }
  html body .tbp-catalogo-filtri .tbp-catalogo-filtri__voce[aria-pressed="true"] {
    background: #084828 !important;
    color: #fff !important;
  }
  html body .tbp-catalogo-filtri .tbp-catalogo-filtri__voce:focus-visible {
    outline: 3px solid #b18a17 !important;
    outline-offset: 2px;
  }
  html body .tbp-catalogo-filtri .tbp-catalogo-filtri__voce[disabled] {
    opacity: .45;
    cursor: default;
  }
  html[data-tbp-theme="dark"] body .tbp-catalogo-filtri .tbp-catalogo-filtri__voce:hover {
    background: rgba(255, 255, 255, .08) !important;
  }
  html[data-tbp-theme="dark"] body .tbp-catalogo-filtri .tbp-catalogo-filtri__voce[aria-pressed="true"] {
    background: #ededed !important;
    color: #141414 !important;
  }
  html body .tbp-catalogo-download button {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
  }
  html body .tbp-catalogo-download button svg { flex: 0 0 auto; }
}
/* Il filtro vero: le schede portano il tipo, il contenitore dice quale si
   vuole vedere. Vale anche per quelle che arrivano scorrendo. */
#tbp-home-feed[data-tbp-filtro="mestiere"] .card-esperienza:not([data-kind="mestiere"]),
#tbp-home-feed[data-tbp-filtro="esperienza"] .card-esperienza:not([data-kind="esperienza"]) {
  display: none !important;
}
@media (max-width: 749px) {
  /* Sul telefono: titolo con il PDF accanto, due righe di testo, il filtro, e
     la vista su una riga sola. Prima la testata occupava mezzo schermo. */
  .tbp-catalogo-header { position: relative; padding: 12px 16px 0; margin-bottom: 14px; }
  .tbp-catalogo-heading { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tbp-catalogo-heading__copy { padding-right: 0; }
  .tbp-catalogo-toolbar {
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 12px;
    padding: 0 0 14px;
    border-top: 0;
  }
  .tbp-catalogo-views { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
  .tbp-catalogo-download { flex: 0 0 auto; width: auto; max-width: none; }
  .tbp-catalogo-download__nota {
    position: absolute !important;
    width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}
@layer tbp-catalogo {
  @media (max-width: 749px) {
    html body .tbp-catalogo-header h1 { font-size: 26px !important; margin: 0 0 6px !important; }
    html body .tbp-catalogo-header .tbp-catalogo-lead { font-size: 14px !important; line-height: 1.45 !important; }
    html body .tbp-catalogo-caption { margin: 0 !important; flex: 0 0 auto; color: var(--tbp-night-muted, #536d60) !important; }
    html body .tbp-catalogo-header .tbp-viste { width: auto !important; flex: 0 1 auto; gap: 4px !important; }
    html body .tbp-catalogo-header .tbp-viste__btn {
      min-width: 44px !important;
      width: 44px !important;
      flex: 0 0 44px;
      padding: 0 !important;
      gap: 0 !important;
      justify-content: center !important;
    }
    /* Tre vista con il solo segno: il nome resta ai lettori di schermo e nel
       suggerimento, e il PDF sta sulla stessa riga. */
    html body .tbp-catalogo-header .tbp-viste__nome {
      position: absolute !important;
      width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    }
    html body .tbp-catalogo-download button { padding: 10px 14px !important; }
  }
}

@media (min-width: 850px) {
  html body.tbp-feed-page #tbp-home-feed { padding-top: 16px !important; }
}
