/* ==========================================================
   GridCD – Destinasi Display  |  gridcd.css  v1.0.0
   ========================================================== */

/* ── Reset & Base ───────────────────────────────────────── */
.gridcd-wrap *,
.gridcd-wrap *::before,
.gridcd-wrap *::after {
    box-sizing: border-box;
}

.gridcd-wrap {
    --gridcd-overlay: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.70));
    --gridcd-radius: 16px;
    --gridcd-gap: 16px;
    --gridcd-trans: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
}

/* ── Header Row ─────────────────────────────────────────── */
.gridcd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.gridcd-header-align-left   { justify-content: space-between; }
.gridcd-header-align-center { justify-content: center; text-align: center; }
.gridcd-header-align-right  { justify-content: flex-end; text-align: right; }

.gridcd-header-align-center .gridcd-header-title,
.gridcd-header-align-right  .gridcd-header-title {
    flex: 1;
}

.gridcd-header-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.gridcd-header-title a {
    text-decoration: none;
    color: inherit;
}

.gridcd-header-title a:hover {
    opacity: 0.8;
}

/* ── CTA Button ─────────────────────────────────────────── */
.gridcd-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1.5px solid currentColor;
    border-radius: 30px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--gridcd-trans), color var(--gridcd-trans);
    color: #333;
}

.gridcd-cta:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

.gridcd-cta-below {
    display: none;
    margin-top: 16px;
    text-align: center;
}

/* ── Grid ───────────────────────────────────────────────── */
.gridcd-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gridcd-gap, 16px);
    width: 100%;
}

/* ── Orphan Handling ────────────────────────────────────── */
.gridcd-orphan-center .gridcd-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 340px;
    margin: 0 auto;
}

.gridcd-orphan-stretch .gridcd-card:last-child {
    grid-column: 1 / -1;
}

/* ── Card ───────────────────────────────────────────────── */
.gridcd-card {
    position: relative;
    display: block;
    height: 220px;
    border-radius: var(--gridcd-radius, 16px);
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    transition:
        transform var(--gridcd-trans),
        box-shadow var(--gridcd-trans);
    will-change: transform;
}

/* ── Background Image Layer ─────────────────────────────── */
.gridcd-bg {
    position: absolute;
    inset: 0;
    background-color: #c8d0da;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    transition: transform var(--gridcd-trans);
}

/* ── Overlay ────────────────────────────────────────────── */
.gridcd-overlay {
    position: absolute;
    inset: 0;
    background: var(--gridcd-overlay);
    transition: opacity var(--gridcd-trans);
}

/* ── Card Content ───────────────────────────────────────── */
.gridcd-card-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 16px;
    z-index: 2;
}

.gridcd-pos-bottom-left .gridcd-card-content  { justify-content: flex-end; align-items: flex-start; }
.gridcd-pos-center .gridcd-card-content       { justify-content: center;   align-items: center; text-align: center; }
.gridcd-pos-top-left .gridcd-card-content     { justify-content: flex-start; align-items: flex-start; }

.gridcd-dest-title {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

.gridcd-parent-label {
    display: block;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.8);
    margin-top: 2px;
}

/* ── Badges ─────────────────────────────────────────────── */
.gridcd-badge {
    position: absolute;
    z-index: 3;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}

/* Pill */
.gridcd-badge-pill {
    padding: 4px 9px;
    border-radius: 20px;
    background: rgba(255,255,255,0.95);
    color: #222;
}

/* Corner */
.gridcd-badge-corner {
    padding: 4px 8px;
    background: rgba(255,255,255,0.95);
    color: #222;
    border-radius: 0 0 0 8px;
}

/* Floating dot */
.gridcd-badge-floating {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    text-align: center;
    padding: 2px;
    line-height: 1.1;
}

/* Badge Positions */
.gridcd-badge-pos-topright  .gridcd-badge { top: 10px; right: 10px; }
.gridcd-badge-pos-topleft   .gridcd-badge { top: 10px; left: 10px; }
.gridcd-badge-pos-bottomright .gridcd-badge { bottom: 10px; right: 10px; }

.gridcd-badge-corner { top: 0; right: 0; border-radius: 0 var(--gridcd-radius,16px) 0 8px; }

/* ── Hover Effects ──────────────────────────────────────── */
/* Zoom */
.gridcd-hover-zoom .gridcd-card:hover .gridcd-bg {
    transform: scale(1.07);
}

/* Darken */
.gridcd-hover-darken .gridcd-card:hover .gridcd-overlay {
    opacity: 1.3;
    background: var(--gridcd-overlay), rgba(0,0,0,0.25);
}

/* Lift */
.gridcd-hover-lift .gridcd-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}

/* ── Skeleton Loader ─────────────────────────────────────── */
@keyframes gridcd-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

.gridcd-skeleton-header {
    height: 32px;
    width: 200px;
    border-radius: 6px;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #e8ecef 25%, #f4f6f7 50%, #e8ecef 75%);
    background-size: 600px 100%;
    animation: gridcd-shimmer 1.4s infinite linear;
}

.gridcd-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.gridcd-skeleton-card {
    height: 220px;
    border-radius: 16px;
    background: linear-gradient(90deg, #e8ecef 25%, #f4f6f7 50%, #e8ecef 75%);
    background-size: 600px 100%;
    animation: gridcd-shimmer 1.4s infinite linear;
}

/* ── Empty State ─────────────────────────────────────────── */
.gridcd-empty {
    color: #888;
    font-size: 0.9rem;
    padding: 20px 0;
}

/* ── Mobile: No BG Image ─────────────────────────────────── */
@media (max-width: 767px) {
    .gridcd-no-mobile-bg .gridcd-bg {
        background-image: none !important;
        background-color: #c8d0da;
    }

    /* CTA Below Grid on mobile */
    .gridcd-cta-below-mobile .gridcd-cta-inline {
        display: none;
    }
    .gridcd-cta-below {
        display: flex;
        justify-content: center;
    }

    .gridcd-skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Tablet ──────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1024px) {
    .gridcd-header-title {
        font-size: 1.4rem;
    }
}

/* ── Elementor editor preview ────────────────────────────── */
.elementor-editor-active .gridcd-skeleton-card {
    background: #e8ecef;
    animation: none;
}
