/* ============================================================
   Katalog Referencji — Book Slider
   Desktop: StPageFlip | Mobile: Slick
   1 referencja = 1 strona | spread = 2 ref | ~700px/stronę
   ============================================================ */

/* ── Sekcja ─────────────────────────────────────────────── */
.modul-references-book {
  padding: 0 0 3rem;
}

/* ── Nagłówek ───────────────────────────────────────────── */
.rb-header__title {
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.rb-header__lead {
  font-size: 1.1rem;
  color: #555;
  padding-bottom: 30px;
}

/* ── Desktop wrapper ────────────────────────────────────── */
.rb-book-outer {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: box-shadow 0.35s ease;
  margin-top: 15px;
}

.rb-book-outer.rb-book-outer--opened {
  box-shadow: 5px 7px 25px rgba(0,0,0,0.1);
}

.rb-book-outer.rb-book-outer--cover .rb-page--cover .rb-page__inner {
  box-shadow: 5px 7px 25px rgba(0,0,0,0.1);
}

.rb-book {
  margin: 0 auto;
}

/* ── Strony wspólne ─────────────────────────────────────── */
.rb-page {
  background: #fff;
  overflow: hidden;
  box-sizing: border-box;
}

.rb-page__inner {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* ── Back cover ─────────────────────────────────────────── */
.rb-page--back-cover .rb-page__inner {
  background: #fff;
  position: relative;
}

.rb-page--back-cover .rb-page__inner::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  height: 68%;
  background-image: url('/wp-content/themes/cobouw/assets/img/arrow-references-right.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

/* ── Okładka ────────────────────────────────────────────── */
.rb-page--cover .rb-page__inner {
  background: #1c1c1c;
}

.rb-cover__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 1;
}

.rb-cover__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 2.5rem 2rem;
}

.rb-page--cover .rb-cover__overlay {
  display: none;
}

.rb-cover__content { color: #fff; }

.rb-page--cover .rb-page__inner::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 70px;
  height: 70px;
  background-color: #fff;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-position: left 8px top 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M16 16L4 4' stroke='%23ff4200' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M10 4H4V10' stroke='%23ff4200' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 3;
}

.rb-cover__sub {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #ff4200;
  margin-bottom: 0.5rem;
}

.rb-cover__title {
  font-size: clamp(1.3rem, 2.8vw, 2.1rem);
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

/* ── Strona referencji ──────────────────────────────────── */
.rb-page--ref .rb-page__inner {
  background: #fff;
}

/* Obszar tekstowy — dynamiczna wysokość */
.rb-ref-head {
  flex: 0 0 auto;
  height: auto;
  overflow: visible;
  position: relative;
  z-index: 0;
  margin-bottom: auto;
  padding: 1.25rem 20% 1rem 55px;
  box-sizing: border-box;
}

.rb-page--ref .rb-ref-head::after {
  content: '';
  position: absolute;
  top: 0;
  width: 220px;
  height: 220px;
  pointer-events: none;
  z-index: -1;
}

/* Lewa strona spreadu: gradient pomarańczowy w prawym górnym rogu */
.rb-page--ref:nth-child(odd) .rb-ref-head::after {
  right: 0;
  background: radial-gradient(circle at top right, rgba(255, 66, 0, 0.22) 0%, rgba(255, 66, 0, 0) 70%);
}

/* Prawa strona spreadu: gradient szary w lewym górnym rogu */
.rb-page--ref:nth-child(even) .rb-ref-head::after {
  left: 0;
  background: radial-gradient(circle at top left, rgba(170, 170, 170, 0.28) 0%, rgba(170, 170, 170, 0) 70%);
}

/* Tytuł — duży, pomarańczowy, poprzedzony " */
.rb-ref-title {
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 700;
  color: #ff4200;
  margin: 0 0 0.6rem;
  line-height: 1.2;
}

.rb-ref-title::before {
  content: '\201C'; /* " */
  display: inline-block;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  color: #ff4200;
  margin-right: 0.2rem;
  font-weight: 700;
  vertical-align: middle;
}

/* Cytat */
.rb-ref-quote {
  font-size: clamp(0.78rem, 1.1vw, 0.9rem);
  font-style: italic;
  color: #444;
  line-height: 1.55;
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Przyciski CTA — jedna linia */
.rb-ref-cta {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
}

/* ── Przycisk — wspólny ─────────────────────────────────── */
.rb-btn {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 0;
  font-family: Poppins, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 24px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid transparent;
  box-sizing: border-box;
}

.rb-btn--primary {
  background: #ff4200;
  color: #fff;
  border-color: #ff4200;
}
.rb-btn--primary:hover {
  background: #e03a00;
  border-color: #e03a00;
  color: #fff;
}

.rb-btn--outline {
  background: #fff;
  color: #aaa;
  border-color: #aaa;
}
.rb-btn--outline:hover {
  background: #ff4200;
  border-color: #ff4200;
  color: #fff;
}

.rb-btn--metryka {
  background: #aaa;
  color: #fff;
  border-color: #aaa;
}
.rb-btn--metryka:hover,
.rb-btn--metryka[aria-expanded="true"] {
  background: #ff4200;
  border-color: #ff4200;
  color: #fff;
}

/* ── Zdjęcie — pełna szerokość strony, odstęp 30px od CTA ─ */
.rb-page--ref .rb-ref-photo {
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
  margin-top: 30px;
  position: relative;
  overflow: hidden;
}

.rb-page--ref .rb-ref-photo::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  pointer-events: none;
  z-index: 2;
}

.rb-page--ref .rb-ref-photo::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 70px;
  height: 70px;
  background-color: #fff;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 3;
}

/* Lewa strona spreadu: od prawej krawędzi do środka */
.rb-page--ref:nth-child(odd) .rb-ref-photo::before {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
}

.rb-page--ref:nth-child(odd) .rb-ref-photo::after {
  left: 0;
  background-position: right 8px top 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M4 16L16 4' stroke='%23ff4200' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M10 4H16V10' stroke='%23ff4200' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Prawa strona spreadu: od lewej krawędzi w prawo */
.rb-page--ref:nth-child(even) .rb-ref-photo::before {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
}

.rb-page--ref:nth-child(even) .rb-ref-photo::after {
  right: 0;
  background-position: left 8px top 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M16 16L4 4' stroke='%23ff4200' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M10 4H4V10' stroke='%23ff4200' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.rb-ref-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rb-ref-photo--empty {
  background: #eee;
}

/* ── Metryka overlay ────────────────────────────────────── */
.rb-metryka-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rb-metryka-overlay[hidden] {
  display: none !important;
}

.rb-metryka-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 1rem;
  font-size: clamp(0.72rem, 1vw, 0.85rem);
}

.rb-metryka-dl a {
  color: #fff;
}
.rb-metryka-dl a:hover {
  color: #ff4200;
}
/* Mobile: metryka od góry zdjęcia */
.rb-slide .rb-metryka-overlay {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 30px 1rem 1rem 25px;
}

.rb-slide .rb-metryka-dl {
  width: auto;
  max-width: 400px;
  margin: 0;
}

/* Desktop (book): metryka w górnych narożnikach, ~50% szerokości strony */
.rb-page--ref .rb-metryka-overlay {
  align-items: flex-start;
  padding: 1rem;
}

.rb-page--ref:nth-child(odd) .rb-metryka-overlay {
  justify-content: flex-start;
}

.rb-page--ref:nth-child(even) .rb-metryka-overlay {
  justify-content: flex-end;
}

.rb-page--ref .rb-metryka-dl {
  width: 52%;
  max-width: 340px;
  margin: 0;
}

.rb-metryka-dl dt {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.rb-metryka-dl dd {
  margin: 0;
  font-weight: 500;
}

/* ── Nawigacja desktop ──────────────────────────────────── */
.rb-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.rb-nav__btn {
  background: #fff;
  border: 2px solid #1c1c1c;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  color: #1c1c1c;
  flex-shrink: 0;
}
.rb-nav__btn:hover {
  background: #1c1c1c;
  color: #fff;
}
.rb-nav__btn svg { display: block; }

.rb-nav__counter {
  font-size: 0.85rem;
  color: #555;
  min-width: 70px;
  text-align: center;
}

/* ── Mobile: Slick slider ───────────────────────────────── */
.rb-mobile-wrapper .container {
  padding-left: 0;
  padding-right: 0;
}

.rb-slide { outline: none; }

.rb-slide__head {
  padding: 1.25rem 1rem 0;
  background: #fff;
}

/* rb-ref-title i rb-ref-quote są współdzielone desktop/mobile */
.rb-slide .rb-ref-title { font-size: 2.15rem; }
.rb-slide .rb-ref-quote {
  -webkit-line-clamp: 5;
  font-size: 0.9rem;
}

.rb-slide .rb-ref-cta {
  flex-wrap: nowrap;
  margin-top: 0.25rem;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 3;
}

.rb-slide .rb-ref-cta .rb-btn {
  flex: 0 0 auto;
}

/* Zdjęcie w siderze — aspect ratio 16:9, photo na dole */
.rb-slide .rb-ref-photo {
  flex: none;
  aspect-ratio: 16 / 9;
  margin-top: -15px;
  overflow: hidden;
  position: relative;
}

.rb-slide .rb-ref-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Strzałki Slick */
.rb-mobile-slider {
  position: relative;
}

.rb-slick-arrow {
  border: none;
  border-radius: 0;
  width: 55px;
  height: 55px;
  padding: 0;
  cursor: pointer;
  z-index: 5;
  position: absolute;
  bottom: 25px;
  top: auto;
  transform: none;
  transition: background-color 0.3s ease-in-out, background-size 0.3s ease-in-out;
}
.rb-slick-arrow.slick-prev::before,
.rb-slick-arrow.slick-next::before { content: none; }

/* Lewa (↙): ikona w lewym dolnym rogu kwadratu */
.rb-slick-arrow.slick-prev {
  left: 0;
  right: auto;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M16 4L4 16' stroke='%23ff4200' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M4 10V16H10' stroke='%23ff4200' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat left 8px bottom 8px / 20px 20px;
}
.rb-slick-arrow.slick-prev:hover {
  background: #ff4200 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M16 4L4 16' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M4 10V16H10' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat left 8px bottom 8px / 24px 24px;
}

/* Prawa (↗): ikona w prawym górnym rogu kwadratu */
.rb-slick-arrow.slick-next {
  right: 0;
  left: auto;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M4 16L16 4' stroke='%23ff4200' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M10 4H16V10' stroke='%23ff4200' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px top 8px / 20px 20px;
}
.rb-slick-arrow.slick-next:hover {
  background: #ff4200 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M4 16L16 4' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M10 4H16V10' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px top 8px / 24px 24px;
}

/* Dots Slick */
.rb-mobile-slider .slick-dots li button::before {
  color: #ff4200;
  font-size: 10px;
}
.rb-mobile-slider .slick-dots li.slick-active button::before {
  color: #ff4200;
  opacity: 1;
}

/* ── Lightbox inline ────────────────────────────────────── */
.rb-lightbox-content { background: #fff; border-radius: 8px; }
.rb-lightbox-body    { line-height: 1.7; color: #333; }
.rb-lightbox-body p  { margin-bottom: 1rem; }

/* ── Responsywność ──────────────────────────────────────── */
@media (max-width: 1399px) {
  .rb-ref-head { padding-left: 14%; padding-right: 14%; }
}

@media (max-width: 1199px) {
  .rb-ref-head { padding: 1rem 10% 0.75rem; }
  .rb-ref-title::before { font-size: 2rem; }
  .rb-ref-quote { -webkit-line-clamp: 3; }
}

@media (min-width: 992px) and (max-width: 1099px) {
  .rb-ref-head { padding: 0.75rem 8% 0.5rem; }
  .rb-ref-title::before { font-size: 1.6rem; }
  .rb-ref-quote { -webkit-line-clamp: 2; }
  .rb-btn { padding: 0.3rem 0.6rem; font-size: 0.7rem; }
}

@media (max-width: 991px) {
  .modul-references-book { padding: 3rem 0; }
  .rb-header__lead { font-size: 1rem; }
}

@media (max-width: 767px) {
  .rb-slide .rb-btn { font-size: 14px; }
  .rb-slide .rb-btn { padding: 6px 14px; }
}

@media (max-width: 639px) {
  .rb-slide .rb-ref-cta {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 0.4rem;
  }
}

@media (max-width: 768px) {
  .modul-references-book { padding-top: 0; }
}

@media (max-width: 575px) {
  .rb-metryka-dl { font-size: 0.78rem; padding: 1rem; }
}
