/*
 * ExpoBooking: ticket button, Tickets layout, cart bar and preview modal.
 * Plain CSS, no build step. Colours and shapes come from the theme's own
 * palette (petrol #244752, green #b4d7a5) and are pending designer approval.
 */

/* Header ticket button
 * With a ticket button the header becomes a flex row, so the menu gets the
 * space that's left and clips extra items the way it already does
 * (overflow: hidden on .nav-primary). Without a button nothing changes.
 */
.mainHeader.-has-ticket-button {
  display: flex;
  align-items: flex-start;
}
.mainHeader.-has-ticket-button .brand {
  flex: none;
}
.mainHeader.-has-ticket-button .nav-primary {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin-right: 20px;
}
.mainHeader .ticket-button {
  flex: none;
  margin: 10px 0 0 auto;
  padding: 0 22px 0 16px;
  height: 40px;
  line-height: 40px;
  white-space: nowrap;
  font-weight: 500;
  color: #fff;
  background-color: #244752;
  /* Square left corners, fully rounded right side (design mockup). */
  border-radius: 0 999px 999px 0;
  transition: background-color 0.2s, color 0.2s;
}
/* Tighter menu next to the ticket button where the Swedish menu would
 * otherwise lose items to overflow (measured with clientWidth + 15px
 * scrollbar, see the commit message). Items that still don't fit are
 * clipped as before and stay reachable in the drawer menu. */
@media (min-width: 1024px) and (max-width: 1039.98px) {
  .mainHeader.-has-ticket-button .nav-primary ul li {
    padding: 0 16px;
  }
}
@media (min-width: 700px) and (max-width: 1023.98px) {
  .mainHeader.-has-ticket-button .nav-primary {
    margin-right: 12px;
  }
  .mainHeader.-has-ticket-button .nav-primary ul li {
    padding: 0 6px;
  }
  .mainHeader .ticket-button {
    padding: 0 14px 0 10px;
    font-size: 14px;
    /* A bit less height below 1024px, still centred on the burger. */
    height: 36px;
    line-height: 36px;
    margin-top: 12px;
  }
}

/* Below 700px the menu is hidden and only logo, ticket button and burger
 * share the row. Take the button closer to the burger (12px gap) and let
 * the label wrap to two lines on the narrowest phones. */
@media (max-width: 699.98px) {
  .mainHeader.-has-ticket-button {
    padding-right: 67px;
  }
  .mainHeader .ticket-button {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-top: 12px;
    height: 36px;
    padding: 0 14px 0 10px;
    font-size: 14px;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
    overflow: hidden;
  }
}
.mainHeader .ticket-button:hover,
.mainHeader .ticket-button:focus-visible {
  color: #244752;
  background-color: #b4d7a5;
}

/* The same ticket button in the burger menu, between the primary menu and
 * the full menu (design mockup). Menu-sized text at every width; resets
 * the header button's flex and small-screen rules. The wrapper is a div so
 * it fades in with the rest of the menu. */
.mainHeader .nav-full .nav-full-ticket {
  margin: -10px 0 25px;
}
.mainHeader .nav-full .ticket-button {
  display: inline-block;
  margin: 0;
  height: 40px;
  padding: 0 22px 0 16px;
  font-size: 18px;
  line-height: 40px;
  white-space: nowrap;
  text-align: left;
}

/* Buy buttons (Tickets layout, cart bar, preview modal) */
.expo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 20px;
  border: 2px solid #244752;
  border-radius: 0;
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  color: #fff;
  background-color: #244752;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.expo-button.-secondary {
  color: #244752;
  background-color: transparent;
}
.expo-button:hover,
.expo-button:focus-visible {
  color: #244752;
  border-color: #b4d7a5;
  background-color: #b4d7a5;
}
/* Outlined button ("Läs mer"): 1px border, fills petrol with white text on
 * hover. Padding grows by 1px so it keeps the same size as the solid
 * buttons with their 2px border. */
.expo-button.-secondary {
  border-width: 1px;
  padding: 9px 21px;
}
.expo-button.-secondary:hover,
.expo-button.-secondary:focus-visible {
  color: #fff;
  border-color: #244752;
  background-color: #244752;
}

/* Tickets layout: cards styled like the theme's "Länkpuffar i rutnät" in
 * two columns (e.g. "Missa inte" on Aktiviteter): full container width, 2
 * columns from 700px with a 20px gap, 16:9 images, 22px headings (18px
 * below 1024px) and the theme's grey "> Läs mer" link. The buy button sits
 * at the bottom of each card, aligned across a row. */
/* Description above the cards: body text, kept to the theme's 820px
 * text width for readable lines. */
.acf-block.tickets .tickets-description {
  max-width: 820px;
  margin: 0 0 30px;
}
@media (max-width: 1023.98px) {
  .acf-block.tickets .tickets-description {
    margin-bottom: 20px;
  }
}
/* A bit more room below the block than the theme's .acf-block margin
 * (60px, 30px below 700px). */
.acf-block.tickets {
  padding-bottom: 40px;
}
.acf-block.tickets .tickets-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px 20px;
}
@media (min-width: 700px) {
  .acf-block.tickets .tickets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.acf-block.tickets .ticket {
  display: flex;
  flex-direction: column;
}
.acf-block.tickets .ticket-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 20px;
}
.acf-block.tickets .ticket-heading {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.1;
}
@media (max-width: 1023.98px) {
  .acf-block.tickets .ticket-heading {
    font-size: 18px;
  }
}
.acf-block.tickets .ticket-text {
  margin: 5px 0 0;
}
/* Buy button first, then "> Läs mer", on one row at the bottom of the
 * card so rows line up. Wraps onto two lines if the card is too narrow. */
/* Köp (solid) and Läs mer (outlined) as two equal buttons, each half the
 * card's width, Köp first (design mockup). A lone Köp keeps half width so
 * buttons line up across cards. In very narrow cards they stack.
 * Labels stay on one line: a button with a longer label ("Lägg i
 * varukorgen") grows past half width instead of wrapping, and if the two
 * no longer fit side by side they stack. */
.acf-block.tickets .ticket {
  container-type: inline-size;
}
.acf-block.tickets .ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: auto;
  padding-top: 20px;
}
.acf-block.tickets .ticket-actions .expo-button {
  flex: 0 0 auto;
  min-width: calc(50% - 10px);
  max-width: 100%;
  white-space: nowrap;
}
/* The Text och bild buy button looks like the ticket button (one line, and
 * the same size below 1024px), but its width follows the label. */
.acf-block.text-image .expo-button {
  max-width: 100%;
  white-space: nowrap;
}
/* A bit lower and 14px text below 1024px, like the header ticket button. */
@media (max-width: 1023.98px) {
  .acf-block.tickets .ticket-actions .expo-button,
  .acf-block.text-image .expo-button {
    font-size: 14px;
    min-height: 40px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .acf-block.tickets .ticket-actions .expo-button.-secondary {
    padding-top: 7px;
    padding-bottom: 7px;
  }
}
@container (max-width: 279.98px) {
  .acf-block.tickets .ticket-actions .expo-button {
    flex-basis: 100%;
  }
}

/* Text och bild: image and text side by side from 700px, like the
 * image + hero grid on the Brix sites. Full container width with the link
 * grid's 20px gap (40px here, for air around the text), the image in its
 * original proportions, text centred vertically against the image. The
 * heading is an h2 in the theme's block h2 style (Berlingske Serif), so it
 * doesn't enter the h3-based anchor menu. */
.acf-block.text-image {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
@media (min-width: 700px) {
  .acf-block.text-image {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
    align-items: center;
  }
  .acf-block.text-image.-image-right .text-image-image {
    order: 2;
  }
  /* Line height and the font's own space above capitals put the first
   * letters below the top of the text box. Pull the first element up so the
   * cap tops line up with the image when the text is the taller column.
   * Measured in Chrome: 0.11em for the Berlingske Serif heading (line-height 1.1), 0.40em for Juli Sans body
   * text (line-height 1.45). */
  .acf-block.text-image .text-image-body > .text-image-heading:first-child {
    margin-top: -0.11em;
  }
  .acf-block.text-image .text-image-body > .text-image-text:first-child {
    margin-top: -0.4em;
  }
  .acf-block.text-image.-no-image {
    grid-template-columns: minmax(0, 1fr);
    max-width: 820px;
  }
}
.acf-block.text-image .text-image-image {
  display: block;
  width: 100%;
  height: auto;
}
.acf-block.text-image .text-image-heading {
  margin: 0;
  font-family: Berlingske Serif, Georgia, serif;
  font-weight: 700;
  line-height: 1.1;
  font-size: 36px;
}
@media (max-width: 1023.98px) {
  .acf-block.text-image .text-image-heading {
    font-size: 24px;
  }
}
.acf-block.text-image .text-image-text {
  margin: 15px 0 0;
}
/* Ticket and Text och bild texts come from a bold-only editor, so they are
 * one or more <p>. Keep paragraphs tight, as in the old plain textarea. */
.acf-block.tickets .ticket-text p,
.acf-block.text-image .text-image-text p {
  margin: 0;
}
.acf-block.tickets .ticket-text p + p,
.acf-block.text-image .text-image-text p + p {
  margin-top: 10px;
}
/* Space between the text and the buy button: 60px from 1024px, 40px below. */
.acf-block.text-image .expo-button {
  margin-top: 40px;
}
@media (min-width: 1024px) {
  .acf-block.text-image .expo-button {
    margin-top: 60px;
  }
}
/* An ordinary link uses the theme's grey .readMore link with the arrow. */
.acf-block.text-image .readMore {
  display: inline-block;
  margin-top: 15px;
}

/* "Boka" button on each occasion on the activity page: top right of the
 * text, beside the heading and time (design mockup). The button stays last
 * in the HTML, so screen readers get the heading first; a two-column grid
 * moves it up. The theme sets the text container to inline-block from
 * 700px, so it becomes inline-grid there. */
.occasion .text-container.-has-booking {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 20px;
  align-items: start;
}
@media (min-width: 700px) {
  .occasion .text-container.-has-booking {
    display: inline-grid;
  }
}
/* Below 700px the image is a full-width float. A grid would squeeze in
 * beside it at zero width, so start it below the image instead. */
@media (max-width: 699.98px) {
  .occasion .text-container.-has-booking {
    clear: both;
  }
}
/* Only the heading and time share the row with the button; the text
 * below uses the full width. */
.occasion .text-container.-has-booking > * {
  grid-column: 1 / -1;
  min-width: 0;
}
.occasion .text-container.-has-booking > .header,
.occasion .text-container.-has-booking > .time {
  grid-column: 1;
}
/* "+ Läs mer" is inline-block with an underline; don't stretch it. */
.occasion .text-container.-has-booking > .readMore {
  justify-self: start;
}
.occasion .text-container.-has-booking > .expo-book {
  grid-column: 2;
  grid-row: 1 / span 2;
}

/* Cart bar: printed once at the end of <main> when a voucher or gift card
 * is on the page. Sticky at the bottom, under the header (z-index 100).
 * Green background (the theme's accent) so it stands out from both the
 * #f7f7f7 content and the white footer without a shadow. */
.expo-cart-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  color: #244752;
  background-color: #b4d7a5;
}
/* Full width, with the header's edges instead of the content container's:
 * 40px on the left like the logo, 28px on the right like the burger. */
.expo-cart-bar .container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  width: auto;
  max-width: none;
  padding: 24px 28px 24px 40px;
}
/* 100px high on large screens, content centred. min-height rather than
 * height, so a long bar text that wraps can still make it taller. */
@media (min-width: 1024px) {
  .expo-cart-bar .container {
    min-height: 100px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
}
/* Same button as the header's ticket button: 40px high, square left
 * corners, fully rounded right side; 36px and 14px text below 1024px. */
.expo-cart-bar .expo-button {
  flex: none;
  min-height: 0;
  height: 40px;
  padding: 0 22px 0 16px;
  border: 0;
  border-radius: 0 999px 999px 0;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}
@media (max-width: 1023.98px) {
  .expo-cart-bar .expo-button {
    height: 36px;
    padding: 0 14px 0 10px;
    font-size: 14px;
  }
}
/* The default hover is green, which would vanish on the green bar. */
.expo-cart-bar .expo-button:hover,
.expo-cart-bar .expo-button:focus-visible {
  color: #244752;
  background-color: #fff;
}
.expo-cart-bar .expo-cart-text {
  margin: 0;
  font-weight: 500;
}
@media (max-width: 699.98px) {
  .expo-cart-bar .container {
    justify-content: space-between;
  }
}

/* Preview modal (EXPO_BOOKING_PREVIEW only). The dialog has no padding, so
 * a click on the dialog element itself is a click on the backdrop. */
.expo-booking-preview {
  width: min(625px, 100% - 32px);
  max-width: none;
  padding: 0;
  border: 0;
  color: #244752;
  background-color: #fff;
}
.expo-booking-preview::backdrop {
  background-color: rgba(0, 0, 0, 0.6);
}
.expo-booking-preview .inner {
  position: relative;
  padding: 30px;
}
.expo-booking-preview h2 {
  margin: 0 40px 15px 0;
  font-family: Berlingske Serif, Georgia, serif;
  font-size: 24px;
  line-height: 1.1;
}
.expo-booking-preview p {
  margin: 0 0 15px;
}
.expo-booking-preview dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 5px 15px;
  margin: 0 0 15px;
}
.expo-booking-preview dt {
  font-weight: 500;
}
.expo-booking-preview dd {
  margin: 0;
}
.expo-booking-preview .warning {
  padding: 10px 15px;
  background-color: #f2f2f2;
  border-left: 4px solid #e55d66;
}
.expo-booking-preview .close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 44px;
  height: 44px;
  border: 0;
  font-size: 32px;
  line-height: 1;
  color: #244752;
  background: transparent;
  cursor: pointer;
}
