/* Modal & swiper CSS 
 * Last update : 6.8.26
*/

/* swiper hero */
.swiper-button-prev::after,
.swiper-rtl .swiper-button-next::after,
.swiper-button-next::after,
.swiper-rtl .swiper-button-prev::after {
	color: var(--color-light);
	font-size: 1.3rem !important;
}
.swiper-button-prev,
.swiper-button-next {
	background: transparent;
	border: 0;
	cursor: pointer;
}
.hero .swiper-slide-duplicate {
	display: none !important;
}

/* minislider */
.media-mini-slider .swiper {
	width: 100%;
	position: relative;
}
.media-mini-slider .swiper .swiper-wrapper {
	transition-timing-function: linear;
}

/* mini logos */
.media-mini-slider .swiper-minislider-logos .swiper-wrapper {
	align-items: center;
}
.media-mini-slider .swiper-minislider-logos  .swiper-button-next-mini,
.media-mini-slider .swiper-minislider-logos  .swiper-button-prev-mini {
  display: none;
}

/* nav */
.swiper-button-prev-mini {
	left: 5%;
}
.swiper-button-next-mini {
	right: 5%;
}
.media-mini-slider .swiper-button-next-mini {
  right: 0;
  left: auto;
}
.media-mini-slider .swiper-button-prev-mini {
	left: 0;
  right: auto;
}
.media-mini-slider .swiper-button-next-mini,
.media-mini-slider .swiper-button-prev-mini {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary);
  border: 0;
  color: var(--color-main);
  padding: 0.5rem;
  z-index: 10;
  border-radius: 40px 40px 0 0;
  cursor: pointer;
}
.media-mini-slider .swiper-button-next-mini {
  right: 0;
  border-radius: 40px 0 0 40px; /* left half-circle */
}
.media-mini-slider .swiper-button-prev-mini {
  left: 0;
  border-radius: 0 40px 40px 0; /* right half-circle */
}
.media-mini-slider .swiper-button-next-mini::after {
	content: 'next';
	padding-left: 0.5rem;
}
.media-mini-slider .swiper-button-prev-mini::after {
	content: 'prev';
	padding-right: 0.5rem;
}
.media-mini-slider .swiper-button-next-mini::after,
.media-mini-slider .swiper-button-prev-mini::after {
  color: var(--color-light);
	font-size: 1.2rem !important;
  font-family: swiper-icons;
  text-transform: none !important;
  font-weight: var(--fw-bold);
  letter-spacing: 0;
  font-variant: initial;
  line-height: 1;
}

.swiper-pagination {
	z-index: 5 !important;
}
.swiper-pagination-bullet-active {
	background: var(--color-light) !important;
}
.swiper-wrapper.disabled {
  transform: translate3d(0px, 0, 0) !important;
}
.swiper-wrapper.disabled .swiper-slide {
	transition: none !important;
}
.swiper-button-lock,
.swiper-button-disabled,
.swiper-pagination.disabled,
.swiper-button-prev.disabled,
.swiper-button-next.disabled {
	display: none !important;
}

/* MODAL */

/* ── What scrolls, and what does not ──────────────────────────
   The browser sets `overflow: auto` on <dialog>, so the dialog was the
   scrolling container - and a scrolling container clips whatever leaves its
   box, starting with a close button hung outside the corner.

   Inverted here: the dialog no longer scrolls (overflow visible, bounded
   height), .form-box inside does. */

dialog.modal-form {
	width: calc(100% - 2rem);
	max-width: 800px;
	max-height: calc(100vh - 4rem);
	overflow: visible;
	background-color: transparent;
	border: none;
	padding: 0;
	position: relative;
}

/* ⚠️ Scoped to [open]: without it, `display: flex` would override the
   `display: none` the browser puts on a closed dialog, and the modal would be
   permanently visible on all three sites. */
dialog.modal-form[open] {
	display: flex;
	flex-flow: column;
}

/* The page no longer scrolls behind the modal. `showModal()` raises the dialog
   to the top layer but does **not** block document scrolling: the page slid
   behind it, the modal ran off screen, and the pointer had to come back onto
   it to scroll it. */
html:has(dialog.modal-form[open]) {
	overflow: hidden;
}

dialog.modal-form::backdrop {
	background-color: rgba(0, 0, 0, 0.75);
	animation: modal-backdrop-in 0.3s ease forwards;
}
@keyframes modal-backdrop-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.modal-form .form-box {
	/* This is what scrolls now. min-height: 0 is required: a flex child refuses by
	   default to shrink below its content height, so internal scrolling would
	   never trigger. */
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 2rem;
	background-color: var(--color-light);
}

/* Outside, on the backdrop - its original place. Nothing clips it any more, and
   placed on the dialog rather than on .form-box it stays put while the form
   scrolls. */
.modal-close {
	position: absolute;
	top: -15px;
	right: -15px;
	z-index: 1;
	background-color: var(--color-primary);
	border: none;
	border-radius: var(--br-round);
	width: 30px;
	height: 30px;
	color: var(--color-light);
	font-size: 1.2rem;
	line-height: 1;
	padding: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	text-transform: uppercase;
}
