/* =========================================================
   CAPÇALERES LLIBRES BLOCK
   ========================================================= */

.c-capcaleres-llibres {
  background: var(--bg-block, var(--wp--preset--color--base));
  padding-top: var(--pad-t, 60px);
  padding-bottom: var(--pad-b, 60px);
}

.c-capcaleres-llibres__header {
  max-width: 1200px;
  margin: 0 auto 0;
  text-align: center;
}

.c-capcaleres-llibres__subtitol {
  font-size: var(--fs-sub, 18px);
  color: var(--color-sub, #5d4d9b);
  line-height: 44px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0;
  padding: 0;
}

.c-capcaleres-llibres__titol {
  font-size: var(--fs-titol, 52px);
  color: var(--color-titol, #1e1348);
  line-height: 1.1;
  font-weight: 700;
  margin: 0 0 32px;
  padding: 0;
}

.c-capcaleres-llibres__tabs-wrapper {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 10;
  margin-bottom: -1px;
}

.c-capcaleres-llibres__tabs {
  display: inline-flex;
  justify-content: center;
  gap: 0;
}

.c-capcaleres-llibres__tab {
  position: relative;
  padding: 14px 48px 18px;
  font-size: 16px;
  font-weight: 600;
  color: #b2a4d2;
  background-color: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
  line-height: 1;
  z-index: 0;
}

.c-capcaleres-llibres__tab::before,
.c-capcaleres-llibres__tab::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 16px;
  height: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.c-capcaleres-llibres__tab.is-active {
  color: #5c4d9b;
  background-color: #ffffff;
  border-radius: 30px 30px 0 0;
  border: 1px solid #edecf0;
  border-bottom: none;
  box-shadow: 0 -8px 10px -6px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.c-capcaleres-llibres__tab.is-active::before {
  left: -16px;
  background: radial-gradient(circle at top right, transparent 69%, #ffffff 70%);
  opacity: 1;
  transform: rotate(270deg);
}

.c-capcaleres-llibres__tab.is-active::after {
  right: -16px;
  background: radial-gradient(circle at top left, transparent 69%, #ffffff 70%);
  opacity: 1;
  transform: rotate(90deg);
}

.c-capcaleres-llibres__tab-text {
  display: block;
  padding-top: 10px;
}

.c-capcaleres-llibres__tab-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #5c4d9b;
  margin: 8px auto 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.c-capcaleres-llibres__tab.is-active .c-capcaleres-llibres__tab-dot {
  opacity: 1;
}

.c-capcaleres-llibres__tab:not(.is-active):hover {
  color: #4b5563;
}

.c-capcaleres-llibres__content {
  position: relative;
  z-index: 5;
  border: 1px solid #edecf0;
  background-color: #ffffff;
  box-shadow: 0 0 25px 0px rgba(0, 0, 0, 0.15);
  border-radius: 24px;
  padding: 40px 0 40px var(--grid-margin);
  max-width: 100%;
}

.c-capcaleres-llibres .c-llibre-carousel {
  margin-top: 0;
  margin-bottom: 0;
}

.c-capcaleres-llibres .c-llibre-carousel__card.is-hidden {
  display: none;
}

.c-capcaleres-llibres .c-llibre-carousel__wrapper {
  width: 100%;
  position: static;
  left: auto;
  transform: none;
}

.c-capcaleres-llibres .c-llibre-carousel__track-outer {
  padding-left: 0;
  padding-bottom: 60px;
}

.c-capcaleres-llibres .c-llibre-carousel__header {
  padding-left: 0;
}

@media (max-width: 768px) {
  .c-capcaleres-llibres {
    padding-top: var(--pad-t-mob, 32px);
    padding-bottom: var(--pad-b-mob, 32px);
    overflow: hidden;
  }

  .c-capcaleres-llibres__subtitol {
    font-size: var(--fs-sub-mob, 18px);
  }

  .c-capcaleres-llibres__titol {
    font-size: var(--fs-titol-mob, 2rem);
    padding: 0 var(--grid-margin);
  }

  .c-capcaleres-llibres__tab {
    padding: 12px 24px 16px;
    font-size: 14px;
  }

  .c-capcaleres-llibres__tabs-wrapper {
    padding: 0;
  }

  .c-capcaleres-llibres__tabs {
    width: 100%;
  }

  .c-capcaleres-llibres__tab {
    flex: 1;
    padding: 16px 10px;
    font-size: 15px;
    border-radius: 20px 20px 0 0 !important;
    white-space: nowrap;
  }

  .c-capcaleres-llibres__tab::before,
  .c-capcaleres-llibres__tab::after {
    display: none;
  }

  .c-capcaleres-llibres__tab:first-child.is-active::after {
    display: block;
    z-index: 10;
  }

  .c-capcaleres-llibres__tab:last-child.is-active::before {
    display: block;
    z-index: 10;
  }

  .c-capcaleres-llibres__content {
    margin: 0;
    border-radius: 24px 24px 0 0;
    border-left: none;
    border-right: none;
    padding: 24px 0 40px var(--grid-margin);
  }

  .c-capcaleres-llibres__content[data-active-tab="left"] {
    border-top-left-radius: 0;
  }

  .c-capcaleres-llibres__content[data-active-tab="right"] {
    border-top-right-radius: 0;
  }

  .c-capcaleres-llibres .c-llibre-carousel__track-outer {
    padding-left: var(--grid-margin);
    padding-bottom: 30px;
  }
}