/* ============================================================
   Project detail page (.pd-*)
   Reading-first layout: sticky contents rail + one 740px column.
   Uses the tokens defined in ediide.css.
   ============================================================ */
.pd {
    --pd-muted: rgba(32, 29, 29, .68);
    --pd-line: rgba(32, 29, 29, .14);
    --pd-card: var(--bg);
    --pd-offset: 132px;
    --pd-body: clamp(1.0625rem, 1.05vw + .55rem, 1.1875rem);
    color: var(--ink);
}

/* ---------- Header (built on the template .hub-hero) ---------- */
.pd-header {
    padding-bottom: var(--sp-4);
}

.pd-title {
    overflow-wrap: anywhere;
    max-width: 18ch;
    margin-bottom: var(--sp-2);
}

.pd-subtitle {
    font-family: var(--font-title);
    font-size: clamp(1.25rem, 2vw, 1.875rem);
    letter-spacing: -.03em;
    max-width: 30ch;
    margin-top: var(--sp-2);
    line-height: 1.2;
}

.pd-lead {
    color: var(--pd-muted);
    font-size: clamp(1.0625rem, 1.2vw + .5rem, 1.25rem);
    max-width: 56ch;
    margin-top: var(--sp-3);
    line-height: 1.6;
}

.pd-meta {
    border-top: 1px solid var(--pd-line);
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0 var(--sp-3);
    max-width: 64rem;
    margin-top: var(--sp-4);
    display: grid;
}

.pd-meta__item {
    padding-block: 1rem;
    min-width: 0;
}

.pd-meta dt {
    color: var(--pd-muted);
    margin-bottom: .25rem;
    font-size: .875rem;
}

.pd-meta dd {
    overflow-wrap: anywhere;
    font-size: 1.0625rem;
    font-weight: 500;
    line-height: 1.35;
}

.pd-meta a {
    text-underline-offset: .2em;
    text-decoration: underline;
}

.pd-coverwrap {
    background: var(--bg);
    padding-bottom: var(--sp-4);
}

.pd-cover {
    border-radius: var(--radius);
    object-fit: cover;
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
    display: block;
}

/* ---------- Layout ---------- */
.pd-body {
    padding-block: var(--sp-5) var(--sp-6);
}

/* .creds__grid (template) supplies the grid; only the proportions change. */
.pd-layout.has-toc {
    grid-template-columns: minmax(13rem, .24fr) minmax(0, 1fr);
}

.pd-layout:not(.has-toc) {
    grid-template-columns: minmax(0, 1fr);
}

.pd-main {
    max-width: 62rem;
    min-width: 0;
}

/* ---------- Contents rail ---------- */
.pd-rail {
    top: var(--pd-offset);
    align-self: start;
    position: sticky;
}

.pd-toc__label {
    color: var(--pd-muted);
    margin-bottom: var(--sp-1);
    font-size: .875rem;
}

.pd-toc ol {
    border-left: 1px solid var(--pd-line);
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

.pd-toc a {
    color: var(--pd-muted);
    border-left: 2px solid transparent;
    margin-left: -1px;
    padding: .45rem .9rem;
    font-size: .9375rem;
    line-height: 1.3;
    transition: color .15s, border-color .15s;
    display: block;
}

.pd-toc a:hover {
    color: var(--ink);
}

.pd-toc a[aria-current] {
    color: var(--ink);
    border-left-color: var(--blue);
    font-weight: 600;
}

.pd-cta {
    background: var(--ink);
    color: var(--white);
    border-radius: var(--radius-sm);
    padding: .85rem 1.25rem;
    font-weight: 600;
    line-height: 1.2;
    transition: background .15s;
    display: inline-block;
}

.pd-cta:hover {
    background: var(--blue);
}

.pd-cta--rail {
    text-align: center;
    margin-top: var(--sp-3);
    display: block;
}

/* ---------- Sections ---------- */
.pd-section {
    border-top: 1px solid var(--pd-line);
    scroll-margin-top: var(--pd-offset);
    padding-block: clamp(2.25rem, 4vw, 3.5rem);
}

.pd-section:first-child {
    border-top: 0;
    padding-top: 0;
}

.pd-h2 {
    font-size: clamp(1.75rem, 2.6vw, 2.5rem);
    letter-spacing: -.04em;
    max-width: none;
    margin-bottom: var(--sp-3);
    line-height: 1.1;
}

.pd-h3,
.pd-problems h3,
.pd-steps h3,
.pd-card h3,
.pd-impact h3 {
    font-family: var(--font-title);
    letter-spacing: -.02em;
    font-size: 1.1875rem;
    font-weight: 600;
    line-height: 1.3;
}

.pd-h3 {
    margin-block: var(--sp-3) var(--sp-1);
}

.pd-prose,
.pd-problems p,
.pd-steps p,
.pd-card p {
    font-size: var(--pd-body);
    letter-spacing: -.01em;
    max-width: 58ch;
    line-height: 1.7;
}

.pd-prose {
    margin-bottom: var(--sp-2);
}

.pd-prose:first-of-type {
    font-size: calc(var(--pd-body) + .0625rem);
}

.pd-list {
    padding: 0;
    margin: var(--sp-1) 0 var(--sp-2);
    font-size: var(--pd-body);
    letter-spacing: -.01em;
    line-height: 1.6;
    list-style: none;
}

.pd-list li {
    padding-left: 1.25rem;
    margin-bottom: .5rem;
    max-width: 58ch;
    position: relative;
}

.pd-list li::before {
    content: "";
    background: var(--blue);
    border-radius: 1px;
    width: .4rem;
    height: .4rem;
    position: absolute;
    top: .7em;
    left: 0;
}

.pd-list--cols {
    column-gap: var(--sp-3);
    columns: 2 14rem;
}

.pd-list--cols li {
    break-inside: avoid;
}

/* Problems: numbered rows */
.pd-problems {
    counter-reset: problem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pd-problems > li {
    counter-increment: problem;
    border-top: 1px solid var(--pd-line);
    grid-template-columns: 2.75rem minmax(0, 1fr);
    gap: var(--sp-2);
    padding-block: 1.25rem;
    display: grid;
}

.pd-problems > li:first-child {
    border-top: 0;
    padding-top: 0;
}

.pd-problems > li::before {
    content: counter(problem, decimal-leading-zero);
    font-family: var(--font-title);
    color: var(--blue);
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.3;
}

.pd-problems > li > * {
    grid-column: 2;
}

.pd-problems h3 {
    margin-bottom: .35rem;
}

/* Goals: checks */
.pd-checks {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pd-checks li {
    font-size: var(--pd-body);
    letter-spacing: -.01em;
    padding: .7rem 0 .7rem 2rem;
    border-top: 1px solid var(--pd-line);
    line-height: 1.55;
    position: relative;
}

.pd-checks li:first-child {
    border-top: 0;
}

.pd-checks li::before {
    content: "";
    border-bottom: 2px solid var(--blue);
    border-right: 2px solid var(--blue);
    width: .45rem;
    height: .8rem;
    position: absolute;
    top: 1rem;
    left: .4rem;
    transform: rotate(40deg);
}

/* Feature / role cards */
.pd-cards {
    grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr));
    gap: var(--sp-2);
    margin-top: var(--sp-2);
    display: grid;
}

.pd-card {
    background: var(--pd-card);
    border-radius: var(--radius);
    padding: 1.25rem 1.375rem 1.375rem;
    min-width: 0;
}

.pd-card h3 {
    margin-bottom: .4rem;
}

.pd-card p {
    color: var(--pd-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.pd-card .pd-list {
    color: var(--pd-muted);
    font-size: 1rem;
    margin-bottom: 0;
}

.pd-more {
    margin-top: var(--sp-2);
}

.pd-more summary {
    cursor: pointer;
    border: 1px solid var(--pd-line);
    border-radius: var(--radius-sm);
    padding: .7rem 1rem;
    font-weight: 600;
    list-style: none;
    display: inline-block;
}

.pd-more summary::-webkit-details-marker {
    display: none;
}

.pd-more summary:hover {
    border-color: var(--ink);
}

.pd-more[open] summary {
    margin-bottom: var(--sp-2);
}

.pd-more .pd-cards {
    margin-top: 0;
}

/* Technology chips */
.pd-tech {
    gap: var(--sp-3);
    display: grid;
}

.pd-tech__group h3 {
    color: var(--pd-muted);
    letter-spacing: -.01em;
    margin-bottom: .6rem;
    font-size: .9375rem;
    font-weight: 500;
}

.pd-chips {
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

.pd-chips li {
    background: var(--pd-card);
    border: 1px solid var(--pd-line);
    border-radius: var(--radius-sm);
    padding: .45rem .8rem;
    font-size: .9375rem;
    line-height: 1.3;
}

/* Implementation steps */
.pd-steps {
    counter-reset: step;
    margin: var(--sp-2) 0 0;
    padding: 0;
    list-style: none;
}

.pd-steps > li {
    counter-increment: step;
    padding: 0 0 var(--sp-3) 3.25rem;
    position: relative;
}

.pd-steps > li:last-child {
    padding-bottom: 0;
}

.pd-steps > li::before {
    content: counter(step);
    background: var(--ink);
    color: var(--white);
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    width: 2rem;
    height: 2rem;
    font-size: .9375rem;
    font-weight: 600;
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
}

.pd-steps > li::after {
    content: "";
    background: var(--pd-line);
    width: 1px;
    position: absolute;
    top: 2.5rem;
    bottom: .5rem;
    left: 1rem;
}

.pd-steps > li:last-child::after {
    display: none;
}

.pd-steps h3 {
    margin-bottom: .3rem;
    padding-top: .25rem;
}

/* Impact: the one dark block */
.pd-section--impact {
    border-top: 0;
}

.pd-impact {
    background: var(--ink);
    color: var(--white);
    border-radius: var(--radius);
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

.pd-impact .pd-prose,
.pd-impact .pd-list {
    color: rgba(255, 255, 255, .86);
}

.pd-impact__grid {
    gap: var(--sp-3);
    display: grid;
}

.pd-impact__item {
    border-top: 1px solid rgba(255, 255, 255, .2);
    padding-top: var(--sp-2);
}

.pd-impact__item:first-child {
    border-top: 0;
    padding-top: 0;
}

.pd-impact__item h3 {
    color: var(--white);
    margin-bottom: .35rem;
}

.pd-impact__item p {
    color: rgba(255, 255, 255, .8);
    font-size: 1.0625rem;
    line-height: 1.65;
}

.pd-impact__item .pd-list {
    color: rgba(255, 255, 255, .8);
}

.pd-impact .pd-list li::before {
    background: var(--white);
}

.pd-compare__head {
    color: rgba(255, 255, 255, .6);
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
    margin-bottom: var(--sp-1);
    font-size: .875rem;
    display: none;
}

.pd-compare__row {
    border-top: 1px solid rgba(255, 255, 255, .2);
    gap: var(--sp-2) var(--sp-3);
    padding-block: var(--sp-2);
    display: grid;
}

.pd-compare__row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.pd-compare__row p {
    color: rgba(255, 255, 255, .86);
    font-size: 1.0625rem;
    line-height: 1.6;
}

.pd-compare__tag {
    color: rgba(255, 255, 255, .6);
    margin-bottom: .25rem;
    font-size: .8125rem;
    display: block;
}

.pd-compare__row p:last-child .pd-compare__tag {
    color: var(--white);
}

/* Facts */
.pd-facts {
    margin: 0;
}

.pd-facts > div {
    border-top: 1px solid var(--pd-line);
    grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
    gap: var(--sp-2);
    padding-block: .9rem;
    display: grid;
}

.pd-facts > div:first-child {
    border-top: 0;
}

.pd-facts dt {
    color: var(--pd-muted);
    font-size: .9375rem;
}

.pd-facts dd {
    font-size: 1rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

/* ---------- Footer area ---------- */
.pd-end {
    background: var(--bg);
    padding-block: var(--sp-4) var(--sp-6);
}

/* Sebelumnya / berikutnya */
.pd-pager {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-2);
    display: grid;
}

.pd-pager__link {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    transition: box-shadow .2s, transform .2s;
}

.pd-pager__link:hover {
    box-shadow: 0 8px 24px rgba(32, 29, 29, .1);
    transform: translateY(-2px);
}

.pd-pager__link--next {
    grid-column: 2;
    justify-content: space-between;
    text-align: right;
}

.pd-pager__icon {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
    display: grid;
    place-items: center;
    font-size: 1.125rem;
    transition: background .2s, color .2s;
}

.pd-pager__link:hover .pd-pager__icon {
    background: var(--blue);
    color: var(--white);
}

.pd-pager__text small {
    color: var(--pd-muted);
    font-size: .8125rem;
    display: block;
}

.pd-pager__text strong {
    font-family: var(--font-title);
    letter-spacing: -.02em;
    margin-top: .1rem;
    font-size: 1.1875rem;
    font-weight: 600;
    line-height: 1.2;
    display: block;
}

/* Proyek terkait */
.pd-related {
    margin-top: var(--sp-5);
}

.pd-related__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}

.pd-related__head h2 {
    font-size: clamp(1.5rem, 2.2vw, 2rem);
}

.pd-related__all {
    color: var(--ink);
    font-size: .9375rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 1px solid var(--ink);
}

.pd-related__all:hover {
    color: var(--blue);
    border-color: var(--blue);
}

.pd-related__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-2);
    display: grid;
}

.pd-rel {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius);
    padding: .75rem;
    transition: box-shadow .25s, transform .25s;
}

.pd-rel:hover {
    box-shadow: 0 12px 32px rgba(32, 29, 29, .12);
    transform: translateY(-3px);
}

.pd-rel__media {
    display: block;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--ink);
}

.pd-rel__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s cubic-bezier(.16, 1, .3, 1);
}

.pd-rel:hover .pd-rel__media img {
    transform: scale(1.04);
}

.pd-rel__fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.pd-rel__media .pd-rel__fallback img {
    width: 30%;
    height: auto;
    max-height: 60%;
    object-fit: contain;
}

.pd-rel__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1rem .5rem .5rem;
}

.pd-rel__chips {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    margin-bottom: .75rem;
}

.pd-rel__chips > span {
    border: 1px solid var(--pd-line);
    border-radius: 999px;
    padding: .2rem .65rem;
    color: var(--pd-muted);
    font-size: .8125rem;
    line-height: 1.3;
}

.pd-rel__body strong {
    font-family: var(--font-title);
    letter-spacing: -.02em;
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.2;
    display: block;
}

.pd-rel__excerpt {
    color: var(--pd-muted);
    font-size: .9375rem;
    line-height: 1.55;
    margin-top: .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pd-rel__more {
    margin-top: auto;
    padding-top: 1rem;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--ink);
}

.pd-rel:hover .pd-rel__more {
    color: var(--blue);
}

/* Ajakan diskusi */
.pd-cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    flex-wrap: wrap;
    margin-top: var(--sp-5);
    background: var(--ink);
    background-image: radial-gradient(circle at 100% 0, rgba(246, 81, 0, .28), transparent 55%);
    color: var(--white);
    border-radius: var(--radius);
    padding: clamp(1.75rem, 4vw, 3rem);
}

.pd-cta-band__eyebrow {
    color: var(--blue);
    font-size: .9375rem;
    font-weight: 500;
    display: block;
    margin-bottom: .75rem;
}

.pd-cta-band h2 {
    font-size: clamp(1.75rem, 3vw, 2.75rem);
    max-width: 20ch;
    line-height: 1.1;
}

.pd-cta-band p {
    color: rgba(255, 255, 255, .78);
    max-width: 52ch;
    margin-top: var(--sp-2);
    font-size: 1.0625rem;
    line-height: 1.6;
}

.pd-cta-band__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.pd-cta-band .pd-cta {
    background: var(--blue);
}

.pd-cta-band .pd-cta:hover {
    background: var(--white);
    color: var(--ink);
}

.pd-cta-band .pd-cta--ghost {
    background: transparent;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
}

.pd a:focus-visible,
.pd summary:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Responsive ---------- */
@media (min-width: 720px) {
    .pd-compare__head {
        display: grid;
    }

    .pd-compare__row {
        grid-template-columns: 1fr 1fr;
    }

    .pd-compare__tag {
        display: none;
    }
}

@media (max-width: 900px) {
    .pd {
        --pd-offset: 132px;
    }

    .pd-layout.has-toc {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0;
    }

    /* Contents rail becomes a sticky, horizontally scrollable strip. */
    .pd-rail {
        z-index: 5;
        background: var(--white);
        border-bottom: 1px solid var(--pd-line);
        margin: 0 calc(var(--pad-x) * -1) var(--sp-3);
        padding-inline: var(--pad-x);
        top: 76px;
    }

    .pd-toc__label,
    .pd-cta--rail {
        display: none;
    }

    .pd-toc ol {
        border-left: 0;
        flex-direction: row;
        gap: .25rem;
        padding-block: .5rem;
        position: relative;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .pd-toc ol::-webkit-scrollbar {
        display: none;
    }

    .pd-toc a {
        border-left: 0;
        border-radius: var(--radius-sm);
        margin-left: 0;
        padding: .5rem .8rem;
        white-space: nowrap;
    }

    .pd-toc a[aria-current] {
        background: var(--ink);
        color: var(--white);
    }
}

@media (max-width: 719px) {
    .pd-related__grid {
        grid-template-columns: 1fr;
    }

    .pd-related__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .pd-pager {
        grid-template-columns: 1fr;
    }

    .pd-pager__link--next {
        grid-column: 1;
    }

    .pd-facts > div {
        grid-template-columns: 1fr;
        gap: .15rem;
    }

    .pd-problems > li {
        grid-template-columns: 2.25rem minmax(0, 1fr);
        gap: .75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pd * {
        transition: none !important;
    }

    html {
        scroll-behavior: auto;
    }
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Galeri screenshot */
.pd-gallery {
    background: var(--bg);
    padding-bottom: var(--sp-4);
}

.pd-gallery__stage {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--pd-line);
    background: #0b0b0d;
}

.pd-gallery__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.pd-gallery__track::-webkit-scrollbar {
    display: none;
}

.pd-gallery__slide {
    flex: 0 0 100%;
    margin: 0;
    scroll-snap-align: center;
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

/* Gambar mengisi kotak 16:9 tanpa pernah menambah tingginya; gambar potret mengecil menyesuaikan. */
.pd-gallery__slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.pd-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #201d1d;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

.pd-gallery__nav--prev { left: 12px; }
.pd-gallery__nav--next { right: 12px; }

.pd-gallery__nav:hover,
.pd-gallery__nav:focus-visible {
    background: #fff;
}

.pd-gallery__count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: .8125rem;
}

.pd-gallery__thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.pd-gallery__thumb {
    flex: 0 0 120px;
    aspect-ratio: 16 / 10;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #0b0b0d;
    cursor: pointer;
    opacity: .6;
    transition: opacity .2s, border-color .2s;
}

.pd-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pd-gallery__thumb:hover,
.pd-gallery__thumb[aria-selected="true"] {
    opacity: 1;
}

.pd-gallery__thumb[aria-selected="true"] {
    border-color: #ff5a00;
}

@media (max-width: 640px) {
    .pd-gallery__nav { width: 36px; height: 36px; }
    .pd-gallery__thumb { flex-basis: 84px; }
}

/* Breadcrumb */
.pd-crumbs {
    margin-bottom: var(--sp-3);
}

.pd-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .9375rem;
    color: var(--pd-muted);
}

.pd-crumbs li + li::before {
    content: "/";
    margin-right: 10px;
    opacity: .5;
}

.pd-crumbs a {
    color: inherit;
    text-decoration: none;
}

.pd-crumbs a:hover,
.pd-crumbs a:focus-visible {
    color: #ff5a00;
    text-decoration: underline;
}

.pd-crumbs li[aria-current="page"] {
    color: #201d1d;
    font-weight: 500;
}

.pd-label {
    display: block;
    margin-bottom: var(--sp-2);
}
