/* Public project story and authenticated mobile publishing form. */
.pmp-project-story {
    overflow-x: clip;
    color: var(--ink);
    background: #ffffff;
}

.pmp-story__inner {
    width: calc(100% - 2rem);
    max-width: 1160px;
    margin: 0 auto;
}

.pmp-story-kicker {
    margin: 0;
    color: #315eff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.pmp-story-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: 640px;
    align-items: flex-end;
    overflow: hidden;
    padding: 8rem 0 5.5rem;
    color: #ffffff;
    background: #071324;
}

.pmp-story-hero::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: rgba(7, 19, 36, 0.68);
    content: "";
}

.pmp-story-hero__media {
    position: absolute;
    z-index: -2;
    inset: 0;
}

.pmp-story-hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 52%;
}

.pmp-story-hero__inner {
    position: relative;
    display: grid;
    gap: 1.15rem;
}

.pmp-story-hero .pmp-story-kicker {
    color: #a9bdff;
}

.pmp-story-hero h1 {
    max-width: 920px;
    margin: 0;
    color: #ffffff;
    font-size: 4.5rem;
    line-height: 1.02;
    letter-spacing: 0;
}

.pmp-story-hero p:last-child {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.18rem;
    line-height: 1.65;
}

/* Authenticated frontend form: retained as the compact mobile-first control. */
.pmp-story-admin {
    border-bottom: 1px solid var(--line);
    background: var(--pmp-surface-soft);
}

.pmp-story-admin > .pmp-story__inner {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.pmp-story-notice {
    margin-bottom: 0.85rem;
    border: 1px solid rgba(49, 94, 255, 0.24);
    border-radius: 6px;
    padding: 0.8rem 0.95rem;
    color: var(--ink);
    background: #eef3ff;
    font-weight: 700;
}

.pmp-story-notice--error {
    border-color: rgba(174, 53, 43, 0.24);
    color: #792b25;
    background: #fff3f1;
}

.pmp-story-form-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.pmp-story-form-panel summary {
    min-height: 3.1rem;
    padding: 0.85rem 1rem;
    color: var(--blue-deep);
    font-weight: 780;
    cursor: pointer;
    list-style: none;
}

.pmp-story-form-panel summary::-webkit-details-marker {
    display: none;
}

.pmp-story-form-panel summary:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.pmp-story-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 0 1rem 1rem;
}

.pmp-story-field {
    display: grid;
    gap: 0.42rem;
    min-width: 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 700;
}

.pmp-story-field--wide {
    grid-column: 1 / -1;
}

.pmp-story-field input,
.pmp-story-field select,
.pmp-story-field textarea {
    width: 100%;
    min-width: 0;
    min-height: 2.85rem;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 0.7rem 0.78rem;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
}

.pmp-story-field input[type="file"] {
    padding: 0.5rem;
}

.pmp-story-field textarea {
    min-height: 8.5rem;
    resize: vertical;
}

.pmp-story-field input:focus,
.pmp-story-field select:focus,
.pmp-story-field textarea:focus {
    border-color: var(--blue);
    outline: 3px solid rgba(49, 94, 255, 0.16);
}

.pmp-story-field small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.pmp-story-form__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.pmp-story-feed {
    padding: 6rem 0 6.5rem;
}

.pmp-story-section-heading {
    display: grid;
    gap: 0.8rem;
    max-width: 820px;
    margin-bottom: 3.5rem;
}

.pmp-story-section-heading h2,
.pmp-story-impact h2,
.pmp-story-closing h2 {
    margin: 0;
    color: var(--ink);
    font-size: 2.8rem;
    line-height: 1.08;
    letter-spacing: 0;
}

.pmp-story-timeline {
    position: relative;
    display: grid;
}

.pmp-story-timeline::before {
    position: absolute;
    top: 2.75rem;
    bottom: 2.75rem;
    left: 50%;
    width: 1px;
    background: #d7deeb;
    content: "";
}

.pmp-story-entry {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 2rem;
    align-items: start;
    min-width: 0;
    padding: 2.75rem 0;
}

.pmp-story-entry__point {
    z-index: 1;
    display: grid;
    width: 56px;
    height: 56px;
    grid-column: 2;
    grid-row: 1 / 3;
    place-items: center;
    align-self: center;
    border: 1px solid #cbd5e6;
    border-radius: 50%;
    color: #183fd5;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(7, 19, 36, 0.08);
    font-size: 0.82rem;
    font-weight: 850;
}

.pmp-story-entry__media {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
    margin: 0;
    overflow: hidden;
    border-radius: 8px;
    background: var(--pmp-surface-soft);
    box-shadow: 0 18px 42px rgba(7, 19, 36, 0.11);
    aspect-ratio: 4 / 3;
}

.pmp-story-entry__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pmp-story-entry__meta {
    display: flex;
    min-width: 0;
    grid-column: 3;
    grid-row: 1;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    margin-bottom: 0.9rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.pmp-story-entry__copy {
    min-width: 0;
    grid-column: 3;
    grid-row: 2;
}

.pmp-story-entry:nth-child(even) .pmp-story-entry__media {
    grid-column: 3;
}

.pmp-story-entry:nth-child(even) .pmp-story-entry__meta,
.pmp-story-entry:nth-child(even) .pmp-story-entry__copy {
    grid-column: 1;
}

.pmp-story-status,
.pmp-story-visibility {
    border: 1px solid rgba(49, 94, 255, 0.22);
    border-radius: 4px;
    padding: 0.24rem 0.48rem;
    color: #244f9b;
    background: #eaf1ff;
}

.pmp-story-status--preparation {
    border-color: #d4dbe5;
    color: #43546c;
    background: #eef1f5;
}

.pmp-story-status--conversion {
    border-color: #f0d79a;
    color: #7a4a00;
    background: #fff3d6;
}

.pmp-story-status--almost-done {
    border-color: #bcdcc9;
    color: #276a49;
    background: #e7f6ee;
}

.pmp-story-status--live {
    border-color: #a8d5b9;
    color: #16643b;
    background: #dff3e7;
}

.pmp-story-visibility {
    border-color: var(--line-strong);
    color: var(--ink-soft);
    background: #ffffff;
}

.pmp-story-entry h3 {
    margin: 0;
    color: var(--ink);
    font-size: 2rem;
    line-height: 1.15;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.pmp-story-entry__text {
    margin-top: 1rem;
    color: var(--ink-soft);
    line-height: 1.7;
}

.pmp-story-entry__text > *:first-child {
    margin-top: 0;
}

.pmp-story-entry__text > *:last-child {
    margin-bottom: 0;
}

.pmp-story-entry__admin {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
}

.pmp-story-entry__admin form {
    margin: 0;
}

.pmp-story-entry__admin a,
.pmp-story-entry__admin button {
    border: 0;
    padding: 0;
    color: var(--blue-deep);
    background: transparent;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    cursor: pointer;
}

.pmp-story-entry__admin button {
    color: #792b25;
}

.pmp-story-empty {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 3rem 0;
}

.pmp-story-empty h3,
.pmp-story-empty p {
    max-width: 680px;
    margin: 0;
}

.pmp-story-empty h3 {
    font-size: 1.65rem;
}

.pmp-story-empty p {
    margin-top: 0.6rem;
    color: var(--muted);
}

.pmp-story-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
    margin-top: 2.5rem;
}

.pmp-story-pagination .page-numbers {
    display: grid;
    min-width: 2.7rem;
    min-height: 2.7rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.45rem 0.7rem;
    color: var(--ink);
    background: #ffffff;
}

.pmp-story-pagination .current {
    border-color: var(--blue);
    color: #ffffff;
    background: var(--blue);
}

.pmp-story-move-banner {
    padding: 4.75rem 0;
    color: #ffffff;
    background: #071324;
}

.pmp-story-move-banner__inner {
    display: grid;
    grid-template-columns: minmax(0, 0.6fr) minmax(280px, 0.4fr);
    gap: 3rem;
    align-items: end;
}

.pmp-story-move-banner h2,
.pmp-story-move-banner p {
    margin: 0;
}

.pmp-story-move-banner h2 {
    color: #ffffff;
    font-size: 3.25rem;
    line-height: 1.05;
    letter-spacing: 0;
}

.pmp-story-move-banner p {
    color: rgba(255, 255, 255, 0.76);
    font-size: 1.08rem;
    line-height: 1.65;
}

.pmp-story-gallery {
    padding: 5.5rem 0 5.75rem;
    background: #ffffff;
}

.pmp-story-section-heading--compact {
    margin-bottom: 2.25rem;
}

.pmp-story-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
}

.pmp-story-gallery figure {
    min-width: 0;
    margin: 0;
}

.pmp-story-gallery__image {
    overflow: hidden;
    border-radius: 8px;
    background: var(--pmp-surface-soft);
    aspect-ratio: 4 / 3;
}

.pmp-story-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 280ms ease;
}

.pmp-story-gallery figure:hover img {
    transform: scale(1.025);
}

.pmp-story-gallery figcaption {
    display: grid;
    gap: 0.3rem;
    padding-top: 0.8rem;
}

.pmp-story-gallery figcaption strong {
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.pmp-story-gallery figcaption time {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.pmp-story-impact {
    padding: 5.5rem 0 5.75rem;
    background: var(--pmp-surface-soft);
}

.pmp-story-impact__intro {
    max-width: 700px;
    color: var(--ink-soft);
    line-height: 1.7;
}

.pmp-story-impact__intro > *:first-child {
    margin-top: 0;
}

.pmp-story-impact__intro > *:last-child {
    margin-bottom: 0;
}

.pmp-story-impact__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}

.pmp-story-impact__grid article {
    min-width: 0;
    border-top: 2px solid #315eff;
    padding-top: 1.25rem;
}

.pmp-story-impact__grid article > span {
    display: block;
    margin-bottom: 1.25rem;
    color: #315eff;
    font-size: 0.78rem;
    font-weight: 850;
}

.pmp-story-impact__grid h3,
.pmp-story-impact__grid p {
    margin: 0;
}

.pmp-story-impact__grid h3 {
    color: var(--ink);
    font-size: 1.25rem;
    line-height: 1.25;
    letter-spacing: 0;
}

.pmp-story-impact__grid p {
    margin-top: 0.7rem;
    color: var(--ink-soft);
    font-size: 0.94rem;
    line-height: 1.65;
}

.pmp-story-closing {
    padding: 5rem 0 5.25rem;
    border-top: 1px solid var(--line);
    background: #ffffff;
}

.pmp-story-closing__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3rem;
    align-items: end;
}

.pmp-story-closing__inner > div {
    display: grid;
    gap: 0.85rem;
    max-width: 780px;
}

.pmp-story-closing__inner > div > p:last-child {
    max-width: 700px;
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.7;
}

.pmp-story-closing .button {
    min-width: 190px;
    min-height: 3rem;
}

@media (max-width: 1100px) {
    .pmp-story-hero h1 {
        font-size: 4rem;
    }

    .pmp-story-entry {
        column-gap: 1.5rem;
    }
}

@media (max-width: 900px) {
    .pmp-story-hero {
        min-height: 580px;
        padding: 7rem 0 4.75rem;
    }

    .pmp-story-hero h1 {
        font-size: 3.5rem;
    }

    .pmp-story-timeline::before {
        top: 0;
        bottom: 0;
        left: 27px;
    }

    .pmp-story-entry {
        grid-template-columns: 56px minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        gap: 1rem 1.25rem;
        padding: 2.75rem 0;
    }

    .pmp-story-entry__point {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
    }

    .pmp-story-entry__meta,
    .pmp-story-entry:nth-child(even) .pmp-story-entry__meta {
        min-height: 56px;
        grid-column: 2;
        grid-row: 1;
        margin-bottom: 0;
    }

    .pmp-story-entry__media,
    .pmp-story-entry:nth-child(even) .pmp-story-entry__media {
        width: 100%;
        max-width: 760px;
        grid-column: 2;
        grid-row: 2;
    }

    .pmp-story-entry__copy,
    .pmp-story-entry:nth-child(even) .pmp-story-entry__copy {
        grid-column: 2;
        grid-row: 3;
    }

    .pmp-story-entry--without-image .pmp-story-entry__copy {
        grid-row: 2;
    }

    .pmp-story-move-banner__inner,
    .pmp-story-closing__inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        align-items: start;
    }

    .pmp-story-move-banner h2 {
        font-size: 2.75rem;
    }

    .pmp-story-gallery__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pmp-story-impact__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 2.5rem;
    }

    .pmp-story-closing .button {
        justify-self: start;
    }
}

@media (max-width: 620px) {
    .pmp-story__inner {
        width: calc(100% - 2rem);
    }

    .pmp-story-hero {
        min-height: 520px;
        padding: 6.5rem 0 3.75rem;
    }

    .pmp-story-hero::after {
        background: rgba(7, 19, 36, 0.72);
    }

    .pmp-story-hero h1 {
        font-size: 2.65rem;
        line-height: 1.07;
    }

    .pmp-story-hero p:last-child {
        font-size: 1rem;
        line-height: 1.58;
    }

    .pmp-story-admin > .pmp-story__inner {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .pmp-story-form-panel summary {
        min-height: 3.25rem;
        padding: 0.9rem;
    }

    .pmp-story-form {
        grid-template-columns: 1fr;
        gap: 0.9rem;
        padding: 0 0.9rem 0.9rem;
    }

    .pmp-story-field--wide {
        grid-column: auto;
    }

    .pmp-story-field input,
    .pmp-story-field select,
    .pmp-story-field textarea {
        min-height: 3rem;
        font-size: 1rem;
    }

    .pmp-story-field textarea {
        min-height: 9rem;
    }

    .pmp-story-form__actions {
        display: grid;
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .pmp-story-form__actions .button {
        width: 100%;
        min-height: 3rem;
    }

    .pmp-story-feed,
    .pmp-story-gallery,
    .pmp-story-impact {
        padding: 4rem 0 4.25rem;
    }

    .pmp-story-section-heading {
        margin-bottom: 2.5rem;
    }

    .pmp-story-section-heading h2,
    .pmp-story-impact h2,
    .pmp-story-closing h2 {
        font-size: 2.1rem;
    }

    .pmp-story-timeline::before {
        left: 23px;
    }

    .pmp-story-entry {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 0.85rem 0.75rem;
        padding: 2.2rem 0;
    }

    .pmp-story-entry__point {
        width: 46px;
        height: 46px;
        font-size: 0.75rem;
    }

    .pmp-story-entry__meta,
    .pmp-story-entry:nth-child(even) .pmp-story-entry__meta {
        min-height: 46px;
        gap: 0.42rem;
    }

    .pmp-story-entry h3 {
        font-size: 1.6rem;
    }

    .pmp-story-entry__admin {
        min-height: 2.75rem;
    }

    .pmp-story-move-banner {
        padding: 4rem 0;
    }

    .pmp-story-move-banner h2 {
        font-size: 2.2rem;
    }

    .pmp-story-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem 0.65rem;
    }

    .pmp-story-gallery figcaption {
        padding-top: 0.65rem;
    }

    .pmp-story-gallery figcaption strong {
        font-size: 0.82rem;
    }

    .pmp-story-gallery figcaption time {
        font-size: 0.72rem;
    }

    .pmp-story-impact__grid {
        grid-template-columns: 1fr;
        gap: 2.25rem;
    }

    .pmp-story-closing {
        padding: 4rem 0 4.25rem;
    }

    .pmp-story-closing .button {
        width: 100%;
        min-height: 3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pmp-story-gallery img {
        transition: none;
    }
}
