.audios-page {
  padding-block: 3rem 5rem;
  background: var(--background-color);
}

.audios__header {
  margin-bottom: 2.5rem;
}

.audios__title {
  margin: 0 0 0.6rem;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--heading-color);
}

.audios__description {
  max-width: 700px;
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.6;
  color: var(--text-light-color);
}

/* --------------------------------------------------
   Audio Grid
-------------------------------------------------- */

.audios__content {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.audios__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 250px;
  color: var(--text-color-of-background);
}

.audios__loading p {
  margin: 0;
  font-size: 0.95rem;
}

.audios__loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--secondary-background-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: audios-loading-spin 0.8s linear infinite;
}

@keyframes audios-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.audios__error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 250px;
  text-align: center;
}

.audios__error p {
  margin: 0;
  color: var(--text-color-of-background);
}

.audios__retry {
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 8px;
  background: var(--primary-color);
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.audios__retry:hover {
  background: var(--hover-color-of-button-primary);
}

/* --------------------------------------------------
   Audio Card
-------------------------------------------------- */

.audio-card {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--card-background-color);
  box-shadow: var(--shadow-sm);
}

.audio-card:hover {
  transform: translateY(-3px);

  border-color: var(--tertiary-color);

  box-shadow:
    0 10px 28px rgba(0, 61, 77, 0.12),
    0 3px 8px rgba(0, 0, 0, 0.05);
}

/* --------------------------------------------------
   Header / Cover
-------------------------------------------------- */

.audio-card__header {
  position: relative;
  margin-bottom: 1rem;
}

.audio-card__cover {
  width: 100%;
  height: 150px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--secondary-background-color);
}

.audio-card__cover-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.audio-card__cover-label {
  margin-bottom: 0.5rem;

  font-size: 1.1rem;
  font-weight: 600;

  color: var(--primary-color);
}

.audio-card__cover-title {
  display: -webkit-box;

  overflow: hidden;

  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;

  color: var(--heading-color);

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.audio-card__favorite {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 2.75rem;
  height: 2.75rem;
  padding: 0;

  border: 1px solid var(--border-color);
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.95);

  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-light-color);

  cursor: pointer;

  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.audio-card__favorite:hover {
  color: var(--primary-color);
  background: var(--secondary-background-color);
  border-color: var(--tertiary-color);

  transform: scale(1.05);
}

.audio-card--favorite .audio-card__favorite {
  color: #dc2626;
}

.audio-card--favorite .audio-card__favorite:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.2);
}

/* --------------------------------------------------
   Information
-------------------------------------------------- */

.audio-card__info {
  margin-bottom: 1rem;
}

.audio-card__title {
  display: -webkit-box;
  margin: 0 0 0.5rem;
  overflow: hidden;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--heading-color);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.audio-card__author {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  color: var(--text-light-color);
}

.audio-card__description {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-color);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* --------------------------------------------------
   Player
-------------------------------------------------- */

.audio-card__player {
  margin-top: 1.5rem;
}

.audio-card__progress {
  position: relative;

  width: 100%;
  height: 0.5rem;

  border-radius: 1rem;

  background: var(--border-color);

  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);

  cursor: pointer;
}

.audio-card__progress-value {
  position: absolute;
  top: 0;
  left: 0;

  width: 0;
  height: 100%;

  border-radius: inherit;

  background: var(--primary-color);

  box-shadow: 0 0 0.6rem rgba(0, 157, 197, 0.25);

  transition: width 0.05s linear;
}

.audio-card__time {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light-color);
}

/* --------------------------------------------------
   Controls
-------------------------------------------------- */

.audio-card__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.audio-card__controls-divider {
  width: 1px;
  height: 2.5rem;
  margin: 0 0.25rem;
  background: var(--border-color);
}

.audio-card__secondary-control,
.audio-card__play-button {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border-radius: 50%;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.audio-card__secondary-control {
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  background: var(--primary-color);
  font-size: 1rem;
  color: var(--text-color-of-primary);
}

.audio-card__play-button {
  width: 3rem;
  height: 3rem;
  border: 0;
  background: var(--primary-color);
  font-size: 1.1rem;
  color: var(--text-color-of-primary);
  box-shadow: var(--shadow-sm);
}

.audio-card__secondary-control:hover {
  color: var(--primary-color);

  background: var(--secondary-background-color);

  border-color: var(--tertiary-color);

  transform: translateY(-1px);
}

.audio-card__play-button:hover {
  background: var(--hover-color-of-button-primary);

  box-shadow: var(--shadow-md);

  transform: translateY(-1px);
}

.audio-card--playing .audio-card__play-button {
  box-shadow: 0 4px 14px rgba(0, 157, 197, 0.3);
}

/* --------------------------------------------------
   Footer
-------------------------------------------------- */

.audio-card__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* .audio-card__read-text, */
.audio-card__replay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;

  min-height: 2.5rem;
  padding: 0.55rem 0.75rem;

  border: 1px solid var(--tertiary-color);
  border-radius: 0.6rem;

  background: var(--secondary-background-color);
  color: var(--primary-color);

  font-size: 0.8rem;
  font-weight: 600;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

/* .audio-card__read-text, */
.audio-card__replay:hover {
  background: var(--tertiary-color);
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

/* .audio-card__read-text-icon, */
.audio-card__replay-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.audio-card__footer span {
  font-size: 1.1rem;
  color: var(--text-light-color);
}

.audio-card__repeat {
  flex-shrink: 0;

  padding: 0;

  border: 0;

  background: transparent;

  font-size: 1.7rem;

  color: var(--text-color-of-primary);

  cursor: pointer;

  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.audio-card__repeat:hover {
  color: var(--primary-color);

  transform: rotate(-30deg);
}

.audio-card__audio {
  display: none;
}

.audio-text-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 1.5rem;
}

.audio-text-modal[hidden] {
  display: none;
}

.audio-text-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.audio-text-modal__content {
  position: relative;
  z-index: 1;

  width: min(700px, 100%);
  max-height: min(700px, 90vh);

  display: flex;
  flex-direction: column;

  padding: 1.5rem;

  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);

  background: var(--card-background-color);
  box-shadow: var(--shadow-md);
}

.audio-text-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 2.25rem;
  height: 2.25rem;

  padding: 0;
  border: 0;
  border-radius: 50%;

  background: var(--secondary-background-color);
  color: var(--text-color);

  font-size: 1rem;
  cursor: pointer;

  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.audio-text-modal__close:hover {
  background: var(--tertiary-color);
  color: var(--primary-color);
}

.audio-text-modal__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  padding-right: 3rem;
  margin-bottom: 1.25rem;
}

.audio-text-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 2.75rem;
  height: 2.75rem;

  flex-shrink: 0;

  border-radius: 0.75rem;

  background: var(--secondary-background-color);
  color: var(--primary-color);

  font-size: 1.25rem;
}

.audio-text-modal__header h2 {
  margin: 0 0 0.2rem;

  font-size: 1.35rem;
  font-weight: 700;
  color: var(--heading-color);
}

.audio-text-modal__subtitle {
  margin: 0;

  font-size: 0.8rem;
  color: var(--text-light-color);
}

.audio-text-modal__body {
  min-height: 200px;
  max-height: 55vh;

  overflow-y: auto;

  padding: 1rem 1.1rem;

  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);

  background: var(--secondary-background-color);

  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-color);

  white-space: pre-wrap;
}

.audio-text-modal__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.audio-text-modal__close-button {
  min-width: 100px;
  padding: 0.65rem 1rem;

  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);

  background: var(--secondary-background-color);
  color: var(--text-color);

  font-size: 0.85rem;
  font-weight: 600;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.audio-text-modal__close-button:hover {
  background: var(--tertiary-color);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* --------------------------------------------------
   Responsive
-------------------------------------------------- */

@media (max-width: 1000px) {
  .audios__content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .audios-page {
    padding-block: 2rem 4rem;
  }

  .audios__title {
    font-size: 2.4rem;
  }

  .audios__description {
    font-size: 1.4rem;
  }

  .audios__content {
    grid-template-columns: 1fr;
  }
}
