/* Stag Events Calendar - matched to the Stag Bookings manager calendar style. */

.stag-events-calendar-wrap,
.stag-events-list-wrap {
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-transform: none;
  width: 100%;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

body.stag-events-public-page #header-wrapper .main-title-section-wrapper,
body.stag-events-public-page .main-title-section-wrapper.aligncenter {
  display: none !important;
}

.stag-events-calendar-wrap *,
.stag-events-calendar-wrap *::before,
.stag-events-calendar-wrap *::after,
.stag-events-list-wrap *,
.stag-events-list-wrap *::before,
.stag-events-list-wrap *::after {
  box-sizing: border-box;
  font-family: inherit;
}

.stag-events-intro {
  margin: 0 0 18px;
}

.stag-events-intro p:last-child {
  margin-bottom: 0;
}

.stag-events-calendar {
  width: 100%;
  margin: 0 auto;
  color: inherit;
  background: transparent;
}

.stag-events-calendar-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.stag-events-calendar-heading h2,
.stag-events-calendar-header h2 {
  margin: 0;
  color: inherit;
  font: inherit;
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1.2;
}

.stag-events-calendar-heading h2[hidden] {
  display: none !important;
}

.stag-events-calendar-nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  width: 100%;
}

.stag-events-calendar-nav a,
.stag-events-month-nav,
button.stag-events-month-nav {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor !important;
  border-radius: 999px !important;
  padding: 8px 12px !important;
  margin: 0 !important;
  text-decoration: none !important;
  color: inherit !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font: inherit !important;
  font-size: 0.9em !important;
  line-height: 1.2 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  cursor: pointer;
  transition: none !important;
}

.stag-events-month-nav::before,
.stag-events-month-nav::after,
button.stag-events-month-nav::before,
button.stag-events-month-nav::after {
  content: none !important;
  display: none !important;
}

.stag-events-month-nav:hover,
.stag-events-month-nav:focus,
.stag-events-month-nav.is-active {
  outline: 1px solid currentColor !important;
  outline-offset: 3px;
  color: inherit !important;
  background: transparent !important;
}

.stag-events-weekdays,
.stag-events-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
}

.stag-events-weekdays {
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.stag-events-weekdays span {
  border-right: 1px solid currentColor;
  padding: 10px;
  min-height: auto;
  font-weight: 700;
  opacity: 0.8;
  font-size: 0.85em;
  line-height: 1.2;
  text-align: left;
}

.stag-events-weekdays span:last-child {
  border-right: 0;
}

.stag-events-grid {
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
}

.stag-events-grid[hidden] {
  display: none !important;
}

.stag-events-day,
div.stag-events-day {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: start;
  gap: 5px;
  min-height: 86px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  border-radius: 0 !important;
  padding: 10px;
  margin: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  color: inherit !important;
  text-align: left;
  font: inherit;
  box-shadow: none !important;
  text-shadow: none !important;
  cursor: pointer;
  overflow: hidden;
}

.stag-events-day::before,
.stag-events-day::after,
div.stag-events-day::before,
div.stag-events-day::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
}

.stag-events-day:hover,
.stag-events-day:focus,
.stag-events-day.is-selected {
  outline: 2px solid currentColor;
  outline-offset: -3px;
  z-index: 1;
}

.stag-events-day-empty {
  opacity: 0.25;
  cursor: default;
}

.stag-events-day.has-events,
.stag-events-day.is-today,
.stag-events-day.has-events.is-today {
  background: transparent !important;
  background-color: transparent !important;
  color: inherit !important;
}

.stag-events-day-number {
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  color: inherit !important;
  font: inherit !important;
  font-size: clamp(1rem, 2vw, 1.35rem) !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.stag-events-day.is-today .stag-events-day-number {
  border-bottom: 2px solid currentColor !important;
  padding-bottom: 2px !important;
}

.stag-events-calendar-date-meta {
  display: block;
  margin-top: 2px;
  font-size: 0.68em;
  line-height: 1.15;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stag-events-cell-events {
  display: grid;
  gap: 3px;
  min-width: 0;
  align-self: start;
}

.stag-events-cell-event {
  display: block;
  min-width: 0;
  border-left: 3px solid var(--stag-event-colour, currentColor);
  padding-left: 5px;
  font-size: 0.68em;
  line-height: 1.18;
}

.stag-events-cell-event-time {
  opacity: 0.82;
  white-space: nowrap;
}

.stag-events-cell-event-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stag-events-cell-more {
  display: block;
  font-size: 0.66em;
  line-height: 1.2;
  opacity: 0.78;
}

.stag-events-calendar-metrics,
.stag-events-calendar-metric {
  display: none !important;
}

.stag-events-markers {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  margin: 0;
  align-self: end;
}

.stag-events-marker {
  display: block;
  height: 4px;
  flex: 1 1 0;
  min-width: 5px;
  max-width: 22px;
  border: 0;
  border-radius: 0 !important;
  background: var(--stag-event-colour, currentColor) !important;
  box-shadow: none !important;
}

.stag-events-more {
  display: inline-flex;
  align-items: center;
  font-size: 0.68em;
  line-height: 1;
  opacity: 0.75;
  padding-left: 1px;
}

.stag-events-day-panel {
  margin-top: 16px;
  border: 1px solid currentColor;
  border-radius: 0;
  padding: 14px;
  background: transparent;
  color: inherit;
}

.stag-events-today {
  margin: 0 0 18px;
  border: 1px solid currentColor;
  border-radius: 0;
  padding: 14px;
  color: inherit;
  background: transparent;
}

.stag-events-today-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  align-items: baseline;
  margin-bottom: 12px;
}

.stag-events-today-head h2 {
  margin: 0;
  color: inherit;
  font: inherit;
  font-size: 1.05em;
  font-weight: 700;
  line-height: 1.2;
}

.stag-events-today-head span {
  font-size: 0.85em;
  opacity: 0.82;
}

.stag-events-today-list {
  display: grid;
  gap: 10px;
}

.stag-events-day-panel[hidden],
.stag-events-modal[hidden] {
  display: none !important;
}

.stag-events-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.stag-events-panel-head h3 {
  margin: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  font-size: 1.15em;
  line-height: 1.2;
}

.stag-events-panel-close,
.stag-events-modal-close,
.stag-events-detail-button,
.stag-events-details-link,
button.stag-events-panel-close,
button.stag-events-modal-close,
button.stag-events-detail-button {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor !important;
  border-radius: 999px !important;
  padding: 8px 12px !important;
  margin: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  color: inherit !important;
  font: inherit !important;
  font-size: 0.9em !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer;
}

.stag-events-panel-close::before,
.stag-events-panel-close::after,
.stag-events-modal-close::before,
.stag-events-modal-close::after,
.stag-events-detail-button::before,
.stag-events-detail-button::after {
  content: none !important;
  display: none !important;
}

.stag-events-panel-close:hover,
.stag-events-panel-close:focus,
.stag-events-modal-close:hover,
.stag-events-modal-close:focus,
.stag-events-detail-button:hover,
.stag-events-detail-button:focus,
.stag-events-details-link:hover,
.stag-events-details-link:focus {
  outline: 1px solid currentColor;
  outline-offset: 3px;
}

.stag-events-day-items {
  display: grid;
  gap: 10px;
}

.stag-events-card {
  border: 1px solid currentColor;
  border-left: 6px solid var(--stag-event-colour, currentColor);
  border-radius: 0;
  padding: 10px;
  background: transparent;
  color: inherit;
}

.stag-events-day-item-top,
.stag-events-card-meta,
.stag-events-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.stag-events-day-item h4,
.stag-events-card h3,
.stag-events-modal-content h3 {
  margin: 0 0 6px;
  color: inherit;
  font: inherit;
  font-size: 1em;
  font-weight: 700;
}

.stag-events-day-item p,
.stag-events-card p,
.stag-events-modal-content p {
  margin: 0 0 10px;
  opacity: 0.85;
}

.stag-events-badge,
.stag-events-time {
  display: inline-flex;
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.85em;
  line-height: 1.2;
  white-space: nowrap;
  color: inherit;
  background: transparent;
}

.stag-events-badge {
  border-color: var(--stag-event-colour, currentColor);
  color: var(--stag-event-colour, currentColor);
}

.stag-events-empty {
  margin: 0;
  border: 1px solid currentColor;
  border-radius: 0;
  padding: 12px;
  background: transparent;
  color: inherit;
  opacity: 0.85;
}

.stag-events-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.stag-events-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
}

.stag-events-modal-card {
  position: relative;
  width: min(620px, 100%);
  max-height: min(760px, 90vh);
  overflow: auto;
  border: 1px solid currentColor;
  border-radius: 0;
  background: inherit;
  color: inherit;
  padding: 18px;
  box-shadow: none;
}

.stag-events-modal-close {
  float: right;
  margin-bottom: 10px !important;
}

.stag-events-modal-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  margin-bottom: 14px;
}

.stag-events-list {
  display: grid;
  gap: 12px;
}

.stag-events-list-wrap {
  margin-top: 26px;
}

.stag-events-list-heading {
  display: block;
  margin: 0 0 18px;
  color: inherit;
  font: inherit;
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1.2;
}

.stag-events-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 0;
  overflow: hidden;
  min-width: 0;
}

.stag-events-card.has-no-image {
  grid-template-columns: minmax(0, 1fr);
}

.stag-events-card.has-no-image .stag-events-card-body {
  padding: 10px;
}

.stag-events-day-items .stag-events-card {
  grid-template-columns: 190px minmax(0, 1fr);
}

.stag-events-card-image-link {
  display: block;
  min-height: 100%;
  color: inherit;
  overflow: hidden;
}

.stag-events-card-image {
  width: 100%;
  height: 100% !important;
  min-height: 100%;
  object-fit: cover;
  display: block;
}

.stag-events-card-body {
  padding: 10px 10px 10px 0;
  min-width: 0;
}

.stag-events-card-meta span,
.stag-events-card h3,
.stag-events-card p {
  overflow-wrap: normal;
  word-break: normal;
}

.stag-events-card h3 a {
  color: inherit;
  text-decoration: none;
}

.stag-events-card h3 a:hover,
.stag-events-card h3 a:focus {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .stag-events-calendar-header {
    display: grid;
  }
}

@media (max-width: 720px) {
  .stag-events-calendar-wrap,
  .stag-events-list-wrap {
    max-width: 100%;
  }

  .stag-events-calendar-header {
    gap: 12px;
    margin-bottom: 12px;
  }

  .stag-events-weekdays span,
  .stag-events-day {
    padding: 6px;
  }

  .stag-events-day {
    min-height: 58px;
    gap: 3px;
  }

  .stag-events-weekdays span {
    font-size: 0.72em;
    padding: 6px 3px;
    text-align: center;
  }

  .stag-events-calendar-date-meta {
    display: none;
  }

  .stag-events-cell-events {
    display: none;
  }

  .stag-events-cell-event {
    display: block;
    border-left-width: 2px;
    padding-left: 4px;
    font-size: 0.58em;
  }

  .stag-events-cell-event-time {
    display: none;
  }

  .stag-events-marker {
    height: 3px;
    max-width: 14px;
  }

  .stag-events-day-panel {
    padding: 10px;
    margin-top: 10px;
  }

  .stag-events-panel-head {
    gap: 10px;
    margin-bottom: 10px;
  }

  .stag-events-panel-head h3 {
    font-size: 1.15em;
    line-height: 1.2;
  }

  .stag-events-day-items .stag-events-card,
  .stag-events-list .stag-events-card.has-image,
  .stag-events-card.has-image {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
  }

  .stag-events-card-body {
    padding: 9px 9px 9px 0;
  }

  .stag-events-card-image {
    min-height: 100%;
  }

  .stag-events-card-meta {
    gap: 6px;
    margin-bottom: 6px;
  }

  .stag-events-badge,
  .stag-events-time {
    padding: 3px 8px;
    font-size: 0.78em;
  }

  .stag-events-card h3 {
    margin-bottom: 6px !important;
  }

  .stag-events-card p {
    display: -webkit-box;
    margin-bottom: 8px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .stag-events-card-actions {
    gap: 6px;
  }

  .stag-events-details-link,
  .stag-events-panel-close,
  button.stag-events-panel-close {
    padding: 7px 10px !important;
    font-size: 0.84em !important;
  }
}

@media (max-width: 440px) {
  .stag-events-weekdays span {
    font-size: 0.68em;
    padding: 5px 3px;
  }

  .stag-events-day {
    min-height: 50px;
    padding: 5px;
  }

  .stag-events-day-number {
    font-size: 12px !important;
  }

  .stag-events-markers {
    gap: 2px;
  }

  .stag-events-marker {
    min-width: 4px;
    max-width: 10px;
  }
}


/* v1.0.6: calendar grid reliability pass.
   Use inset cell lines instead of separate border joins so the grid has no gaps,
   remove the today underline, and keep selected cells outlined after click. */
.stag-events-calendar-wrap {
  max-width: 820px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.stag-events-calendar {
  border: 1px solid currentColor !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
}

.stag-events-weekdays,
.stag-events-grid {
  border: 0 !important;
}

.stag-events-weekdays {
  box-shadow: inset 0 -1px 0 currentColor !important;
}

.stag-events-weekdays span,
.stag-events-day,
div.stag-events-day {
  border: 0 !important;
  outline: 0;
  box-shadow: inset -1px -1px 0 currentColor !important;
}

.stag-events-weekdays span:last-child,
.stag-events-grid .stag-events-day:nth-child(7n) {
  box-shadow: inset 0 -1px 0 currentColor !important;
}

.stag-events-day:hover,
.stag-events-day:focus,
.stag-events-day.is-selected,
div.stag-events-day:hover,
div.stag-events-day:focus,
div.stag-events-day.is-selected {
  outline: 2px solid currentColor !important;
  outline-offset: -3px !important;
  box-shadow: inset -1px -1px 0 currentColor !important;
  z-index: 2;
}

.stag-events-day.is-today .stag-events-day-number,
.stag-events-day-number {
  border: 0 !important;
  padding: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.stag-events-day.is-today .stag-events-day-number::before,
.stag-events-day.is-today .stag-events-day-number::after,
.stag-events-day-number::before,
.stag-events-day-number::after {
  content: none !important;
  display: none !important;
}

.stag-events-day-panel {
  border: 1px solid currentColor !important;
  margin-top: 0 !important;
  border-top: 0 !important;
}


/* v1.0.7: keep the outer outline around the calendar grid only, not the heading or month controls. */
.stag-events-calendar {
  border: 0 !important;
  outline: 0 !important;
  overflow: visible !important;
}

.stag-events-calendar-header {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  margin-bottom: 18px !important;
}

.stag-events-calendar-heading,
.stag-events-calendar-heading h2 {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.stag-events-calendar-board {
  border: 1px solid currentColor !important;
  outline: 0 !important;
  overflow: hidden !important;
  width: 100% !important;
}

.stag-events-calendar-nav,
.stag-events-calendar-nav *,
.stag-events-month-nav,
.stag-events-month-nav:hover,
.stag-events-month-nav:focus,
.stag-events-month-nav.is-active {
  outline: 0 !important;
  box-shadow: none !important;
}

.stag-events-month-nav.is-active {
  text-decoration: none !important;
}

.stag-events-weekdays {
  border: 0 !important;
  box-shadow: inset 0 -1px 0 currentColor !important;
}

.stag-events-grid {
  border: 0 !important;
}

.stag-events-weekdays span {
  border: 0 !important;
  box-shadow: inset -1px 0 0 currentColor !important;
}

.stag-events-weekdays span:last-child {
  box-shadow: none !important;
}

.stag-events-day,
div.stag-events-day {
  border: 0 !important;
  outline: 0;
  box-shadow: inset -1px -1px 0 currentColor !important;
}

.stag-events-grid .stag-events-day:nth-child(7n),
.stag-events-grid div.stag-events-day:nth-child(7n) {
  box-shadow: inset 0 -1px 0 currentColor !important;
}

.stag-events-day:hover:not(.stag-events-day-empty),
.stag-events-day:focus:not(.stag-events-day-empty),
.stag-events-day.is-selected,
div.stag-events-day:hover:not(.stag-events-day-empty),
div.stag-events-day:focus:not(.stag-events-day-empty),
div.stag-events-day.is-selected {
  outline: 2px solid currentColor !important;
  outline-offset: -4px !important;
  z-index: 2;
}

.stag-events-day-empty:hover,
.stag-events-day-empty:focus {
  outline: 0 !important;
}

.stag-events-day.is-today .stag-events-day-number {
  border: 0 !important;
  padding-bottom: 0 !important;
}

/* v1.0.8: selection/hover frame should cover the full calendar cell, including the top edge. */
.stag-events-day,
div.stag-events-day {
  position: relative !important;
  outline: 0 !important;
}

.stag-events-day:hover:not(.stag-events-day-empty),
.stag-events-day:focus:not(.stag-events-day-empty),
.stag-events-day.is-selected,
div.stag-events-day:hover:not(.stag-events-day-empty),
div.stag-events-day:focus:not(.stag-events-day-empty),
div.stag-events-day.is-selected {
  outline: 0 !important;
  z-index: 3 !important;
}

.stag-events-day:hover:not(.stag-events-day-empty)::after,
.stag-events-day:focus:not(.stag-events-day-empty)::after,
.stag-events-day.is-selected::after,
div.stag-events-day:hover:not(.stag-events-day-empty)::after,
div.stag-events-day:focus:not(.stag-events-day-empty)::after,
div.stag-events-day.is-selected::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  border: 2px solid currentColor !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none !important;
  box-sizing: border-box !important;
  z-index: 5 !important;
}

.stag-events-day-empty::after,
.stag-events-day-empty:hover::after,
.stag-events-day-empty:focus::after {
  content: none !important;
  display: none !important;
}

/* v1.0.9: full-cell selection frame and reliable calendar-grid borders. */
.stag-events-calendar-board {
  border: 1px solid currentColor !important;
  outline: 0 !important;
  overflow: hidden !important;
}

.stag-events-weekdays,
.stag-events-grid {
  border: 0 !important;
  box-shadow: none !important;
}

.stag-events-weekdays {
  border-bottom: 1px solid currentColor !important;
}

.stag-events-weekdays span {
  border: 0 !important;
  border-right: 1px solid currentColor !important;
  box-shadow: none !important;
}

.stag-events-weekdays span:nth-child(7n) {
  border-right: 0 !important;
}

.stag-events-day,
div.stag-events-day {
  border: 0 !important;
  border-right: 1px solid currentColor !important;
  border-bottom: 1px solid currentColor !important;
  outline: 0 !important;
  box-shadow: none !important;
  position: relative !important;
}

.stag-events-grid .stag-events-day:nth-child(7n),
.stag-events-grid div.stag-events-day:nth-child(7n) {
  border-right: 0 !important;
  box-shadow: none !important;
}

.stag-events-grid .stag-events-day:nth-last-child(-n+7),
.stag-events-grid div.stag-events-day:nth-last-child(-n+7) {
  border-bottom: 0 !important;
}

.stag-events-day::after,
div.stag-events-day::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  border: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  pointer-events: none !important;
  z-index: 5 !important;
}

.stag-events-day:hover:not(.stag-events-day-empty),
.stag-events-day:focus:not(.stag-events-day-empty),
.stag-events-day.is-selected,
div.stag-events-day:hover:not(.stag-events-day-empty),
div.stag-events-day:focus:not(.stag-events-day-empty),
div.stag-events-day.is-selected {
  outline: 0 !important;
  box-shadow: none !important;
  z-index: 3 !important;
}

.stag-events-day:hover:not(.stag-events-day-empty)::after,
.stag-events-day:focus:not(.stag-events-day-empty)::after,
.stag-events-day.is-selected::after,
div.stag-events-day:hover:not(.stag-events-day-empty)::after,
div.stag-events-day:focus:not(.stag-events-day-empty)::after,
div.stag-events-day.is-selected::after {
  border-color: currentColor !important;
}

.stag-events-day-empty::after,
.stag-events-day-empty:hover::after,
.stag-events-day-empty:focus::after {
  content: none !important;
  display: none !important;
}

.stag-events-day.is-today,
.stag-events-day.is-today .stag-events-day-number,
.stag-events-day.is-today .stag-events-day-number::before,
.stag-events-day.is-today .stag-events-day-number::after {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.stag-events-month-nav:focus {
  outline: none !important;
}

.stag-events-month-nav:focus-visible {
  outline: 1px solid currentColor !important;
  outline-offset: 3px !important;
}

/* v1.0.10: readable in-cell events, Today section, and a subtle current-day state. */
.stag-events-month-nav[hidden] {
  display: none !important;
}

.stag-events-day.is-today,
.stag-events-day.is-today .stag-events-day-number,
.stag-events-day.is-today .stag-events-day-number::before,
.stag-events-day.is-today .stag-events-day-number::after {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.stag-events-day.is-today {
  border-color: currentColor !important;
}

.stag-events-day.is-today::before,
div.stag-events-day.is-today::before {
  content: none !important;
  display: none !important;
}

.stag-events-day.is-today::after,
div.stag-events-day.is-today::after {
  border-color: currentColor !important;
  border-width: 1px !important;
}

.stag-events-day.is-today:hover::after,
.stag-events-day.is-today:focus::after,
.stag-events-day.is-today.is-selected::after,
div.stag-events-day.is-today:hover::after,
div.stag-events-day.is-today:focus::after,
div.stag-events-day.is-today.is-selected::after {
  border-width: 2px !important;
}

.stag-events-calendar-wrap,
.stag-events-calendar-wrap *,
.stag-events-list-wrap,
.stag-events-list-wrap * {
  text-transform: none !important;
}

/* v1.0.15: real-event listing polish and past-day states. */
.stag-events-day.is-past:not(.is-today) {
  background: rgba(255, 255, 255, 0.025) !important;
}

.stag-events-day.is-past:not(.is-today) .stag-events-day-number {
  opacity: 0.42 !important;
}

.stag-events-day.is-past:not(.is-today)::after,
div.stag-events-day.is-past:not(.is-today)::after {
  border-color: rgba(255, 255, 255, 0.2) !important;
  border-width: 1px !important;
}

.stag-events-day.is-past:not(.is-today):hover::after,
.stag-events-day.is-past:not(.is-today):focus::after,
.stag-events-day.is-past:not(.is-today).is-selected::after,
div.stag-events-day.is-past:not(.is-today):hover::after,
div.stag-events-day.is-past:not(.is-today):focus::after,
div.stag-events-day.is-past:not(.is-today).is-selected::after {
  border-color: currentColor !important;
  border-width: 2px !important;
}

.stag-events-card .stag-events-badge {
  margin: 0;
}

.stag-events-card h3 {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  line-height: 1.2 !important;
}

.stag-events-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.stag-events-card.has-image {
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
}

.stag-events-card.has-image .stag-events-card-image {
  min-height: 100%;
}

/* v1.0.19: smaller calendar dates and inactive past-day hover states. */
.stag-events-day-number {
  font-size: clamp(12px, 1.2vw, 14px) !important;
  line-height: 1 !important;
}

.stag-events-day.is-past:not(.is-today),
div.stag-events-day.is-past:not(.is-today) {
  background: rgba(0, 0, 0, 0.08) !important;
  color: rgba(255, 255, 255, 0.44) !important;
}

.stag-events-day.is-past:not(.is-today) .stag-events-day-number,
div.stag-events-day.is-past:not(.is-today) .stag-events-day-number {
  opacity: 0.55 !important;
}

.stag-events-day.is-past:not(.is-today)::after,
.stag-events-day.is-past:not(.is-today):hover::after,
.stag-events-day.is-past:not(.is-today):focus::after,
.stag-events-day.is-past:not(.is-today).is-selected::after,
div.stag-events-day.is-past:not(.is-today)::after,
div.stag-events-day.is-past:not(.is-today):hover::after,
div.stag-events-day.is-past:not(.is-today):focus::after,
div.stag-events-day.is-past:not(.is-today).is-selected::after {
  border-color: rgba(255, 255, 255, 0.14) !important;
  border-width: 1px !important;
}

.stag-events-day.is-past:not(.is-today):hover,
.stag-events-day.is-past:not(.is-today):focus,
.stag-events-day.is-past:not(.is-today).is-selected,
div.stag-events-day.is-past:not(.is-today):hover,
div.stag-events-day.is-past:not(.is-today):focus,
div.stag-events-day.is-past:not(.is-today).is-selected {
  background: rgba(0, 0, 0, 0.08) !important;
  color: rgba(255, 255, 255, 0.44) !important;
  outline: 0 !important;
  box-shadow: none !important;
  z-index: 1 !important;
}

/* v1.0.23: purpose-built event detail pages and month-linked listings. */
[data-stag-events-list-month-panel][hidden] {
  display: none !important;
}

body.single-stag_event #header-wrapper .main-title-section-wrapper,
body.single-stag_event .main-title-section-wrapper,
body.single-stag-event #header-wrapper .main-title-section-wrapper,
body.single-stag-event .main-title-section-wrapper {
  display: none !important;
}

.stag-events-single-page {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 52px;
  color: inherit;
}

.stag-events-single,
.stag-events-single * {
  box-sizing: border-box;
  font-family: inherit;
  text-transform: none !important;
}

.stag-events-single {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: stretch;
  color: inherit;
}

.stag-events-single-image {
  display: block;
  margin: 0;
  overflow: hidden;
  border: 1px solid currentColor;
  min-height: 100%;
}

.stag-events-single-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
}

.stag-events-single-content {
  border: 1px solid currentColor;
  border-left: 6px solid var(--stag-event-colour, currentColor);
  padding: clamp(18px, 2.4vw, 28px);
  background: transparent;
}

.stag-events-back-link {
  display: inline-flex;
  margin: 0 0 18px;
  color: inherit;
  text-decoration: none;
  opacity: 0.86;
}

.stag-events-back-link:hover,
.stag-events-back-link:focus {
  text-decoration: underline;
}

.stag-events-single-meta,
.stag-events-single-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.stag-events-single-meta {
  margin-bottom: 16px;
}

.stag-events-single-meta > span:not(.stag-events-badge) {
  opacity: 0.86;
}

.stag-events-single h1 {
  margin: 0 0 18px;
  color: inherit;
  font: inherit;
  font-size: clamp(1.55rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.1;
}

.stag-events-single-copy {
  display: grid;
  gap: 14px;
  margin: 0 0 24px;
  max-width: 780px;
}

.stag-events-single-copy p {
  margin: 0;
  opacity: 0.9;
}

.stag-events-facts {
  display: grid;
  gap: 10px;
  margin: 8px 0 0;
}

.stag-events-facts div {
  display: grid;
  grid-template-columns: minmax(110px, 0.24fr) minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  padding-top: 10px;
}

.stag-events-facts dt {
  font-weight: 700;
}

.stag-events-facts dd {
  margin: 0;
  opacity: 0.9;
}

.stag-events-primary-action {
  border-color: var(--stag-event-colour, currentColor) !important;
  color: var(--stag-event-colour, currentColor) !important;
}

@media (max-width: 640px) {
  .stag-events-single-page {
    width: min(100% - 24px, 1120px);
    padding: 28px 0 44px;
  }

  .stag-events-single {
    grid-template-columns: 1fr;
  }

  .stag-events-single-image,
  .stag-events-single-image img {
    min-height: 0;
    height: auto;
  }

  .stag-events-facts div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* v1.0.31: avoid clipped event text in narrow calendar cells. */
@media (max-width: 900px) {
  .stag-events-calendar-date-meta,
  .stag-events-cell-events {
    display: none !important;
  }

  .stag-events-day,
  div.stag-events-day {
    min-height: 70px !important;
  }

  .stag-events-marker {
    height: 3px !important;
    max-width: 18px !important;
  }
}

/* v1.0.29: mobile calendar and selected-day cards should stay compact. */
@media (max-width: 720px) {
  .stag-events-weekdays span,
  .stag-events-day,
  div.stag-events-day {
    padding: 6px !important;
  }

  .stag-events-day,
  div.stag-events-day {
    min-height: 58px !important;
    gap: 3px !important;
  }

  .stag-events-weekdays span {
    font-size: 0.72em !important;
    padding: 6px 3px !important;
    text-align: center !important;
  }

  .stag-events-calendar-date-meta,
  .stag-events-cell-events {
    display: none !important;
  }

  .stag-events-marker {
    height: 3px !important;
    max-width: 14px !important;
  }

  .stag-events-day-panel {
    padding: 10px !important;
    margin-top: 0 !important;
  }

  .stag-events-panel-head {
    gap: 10px !important;
    margin-bottom: 10px !important;
  }

  .stag-events-panel-head h3 {
    font-size: 1.15em !important;
    line-height: 1.2 !important;
  }

  .stag-events-day-items .stag-events-card,
  .stag-events-list .stag-events-card.has-image,
  .stag-events-card.has-image {
    grid-template-columns: 96px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .stag-events-card-image-link {
    min-height: 100% !important;
  }

  .stag-events-card-image {
    min-height: 100% !important;
    height: 100% !important;
  }

  .stag-events-card-body {
    padding: 9px 9px 9px 0 !important;
  }

  .stag-events-card-meta {
    gap: 6px !important;
    margin-bottom: 6px !important;
  }

  .stag-events-badge,
  .stag-events-time {
    padding: 3px 8px !important;
    font-size: 0.78em !important;
  }

  .stag-events-card h3 {
    margin-bottom: 6px !important;
  }

  .stag-events-card p {
    display: -webkit-box !important;
    margin-bottom: 8px !important;
    overflow: hidden !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .stag-events-card-actions {
    gap: 6px !important;
  }

  .stag-events-details-link,
  .stag-events-panel-close,
  button.stag-events-panel-close {
    padding: 7px 10px !important;
    font-size: 0.84em !important;
  }
}

@media (max-width: 440px) {
  .stag-events-weekdays span {
    font-size: 0.68em !important;
    padding: 5px 3px !important;
  }

  .stag-events-day,
  div.stag-events-day {
    min-height: 50px !important;
    padding: 5px !important;
  }

  .stag-events-day-number {
    font-size: 12px !important;
  }

  .stag-events-markers {
    gap: 2px !important;
  }

  .stag-events-marker {
    min-width: 4px !important;
    max-width: 10px !important;
  }
}

/* v1.0.33: square compact cells with aligned grid lines for narrow and tablet layouts. */
@media (max-width: 900px) {
  .stag-events-grid {
    align-items: stretch !important;
    aspect-ratio: 7 / var(--stag-calendar-rows, 5) !important;
    gap: 0 !important;
    grid-auto-rows: minmax(0, 1fr) !important;
  }

  .stag-events-day,
  div.stag-events-day {
    aspect-ratio: auto !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    min-height: 0 !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: clamp(5px, 1.2vw, 8px) !important;
  }

  .stag-events-day-number {
    font-size: clamp(12px, 2.7vw, 16px) !important;
  }
}

/* v1.0.36: show short event titles on larger screens without overflowing cells. */
@media (min-width: 901px) {
  .stag-events-day,
  div.stag-events-day {
    min-height: clamp(96px, 9vw, 118px) !important;
    gap: 9px !important;
    grid-template-rows: auto auto 1fr !important;
  }

  .stag-events-cell-events {
    overflow: hidden !important;
    margin-top: 3px !important;
    padding-right: 2px !important;
  }

  .stag-events-cell-event {
    max-width: 100% !important;
    overflow: hidden !important;
    font-size: clamp(0.62rem, 0.8vw, 0.72rem) !important;
    line-height: 1.12 !important;
  }

  .stag-events-cell-event-title {
    display: -webkit-box !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* v1.0.41: desktop Events page layout for staging and live Events pages. */
@media (min-width: 1025px) {
  body.stag-events-public-page .page.type-page.hentry:has(> .stag-events-calendar-wrap + .stag-events-list-wrap) {
    display: grid !important;
    grid-template-columns: minmax(600px, 1.2fr) minmax(320px, 0.8fr) !important;
    gap: clamp(22px, 2.6vw, 38px) !important;
    align-items: start !important;
    width: min(1440px, calc(100vw - 96px)) !important;
    margin: 0 auto !important;
  }

  body.stag-events-public-page .page.type-page.hentry:has(> .stag-events-calendar-wrap + .stag-events-list-wrap) > .stag-events-calendar-wrap,
  body.stag-events-public-page .page.type-page.hentry:has(> .stag-events-calendar-wrap + .stag-events-list-wrap) > .stag-events-list-wrap {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
  }

  body.stag-events-public-page .page.type-page.hentry:has(> .stag-events-calendar-wrap + .stag-events-list-wrap) > .stag-events-list-wrap {
    padding-top: 7px !important;
  }

  body.stag-events-public-page .page.type-page.hentry:has(> .stag-events-calendar-wrap + .stag-events-list-wrap) > .stag-events-list-wrap {
    position: sticky !important;
    top: 28px !important;
  }

  body.stag-events-public-page .stag-events-list-wrap.is-showing-day-panel .stag-events-day-panel {
    margin-top: 0 !important;
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  body.stag-events-public-page .stag-events-list-wrap.is-showing-day-panel .stag-events-panel-head {
    align-items: flex-start !important;
    margin: 0 !important;
  }

  body.stag-events-public-page .stag-events-list-wrap.is-showing-day-panel .stag-events-day-items {
    margin-top: var(--stag-events-card-offset, 16px) !important;
  }

  body.stag-events-public-page .stag-events-calendar-header {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  body.stag-events-public-page .stag-events-calendar-heading {
    min-width: max-content !important;
  }

  body.stag-events-public-page .stag-events-calendar-heading h2 {
    white-space: nowrap !important;
  }

  body.stag-events-public-page .stag-events-calendar-nav {
    flex-wrap: nowrap !important;
    align-items: center !important;
  }

  body.stag-events-public-page .stag-events-list-heading {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    font-size: 1.15em !important;
    line-height: 1.2 !important;
  }

  body.stag-events-public-page .stag-events-list-wrap .stag-events-list-heading,
  body.stag-events-public-page .stag-events-list-wrap.is-showing-day-panel .stag-events-panel-head h3 {
    font: inherit !important;
    font-size: 1.15em !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
  }

  body.stag-events-public-page .stag-events-list-wrap.is-showing-day-panel .stag-events-panel-head {
    min-height: var(--stag-events-calendar-header-height, auto) !important;
    align-items: flex-start !important;
  }

  body.stag-events-public-page .stag-events-list-wrap.is-showing-day-panel .stag-events-panel-close {
    transform: translateY(calc((1.15em * 1.2 - (0.9em * 1.2 + 18px)) / 2)) !important;
  }

  body.stag-events-public-page .stag-events-list-wrap:not(.is-showing-day-panel) .stag-events-list {
    margin-top: var(--stag-events-card-offset, 18px) !important;
  }

  body.stag-events-public-page .stag-events-list .stag-events-card.has-image,
  body.stag-events-public-page .stag-events-list-wrap.is-showing-day-panel .stag-events-day-items .stag-events-card.has-image {
    grid-template-columns: minmax(108px, 0.32fr) minmax(0, 1fr) !important;
  }

  body.stag-events-public-page .stag-events-list-wrap .stag-events-card.has-image {
    min-height: 0 !important;
  }

  body.stag-events-public-page .stag-events-list-wrap .stag-events-card-meta {
    flex-wrap: nowrap !important;
    gap: 5px !important;
    min-width: 0 !important;
  }

  body.stag-events-public-page .stag-events-list-wrap .stag-events-card-meta span {
    flex: 0 0 auto !important;
    font-size: 0.78em !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }

  body.stag-events-public-page .stag-events-list-wrap .stag-events-card-meta .stag-events-badge {
    padding: 3px 8px !important;
  }

  body.stag-events-public-page .stag-events-list-wrap .stag-events-card.has-image .stag-events-card-image-link,
  body.stag-events-public-page .stag-events-list-wrap .stag-events-card.has-image .stag-events-card-image {
    height: 100% !important;
    min-height: 100% !important;
  }
}
