/* ==========================================================================
   Polarity Map Builder — Styles
   ========================================================================== */

.ppb-builder {
    --ppb-warm: #c17d3c;
    --ppb-warm-light: rgba(193, 125, 60, 0.08);
    --ppb-warm-mid: rgba(193, 125, 60, 0.15);
    --ppb-teal: #3c8c96;
    --ppb-teal-light: rgba(60, 140, 150, 0.08);
    --ppb-teal-mid: rgba(60, 140, 150, 0.15);
    --ppb-dark: #1a1614;
    --ppb-text: #1a1614;
    --ppb-muted: #6b5f58;
    --ppb-bg: #faf8f4;
    --ppb-border: #e8e2d8;
    --ppb-input-bg: #fff;

    font-family: 'Lora', 'Georgia', serif;
    color: var(--ppb-text);
    background: var(--ppb-bg);
    border-radius: 12px;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* ==========================================================================
   Step Screens
   ========================================================================== */

.ppb-step {
    padding: 56px 48px 48px;
    opacity: 0;
    transition: opacity 200ms ease;
    display: none;
}

.ppb-step--active {
    display: block;
}

.ppb-step--visible {
    opacity: 1;
}

/* ---- Prompt ---- */

.ppb-prompt {
    font-family: 'Fraunces', 'Lora', 'Georgia', serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--ppb-text);
    margin: 0 0 32px;
    font-optical-sizing: auto;
}

/* ---- Helper text ---- */

.ppb-helper {
    font-family: 'Lora', 'Georgia', serif;
    font-size: 15px;
    font-style: italic;
    color: var(--ppb-muted);
    line-height: 1.6;
    margin: 16px 0 0;
}

/* ---- Inputs ---- */

.ppb-input-wrap {
    margin: 0 0 8px;
}

.ppb-input,
.ppb-textarea {
    width: 100%;
    font-family: 'DM Mono', 'Menlo', monospace;
    font-size: 16px;
    color: var(--ppb-text);
    background: var(--ppb-input-bg);
    border: 1.5px solid var(--ppb-border);
    border-radius: 8px;
    padding: 14px 16px;
    box-sizing: border-box;
    transition: border-color 200ms ease, box-shadow 200ms ease;
    outline: none;
}

.ppb-input:focus,
.ppb-textarea:focus {
    border-color: var(--ppb-warm);
    box-shadow: 0 0 0 3px rgba(193, 125, 60, 0.12);
}

.ppb-input::placeholder,
.ppb-textarea::placeholder {
    color: #b5ada4;
    font-style: italic;
}

.ppb-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* ---- Bullet fields ---- */

.ppb-bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 4px;
}

.ppb-bullets li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ppb-bullets li::before {
    content: '\2022';
    color: var(--ppb-warm);
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}

.ppb-bullets .ppb-input {
    flex: 1;
}

.ppb-add-btn {
    background: none;
    border: none;
    font-family: 'Lora', 'Georgia', serif;
    font-size: 14px;
    color: var(--ppb-warm);
    cursor: pointer;
    padding: 4px 0;
    margin-top: 4px;
    transition: opacity 150ms;
}

.ppb-add-btn:hover {
    opacity: 0.7;
}

/* ---- Example tags ---- */

.ppb-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
}

.ppb-example-tag {
    font-family: 'Lora', 'Georgia', serif;
    font-size: 13px;
    color: var(--ppb-muted);
    background: rgba(193, 125, 60, 0.06);
    border: 1px solid var(--ppb-border);
    border-radius: 20px;
    padding: 5px 14px;
    cursor: pointer;
    transition: background 150ms, border-color 150ms;
    white-space: nowrap;
}

.ppb-example-tag:hover {
    background: var(--ppb-warm-light);
    border-color: rgba(193, 125, 60, 0.3);
}

/* ---- CTA button ---- */

.ppb-cta {
    display: inline-block;
    font-family: 'Fraunces', 'Lora', 'Georgia', serif;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: var(--ppb-warm);
    border: none;
    border-radius: 8px;
    padding: 14px 32px;
    margin-top: 32px;
    cursor: pointer;
    transition: background 200ms, transform 100ms, opacity 200ms;
    opacity: 0.4;
    pointer-events: none;
}

.ppb-cta--enabled {
    opacity: 1;
    pointer-events: auto;
}

.ppb-cta--enabled:hover {
    background: #a96a2f;
}

.ppb-cta--enabled:active {
    transform: translateY(1px);
}

/* ==========================================================================
   Step 5 — Bridge Moment
   ========================================================================== */

.ppb-bridge-card {
    background: var(--ppb-warm-light);
    border: 1px solid var(--ppb-border);
    border-radius: 10px;
    padding: 20px 24px;
    margin: 0 0 24px;
    opacity: 0;
    transition: opacity 300ms ease;
}

.ppb-bridge-card--visible {
    opacity: 1;
}

.ppb-bridge-card__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ppb-warm);
    margin: 0 0 10px;
}

.ppb-bridge-card__item {
    font-family: 'DM Mono', 'Menlo', monospace;
    font-size: 14px;
    color: var(--ppb-text);
    line-height: 1.6;
    margin: 0 0 4px;
}

.ppb-bridge-narration {
    font-family: 'Fraunces', 'Lora', 'Georgia', serif;
    font-size: 18px;
    font-style: italic;
    color: var(--ppb-muted);
    line-height: 1.6;
    margin: 0 0 28px;
    opacity: 0;
    transition: opacity 500ms ease;
}

.ppb-bridge-narration--visible {
    opacity: 1;
}

.ppb-step5-prompt {
    opacity: 0;
    transition: opacity 300ms ease;
}

.ppb-step5-prompt--visible {
    opacity: 1;
}

/* ==========================================================================
   Completed Map
   ========================================================================== */

.ppb-result {
    padding: 48px 32px;
    opacity: 0;
    transition: opacity 600ms ease;
    display: none;
}

.ppb-result--active {
    display: block;
}

.ppb-result--visible {
    opacity: 1;
}

/* ---- Map container ---- */

.ppb-map {
    max-width: 680px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--ppb-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ---- Greater Purpose ---- */

.ppb-map__purpose {
    background: var(--ppb-warm);
    color: #fff;
    text-align: center;
    padding: 20px 24px;
}

.ppb-map__purpose-label {
    font-family: 'Fraunces', 'Lora', serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
    margin: 0 0 6px;
}

.ppb-map__purpose-text {
    font-family: 'Fraunces', 'Lora', serif;
    font-size: 19px;
    font-style: italic;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
}

/* ---- Gifts row ---- */

.ppb-map__gifts {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.ppb-map__gifts-section {
    padding: 20px 24px;
}

.ppb-map__gifts-section:first-child {
    background: var(--ppb-warm-light);
}

.ppb-map__gifts-section:last-child {
    background: var(--ppb-teal-light);
    border-left: 1px solid var(--ppb-border);
}

.ppb-map__section-label {
    font-family: 'Fraunces', 'Lora', serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 12px;
}

.ppb-map__section-label--a {
    color: var(--ppb-warm);
}

.ppb-map__section-label--b {
    color: var(--ppb-teal);
}

.ppb-map__item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ppb-map__item-list li {
    font-family: 'Lora', 'Georgia', serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ppb-text);
    padding: 3px 0 3px 16px;
    position: relative;
}

.ppb-map__item-list li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: var(--ppb-muted);
}

/* ---- Pole names row ---- */

.ppb-map__poles {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background: #fff;
    border-top: 1px solid var(--ppb-border);
    border-bottom: 1px solid var(--ppb-border);
    padding: 16px 24px;
}

.ppb-map__pole-name {
    font-family: 'Fraunces', 'Lora', serif;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
}

.ppb-map__pole-name--a {
    color: var(--ppb-warm);
}

.ppb-map__pole-name--b {
    color: var(--ppb-teal);
}

.ppb-map__pole-arrow {
    font-size: 28px;
    color: rgba(193, 125, 60, 0.4);
    padding: 0 16px;
    user-select: none;
}

/* ---- Shadows row ---- */

.ppb-map__shadows {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.ppb-map__shadows-section {
    padding: 20px 24px;
}

.ppb-map__shadows .ppb-map__shadows-section:first-child {
    background: rgba(193, 125, 60, 0.04);
}

.ppb-map__shadows .ppb-map__shadows-section:last-child {
    background: rgba(60, 140, 150, 0.04);
    border-left: 1px solid var(--ppb-border);
}

/* ---- Deeper Fear ---- */

.ppb-map__fear {
    background: var(--ppb-dark);
    color: #fff;
    text-align: center;
    padding: 20px 24px;
}

.ppb-map__fear-label {
    font-family: 'Fraunces', 'Lora', serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.5;
    margin: 0 0 6px;
}

.ppb-map__fear-text {
    font-family: 'Fraunces', 'Lora', serif;
    font-size: 19px;
    font-style: italic;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
}

/* ---- Closing narration ---- */

.ppb-closing {
    max-width: 560px;
    margin: 48px auto 0;
    text-align: center;
}

.ppb-closing__text {
    font-family: 'Fraunces', 'Lora', serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--ppb-text);
    margin: 0 0 16px;
}

.ppb-closing__credit {
    font-family: 'Lora', 'Georgia', serif;
    font-size: 12px;
    font-style: italic;
    color: var(--ppb-muted);
    margin: 32px 0 0;
}

/* ---- Actions ---- */

.ppb-actions {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin: 36px 0 0;
}

.ppb-action-link {
    font-family: 'Lora', 'Georgia', serif;
    font-size: 14px;
    color: var(--ppb-warm);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 4px;
    transition: opacity 150ms;
    text-decoration: none;
}

.ppb-action-link:hover {
    opacity: 0.7;
}

.ppb-action-link--subtle {
    color: var(--ppb-muted);
    font-size: 13px;
}

/* ==========================================================================
   Visually hidden (accessible labels)
   ========================================================================== */

.ppb-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 600px) {
    .ppb-step {
        padding: 36px 24px 32px;
    }

    .ppb-prompt {
        font-size: 20px;
    }

    .ppb-result {
        padding: 32px 16px;
    }

    /* Stack map columns vertically */
    .ppb-map__gifts,
    .ppb-map__shadows {
        grid-template-columns: 1fr;
    }

    .ppb-map__gifts-section:last-child,
    .ppb-map__shadows .ppb-map__shadows-section:last-child {
        border-left: none;
        border-top: 1px solid var(--ppb-border);
    }

    .ppb-map__poles {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }

    .ppb-map__pole-arrow {
        transform: rotate(90deg);
        padding: 0;
        display: block;
        text-align: center;
    }

    .ppb-map__pole-name {
        font-size: 18px;
    }

    .ppb-map__purpose-text,
    .ppb-map__fear-text {
        font-size: 17px;
    }

    .ppb-closing__text {
        font-size: 15px;
    }

    .ppb-cta {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================================
   Print — show only the map
   ========================================================================== */

@media print {
    .ppb-builder .ppb-step {
        display: none !important;
    }

    .ppb-builder .ppb-result {
        display: block !important;
        opacity: 1 !important;
        padding: 0;
    }

    .ppb-builder {
        background: #fff;
        border-radius: 0;
    }

    .ppb-actions {
        display: none !important;
    }

    .ppb-map {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
