/* DIALOG BLOCK */

.dialog {
  --dialog-max-w: min(100vw - var(--gutter) * 2, 77rem);
  --dialog-max-h: min(100vh - var(--gutter) * 2, 50rem);
  --dialog-header-h: 4.5rem;
  --dialog-footer-h: 4.5rem;
  --dialog-comments-w: 22.5rem;
  --dialog-background: var(--color-black);
  width: 100%;
  max-width: var(--dialog-max-w);
  height: 100%;
  max-height: var(--dialog-max-h);
  color: var(--color-grey-800);
  border-radius: var(--rounded-2xl);
  overflow: hidden;
  background: var(--dialog-background);
  margin: auto !important;
  left: var(--gutter);
  right: var(--gutter);
}

.dialog.with-dtl {
  --dialog-max-w: min(100vw - var(--gutter) * 2 - 26rem, 77rem);
  margin-right: 30rem !important;
}

/* Header */

.dialog [data-pc-section='header'] {
  height: var(--dialog-header-h);
  padding: 1rem;
  color: var(--color-white);
  background: var(--color-white-10);
  display: flex;
  gap: var(--space-16);
}
@media screen and (max-width: 96rem) {
  .dialog#virtual-sample.with-dtl [data-pc-section='header'] h2 {
    text-align: left;
    left: 27.5rem;
    right: 9.5rem;
  }
}
.dialog:not(#physical-sample) [data-pc-section='header'] h2 {
  font-family: var(--font-serif);
  position: absolute;
  left: 15rem;
  right: 5rem;
  text-align: center;
  line-height: 2.5rem;
  max-height: 1lh;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 auto;
}
.dialog [data-pc-name='pcclosebutton'] {
  color: var(--color-white);
}
.dialog__tabs {
  display: flex;
  gap: var(--space-4);
  background: var(--color-black);
  border-radius: var(--rounded-lg);
  outline: 4px solid var(--color-black);
  position: relative;
  z-index: 10;
}
.dialog__tabs .btn {
  align-items: center;
  font-size: var(--text-md);
}
.dialog__tabs .btn:hover {
  --btn-background: var(--color-white-10);
}
.dialog__tabs .btn[aria-pressed='true'] {
  --btn-background: var(--color-white);
  --btn-color: var(--color-text);
  --btn-border-color: var(--color-white);
}

/* Content */
.dialog__inner {
  padding: var(--space-16);
  background: var(--dialog-inner-background, #f7f7f7);
  height: 100%;
  overflow-y: auto;
}
.with-comments .dialog__inner {
  margin-right: var(--dialog-comments-w, 20rem);
}
.dialog__inner .tracks-header {
  height: 3.625rem;
  background: var(--color-white-50);
  border-radius: var(--rounded-xl);
  padding-inline: var(--space-8);
  border: var(--border-width) solid var(--color-grey-200);
  flex-wrap: nowrap;
  gap: var(--space-8);
  position: sticky;
  top: 0;
  z-index: 1;
}
.dialog__inner .tracks {
  display: flex;
  gap: var(--space-8);
  overflow-x: auto;
  padding: var(--space-8) 1.5rem var(--space-8) var(--space-8);
  margin: calc(-1 * var(--space-8));
  -webkit-mask-image: linear-gradient(
    to left,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 1) 3rem
  );
  mask-image: linear-gradient(to left, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 3rem);
}
/* Windows fix */
[data-browser*='Windows'] .dialog__inner .tracks {
  transform: translateY(0.46875rem); /* 7.5px */
}
.dialog__inner .tracks > *:last-child {
  margin-right: 1rem;
}
.dialog [data-pc-section='content'] [role='tablist'] {
  height: 3.5rem;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin: 0 auto;
  border-bottom: 1px solid var(--color-grey-700);
  padding-top: 7px;
}
.dialog [data-pc-section='content'] [role='tab'] {
  --tab-h: 3rem;
  --tab-min-w: none;
  --tab-py: var(--space-8);
  --tab-px: var(--space-12);
  --tab-border-w: 1px;
  --tab-color: var(--color-grey-400);
  --tab-background: transparent;
  --tab-border-color: transparent;
  position: relative;
  display: flex;
  align-items: center;
  font-size: var(--text-md);
  text-align: center;
  background-color: transparent;
  color: var(--tab-color);
  padding: var(--tab-py) var(--tab-px);
  margin: 0;
  cursor: pointer;
  gap: var(--space-4);
  min-width: var(--tab-min-w);
  height: var(--tab-h);
  border-bottom: var(--tab-border-w) solid var(--tab-border-color);
}
.dialog [data-pc-section='content'] [role='tab'][aria-selected='true'] {
  --tab-border-color: var(--color-white);
  --tab-color: var(--color-white);
}
.dialog [data-pc-section='content'] [role='tab']:focus-visible {
  z-index: 20;
}
.dialog [data-pc-section='content'] [role='tab'] .label {
  flex-grow: 1;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-top: -0.1em;
}

/* Footer */
.dialog [data-pc-section='footer'] {
  display: flex;
  gap: var(--space-16);
  height: var(--dialog-footer-h);
  padding: 1rem;
  background: var(--color-black);
  color: var(--color-white);
}

/* Virtual Sample */
.dialog#virtual-sample {
  --dialog-inner-background: #f7f7f7;
}
.dialog#virtual-sample [data-pc-section='header'] h2 {
  left: 22.5rem;
  right: 22.5rem;
}
.dialog#virtual-sample #comments-container {
  top: var(--dialog-header-h);
}
.dialog#virtual-sample.dynamic #comments-container {
  top: 4.5rem;
}
.dialog#virtual-sample.static #comments-container {
  top: 8rem;
}
.dialog#virtual-sample.static [data-pc-section='footer'] {
  display: none;
}
.dialog#virtual-sample.static .dialog__inner {
  height: calc(100% - 3.5rem) !important;
}

/* Physical Sample */
.dialog#physical-sample {
  --dialog-header-h: 15rem;
  --dialog-background: var(--color-grey-50);
  padding: var(--space-32) var(--space-32) 0;
  overflow-y: auto;
}
.dialog#physical-sample [data-pc-section='header'] {
  display: flex;
  flex-direction: column;
  text-align: center;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: var(--space-32);
  color: var(--color-white);
  background: linear-gradient(
      90deg,
      hsla(0, 0%, 10%, 0.5) 0%,
      hsla(0, 0%, 10%, 0.9) 50%,
      hsla(0, 0%, 10%, 0.9) 100%
    ),
    var(--cover), var(--color-black);
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: var(--rounded-xl);
}
.dialog#physical-sample [data-pc-name='pcclosebutton'] {
  top: var(--space-40);
  right: var(--space-40);
}
.dialog#physical-sample .overflow-y {
  border-radius: var(--rounded-xl) var(--rounded-xl) 0 0;
}
.dialog#physical-sample .masonry > :only-child {
  column-span: initial;
}
@media (min-width: 90rem) {
  .dialog#physical-sample .masonry {
    column-count: 3;
  }
}

/* Project Request Dialog */
#project-request-dialog,
#optimization-request-dialog {
  --dialog-max-w: 704px;
  --dialog-max-h: 712px;
  --dialog-header-h: 6rem;
  --dialog-background: var(--color-white);
  color: var(--color-black);
  align-items: stretch;
  overflow: hidden;
}
#optimization-request-dialog {
  --dialog-max-h: 676px;
  --dialog-header-h: 8rem;
}
#optimization-request-dialog [data-pc-section='header'] {
  flex-direction: column;
  align-items: center;
  gap: 0;
}
#project-request-dialog h2,
#optimization-request-dialog h2 {
  position: static !important;
  color: var(--color-black);
  margin-block: var(--space-16) !important;
}
#project-request-dialog [data-pc-name='pcclosebutton'],
#optimization-request-dialog [data-pc-name='pcclosebutton'] {
  display: none;
}
#project-request-dialog #project-dtl {
  position: relative;
  padding-left: var(--space-64);
}
#project-request-dialog #project-dtl.selected {
  border-color: var(--color-primary-20);
  background-color: var(--color-primary-10);
}
#project-request-dialog #project-dtl input[type='checkbox'] {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--rounded-md);
  position: absolute;
  left: var(--space-12);
}
#optimization-request-dialog select {
  background-image: var(--icon-chevron-single-down-grey);
  background-position: center right 1rem;
  background-repeat: no-repeat;
}
#project-request-dialog [data-icon='leaf'],
#optimization-request-dialog [data-icon='leaf'] {
  --column-gap: var(--space-4);
  padding: 0.25rem var(--space-8) 0.375rem;
  background: var(--color-dtl-15);
  color: var(--color-dtl);
  border-radius: var(--rounded-md);
  line-height: 1;
  font-weight: 500;
}
#project-request-dialog [data-icon='leaf']::before,
#optimization-request-dialog [data-icon='leaf']::before {
  transform: translateY(0.125rem);
}
