/* ****************************************************************************
Scaling
**************************************************************************** */
/*
Using a 16:9 aspect ratio, (w x h): 120rem x 67.5rem

How did we calculate this...
initial design done with `:root { font-size: 16px; }` and 1920px x 1080px viewport
(w x h) = (1920 / 16) x (1080 / 16) = 120rem x 67.5rem
*/

:root {
  font-size: 4px; /* 480px x 270px */
}

@media screen and (min-width: 480px) and (min-height: 270px) {
  :root {
    font-size: 4px;
  }
}

@media screen and (min-width: 640px) and (min-height: 360px) {
  :root {
    font-size: calc(640px / 120);
  }
}

@media screen and (min-width: 960px) and (min-height: 540px) {
  :root {
    font-size: 8px;
  }
}

@media screen and (min-width: 1280px) and (min-height: 720px) {
  :root {
    font-size: calc(1280px / 120);
  }
}

@media screen and (min-width: 1920px) and (min-height: 1080px) {
  :root {
    font-size: 16px;
  }
}

@media screen and (min-width: 3840px) and (min-height: 2160px) {
  :root {
    font-size: 32px;
  }
}

@media screen and (min-width: 7680px) and (min-height: 4320px) {
  :root {
    font-size: 64px;
  }
}

/* ****************************************************************************
Global
**************************************************************************** */

html,
body {
  position: relative;
  width: 100%;
  height: 100%;
}

body {
  color: #333;
  margin: 0;
  padding: 0.5rem;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

a {
  color: rgb(0, 100, 200);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: rgb(0, 80, 160);
}

label {
  display: block;
}

input,
button,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  -webkit-padding: 0.4em 0;
  padding: 0.4em;
  margin: 0 0 0.5em 0;
  box-sizing: border-box;
  border: 0.0625rem solid #ccc;
  border-radius: 0.125rem;
}

input:disabled {
  color: #ccc;
}

button {
  color: #333;
  background-color: #f4f4f4;
  outline: none;
}

button:disabled {
  color: #999;
}

button:not(:disabled):active {
  background-color: #ddd;
}

button:focus {
  border-color: #666;
}

/* ****************************************************************************
App
**************************************************************************** */

body {
  margin: 0;
  padding: 0;
}

.app {
  width: 120rem;
  height: 67.5rem;
  background-color: #4c7979;
  overflow: hidden;
}

.overlay {
  position: absolute;
  left: 0;
  top: 0;
  background-color: black;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

.detail {
  width: 100%;
  height: 100%;
}

.player {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: black;
  z-index: 10;
}

.main {
  --drawer-offset: 6.25rem;
  --drawer-width: 31.25rem;
  position: relative;
  width: 100%;
  height: 100%;
}

.drawer {
  display: inline-block;
  width: var(--drawer-offset);
  height: 100%;
  vertical-align: top;
  transform: translateX(calc(-1 * var(--drawer-width) + var(--drawer-offset)));
  transition-property: width, transform;
  transition-duration: 0.2s;
  transition-timing-function: ease-out;
}

.drawer[aria-current] {
  width: var(--drawer-width);
  transform: translateX(0);
}

.browser {
  display: inline-block;
  width: 100%;
  height: 100%;
  --whitespace-px: 0.3em;
  transition-property: max-width;
  transition-duration: 0.2s;
  transition-timing-function: ease-out;
}

.browser[aria-current] {
  max-width: calc(100% - var(--drawer-offset) - var(--whitespace-px));
}

.browser:not([aria-current]) {
  max-width: calc(100% - var(--drawer-width) - var(--whitespace-px));
}

/* ****************************************************************************
Splash Screen
**************************************************************************** */

.splash {
  height: 100%;
  margin-bottom: 15rem;
}

.splash-title {
  color: white;
  font-size: 3.75rem;
  text-align: center;
  margin-top: 40rem;
}

.loader {
  position: relative;
  left: 50%;
  top: 50%;
  width: 20rem;
  height: 20rem;
  margin: -14.2rem 0 0 -13.2rem;
  border: 3rem solid #f3f3f3;
  border-radius: 50%;
  border-top: 3rem solid #3498db;
  -webkit-animation: spin 2s linear infinite;
  animation: spin 2s linear infinite;
}

@-webkit-keyframes spin {
  0% {
      -webkit-transform: rotate(0deg);
  }
  100% {
      -webkit-transform: rotate(360deg);
  }
}

@keyframes spin {
  0% {
      transform: rotate(0deg);
  }
  100% {
      transform: rotate(360deg);
  }
}

/* ****************************************************************************
Drawer
**************************************************************************** */

.drawer-drawer {
  width: var(--drawer-width);
  height: 100%;
  background-color: teal;
}

.drawer-title {
  font-size: 3.625rem;
  text-align: center;
  line-height: 6.25rem;
  padding-top: 6.25rem;
}

.drawer-buttons {
  width: 18.75rem;
  margin: 0 auto;
}

.drawer-button {
  margin-bottom: 1.25rem;
  background-color: #55c9c9;
  color: white;
  font-size: 2rem;
  text-align: center;
  line-height: 4.375rem;
}

.drawer-button[aria-current] {
  background-color: blanchedalmond;
  color: black;
}

/* ****************************************************************************
Browser
**************************************************************************** */

.browser-header {
  /* doesn't re-align when drawer open */
  /* position: relative; */
  /* left: 81.3125rem; */
  /*  */
  line-height: 11.25rem;
  color: white;
  font-size: 3.75rem;
  /* content flash */
  text-align: right;
  margin-right: 5.0625rem;
  /*  */
  margin-top: 1.25rem;
}

.browser-header > span {
  font-size: 2rem;
  color: rgb(54, 88, 88);
}

.browser-carousels {
  /* 100vh = 1147, 100% = 1162 */
  height: calc(100vh - 12.5rem);
  overflow: hidden;
}

.carousel-wrapper {
  position: absolute;
  width: 100%;
}

.browser-carousels .carousel-wrapper:last-child {
  min-height: 200vh;
}

.browser-alert-error {
  color: red;
}

.browser p {
  color: white;
}

/* ****************************************************************************
Carousel
**************************************************************************** */

.carousel {
  overflow: hidden;
  height: 23.75rem;
  margin: 1.25rem 0;
  padding-left: 0.625rem;
  /* want to see bit of previous item... */
  /* padding-left: 1.25rem; */
}

.carousel-item-wrapper {
  display: block;
  position: absolute;
  height: 23.75rem;
  width: 12.5rem;
  margin: 0 0.625rem;
}

/* ****************************************************************************
Item
**************************************************************************** */

.item {
  width: 12.5rem;
  height: 23.75rem;
  background-color: #1c1c1c;
}

.item[aria-current] {
  background-color: white;
}

.item-poster {
  position: relative;
  width: 12.5rem;
  height: 18.75rem;
}

.item-runtime {
  position: absolute;
  width: max-content;
  top: 14.5rem;
  left: 6.6rem;
  font-size: 1.25rem;
  --opacity: 0.85;
  color: rgba(255, 255, 255, var(--opacity));
  background-color: rgba(28, 28, 28, 0.65);
  opacity: var(--opacity);
  border: 0.625rem solid rgba(28, 28, 28, var(--opacity));
}

.item-runtime[aria-selected] {
  background-color: rgba(28, 28, 28, var(--opacity));
  border-color: rgb(0, 0, 0);
}

.item img {
  margin: auto;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-description {
  padding: 0.625rem;
  color: white;
}

.item[aria-current] .item-description {
  color: black;
}

.item-name {
  font-weight: 800;
  font-size: larger;
}

.item-rating {
  font-weight: 500;
}

/* ****************************************************************************
Lazy
**************************************************************************** */

.lazy {
  width: 100%;
  height: 100%;
}

/* ****************************************************************************
Detail
**************************************************************************** */

.detail section {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  color: white;
}

.detail-preview,
.detail-detail {
  height: calc((100% - 4rem) / 2);
  max-height: calc((100% - 4rem) / 2);
}

.detail-preview img {
  width: 100%;
  object-fit: cover;
  object-position: top;
}

.detail-action-bar {
  height: 4rem;
  background-color: #008291;
  display: flex;
}

.detail-action-bar-buttons {
  display: flex;
}

.detail-detail {
  display: flex;
}

.detail-poster {
  height: 100%;
  padding-right: 1.5rem;
  margin-left: auto;
  transform: translateY(-50%);
}

.detail-poster img {
  border-radius: 0.25rem;
  border: 0.0625rem solid rgba(255, 255, 255, 0.5);
  box-shadow: lightgrey;
}

.detail-name {
  margin-top: 1.5rem;
  margin-block-end: 0rem;
  font-weight: 700;
  font-size: 1.5rem;
}

.detail-tagline {
  /* margin-top: 0.25rem; */
  margin-block-start: 0.25rem;
  margin-block-end: 0.5rem;
  font-size: 1.35rem;
  font-weight: 300;
}

.detail-details {
  margin-top: 1rem;
  font-weight: 300;
}

.detail-length {
  margin-right: 0.5rem;
}

.detail-description {
  margin-top: 1rem;
  padding-right: 6rem;
  font-size: 1.25rem;
  font-weight: 300;
  max-width: 50rem;
}

.detail img {
  display: block;
  margin: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.detail button {
  margin-top: auto;
  margin-bottom: auto;
  margin-right: 1rem;
  padding: 0.5rem 1rem;
  background-color: #55c9c9;
  color: white;
  font-size: 1.125rem;
  text-align: center;
}

.detail button[aria-current] {
  background-color: blanchedalmond;
  color: black;
}

.detail-outline {
  border-width: 0.0625rem;
  border-radius: 0.25rem;
  border-style: solid;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

/* ****************************************************************************
Player
**************************************************************************** */

.player iframe,
.player video {
  position: absolute;
  width: 100vw;
  height: 100vh;
}

/* ****************************************************************************
Transform
**************************************************************************** */

.transform {
  white-space: nowrap;
  position: relative;
}

/* ****************************************************************************
Utilities
**************************************************************************** */

.w-1\/3 {
  width: 33.333333%;
}

.w-2\/3 {
  width: 66.666667%;
}

.w-5\/6 {
  width: 83.333333%;
}

.hidden {
  display: none;
}
