/* ==================================================================
   JUSTPIXEL SOFTWARE LIBRARY
   HTML / CSS VISUALISER
   ================================================================== */

.jp-html-css-visualiser {
  display: grid;

  gap: var(--jp-space-4);
}

/* ==================================================================
   TOOLBAR
   ================================================================== */

.jp-html-css-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;

  gap: var(--jp-space-2);
}

/* ==================================================================
   WORKSPACE
   ================================================================== */

.jp-html-css-workspace {
  display: grid;

  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);

  gap: var(--jp-space-5);

  align-items: stretch;
}

.jp-html-css-editors {
  display: grid;

  grid-template-rows: repeat(2, minmax(0, 1fr));

  gap: var(--jp-space-4);

  min-width: 0;
}

.jp-html-css-panel,
.jp-html-css-preview-panel {
  min-width: 0;
}

.jp-html-css-panel {
  display: flex;
  flex-direction: column;
}

.jp-html-css-panel .jp-tool-panel-header {
  margin-bottom: var(--jp-space-3);
}

/* ==================================================================
   EDITORS
   ================================================================== */

.jp-html-css-input {
  flex: 1;

  min-height: 210px;

  height: clamp(210px, 29vh, 300px);

  resize: vertical;

  font-size: var(--jp-text-sm);

  line-height: var(--jp-leading-relaxed);

  tab-size: 2;
}

/* ==================================================================
   PREVIEW
   ================================================================== */

.jp-html-css-preview-panel {
  display: flex;
  flex-direction: column;
}

.jp-html-css-preview-shell {
  flex: 1;

  min-height: 0;

  overflow: hidden;

  border: 1px solid var(--jp-border);
  border-radius: var(--jp-radius-sm);

  background: var(--jp-surface-soft);
}

.jp-html-css-preview {
  display: block;

  width: 100%;

  height: clamp(460px, 63vh, 640px);

  border: 0;

  background: #ffffff;
}

.jp-html-css-status {
  flex-shrink: 0;

  color: var(--jp-text-soft);

  font-size: var(--jp-text-xs);
  font-weight: var(--jp-weight-medium);
}

/* ==================================================================
   TABLET
   ================================================================== */

@media (max-width: 960px) {
  .jp-html-css-workspace {
    grid-template-columns: 1fr;
  }

  .jp-html-css-editors {
    grid-template-columns: repeat(2, minmax(0, 1fr));

    grid-template-rows: none;
  }

  .jp-html-css-input {
    height: 280px;
  }

  .jp-html-css-preview {
    height: 430px;
  }
}

/* ==================================================================
   MOBILE
   ================================================================== */

@media (max-width: 700px) {
  .jp-html-css-toolbar {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jp-html-css-editors {
    grid-template-columns: 1fr;
  }

  .jp-html-css-input {
    min-height: 230px;

    height: 260px;
  }

  .jp-html-css-preview {
    height: 380px;
  }
}

@media (max-width: 480px) {
  .jp-html-css-toolbar {
    grid-template-columns: 1fr;
  }

  .jp-html-css-preview {
    height: 340px;
  }
}
