/* ==========================================================================
   Frontier Pipeline — Frontend Chart Styles
   ========================================================================== */

.pp-pipeline {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 100%;
    overflow-x: auto;
}

/* Group
   ========================================================================== */

.pp-pipeline__group {
    margin-bottom: 32px;
    min-width: 900px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Header
   ========================================================================== */

.pp-pipeline__header {
    background: linear-gradient(90deg, #1a1a4e, #7b2d8e);
    color: #fff;
    padding: 18px 24px;
}

.pp-pipeline__header-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: inherit;
}

/* Column labels
   ========================================================================== */

.pp-pipeline__columns {
    display: grid;
    grid-template-columns: 200px 1fr 180px 150px 40px;
    gap: 0;
    padding: 20px 20px 10px;
    background: transparent;
    border-bottom: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1a3a6b;
}

.pp-pipeline__col-label--phases {
    display: flex;
    justify-content: space-around;
    padding: 0 16px;
}

.pp-pipeline__col-label--milestones {
    white-space: nowrap;
}

.pp-pipeline__col-label--rights {
    text-align: center;
}

/* Program row
   ========================================================================== */

.pp-pipeline__row {
    display: grid;
    grid-template-columns: 200px 1fr 180px 150px 40px;
    gap: 0;
    padding: 14px 20px;
    align-items: center;
    border-bottom: none;
    background: transparent;
    transition: background-color 0.15s ease;
}

.pp-pipeline__row:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* Program info */

.pp-pipeline__program-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pp-pipeline__program-name {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
}

.pp-pipeline__edit-link {
    font-size: 11px;
    font-weight: 400;
    color: #999;
    text-decoration: none;
    margin-left: 6px;
}

.pp-pipeline__edit-link:hover {
    color: #0073aa;
    text-decoration: underline;
}

.pp-pipeline__program-target {
    font-size: 12px;
    color: #000;
}

.pp-pipeline__program-mechanism {
    font-size: 11px;
    color: #000;
}

/* Phase track / progress bar
   ========================================================================== */

.pp-pipeline__phases {
    padding: 0 16px;
}

.pp-pipeline__phase-track {
    position: relative;
    height: 28px;
    background: #d9d9d9;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 96% 100%, 4% 100%);
}

.pp-pipeline__phase-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.6);
    z-index: 2;
    transform: translateX(-1px);
}

.pp-pipeline__progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: linear-gradient(90deg, #1a1a4e, #7b2d8e, #e84393);
    z-index: 1;
    transform-origin: left;
}

@keyframes pp-grow-bar {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

.pp-pipeline--visible .pp-pipeline__progress-bar {
    animation: pp-grow-bar 1s ease-out 0.3s both;
}

/* Phase labels under the track */

.pp-pipeline__phase-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    padding: 0 2px;
}

/* Milestones
   ========================================================================== */

.pp-pipeline__milestones {
    font-size: 13px;
    color: #444;
    padding: 0 8px;
}

/* Rights
   ========================================================================== */

.pp-pipeline__rights {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pp-pipeline__rights-logo {
    max-height: 28px;
    max-width: 100px;
    object-fit: contain;
    flex-shrink: 1;
    min-width: 0;
}

.pp-pipeline__rights-name {
    font-size: 12px;
    color: #666;
}

.pp-pipeline__toggle-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toggle button
   ========================================================================== */

.pp-pipeline__toggle {
    background: none;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #666;
    transition: transform 0.25s ease, border-color 0.15s ease;
    flex-shrink: 0;
}

.pp-pipeline__toggle:hover {
    opacity: 0.8;
}

.pp-pipeline__toggle[aria-expanded="true"] {
    transform: rotate(180deg);
}

.pp-pipeline__toggle-icon {
    display: block;
}

/* Expanded content
   ========================================================================== */

.pp-pipeline__expanded {
    grid-column: 1 / -1;
    overflow: hidden;
    border-bottom: 1px solid #eee;
    background: rgba(0, 0, 0, 0.01);
}

.pp-pipeline__expanded[hidden] {
    display: none;
}

.pp-pipeline__expanded-inner {
    padding: 24px 28px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.pp-pipeline__expanded-inner > *:first-child {
    margin-top: 0;
}

.pp-pipeline__expanded-inner > *:last-child {
    margin-bottom: 0;
}

.pp-pipeline__expanded-inner img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.pp-pipeline__expanded-inner .wp-block-button__link {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
}

/* Mobile meta — hidden on desktop
   ========================================================================== */

.pp-pipeline__mobile-meta {
    display: none;
}

/* No-milestones modifier — 4-column grid
   ========================================================================== */

.pp-pipeline--no-milestones .pp-pipeline__columns,
.pp-pipeline--no-milestones .pp-pipeline__row {
    grid-template-columns: 200px 1fr 150px 40px;
}

/* Responsive — mobile card layout
   ========================================================================== */

@media (max-width: 768px) {
    .pp-pipeline {
        overflow-x: visible;
    }

    .pp-pipeline__group {
        min-width: 0;
    }

    .pp-pipeline__columns {
        display: none;
    }

    .pp-pipeline__row {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 16px 20px;
        border-bottom: 1px solid #eee;
        cursor: pointer;
        position: relative;
    }

    .pp-pipeline__row:hover {
        background: rgba(0, 0, 0, 0.02);
    }

    .pp-pipeline__program-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
        width: 100%;
        padding-right: 100px;
    }

    .pp-pipeline__rights {
        position: absolute;
        top: 16px;
        right: 60px;
        justify-content: flex-end;
    }

    .pp-pipeline__rights-logo {
        max-height: 24px;
    }

    .pp-pipeline__phases {
        width: 100%;
        padding: 0;
    }

    .pp-pipeline__mobile-meta {
        display: block;
        width: 100%;
    }

    .pp-pipeline__stage-label {
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #1a3a6b;
        margin-bottom: 4px;
    }

    .pp-pipeline__milestones-label {
        font-size: 12px;
        color: #555;
        line-height: 1.4;
    }

    .pp-pipeline__milestones-label strong {
        color: #333;
    }

    .pp-pipeline__milestones {
        display: none;
    }

    .pp-pipeline__toggle-cell {
        display: flex;
        position: absolute;
        top: 16px;
        right: 20px;
        align-items: center;
        justify-content: center;
    }

    .pp-pipeline__expanded {
        border-bottom: 1px solid #eee;
    }

    .pp-pipeline__expanded-inner {
        padding: 16px 20px;
    }
}
