/* ==========================================================================
   pds-value — subsidy schemes accordion
   ========================================================================== */

.pds-value {
    position: relative;
    padding-block: var(--pds-section-y);
    background: var(--pds-paper);
}

.pds-value__inner {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: start;
    gap: clamp(2.5rem, 6vw, 5.5rem);
}

/* --- Aside ------------------------------------------------------------------ */

.pds-value__aside {
    position: sticky;
    inset-block-start: clamp(5rem, 12vh, 8rem);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.pds-value__aside .pds__h2 {
    max-inline-size: 16ch;
}

/* --- Media stage -------------------------------------------------------------
   Every scheme image is stacked in one frame; only the active one is drawn.
   The base slide defines the frame's height, the rest are absolutely placed on
   top of it. */

.pds-value__media {
    position: relative;
    margin: .5rem 0;
    aspect-ratio: 4 / 3;
    border-radius: var(--pds-r-lg);
}

.pds-value__slide {
    position: absolute;
    inset: 0;
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.05);
    transition: opacity .65s var(--pds-ease-out), transform 1s var(--pds-ease-out),
                visibility .65s;
}

.pds-value__slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.pds-value__slide img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    display: block;
}

/* --- List --------------------------------------------------------------------- */

.pds-value__list {
    display: flex;
    flex-direction: column;
}

.pds-value__item {
    border-block-start: 1px solid var(--pds-line);
}

.pds-value__item:last-of-type {
    border-block-end: 1px solid var(--pds-line);
}

.pds-value__item summary {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding-block: clamp(1.125rem, 2.2vw, 1.625rem);
    cursor: pointer;
    list-style: none;
    transition: color .35s var(--pds-ease);
}

/* Safari still paints its own disclosure triangle without this. */
.pds-value__item summary::-webkit-details-marker {
    display: none;
}

.pds-value__index {
    font-family: var(--pds-display);
    font-size: var(--pds-fs-eyebrow);
    font-weight: 600;
    letter-spacing: .12em;
    color: var(--pds-muted);
}

.pds-value__icon {
    display: grid;
    place-items: center;
    inline-size: 2.5rem;
    block-size: 2.5rem;
    border-radius: 50%;
    background: var(--pds-purple-wash);
    color: var(--pds-purple);
    transition: background-color .4s var(--pds-ease), color .4s var(--pds-ease),
                transform .45s var(--pds-ease);
}

.pds-value__item[open] .pds-value__icon,
.pds-value__item summary:hover .pds-value__icon {
    background: var(--pds-purple);
    color: #fff;
}

.pds-value__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .375rem .625rem;
    min-inline-size: 0;
}

.pds-value__title {
    font-family: var(--pds-display);
    font-size: clamp(1.0625rem, 1.5vw, 1.375rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--pds-title);
}

.pds-value__abbr {
    padding: .1875rem .5rem;
    border-radius: 6px;
    background: var(--pds-bone-deep);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pds-muted);
}

.pds-value__amount {
    font-family: var(--pds-display);
    font-size: var(--pds-fs-small);
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--pds-orange-ink);
    white-space: nowrap;
}

.pds-value__toggle {
    display: grid;
    place-items: center;
    inline-size: 2.25rem;
    block-size: 2.25rem;
    border: 1px solid var(--pds-line);
    border-radius: 50%;
    color: var(--pds-title);
    transition: transform .45s var(--pds-ease), background-color .35s var(--pds-ease),
                border-color .35s var(--pds-ease), color .35s var(--pds-ease);
}

.pds-value__item summary:hover .pds-value__toggle {
    border-color: var(--pds-title);
}

/* The plus becomes a minus by rotating 45°, so there is no icon swap. */
.pds-value__item[open] .pds-value__toggle {
    transform: rotate(45deg);
    background: var(--pds-orange);
    border-color: var(--pds-orange);
    color: #1B0C05;
}

/* --- Panel ---------------------------------------------------------------------- */

.pds-value__panel {
    overflow: hidden;
    transition: block-size .5s var(--pds-ease-out);
}

.pds-value__panel-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 0 clamp(1.25rem, 2.4vw, 1.75rem) calc(2.5rem + 1rem + 2.25rem);
}

.pds-value__panel-inner p {
    max-inline-size: 60ch;
    font-size: var(--pds-fs-small);
    line-height: 1.65;
    color: var(--pds-body);
}

.pds-value__panel-inner ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: .625rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pds-value__panel-inner li {
    display: flex;
    align-items: flex-start;
    gap: .5625rem;
    font-size: var(--pds-fs-small);
    line-height: 1.5;
    color: var(--pds-body);
}

.pds-value__panel-inner li svg {
    flex: none;
    margin-block-start: .25rem;
    color: var(--pds-sage);
}

/* --- Note -------------------------------------------------------------------------- */

.pds-value__note {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    margin-block-start: 1.5rem;
    padding: 1.125rem 1.25rem;
    border-radius: var(--pds-r-sm);
    background: var(--pds-bone);
    font-size: var(--pds-fs-eyebrow);
    line-height: 1.6;
    color: var(--pds-muted);
}

.pds-value__note svg {
    flex: none;
    margin-block-start: .125rem;
    color: var(--pds-purple);
}

/* --- Responsive --------------------------------------------------------------------- */

@media (max-width: 1023px) {

    .pds-value__inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .pds-value__aside {
        position: static;
    }

    .pds-value__aside .pds__h2 {
        max-inline-size: none;
    }
}

@media (max-width: 599px) {

    .pds-value__item summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: .75rem;
    }

    /* The index and the amount are the first things to go when the row runs
       out of width — both repeat information the panel already carries. */
    .pds-value__index,
    .pds-value__amount {
        display: none;
    }

    .pds-value__panel-inner {
        padding-inline-start: calc(2.5rem + .75rem);
    }
}
