/* Adapted from feature/VTO-46/modernize-webshop-ui.
   Content only: preserve sidebar widths, slider, calendar and booking behavior. */
#content.vto-detail-content .vto-detail-slider > .event-calendar {
  display: none;
}

#content.vto-detail-content .vto-detail-cal-tabs {
  display: flex;
  flex-wrap: wrap;
  margin: 24px 0 20px;
  border-bottom: 2px solid #e6ebf2;
}

#content.vto-detail-content .vto-detail-cal-tab {
  position: relative;
  bottom: -2px;
  padding: 14px 32px;
  margin-right: 4px;
  border: 1px solid #e6ebf2;
  border-bottom: 2px solid transparent;
  border-radius: 10px 10px 0 0;
  background: #f1f3f6;
  color: #647084;
  font: normal normal 700 15px/1 Boston, Arial, Helvetica, sans-serif;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

#content.vto-detail-content .vto-detail-cal-tab[aria-selected="true"] {
  border-bottom-color: #fff;
  background: #fff;
  color: #0f1b2d;
}

#content.vto-detail-content .vto-detail-cal-tab:hover {
  color: #db0028;
}

#content.vto-detail-content .vto-detail-cal-tabs[hidden],
#content.vto-detail-content [role="tabpanel"][hidden] {
  display: none !important;
}

#content.vto-detail-content > hgroup {
  padding: 0;
  margin: 0 0 12px;
  border-bottom: 1px solid #e6ebf2;
}

#content.vto-detail-content > hgroup h1 {
  margin: 0 0 4px;
  color: var(--main, #db0028);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: none;
  overflow-wrap: break-word;
}

#content.vto-detail-content > hgroup h2 {
  margin: 0;
  color: #536176;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

#content.vto-detail-content .page_left #calendar,
#content.vto-detail-content .page_left .event-text {
  box-sizing: border-box;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 27, 45, 0.05);
}

#content.vto-detail-content .page_left .event-text {
  color: #536176;
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

#content.vto-detail-content .page_left .event-text p {
  margin: 0 0 1em;
  font-size: inherit;
  line-height: inherit;
}

#content.vto-detail-content .page_left .event-text > :last-child {
  margin-bottom: 0;
}

#content.vto-detail-content .page_left .event-text h2,
#content.vto-detail-content .page_left .event-text h3,
#content.vto-detail-content .page_left #newcalheader {
  color: #0f1b2d;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  text-transform: none;
}

#content.vto-detail-content .page_left .event-text a {
  color: #b90022;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#content.vto-detail-content .page_left .calbtn {
  padding: 8px 12px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #f1f3f6;
  color: #0f1b2d;
  text-shadow: none;
}

#content.vto-detail-content .page_left .btn-primary.calbtn {
  border-color: #db0028;
  background: #db0028;
  color: #fff;
}

#content.vto-detail-content .page_left #terminliste {
  margin-bottom: 28px;
}

#content.vto-detail-content .page_left .accordion-multiple > h3 {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 18px 22px !important;
  margin: 0 0 8px !important;
  background: #f1f3f6 !important;
  border-radius: 12px !important;
  color: #0f1b2d !important;
  font: normal normal 800 16px/1.3 Boston, Arial, Helvetica, sans-serif !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  cursor: pointer;
  filter: none !important;
  position: relative;
}

/* Calendar icon before month label */
#content.vto-detail-content > hgroup .vto-detail-meta-date::before,
#content.vto-detail-content .page_left .accordion-multiple > h3::before {
  content: '';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23db0028' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Chevron icon (the existing <i> element) — pushed to the right */
#content.vto-detail-content .page_left .accordion-multiple > h3 i {
  margin-left: auto;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  font-style: normal;
  font-size: 0 !important;
  color: transparent !important;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23647084' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center/contain no-repeat !important;
}

/* Kill any legacy sprite pseudo-elements on the icon */
#content.vto-detail-content .page_left .accordion-multiple > h3 i::before,
#content.vto-detail-content .page_left .accordion-multiple > h3 i::after {
  display: none !important;
  content: none !important;
}

/* Dates container — card wrap */
#content.vto-detail-content .page_left .dates {
  margin-bottom: 12px !important;
  padding: 12px !important;
  background: #f8fafc !important;
  border: 1px solid #e6ebf2 !important;
  border-radius: 14px !important;
  box-sizing: border-box;
}

/* Stacked date/location on the left, actions centered on the right. */
#content.vto-detail-content .page_left .dates > div {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  grid-auto-flow: column;
  align-items: center !important;
  column-gap: 10px !important;
  row-gap: 0 !important;
  padding: 10px 12px !important;
  margin: 0 0 6px !important;
  border: 1px solid #e6ebf2 !important;
  border-radius: 12px !important;
  background: #fff !important;
  filter: none !important;
  cursor: pointer;
  flex-wrap: wrap;
  overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

#content.vto-detail-content .page_left .dates > div:last-child {
  margin-bottom: 0 !important;
}

#content.vto-detail-content .page_left .dates > div:hover {
  border-color: rgba(219, 0, 40, 0.30) !important;
  box-shadow: 0 4px 16px rgba(15, 27, 45, 0.08) !important;
}

#content.vto-detail-content .page_left .dates > div.selected {
  border-color: rgba(219, 0, 40, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(219, 0, 40, 0.10) !important;
}

/* Hide only the repeated event title, preserving other-venue links. */
#content.vto-detail-content .page_left .dates > div > a[id^="TX"] {
  display: none !important;
}

/* Date and location share a compact, stacked text block. */
#content.vto-detail-content .page_left .dates > div p:first-of-type {
  grid-column: 1;
  grid-row: 1;
  flex: 1 1 100% !important;
  order: 1;
  margin: 0 !important;
  padding: 0 0 3px 28px !important;
  position: relative;
  min-width: 0;
  box-sizing: border-box;
}

#content.vto-detail-content .page_left .dates > div p:first-of-type::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23db0028' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E") center/contain no-repeat;
}

#content.vto-detail-content .page_left .dates > div p:first-of-type time {
  display: block;
  color: #0f1b2d !important;
  font: normal normal 700 14px/1.3 Boston, Arial, Helvetica, sans-serif !important;
  white-space: normal;
}

/* Location sits directly below the date at every viewport width. */
#content.vto-detail-content .page_left .dates > div p:nth-of-type(2) {
  grid-column: 1;
  grid-row: 2;
  flex: 1 1 100% !important;
  order: 2;
  min-width: 0;
  margin: 0 !important;
  padding: 0 0 8px 28px !important;
  box-sizing: border-box;
  position: relative;
  color: #647084 !important;
  font: normal normal 400 12px/1.3 Boston, Arial, Helvetica, sans-serif !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

#content.vto-detail-content > hgroup .vto-detail-meta-location::before,
#content.vto-detail-content .page_left .dates > div p:nth-of-type(2)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23647084' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") center/contain no-repeat;
}

#content.vto-detail-content .page_left .dates > div p:nth-of-type(2) span {
  color: inherit !important;
  font: inherit !important;
}

/* ACTIONS — saalplan | programm | tickets, pinned to the right */
#content.vto-detail-content .page_left .dates > div > span:first-of-type {
  grid-row: 1 / span 2;
  flex: 0 0 auto !important;
  order: 10;
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 0 !important;
}

/* Button order: saalplan(3) → programm(6) → tickets(10) */
#content.vto-detail-content .page_left .dates > div > a.btn-link:not(.fancybox\.ajax) {
  grid-row: 1 / span 2;
  order: 3;
}

#content.vto-detail-content .page_left .dates > div > a.fancybox\.ajax {
  grid-row: 1 / span 2;
  order: 6;
}

#content.vto-detail-content .page_left .dates > div > span:first-of-type {
  order: 10;
}

/* Tickets button — red pill with ticket icon */
#content.vto-detail-content #newcal #cal-slide-content .btn-red,
#content.vto-detail-content .page_left .dates > div > span:first-of-type a.btn-red {
  text-align: center;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  background: var(--main, #db0028) !important;
  color: #fff !important;
  font: normal normal 700 14px/1 Boston, Arial, Helvetica, sans-serif !important;
  text-decoration: none !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(219,0,40,0.22) !important;
  filter: none !important;
  white-space: nowrap;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

#content.vto-detail-content #newcal #cal-slide-content .btn-red::before,
#content.vto-detail-content .page_left .dates > div > span:first-of-type a.btn-red::before {
  content: '';
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v2z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Align inline content without changing desktop/mobile link visibility. */
#content.vto-detail-content #newcal #cal-slide-content .btn-red > span,
#content.vto-detail-content .page_left .dates > div > span:first-of-type a.btn-red > span {
  display: inline-block;
  vertical-align: middle;
  line-height: 15px;
}

#content.vto-detail-content #newcal #cal-slide-content .btn-red:hover,
#content.vto-detail-content .page_left .dates > div > span:first-of-type a.btn-red:hover {
  background: var(--main_hover, #c80225) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(219,0,40,0.30) !important;
}

/* Saalplan & Programm — shared ghost button style matching tickets shape */
#content.vto-detail-content #newcal #cal-slide-content .btn-simple:not(.btn-red),
#content.vto-detail-content .page_left .dates > div > a.btn-link:not(.fancybox\.ajax),
#content.vto-detail-content .page_left .dates > div > a.fancybox\.ajax {
  display: inline-flex !important;
  align-items: center;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  border: 1px solid #dfe5ee !important;
  background: #f1f3f6 !important;
  background-image: none !important;
  color: #0f1b2d !important;
  font: normal normal 600 14px/1 Boston, Arial, Helvetica, sans-serif !important;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: none !important;
  filter: none !important;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

#content.vto-detail-content #newcal #cal-slide-content .btn-simple:not(.btn-red):hover,
#content.vto-detail-content .page_left .dates > div > a.btn-link:not(.fancybox\.ajax):hover,
#content.vto-detail-content .page_left .dates > div > a.fancybox\.ajax:hover {
  background: #e8ecf1 !important;
  background-image: none !important;
  border-color: #c8d0db !important;
  color: #0f1b2d !important;
  box-shadow: none !important;
}

/* Hide legacy br and trailing empty span */
#content.vto-detail-content .page_left .dates > div br {
  display: none !important;
}

#content.vto-detail-content .page_left .dates > div > span:last-child:empty {
  display: none !important;
}

#content.vto-detail-content .page_left a:focus-visible,
#content.vto-detail-content .page_left button:focus-visible {
  outline: 2px solid #0f1b2d;
  outline-offset: 3px;
}

@media screen and (max-width: 820px) {
  #content.vto-detail-content > hgroup h1 {
    font-size: 20px;
  }

  #content.vto-detail-content .page_left #calendar,
  #content.vto-detail-content .page_left .event-text {
    padding: 12px;
  }
}

/* Use the reference stacked cards where the unchanged sidebar limits space. */
@media screen and (max-width: 1320px) {
  /* Accordion headers */
  #content.vto-detail-content .page_left .accordion-multiple > h3 {
    padding: 14px 16px !important;
    font-size: 14px !important;
  }

  /* Date rows — switch to stacked layout */
  #content.vto-detail-content .page_left .dates > div {
    flex-wrap: wrap !important;
    padding: 10px 12px !important;
    column-gap: 10px !important;
    row-gap: 6px !important;
  }

  /* Date column — full width, reduce left offset for icon */
  #content.vto-detail-content .page_left .dates > div p:first-of-type {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    padding: 0 0 3px 28px !important;
  }

  #content.vto-detail-content .page_left .dates > div p:first-of-type::before {
    left: 4px;
    top: 1px;
    transform: none;
    width: 16px;
    height: 16px;
  }

  /* Venue column — full width */
  #content.vto-detail-content .page_left .dates > div p:nth-of-type(2) {
    flex: 1 1 100% !important;
    padding: 0 0 8px 28px !important;
    white-space: normal;
  }

  #content.vto-detail-content .page_left .dates > div p:nth-of-type(2)::before {
    left: 5px;
    top: 1px;
    transform: none;
    width: 14px;
    height: 14px;
  }

  /* Actions row — full width, wrap buttons */
  #content.vto-detail-content .page_left .dates > div > span:first-of-type {
    flex: 0 0 auto !important;
    padding: 0 !important;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Saalplan / Programm links — also wrap into the button row */
  #content.vto-detail-content #newcal #cal-slide-content .btn-simple:not(.btn-red),
#content.vto-detail-content .page_left .dates > div > a.btn-link:not(.fancybox\.ajax),
  #content.vto-detail-content .page_left .dates > div > a.fancybox\.ajax {
    flex: 0 0 auto;
    order: 11;
  }

  #content.vto-detail-content .page_left .dates > div > a.fancybox\.ajax {
    order: 12;
  }

  /* Buttons slightly smaller on mobile */
  #content.vto-detail-content #newcal #cal-slide-content .btn-red,
#content.vto-detail-content .page_left .dates > div > span:first-of-type a.btn-red {
    padding: 10px 16px !important;
    font-size: 13px !important;
  }

  #content.vto-detail-content #newcal #cal-slide-content .btn-simple:not(.btn-red),
#content.vto-detail-content .page_left .dates > div > a.btn-link:not(.fancybox\.ajax),
  #content.vto-detail-content .page_left .dates > div > a.fancybox\.ajax {
    padding: 10px 14px !important;
    font-size: 12px !important;
  }
}

/* Keep the tab strip and all views aligned, including shared detail content. */
#content.vto-detail-content .page_left .vto-detail-cal-tabs,
#content.vto-detail-content .page_left #terminliste,
#content.vto-detail-content .page_left #calendar,
#content.vto-detail-content .page_left #vto-event-details {
  box-sizing: border-box;
  margin-right: 0;
  margin-left: 0;
}

@media screen and (max-width: 767px) {
  #content.vto-detail-content .vto-detail-cal-tab {
    flex: 1 1 auto;
    padding: 12px 10px;
    font-size: 13px;
  }

  #content.vto-detail-content > hgroup {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  #content.vto-detail-content > hgroup,
  #content.vto-detail-content .page_left .vto-detail-cal-tabs,
  #content.vto-detail-content .page_left #terminliste,
  #content.vto-detail-content .page_left #calendar,
  #content.vto-detail-content .page_left #vto-event-details {
    margin-right: 12px;
    margin-left: 12px;
  }
}

/* Frame the existing content videos without changing playback or loading. */
#content.vto-detail-content .page_left #video > div[id^="video-"] {
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid #e6ebf2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(15, 27, 45, 0.08);
}

#content.vto-detail-content .page_left #video iframe {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  margin: 0 !important;
  border: 0;
  border-radius: 10px;
  background: #0f1b2d;
}

/* Reuse the date-card icons for the title metadata. */
#content.vto-detail-content > hgroup h2 {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

#content.vto-detail-content > hgroup .vto-detail-meta-date,
#content.vto-detail-content > hgroup .vto-detail-meta-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#content.vto-detail-content > hgroup .vto-detail-meta-date::before,
#content.vto-detail-content > hgroup .vto-detail-meta-location::before {
  position: static;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transform: none;
}

/* Reset legacy button metrics without overriding desktop/mobile visibility. */
@media screen and (max-width: 600px) {
  #content.vto-detail-content .page_left .dates > div {
    display: flex !important;
    justify-content: flex-start;
  }
}

#content.vto-detail-content #newcal #cal-slide-content .btn-simple,
#content.vto-detail-content .page_left .dates .btn-simple {
  box-sizing: border-box;
  height: auto;
  min-width: 0;
  text-shadow: none;
  text-transform: none;
}

#content.vto-detail-content #newcal #cal-slide-content .btn-simple span,
#content.vto-detail-content .page_left .dates .btn-simple span {
  color: inherit;
  font: inherit;
}

#content.vto-detail-content .page_left .dates > div > strong {
  order: 2;
  padding: 12px;
}

#content.vto-detail-content .page_left .accordion-multiple > h3.ui-state-active i {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  #content.vto-detail-content .vto-detail-cal-tab,
  #content.vto-detail-content .page_left .dates > div,
  #content.vto-detail-content #newcal #cal-slide-content .btn-simple,
#content.vto-detail-content .page_left .dates .btn-simple {
    transition: none;
  }
}
