/* ==========================================================
   Quote slider: kertas sobek bergaris, tulisan tangan
   Murni CSS, tanpa gambar. Letakkan di public/css/quote-note.css
   ========================================================== */

.quote-wrap { padding: .5rem .75rem 0; }

/* ---------- Carousel: animasi "sobek lalu jatuh" ---------- */
.quote-carousel .carousel-inner {
    overflow: visible;          /* supaya kertas yang jatuh & bayangan tidak terpotong */
    min-height: 434px;          /* tinggi tetap agar layout tidak melompat */
}

.quote-carousel.carousel-fade .carousel-item { transition-duration: .8s; }

/* item lama tetap terlihat selama animasi jatuh (.8s), lalu hilang */
.quote-carousel.carousel-fade .active.carousel-item-start,
.quote-carousel.carousel-fade .active.carousel-item-end { transition: opacity 0s .8s; }

/* ---------- Kertas ---------- */
.q-note {
    margin: 0;
    filter:
        drop-shadow(0 7px 9px rgba(60, 45, 20, .22))
        drop-shadow(0 1px 1px rgba(60, 45, 20, .30));
    transform-origin: 50% 0;
    /* posisi awal: di atas, miring ke arah berlawanan */
    transform: translateY(-40px) rotate(calc(var(--tilt) * -1 - 4deg));
    opacity: 0;
    transition: transform .8s cubic-bezier(.2, .8, .3, 1.08), opacity .5s ease-out;
}

/* mendarat */
.quote-carousel .carousel-item.active .q-note,
.quote-carousel .carousel-item-next.carousel-item-start .q-note,
.quote-carousel .carousel-item-prev.carousel-item-end .q-note {
    transform: translateY(0) rotate(var(--tilt));
    opacity: 1;
}

/* disobek dan jatuh */
.quote-carousel .carousel-item.active.carousel-item-start .q-note,
.quote-carousel .carousel-item.active.carousel-item-end .q-note {
    transform: translateY(80px) rotate(calc(var(--tilt) + 9deg));
    opacity: 0;
    transition: transform .8s cubic-bezier(.5, 0, .9, .6), opacity .7s ease-in;
}

.q-paper {
    position: relative;
    min-height: 384px;
    display: flex;
    flex-direction: column;
    padding: 38px 1.5rem 1.6rem 4.6rem;
    background-color: #f6efdc;
    background-image:
        radial-gradient(ellipse at 15% 8%, rgba(255, 255, 255, .55), transparent 60%),
        repeating-linear-gradient(to bottom,
            transparent 0 31px,
            rgba(74, 111, 165, .28) 31px 32px);
    /* tepi atas & bawah bergerigi seperti disobek dari buku */
    clip-path: polygon(
        0 5px, 5% 1px, 10% 6px, 16% 2px, 22% 7px, 29% 1px, 35% 5px, 42% 0,
        48% 6px, 55% 2px, 61% 7px, 68% 1px, 74% 5px, 81% 0, 87% 6px, 93% 2px, 100% 5px,
        100% calc(100% - 4px),
        94% 100%, 88% calc(100% - 6px), 81% 100%, 75% calc(100% - 5px),
        68% calc(100% - 1px), 61% calc(100% - 7px), 54% calc(100% - 2px), 47% 100%,
        40% calc(100% - 6px), 33% calc(100% - 2px), 26% calc(100% - 7px), 19% 100%,
        12% calc(100% - 5px), 6% calc(100% - 1px), 0 calc(100% - 5px)
    );
}

/* lubang spiral */
.q-paper::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 24px;
    bottom: 24px;
    width: 14px;
    background:
        radial-gradient(circle, #fff 0 4px, #c9bb9a 4.5px 5.5px, transparent 6px)
        center top / 14px 32px repeat-y;
}

/* garis margin merah */
.q-paper::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 52px;
    width: 2px;
    background: rgba(200, 75, 75, .40);
}

/* ---------- Tulisan tangan ---------- */
.q-text,
.q-meta {
    font-family: 'Caveat', 'Kalam', 'Segoe Script', cursive;
    line-height: 32px;
}

.q-text {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 400;
    color: #27386b;            /* tinta biru */
    hyphens: auto;
    overflow-wrap: anywhere;
}

/* penulis: lebih kecil dari kutipan, tepat di bawahnya, maksimal 4 baris.
   line-height 32px = satu baris per garis kertas */
.q-authors {
    margin: 0;
    font-family: 'Caveat', 'Kalam', 'Segoe Script', cursive;
    font-size: 1.15rem;
    line-height: 32px;
    color: #5f6a8c;            /* tinta biru yang lebih pudar */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
}

.q-authors-label {
    font-weight: 600;
    color: #3c4a78;
}

/* tahun & DOI: menempel di dasar kertas */
.q-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-top: auto;
    padding-top: .6rem;
    font-size: 1.25rem;
    color: #5b4d37;
}

.q-year { font-weight: 600; }

.q-doi {
    color: #9b2c2c;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
    text-align: right;
}
.q-doi:hover,
.q-doi:focus-visible { color: #6e1b1b; }

/* ---------- Indikator titik ---------- */
.q-dots {
    position: static;
    margin: 0.5rem 0 0;
    gap: .45rem;
    justify-content: center;
}

.q-dots [data-bs-target] {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: #8a7b5d;
    background-clip: border-box;
    opacity: .35;
    transition: opacity .3s;
}
.q-dots .active { opacity: 1; }

/* ---------- Layar kecil ---------- */
@media (max-width: 575.98px) {
    .quote-carousel .carousel-inner { min-height: 494px; }
    .q-paper { min-height: 444px; padding: 36px 1rem 1.4rem 3.4rem; }
    .q-paper::before { left: 10px; }
    .q-paper::after  { left: 38px; }
    .q-text { font-size: 1.4rem; }
}

/* ---------- Hormati preferensi kurangi gerakan ---------- */
@media (prefers-reduced-motion: reduce) {
    .quote-carousel .carousel-item .q-note {
        transform: rotate(var(--tilt)) !important;
        transition: opacity .3s !important;
    }
}