/*
 * Kitchen Infinity – shared inner-page components (from docs/pages/_dev/css/10-components.css + 00-core.css)
 * page-banner, page-title, pagination, small button, back-link, ki-block spacing, image-carousel, dark header.
 * Enqueued site-wide by kitcheninfinity_scripts(); templates: template-parts/components/*.php
 */

/* dark header (pages without a banner – Figma "Header_black") */
.site-header--dark {
  color: var(--wp--preset--color--ink-2);
}

.site-header--dark:not(.is-solid):not(.is-menu-open):not(.is-search-open) .site-header__actions .wp-block-button__link:hover {
  color: var(--wp--preset--color--cream);
}

/* button – small size (Figma "button" 18/18, 54px high): Back to …, Download Catalogue */
.wp-block-button__link.has-small-font-size {
  height: 54px;
  padding: var(--ki-btn-nudge) 25px 0;
  font-size: 18px;
  line-height: 18px;
}

/* section spacing on inner pages: 200px (mobile 80) */
.ki-block {
  padding-top: 200px;
}

/* ---------- page-banner (Figma "Mask group" 1440×560, mobile 390×390) ---------- */
.ki-page-banner {
  position: relative;
  height: 560px;
  overflow: hidden;
  color: var(--wp--preset--color--white);
  background: #d9d9d9;
}

.ki-page-banner__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ki-page-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .4) 0%, rgba(0, 0, 0, 0) 35%), linear-gradient(180deg, rgba(0, 0, 0, 0) 46%, rgba(0, 0, 0, .6) 100%);
}

.ki-page-banner__inner {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 53px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 50px;
}

.ki-page-banner__title {
  /* desktop design: "NEWS" (mobile design: "News" – see the 900px query) */
  font-size: var(--ki-h1);
  line-height: var(--ki-h1-lh);
  font-weight: 300;
}

.ki-page-banner__aside {
  margin-left: auto;
}

/* ---------- page-title (dark header pages, Figma "Group 113 / 168 / 206") ---------- */
.ki-page-title {
  padding-top: 183px;
}

.ki-page-title .ki-container {
  padding-bottom: 40px;
  position: relative;
}

.ki-page-title .ki-container::after {
  content: "";
  position: absolute;
  left: var(--ki-gutter);
  right: var(--ki-gutter);
  bottom: 0;
  height: 1px;
  background: rgba(137, 123, 113, .5);
}

.ki-page-title__eyebrow {
  font-size: 20px;
  line-height: 25px;
  font-weight: 500;
  margin-bottom: 20px;
}

.ki-page-title .page-title {
  font-size: var(--ki-h2);
  line-height: 1.2;
  font-weight: 300;
}

.ki-page-title__subtitle {
  margin-top: 20px;
  font-size: 20px;
  line-height: 25px;
  font-weight: 500;
}

/* ---------- pagination "‹ 01 02 03 ›" (Figma "Frame 18413893"), current = taupe ---------- */
.ki-pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  font-size: 18px;
  line-height: 18px;
}

.ki-pagination .prev, .ki-pagination .next{
  transform: none !important;
}

.ki-pagination .prev {
  margin-right: -25px;
}

.ki-pagination .next {
  margin-left: -25px;
}

.ki-pagination .page-numbers {
  color: var(--wp--preset--color--ink-2);
  transition: color .3s;
}
.ki-pagination .page-numbers.next,
.ki-pagination .page-numbers.prev {
  padding-top: 0px;
}

.ki-pagination a.page-numbers:hover,
.ki-pagination .page-numbers.current {
  color: var(--wp--preset--color--taupe);
}

.ki-pagination .prev,
.ki-pagination .next {
  display: inline-flex;
  color: var(--wp--preset--color--ink-2);
  transform: translateY(-2px);
}

.ki-pagination .is-disabled {
  cursor: default;
}

.ki-pagination .page-numbers.dots {
  color: var(--wp--preset--color--muted);
}

/* ---------- back-link ("Back to …" at the end of detail pages, Figma "Frame 17") ---------- */
.ki-back-link {
  padding-top: 100px;
}

/* ---------- image-carousel (free-width slides + shared pager) ---------- */
.ki-carousel {
  overflow: hidden;
}

.ki-carousel__head {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 50px;
}

.ki-carousel__head h2 {
  font-size: var(--ki-h2);
  line-height: var(--ki-h2-lh);
  font-weight: 300;
}

.ki-carousel__swiper {
  overflow: visible;
  margin-left: -1px;
}

.ki-carousel__swiper:not(.swiper-initialized) .ki-carousel__track {
  display: flex;
  gap: 20px;
}

.ki-carousel__slide {
  flex-shrink: 0;
  width: min-content!important;
  margin: 0;
}

.ki-carousel__slide img {
  display: block;
  height: var(--slide-h);
  width: auto;
  max-width: none;
  object-fit: cover;
  background: #d9d9d9;
}

/* fixed slide width (image-carousel $w / $mw), image cropped to cover */
.ki-carousel__slide--fixed img {
  width: var(--slide-w);
}

.ki-carousel__slide figcaption {
  margin: 28px 0 0;
  /* reset core .wp-element-caption margin-bottom (1em) */
  font-size: 20px;
  line-height: 25px;
  font-weight: 500;
  color: rgba(44, 44, 44, .5);
}

.ki-carousel__pager {
  display: flex;
  justify-content: flex-end;
  margin-top: 47px;
}

@media (max-width: 900px) {
  .wp-block-button__link.has-small-font-size {
    height: 44px;
    padding: var(--ki-btn-nudge) 25px 0;
    font-size: 16px;
    line-height: 1.5;
  }

  .ki-pagination .prev {
    margin-right: -14.5px;
  }

  .ki-pagination .next {
    margin-left: -14.5px;
  }

  .ki-block {
    padding-top: 80px;
  }

  .ki-page-banner {
    height: 390px;
  }

  .ki-page-banner__inner {
    bottom: 35px;
    flex-wrap: wrap;
    gap: 15px 20px;
    align-items: flex-end;
  }

  .ki-page-banner__title {
    flex: 1 0 100%;
    text-transform: none;
  }

  .ki-page-banner__aside {
    position: absolute;
    right: var(--ki-gutter);
    bottom: 0;
  }

  .ki-page-title {
    padding-top: 121px;
  }

  .ki-page-title .ki-container {
    padding-bottom: 20px;
  }

  .ki-page-title__eyebrow {
    font-size: 16px;
    line-height: 1.2;
    margin-bottom: 15px;
  }

  .ki-page-title__subtitle {
    margin-top: 15px;
    font-size: 16px;
    line-height: 1.2;
  }

  .ki-pagination .nav-links {
    gap: 28px;
    font-size: 16px;
  }

  .ki-back-link {
    padding-top: 40px;
  }

  .ki-carousel__head {
    gap: 20px;
    margin-bottom: 40px;
  }

  .ki-carousel__swiper:not(.swiper-initialized) .ki-carousel__track {
    gap: 15px;
  }

  .ki-carousel__slide img {
    height: var(--slide-mh);
  }

  .ki-carousel__slide--fixed img {
    width: min(var(--slide-mw), calc(100vw - 40px));
  }

  .ki-carousel__slide figcaption {
    margin: 20px 0 0;
    font-size: 16px;
    line-height: 24px;
  }

  .ki-carousel__pager {
    margin-top: 35px;
  }
}

/* ---------- grid + video card (Operating Manual, search) + video popup [data-ki-video] ---------- */
.ki-grid {
  display: grid;
  gap: 50px 16px;
}

.ki-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ki-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 26px;
}

.ki-grid .post-thumbnail {
  display: block;
  aspect-ratio: 355/298;
}

.ki-grid .entry-title {
  margin-top: 20px;
}

.ki-grid .entry-title a {
  background: linear-gradient(currentColor,currentColor) 0 100%/0 1px no-repeat;
  transition: background-size .45s var(--ki-ease-out);
}
.ki-grid .entry-title a:hover {
  background-size: 100% 1px;
}

.ki-video-thumb {
  position: relative;
  aspect-ratio: 533/300!important;
}

.ki-video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .12);
  transition: background .4s;
}

.ki-video-thumb:hover::after {
  background: rgba(0, 0, 0, .25);
}

.ki-video-thumb__play {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: 101px;
  height: 101px;
  margin: -50.5px 0 0 -50.5px;
  color: #fff;
  transition: transform .5s var(--ki-ease-out);
}

.ki-video-thumb__play svg {
  width: 100%;
  height: 100%;
}

.ki-video-thumb:hover .ki-video-thumb__play {
  transform: scale(1.08);
}

@media (max-width: 900px) {
  .ki-grid {
    gap: 40px;
  }

  .page-template-brands .ki-page-banner::after {
    background: linear-gradient(360deg, rgba(0, 0, 0, 0) 27.61%, rgba(0, 0, 0, 0.5) 100.38%), linear-gradient(180deg, rgba(0, 0, 0, 0) 57.18%, rgba(0, 0, 0, 0.5) 99.96%);
  }

  .ki-grid--3,
  .ki-grid--2 {
    grid-template-columns: 1fr;
  }

  .ki-grid .post-thumbnail {
    aspect-ratio: 349/293;
  }

  .ki-video-thumb {
    aspect-ratio: 349/196!important;
  }

  .ki-video-thumb__play {
    width: 66px;
    height: 66px;
    margin: -33px 0 0 -33px;
  }
}

.ki-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: rgba(26, 30, 33, .9);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s, visibility 0s .4s;
}

.ki-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.ki-lightbox__frame {
  width: min(1320px, 100%);
  aspect-ratio: 16/9;
  background: #000;
}

.ki-lightbox__frame iframe,
.ki-lightbox__frame video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.ki-lightbox__close {
  position: absolute;
  top: 24px;
  right: 30px;
  width: 32px;
  height: 32px;
}

.ki-lightbox__close::before,
.ki-lightbox__close::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1.5px;
  background: #fff;
  transform: rotate(45deg);
}

.ki-lightbox__close::after {
  transform: rotate(-45deg);
}

@media (max-width: 900px) {
  .ki-lightbox {
    padding: 20px;
  }
}
