/**
 * Promo pages — /sales (list) and /sales/{id} (detail).
 * Shared hero / buttons / pills / empty state live in page.css, which must be
 * loaded before this file. Tokens come from site.css (:root).
 */

/* ==========================================================================
   3. Promo card (list + "promo lainnya")
   ========================================================================== */
.pr-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 26px);
}

.pr-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: var(--ln-r-lg);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--ln-line);
    box-shadow: var(--ln-sh-xs);
    text-decoration: none;
    transition: transform .35s var(--ln-ease), box-shadow .35s var(--ln-ease),
        border-color .35s var(--ln-ease);
}

.pr-card:hover {
    transform: translateY(-7px);
    box-shadow: var(--ln-sh-lg);
    border-color: rgba(26, 109, 255, .25);
}

.pr-card-media {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: linear-gradient(160deg, var(--ln-sky-2), #dfeaff);
}

/* Blown-up blurred copy of the poster fills the frame, so the contained
   poster never sits on empty letterbox bars — and nothing is cropped. */
.pr-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.4);
    filter: blur(26px) saturate(1.5);
    opacity: .55;
}

.pr-card-img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .45s var(--ln-ease);
}

.pr-card:hover .pr-card-img {
    transform: scale(1.04);
}

/* A light desaturation reads as "past" — anything heavier makes the whole
   list look broken, which matters because every promo can be expired. */
.pr-card--expired .pr-card-img {
    filter: grayscale(.2);
}

.pr-card--expired .pr-card-bg {
    filter: grayscale(.2) blur(26px) saturate(1.2);
}

.pr-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px clamp(15px, 1.6vw, 20px) 20px;
}

.pr-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 11px;
}

.pr-card-title {
    font-size: clamp(14.5px, 1.5vw, 16.5px);
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -.01em;
    color: var(--ln-navy);
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .25s var(--ln-ease);
}

.pr-card:hover .pr-card-title {
    color: var(--ln-blue-dark);
}

.pr-card-excerpt {
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ln-muted);
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pr-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--ln-line);
}

.pr-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ln-blue-dark);
    transition: gap .25s var(--ln-ease);
}

.pr-card:hover .pr-card-cta {
    gap: 12px;
}

.pr-card-arrow {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ln-sky-2);
    color: var(--ln-blue-dark);
    font-size: 13px;
    flex: 0 0 32px;
    transition: background .3s var(--ln-ease), color .3s var(--ln-ease),
        transform .3s var(--ln-ease);
}

.pr-card:hover .pr-card-arrow {
    background: var(--ln-grad);
    color: #fff;
    transform: translateX(3px);
}

/* ==========================================================================
   5. Detail page
   ========================================================================== */
.pr-detail {
    display: grid;
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    gap: clamp(24px, 3vw, 44px);
    align-items: start;
}

/* --- Poster --- */
.pr-poster-col {
    position: sticky;
    top: 96px;
}

.pr-poster {
    position: relative;
    border-radius: var(--ln-r-xl);
    overflow: hidden;
    background: #fff;
    padding: 10px;
    border: 1px solid var(--ln-line);
    box-shadow: var(--ln-sh);
}

.pr-poster-inner {
    position: relative;
    display: block;
    border-radius: calc(var(--ln-r-xl) - 10px);
    overflow: hidden;
    background: linear-gradient(160deg, var(--ln-sky-2), #dfeaff);
}

.pr-poster-inner img {
    display: block;
    width: 100%;
    height: auto;
}

.pr-poster-zoom {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(10, 36, 100, .42);
    opacity: 0;
    transition: opacity .3s var(--ln-ease);
}

.pr-poster-inner:hover .pr-poster-zoom,
.pr-poster-inner:focus-visible .pr-poster-zoom {
    opacity: 1;
}

.pr-poster-zoom span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px;
    border-radius: 999px;
    background: #fff;
    color: var(--ln-navy);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--ln-sh);
}

.pr-poster-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 14px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ln-muted);
}

/* --- Content --- */
.pr-content {
    padding: clamp(24px, 3vw, 40px);
    background: #fff;
    border: 1px solid var(--ln-line);
    border-radius: var(--ln-r-xl);
    box-shadow: var(--ln-sh-sm);
}

.pr-content-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: clamp(15px, 1.8vw, 18px);
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--ln-navy);
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ln-line);
}

.pr-content-title::before {
    content: "";
    width: 4px;
    height: 20px;
    border-radius: 3px;
    background: var(--ln-grad-soft);
    flex: 0 0 4px;
}

.pr-expired-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 22px;
    border-radius: var(--ln-r-sm);
    background: #fffbeb;
    border: 1px solid #fde3bd;
    color: #92400e;
    font-size: 13px;
    line-height: 1.65;
}

.pr-expired-note i {
    font-size: 16px;
    margin-top: 1px;
    flex-shrink: 0;
}

/* --- CMS rich text --- */
.pr-prose {
    font-size: clamp(14px, 1.5vw, 15.5px);
    line-height: 1.85;
    color: var(--ln-ink);
}

.pr-prose > :first-child {
    margin-top: 0;
}

.pr-prose > :last-child {
    margin-bottom: 0;
}

.pr-prose p {
    margin: 0 0 16px;
    text-align: left !important;
}

.pr-prose p:empty {
    display: none;
}

.pr-prose h1,
.pr-prose h2,
.pr-prose h3,
.pr-prose h4 {
    font-size: clamp(16px, 1.9vw, 19px);
    font-weight: 800;
    line-height: 1.4;
    color: var(--ln-navy);
    margin: 28px 0 12px;
}

.pr-prose strong,
.pr-prose b {
    color: var(--ln-navy);
    font-weight: 700;
}

.pr-prose a {
    color: var(--ln-blue-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pr-prose ul,
.pr-prose ol {
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.pr-prose li {
    position: relative;
    padding-left: 30px;
}

.pr-prose li > p {
    margin: 0;
}

.pr-prose ul > li::before {
    content: "";
    position: absolute;
    top: .62em;
    left: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ln-blue-soft);
}

.pr-prose ol {
    counter-reset: pr-ol;
}

.pr-prose ol > li {
    counter-increment: pr-ol;
    padding-left: 36px;
}

.pr-prose ol > li::before {
    content: counter(pr-ol);
    position: absolute;
    top: 1px;
    left: 0;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 8px;
    background: var(--ln-blue-tint);
    color: var(--ln-blue-dark);
    font-size: 11.5px;
    font-weight: 800;
}

.pr-prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ln-r-sm);
    margin: 8px 0 18px;
}

.pr-prose blockquote {
    margin: 0 0 18px;
    padding: 14px 20px;
    border-left: 4px solid var(--ln-blue);
    border-radius: 0 var(--ln-r-sm) var(--ln-r-sm) 0;
    background: var(--ln-sky-2);
    color: var(--ln-navy);
    font-weight: 600;
}

.pr-prose table {
    width: 100%;
    margin-bottom: 18px;
    border-collapse: collapse;
    font-size: 13.5px;
}

.pr-prose th,
.pr-prose td {
    padding: 10px 12px;
    border: 1px solid var(--ln-line);
    text-align: left;
}

.pr-prose th {
    background: var(--ln-sky-2);
    color: var(--ln-navy);
    font-weight: 700;
}

/* Wide tables get their own scroller instead of pushing the page sideways. */
.pr-prose-scroll {
    overflow-x: auto;
}

/* --- Contact call-to-action --- */
.pr-cta {
    margin-top: 28px;
    padding: clamp(20px, 2.4vw, 28px);
    border-radius: var(--ln-r);
    background: var(--ln-grad);
    color: #fff;
    overflow: hidden;
    position: relative;
}

.pr-cta::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -70px;
    top: -110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.pr-cta-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.pr-cta h2 {
    font-size: clamp(16px, 1.9vw, 20px);
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
}

.pr-cta p {
    font-size: 13px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .78);
    margin: 0;
}

.pr-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pr-btn-white {
    background: #fff;
    color: var(--ln-navy);
}

.pr-btn-white:hover {
    color: var(--ln-blue-dark);
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .2);
}

.pr-btn-outline-white {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, .4);
}

.pr-btn-outline-white:hover {
    background: rgba(255, 255, 255, .22);
    color: #fff;
    transform: translateY(-3px);
}

/* ==========================================================================
   7. Responsive  (shared page chrome breakpoints live in page.css)
   ========================================================================== */
@media (max-width: 1199.98px) {
    .pr-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .pr-detail {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Sticky only makes sense beside the text, not stacked above it. */
    .pr-poster-col {
        position: static;
        top: auto;
        max-width: 480px;
        margin: 0 auto;
        width: 100%;
    }

    .pr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .pr-cta-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .pr-cta-actions .pr-btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 575.98px) {
    .pr-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .pr-card-media {
        aspect-ratio: 1 / 1;
    }

    .pr-content,
    .pr-poster {
        border-radius: var(--ln-r-lg);
    }

    .pr-poster {
        padding: 8px;
    }

    .pr-poster-inner {
        border-radius: calc(var(--ln-r-lg) - 8px);
    }

    .pr-cta-actions {
        flex-direction: column;
    }

    .pr-cta-actions .pr-btn {
        width: 100%;
    }
}
