/* LTA – Eventi gratuiti. Caricato solo su eventi, archivi e ricerca. */
.lta-free-event__page,
.lta-free-event-archive {
  --lta-event-border: 1px solid color-mix(in srgb, var(--wp--preset--color--gray-disabled) 75%, transparent);
  --lta-event-radius: var(--wp--preset--spacing--xs);
  --lta-event-shadow: var(--wp--preset--shadow--card);
  --lta-event-success: var(--wp--preset--color--green-success, #2e7d32);
  width: min(100% - 2rem, var(--wp--style--global--wide-size));
  margin-inline: auto;
  padding-block: var(--wp--preset--spacing--lg) var(--wp--preset--spacing--xxl);
}

.lta-free-event__breadcrumb { margin-bottom: var(--wp--preset--spacing--lg); }
.lta-free-event__hero,
.lta-free-event-archive__header {
  padding: clamp(1.25rem, 4vw, 3rem);
  background: var(--wp--preset--color--gray-bg);
  border: var(--lta-event-border);
  border-radius: var(--lta-event-radius);
}
.lta-free-event__title,
.lta-free-event-archive__header h1 { margin-block: var(--wp--preset--spacing--sm); font-size: clamp(2rem, 5vw, 3.4rem); }
.lta-free-event__subtitle { max-width: 72ch; margin-bottom: 0; font-size: var(--wp--preset--font-size--xl); line-height: 1.4; }
.lta-free-event__details {
  display: grid;
  gap: clamp(.75rem, 1.5vw, 1rem);
  min-width: 0;
  margin-top: var(--wp--preset--spacing--lg);
}

/* Modalità dell'evento: badge azzurro con icona specifica. */
.lta-free-event__format {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: .55rem;
  box-sizing: border-box;
  margin-bottom: 1rem;
  padding: .42rem .7rem;
  border: 1px solid var(--wp--preset--color--blue-primary) !important;
  border-color: color-mix(in srgb, var(--wp--preset--color--blue-primary) 25%, transparent);
  border-radius: var(--lta-event-radius);
  background: var(--wp--preset--color--blue-light);
  color: var(--wp--preset--color--blue-primary);
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 600;
  line-height: 1.25;
}

.lta-free-event__format::before {
  content: "";
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  background-color: currentColor;
  -webkit-mask: var(--lta-event-format-icon) center / contain no-repeat;
  mask: var(--lta-event-format-icon) center / contain no-repeat;
}

.lta-free-event__format--in-person {
  --lta-event-format-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 5-8 11-8 11S4 15 4 10a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E");
}

.lta-free-event__format--webinar {
  --lta-event-format-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='3.5' width='19' height='14' rx='2'/%3E%3Cpath d='M8 21h8M12 17.5V21M10 8l5 3-5 3Z'/%3E%3C/svg%3E");
}

.lta-free-event__format--hybrid {
  --lta-event-format-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='3.5' width='13.5' height='12' rx='2'/%3E%3Cpath d='M6 19h6.5M9.25 15.5V19M21.5 14.5c0 2.7-3.25 5.5-3.25 5.5S15 17.2 15 14.5a3.25 3.25 0 1 1 6.5 0Z'/%3E%3Ccircle cx='18.25' cy='14.5' r='.9'/%3E%3C/svg%3E");
}

/* CFP nella Hero: titolo reale e icona decorativa accessibile. */
.lta-free-event__credits.legis-box-evidenza {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: clamp(.5rem, 1.25vw, .75rem);
  border-radius: var(--lta-event-radius);
  background: var(--wp--preset--color--yellow-soft);
}

/* Nasconde la vecchia etichetta generata dal tema. */
.lta-free-event__credits.legis-box-evidenza::before {
  content: none;
  display: none;
}

.lta-free-event__credits-title {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0 0 .25rem;
  color: var(--wp--preset--color--blue-primary);
  font-size: var(--wp--preset--font-size--sm, 1.125rem);
  line-height: 1.35;
}

.lta-free-event__credits-icon {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9.5l10-5 10 5-10 5-10-5Z'/%3E%3Cpath d='M6 11.5v4c0 1.7 2.7 3 6 3s6-1.3 6-3v-4M22 9.5v6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9.5l10-5 10 5-10 5-10-5Z'/%3E%3Cpath d='M6 11.5v4c0 1.7 2.7 3 6 3s6-1.3 6-3v-4M22 9.5v6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.lta-free-event__credits-content > :first-child { margin-top: 0; }
.lta-free-event__credits-content > :last-child { margin-bottom: 0; }

/* Locandina PDF: stile della CTA documentale PDP. */
.lta-free-event__brochure {
  margin-top: 1rem;
  font-size: var(--wp--preset--font-size--lg);
  line-height: 1.35;
  text-align: left;
}

.lta-free-event__brochure a {
  color: var(--wp--preset--color--blue-primary);
  font-weight: 400;
  text-decoration: none;
}

.lta-free-event__brochure a:hover,
.lta-free-event__brochure a:focus-visible { text-decoration: underline; }

.lta-free-event__brochure a::before {
  content: "PDF";
  display: inline-block;
  margin-right: .6rem;
  padding: 2px 5px;
  border-radius: 2px;
  background: var(--wp--preset--color--blue-primary);
  color: var(--wp--preset--color--white, #fff);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .02em;
  vertical-align: middle;
}

.lta-free-event__featured { margin: var(--wp--preset--spacing--lg) 0 0; }
.lta-free-event__featured img { display: block; width: 100%; max-height: 620px; object-fit: cover; border-radius: var(--lta-event-radius); }
.lta-free-event__abstract { max-width: 78ch; margin-top: var(--wp--preset--spacing--lg); font-size: var(--wp--preset--font-size--lg); line-height: 1.55; }
.lta-free-event__abstract p:last-child { margin-bottom: 0; }

.lta-free-event__sessions,
.lta-free-event__content,
.lta-free-event__teachers,
.lta-free-event__registration,
.lta-free-event__contact { margin-top: var(--wp--preset--spacing--xl); }
.lta-free-event__session-grid,
.lta-free-event__teacher-list { display: grid; grid-template-columns: 1fr; gap: var(--wp--preset--spacing--md); }

.lta-free-event__manage-sessions,
.lta-free-event__manage-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--wp--preset--spacing--lg); }
.lta-free-event__session,
.lta-free-event__teacher,
.lta-free-event__manage-session,
.lta-free-event__add-session { box-sizing: border-box; }
.lta-free-event__session h3,
.lta-free-event__teacher h3,
.lta-free-event__manage-session h3 { margin-top: 0; }

.lta-free-event__session {
  padding: clamp(1rem, 2.5vw, 1.5rem);
}
.lta-free-event__session h3 {
  margin-bottom: var(--wp--preset--spacing--xs);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.15;
}

.lta-free-event__session > p,
.lta-free-event__session > div {
  margin-block: var(--wp--preset--spacing--xs);
}

.lta-free-event__session > p:last-child {
  margin-bottom: 0;
}
.lta-free-event__availability { background: var(--wp--preset--color--blue-light); }
/* =========================================================
   CTA PRINCIPALI – ISCRIZIONE
   ========================================================= */

/* Centratura dei due pulsanti */
.lta-free-event__primary-action,
.lta-free-event__submit {
  display: flex;
  justify-content: center;
  text-align: center;
}

.lta-free-event__primary-action {
  margin: var(--wp--preset--spacing--lg) 0 0;
}

.lta-free-event__submit {
  margin-bottom: 0;
}

/* Aspetto normale */
.lta-free-event__primary-action > .wp-element-button,
.lta-free-event__submit > .wp-element-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;

  background: var(--wp--preset--color--green-success) !important;
  color: #fff !important;
  border: 1px solid var(--wp--preset--color--blue-primary) !important;
  border-radius: 6px;

  font-family: inherit;
  font-size: var(--wp--preset--font-size--md);
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;

  padding: 12px 30px;
  cursor: pointer;

  transition:
    background-color 0.2s ease,
    filter 0.2s ease;
}

/* Hover e navigazione da tastiera */
.lta-free-event__primary-action > .wp-element-button:hover,
.lta-free-event__primary-action > .wp-element-button:focus-visible,
.lta-free-event__submit > .wp-element-button:hover,
.lta-free-event__submit > .wp-element-button:focus-visible {
  background: var(--wp--preset--color--blue-primary) !important;
  color: #fff !important;
  border-color: var(--wp--preset--color--blue-primary) !important;
  filter: brightness(0.98);
}

/* CTA LEGIS Fiducia / green-success. */
:where(.lta-free-event__page, .lta-free-event-archive) .wp-element-button,
.legis-search__section--eventi .wp-element-button {
  border-color: var(--lta-event-success, var(--wp--preset--color--green-success, #2e7d32)) !important;
  background-color: var(--lta-event-success, var(--wp--preset--color--green-success, #2e7d32)) !important;
  color: var(--wp--preset--color--white, #fff) !important;
  text-decoration: none;
}

:where(.lta-free-event__page, .lta-free-event-archive) .wp-element-button:hover,
:where(.lta-free-event__page, .lta-free-event-archive) .wp-element-button:focus-visible,
.legis-search__section--eventi .wp-element-button:hover,
.legis-search__section--eventi .wp-element-button:focus-visible {
  border-color: color-mix(in srgb, var(--lta-event-success, var(--wp--preset--color--green-success, #2e7d32)) 82%, #000) !important;
  background-color: color-mix(in srgb, var(--lta-event-success, var(--wp--preset--color--green-success, #2e7d32)) 82%, #000) !important;
  color: var(--wp--preset--color--white, #fff) !important;
}

.lta-free-event__content { max-width: var(--wp--style--global--content-size); margin-inline: auto; }
.lta-free-event__teacher {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: var(--wp--preset--spacing--md);
  align-items: center;
  padding: clamp(.875rem, 2vw, 1.25rem);
}

.lta-free-event__teacher-image img {
  display: block;
  width: 88px;
  height: 88px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}

.lta-free-event__teacher h3 {
  margin-bottom: var(--wp--preset--spacing--xs);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.15;
}

.lta-free-event__teacher-body > p:not(:has(a)) {
  display: none;
}

.lta-free-event__teacher-body p {
  margin-top: 0;
}

.lta-free-event__teacher-body p:last-child {
  margin-bottom: 0;
}

.lta-free-event__registration { scroll-margin-top: var(--wp--preset--spacing--xxl); margin-inline: auto; padding: clamp(1rem, 3vw, 2rem); background: var(--wp--preset--color--gray-bg); border: var(--lta-event-border); border-radius: var(--lta-event-radius); box-shadow: var(--lta-event-shadow); }
.lta-free-event__registration-intro { margin-bottom: var(--wp--preset--spacing--lg); font-size: var(--wp--preset--font-size--lg);}
.lta-free-event__notice { margin-block: var(--wp--preset--spacing--md); padding: var(--wp--preset--spacing--md); border-left: 5px solid var(--wp--preset--color--blue-primary); background: var(--wp--preset--color--blue-light); }
.lta-free-event__notice--error { border-left-color: var(--wp--preset--color--yellow-gold); background: var(--wp--preset--color--yellow-soft); }
.lta-free-event__notice :last-child { margin-bottom: 0; }

.lta-free-event__fieldset { margin: 0 0 var(--wp--preset--spacing--lg); padding: 0; border: 0; }
.lta-free-event__fieldset legend { margin-bottom: var(--wp--preset--spacing--sm); font-weight: 400; color: var(--wp--preset--color--blue-primary);}
.lta-free-event__session-select { display: grid; gap: var(--wp--preset--spacing--sm); }
.lta-free-event__session-option { display: flex; align-items: flex-start; gap: var(--wp--preset--spacing--sm); padding: var(--wp--preset--spacing--md); background: #fff; border: var(--lta-event-border); border-radius: var(--lta-event-radius); cursor: pointer; }
.lta-free-event__session-option strong {
  font-weight: 600; /* Titolo */
  color: var(--wp--preset--color--blue-primary);
}

.lta-free-event__session-option [data-availability-label] {
  font-weight: 400; /* Stato */
}
.lta-free-event__session-option:has(input:checked) { border-color: var(--wp--preset--color--blue-primary); background: var(--wp--preset--color--blue-light); }
.lta-free-event__session-option.is-disabled { opacity: .65; cursor: not-allowed; }
.lta-free-event__form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--wp--preset--spacing--lg); }
.lta-free-event__field { display: flex; flex-direction: column; gap: var(--wp--preset--spacing--xxs); margin-block: 0 var(--wp--preset--spacing--md); }
.lta-free-event__field--wide { grid-column: 1 / -1; }
.lta-free-event__field label { font-weight: 400; }
/* Asterisco dei campi obbligatori */
.lta-free-event__form span[aria-hidden="true"] {
  color: #dc2626;
}
.lta-free-event__field :is(input, select, textarea) { box-sizing: border-box; width: 100%; min-height: 44px; padding: var(--wp--preset--spacing--sm); border: var(--lta-event-border); border-radius: var(--wp--preset--spacing--xxs); background: var(--wp--preset--color--white, #fff); color: var(--wp--preset--color--gray-text); font: inherit; }
.lta-free-event__professional-data { margin-block: var(--wp--preset--spacing--md); padding: var(--wp--preset--spacing--md); border: var(--lta-event-border); border-radius: var(--lta-event-radius); background: var(--wp--preset--color--gray-bg); }
.lta-free-event__professional-data summary { cursor: pointer; font-weight: 400; color: var(--wp--preset--color--blue-primary); }
.lta-free-event__professional-data[open] summary { margin-bottom: var(--wp--preset--spacing--md); }
.lta-free-event__choice { margin-block: var(--wp--preset--spacing--md); }
.lta-free-event__choice label { display: flex; gap: var(--wp--preset--spacing--sm); align-items: flex-start; font-weight: 400; }
.lta-free-event__choice label a { font-weight: 500; }
.lta-free-event__choice input { margin-top: .35em; }
.lta-free-event__turnstile { margin-block: var(--wp--preset--spacing--lg); }
.lta-free-event__honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.lta-free-event__manage-session form,
.lta-free-event__add-session { margin-top: var(--wp--preset--spacing--md); }
.lta-free-event__confirm-box { margin-block: var(--wp--preset--spacing--lg); }
.lta-free-event__thank-you { text-align: left; }

.lta-free-event__contact { max-width: 900px; padding: var(--wp--preset--spacing--lg);}
/* Titolo “Segreteria Corsi” */
.lta-free-event__contact h2 {
  margin-top: 0;
  font-weight: 600;
}

/* Tutto il testo dei contatti */
.lta-free-event__contact p {
  font-size: var(--wp--preset--font-size--lg);
  font-weight: 400;
  line-height: 1.5;
}

/* Nome della persona/ufficio */
.lta-free-event__contact p strong {
  font-weight: 500;
}

/* Indirizzo e-mail */
.lta-free-event__contact a {
  font-size: inherit;
  font-weight: 400;
}

.lta-free-event-archive__nav { display: flex; flex-wrap: wrap; gap: var(--wp--preset--spacing--sm); margin-block: var(--wp--preset--spacing--lg); }
.lta-free-event-archive__nav a { display: inline-flex; padding: var(--wp--preset--spacing--sm) var(--wp--preset--spacing--md); border: 1px solid var(--wp--preset--color--blue-primary); border-radius: var(--wp--preset--spacing--xxs); text-decoration: none; }
.lta-free-event-archive__nav a.is-active { background: var(--wp--preset--color--blue-primary); color: var(--wp--preset--color--gray-bg); }
.lta-free-event-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--wp--preset--spacing--lg); }
.lta-free-event-card { display: flex; flex-direction: column; overflow: hidden; background: var(--wp--preset--color--gray-bg); border: var(--lta-event-border); border-radius: var(--lta-event-radius); box-shadow: var(--lta-event-shadow); }
.lta-free-event-card__image { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.lta-free-event-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lta-free-event-card__body { display: flex; flex: 1; flex-direction: column; padding: var(--wp--preset--spacing--lg); }
.lta-free-event-card__title { margin-block: 0 var(--wp--preset--spacing--sm); font-size: var(--wp--preset--font-size--xl); }
.lta-free-event-card__title a { text-decoration: none; }
.lta-free-event-card__excerpt { flex: 1; }
.lta-free-event-card__action { margin-top: auto; }
.lta-free-event-archive__pagination { margin-top: var(--wp--preset--spacing--xl); }
.lta-free-event-archive__pagination .page-numbers { display: flex; flex-wrap: wrap; gap: var(--wp--preset--spacing--xs); padding: 0; list-style: none; }
.lta-free-event-archive__pagination a,
.lta-free-event-archive__pagination span { display: inline-flex; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; border: var(--lta-event-border); border-radius: var(--wp--preset--spacing--xxs); text-decoration: none; }
.lta-free-event-archive__pagination .current { background: var(--wp--preset--color--blue-primary); color: var(--wp--preset--color--gray-bg); }

/* Integrazione con LEGIS · Search Results. */
.legis-search__section--eventi .lta-free-event-search-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--wp--preset--spacing--lg); }
.legis-search__section--eventi .lta-free-event-search-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--wp--preset--color--gray-disabled); border-radius: var(--wp--preset--spacing--xxs); background: var(--wp--preset--color--gray-bg); box-shadow: var(--wp--preset--shadow--card); }
.legis-search__section--eventi .lta-free-event-search-card__image { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.legis-search__section--eventi .lta-free-event-search-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.legis-search__section--eventi .lta-free-event-search-card__body { display: flex; flex: 1; flex-direction: column; padding: var(--wp--preset--spacing--lg); }
.legis-search__section--eventi .lta-free-event-search-card h3 { margin-top: 0; }
.legis-search__section--eventi .lta-free-event-search-card__action { margin-top: auto; }
.legis-search-top__item--event .legis-search-top__media a { aspect-ratio: 16 / 9; }
.legis-search-top__item--event .legis-search-top__media img { object-fit: cover; }

@media (max-width: 960px) {
  .lta-free-event-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 781px) {
  .lta-free-event__manage-sessions,
  .lta-free-event__manage-add,
  .lta-free-event__form-grid,
  .legis-search__section--eventi .lta-free-event-search-grid { grid-template-columns: 1fr; }
  .lta-free-event__field--wide { grid-column: auto; }
}

@media (max-width: 600px) {
  .lta-free-event__credits-title { align-items: flex-start; }

  .lta-free-event__teacher {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: var(--wp--preset--spacing--sm);
  }

  .lta-free-event__teacher-image img {
    width: 72px;
    height: 72px;
  }

  .lta-free-event__page,
  .lta-free-event-archive { width: min(100% - 1rem, var(--wp--style--global--wide-size)); }
  .lta-free-event-list { grid-template-columns: 1fr; }
  .lta-free-event__hero,
  .lta-free-event-archive__header,
  .lta-free-event__registration { padding: var(--wp--preset--spacing--md); }
}
