/* load google font */
@font-face {
  font-family: 'Xanh Mono';
  src: url(XanhMono-Regular.ttf);
}

/* reset defaults */
* {
  box-sizing: border-box;
  margin: 0;
}

/* css variables */
:root {
  --desktop-color: #ffbef8;
  --desktop-text-color: #ffffff;

  --title-bar-color: #38c6cf;
  --title-bar-text-color: #ffffff;
  --title-bar-highlight-color: #ffbaba;
  --title-bar-height: 32px;

  --pane-content-background-color: rgba(255, 255, 255, 0.37);

  --pane-default-width: 320px;
  --pane-default-height: 360px;
  --pane-border-radius: 8px;
}

body {
  font-family: 'Xanh Mono', monospace;
  background: var(--desktop-color);

  /* if outside of the window, clip */
  height: 100vh;
  overflow: clip;
}

h1 {
  color: var(--desktop-text-color);
  padding: 32px;
  font-size: 1.5rem;
}

.pane {
  position: absolute;
  width: var(--pane-default-width);
  height: var(--pane-default-height);

  display: grid;
  grid-template-rows: var(--title-bar-height) 1fr;

  border-radius: var(--pane-border-radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);

  overflow: clip;

  min-width: 160px;
  min-height: 160px;
}

.pane .title {
  cursor: move;

  display: flex;
  align-items: center;
  justify-content: center;

  background-color: var(--title-bar-color);
  color: var(--title-bar-text-color);
}

.pane h2 {
  font-size: 1rem;
  font-weight: 400;
}

.pane .content {
  position: relative;
  background-color: var(--pane-content-background-color);
}

/* make image fill the space */
.pane .content img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;

  object-fit: cover;

  -webkit-user-drag: none;
  user-drag: none;
}

/* add a corner in bottom right */
.pane .corner {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;

  /* north west to south east */
  cursor: nwse-resize;

  /* background-color: red; */
}

.pane.is-dragging .title {
  background-color: var(--title-bar-highlight-color);
}
