/* =============================================
   LAYANAN SECTION — 3D Book Cards
   Adapted from "Book" by eslam-hany (Uiverse.io)
   Colors adapted to Semanggi Landscape theme.
   Desktop: open on hover. Mobile: open on tap.
   ============================================= */

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 56px 48px;
    justify-items: center;
    align-items: start;
    padding-top: 8px;
}

/* ─── Book wrapper & toggle ─── */
.book-wrap {
    display: block;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.book-toggle {
    display: none;
}

/* ─── Book ─── */
.book {
    position: relative;
    border-radius: 10px;
    width: 220px;
    height: 300px;
    background-color: whitesmoke;
    box-shadow: 1px 1px 12px rgba(0, 0, 0, 0.35);
    transform-style: preserve-3d;
    perspective: 2000px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    transition: transform 0.4s ease;
}

.book:hover {
    transform: translateY(-6px);
}

/* ─── Cover ─── */
.cover {
    top: 0;
    left: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.5s ease;
    transform-origin: 0;
    transform-origin: left center;
    box-shadow: 1px 1px 12px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(135deg, var(--color-primary, #059669), #10b981);
    color: #ffffff;
    z-index: 2;
}

.book:hover .cover,
.book-toggle:checked ~ .book .cover {
    transform: rotateY(-80deg);
}

.cover-icon {
    font-size: 40px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.cover-title {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    padding: 0 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ─── Pages (revealed when cover opens) ─── */
.pages {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 22px;
    text-align: center;
}

.pages-index {
    position: absolute;
    top: 14px;
    right: 18px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.15);
}

.pages-icon {
    font-size: 28px;
    color: var(--color-primary, #059669);
}

.pages-title {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
    color: #222222;
}

.pages-text {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 12px;
    line-height: 1.65;
    color: #555555;
    max-height: 130px;
    overflow: hidden;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

@media (max-width: 400px) {
    .book {
        width: 200px;
        height: 273px;
    }
}
