/* Shared partner dialog for both carousels and the partner directory. */
body:has(#partner-dialog[open]) {
  overflow: hidden;
}

dialog {
  color: var(--white);
  border: 1px solid #ffffff26;
  padding: 0;
  width: min(1000px,calc(100% - 64px));
  max-height: calc(100svh - 64px);
  margin: auto;
  background: #080607;
  overflow: auto;
  box-shadow: 0 40px 140px #000b;
}

dialog::backdrop {
  background: #02050ce6;
  backdrop-filter: blur(10px);
}

dialog[open] {
  animation: modal-in .55s cubic-bezier(.16,1,.3,1) both;
}

dialog[open]::backdrop {
  animation: fade-in .3s both;
}

dialog.is-closing {
  animation: modal-out .2s ease-in both;
}

.modal-layout {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  min-height: 540px;
}

.modal-visual {
  display: flex;
  flex-direction: column;
  background: #fff;
  position: relative;
}

.modal-logo {
  height: 235px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 45px;
}

.modal-logo img {
  max-width: 90%;
  max-height: 145px;
  object-fit: contain;
}

.modal-photo {
  margin: 0;
  position: relative;
  flex: 1;
  min-height: 240px;
  background: var(--navy);
  overflow: hidden;
}

.modal-photo img {
  width: 100%;
  height: 100%;
  position: absolute;
  object-fit: cover;
  object-position: 45% 35%;
}

.modal-photo figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 45px 20px 15px;
  background: linear-gradient(transparent,#080b13d9);
  color: #fff;
  font-size: 8px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.modal-copy {
  padding: 70px 44px 35px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  background: linear-gradient(145deg,#160609eb,#050506e8),url('assets/webp/pdf--racing-background.webp') center/cover;
}

.modal-copy:before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg,var(--red) 80%,var(--fluo) 80%);
}

.modal-copy .kicker {
  font-size: 9px;
  letter-spacing: .12em;
}

.modal-copy h2 {
  font: italic 900 clamp(30px,4vw,50px)/1.05 var(--display);
  letter-spacing: -.03em;
  margin-bottom: 25px;
}

.modal-description {
  font-size: 14px;
  line-height: 1.85;
  color: #b8c1cf;
  margin-bottom: 28px;
}

.modal-copy .btn {
  font-size: 12px;
  padding: 17px 22px;
  gap: 20px;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff32;
  background: #080b13;
  color: white;
}

.modal-close:hover {
  background: var(--red);
}

.modal-close svg {
  width: 19px;
}

.modal-copy [hidden] {
  display: none;
}

@keyframes modal-in {

from{opacity:0;transform:translate(65px,65px) rotate(5deg) scale(.94)}to{opacity:1;transform:none}

}

@keyframes modal-out {

to{opacity:0;transform:translate(22px,22px) rotate(2deg) scale(.98)}

}

@keyframes fade-in {

from{opacity:0}to{opacity:1}

}

@media(max-width:1050px) {
  .modal-copy {
    padding-inline: 30px;
  }
}

@media(max-width:760px) {
  dialog {
    width: calc(100% - 28px);
    max-height: calc(100svh - 28px);
  }
}

@media(max-width:760px) {
  .modal-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

@media(max-width:760px) {
  .modal-logo {
    height: 160px;
    padding: 35px;
  }
}

@media(max-width:760px) {
  .modal-logo img {
    max-height: 100px;
    max-width: 75%;
  }
}

@media(max-width:760px) {
  .modal-photo {
    display: none;
  }
}

@media(max-width:760px) {
  .modal-copy {
    padding: 32px 25px 25px;
  }
}

@media(max-width:760px) {
  .modal-copy h2 {
    font-size: 35px;
    margin-bottom: 18px;
  }
}

@media(max-width:760px) {
  .modal-description {
    font-size: 13px;
    line-height: 1.7;
  }
}

@media(max-width:760px) {
  .modal-close {
    background: #080b13;
  }
}

@media(max-width:760px) {
  .modal-copy .btn {
    align-self: center;
  }
}

@media(max-width:760px) {
  .modal-copy .kicker {
    font-size: 8px;
  }
}

@media(max-width:760px) {
  .modal-copy .kicker:before {
    width: 20px;
  }
}

@media(max-width:400px) {
  .modal-copy .btn {
    white-space: normal;
  }
}

.modal-copy>.btn {
  align-self: flex-end;
}

/* Shared typography is explicit so the home page and directory render identically. */
.modal-copy { font: 400 15px/1.7 var(--body); }
.modal-copy .kicker { display: flex; align-items: center; gap: 14px; font: 600 9px/1.7 var(--body); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 24px; }
.modal-copy .kicker:before { content: ''; width: 30px; height: 3px; flex: none; background: var(--red); }
.modal-copy h2 { text-transform: none; margin-top: 0; }
.modal-photo figcaption { font: 400 8px/1.7 var(--body); letter-spacing: .1em; }
@media(max-width:760px) { .modal-copy .kicker { font-size: 8px; } .modal-copy .kicker:before { width: 20px; } }
@media(prefers-reduced-motion:reduce) { #partner-dialog, #partner-dialog::backdrop { animation: none !important; transition: none !important; } }

/* SVGs keep their intended icon size even on pages without directory base styles. */
.modal-copy .btn svg { width: 24px; height: 24px; flex: none; }
.modal-close svg { width: 19px; height: 19px; }
.modal-copy .btn { white-space: nowrap; }
@media(max-width:400px) { .modal-copy .btn { white-space: normal; } }
