.stageflow-programming {
  --stageflow-container-max-width: 1240px;
  --stageflow-container-padding: 20px;
  --stageflow-card-min-width: 270px;
  --stageflow-grid-gap: 30px;
  --stageflow-poster-ratio: 2 / 3;
  padding: 72px var(--stageflow-container-padding);
  background: #f5f3ee;
}

.stageflow-programming__container {
  width: min(var(--stageflow-container-max-width), 100%);
  margin-inline: auto;
}

.stageflow-programming.is-container-full .stageflow-programming__container {
  width: 100%;
  max-width: none;
}

.stageflow-programming__header {
  margin-bottom: 38px;
}

.stageflow-programming__eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #a88946;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stageflow-programming__title {
  margin: 0;
  color: #191919;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
}

.stageflow-programming__grid {
  display: grid;
  gap: var(--stageflow-grid-gap);
  align-items: start;
}

.stageflow-programming.is-grid-auto .stageflow-programming__grid {
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(100%, var(--stageflow-card-min-width)), 1fr)
  );
}

.stageflow-programming.is-grid-manual .stageflow-programming__grid {
  grid-template-columns: repeat(
    var(--stageflow-columns-desktop, 4),
    minmax(0, 1fr)
  );
}

.stageflow-card {
  display: flex;
  flex-direction: column;
  align-self: start;
  min-width: 0;
  height: auto;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.08);
}

.stageflow-card__poster {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  aspect-ratio: var(--stageflow-poster-ratio);
  background: #d9d6ce;
}

.stageflow-card__poster:empty,
.stageflow-card > p:empty {
  display: none;
  margin: 0;
}

.stageflow-card__poster img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.stageflow-card:hover .stageflow-card__poster img {
  transform: scale(1.025);
}

.stageflow-card__poster-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  text-align: center;
  color: #666;
}

.stageflow-card__label,
.stageflow-card__sold-out {
  position: absolute;
  top: 16px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stageflow-card__label {
  left: 16px;
  color: #191919;
  background: #e6c979;
}

.stageflow-card__sold-out {
  right: 16px;
  color: #fff;
  background: #b42318;
}

.stageflow-card__body {
  display: grid;
  flex: 0 0 auto;
  gap: 16px;
  min-width: 0;
  padding: 24px;
}

.stageflow-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #8b7137;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.stageflow-card__title {
  margin: 0;
  font-size: clamp(20px, 2vw, 25px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.stageflow-card__title a {
  color: #191919;
  text-decoration: none;
}

.stageflow-card__description {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #5d5d5d;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.stageflow-card__schedule {
  display: grid;
  gap: 3px;
  padding: 15px 0;
  border-top: 1px solid #e5e2dc;
  border-bottom: 1px solid #e5e2dc;
}

.stageflow-card__schedule-label {
  color: #777;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stageflow-card__schedule strong {
  color: #191919;
}

.stageflow-card__schedule small {
  color: #777;
}

.stageflow-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stageflow-card__actions a {
  display: inline-flex;
  flex: 1 1 120px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 7px;
  font-weight: 700;
  text-decoration: none;
}

.stageflow-card__details {
  color: #191919;
  border: 1px solid #c9c5bd;
  background: #fff;
}

.stageflow-card__ticket {
  color: #fff;
  background: #191919;
}

.stageflow-programming__empty {
  padding: 48px 30px;
  border: 1px solid #dedad0;
  border-radius: 12px;
  text-align: center;
  background: #fff;
}

.stageflow-programming__empty strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
}

.stageflow-programming__empty p {
  margin: 0;
  color: #666;
}

.stageflow-programming.is-gap-compact { --stageflow-grid-gap: 16px; }
.stageflow-programming.is-gap-normal { --stageflow-grid-gap: 30px; }
.stageflow-programming.is-gap-wide { --stageflow-grid-gap: 46px; }

.stageflow-programming.is-poster-2-3 { --stageflow-poster-ratio: 2 / 3; }
.stageflow-programming.is-poster-3-4 { --stageflow-poster-ratio: 3 / 4; }
.stageflow-programming.is-poster-square { --stageflow-poster-ratio: 1 / 1; }

/* Anteprima nell'editor Gutenberg. */
.editor-styles-wrapper .stageflow-programming-editor-preview {
  max-width: none;
}

.editor-styles-wrapper .stageflow-programming-editor-preview .components-notice {
  margin: 0 0 16px;
}

.stageflow-programming-editor-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
}

@media screen and (max-width: 960px) {
  .stageflow-programming.is-grid-manual .stageflow-programming__grid {
    grid-template-columns: repeat(
      var(--stageflow-columns-tablet, 2),
      minmax(0, 1fr)
    );
  }
}

@media screen and (max-width: 620px) {
  .stageflow-programming {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .stageflow-programming.is-grid-manual .stageflow-programming__grid {
    grid-template-columns: repeat(
      var(--stageflow-columns-mobile, 1),
      minmax(0, 1fr)
    );
  }

  .stageflow-card__description {
    -webkit-line-clamp: 4;
  }
}

/* Pagina Programmazione: griglia editoriale più leggibile e compatta. */
.post-type-archive-stageflow_content .stageflow-programming,
.tax-stageflow_type .stageflow-programming {
  --stageflow-container-max-width: 1120px;
  --stageflow-grid-gap: 26px;
  padding-top: 24px;
  padding-bottom: 88px;
}

.post-type-archive-stageflow_content .stageflow-programming__header,
.tax-stageflow_type .stageflow-programming__header {
  margin-bottom: 28px;
  padding-top: 10px;
  border-top: 1px solid #dedad0;
}

.post-type-archive-stageflow_content .stageflow-programming__eyebrow,
.tax-stageflow_type .stageflow-programming__eyebrow {
  display: none;
}

.post-type-archive-stageflow_content .stageflow-programming__title,
.tax-stageflow_type .stageflow-programming__title {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.post-type-archive-stageflow_content .stageflow-card,
.tax-stageflow_type .stageflow-card {
  border: 1px solid #e1ddd4;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(25, 25, 25, 0.07);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.post-type-archive-stageflow_content .stageflow-card:hover,
.tax-stageflow_type .stageflow-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(25, 25, 25, 0.11);
}

.post-type-archive-stageflow_content .stageflow-card__body,
.tax-stageflow_type .stageflow-card__body {
  gap: 13px;
  padding: 21px;
}

.post-type-archive-stageflow_content .stageflow-card__meta,
.tax-stageflow_type .stageflow-card__meta {
  gap: 7px 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.post-type-archive-stageflow_content .stageflow-card__title,
.tax-stageflow_type .stageflow-card__title {
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.12;
}

.post-type-archive-stageflow_content .stageflow-card__description,
.tax-stageflow_type .stageflow-card__description {
  color: #66615b;
  font-size: 0.95rem;
  line-height: 1.5;
  -webkit-line-clamp: 3;
}

.post-type-archive-stageflow_content .stageflow-card__schedule,
.tax-stageflow_type .stageflow-card__schedule {
  gap: 4px;
  padding: 13px 0;
}

.post-type-archive-stageflow_content .stageflow-card__schedule strong,
.tax-stageflow_type .stageflow-card__schedule strong {
  font-size: 1rem;
  line-height: 1.35;
}

.post-type-archive-stageflow_content .stageflow-card__actions a,
.tax-stageflow_type .stageflow-card__actions a {
  min-height: 46px;
}

.post-type-archive-stageflow_content .stageflow-card__details:hover,
.tax-stageflow_type .stageflow-card__details:hover {
  border-color: #191919;
  background: #f5f3ee;
}

.post-type-archive-stageflow_content .stageflow-card__ticket:hover,
.tax-stageflow_type .stageflow-card__ticket:hover {
  background: #3a342d;
}

@media (max-width: 960px) {
  .post-type-archive-stageflow_content .stageflow-programming,
  .tax-stageflow_type .stageflow-programming {
    --stageflow-grid-gap: 22px;
  }
}

@media (max-width: 620px) {
  .post-type-archive-stageflow_content .stageflow-programming,
  .tax-stageflow_type .stageflow-programming {
    --stageflow-container-padding: 16px;
    padding-top: 16px;
    padding-bottom: 58px;
  }

  .post-type-archive-stageflow_content .stageflow-programming__header,
  .tax-stageflow_type .stageflow-programming__header {
    margin-bottom: 20px;
  }

  .post-type-archive-stageflow_content .stageflow-card__body,
  .tax-stageflow_type .stageflow-card__body {
    padding: 19px;
  }
}


/* Programmazione v2: sezione eventi più compatta e coerente col filtro. */
.post-type-archive-stageflow_content .stageflow-programming {
  --stageflow-container-max-width: 1120px;
  padding-top: 18px;
  padding-bottom: 88px;
}

.post-type-archive-stageflow_content .stageflow-programming__header {
  margin-bottom: 24px;
  padding-top: 0;
  border-top: 0;
}

.post-type-archive-stageflow_content .stageflow-programming__title {
  font-size: clamp(30px, 3.2vw, 42px);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

@media (max-width: 620px) {
  .post-type-archive-stageflow_content .stageflow-programming {
    padding-top: 14px;
    padding-bottom: 56px;
  }

  .post-type-archive-stageflow_content .stageflow-programming__header {
    margin-bottom: 18px;
  }
}
