/*
 * sharie.ch – Audio posts with a video (ACF "video_link")
 * Play button on the cover + popup with the video, title and client · year.
 * The elements are created by audio-player.js.
 */

/* Cover wrapper (keeps the cover's size, adds the button on top) */
.audio-cover-wrap {
  position: relative;
  display: block;
  flex: 0 0 auto;
  line-height: 0;
}
.audio-tile .audio-cover-wrap { width: 100%; }
.audio-cover-wrap img { cursor: pointer; }

/* Play button on the cover: orange, turquoise on hover */
.audio-video-btn {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0 0 0 3px;
  border: 0;
  border-radius: 999px;
  background: #FF9E7A;
  color: #2A0D35;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: all 300ms;
}
.audio-video-btn svg { width: 20px; height: 20px; }
.audio-video-btn:hover,
.audio-video-btn:focus-visible,
.audio-cover-wrap:hover .audio-video-btn {
  background: #7CF2D4;
  color: #2A0D35;
}
/* Small covers in the list rows: dark, so it doesn't compete with the orange audio button */
.audio-row .audio-video-btn {
  width: 28px; height: 28px; padding-left: 2px;
  background: rgba(42, 13, 53, 0.72);
  color: #FFFFFF;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.audio-row .audio-video-btn svg { width: 11px; height: 11px; }
.audio-row .audio-video-btn:hover,
.audio-row .audio-video-btn:focus-visible,
.audio-row .audio-cover-wrap:hover .audio-video-btn {
  background: #7CF2D4;
  border-color: #7CF2D4;
  color: #2A0D35;
}

/* Popup */
.video-popup {
  width: min(960px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 20px 20px 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: #2A0D35;
  color: #FFFFFF;
  overflow: auto;
}
.video-popup:focus { outline: none; }
.video-popup::backdrop {
  background: rgba(10, 3, 14, 0.82);
}
.video-popup-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.video-popup-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-popup-title {
  margin: 18px 48px 4px 0;
  font-family: Manrope, sans-serif;
  font-weight: 700;
  font-size: 1.625rem;
  line-height: 1.3;
  color: #FFFFFF;
}
.video-popup-meta {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: 1.125rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.68);
}
.video-popup-close {
  position: absolute;
  right: 20px;
  bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: transparent;
  color: #FFFFFF;
  cursor: pointer;
  transition: all 300ms;
}
.video-popup-close:hover,
.video-popup-close:focus-visible {
  border-color: #7CF2D4;
  color: #7CF2D4;
  background: transparent;
}

/* No pink theme default (Hello: button:focus / :active → #c36).
   Focus by mouse keeps the normal look; hover, click and keyboard focus → turquoise. */
.audio-video-btn:focus { background: #FF9E7A; color: #2A0D35; outline: none; }
.audio-row .audio-video-btn:focus { background: rgba(42, 13, 53, 0.72); color: #FFFFFF; }
.video-popup-close:focus { background: transparent; border-color: rgba(255, 255, 255, 0.28); color: #FFFFFF; outline: none; }

.audio-cover-wrap .audio-video-btn:hover,
.audio-cover-wrap .audio-video-btn:active,
.audio-cover-wrap .audio-video-btn:focus-visible,
.audio-cover-wrap:hover .audio-video-btn {
  background: #7CF2D4;
  border-color: #7CF2D4;
  color: #2A0D35;
}
.video-popup .video-popup-close:hover,
.video-popup .video-popup-close:active,
.video-popup .video-popup-close:focus-visible {
  background: transparent;
  border-color: #7CF2D4;
  color: #7CF2D4;
}

/* Video page: hidden cards ("Mehr laden") and the button (looks like btn btn-secondary) */
.e-collection-loop-layout-base > [hidden] { display: none !important; }
.load-more-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: calc(var(--space-l, 32px));
}
.load-more,
.load-more:focus {
  font-family: Manrope, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  padding: 14px 26px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  background: transparent;
  color: #FFFFFF;
  cursor: pointer;
  outline: none;
  transition: all 300ms;
}
.load-more-wrap .load-more:hover,
.load-more-wrap .load-more:active,
.load-more-wrap .load-more:focus-visible {
  background: transparent;
  border-color: #7CF2D4;
  color: #7CF2D4;
  transform: translate3d(0, -2px, 0);
}

/* Popup: portrait videos (most video posts) → video left, info on the right */
.video-popup-info { position: relative; }
.video-popup[open].is-portrait {
  width: fit-content;
  max-width: calc(100vw - 32px);
  display: grid;
  grid-template-columns: auto minmax(220px, 300px);
  gap: 24px;
  align-items: start;
  padding: 20px;
}
.video-popup.is-portrait .video-popup-frame {
  height: min(80vh, 760px);
  width: auto;
  aspect-ratio: 9 / 16;
}
.video-popup.is-portrait .video-popup-info { align-self: center; margin: 0; }
.video-popup.is-portrait .video-popup-title { margin: 0 0 6px 0; }
.video-popup.is-portrait .video-popup-close { top: 20px; bottom: auto; }
/* Mobile: popup fills the screen (aubergine). Video at the bottom, full width in its own aspect ratio
   (--vr, from Vimeo), at most 95 % of the CURRENT screen height (dvh = without the browser
   bars, so nothing is cut off and nothing scrolls); if it would be taller, it gets narrower. Title + client · year lie
   over the top of the video on an aubergine → transparent gradient; orange × bottom right. */
@media (max-width: 767px) {
  .video-popup[open],
  .video-popup[open].is-portrait {
    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: 100%;
    grid-template-areas: "v";
    gap: 0;
    width: 100vw; max-width: 100vw;
    height: 100vh; height: 100dvh; max-height: 100dvh;
    margin: 0; padding: 0;
    border: 0; border-radius: 0;
    background: #2A0D35;
    overflow: hidden;
  }
  .video-popup::backdrop { background: #2A0D35; }
  .video-popup .video-popup-frame,
  .video-popup.is-portrait .video-popup-frame,
  .video-popup .video-popup-info,
  .video-popup .video-popup-close { grid-area: v; }

  .video-popup .video-popup-frame,
  .video-popup.is-portrait .video-popup-frame {
    width: min(100vw, 95vh * var(--vr, 0.5625));
    width: min(100vw, 95dvh * var(--vr, 0.5625));
    height: auto; aspect-ratio: var(--vr, 0.5625);
    margin: 0; border-radius: 0;
    align-self: end; justify-self: center;   /* video sits at the bottom of the screen */
  }

  .video-popup .video-popup-info,
  .video-popup.is-portrait .video-popup-info {
    align-self: start; justify-self: stretch; z-index: 2; margin: 0;   /* title stays at the top of the screen */
    padding: 16px 20px 120px;
    contain: inline-size;   /* long titles wrap instead of widening the popup */
    background: linear-gradient(180deg, #2A0D35 0%, rgba(42, 13, 53, 0.85) 35%, rgba(42, 13, 53, 0.4) 70%, rgba(42, 13, 53, 0) 100%);
    pointer-events: none;   /* taps go through to the video */
  }
  .video-popup .video-popup-title,
  .video-popup.is-portrait .video-popup-title { margin: 0 0 2px; font-size: 1.25rem; }
  .video-popup .video-popup-meta { font-size: 1rem; }

  /* × bottom right on the video, orange so it stands out; above Vimeo's control bar */
  .video-popup .video-popup-close,
  .video-popup.is-portrait .video-popup-close,
  .video-popup .video-popup-close:focus {
    position: relative; inset: auto;
    align-self: end; justify-self: end; z-index: 3;
    /* right edge of the video + 16px (the video can be narrower than the screen) */
    margin: 0 calc((100vw - min(100vw, 95vh * var(--vr, 0.5625))) / 2 + 16px) 64px 0;
    margin-right: calc((100vw - min(100vw, 95dvh * var(--vr, 0.5625))) / 2 + 16px);
    width: 44px; height: 44px;
    border: 0; background: #FF9E7A; color: #2A0D35;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }
  .video-popup .video-popup-close:hover,
  .video-popup .video-popup-close:active,
  .video-popup .video-popup-close:focus-visible {
    border: 0; background: #7CF2D4; color: #2A0D35;
  }
  /* Landscape videos (references on Video + audio references with video): video in the middle
     of the screen, × right below the video */
  .video-popup:not(.is-portrait) .video-popup-frame { align-self: center; }
  .video-popup:not(.is-portrait) .video-popup-close,
  .video-popup:not(.is-portrait) .video-popup-close:focus {
    align-self: center;
    margin: calc(100vw / var(--vr, 1.7778) + 44px + 32px) 16px 0 0;
  }
}

/* Video cards: orange-pink gradient, turquoise-violet on hover (fades smoothly) */
.video-tile::before,
.video-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.video-tile::before { background: linear-gradient(160deg, #FF9E7A 0%, #FF9E7A 50%, #F4789A 100%); }
.video-tile::after {
  background: linear-gradient(160deg, #7CF2D4 0%, #7CF2D4 50%, #A99AF0 100%);
  opacity: 0;
  transition: opacity 300ms;
}
.video-tile:hover::after,
.video-tile:focus-within::after { opacity: 1; }
.video-tile > * { position: relative; z-index: 1; }
.video-tile:hover .video-tile-link { text-underline-offset: 6px; }
.video-tile-link { text-underline-offset: 4px; }
/* The invisible button that opens the popup */
.video-tile > .video-tile-open,
.video-tile > .video-tile-open:hover,
.video-tile > .video-tile-open:focus,
.video-tile > .video-tile-open:active {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
  outline: none;
}
.video-tile > .video-tile-open:focus-visible { outline: 2px solid #2A0D35; outline-offset: -4px; }

/* Über mich: Instagram feed (plugin) without its own header and buttons
   (the page has its own title and "Auf Instagram folgen" button) */
#instagram-feed .sb_instagram_header,
#instagram-feed #sbi_load { display: none !important; }
#instagram-feed #sb_instagram { padding: 0 !important; }
#instagram-feed #sbi_images { padding: 0 !important; }
#instagram-feed .sbi_photo { border-radius: calc(var(--radius-m, 12px)); overflow: hidden; }
