/* =========================================================
   PODCASTS
   ========================================================= */

:root {
  --podcast-accent: #ff2348;
  --podcast-player-height: 72px;
}


/* =========================================================
   GRID
   ========================================================= */

.view-podcasts .view-content {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 46px 20px;
}

.view-podcasts .views-row {
  min-width: 0;
}

.view-podcasts .node--type-podcast {
  margin: 0;
}

/* Исходный Drupal audio нужен только как источник URL. */
.view-podcasts .field--name-field-audio {
  display: none !important;
}


/* =========================================================
   COVER
   ========================================================= */

.view-podcasts .field--name-field-image-cover {
  position: relative;

  width: 100%;
  aspect-ratio: 1 / 1;

  margin: 0 0 14px;

  overflow: hidden;

  border-radius: 3px;
  background: #eee;
}

.view-podcasts .field--name-field-image-cover .media,
.view-podcasts .field--name-field-image-cover .media__element {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  overflow: hidden;
}

.view-podcasts .field--name-field-image-cover img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
}


/* =========================================================
   TITLE
   ========================================================= */

.view-podcasts .field--name-node-title {
    font-size: 16px;
}


/* =========================================================
   PLAY ON COVER
   ========================================================= */

.podcast-card__play {
  position: absolute;

  z-index: 5;
  top: 50%;
  left: 50%;

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

  width: 52px;
  height: 52px;

  padding: 0;

  border: 0;
  border-radius: 50%;

  background: #fff;
  color: #000;

  cursor: pointer;

  transform: translate(-50%, -50%);

  box-shadow: 0 1px 5px rgb(0 0 0 / 10%);

  transition:
    transform .15s ease,
    box-shadow .15s ease,
    color .15s ease;
}

.podcast-card__play:hover {
  transform: translate(-50%, -50%) scale(1.07);

  box-shadow: 0 3px 12px rgb(0 0 0 / 15%);
}

.podcast-card__play:focus-visible {
  outline: 2px solid var(--podcast-accent);
  outline-offset: 3px;
}

.podcast-card__play svg {
  display: block;

  width: 19px;
  height: 19px;

  fill: currentColor;
}


/* =========================================================
   FIXED PLAYER
   ========================================================= */

.podcast-player {
  position: fixed;

  z-index: 10000;

  left: 0;
  right: 0;
  bottom: 0;

  min-height: var(--podcast-player-height);

  background: rgb(255 255 255 / 98%);

  border-top: 1px solid #ededed;

  box-shadow:
    0 -6px 22px rgb(0 0 0 / 5%);

  backdrop-filter: blur(12px);

  transform: translateY(100%);
  opacity: 0;

  transition:
    transform 0.3s ease,
    opacity 0.25s ease;

  pointer-events: none;
}


/* Плеер показан */
.podcast-player.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}


/* Плеер полностью убран из DOM layout */
.podcast-player[hidden] {
  display: none !important;
}


/* Отступ снизу для страницы */
body.podcast-player-visible {
  padding-bottom: var(--podcast-player-height);
}


/* =========================================================
   PLAYER LAYOUT
   ========================================================= */

.podcast-player__inner {
  width: min(1380px, calc(100% - 48px));
  max-width: 1170px;
  min-height: var(--podcast-player-height);

  margin: 0 auto;

  display: grid;

  grid-template-columns:
    auto
    50px
    minmax(160px, 1fr)
    50px
    42px
    34px
    minmax(180px, 250px);

  align-items: center;

  gap: 14px;
}


/* =========================================================
   CONTROLS
   ========================================================= */

.podcast-player__controls {
  display: flex;
  align-items: center;

  gap: 8px;
}

.podcast-player button {
  font: inherit;
  color: inherit;
}


/* Prev / next */

.podcast-player__track-button {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 24px;
  height: 36px;

  padding: 0;

  border: 0;
  background: transparent;

  cursor: pointer;
}

.podcast-player__track-button svg {
  width: 24px;
  height: 24px;

  fill: #151515;
}


/* =========================================================
   SKIP 30
   ========================================================= */

.podcast-player__skip {
  position: relative;

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

  width: 38px;
  height: 38px;

  padding: 0;

  border: 0;
  background: transparent;

  cursor: pointer;
}

.podcast-player__skip svg {
  position: absolute;

  inset: 1px;

  width: 31px;
  height: 35px;

  fill: none;
  stroke: #333;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.podcast-player__skip span {
  position: relative;
  z-index: 2;

  margin-top: 1px;

  font-size: 9px;
  line-height: 1;
}


/* =========================================================
   PLAY
   ========================================================= */

.podcast-player__toggle {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;

  padding: 0;

  border: 1.5px solid var(--podcast-accent);
  border-radius: 50%;

  background: #fff;
  color: #111;

  cursor: pointer;

  transition:
    background .15s ease,
    transform .15s ease;
}

.podcast-player__toggle:hover {
  background: #fafafa;
  transform: scale(1.04);
}

.podcast-player__toggle svg {
  display: block;

  width: 16px;
  height: 16px;

  fill: currentColor;
}
.podcast-player__toggle svg[aria-label="Воспроизвести"] {
    margin-left: 4px;
}

/* =========================================================
   TIME
   ========================================================= */

.podcast-player__time {
  font-size: 10px;
  line-height: 1;

  color: #222;

  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.podcast-player__time--current {
  text-align: right;
}

.podcast-player__time--duration {
  text-align: left;
}


/* =========================================================
   SEEK
   ========================================================= */

.podcast-player__seek {
  --progress: 0%;

  width: 100%;
  height: 14px;

  margin: 0;
  padding: 0;

  appearance: none;
  -webkit-appearance: none;

  background: transparent;

  cursor: pointer;
}

.podcast-player__seek::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;

  border-radius: 0;

  background:
    linear-gradient(
      to right,
      var(--podcast-accent) 0%,
      var(--podcast-accent) var(--progress),
      #e1e1e1 var(--progress),
      #e1e1e1 100%
    );
}

.podcast-player__seek::-webkit-slider-thumb {
  width: 6px;
  height: 6px;

  margin-top: -1.5px;

  appearance: none;
  -webkit-appearance: none;

  border: 0;
  border-radius: 50%;

  background: var(--podcast-accent);
}

.podcast-player__seek::-moz-range-track {
  height: 4px;

  border: 0;

  background: #e1e1e1;
}

.podcast-player__seek::-moz-range-progress {
  height: 4px;

  background: var(--podcast-accent);
}

.podcast-player__seek::-moz-range-thumb {
  width: 6px;
  height: 6px;

  border: 0;
  border-radius: 50%;

  background: var(--podcast-accent);
}


/* =========================================================
   SPEED
   ========================================================= */

.podcast-player__rate {
  padding: 6px 4px;

  border: 0;
  background: transparent;

  font-size: 10px;
  line-height: 1;

  cursor: pointer;
}


/* =========================================================
   VOLUME
   ========================================================= */

.podcast-player__volume {
  position: relative;

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

  width: 34px;
  height: 40px;

  overflow: visible;
}

.podcast-player__volume-button {
  position: relative;
  z-index: 2;

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

  width: 34px;
  height: 34px;

  padding: 0;

  border: 0;
  border-radius: 50%;

  background: transparent;
  color: #111;

  cursor: pointer;

  transition: background-color .15s ease;
}

.podcast-player__volume-button:hover,
.podcast-player__volume-button:focus-visible {
  background: #f2f2f2;
}

.podcast-player__volume-button:focus-visible {
  outline: 1px solid #aaa;
  outline-offset: 2px;
}

.podcast-player__volume-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 25px;
  height: 25px;

  pointer-events: none;
}

.podcast-player__volume-icon svg {
  display: block;

  width: 25px;
  height: 25px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/*
 * В обычном состоянии видна только иконка.
 * Ползунок появляется над ней во всплывающем блоке.
 */
.podcast-player__volume-popover {
  position: absolute;
  z-index: 10;

  left: 50%;
  bottom: calc(100% + 7px);

  width: 138px;

  padding: 12px 14px;

  border: 1px solid #e6e6e6;
  border-radius: 6px;

  background: rgb(255 255 255 / 98%);

  box-shadow:
    0 5px 18px rgb(0 0 0 / 12%);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform:
    translate(-50%, 6px)
    scale(.98);

  transform-origin: 50% 100%;

  transition:
    opacity .18s ease,
    transform .18s ease,
    visibility 0s linear .18s;
}

.podcast-player__volume-popover::after {
  content: "";

  position: absolute;

  left: 50%;
  top: 100%;

  width: 10px;
  height: 10px;

  background: #fff;

  border-right: 1px solid #e6e6e6;
  border-bottom: 1px solid #e6e6e6;

  transform:
    translate(-50%, -5px)
    rotate(45deg);
}

.podcast-player__volume.is-open
.podcast-player__volume-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transform:
    translate(-50%, 0)
    scale(1);

  transition-delay: 0s;
}

/*
 * Desktop fallback: hover/focus работает даже до первого JS-события.
 * Плавное закрытие контролирует CSS, задержку перед закрытием — JS.
 */
@media (hover: hover) and (pointer: fine) {
  .podcast-player__volume:hover
  .podcast-player__volume-popover,
  .podcast-player__volume:focus-within
  .podcast-player__volume-popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform:
      translate(-50%, 0)
      scale(1);

    transition-delay: 0s;
  }
}

.podcast-player__volume-range {
  --volume-progress: 100%;

  display: block;

  width: 110px;
  height: 16px;

  padding: 0;
  margin: 0;

  appearance: none;
  -webkit-appearance: none;

  background: transparent;

  cursor: pointer;
}

/* Chrome / Safari */

.podcast-player__volume-range::-webkit-slider-runnable-track {
  width: 100%;
  height: 3px;

  border-radius: 2px;

  background:
    linear-gradient(
      to right,
      #111 0%,
      #111 var(--volume-progress),
      #ddd var(--volume-progress),
      #ddd 100%
    );
}

.podcast-player__volume-range::-webkit-slider-thumb {
  width: 10px;
  height: 10px;

  margin-top: -3.5px;

  appearance: none;
  -webkit-appearance: none;

  border: 0;
  border-radius: 50%;

  background: #111;

  cursor: grab;
}

.podcast-player__volume-range::-webkit-slider-thumb:active {
  cursor: grabbing;
}

/* Firefox */

.podcast-player__volume-range::-moz-range-track {
  height: 3px;

  border: 0;
  border-radius: 2px;

  background: #ddd;
}

.podcast-player__volume-range::-moz-range-progress {
  height: 3px;

  border-radius: 2px;

  background: #111;
}

.podcast-player__volume-range::-moz-range-thumb {
  width: 10px;
  height: 10px;

  border: 0;
  border-radius: 50%;

  background: #111;

  cursor: grab;
}


/* =========================================================
   META
   ========================================================= */

.podcast-player__meta {
  min-width: 0;

  display: flex;
  align-items: center;

  gap: 10px;
}

.podcast-player__cover {
  flex: 0 0 38px;

  width: 38px;
  height: 38px;

  object-fit: cover;

  border-radius: 3px;
  background: #eee;
}

.podcast-player__cover[hidden] {
  display: none;
}

.podcast-player__title {
  min-width: 0;

  display: -webkit-box;

  overflow: hidden;

  font-size: 10px;
  line-height: 1.2;

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


/* Real audio element */

.podcast-player__audio {
  display: none;
}


/* =========================================================
   ACTIVE CARD
   ========================================================= */

.views-row.is-podcast-playing .podcast-card__play {
  color: var(--podcast-accent);
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1050px) {
  .view-podcasts .view-content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .podcast-player__inner {
    width: calc(100% - 30px);

    grid-template-columns:
      auto
      48px
      minmax(100px, 1fr)
      58px
      35px
      34px
      minmax(140px, 190px);

    gap: 9px;
  }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 760px) {
  :root {
    --podcast-player-height: 130px;
  }

  .view-podcasts .view-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 16px;
  }

  .podcast-player__inner {
    width: calc(100% - 24px);

    padding: 8px 0;

    grid-template-columns: 1fr auto;

    grid-template-areas:
      "meta controls"
      "seek seek"
      "volume rate";

    gap: 8px 12px;
  }

  .podcast-player__meta {
    grid-area: meta;
  }

  .podcast-player__controls {
    grid-area: controls;
  }

  .podcast-player__track-button {
    display: none;
  }

  .podcast-player__time {
    display: none;
  }

  .podcast-player__seek {
    grid-area: seek;
  }

  .podcast-player__volume {
    grid-area: volume;

    width: 34px;
  }

  .podcast-player__volume-popover {
    left: 0;

    transform:
      translate(0, 6px)
      scale(.98);

    transform-origin: 0 100%;
  }

  .podcast-player__volume.is-open
  .podcast-player__volume-popover {
    transform:
      translate(0, 0)
      scale(1);
  }

  .podcast-player__volume-popover::after {
    left: 17px;
  }

  .podcast-player__rate {
    grid-area: rate;

    justify-self: end;
  }
}


@media (max-width: 480px) {
  .view-podcasts .view-content {
    grid-template-columns: 1fr;
  }
}
div#block-vesta-theme-views-block-podcasts-block-1 {
    background-color: #fff;
    border-radius: var(--bs-border-radius);
    overflow: hidden;
}

.view-podcasts.view-display-id-block_1 .view-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.view-podcasts.view-display-id-block_1 .views-row {
    border-bottom: 1px solid #e5e5e5;
    padding: 10px 12px;
    margin-top: 15px;
}

div#block-vesta-theme-views-block-podcasts-block-1 h2.block-title {
    padding: 12px 12px 8px;
    margin: 0;
}

.view-podcasts.view-display-id-block_1 .views-row:first-child {
    margin: 0;
}

.view-podcasts.view-display-id-block_1 .view-footer a {
    color: var(--bs-color-red);
    text-transform: uppercase;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    padding: 8.25px;
    display: block;
}

.view-podcasts.view-display-id-block_1 .view-footer a:hover {
    color: #fff;
    background-color: var(--bs-color-red);
}
@media (max-width: 991px) {
    .front .region-podcast-sidebar {
        width: calc(50% - 15px);
    }
}
@media (max-width: 480px) {
    .front .region-podcast-sidebar {
        width: 100%;
    }
}