/* Reset Defaults */

:root {
  --typescale: 1.333;
  --type-step-5: calc(1rem * pow(var(--typescale), 5));
  --type-step-4: calc(1rem * pow(var(--typescale), 4));
  --type-step-3: calc(1rem * pow(var(--typescale), 3));
  --type-step-2: calc(1rem * pow(var(--typescale), 2));
  --type-step-1: calc(1rem * pow(var(--typescale), 1));
  --type-step-0: 1rem;
  --type-step--1: .75rem;
  --page-gutter: 8vw;
  --max-content-width: 33rem;

  line-height: 1.6;
}

* {
  padding: 0;
  margin: 0;
  background-repeat: no-repeat;
  box-sizing: border-box;
}

html {
  font-size: calc(100% + .33vw);
}

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

@view-transition {
  navigation: auto;
}

.sr-only {
  left:-9999rem;
  top:auto;
  width:1px;
  height:1px;
  overflow: hidden;
  position: absolute;
}

body {
  font-family: "futura-pt", sans-serif;
  font-weight: 300;
  background: hsla(240,27%,5%,1);
  color: #fff;

  > * {
    padding-inline: var(--page-gutter);
    padding-block: 3rlh;
  }
}

a {
  color: inherit;
  transition: all .2s ease-in-out;
  text-underline-offset: .15rlh;
  text-decoration-thickness: 1px;
  text-decoration-color: hsla(240,47%,90%,.3);

  &:hover {
    text-decoration-color: hsla(240,47%,90%,.9);
  }

}

h1, h2, h3, h4 {
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  text-wrap: balance;

  span {
    font-weight: 300;
  }
}

h1 {
  font-size: var(--type-step-2);
  line-height: 1;
  text-align: center;
  font-weight: 600;
}

/* h2 {
  font-size: var(--type-step-1);
  line-height: 1.3;
  font-weight: 400;
} */

h2, h3 {
  font-size: var(--type-step-0);
  line-height: 1.3;
  font-weight: 400;
  a {
    font-weight: 600;
  }
}

h4, cite {
  font-size: var(--type-step--1);
  letter-spacing: 0.05rem;
  font-weight: 400;
}

p {
  max-inline-size: var(--max-content-width);
}

.balance {
  text-wrap: balance;
}

blockquote {
  p {
    text-indent: -.5ch;
    font-size: var(--type-step-1);
    text-wrap: balance;

    &:before {
      content: open-quote;
    }

    &:after {
      content: close-quote;
    }
  }
}

nav {
  text-transform: uppercase;

  ul {
    list-style-type: none;
  }

  li {
    padding-block: .2rlh;
  }

  .logo {
    color: #DECFB3;
  }

  &.main {
    grid-row: 1;
    grid-column: 1;
    z-index: 3;
    position: relative;
    padding-block: unset;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    column-gap:2rlh;
    row-gap: .5rlh;
    margin-block-start: .5rlh;
    padding-inline: var(--page-gutter);

    ul {
      display: flex;
      flex-wrap: wrap;
      column-gap: 1rlh;
    }

    a {
      text-decoration: none;
      /* padding-inline: .2rlh; */
      color: #DECFB3;
      font-weight: 400;

      &:hover {
        text-decoration: underline;
        text-decoration-color: #DECFB3;
      }
    }
  }
}

.template-home nav.main ul li:first-of-type a,
nav.main ul a.active {
  font-weight: 600;
  border-bottom: 1px solid #DECFB3;
  color: #fff;
}

ol.tracklist {
  padding-inline-start: 1.5ch;
}

header.bkgd {
  overflow: hidden;
  max-inline-size: unset;
  padding: 0;
  position: relative;
  height: 77vh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 16vh 1fr;
  margin-block-start: -2rlh;

  + main {
    margin-block-start: -20vh;
    position: relative;
    z-index: 3;
  }

  /* In z-index order  */

  video, figure, .cinema {
    grid-column: 1;
    grid-row: 1/span 2;
    z-index: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
    opacity: 0.6;

    source, img {
        object-fit: cover;
        width:100%;
        height:100%;
    }
  }

  .cinema {
    opacity: 1;
    transition: all 0.6s ease;

    &.cinema-active {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: black;
      z-index: 100;
      opacity: 0;
      pointer-events: none;
      object-fit: contain;
    }

    &.cinema-active.show {
      opacity: 1;
      pointer-events: auto;
    }
  }


    button {
        /* background: hsla(240,27%,5%,.3); */
        border-radius: 6rlh;
        padding: .5rlh;
        cursor: pointer;
        transition: all 0.3s ease-in-out;
        display: flex;
        align-items: center;
        justify-content: center;
        /* box-shadow: 0 4px 20px rgba(0,0,0,0.3); */

        svg {
          transition: all 0.3s ease-in-out;
        }
      }

      .play-btn {
          position: absolute;
          left: calc(50% - 1.5rlh);
          top: calc(50% - 1.5rlh);
          z-index: 1;

          svg{
            width: 2rlh;
            height: 2rlh;
          }

          &:hover {
            background: hsla(240,27%,5%,1);
          }
        }

      .close-btn {
        position: fixed;
        background: hsla(240,27%,5%,.8);
        top: 1rem;
        right: 1rem;
        z-index: 1000;
        align-items: center;
        justify-content: center;
        color: #fff;

        &.hidden {
          opacity: 0;
          pointer-events: none;
          z-index: -1;
          color: transparent;
        }

        svg {
          width: 1rem;
          height: 1rem;
        }

        &.active {
          opacity: 1;
          pointer-events: unset;
          cursor: pointer;
        }
      }

  /* If video is present, hide the image */

  video + figure {
    display: none;
  }

  .fade {
    grid-column: 1;
    grid-row: 1/span 2;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, hsla(240,27%,5%,1) 0%,  hsla(240,27%,5%,0) 15%,hsla(240,27%,5%,0) 70%, hsla(240,27%,5%,1) 95%);
  }


  > h1  {
    grid-column: 1;
    grid-row: 2;
    z-index: 2;
    height: 50%;
    display:flex;
    gap: .5ch;
    place-content: center;
    flex-wrap: wrap;
    padding-inline: 1rlh;
    text-shadow: 0 0px 48px hsla(240,27%,5%,0.75);
    pointer-events: none;
  }
}

/* Hide video loops if… */

@media (prefers-reduced-motion: reduce) {
  header.bkgd {
    video:not(.cinema-active.show), iframe {
      display: none;

      /* If video is hidden, show the image instead */
      + figure {
        display: block;
      }
    }
  }
}

.template-song,  .template-album  {
  header.bkgd {
    figure {
      opacity: 0.3;
    }
    .fade {
      background: linear-gradient(180deg, rgba(4, 4, 7, 0) 40%, rgba(4, 4, 7, .95) 95%);
    }

  }
}

.caption {
  opacity: .7;
  display: flex;
  justify-content: center;
  font-size: var(--type-step--1);
  text-align: center;
  text-wrap: balance;
}

figcaption {
  margin-block-start: .5rlh;
  opacity: .6;
  font-size: var(--type-step--1);
}

::marker {
  color: hsla(240,47%,90%,.5)
}

.flow {
  > * + * {
    margin-block-start: 1rlh;
  }
  &.large > * + * {
    margin-block-start: 3rlh;
  }
  &.small > * + * {
    margin-block-start: .5rlh;
  }

  > h3+* {
    margin-block-start: .25rlh;
  }
}

.flex {
  display: flex;
  flex-wrap: wrap;
  gap: .5rlh;

  &.small {
    gap: .25rlh;
  }

  &.align-c {
    align-items: center;
  }

  &.justify-c {
    justify-content: center;
  }

  &.column {
    flex-direction: column;
  }

  &.flex-content {
    gap: 3vw;
    > * {
      flex: 1 0 min(30ch);
    }
  }

  &.prev-next {
    gap: 3vw;
    justify-content: space-between;
    border-block-start: 1px solid hsla(240,47%,90%,.3);
    padding-block-start: 1rlh;
    margin-block-start: 3rlh;

    > * {
      flex: 1 1 min(24ch);
    }

    > *:last-child {
      display: flex;
      justify-content: end;
    }

  }

  &.list-with-cover {
    gap: 3vw;
    /* justify-content: space-between; */

    > *:first-child {
      flex: 3 0;
      min-inline-size: 20rem;
    }
    > *:last-child {
      flex: 1 0;
      /* min-inline-size: 12rem; */
    }
  }
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 3vw;
  row-gap: 1rlh;
}

@media screen and (max-width: 49rem) {
  .main-grid {
    > * {
      width: 100%;
      max-inline-size: var(--max-content-width);
    }
  }
}

@media screen and (min-width: 50rem) {
  .main-grid {
    grid-template-columns:  8rem
                            /* minmax(20ch,var(--max-content-width)) */
                            1fr
                            8rem;

    > h2, > h3, .intro, .download  {
      grid-column: 1;
    }

    > * {
      grid-column: 2/ span 2;
      grid-column: 2;
    }

    .wide,
    .list-with-cover,
    .card-grid,
    .form {
      grid-column: 2/ span 2;
    }
  }
}

.center {
 max-inline-size: var(--max-content-width);
 margin-inline: auto;
}

.video {
  width: 100%;
  aspect-ratio: 16/9;
  height: 100%;
}

nav {
  container-name: cards;
  container-type: inline-size;
}

.card-grid {
  display: grid;
  column-gap: 3vw;
  row-gap: 2rlh;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));

  &.large {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  }

  a {
    display: flex;
    flex-direction: column;
    /* gap: .5rlh; */
    text-decoration: none;
    background: hsla(240,47%,90%,.02);
    outline: 1px solid hsla(240,47%,90%,.1);
    height: 100%;
    border-radius: 3px;

    > div {
      padding: .5rlh;
    }


    &:hover, &:focus {
      transform: scale(1.05) translateY(-.25rlh);
      box-shadow: 0 2px 48px 24px rgba(0,0,0,0.5);
      z-index: 1;
      background: hsla(240,47%,90%,.2);
      outline: 2px solid hsla(240,47%,90%,.2);
    }
  }

  h4 {
    opacity: .6;
  }

  span {
    display: block;
  }

  &.gallery {

    img {
      outline: 1px solid hsla(240,47%,90%,.1);
      transition: all .2s ease-in-out;

      &:hover {
        outline: 1px solid hsla(240,47%,90%,.2);
      }
    }
  }
}

/* Landscape mode for cards */
@container cards (max-width: 500px) {

  .card-grid {
    grid-template-columns: 1fr;
    row-gap: .5rlh;

    a {
      flex-direction: row;
      align-items: stretch;

      figure  {
        flex: 0 0 4rlh;
        min-height: 4rlh;

        img {
          contain: size;
          object-fit: cover;
          width: 100%;
          height: 100%;
        }
      }
    }
  }

}


.setlist {
  list-style-type: none;
  margin-block-start: .5rlh;

  li {
    counter-increment: list-item;
    padding: .25rlh .5rlh;
    display: grid;
    grid-template-columns:
        2ch /* Now playing icon */
        1fr  /* Track title */
        calc(20px + 4ch); /* Info */
    align-items: baseline;
    gap: .5rlh;
    transition: all .4s ease-in-out;
    border-radius: 3px;

    .track-number {
      display: grid;
      grid-template-columns: 1fr;

      &:before{
        grid-column: 1;
        grid-row: 1;
        z-index: 1;
        content:counter(list-item);
        font-variant-numeric: tabular-nums;
        opacity: 0.5;
        transition: all .3s ease-in-out;
      }

      .now-playing {
        opacity: 0;
        grid-column: 1;
        grid-row: 1;
        transition: all .3s ease-in-out;
        margin-inline-start: -3px;
      }
    }

    .now-playing {
      transition: opacity .2s ease-in-out;
    }

    &.playing {
      background: hsla(240,47%,90%,.3);

      .track-number:before {
        opacity: 0;
        z-index: 0;
      }

      .now-playing {
        opacity: 1;
        z-index: 1;
      }

    }

    .info {
      opacity: 0.6;
      display: flex;
      align-items: center;
      gap: 1ch;
      text-decoration: none;

      &:hover {
        text-decoration: underline;
      }

      span {
        text-transform: capitalize;
        letter-spacing: 0;
        opacity: 0;
      }
    }

    &:hover, &:focus, &:active {
      background: hsla(240,47%,90%,.16);

      .info {
        opacity: 1;
        span {
          opacity: 1;
        }
      }
    }

    audio {
      height: 2rlh;
    }

  }
}

button {
  border: none;
  font-family: "futura-pt", sans-serif;
  font-size: 1rem;
  color: #fff;
  background-color: transparent;
  padding: .5rlh;
  border-radius: 3px;
  transition: all .2s ease-in-out;
  display: flex;
  flex-wrap: wrap;
  gap: .5ch;
  justify-content: center;
  align-items: center;
  cursor: pointer;

  svg {
    width: 22px;
    height: 22px;
    opacity: .8;
  }

  &[disabled] {
    opacity: 0.5;
    pointer-events: none;
  }

  &:hover {
    background-color: hsla(240,47%,90%,.3);

    svg {
      opacity: 1;
    }
  }

  &.track-title {
    justify-content: start;
    text-transform: uppercase;
    letter-spacing: 0.025rem;
    padding: 0;
    text-align: left;
    text-decoration-color: hsla(240,47%,90%,.3);

    span {
      text-transform: capitalize;
      font-weight: 300;
    }

    &:hover {
      background: none;
      text-decoration: underline;
      text-underline-offset: .1rlh;
      text-decoration-color: hsla(240,47%,90%,.4);
    }
  }
}

.setlist-header {
  /* display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between; */
  border-block-end: 1px solid hsla(240,47%,90%,.3);
  padding-block-end: .25rlh
}

.player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .2rlh;
  align-items: center;

  button {
    aspect-ratio: 1/1;
  }

  #scrubber {
    flex: 1;
    /* margin-inline: 1rlh; */
  }
}

#timeDisplay {
  font-family: sans-serif;
  font-variant-numeric: tabular-nums;
  opacity: .8;
  padding-inline-start: 1rlh;
  font-size: .875rem;
}

.download-show {
  gap: 0;
  background: hsla(240,47%,90%,.1);
  text-decoration: none;
  outline: 1px solid hsla(240,47%,90%,.1);
  border-radius: 3px;
  overflow: hidden;
  text-wrap: balance;

  p {
    padding: .5rlh;
    align-items: center;
  }

  &:hover {
    background: hsla(240,47%,90%,.2);
    outline: 1px solid hsla(240,47%,90%,.2);
    transform: scale(1.05) translateY(-.25rlh);
    box-shadow: 0 2px 48px 24px rgba(0,0,0,0.5);
    z-index: 1;
  }
}


/* Hide audio if script loads */
.js .setlist audio {
  display: none;
}

/* Comments */

input, textarea {
  font-family: "futura-pt", sans-serif;
  line-height: 1.6;
}

summary {
  cursor: pointer;
}

#kommentform {
  label {
    display: block;
  }
  textarea,
  input[type="text"],
  input[type="email"],
  input[type="url"] {
    background: hsla(240,47%,90%,.1);
    border: 1px solid hsla(240,47%,90%,.4);
    padding: .5rlh;
    font-size: 1rem;
    color: #fff;
    border-radius: 3px;
  }

  input[type="submit"] {
    text-transform: uppercase;
    font-weight: 700;
    border-radius: 3px;
    border: 1px solid transparent;
    padding: .5rlh;
    font-size: 1rem;
    letter-spacing: 0.02rem;


    &:focus {
      border: 1px solid yellow;
    }
  }
}

.list-comments {
  list-style-type: none;

  li {

    .p-author {
      text-transform: uppercase;
      letter-spacing: 0.05rem;
    }

    .p-content {
      padding-left: 2rlh;
      margin-block: -.25rlh .5rlh;
    }

    a.u-url, a.kommentReply {
      font-size: var(--type-step--1);
      opacity: .6;
      text-transform: uppercase;
      letter-spacing: 0.05rem;

      &:hover {
        opacity: 1;
      }
    }



    header {
      display: flex;
      align-items: center;
      gap: .5rlh;

      img {
        border-radius: .75rlh;
        width: 1.5rlh;
        height: 1.5rlh;
      }
    }

  }

  ul {
    margin-block-start: 1rlh;
    margin-inline-start: 1rlh;
    list-style-type: none;
    padding-inline-start: 1rlh;
    border-left: 1px solid hsla(240,47%,90%,.3);
  }
}


footer {
  background: hsla(240,47%,90%,.1);
  padding-block-end: 5rlh;
  z-index: 1;
  position: relative;
  /* text-wrap: balance; */

  .links {
    flex-basis: 10ch;
  }
}

.links {
  svg {
    opacity: .8;
    transition: all .3s ease-in-out;
  }
  a:hover svg{
    opacity: 1;
  }
}

cite {
  font-style: normal;
  text-transform: uppercase;
}


/* Komments plugin */

#kommentform {

    .form {
      display: flex;
      flex-wrap: wrap;
      row-gap: .5rlh;
      column-gap: 3vw;

        .form-feedback,
        .comment {
          flex-basis: 100%;

          textarea {
              width: 100%;
          }
        }
    }


    label input {
      width: 100%;
    }

    label[for='comment'] {
      flex: 1 width: 100%;
    }

    label[for='email'],
    label[for='author'] {
        flex: 1 0 clamp(30ch,calc(50% - 6vw),100%)
    }

    label[for='author_url'] {
      display: none;
    }

    .komment-privacy {
        font-size: smaller;
        flex: 1;
        min-inline-size: 30ch;
        text-wrap: balance;
    }

    input[type='submit'] {
        flex: 1;
        max-inline-size: max-content;
    }

    #url {
        position: relative;
        left: -200vw;
        height: 0;
    }

    .msg {
        padding: .5lh;
        background-color: hsla(240,47%,90%,.2);
        opacity: 0;
        display: none;

        &.visible {
            display: block;
            animation: kmsg-fade 1s linear forwards;
            animation-delay: 0.5s;
        }

        &.msg-success {
            background-color: green;
        }

        &.msg-error {
            background-color: red;
        }

        &.msg-info {
            /* border-color: blue; */
        }
    }

    .loader {
        display: none;
        animation: none;

        svg {
            width: 30px;
            height: 30px;
            animation: kspin infinite 1s linear forwards;
        }

        &.visible {
            display: flex;
            align-items: center;
        }
    }
}

@keyframes kspin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(359deg);
    }
}

@keyframes kmsg-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


/* Lightbox */
.basicLightbox {
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, .8);
  opacity: .01;
  transition: opacity .4s ease;
  z-index: 1000;
  will-change: opacity;
  padding: 0;
}

.basicLightbox--visible {
  opacity: 1;
}

.basicLightbox__placeholder {
  max-width: 100%;
  -webkit-transform: scale(.9);
  transform: scale(.9);
  transition: -webkit-transform .4s ease;
  transition: transform .4s ease;
  transition: transform .4s ease, -webkit-transform .4s ease;
  z-index: 1;
  will-change: transform;
}

.basicLightbox__placeholder>iframe:first-child:last-child,
.basicLightbox__placeholder>img:first-child:last-child,
.basicLightbox__placeholder>video:first-child:last-child {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  max-width: 95%;
  max-height: 95%
}

.basicLightbox__placeholder>iframe:first-child:last-child,
.basicLightbox__placeholder>video:first-child:last-child {
  pointer-events: auto
}

.basicLightbox__placeholder>img:first-child:last-child,
.basicLightbox__placeholder>video:first-child:last-child {
  width: auto;
  height: auto
}

.basicLightbox--iframe .basicLightbox__placeholder,
.basicLightbox--img .basicLightbox__placeholder,
.basicLightbox--video .basicLightbox__placeholder {
  width: 100%;
  height: 100%;
  pointer-events: none
}

.basicLightbox--visible .basicLightbox__placeholder {
  -webkit-transform: scale(1);
  transform: scale(1)
}


