/* ============================================
   CPC MUSIC - STYLESHEET
   Clean, elegant design matching cpcmusic.com
   ============================================ */

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: white;
  color: #333;
  min-height: 100vh;
}

/* ============================================
   HEADER & BANNER
   ============================================ */

.header {
  width: 100%;
  display: flex;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background-color: white;
  z-index: 1000;
  position: sticky;
  top: 0;
}

/* FIX: Banner uses max-width so it scales down naturally on any screen.
   Fixed pixel width (642px) was wider than most phones, causing overflow. */
.banner {
  width: 100%;
  max-width: 642px;
  height: auto;
  object-fit: fill;
  display: block;
  padding-left: 0;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */

.container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 30px 20px;
  flex-grow: 1;
  background-color: white;
}

/* ============================================
   SONG GRID LAYOUT
   Desktop: 2 columns of 300px each = 620px total (300+300+20 gap)
   Mobile: 2 equal columns that fill the available width
   ============================================ */

.songs-grid {
  display: grid;
  grid-template-columns: 300px 300px;
  gap: 20px;
  width: 620px;
  justify-items: center;
}

/* ============================================
   SONG CARD STYLING
   ============================================ */

.song-card {
  background-color: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  transition: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  text-align: center;
  width: 100%;
}

/* FIX: Song images must fill their card column.
   The <a> tag also carries class "song-image" — ensure both
   the link wrapper and the img inside it are full-width. */
.song-image {
  width: 100%;
  height: auto;
  border-radius: 0;
  margin-bottom: 5px;
  display: block;
}

a.song-image {
  display: block;
  width: 100%;
}

a.song-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Song Title */
.song-title {
  font-size: 16px;
  font-weight: 400;
  color: #333;
  margin-bottom: 10px;
  line-height: 1.3;
}

/* ============================================
   SPOTIFY BUTTON - CENTERED
   ============================================ */

.spotify-button {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.spotify-button img {
  width: 200px;
  height: auto;
  display: block;
  border-radius: 0;
}

.spotify-button:hover img {
  transform: scale(1.05);
  opacity: 0.9;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 30px 20px;
  margin: 40px auto 20px auto;
  font-size: 14px;
  max-width: 620px;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.footer p {
  margin: 8px 0;
}

.footer a {
  color: #1db954;
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}


/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .header {
    padding: 5px 0;
  }

  /* FIX: Banner matches the grid width exactly.
     The grid is 2 columns with a 10px gap = full available width.
     Using 100% with max-width lets it scale to any phone size. */
  .banner {
    width: 100%;
    max-width: 100%;
    height: auto;
    padding: 0;
  }

  /* FIX: Remove fixed left padding that was shifting the grid off-centre
     and causing the column total to mismatch the header width. */
  .container {
    padding: 20px 10px;
  }

  /* FIX: Use fractional columns (1fr 1fr) instead of fixed pixel widths.
     This makes both columns equal and their combined width always equals
     the available viewport width minus the container padding (2×10px = 20px).
     The banner above is also 100% width, so header == grid width. */
  .songs-grid {
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 100%;
    gap: 10px;
  }

  audio {
    width: 100% !important;
    height: 44px;
  }

  .song-card {
    padding-bottom: 12px;
    width: 100%;
  }

  /* FIX: Images fill their column cell completely. */
  .song-image {
    width: 100%;
    height: auto;
  }

  a.song-image {
    width: 100%;
  }

  a.song-image img {
    width: 100%;
    height: auto;
  }

  .song-title {
    font-size: 14px;
  }

  .spotify-button img {
    width: 160px;
  }
}

@media (max-width: 480px) {
  .song-card {
    padding-bottom: 10px;
  }

  .song-image {
    margin-bottom: 10px;
  }

  .spotify-button img {
    width: 140px;
  }
}

@media (max-width: 768px) {
  .footer {
    max-width: 100%;
    border-radius: 8px;
    padding: 24px 16px;
    margin: 30px auto 20px auto;
  }
}


/* ============================================
   CUSTOM AUDIO PLAYER
   ============================================ */

.audio-player {
  width: 100%;
  max-width: 300px;
  background-color: #111;
  color: #fff;
  border-radius: 8px;
  padding: 12px 12px 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "btn bar time"
    "btn bar time";
  column-gap: 10px;
  user-select: none;
  -webkit-user-select: none;
}

.play-btn {
  grid-area: btn;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  border: 0;
  color: #000;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  line-height: 42px;
  text-align: center;
  padding: 0;
}

.play-btn:active {
  transform: scale(0.96);
}

.timeline {
  grid-area: bar;
  height: 6px;
  background-color: #333;
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  align-self: center;
}

.progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background-color: #1db954;
  border-radius: 3px;
}

.time {
  grid-area: time;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  line-height: 1.2;
  text-align: right;
  align-self: center;
  min-width: 70px;
  font-variant-numeric: tabular-nums;
}

.time .divider {
  color: #888;
  padding: 0 4px;
}

@media (max-width: 768px) {
  .audio-player {
    max-width: 100%;
    padding: 10px;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "btn time"
      "bar bar";
    row-gap: 8px;
  }

  .play-btn {
    width: 38px;
    height: 38px;
    font-size: 14px;
    line-height: 38px;
  }

  .timeline {
    height: 5px;
  }

  .time {
    font-size: 11px;
    text-align: left;
    align-self: center;
  }
}
