/* font face DMSans-VariableFont_opsz,wght.ttf */

@font-face {
  font-family: "DM Sans";
  src: url("/font/DMSans-VariableFont_opsz,wght.ttf")
    format("truetype-variations");
}

:root {
  --text: 51, 51, 51;
  --bg: 255, 255, 255;
  --border: 1px solid rgba(var(--text), 0.25);
  --border-radius: 0.5rem;
  --width: 800px;
  --brand: 224, 90, 1;
  --container-opacity: 0.05;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: 255, 255, 255;
    --bg: 0, 13, 33;
  }
}

body {
  line-height: 1.5;
  background-color: rgb(var(--bg));
  margin: 0;
  padding: 1rem;
}

body *,
body *:before {
  color: rgb(var(--text));
  font-family: "DM Sans", sans-serif;
  transition: all 150ms ease;
}

.container {
  width: var(--width);
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.container > * {
  margin: 0 auto;
  display: block;
  position: inherit;
}

.hidden {
  display: none;
}

h1 {
  text-align: center;
}

button {
  background-color: rgba(var(--text), var(--container-opacity));
  color: rgb(var(--bg));
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  cursor: pointer;
  border: var(--border);
}

select {
  background-color: rgba(var(--text), var(--container-opacity));
  color: rgb(var(--text));
  border: var(--border);
  border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
  font-size: 1rem;
  align-self: center;
  margin-left: auto;
}

option {
  background-color: rgb(var(--bg));
}

.list-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-and-sort-wrapper {
  display: flex;
  justify-content: space-between; /* Align children to opposite ends */
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.tags-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* Selector for the dropdown and the list of tags */
.tags-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* This class is for the 'Select a tag' dropdown */
.tag-dropdown-wrapper {
  align-self: flex-start; /* Align dropdown to the start of the flex container */
}

#tag-dropdown {
  margin-left: 0;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

/* Sorting options dropdown */
#sort-options {
  align-self: flex-end; /* Aligns sorting options to the end of the flex container */
}

.post-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto;
  gap: 0.5rem 1rem;
  align-items: start;
  border: var(--border);
  border-radius: var(--border-radius);
  padding: 1rem;
  position: relative;
  background-color: rgb(var(--text), var(--container-opacity));
  cursor: pointer;
}

.post-card:hover {
  scale: 1.025;
}

/* Adjustments to the play-button visibility */
.post-card:hover .play-button,
.post-card:focus-within .play-button {
  opacity: 1;
}

/* Existing styles for reference and possible adjustment */
.thumbnail-wrapper {
  position: relative;
  width: 100px; /* Match thumbnail width */
  height: 100px; /* Match thumbnail height */
  border-radius: var(--border-radius);
  overflow: hidden;
}

.play-button {
  display: flex;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(var(--brand), 0.7);
  color: rgb(var(--bg));
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
  opacity: 0;
}

.post-image {
  grid-row: 1 / span 2;
  border-radius: var(--border-radius);
}

.post-info {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-title,
.post-description {
  margin: 0;
}

.post-description {
  margin: 0.5rem 0 0;
}

.post-publish-date {
  opacity: 0.8;
  font-size: 0.8rem;
}

audio {
  grid-column: 1 / span 2;
  width: 100%;
}

.tag-list:not(:has(li)) {
  display: none;
}

.tag-list:has(li) {
  margin: 0;
  padding-inline-start: 0;
  list-style-type: none;
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.post-tag-list:has(li) {
  margin-top: auto;
  padding-top: 0.5rem;
}

.post-tag {
  background-color: rgb(var(--bg));
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius);
  cursor: pointer;
}

.post-tag:hover {
  background-color: rgb(var(--text));
  color: rgb(var(--bg));
}

.post-tag-filter {
  background-color: rgba(var(--text), var(--container-opacity));
  border: var(--border);
}

.post-tag-filter:hover {
  background-color: red;
  color: white;
}

.post-tag-filter:before {
  content: "x ";
  color: red;
}

.post-tag-filter:hover:before {
  color: white;
}


input[type="text"] {
  font-size: 1rem;
  background-color: rgb(var(--bg));
  border: var(--border);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  background-color: rgb(var(--text), var(--container-opacity));
}

script {
  display: none !important;
}

/* PLAYER */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px; /* Adjust height as needed */
  background-color: rgba(var(--bg), 0.8);
  backdrop-filter: blur(1rem);
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.125);
  z-index: 1000;
}

.player-bar-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  max-width: var(--width);
  margin: auto;
  gap: 1rem;
}

/* Wrapper for all content inside player bar to match --width */
.player-content-wrapper {
  display: flex;
  justify-content: space-between; /* Align thumbnail to left, controls to center */
  align-items: center;
  width: 100%;
  flex-direction: column;
}

.player-info-wrapper {
  display: flex;
  align-items: center;
  overflow: hidden; /* Prevent content from overflowing */
}

.player-thumbnail {
  width: 75px; /* Adjust width as needed */
  height: 75px; /* Adjust height as needed */
  object-fit: cover;
  border-radius: var(--border-radius);
}

.player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem; /* Space between control elements */
  flex-grow: 1; /* Allow controls to fill space */
  width: 100%;
}

#player-play-pause {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  width: 42px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 42px; /* Adjust line-height to match the button's height */
  text-align: center; /* Ensure the text is centered horizontally */
}


#player-seek {
  flex-grow: 1; /* Allows the seek bar to expand and use available space */
  width: 100%;
}

.build-info-overlay {
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0,0,0,0.6);
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 0 0 6px 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.7;
}

.build-info-overlay * {
  color: #fff;
}

.build-info-local-time {
  display: block;
}

.build-info-time-ago {
  opacity: 0.7;
  font-size: 0.8em;
  display: block;
}