/*
 * Estils de les seccions afegides el 2026: vídeos, agenda i compartir.
 * (theme.css és la plantilla original; aquí només hi ha el que és nou.)
 */

/* ---------- General ---------- */

/* Els carrusels (slick) es veuen apilats fins que s'inicialitzen: els amaguem només aquell instant.
   Abans s'amagava tota la pàgina fins que carregaven totes les imatges, i això penalitzava molt la velocitat (LCP). */
.js-slick-carousel:not(.slick-initialized) {
    opacity: 0;
    max-height: 520px;
    overflow: hidden;
}

/* ---------- Vídeos ---------- */

.video-ratio {
    position: relative;
    width: 100%;
    height: 0;
    overflow: hidden;
    background: #000;
}
.video-ratio.is-vertical { padding-bottom: 177.78%; }
.video-ratio.is-horizontal { padding-bottom: 56.25%; }
.video-ratio iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Vídeo dins la fitxa del llibre, després de la sinopsi */
.book-video {
    margin: 1.5rem 0 2rem;
}
.book-video .video-ratio.is-vertical {
    max-width: 320px;
    padding-bottom: 0;
    height: 569px;
}
@media (max-width: 575px) {
    .book-video .video-ratio.is-vertical {
        max-width: 100%;
        height: 0;
        padding-bottom: 177.78%;
    }
}

/* Slider de vídeos de la home: scroll horitzontal amb snap (es pot lliscar amb el dit) */
.video-slider {
    position: relative;
}
.video-slider__track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.video-slider__track::-webkit-scrollbar {
    display: none;
}
.video-card {
    flex: 0 0 calc((100% - 64px) / 5);
    scroll-snap-align: start;
    min-width: 0;
}
@media (max-width: 1199px) {
    .video-card { flex-basis: calc((100% - 48px) / 4); }
}
@media (max-width: 991px) {
    .video-card { flex-basis: calc((100% - 32px) / 3); }
}
@media (max-width: 767px) {
    /* Al mòbil es veu una targeta i mitja, perquè quedi clar que es pot lliscar */
    .video-card { flex-basis: 62%; }
}
.video-card__play {
    display: block;
    position: relative;
    width: 100%;
    padding: 0;
    padding-bottom: 177.78%;
    border: 0;
    background: #1d1d1d;
    cursor: pointer;
    overflow: hidden;
}
.video-card__play img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.video-card__play:hover img,
.video-card__play:focus img {
    transform: scale(1.04);
}
/* La miniatura de YouTube (hqdefault, 4:3) d'un vídeo horitzontal porta franges negres a dalt i a baix: les retallem */
.video-card__play.is-horizontal img {
    transform: scale(1.34);
}
.video-card__play.is-horizontal:hover img,
.video-card__play.is-horizontal:focus img {
    transform: scale(1.39);
}
.video-card__play.has-poster img {
    transform: none;
}
.video-card__play.has-poster:hover img,
.video-card__play.has-poster:focus img {
    transform: scale(1.04);
}
.video-card__play:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0));
}
.video-card__icon {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    margin: -29px 0 0 -29px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    z-index: 1;
    transition: background .2s ease;
}
.video-card__icon:before {
    content: "";
    position: absolute;
    left: 23px;
    top: 18px;
    border-style: solid;
    border-width: 11px 0 11px 17px;
    border-color: transparent transparent transparent #19110b;
}
.video-card__play:hover .video-card__icon,
.video-card__play:focus .video-card__icon {
    background: #fff;
}
.video-card__body {
    padding-top: .75rem;
}
.video-card__author {
    display: block;
    font-size: 14px;
    color: #7c6e65;
}
.video-card__title {
    font-size: 17px;
    line-height: 1.3;
}
.video-slider__arrow {
    position: absolute;
    top: 38%;
    width: 44px;
    height: 44px;
    border: 1px solid #eae8e4;
    border-radius: 50%;
    background: #fff;
    color: #19110b;
    font-size: 16px;
    line-height: 42px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}
.video-slider__arrow:disabled {
    opacity: 0;
    pointer-events: none;
}
.video-slider__arrow--prev { left: -22px; }
.video-slider__arrow--next { right: -22px; }
@media (max-width: 991px) {
    .video-slider__arrow { display: none; }
}

/* Finestra del vídeo */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000; /* per sobre del bàner de cookies i del popup de la newsletter (99999) */
    background: rgba(0, 0, 0, .85);
    align-items: center;
    justify-content: center;
    padding: 50px 16px 16px;
}
.video-modal.is-open {
    display: flex;
}
.video-modal__frame {
    position: relative;
    background: #000;
}
.video-modal__frame.is-vertical {
    height: min(82vh, 160vw);
    width: calc(min(82vh, 160vw) * 9 / 16);
}
.video-modal__frame.is-horizontal {
    width: min(92vw, 1100px);
    height: calc(min(92vw, 1100px) * 9 / 16);
}
.video-modal__frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}
.video-modal__caption {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding-top: 8px;
    color: #fff;
    font-size: 15px;
    text-align: center;
}
.video-modal__caption a {
    color: #fff;
    text-decoration: underline;
}
.video-modal__close {
    position: absolute;
    top: 10px;
    right: 16px;
    border: 0;
    background: none;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}
body.video-modal-open {
    overflow: hidden;
}

/* ---------- Agenda ---------- */

.agenda-intro {
    max-width: 640px;
}
.event-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 30px;
}
@media (max-width: 991px) {
    .event-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
    .event-grid { grid-template-columns: 1fr; }
}
.event-card {
    display: flex;
    flex-direction: column;
}
.event-card__image {
    display: block;
    position: relative;
    padding-bottom: 66%;
    background: #f3f1ee;
    overflow: hidden;
}
.event-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    transition: transform .4s ease;
}
.event-card__image:hover img {
    transform: scale(1.03);
}
.event-card__image--empty:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #6f77c7;
}
.event-card__body {
    padding-top: 1rem;
}
.event-when {
    display: inline-block;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #7c6e65;
    margin-bottom: .25rem;
}
.event-when--today {
    color: #6f77c7;
    font-weight: 600;
}
.event-card__date {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: .25rem;
}
.event-card__title {
    font-size: 19px;
    line-height: 1.3;
    margin-bottom: .5rem;
}
.event-card__title a {
    color: inherit;
}
.event-card__place {
    font-size: 15px;
    color: #4b4b4b;
    margin-bottom: .5rem;
}
.event-card__links {
    font-size: 14px;
    margin-top: auto;
}
.event-card__links a {
    display: inline-block;
    margin-right: 1rem;
    text-decoration: underline;
}

/* Banner d'un especial (super-esdeveniment) */
.super-event-banner {
    display: block;
    position: relative;
    margin-bottom: 3rem;
    color: #fff;
    background: #19110b;
    overflow: hidden;
}
.super-event-banner img {
    display: block;
    width: 100%;
    height: auto;
}
.super-event-banner__text {
    padding: 1rem 1.25rem;
    background: #19110b;
}
.super-event-banner__text h2 {
    color: #fff;
    font-size: 22px;
    margin: 0;
}
.super-event-banner__text p {
    margin: .25rem 0 0;
    font-size: 15px;
    color: #e5e0da;
}
.super-event-banner:hover {
    color: #fff;
    text-decoration: none;
}
.super-event-banner:hover h2 {
    text-decoration: underline;
}

/* Fitxa d'un acte */
.event-detail__image img {
    width: 100%;
    height: auto;
}
.event-detail__meta {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    font-size: 16px;
}
.event-detail__meta li {
    padding: .6rem 0;
    border-bottom: 1px solid #eae8e4;
}
.event-detail__meta li:first-child {
    border-top: 1px solid #eae8e4;
}
.event-detail__meta i {
    width: 22px;
    color: #6f77c7;
}
.event-detail__past {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    background: #f3f1ee;
    font-size: 15px;
}
.event-detail__actions .btn {
    margin: 0 .5rem .5rem 0;
}
.event-authors {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.event-authors a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
}
.event-authors img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

/* Llista compacta d'actes (fitxa de llibre) */
.event-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.event-list li {
    padding: .75rem 0;
    border-bottom: 1px solid #eae8e4;
    font-size: 15px;
}
.event-list li:first-child {
    border-top: 1px solid #eae8e4;
}
.event-list strong {
    display: block;
}

/* ---------- Compartir ---------- */

.share-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.share-box__label {
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #7c6e65;
    margin-right: 4px;
}
.share-box__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #dcd8d2;
    border-radius: 50%;
    background: #fff;
    color: #19110b;
    font-size: 16px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.share-box__btn:hover,
.share-box__btn:focus {
    background: #19110b;
    border-color: #19110b;
    color: #fff;
    text-decoration: none;
}
.share-box__btn--x {
    font-weight: 700;
    font-size: 15px;
    font-family: Arial, sans-serif;
}
.share-box__native {
    display: none;
    width: auto;
    padding: 0 16px;
    border-radius: 19px;
    font-size: 14px;
}
.share-box__native i {
    margin-right: 6px;
}
/* Als mòbils amb menú natiu de compartir es mostra aquest botó en lloc de les xarxes una a una */
.share-box.has-native .share-box__native {
    display: inline-flex;
}
.share-box.has-native .share-box__network {
    display: none;
}
.share-box__copied {
    font-size: 13px;
    color: #6f77c7;
    display: none;
}

/* Animacions del menú lateral (abans es carregava animate.css sencer, 77 KB, només per a aquestes dues) */
@-webkit-keyframes fadeInLeft {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

.fadeInLeft {
  -webkit-animation-name: fadeInLeft;
  animation-name: fadeInLeft;
}

@-webkit-keyframes fadeOutLeft {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }
}

@keyframes fadeOutLeft {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }
}

.fadeOutLeft {
  -webkit-animation-name: fadeOutLeft;
  animation-name: fadeOutLeft;
}

