:root {
  --color-text: #22223b;
  --color-text-light:rgb(100, 100, 100);
  --color-primary: #4a4e69;
  --color-primary-invert: #f2e9e4;
  --color-bg: rgba(255, 255, 255, 0.25);
  --color-layer: rgba(255, 255, 255, 0.5);
  --glass-blur: blur(10px);
  --box-shadow: 0 5px 15px rgba(20, 20, 20, .2);
}

html {
  font-size: 18px;

  &.dark {
    --color-text: #ffffff;
    --color-text-light:rgb(178, 178, 209);
    --color-bg: rgba(0, 0, 0, 0.5);
    --glass-blur: blur(10px);
    --color-layer: rgba(0, 0, 0, 0.2);
    --box-shadow: 0 5px 25px rgba(100, 100, 100, .2);

    .fog-bg .fog {
      opacity: 0.15;
    }

    body {
      background: url(/media/bg-dark.png);
      background-size: cover;
      background-position: center;
    }

    .logo {
      border-color: white;
    }
  }

  body {
    color: var(--color-text);
    background: url('/media/bg-light.png');
    background-size: cover;
    background-position: center;
    font-family: 'Gempita', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.7;
  }
}

.glass {
  background: var(--color-bg);
  backdrop-filter: var(--glass-blur);
}

.glass-start {
  background: var(--color-bg);
  transition: backdrop-filter 2s ease-in-out;
}

.glass-start-blur {
  backdrop-filter: var(--glass-blur);
}

hr {
  width: 100%;
  opacity: .6;
}

.hide {
  display: none !important;
}

.layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background-color: var(--color-layer);
}

.scroll-container {
  overflow-y: auto;
  height: 100vh;

  .container {
    max-width: 820px;
    margin: 0 auto;

    main {
      margin: 3rem auto 10rem auto;
      padding: 0 4rem;
      font-size: 1rem;
    }
  }

  footer {
    text-align: center;
    color: white;
    font-size: 0.95rem;
    padding: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, var(--color-bg), transparent);

    a {
      color: inherit;
      text-decoration: none;
    }
    > *{
      margin: 0 1rem;
    }
  }
}

header {
  margin: 0;
  padding: 0rem 1rem;
  border-radius: 1rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0.5rem;
  z-index: 1000;
  font-size: 16px;
  box-shadow: var(--box-shadow);

  .start-logo {
    display: none;
  }

  &.is-start {
    .nav,
    .head-title {
      visibility: hidden;

      img {
        opacity: 0;
      }
    }

    .logo {
      display: block;
    }
  }

  .logo {
    height: 2.2em;
    width: 2.2em;
    max-width: 2.2em;
    max-height: 2.2em;
    box-shadow: none;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 50%;
  }

  .head-title {
    display: flex;
    align-items: center;
    gap: 1rem;

    h1 {
      letter-spacing: 2px;
      margin: 0;

      a {
        color: inherit;
        text-decoration: none;
      }
    }
  }

  a {
    text-decoration: none;
    display: flex;
    align-items: center;
    color: var(--color-text);
  }

  svg {
    height: 2em;
    width: 2em;
    cursor: pointer;
  }

  .nav {
    display: flex;
    align-items: center;
    gap: .5em;
  }

  .actions {
    display: flex;
    align-items: center;
    gap: 1em;
  }
}

select {
  text-align: center;
  background-color: transparent;
  font-size: 1em;
  border: none;
  color: inherit;
  font-family: inherit;
  background-color: var(--color-bg);
  padding: .5em .75em;
  border-radius: 1em;
}

.btn-row {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.post-list {
  list-style: none;
  padding: 0;

  .post-list-item {
    display: flex;
    flex-direction: row;
    margin-bottom: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    position: relative;

    .image-container {
      width: 33%;
      overflow: hidden;

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }
    
    .text-container {
      flex: 1;
      padding: 2.5rem 3.5rem 2.5rem 2.5rem;
      position: relative;
      display: flex;
      flex-direction: column;

      h1 {
        margin: 0;
        font-size: 2rem;
        line-height: 1.2;
      }

      .date, .short-title {
        color: var(--color-text-light);
        font-size: 1rem;
        margin-top: 0.5rem;
      }
    }

    a {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
    }

    .read-icon {
      position: absolute;
      top: 0;
      right: 0;
      width: 1.5rem;
      height: 1.5rem;
      display: none;
      z-index: 10;
      padding: 1rem;
      cursor: pointer;
      
      &.show {
        display: block;
      }
    }

    .open-icon {
      position: absolute;
      top: 50%;
      right: .3rem;
      transform: translate(0, -50%);
      width: 2.5rem;
      height: 2.5rem;
      color: var(--color-text-light);
    }
  }
}

.post-detail {
  border-radius: 1rem;
  box-shadow: var(--box-shadow);
  position: relative;
  overflow: hidden;

  .post-image {
    max-width: 100%;
    width: 100%;
    margin: 0;
    border-radius: 0;
  }

  h1 {
    margin: 0;
    font-size: 2.5rem;
  }

  .content {
    padding: 2rem;
  }

  .content, .content span {
    color: var(--color-text) !important;
    font-family: inherit !important;
    font-size: 1.1rem !important;
    line-height: 1.7 !important;
  }

}

.welcome-text h1,
.logo-text {
  text-transform: lowercase;
  font-family: monospace;
}


.fadeIn {
  opacity: 0;
  transition: opacity 2s ease-in-out;
}

.fadeIn.visible {
  opacity: 1;
}

.page {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--box-shadow);
  position: relative;
  text-align: center;

  h1 {
    margin: 0;
    font-size: 2.5rem;
    text-align: center;
  }

  .go-to-blog {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;

    .icon {
      width: 2rem;
      height: 2rem;
      position: relative;
      top: 11px;
    }
  }
}

.panorama {
  main, footer {
    display: none !important;
  }
  .container {
    margin-top: .5rem;
  }
  .fog-bg {
    opacity: 1 !important;
  }
}

.pwa-banner {
  display:none; 
  position:fixed; 
  bottom:1rem; 
  left:1rem; 
  right:1rem; 
  margin:auto; 
  max-width:400px; 
  background:#fff; 
  color:#222; 
  border-radius:8px; 
  box-shadow:var(--box-shadow); 
  padding:16px; 
  z-index:9999; 
  text-align:center;

  .dismiss {
    position: absolute; 
    top: 8px; 
    right: 8px; 
    font-size: 1.2rem; 
    cursor: pointer;
  }

  button {
    margin-left:12px; 
    padding:6px 16px; 
    border:none; 
    background:#222; 
    color:#fff; 
    border-radius:4px; 
    cursor:pointer;
  }
}

.fog-bg {
  opacity: 0;
  will-change: opacity;
  transition: opacity 1.5s ease-in-out;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  
  .fog {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.35;

    img {
      position: absolute;
      bottom: 0;
      max-width: 100%;
      animation: fog_effect calc(15s * var(--i)) ease-in infinite;
      opacity: .25;
    }
  }
}

@keyframes fog_effect {
  0% {
    opacity: 0;
    transform: scale(1);
  }
  25%,
  75% {
    opacity: 1;
  }
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

/* Responsive */
@media (min-width: 636px) {

  .nav {
    min-width: 200px;
  }

  .actions {
    min-width: 200px;
  }
}

@media (max-width: 835px) {
  
  header {
    margin: .5rem .5rem;
  }

  .scroll-container {
    & .container {
      main {
        padding: 0 2rem;
      }
    }
  }
}

@media (min-width: 451px) {
  .is-mobile {
    display: none !important;
  }

  .is-desktop {
    display: flex;
  }
}

@media (max-width: 450px) {

  header {
    padding: .5em;
  }
  .scroll-container {
    & .container {
      main {
        padding: 0 .5rem;
      }
    }
  }

  .post-detail .content,
  .page {
    padding: 1rem;
  }

  .post-list .post-list-item {

    .text-container {
      padding: 1rem 1.5rem 1rem 1rem;
    }

    .read-icon {
      top: -.5rem;
      right: -.5rem;
    }

    .open-icon {
      right: 0;
      width: 2rem;
      height: 2rem;
    }
  }

  .is-mobile {
    display: flex;
  }

  .is-desktop {
    display: none !important;
  }
}