/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --background-color: #181818;
  --navbar-background-color: #202020;
  --bold-text-color: #ddd;
  --text-color: #ccc;
  --subtle-text-color: #bbb;
  --navbar-height: 4rem;
  --container-width: 60rem;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: "Outfit", sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.8em;
  margin: 0;
  padding: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  a { color: var(--bold-text-color); }
  a:hover { color: #ffffff; }
}

.navbar {
  background-color: var(--navbar-background-color);
  border-bottom: 1px solid #222;
  height: var(--navbar-height);

  .nav-content {
    max-width: 45rem;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    justify-content: center;
  }

  .home-link {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;

    &:hover { background-color: #222; }
    svg { display: block; }
  }
}

main.container {
  margin: 0 auto;

  .albums-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(2, 1fr);
    margin: 5rem auto;
    max-width: 90rem;
    padding: 0 1rem;
  }

  .album-card {
    aspect-ratio: 16/9;
    color: inherit;
    overflow: hidden;
    position: relative;
    text-decoration: none;

    .image-wrapper {
      width: 100%;
      height: 100%;

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

    .overlay {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 1.5rem;
      background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
      opacity: 1;

      h3 {
        color: #fff;
        font-size: 2.5rem;
        font-weight: 700;
        letter-spacing: -0.005em;
        line-height: 1.2;
        margin: 0 0 0.3rem;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
      }

      time {
        color: rgba(255, 255, 255, 0.95);
        font-size: 0.9rem;
        font-weight: 400;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
      }

      .unpublished {
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.9rem;
        font-weight: 400;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
      }
    }
  }

  .album-banner {
    height: 500px;

    .banner-content {
      text-align: center;
    }

    time {
      display: block;
      font-size: 1em;
      color: rgba(255,255,255,0.6);
      text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    }
  }

  .content-block-container {
    margin: 5rem 0 2rem 0;

    img {
      border-radius: 4px;
      display: block;
      height: auto;
      margin: 0 auto 1rem auto;
      max-width: 100%;
      transition: filter 0.3s ease;
      width: auto;
    }

    img:hover {
      filter: brightness(1.1);
    }
  }

  .content {
    margin: 0 auto;
    max-width: var(--container-width);
  }

  .content-block-paragraph {
    margin-bottom: 2rem;
    font-size: 1em;
    line-height: 1.8;
  }

  .content-block-image {
    margin-bottom: 2rem;
    text-align: center;

    img {
      border-radius: 4px;
      display: block;
      height: auto;
      margin: 0 auto;
      max-width: 100%;
      transition: filter 0.3s ease;
      width: auto;
    }

    img:hover {
      filter: brightness(1.1);
    }

    .image-caption {
      margin-top: 0.5rem;
      font-size: 0.9em;
      color: var(--text-color);
      font-style: italic;
      opacity: 0.8;
    }
  }

  .gallery {
    text-align: center;
    display: flow-root;
    overflow: visible;

    .gallery-row {
      display: inline-flex;
      gap: 0.5rem;
    }

    figure {
      display: flex;
      flex-direction: column;
      height: auto;
      margin: 0;
      cursor: pointer;

      img {
        max-height: 500px;
        width: auto;
        object-fit: contain;
      }

      img:hover {
        filter: brightness(1.1);
      }
    }

    .gallery-caption {
      margin-top: 1rem;
      text-align: center;
      color: var(--text-color);
      font-size: 0.9em;
      opacity: 0.9;
      padding: 0 1rem;
    }
  }

  .post .post-header {
    margin: 0 0 3rem;
    position: relative;
  }

  .post .post-header .cover-image {
    margin: 0;
    width: 100%;
    height: 600px;
    overflow: hidden;
    position: relative;
  }

  .post .post-header .cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
  }

  .post .post-header .banner-content {
    background: rgba(0, 0, 0, 0.5);
    inset: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: absolute;

    h2.subtitle {
      font-size: 1.75rem;
      font-weight: 400;
      margin: 0;
    }
  }

  .post .post-header .banner-content h1 {
    font-size: 4rem;
    line-height: 1.2;
    margin: 0 0 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #fff;
  }

  .post .post-header .banner-content time {
    bottom: 2rem;
    font-size: 0.9rem;
    position: absolute;
    bottom: 2rem;
  }

  .post .content section {
    margin: 1rem 0 0 0;
  }
}

.pswp__img {
  object-fit: contain;
}

.pswp__custom-caption {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 16px;
  line-height: 1.4;
  padding: 12px 16px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 30%;
  overflow-y: auto;
  text-align: center;
}

@media (max-width: 640px) {
  main.container {
    .albums-grid {
      grid-template-columns: repeat(1, 1fr);
      padding: 0 0.5rem;
    }

    .gallery .gallery-row { flex-direction: column; }
    .gallery figure img { height: auto; }
  }

  p {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .post .post-header .banner-content {
    padding: 1rem;

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