:root {
  --as-graphite: #101820;
  --as-night: #172a3a;
  --as-ivory: #f6f1e8;
  --as-warm-white: #fcfaf6;
  --as-silver: #d9dee3;
  --as-gold: #b78749;
  --as-text: #25313b;
}

.as-events,
.as-events * {
  box-sizing: border-box;
}

.as-events {
  color: var(--as-text);
  font-family: inherit;
}

/* Mantiene visibile l'intestazione Archivio sotto l'header sticky di BeTheme. */
#archivio-eventi {
  scroll-margin-top: 110px;
}

.as-events__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.as-event-card {
  position: relative;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 42, 58, 0.14);
  background: var(--as-warm-white);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.as-event-card__content {
  padding: 26px 22px;
}

.as-event-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--as-night);
}

.as-event-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
}

.as-event-card:hover .as-event-card__media img {
  transform: scale(1.025);
}

.as-event-card__play {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding-left: 3px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(16, 24, 32, 0.78);
  color: #fff;
  font-size: 15px;
  transform: translate(-50%, -50%);
}

.as-event-card:hover {
  transform: translateY(-4px);
  border-color: rgba(183, 135, 73, 0.65);
  box-shadow: 0 18px 50px rgba(16, 24, 32, 0.09);
}

.as-event-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 28px;
  color: var(--as-night);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.as-status {
  color: #47625a;
  text-align: right;
}

.as-status--annullato,
.as-status--rinviato {
  color: #91413b;
}

.as-event-card__date {
  display: block;
  margin-bottom: 13px;
  color: var(--as-gold);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.as-event-card h3 {
  margin: 0 0 18px;
  color: var(--as-graphite);
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(27px, 2.1vw, 38px);
  font-weight: 400;
  line-height: 1.08;
}

.as-event-card h3 a {
  color: inherit;
  text-decoration: none;
}

.as-event-card__place,
.as-event-card__org {
  margin: 0 0 7px;
  line-height: 1.55;
}

.as-event-card__org {
  color: #66717a;
  font-size: 14px;
}

.as-event-card__link {
  display: inline-block;
  margin-top: 24px;
  color: var(--as-graphite);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.as-event-card__link:hover,
.as-event-card__link:focus-visible {
  color: var(--as-gold);
}

.as-events__filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 0 0 40px;
  padding: 18px;
  background: var(--as-graphite);
}

.as-events__filters label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--as-ivory);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.as-events__filters select {
  display: block;
  width: 100%;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  margin: 0 !important;
  padding: 0 34px 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  background-color: #fff;
  color: var(--as-graphite);
  font: inherit;
  line-height: 1.2;
}

.as-events__filter-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  min-width: 0;
  align-self: end;
}

/* BeTheme assegna geometrie diverse a button e link. */
.as-events__filters > .as-events__filter-actions > .as-events__filter-submit,
.as-events__filters > .as-events__filter-actions > .as-events__reset {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  margin: 0 !important;
  padding: 0 20px !important;
  border: 1px solid var(--as-gold);
  border-radius: 0 !important;
  background: var(--as-gold) !important;
  box-shadow: none !important;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1 !important;
  white-space: nowrap;
  text-decoration: none;
  text-align: center;
  text-transform: uppercase;
  transform: none !important;
  position: static !important;
  inset: auto !important;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* Neutralizza gli elementi decorativi applicati ai pulsanti da BeTheme. */
.as-events__filters > .as-events__filter-actions > .as-events__filter-submit::before,
.as-events__filters > .as-events__filter-actions > .as-events__filter-submit::after,
.as-events__filters > .as-events__filter-actions > .as-events__reset::before,
.as-events__filters > .as-events__filter-actions > .as-events__reset::after {
  display: none !important;
  content: none !important;
}

.as-events__filters > .as-events__filter-actions > .as-events__reset {
  background: transparent !important;
}

.as-events__filters > .as-events__filter-actions > .as-events__filter-submit:hover,
.as-events__filters > .as-events__filter-actions > .as-events__filter-submit:focus-visible,
.as-events__filters > .as-events__filter-actions > .as-events__reset:hover,
.as-events__filters > .as-events__filter-actions > .as-events__reset:focus-visible {
  border-color: var(--as-ivory);
  background: var(--as-ivory) !important;
  color: var(--as-graphite);
}

.as-events__pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 44px;
}

.as-events__pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--as-silver);
  color: var(--as-graphite);
  text-decoration: none;
}

.as-events__pagination .current {
  border-color: var(--as-gold);
  background: var(--as-gold);
  color: #fff;
}

.as-events__empty {
  padding: 32px;
  border-left: 3px solid var(--as-gold);
  background: var(--as-ivory);
}

/* =========================================================
   HOME — EVENTI IN EVIDENZA
   La SECTION BeTheme conserva il proprio sfondo petrolio.
   Shortcode: [as_eventi_home]
   ========================================================= */

/*
 * Il CSS consolidato applica già un padding alla vecchia SECTION Eventi.
 * Lo azzeriamo con specificità maggiore per evitare la somma con lo shortcode.
 */
.as-home-events-section.as-home-events-section {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.as-home-events-wrap,
.as-home-events-wrap > .mcb-wrap-inner {
  width: 100% !important;
  margin: 0 !important;
}

.as-home-events-wrap .column,
.as-home-events-wrap .mcb-column-inner {
  margin: 0 !important;
}

.as-home-events-showcase,
.as-home-events-showcase * {
  box-sizing: border-box;
}

.as-home-events-showcase {
  width: min(1480px, calc(100% - 32px));
  margin-inline: auto;
  padding-block: clamp(90px, 9vw, 150px);
  color: var(--as-ivory);
  background: transparent;
}

.as-home-events-showcase__heading {
  display: block;
  margin: 0;
  text-align: center;
  transform: translateX(18px);
}

/* Copia esatta della tipografia di .as-home-maestro__eyebrow. */
.as-home-events-showcase__title {
  margin: 0 0 22px;
  color: #a47437;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* Copia esatta della geometria di .as-home-maestro__rule. */
.as-home-events-showcase__rule {
  display: block;
  width: 78px;
  height: 1px;
  margin: 34px auto;
  background: #b78749;
}

.as-home-events-showcase__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  width: min(100%, 1180px);
  margin-inline: auto;
}

.as-home-events-showcase__item {
  min-width: 0;
}

.as-home-events-showcase__label {
  margin: 0 0 14px;
  color: rgba(247, 242, 233, 0.66);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.as-home-events-showcase .as-event-card {
  height: 100%;
  border-color: rgba(196, 154, 93, 0.42);
  background: #fcfaf6;
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.22);
}

.as-home-events-showcase .as-event-card:hover {
  border-color: rgba(196, 154, 93, 0.82);
  box-shadow: 0 34px 76px rgba(0, 0, 0, 0.28);
}

.as-home-events-showcase .as-event-card__media {
  aspect-ratio: 16 / 9;
}

.as-home-events-showcase .as-event-card__content {
  padding: 26px 22px 28px;
}

.as-home-events-showcase .as-event-card__meta {
  margin-bottom: 24px;
}

.as-home-events-showcase .as-event-card h3 {
  font-size: clamp(29px, 4.5vw, 42px);
}

.as-home-events-showcase__actions {
  display: flex;
  justify-content: center;
  margin-top: clamp(42px, 6vw, 68px);
}

.as-home-events-showcase__button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  min-height: 55px;
  padding: 15px 21px;
  border: 1px solid #c49a5d;
  color: #f7f2e9;
  background: transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.as-home-events-showcase__button:hover {
  color: #0d1d2a;
  background: #c49a5d;
  transform: translateY(-2px);
}

.as-home-events-showcase__button:focus-visible,
.as-home-events-showcase a:focus-visible {
  outline: 3px solid #c49a5d;
  outline-offset: 4px;
}

.as-home-events-showcase__empty {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 30px;
  border-left: 2px solid #c49a5d;
  color: rgba(247, 242, 233, 0.78);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

@media screen and (max-width: 767px) {
  .as-home-events-showcase {
    padding-block: 76px;
  }

  .as-home-events-showcase__heading {
    transform: none;
  }

  .as-home-events-showcase__title {
    margin-bottom: 17px;
    font-size: 11px;
  }

  .as-home-events-showcase__rule {
    margin: 27px auto;
  }
}

.as-event-details {
  border-top: 1px solid var(--as-silver);
}

.as-event-details__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  padding: 18px 0;
  border-bottom: 1px solid var(--as-silver);
}

.as-event-details__row dt {
  color: var(--as-gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.as-event-details__row dd {
  margin: 0;
  color: var(--as-graphite);
  line-height: 1.65;
}

.as-event-details__cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: 28px;
  padding: 0 22px;
  background: var(--as-gold);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

/* Pagina automatica del singolo evento. */
.as-single-event,
.as-single-event * {
  box-sizing: border-box;
}

.as-single-event {
  background: var(--as-warm-white);
  color: var(--as-text);
}

.as-single-event__hero {
  position: relative;
  padding: clamp(76px, 9vw, 138px) 24px clamp(66px, 8vw, 118px);
  overflow: hidden;
  background:
    radial-gradient(circle at 87% 18%, rgba(183, 135, 73, 0.18), transparent 29%),
    linear-gradient(135deg, #101820 0%, #172a3a 100%);
  color: var(--as-ivory);
}

.as-single-event__hero::after {
  content: "";
  position: absolute;
  right: -8%;
  bottom: 18%;
  width: 46%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(246, 241, 232, 0.3), transparent);
  box-shadow: 0 13px rgba(246, 241, 232, 0.12), 0 26px rgba(246, 241, 232, 0.08);
  transform: rotate(-8deg);
}

.as-single-event__hero-inner,
.as-single-event__content {
  width: min(100%, 1420px);
  margin-inline: auto;
}

.as-single-event__back,
.as-single-event__footer-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
}

.as-single-event__back {
  margin-bottom: clamp(54px, 7vw, 92px);
}

.as-single-event__eyebrow {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  max-width: 860px;
  margin-bottom: 24px;
  color: var(--as-ivory);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.as-single-event__hero .as-status {
  color: #c7d8d1;
}

.as-single-event__date {
  display: block;
  margin-bottom: 15px;
  color: #d2a567;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.as-single-event__hero h1 {
  max-width: 980px;
  margin: 0;
  color: var(--as-ivory);
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(45px, 7vw, 104px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.035em;
}

.as-single-event__content {
  padding: clamp(42px, 6vw, 90px) 24px clamp(70px, 9vw, 130px);
}

.as-single-event__media {
  width: 100%;
  margin: 0 0 clamp(42px, 6vw, 76px);
}

.as-single-event__media > img,
.as-single-event__video,
.as-single-event__media-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8.25;
  background: var(--as-night);
}

.as-single-event__media > img {
  object-fit: cover;
}

.as-single-event__video {
  position: relative;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
}

.as-single-event__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.as-single-event__media-placeholder {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 28%, rgba(183, 135, 73, 0.28), transparent 23%),
    linear-gradient(135deg, #172a3a, #101820);
}

.as-single-event__media-placeholder::before,
.as-single-event__media-placeholder::after,
.as-single-event__media-placeholder span::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 43%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(246, 241, 232, 0.34), transparent);
}

.as-single-event__media-placeholder::after {
  top: calc(43% + 18px);
  opacity: 0.55;
}

.as-single-event__media-placeholder span::before {
  top: calc(43% + 36px);
  opacity: 0.3;
}

.as-single-event__media figcaption {
  margin-top: 10px;
  color: #6d747a;
  font-size: 12px;
  line-height: 1.5;
}

.as-single-event__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
}

.as-single-event__editorial {
  margin-top: 44px;
  color: var(--as-text);
  font-size: 17px;
  line-height: 1.75;
}

.as-single-event__aside {
  align-self: start;
  padding: 28px;
  border-top: 2px solid var(--as-gold);
  background: var(--as-ivory);
}

.as-single-event__aside-label {
  margin: 0 0 18px;
  color: var(--as-gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.as-single-event__aside a {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(16, 24, 32, 0.14);
  color: var(--as-graphite);
  font-weight: 600;
  text-decoration: none;
}

.as-single-event__no-link {
  margin: 0;
  color: #6d747a;
  line-height: 1.6;
}

.as-single-event__footer-back {
  margin-top: 58px;
  color: var(--as-graphite);
}

.as-single-event a:focus-visible {
  outline: 3px solid var(--as-gold);
  outline-offset: 4px;
}

.as-events a:focus-visible,
.as-events button:focus-visible,
.as-events select:focus-visible {
  outline: 3px solid var(--as-gold);
  outline-offset: 3px;
}

@media (min-width: 651px) {
  .as-events__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
  }

  .as-events__filters {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    padding: 22px;
  }

  /* Tre filtri sopra, due azioni nello stesso contenitore. */
  .as-events__filters label:nth-of-type(3) {
    grid-column: 1 / -1;
  }

  .as-events__filter-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-column: 1 / -1;
  }

  .as-event-card {
    min-height: 330px;
  }

  .as-event-card__content {
    padding: 32px;
  }

  .as-event-card__meta {
    margin-bottom: 34px;
  }

  .as-event-details__row {
    grid-template-columns: minmax(150px, 0.34fr) 1fr;
    gap: 28px;
  }

  .as-single-event__layout {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 0.32fr);
    gap: clamp(48px, 6vw, 96px);
  }

  .as-home-events-showcase {
    width: min(1480px, calc(100% - 64px));
  }

  .as-home-events-showcase__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(26px, 3.2vw, 50px);
  }

  .as-home-events-showcase .as-event-card__content {
    padding: 32px;
  }
}

@media (min-width: 1101px) {
  .as-events__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .as-events__filters {
    grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(310px, 0.9fr);
    align-items: end;
  }

  .as-home-events-showcase {
    width: min(1480px, calc(100% - 96px));
  }

  .as-events__filters label:nth-of-type(3) {
    grid-column: auto;
  }

  .as-events__filter-actions {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .as-event-card {
    transition: none;
  }

  .as-event-card:hover {
    transform: none;
  }

  .as-event-card__media img {
    transition: none;
  }

  .as-event-card:hover .as-event-card__media img {
    transform: none;
  }
}
