/* Fit the photo mount to the real image, including WordPress lazy auto-sized images. */
html[data-edition] .single-post .full-story .prose img:not(.illustrated-icon) {
 contain-intrinsic-size:none!important;
}
html[data-edition] .single-post .full-story .prose figure.wp-block-image:not(.wp-block-gallery) {
 height:auto;min-height:0;
}
html[data-edition] .single-post .reading-layout {
 align-items:start;
}
html[data-edition] .single-post .reading-sidebar,
html[data-edition] .single-post .full-story {
 align-self:start;min-width:0;
}
.reading-sidebar [data-adaptive-sidebar] > [hidden] {
 display:none!important;
}

/* Attribute dimensions keep portrait and landscape space stable before loading. */
html[data-edition] .single-post .full-story .prose > figure:not(.wp-block-gallery):not(.pw-cinema) img,
html[data-edition] .single-post .full-story .prose > p > img,
html[data-edition] .single-post .full-story .prose > p > a > img {
 aspect-ratio:var(--pw-image-ratio, auto);
 height:auto;max-height:none;
}

/* Framed photos use their own dimensions even before a lazy source is selected. */
html[data-edition] .single-post .full-story .prose .wp-block-gallery img[style*="--pw-image-ratio"],
html[data-edition] .single-post .full-story .prose figure.gallery:not(.wp-block-gallery) img[style*="--pw-image-ratio"] {
 aspect-ratio:var(--pw-image-ratio)!important;
}
html[data-edition] .single-post .full-story .prose figure.gallery:not(.wp-block-gallery):has(>a>img:only-child,>a>img:first-child + .pw-image-loader:last-child) {
 display:block;
}

/* photo-finish.css adds a 4px mat and 1px line on each edge. Apply the ratio to
   the photo inside that frame, including while its image bytes are pending. */
html[data-edition] .single-post .full-story .prose>figure:not(.pw-cinema):not(.wp-block-gallery) img[style*="--pw-image-ratio"]:not(.illustrated-icon),
html[data-edition] .single-post .full-story .prose>p>img[class*="wp-image-"][style*="--pw-image-ratio"],
html[data-edition] .single-post .full-story .prose>p>a>img[class*="wp-image-"][style*="--pw-image-ratio"],
html[data-edition] .single-post .full-story .prose .gallery-icon img[style*="--pw-image-ratio"],
html[data-edition] .single-post .full-story .prose .wp-block-gallery.pw-episode-gallery .wp-block-image img[style*="--pw-image-ratio"] {
 box-sizing:content-box;
 width:calc(100% - 10px)!important;
 max-width:calc(100% - 10px);
 aspect-ratio:var(--pw-image-ratio)!important;
}

/* Keep the parchment wash continuous from the bottom of the photo mount
   through the reading time, article and signature to the divider. */
html[data-edition] .single-post .full-story > :is(.pw-reading-time, .pw-post-sections, .prose, .pw-story-ending) {
 background-image: linear-gradient(90deg, transparent, rgb(255 248 229 / 74%) 6%, rgb(255 248 229 / 74%) 94%, transparent);
}
html[data-edition] .single-post .full-story > .prose {
 color: #21170f;
 margin-block: 0;
 padding-block: clamp(10px, 1.6vw, 24px);
}
html[data-edition] .single-post .full-story > .prose > p:not(:has(img, video, iframe)) {
 line-height: 1.72;
}

/* Additional pennants use the same mount, ink and notch as the primary one. */
.full-story .pw-post-cover-multiple .pw-post-kicker:has(+ .pw-post-kicker) { margin-bottom: 3px; }
html[data-edition] .pw-post-cover-multiple:not(.pw-trailer-open) {
 display: grid;
 grid-template-columns: minmax(0, 1fr);
 height: auto;
}
html[data-edition] .pw-post-cover-multiple .pw-post-cover-image,
html[data-edition] .pw-post-cover-multiple .pw-post-cover-heading { grid-area: 1 / 1; }
html[data-edition] .pw-post-cover-multiple:not(.pw-trailer-open) .pw-post-cover-heading {
 position: relative;
 align-self: end;
 min-width: 0;
}
html[data-edition] .pw-post-cover-multiple .pw-post-cover-image img { height: 100%; }

/* The photo sets the cover's preferred height. Long headings and their video
   control may enlarge the same grid row on narrow screens. */
html[data-edition] .pw-post-video:has(.pw-trailer-start):not(.pw-trailer-open) {
 aspect-ratio: auto;
}
html[data-edition] .pw-post-video:has(.pw-trailer-start):not(.pw-trailer-open) .pw-post-cover-image {
 position: relative;
 grid-area: 1 / 1;
 aspect-ratio: 16 / 9;
 align-self: stretch;
 min-height: 0;
}
html[data-edition] .pw-post-video:has(.pw-trailer-start):not(.pw-trailer-open) .pw-post-cover-image img {
 position: absolute;
 inset: 0;
 width: 100%;
 height: 100%;
 object-fit: cover;
}
html[data-edition] .pw-post-video:has(.pw-trailer-start):not(.pw-trailer-open) .pw-post-cover-heading {
 grid-area: 1 / 1;
}

html[data-edition] .single-post .full-story > .pw-post-cover { margin-bottom: 0; }
.full-story > .pw-reading-time {
 display: flex;
 align-items: center;
 justify-content: center;
 gap: .65rem;
 margin: 0;
 padding-block: .6rem .9rem;
 color: #442d18;
 font: 600 .92rem/1.4 var(--sans);
}
:is(.pw-reading-time, .pw-story-count)::before,
:is(.pw-reading-time, .pw-story-count)::after {
 content: '';
 width: clamp(18px, 4vw, 54px);
 height: 1px;
 background: #a17d45;
}
.pw-reading-time > span,
.pw-story-count > .pw-article-views {
 padding: .28rem .9rem;
 border: 1px solid #ac864e;
 border-radius: 2px;
 background: linear-gradient(105deg, #f3e1b5, #fff4d9 48%, #efdaac);
 box-shadow: inset 0 0 0 2px rgb(255 248 222 / 65%);
}
.full-story > .pw-story-ending {
 display: flow-root;
 border-bottom: 1px solid var(--rule);
}
.full-story > .pw-story-ending + .pw-related {
 margin-top: 0;
 border-top: 0;
}
.pw-story-ending > .pw-story-signature {
 display: grid;
 justify-items: center;
 gap: .22rem;
 margin: 0;
 padding: .55rem .75rem 1rem;
 text-align: center;
 line-height: 1.25;
}
.pw-story-signature > p {
 margin: 0;
 line-height: 1.3;
}
.pw-story-count {
 display: flex;
 align-items: center;
 justify-content: center;
 gap: .65rem;
 margin-top: .18rem;
}
.pw-story-count:empty { display: none; }
.pw-story-count > .pw-article-views {
 margin: 0;
 color: #442d18;
 font: 600 .88rem/1.3 var(--sans);
}
.full-story > .pw-post-sections {
 display: flex;
 align-items: center;
 justify-content: center;
 flex-wrap: wrap;
 gap: .4rem .65rem;
 margin: 0;
 padding-block: .35rem 1rem;
 text-align: center;
}
.full-story > .pw-post-sections > p {
 flex-basis: 100%;
 margin: 0 0 .25rem;
 color: #392615;
 font-size: 1rem;
 line-height: 1.5;
}
.full-story > .pw-post-sections a {
 display: inline-flex;
 align-items: center;
 gap: .4em;
 min-height: 36px;
 padding: .3em .85em;
 border: 1px solid #896536;
 border-radius: 3px;
 background: #fff2d3;
 color: #402810;
 font: 600 .94rem/1.4 var(--sans);
 text-decoration: none;
}
.full-story > .pw-post-sections a:hover { background: #f0d8a9; text-decoration: underline; }
.full-story > .pw-post-sections a:focus-visible { outline: 3px solid #683a13; outline-offset: 2px; }
.full-story > .prose[id], .full-story .prose :is(#fragen-und-antworten, #questions-and-answers) {
 scroll-margin-block-start: clamp(5rem, 12vh, 9rem);
}
@media print {
 .pw-post-sections { display: none !important; }
}

/* The cover photograph opens the original while its overlaid trailer control stays interactive. */
.full-story .pw-post-cover-image > a { display:block; height:100%; cursor:zoom-in; }
.full-story .pw-post-cover:has(.pw-post-cover-image > a) .pw-post-cover-heading { pointer-events:none; }
.full-story .pw-post-cover-heading :is(a,button) { pointer-events:auto; }
