:root {
  --header-background-color: #000000;
  --poster-height: 69vh;
  --poster-width: calc(var(--poster-height) / 1.414141414);
  --poster-margin-top: 11vh;
  --poster-margin-left: calc(50vw - var(--poster-width) / 2 - 1vh);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body,
textarea {
  font-family: 'Helvetica', 'Helvetica Neue', 'Arial', 'Roboto', sans-serif;
  resize: none;
}

/* Layout */
.layout {
  display: grid;
  min-height: 100vh;
  grid-template-rows: min-content auto;
  grid-template-columns: auto auto;
  grid-template-areas: 'logo submit' 'editor editor';
  background-color: var(--header-background-color);
}
.layout-logo {
  padding: 0.5rem 1rem;
  grid-area: logo;
  font-size: 1.6rem;
  font-weight: bold;
  color: #ffffff;
  align-self: center;
}
.layout-submit {
  padding: 0.5rem 1rem;
  grid-area: submit;
  justify-self: end;
  align-self: center;
}
.layout-editor {
  grid-area: editor;
  background-color: #eeeeee;
}

/* Header and footer components */
.btn-submit {
  cursor: pointer;
  display: inline-block;
  min-width: 8rem;
  line-height: 42px;
  font-weight: bold;
  border: 1px solid black;
  border-radius: 4px;
  text-align: center;
  background-color: #ffeb3b;
  color: #000000;
}

/* Editor */
.editor {
  position: relative;
  height: 100%;
  background-image: url('bg.jpg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: auto 100%;
}
.poster {
  position: absolute;
  height: var(--poster-height);
  width: var(--poster-width);
  top: var(--poster-margin-top);
  left: var(--poster-margin-left);
  transform: perspective(100vh) rotateX(3deg);
}

/* Text editor */
.text-editor {
  width: calc(var(--poster-width) - 8vh);
  background: rgba(0, 0, 0, 0);
  border: none;
  outline: none;
  font-weight: bold;
  margin-top: 4vh;
  margin-left: 4vh;
  height: 31vh;
  line-height: 1.2;
  overflow-y: hidden;
}

/* Calendar editor */
.calendar-wrapper {
  height: calc(var(--poster-height) - 31vh - 12vh);
  margin: 4vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar {
  width: 100%;
  display: grid;
  grid-column-gap: 1vh;
  grid-row-gap: 1vh;
}
.circle-wrapper, .circular-outer {
  position: relative;
  padding-top: 100%;
}

.circle {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: #000;
  background-color: #fff;
  border-radius: 50%;
}
.nav-calendar {
  position: absolute;
  top: 60vh;
  left: calc(50vw - 40vh);
  display: flex;
  justify-content: space-between;
  width: 78vh;
}
.prev-calendar {
  cursor: pointer;
  width: 8vh;
  height: 8vh;
  background-image: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='arcs' %3E%3Cpath d='M15 18l-6-6 6-6' /%3E%3C/svg%3E%0A");
}
.next-calendar {
  cursor: pointer;
  width: 8vh;
  height: 8vh;
  background-image: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='arcs' %3E%3Cpath d='M9 18l6-6-6-6' /%3E%3C/svg%3E%0A");
}

/* Popup */
.popup {
  z-index: 1000;
  background-color: rgba(0, 0, 0, 1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  transition: width 0.2s, height 0.2s;
  border-radius: 3vh;
  padding: 0.5vh;
}
.popup-header {
  display: flex;
}
.popup-content {
  opacity: 1;
  transition: opacity 0.2s linear 0.1s;
}
.collapsed .popup-content {
  pointer-events: none;
  opacity: 0;
  transition: none;
}
.popup-open {
  cursor: pointer;
  width: 5vh;
  height: 5vh;
  padding-top: 0;
  background-repeat: no-repeat;
  background-position: center;
}
.popup-close {
  justify-self: end;
  cursor: pointer;
  width: 5vh;
  height: 5vh;
  background-repeat: no-repeat;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='arcs'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
}
.popup-right .popup-header {
  justify-content: flex-end;
}
.popup-content {
  padding: 0 2vh 2vh 2vh;
}
.collapsed {
  height: 6vh;
  width: 6vh;
  background-color: rgba(0, 0, 0, 0.7);
}
.collapsed.popup-left {
  border-radius: 3vh 0 3vh 3vh;
}
.collapsed.popup-right {
  border-radius: 0 3vh 3vh 3vh;
}

.popup-grid {
  display: grid;
  margin-top: 1vh;
  grid-template-columns: repeat(4, 1fr);
  grid-column-gap: 1vh;
  grid-row-gap: 1vh;
}

/* Custom popup dialogs */
.popup-format {
  position: absolute;
  top: 18vh;
  left: calc(var(--poster-margin-left) - 7.5vh);
  color: white;
}
.popup-format.expanded {
  width: 30vh;
  height: 15vh;
}
.popup-format .popup-open {
  /*background-image: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='arcs' %3E%3Cpath d='M13 2H6a2 2 0 0 0-2 2v16c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V9l-7-7z' /%3E%3Cpath d='M13 3v6h6' /%3E%3C/svg%3E%0A");*/
}

.popup-background {
  position: absolute;
  top: 40vh;
  right: calc(100vw - var(--poster-margin-left) - var(--poster-width) - 3.5vh);
  color: white;
}
.popup-background.expanded {
  width: 30vh;
  height: 30vh;
}

.popup-background .popup-open {
  /*background-image: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='square' stroke-linejoin='arcs' %3E%3Crect x='3' y='3' width='18' height='18' rx='2' /%3E%3Ccircle cx='8.5' cy='8.5' r='1.5' /%3E%3Cpath d='M20.4 14.5L16 10 4 20' /%3E%3C/svg%3E%0A");*/
}

/* Mobile */
.mobile-editor {
  display: none;
  height: 100%;
  background-color: #ffffff;
  color: #000000;
}
@media (max-aspect-ratio: 75/100), (max-height: 640px), (max-width: 800px) {
  .layout {
    grid-template-rows: min-content auto min-content;
    grid-template-columns: auto;
    grid-template-areas: 'logo' 'editor' 'submit';
  }
  .editor { display: none; }
  .mobile-editor { display: flex; position: fixed; top: 0; left: 0; bottom: 0; right: 0; align-items: center; justify-content: center; padding: 1rem; }
}


