/*
 * Event tickets (paper ticket with scalloped ends, date stub, framed details and button stub), shared by the
 * homepage events section and the events list pages (frontpage/includes/event_ticket.html).
 * .sd-ticket--compact: smaller, without the button stub (past events and the small homepage tickets);
 * .sd-ticket--past: the greys of past events.
 */
/* Small pill on the ticket (in person / online) */
.sd-event-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 0.3125rem 0.625rem;
  border-radius: 999px;
}

.sd-event-chip--inperson { color: #1F2A3D; background: #50D878; }
.sd-event-chip--online { color: #1F55B8; background: #E1EBFD; }

/* ---- Ticket: paper ticket with scalloped ends, a date stub, framed details and a button stub.
   The scallops are real cut-outs (CSS mask on .sd-ticket-paper); the shadow sits on .sd-ticket so it follows the cut shape. */
.sd-ticket {
  --sd-tk: #157A43;
  --sd-tk-dark: #0F5A31;
  --sd-tk-soft: #EAF8EF;
  --sd-tk-line: rgba(21, 122, 67, 0.35);
  --sd-scallop: 7px;
  --sd-scallop-step: 20px;
  --sd-tk-text: #1B2333;
  --sd-tk-muted: #435066;
  display: block;
  color: var(--sd-tk-text);
  text-decoration: none;
  filter: drop-shadow(0 16px 22px rgba(27, 35, 51, 0.16));
  transition: transform .2s ease;
}

a.sd-ticket:hover,
a.sd-ticket:focus-visible {
  color: var(--sd-tk-text);
  transform: translateY(-3px);
}

a.sd-ticket:focus-visible {
  outline: 2px solid var(--sd-tk);
  outline-offset: 6px;
}

.sd-ticket--online {
  --sd-tk: #1F55B8;
  --sd-tk-dark: #163F8A;
  --sd-tk-soft: #EDF3FE;
  --sd-tk-line: rgba(31, 85, 184, 0.35);
}

.sd-ticket-paper {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr) 13rem;
  min-height: 14.5rem;
  border-radius: 0.375rem;
  -webkit-mask:
    radial-gradient(circle at 0 50%, #0000 var(--sd-scallop), #000 calc(var(--sd-scallop) + 0.5px)) 0 50% / 51% var(--sd-scallop-step) repeat-y,
    radial-gradient(circle at 100% 50%, #0000 var(--sd-scallop), #000 calc(var(--sd-scallop) + 0.5px)) 100% 50% / 51% var(--sd-scallop-step) repeat-y;
  mask:
    radial-gradient(circle at 0 50%, #0000 var(--sd-scallop), #000 calc(var(--sd-scallop) + 0.5px)) 0 50% / 51% var(--sd-scallop-step) repeat-y,
    radial-gradient(circle at 100% 50%, #0000 var(--sd-scallop), #000 calc(var(--sd-scallop) + 0.5px)) 100% 50% / 51% var(--sd-scallop-step) repeat-y;
}

/* Date stub on the event colour, with a decorative barcode and a dashed tear line on its inner edge */
.sd-ticket-stub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.5rem 1rem 1.5rem 2.25rem;
  background: linear-gradient(160deg, var(--sd-tk) 0%, var(--sd-tk-dark) 100%);
  border-right: 2px dashed rgba(255, 255, 255, 0.7);
  color: #FFFFFF;
  text-align: center;
  text-decoration: none;
}

a.sd-ticket-stub:hover {
  color: #FFFFFF;
}

.sd-ticket-barcode {
  position: absolute;
  left: 1rem;
  top: 50%;
  width: 0.75rem;
  height: 62%;
  transform: translateY(-50%);
  opacity: 0.55;
  background: repeating-linear-gradient(to bottom, #FFFFFF 0 2px, transparent 2px 4px, #FFFFFF 4px 5px, transparent 5px 8px, #FFFFFF 8px 11px, transparent 11px 13px);
}

.sd-ticket-day {
  font-size: 4rem;
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: -2px;
}

.sd-ticket-month {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.92;
}

.sd-ticket-stub-big {
  font-size: 2.75rem;
  margin-bottom: 0.5rem;
}

/* Details on the soft tint, inside a thin frame like a printed ticket */
.sd-ticket-main {
  display: flex;
  padding: 0.875rem;
  background: var(--sd-tk-soft);
  min-width: 0;
}

.sd-ticket-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.625rem;
  padding: 1.25rem 1.5rem;
  border: 1.5px solid var(--sd-tk-line);
  border-radius: 0.375rem;
  min-width: 0;
}

.sd-ticket-name {
  font-size: 1.625rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--sd-tk-text);
  text-decoration: none;
}

a.sd-ticket-name:hover {
  color: var(--sd-tk);
}

.sd-ticket-place {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--sd-tk);
}

.sd-ticket-text {
  max-width: 34rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--sd-tk-muted);
}

/* Button stub on the right, behind a second dashed tear line */
.sd-ticket-end {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.5rem 1.25rem 1.25rem;
  background: var(--sd-tk-soft);
  border-left: 2px dashed var(--sd-tk-line);
}

.sd-ticket-cta {
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: center;
  color: #1F2A3D;
  background: #50D878;
  padding: 0.8125rem 1.375rem;
  border-radius: 0.625rem;
  text-decoration: none;
  white-space: nowrap;
}

a.sd-ticket-cta:hover {
  color: #1F2A3D;
}

.sd-ticket-cta--online {
  color: #FFFFFF;
  background: var(--sd-tk);
}

a.sd-ticket-cta--online:hover {
  color: #FFFFFF;
  background: var(--sd-tk-dark);
}

@media (max-width: 991.98px) {
  .sd-ticket-paper {
    grid-template-columns: 9rem minmax(0, 1fr) 11rem;
  }

  .sd-ticket-name {
    font-size: 1.375rem;
  }
}

/* Phones: the ticket turns vertical (stub on top, button at the bottom); scallops move to the top and bottom ends */
@media (max-width: 767.98px) {
  .sd-ticket .sd-ticket-paper {
    grid-template-columns: 1fr;
    -webkit-mask:
      radial-gradient(circle at 50% 0, #0000 var(--sd-scallop), #000 calc(var(--sd-scallop) + 0.5px)) 50% 0 / var(--sd-scallop-step) 51% repeat-x,
      radial-gradient(circle at 50% 100%, #0000 var(--sd-scallop), #000 calc(var(--sd-scallop) + 0.5px)) 50% 100% / var(--sd-scallop-step) 51% repeat-x;
    mask:
      radial-gradient(circle at 50% 0, #0000 var(--sd-scallop), #000 calc(var(--sd-scallop) + 0.5px)) 50% 0 / var(--sd-scallop-step) 51% repeat-x,
      radial-gradient(circle at 50% 100%, #0000 var(--sd-scallop), #000 calc(var(--sd-scallop) + 0.5px)) 50% 100% / var(--sd-scallop-step) 51% repeat-x;
  }

  .sd-ticket .sd-ticket-stub {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
    /* Right padding keeps the date / "Coming soon" clear of the barcode */
    padding: 1.5rem 5.5rem 1.125rem 1.25rem;
    text-align: left;
    border-right: 0;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.7);
  }

  .sd-ticket .sd-ticket-barcode {
    left: auto;
    right: 1.25rem;
    top: 50%;
    width: 3rem;
    height: 1.75rem;
    background: repeating-linear-gradient(to right, #FFFFFF 0 2px, transparent 2px 4px, #FFFFFF 4px 5px, transparent 5px 8px, #FFFFFF 8px 11px, transparent 11px 13px);
  }

  .sd-ticket .sd-ticket-day {
    font-size: 2.75rem;
  }

  .sd-ticket .sd-ticket-stub-big {
    font-size: 2rem;
    margin: 0;
  }

  .sd-ticket .sd-ticket-end {
    border-left: 0;
    border-top: 2px dashed var(--sd-tk-line);
    padding: 1rem 1.25rem 1.5rem;
  }

  .sd-ticket .sd-ticket-cta {
    width: 100%;
  }

  .sd-ticket-frame {
    padding: 1rem 1.125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sd-ticket {
    transition: none;
  }

  a.sd-ticket:hover,
  a.sd-ticket:focus-visible {
    transform: none;
  }
}


/* ---- Ticket without a button stub (past events, or an event without a page): the details reach the right edge,
   which keeps the dashed tear line, as if the button stub had been torn off */
.sd-ticket-paper:not(:has(.sd-ticket-end)) {
  grid-template-columns: 10.5rem minmax(0, 1fr);
}

.sd-ticket-paper:not(:has(.sd-ticket-end)) .sd-ticket-main {
  border-right: 2px dashed var(--sd-tk-line);
}

/* Past events: the same ticket in greys */
.sd-ticket--past {
  --sd-tk: #6B7280;
  --sd-tk-dark: #4B5563;
  --sd-tk-soft: #F3F4F6;
  --sd-tk-line: rgba(107, 114, 128, 0.35);
  --sd-tk-text: #374151;
  filter: drop-shadow(0 12px 18px rgba(27, 35, 51, 0.1));
}

.sd-ticket--past .sd-event-chip {
  color: #FFFFFF;
  background: #6B7280;
}

.sd-ticket--past .sd-ticket-text {
  color: #6B7280;
}

@media (max-width: 991.98px) {
  .sd-ticket-paper:not(:has(.sd-ticket-end)) {
    grid-template-columns: 9rem minmax(0, 1fr);
  }
}

@media (max-width: 767.98px) {
  .sd-ticket .sd-ticket-paper:not(:has(.sd-ticket-end)) {
    grid-template-columns: 1fr;
  }

  .sd-ticket-paper:not(:has(.sd-ticket-end)) .sd-ticket-main {
    border-right: 0;
    border-bottom: 2px dashed var(--sd-tk-line);
  }
}
/* "See what happened" on a past ticket that opens the event's summary */
.sd-ticket-recap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--sd-tk-text);
}

.sd-ticket-recap i {
  transition: transform .2s ease;
}

a.sd-ticket:hover .sd-ticket-recap i {
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .sd-ticket-recap i {
    transition: none;
  }
}
/* Days left above the button of the button stub (events list) */
.sd-ticket-end {
  flex-direction: column;
  gap: 0.625rem;
}

.sd-ticket-days {
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sd-tk);
}

/* Compact ticket (past events, and the small tickets of the homepage): narrower stub, smaller name, no text */
.sd-ticket--compact .sd-ticket-paper:not(:has(.sd-ticket-end)) {
  grid-template-columns: 8rem minmax(0, 1fr);
  min-height: 0;
}

.sd-ticket--compact .sd-ticket-stub {
  padding: 1rem 0.75rem 1rem 1.75rem;
}

.sd-ticket--compact .sd-ticket-day {
  font-size: 2.75rem;
}

.sd-ticket--compact .sd-ticket-barcode {
  left: 0.75rem;
  width: 0.5rem;
}

.sd-ticket--compact .sd-ticket-main {
  padding: 0.625rem;
}

.sd-ticket--compact .sd-ticket-frame {
  gap: 0.375rem;
  padding: 0.875rem 1.25rem;
}

.sd-ticket--compact .sd-ticket-name {
  font-size: 1.25rem;
}

.sd-ticket--compact .sd-ticket-text {
  display: none;
}

.sd-ticket--compact .sd-ticket-stub-big {
  margin-bottom: 0.25rem;
  font-size: 1.75rem;
}

.sd-ticket--compact .sd-ticket-month {
  font-size: 0.75rem;
}

@media (max-width: 767.98px) {
  .sd-ticket--compact .sd-ticket-paper:not(:has(.sd-ticket-end)) {
    grid-template-columns: 1fr;
  }

  .sd-ticket--compact .sd-ticket-stub {
    padding: 1rem 5.5rem 0.875rem 1.25rem;
  }

  .sd-ticket--compact .sd-ticket-day {
    font-size: 2rem;
  }

  .sd-ticket--compact .sd-ticket-barcode {
    left: auto;
    width: 3rem;
  }

  .sd-ticket--compact .sd-ticket-name {
    font-size: 1.125rem;
  }
}
/* Ticket with a picture (event ticket_background, e.g. Porto): the picture very lightly behind the details and the
   button stub (the date stub stays as it is) */
.sd-ticket--photo .sd-ticket-paper {
  background: var(--sd-tk-soft) var(--sd-ticket-photo) center / cover no-repeat;
}

.sd-ticket--photo .sd-ticket-main,
.sd-ticket--photo .sd-ticket-end {
  background: rgba(234, 248, 239, 0.9);
}

.sd-ticket--photo.sd-ticket--online .sd-ticket-main,
.sd-ticket--photo.sd-ticket--online .sd-ticket-end {
  background: rgba(237, 243, 254, 0.9);
}