/* Alice im Quantenland: section-specific refinement of Core content elements.
   Editorial records, FAL references and their configured image positions stay intact. */
.pw-content--alice {
    --pw-alice-gap: clamp(1.5rem, 4vw, 3.25rem);
    --pw-alice-section-gap: clamp(2.75rem, 7vw, 5.5rem);
    padding-bottom: clamp(3.5rem, 8vw, 7rem);
    color: var(--pw-ink);
}

.pw-content--alice :is(.frame-type-text, .frame-type-textmedia) {
    font-size: clamp(1rem, 0.35vw + 0.93rem, 1.075rem);
    line-height: 1.72;
}

.pw-content--alice :is(.frame-type-text, .frame-type-textmedia) p {
    margin-block: 0 0.9em;
}

.pw-content--alice :is(.frame-type-text, .frame-type-textmedia) p:last-child {
    margin-bottom: 0;
}

.pw-content--alice :is(h2, h3, h4) {
    color: #1d1d1b;
    letter-spacing: 0;
}

.pw-content--alice h3 {
    margin-block: 1.8em 0.65em;
    font-size: clamp(1.15rem, 1.6vw, 1.4rem);
    font-weight: 750;
    line-height: 1.3;
}

.pw-content--alice h4 {
    margin-block: 1.5em 0.6em;
    font-size: clamp(1.05rem, 1.35vw, 1.25rem);
    font-weight: 750;
    line-height: 1.35;
}

.pw-content--alice .ce-gallery img {
    margin-inline: auto;
}

/* Entry page: preserve the alternating Core image positions and vertically
   centre each compact text block next to its 4:3 illustration. */
.pw-content--alice-entry > .frame + .frame {
    margin-top: var(--pw-alice-section-gap);
}

.pw-content--alice-entry > .pw-section-transition--standard {
    width: min(calc(100% - 2rem), var(--pw-content-normal));
    margin: calc(var(--pw-alice-section-gap) / 2) auto;
}

.pw-content--alice-entry > .pw-section-transition--standard + .frame {
    margin-top: 0;
}

.pw-content--alice-entry > .frame-type-header + .frame {
    margin-top: clamp(2.25rem, 5vw, 4rem);
}

.pw-content.pw-content--alice-entry > .frame-type-textmedia .ce-intext {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--pw-alice-gap);
}

.pw-content.pw-content--alice-entry > .frame-type-textmedia .ce-intext .ce-gallery {
    width: 100%;
    max-width: none;
    margin: 0;
}

.pw-content--alice-entry .ce-intext .ce-bodytext {
    min-width: 0;
}

.pw-content.pw-content--alice-entry > .frame-type-textmedia .ce-intext.ce-right .ce-gallery {
    order: 2;
}

.pw-content--alice-entry .firstHeadline {
    display: inline-block;
    margin-bottom: 0.75rem;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.35;
}

.pw-content--alice-entry .firstHeadline a:focus-visible {
    outline: 3px solid var(--pw-blue);
    outline-offset: 4px;
}

/* Original series page (Legacy page 77): the imported monolithic textpic was
   split into Core text/textmedia records. Rejoin its visual flow here. */
.pw-content--alice-overview > .frame:first-child,
.pw-content--alice-information > .frame:first-child {
    margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.pw-content--alice-information > .frame + .frame {
    margin-top: clamp(1.75rem, 4vw, 3rem);
}

.pw-content--alice-overview > .frame + .frame {
    margin-top: 0;
}

.pw-content--alice-overview > .frame-type-image:first-child,
.pw-content--alice-information > .frame-type-image:first-child {
    width: min(calc(100% - 2rem), 37.5rem);
}

.pw-content--alice-overview > .frame-type-text:first-of-type,
.pw-content--alice-information > .frame-type-header,
.pw-content--alice-information > .frame-type-text {
    width: min(calc(100% - 2rem), var(--pw-content-reading));
}

.pw-content--alice-overview > :is(.frame-type-text, .frame-type-textmedia) {
    font-size: max(1rem, calc(1.45 * var(--pw-article-unit)));
    line-height: max(1.65em, calc(2.4 * var(--pw-article-unit)));
    letter-spacing: calc(0.025 * var(--pw-article-unit));
}

.pw-content--alice-overview > .frame-type-text:first-of-type :is(h2, h3),
.pw-content--alice-information > .frame-type-header :is(h1, h2, h3) {
    text-align: center;
}

.pw-content--alice-overview > .frame-type-text:first-of-type h2,
.pw-content--alice-information > .frame-type-header h2 {
    margin-bottom: 0.65em;
    font-size: clamp(2.15rem, 4vw, 3rem);
    font-weight: 750;
    line-height: 1.12;
}

.pw-content--alice-overview > .frame-type-text:not(:first-of-type) {
    width: min(calc(100% - 2rem), var(--pw-content-normal));
}

.pw-content--alice-overview > .frame-type-text h3 {
    margin: calc(0.5 * var(--pw-article-unit)) 0 0;
    padding-bottom: calc(2 * var(--pw-article-unit));
    text-align: center;
    font-size: max(1.5rem, calc(3 * var(--pw-article-unit)));
    font-weight: 700;
    line-height: 1.2;
}

.pw-content--alice-overview > .frame-type-text:not(:first-of-type) h3 {
    margin-top: calc(5 * var(--pw-article-unit));
}

.pw-content--alice-overview > .frame-type-text h4 {
    margin: calc(3 * var(--pw-article-unit)) 0;
    text-align: center;
    font-size: max(1.25rem, calc(2.5 * var(--pw-article-unit)));
    font-weight: 700;
    line-height: 1.2;
}

.pw-content--alice-overview .introduction,
.pw-content--alice-overview .introduction * {
    font-size: inherit;
    line-height: inherit;
    font-weight: 700;
}

.pw-content--alice-overview .introduction {
    margin-bottom: calc(2.4 * var(--pw-article-unit));
}

.pw-content--alice-overview .introduction a {
    color: #1d1d1b;
}

.pw-content--alice-overview .introduction p,
.pw-content--alice-overview .frame-type-textmedia .normal p {
    margin-block: 0;
}

/* RTE spacer paragraphs came from splitting Legacy CE 621. Their spacing is
   now supplied by the original h3/h4 rules above. */
.pw-content--alice-overview > .frame-type-text:first-of-type h3 + p,
.pw-content--alice-overview > .frame-type-text h4 + p,
.pw-content--alice-overview > .frame-type-text:not(:first-of-type) p {
    display: none;
}

.pw-content.pw-content--alice-overview > .frame-type-textmedia .ce-intext {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: calc(1.5 * var(--pw-article-unit));
}

.pw-content.pw-content--alice-overview > .frame-type-textmedia .ce-intext .ce-gallery {
    width: 100%;
    max-width: none;
    margin: 0;
}

.pw-content--alice-overview .frame-type-textmedia .ce-gallery :is(.ce-row, .ce-column, figure) {
    width: 100%;
}

.pw-content.pw-content--alice-overview > .frame-type-textmedia .ce-left .ce-gallery {
    order: 2;
}

.pw-content.pw-content--alice-overview > .frame-type-textmedia .ce-right .ce-gallery {
    order: 0;
}

.pw-content--alice-overview .frame-type-textmedia .ce-gallery img {
    width: 100%;
    height: auto;
    max-height: 32rem;
    object-fit: contain;
}

.pw-content--alice-overview .folge > :first-child:not(.normal) {
    display: none;
}

.pw-content--alice-overview .frame-type-textmedia .normal {
    min-width: 0;
    padding: calc(0.4 * var(--pw-article-unit)) 0 calc(1.75 * var(--pw-article-unit));
}

/* Information pages keep the original narrow reading measure. The imported
   italic lead paragraphs following an image are the documented captions. */
.pw-content--alice-information > .frame-type-image:not(:first-child) {
    width: min(calc(100% - 2rem), var(--pw-content-reading));
    margin-top: var(--pw-alice-section-gap);
}

.pw-content--alice-information > .frame-type-image + .frame-type-text {
    margin-top: clamp(1.75rem, 3vw, 2.25rem);
}

.pw-content--alice-information > .frame-type-image + .frame-type-text > div:first-child > p > i:only-child {
    display: block;
    color: var(--pw-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.pw-content--alice-information > .frame-type-text :is(ul, ol) {
    padding-left: 1.35rem;
}

/* Episode detail pages retain their editorial media hero. Only the following
   existing video element receives the same calm section rhythm. */
.pw-content--alice-episode > .pw-video {
    width: min(calc(100% - 2rem), 64rem);
    margin: clamp(2.5rem, 6vw, 5rem) auto 0;
}

@media (max-width: 700px) {
    .pw-content--alice {
        --pw-alice-section-gap: clamp(2.5rem, 12vw, 4rem);
    }

    .pw-content--alice :is(.frame-type-text, .frame-type-textmedia) {
        line-height: 1.65;
    }

    .pw-content.pw-content--alice-entry > .frame-type-textmedia .ce-intext,
    .pw-content.pw-content--alice-overview > .frame-type-textmedia .ce-intext,
    .pw-content.pw-content--alice-overview > .frame-type-textmedia .ce-intext.ce-right {
        grid-template-columns: minmax(0, 1fr);
        gap: clamp(1.25rem, 6vw, 2rem);
    }

    .pw-content.pw-content--alice-entry > .frame-type-textmedia .ce-intext.ce-right .ce-gallery,
    .pw-content.pw-content--alice-overview > .frame-type-textmedia .ce-left .ce-gallery,
    .pw-content.pw-content--alice-overview > .frame-type-textmedia .ce-right .ce-gallery {
        order: 0;
    }

    .pw-content--alice-entry .ce-gallery img {
        width: min(100%, 27rem);
    }

    .pw-content--alice-overview .frame-type-textmedia .ce-gallery img {
        max-height: 25rem;
    }

    .pw-content--alice-information > .frame-type-image:not(:first-child) {
        margin-top: clamp(3rem, 14vw, 4.5rem);
    }

    .pw-content--alice-information > .frame-type-image + .frame-type-text {
        margin-top: 1.5rem;
    }
}

/* Legacy pi19: original 1918 × 822 stage, before the title, with its divider.
   The shared hero transform moves the picture only; its white margin remains. */
.pw-content--alice > .pw-alice-hero {
    width: 100%;
    margin: 0;
    border-bottom: 6px solid transparent;
    border-image: linear-gradient(90deg, #4e2583, #891b15) 1;
}
.pw-alice-hero picture, .pw-alice-hero img { display: block; width: 100%; height: auto; }

.pw-content--alice > .pw-alice-hero + .frame { margin-top: clamp(1.5rem, 3vw, 3rem); }
