/*
 * Video Catalog — layer on top of Bulma and the base stylesheet in assets/source-ui/.
 * Holds the palette variables, the scroll-snap carousel, the video player and the
 * components the base stylesheet does not cover.
 */

:root {
  --bulma-scheme-h: 0;
  --bulma-scheme-s: 0%;
  --bulma-scheme-main-l: 0%;
  --bulma-primary-h: 19deg;
  --bulma-primary-s: 90%;
  --bulma-primary-l: 51%;
  --vc-accent: #ff8c42;
  --vc-accent-strong: #ff6600;
  --vc-surface: #1a1a1a;
  --vc-border: #2a2a2a;
}

html,
body {
  background: #000;
}

img.lazy {
  min-height: 1px;
}

.skip-link:focus {
  position: fixed !important;
  top: 8px;
  left: 8px;
  z-index: 10000;
  width: auto !important;
  height: auto !important;
  clip: auto !important;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: var(--vc-accent);
  color: #000 !important;
}

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

.site-branding {
  align-items: center;
  padding: 20px 0 !important;
  margin: 0 0 1rem !important;
  border-radius: 0;
}

.navbar-menu {
  background: none;
  border-radius: 1rem;
  box-shadow: none;
}

.navbar-start .navbar-item.is-active {
  color: var(--vc-accent) !important;
}

#mobile-search-toggle,
.navbar-burger {
  color: #fff;
}

#mobile-search-toggle {
  align-self: center;
}

.navbar-item img,
.navbar-item svg {
  max-height: 80px;
}

.site-title-text {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #fff !important;
}

.site-title-text i {
  color: var(--vc-accent);
}

.navbar-end .navbar-item {
  position: relative;
}

#mobile-search {
  position: relative;
}

#mobile-search input,
#primaryNavbar .navbar-end #searchform input,
#results,
#mobile-search-results {
  background-color: #222;
}

.search-results {
  width: 100%;
  max-height: 70vh;
  overflow-y: auto !important;
  text-align: left;
}

.search-results a {
  display: block;
  border-radius: 6px;
}

.search-results a:hover {
  background: #262626;
}

.search-results .level-item {
  justify-content: flex-start;
}

.search-thumb {
  flex: 0 0 48px;
  width: 48px;
}

.search-thumb img {
  width: 48px;
  height: 27px;
  border-radius: 4px;
  object-fit: cover;
}

.hot-posts-title,
.search-results-title {
  margin: 0.35rem 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--vc-accent) !important;
}

/*
 * Desktop header: logo, menu and search always share one row. The menu takes the space left
 * between the other two; links that do not fit are moved into a "more" dropdown by theme.js,
 * and until the script runs the row scrolls sideways instead of wrapping.
 */
@media screen and (min-width: 1024px) {
  .navbar-brand {
    flex-shrink: 0;
  }

  .navbar-menu {
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
  }

  .navbar-start {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .navbar-start::-webkit-scrollbar {
    display: none;
  }

  /* The dropdown hangs below the row, so nothing may clip it once the links are known to fit. */
  .navbar-start.has-priority-nav {
    overflow: visible;
  }

  .navbar-start.is-measuring {
    overflow: hidden;
  }

  #primaryNavbar .navbar-start > .navbar-item {
    flex: 0 0 auto;
    margin: 0 0.1rem;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
  }

  /* Auto margins centre the group while there is room and collapse to nothing when there is not. */
  #primaryNavbar .navbar-start > .navbar-item:first-child {
    margin-inline-start: auto;
  }

  #primaryNavbar .navbar-start > .navbar-item:last-child {
    margin-inline-end: auto;
  }

  .navbar-end {
    flex: 0 0 auto;
    margin-inline-start: 0;
  }

  /* The search box gives way to the menu on ordinary laptops and reaches full width on wide screens. */
  #primaryNavbar .navbar-end #searchform input {
    width: clamp(180px, calc(22vw - 40px), 450px);
  }

  #results {
    left: auto;
    min-width: min(360px, 90vw);
  }

  #primaryNavbar .navbar-start > .navbar-more {
    position: relative;
    padding: 0;
  }

  .navbar-more > .navbar-link {
    padding: 0.5rem 2.2rem 0.5rem 0.75rem;
    background: transparent !important;
    cursor: pointer;
    white-space: nowrap;
  }

  .navbar-more > .navbar-link::after {
    border-color: var(--vc-accent);
  }

  .navbar-more .navbar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    z-index: 40;
    display: none;
    min-width: 12rem;
    padding: 0.4rem;
    border: 1px solid var(--vc-border);
    border-top: 2px solid var(--vc-accent);
    border-radius: 0 0 8px 8px;
    background: var(--vc-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  }

  .navbar-more:hover .navbar-dropdown,
  .navbar-more:focus-within .navbar-dropdown,
  .navbar-more.is-active .navbar-dropdown {
    display: block;
  }

  .navbar-more .navbar-dropdown .navbar-item {
    display: block;
    margin: 0;
    padding: 0.55rem 0.9rem;
    border-radius: 6px;
    white-space: nowrap;
  }

  .navbar-more .navbar-dropdown .navbar-item:hover,
  .navbar-more .navbar-dropdown .navbar-item:focus-visible {
    background-color: #262626 !important;
  }
}

@media screen and (max-width: 1023px) {
  .navbar-start {
    flex-direction: column;
  }

  .site-title-text {
    font-size: 1.25rem;
  }
}

/* ---------- Quick buttons ---------- */

.home-top-btn-a i {
  color: #ffc93c !important;
}

.home-top-btn-a:hover {
  border-color: #ffc93c !important;
  box-shadow: 0 6px 20px rgba(255, 201, 60, 0.28) !important;
}

.home-top-btn-b i {
  color: #ff5fa2 !important;
}

.home-top-btn-b:hover {
  border-color: #ff5fa2 !important;
  box-shadow: 0 6px 20px rgba(255, 95, 162, 0.28) !important;
}

.home-top-btn-c i {
  color: #33a8e6 !important;
}

.home-top-btn-c:hover {
  border-color: #33a8e6 !important;
  box-shadow: 0 6px 20px rgba(51, 168, 230, 0.28) !important;
}

.tags-scroll {
  gap: 0.25rem;
}

/* ---------- Cards ---------- */

.post-thumbnail {
  aspect-ratio: 16 / 9;
  background: #111;
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.thumb-block a:hover .post-thumbnail img {
  transform: scale(1.04);
}

.loop-video .post-header {
  margin-top: 0.5rem;
}

.loop-video .post-header h3 {
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.45;
}

.thumb-block a:focus-visible {
  outline: 2px solid var(--vc-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Popular strip (scroll-snap carousel) ---------- */

.swiper-container {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.swiper-container::-webkit-scrollbar {
  display: none;
}

.swiper-container:focus-visible {
  outline: 2px solid var(--vc-accent);
  outline-offset: 4px;
}

.swiper-wrapper {
  display: flex;
  gap: 10px;
}

.swiper-slide {
  flex: 0 0 calc((100% - 10px * 2) / 2.1);
  min-width: 0;
  scroll-snap-align: start;
}

.swiper-container.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.swiper-container.is-dragging a {
  pointer-events: none;
}

@media screen and (min-width: 768px) {
  .swiper-slide {
    flex-basis: calc((100% - 10px * 3) / 3.1);
  }
}

@media screen and (min-width: 1024px) {
  .swiper-slide {
    flex-basis: calc((100% - 10px * 5) / 5.1);
  }
}

/* ---------- Listings ---------- */

.archive-description {
  margin-bottom: 1.25rem;
  color: #cfcfcf !important;
  font-size: 0.95rem;
}

.archive-description p {
  color: #cfcfcf !important;
}

.category-title-section .is-flex {
  row-gap: 0.5rem;
}

.pagination-link.is-current {
  border-color: var(--vc-accent);
  background-color: var(--vc-accent);
  color: #000 !important;
}

.pagination-previous[disabled],
.pagination-next[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.pagination-previous,
.pagination-next,
.pagination-link {
  color: #fff !important;
}

.term-index .tag {
  height: auto;
  padding: 0.5rem 0.85rem;
  background: var(--vc-surface);
  border: 1px solid var(--vc-border);
  color: #fff !important;
}

.term-index .tag:hover {
  border-color: var(--vc-accent);
  color: var(--vc-accent) !important;
}

.term-index__count {
  margin-left: 0.5rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: #2a2a2a;
  font-size: 0.75em;
  color: #bbb !important;
}

/* ---------- Watch page ---------- */

.video-breadcrumb {
  margin-bottom: 0.5rem !important;
}

.video-breadcrumb a {
  padding: 0 0.5em;
}

.video-breadcrumb li:first-child a {
  padding-left: 0;
}

.video-breadcrumb li.is-active a {
  color: #999 !important;
}

.video-header h1 {
  font-weight: 600;
  line-height: 1.45;
}

.video-player-with-banners {
  position: relative;
}

.responsive-player {
  position: relative;
  width: 100%;
  height: auto;
  max-height: 550px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  /* border-radius: 8px; */
  background: #000;
}

.responsive-player iframe,
.responsive-player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.video-catalog-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.video-catalog-empty img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.video-catalog-empty p {
  position: relative;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.7);
}

.video-servers {
  gap: 0.5rem;
}

.video-servers .button.is-active {
  background-color: var(--vc-accent) !important;
  border-color: var(--vc-accent) !important;
  color: #000 !important;
}

/*
 * Facts under the player. Wide screens: one line of "label : value" pairs divided by hairlines.
 * Phones: a boxed grid with the label above its value, so every pair lines up in columns.
 */
.video-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

/* Each item carries a left hairline; the negative margin pushes the first one of every row out of the clipped box. */
.video-facts {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.video-facts__list {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.45rem;
  margin: 0 0 0 calc(-0.9rem - 1px);
  padding: 0;
  list-style: none;
}

.video-facts__item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0 0.9rem;
  border-left: 1px solid #3a3a3a;
  font-size: 0.92rem;
  line-height: 1.5;
}

.video-facts__label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  color: #b5b5b5 !important;
  white-space: nowrap;
}

.video-facts__label::after {
  content: ":";
}

.video-facts__label i {
  width: 1.05rem;
  font-size: 0.9em;
  text-align: center;
}

.video-facts__value {
  color: #fff !important;
  font-weight: 500;
}

.video-meta__actions {
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .video-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .video-facts {
    overflow: visible;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--vc-border);
    border-radius: 10px;
    background: #161616;
  }

  /* Three columns on a phone; tablets fit as many as the row holds. */
  .video-facts__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
    gap: 0.2rem 0.2rem;
    margin: 0;
  }

  .video-facts__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    min-width: 0;
    padding: 0;
    border-left: 0;
  }

  .video-facts__label {
    gap: 0.35rem;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
  }

  .video-facts__label::after {
    content: none;
  }

  /* No indent under the label: a third of a phone's width has to hold a full date on one line. */
  .video-facts__value {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: break-word;
  }

  /* messages.css centres the report button on phones; here it sits at the right under the facts. */
  .video-meta .vc-report {
    text-align: right;
  }
}

@media (max-width: 480px) {
  .video-facts__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.video-tags .tag {
  background: var(--vc-surface);
  border: 1px solid var(--vc-border);
  color: #fff !important;
}

.video-tags .tag:hover {
  border-color: var(--vc-accent);
  color: var(--vc-accent) !important;
}

.video-tags .tag i {
  color: var(--vc-accent);
}

/*
 * Fixed bottom bar on phones, slimmer than the base stylesheet draws it. The base rules are all
 * !important, hence the same here. The body keeps exactly the bar's height free, plus the
 * home-indicator inset on notched phones.
 */
@media (max-width: 768px) {
  .mobile-nav-bar {
    padding: 0.25rem 0.5rem calc(0.25rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-nav-item {
    gap: 0.1rem !important;
    padding: 0.3rem 0.25rem !important;
  }

  .mobile-nav-icon,
  .mobile-nav-item-home .mobile-nav-icon {
    width: 18px !important;
    height: 18px !important;
    margin-bottom: 0 !important;
    font-size: 1.05rem !important;
  }

  .mobile-nav-text,
  .mobile-nav-item-home .mobile-nav-text {
    font-size: 0.65rem !important;
    line-height: 1.25 !important;
  }

  .mobile-nav-item-home,
  .mobile-nav-item-home:hover {
    transform: none !important;
  }

  body {
    padding-bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ---------- Pages and footer ---------- */

.static-page .content h2,
.static-page .content h3 {
  margin-top: 1.5em;
  color: #fff !important;
}

.static-page .content {
  max-width: 860px;
  line-height: 1.85;
}

.footer-about {
  max-width: 820px;
  margin: 0 auto 1rem;
  font-size: 0.9rem;
}

.footer-about p {
  color: #aaa !important;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
