/*
Theme Name: Provocation Bureau
Theme URI: https://provocationbureau.com/
Author: Provocation Bureau
Description: Custom téma Provocation Bureau 2026. Assets sú v priečinku assets/ témy (build cez deploy/build-theme.sh).
Version: 1.1.0
Text Domain: pb-theme
*/

body.admin-bar .marquee-bar {
  top: var(--wp-admin--admin-bar--height, 32px);
}

body.admin-bar.page-home .nav,
body.admin-bar .ref-top-chrome {
  top: calc(var(--marquee-bar-height, 0px) + var(--wp-admin--admin-bar--height, 32px));
}

body.admin-bar .ref-top-chrome .nav,
body.admin-bar .ref-top-chrome .ref-breadcrumbs {
  top: auto;
}

@media screen and (max-width: 782px) {
  body.admin-bar .marquee-bar,
  body.admin-bar.page-home .nav,
  body.admin-bar .ref-top-chrome {
    top: calc(var(--marquee-bar-height, 0px) + var(--wp-admin--admin-bar--height, 46px));
  }
}

/* Mobile hero: keep copy below header logo / 3D logo; admin bar shrinks viewport. */
@media (max-width: 767px) {
  body.admin-bar.page-home {
    --home-nav-offset: calc(3.35rem + env(safe-area-inset-top, 0px) + var(--wp-admin--admin-bar--height, 46px));
  }

  body.page-home .hero-cluster {
    top: clamp(10.25rem, 43vh, 18.5rem);
    bottom: var(--home-hero-bottom);
    height: auto;
    justify-content: flex-end;
    overflow: hidden;
  }

  body.admin-bar.page-home .hero-cluster {
    top: clamp(11.5rem, 47vh, 20.5rem);
  }

  body.page-home.logo-3d-off .hero-cluster {
    top: auto;
  }

  body.admin-bar.page-ref-template {
    --ref-hero-safe-top: calc(
      var(--marquee-bar-height) + var(--ref-nav-bar-height) + var(--ref-breadcrumbs-height) +
        var(--wp-admin--admin-bar--height, 46px) + 0.25rem
    );
  }

  body.page-ref-template .hero-cluster {
    max-height: calc(
      100dvh - var(--ref-hero-safe-top) - var(--ref-hero-above-dock) - env(safe-area-inset-bottom, 0px)
    );
    overflow: hidden;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  body.page-home .hero-cluster {
    top: clamp(9.75rem, 40vh, 16.5rem);
  }

  body.admin-bar.page-home .hero-cluster {
    top: clamp(11rem, 44vh, 18.5rem);
  }
}

/* Breadcrumbs — kompaktnejšie, bližšie k navigácii. */
body.page-ref-template {
  --ref-breadcrumbs-height: 1.7rem;
}

body.page-ref-template .ref-top-chrome .ref-breadcrumbs {
  min-height: var(--ref-breadcrumbs-height);
  padding-top: 0.05rem;
  padding-bottom: 0.2rem;
}

@media (max-width: 767px) {
  body.page-ref-template {
    --ref-breadcrumbs-height: 1.55rem;
    --ref-hero-safe-top: calc(
      var(--marquee-bar-height) + var(--ref-nav-bar-height) + var(--ref-breadcrumbs-height) + 0.25rem
    );
  }

  body.page-ref-template .ref-top-chrome .nav {
    padding-bottom: 0.35rem;
  }
}

@media (min-width: 768px) {
  body.page-ref-template .ref-top-chrome .nav {
    padding-bottom: 0.45rem;
  }
}

/* Galéria — 1 stĺpec: full width cez celý viewport. */
body.page-ref-template .ref-template-gallery .ref-template-masonry.ref-template-masonry--cols-1 {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  align-items: stretch;
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-inline: 0;
  column-count: 1 !important;
  columns: auto !important;
}

body.page-ref-template .ref-template-gallery .ref-template-masonry.ref-template-masonry--cols-1 .ref-template-masonry__item {
  display: block;
  width: 100%;
  margin: 0;
  break-inside: auto;
  page-break-inside: auto;
  -webkit-column-break-inside: auto;
  border-radius: 0;
}

/* Videá nad galériou — šírka ako text (body/about), max 80vh výška. */
body.page-ref-template .ref-template-videos {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(1rem, 3vw, 2rem);
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: clamp(1rem, 3vw, 2rem);
  padding-inline: var(--spacing-tiny);
}

@media (min-width: 768px) {
  body.page-ref-template .ref-template-videos {
    padding-inline: var(--spacing-small);
  }
}

@media (max-width: 767px) {
  body.page-ref-template .ref-template-videos {
    padding-left: max(var(--spacing-tiny), env(safe-area-inset-left, 0px));
    padding-right: max(var(--spacing-tiny), env(safe-area-inset-right, 0px));
  }
}

body.page-ref-template .ref-template-video {
  width: 100%;
  margin: 0;
}

body.page-ref-template .ref-template-video__frame {
  position: relative;
  width: min(100%, calc(80dvh * 16 / 9));
  max-width: 100%;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  max-height: 80dvh;
  height: auto;
  overflow: hidden;
  border-radius: 0.35rem;
  background: #000;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

body.page-ref-template .ref-template-video__embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

body.page-ref-template .ref-template-video__caption {
  margin: 0.65rem 0 0;
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--page-fg) 62%, transparent);
  text-align: center;
}

body.page-ref-template .ref-template-videos + .ref-template-gallery {
  margin-top: 0;
}

/* Filter panel: clip + slide from the left. Inner track stays nowrap so
   the bar height never jumps. Width collapses after the close slide. */
body.page-home .references__filters {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: stretch;
  min-width: 0;
  width: auto;
  max-width: 0;
  height: 1.7rem;
  max-height: 1.7rem;
  overflow: hidden;
  opacity: 1;
  visibility: hidden;
  pointer-events: none;
  transform: none;
  background: transparent;
  box-shadow: none;
  transition: max-width 0.01s 0.36s var(--ease, ease), visibility 0s 0.36s;
}

body.page-home .references__filter-control[data-filter-open="true"] .references__filters {
  max-width: 100%;
  height: 1.7rem;
  max-height: 1.7rem;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: max-width 0s, visibility 0s;
}

body.page-home .references__filters-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.85rem;
  width: max-content;
  height: 1.7rem;
  transform: translateX(-110%);
  transition: transform 0.38s var(--ease, ease);
}

body.page-home .references__filter-control[data-filter-open="true"] .references__filters-track {
  transform: translateX(0);
}

body.page-home .references__filter-toggle-count,
body.page-home .references__filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.15rem;
  padding: 0 0.34rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  opacity: 1;
}

body.page-home .references__filter.is-active .references__filter-count,
body.page-home .references__filter-control[data-filter-open="true"] .references__filter-toggle-count {
  background: var(--home-accent);
  color: #050505;
}

body.page-home[data-theme="light"] .references__filter-toggle-count,
body.page-home[data-theme="light"] .references__filter-count {
  background: rgba(16, 19, 23, 0.1);
}

body.page-home[data-theme="light"] .references__filter.is-active .references__filter-count,
body.page-home[data-theme="light"] .references__filter-control[data-filter-open="true"] .references__filter-toggle-count {
  background: var(--home-accent);
  color: #050505;
}

@media (max-width: 767px) {
  body.page-home .references__filters {
    width: 100%;
    max-width: 100%;
    height: 0;
    max-height: 0;
    transition: max-height 0.01s 0.36s var(--ease, ease), visibility 0s 0.36s;
  }

  body.page-home .references__filter-control[data-filter-open="true"] .references__filters {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 12rem;
    transition: max-height 0s, visibility 0s;
  }

  body.page-home .references__filters-track {
    flex-wrap: wrap;
    width: 100%;
    height: auto;
    row-gap: 0.45rem;
  }
}

/* Case nav — text-only, within same služba category (PHP-rendered). */
body.page-ref-template .ref-case-nav {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1rem, 4vw, 2.5rem);
  border-top: 1px solid color-mix(in srgb, var(--page-fg) 22%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--page-fg) 22%, transparent);
  background: color-mix(in srgb, var(--page-fg) 4%, var(--page-bg));
}

body.page-ref-template .ref-case-nav__kicker {
  margin: 0 0 1rem;
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ref-palette-accent, var(--home-accent, var(--brand-accent)));
}

body.page-ref-template .ref-case-nav__rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 4vw, 3rem);
}

body.page-ref-template .ref-case-nav__link {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
  padding: 0;
  color: var(--page-fg);
  text-decoration: none;
  overflow: visible;
  transition: color 0.22s var(--ease, ease);
}

body.page-ref-template .ref-case-nav__link--next {
  text-align: right;
  align-items: flex-end;
}

body.page-ref-template .ref-case-nav__bg,
body.page-ref-template .ref-case-nav__client {
  display: none !important;
}

body.page-ref-template .ref-case-nav__link::after {
  content: none !important;
}

body.page-ref-template .ref-case-nav__dir {
  font-family: "Space Mono", monospace;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--page-fg) 58%, transparent);
}

body.page-ref-template .ref-case-nav__dir::before,
body.page-ref-template .ref-case-nav__dir::after {
  color: var(--ref-palette-accent, var(--home-accent, var(--brand-accent)));
}

body.page-ref-template .ref-case-nav__link--prev .ref-case-nav__dir::before {
  content: "← ";
}

body.page-ref-template .ref-case-nav__link--next .ref-case-nav__dir::after {
  content: " →";
}

body.page-ref-template .ref-case-nav__title {
  font-family: var(--font-body);
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--page-fg);
}

body.page-ref-template .ref-case-nav__link:hover .ref-case-nav__title,
body.page-ref-template .ref-case-nav__link:focus-visible .ref-case-nav__title {
  color: var(--ref-palette-accent, var(--home-accent, var(--brand-accent)));
}

body.page-ref-template .ref-case-nav__link:focus-visible {
  outline: 2px solid var(--ref-palette-accent, var(--home-accent, var(--brand-accent)));
  outline-offset: 4px;
}

@media (max-width: 639px) {
  body.page-ref-template .ref-case-nav__rail {
    grid-template-columns: 1fr;
  }

  body.page-ref-template .ref-case-nav__link--next {
    text-align: left;
    align-items: flex-start;
  }
}
