.s-post__reading:has(.s-post__text > .prostor-story) {
  width: 100%;
  max-width: none;
}

.s-post__reading:has(.prostor-story .story-gallery) > .s-post__toc {
  display: none;
}

.s-post--article:has(.s-post__text > .prostor-story) > .s-post__head {
  width: 100%;
  max-width: none;
  justify-items: start;
  text-align: start;
}

.s-post--article:has(.s-post__text > .prostor-story) > .s-post__head .s-post__title {
  justify-self: stretch;
}

.s-post--article:has(.s-post__text > .prostor-story) > .s-post__head .s-post__blog {
  justify-self: start;
}

.s-post--article:has(.s-post__text > .prostor-story) > .s-post__head .s-post__meta {
  justify-content: flex-start;
}

.s-post--article:has(.s-post__text > .prostor-story) > .s-post__figure {
  display: none;
}

.prostor-story {
  color: var(--color-fg);
  font-size: var(--font-size-body);
  line-height: 1.65;
}

.prostor-story .wrap { width: 100%; }
.s-post .s-post__text .prostor-story :is(figure, p) { margin: 0; }
.prostor-story img { display: block; width: 100%; height: auto; }
.prostor-story .hero-copy { padding-top: clamp(16px, 3vw, 26px); }
.prostor-story .lede { font-size: var(--font-size-lead); line-height: 1.5; }
.s-post .s-post__text .prostor-story .notice { margin-top: 10px; }
.prostor-story .notice, .prostor-story figcaption {
  color: var(--color-fg-muted);
  font-size: var(--font-size-caption);
  line-height: 1.45;
}
.s-post .s-post__text .prostor-story .story-photo { margin-top: 18px; }
.prostor-story .story-photo img { border-radius: var(--radius-lg); }
.prostor-story .story-photo figcaption { margin: 8px 0 0; }

.s-post .s-post__text .prostor-story .comparison {
  --split: 50%;
  position: relative;
  grid-row: 1;
  margin: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  isolation: isolate;
  overflow: hidden;
  background: var(--color-media-backdrop);
}

.prostor-story :is(.comparison-layer, .comparison-control) { position: absolute; inset: 0; }
.prostor-story .comparison-layer img { height: 100%; object-fit: cover; }
.prostor-story .comparison-after { clip-path: inset(0 0 0 var(--split)); }
.prostor-story .comparison-label {
  position: absolute;
  inset: 12px auto auto 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgb(15 23 42 / 82%);
  color: white;
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-semibold);
}

.prostor-story .comparison-after .comparison-label { inset-inline: auto 12px; }
.prostor-story .comparison-divider {
  position: absolute;
  inset-block: 0;
  left: var(--split);
  width: 2px;
  translate: -50% 0;
  background: white;
  box-shadow: 0 0 4px rgb(15 23 42 / 60%);
}

.prostor-story .comparison-grip {
  position: absolute;
  top: 50%;
  left: clamp(24px, var(--split), calc(100% - 24px));
  translate: -50% -50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-elevated);
  color: var(--color-fg);
  box-shadow: 0 1px 5px rgb(15 23 42 / 35%);
}

.prostor-story .comparison-grip::before,
.prostor-story .comparison-grip::after {
  content: "";
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
}

.prostor-story .comparison-grip::before { rotate: 135deg; }
.prostor-story .comparison-grip::after { rotate: -45deg; }
.prostor-story .comparison-control {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  appearance: none;
  cursor: ew-resize;
  touch-action: pan-y;
}

.prostor-story .comparison-control::-webkit-slider-thumb { appearance: none; width: 2px; height: 44px; }
.prostor-story .comparison-control::-moz-range-thumb { width: 2px; height: 44px; border: 0; }
.prostor-story .comparison:has(.comparison-control:focus-visible) .comparison-grip {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}


.prostor-story .section { margin-block: clamp(33px, 6vw, 66px); }
.s-post .s-post__text .prostor-story h2 { margin: 0 0 12px; }
.s-post .s-post__text .prostor-story h3 { margin: 0 0 10px; }
.s-post .s-post__text .prostor-story .story-answers h3 { margin-top: 20px; }
.prostor-story .spec {
  margin-top: 20px;
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-soft);
}
.prostor-story .spec-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr);
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
}
.prostor-story .spec dl { margin: 0; font-size: var(--font-size-small); }
.prostor-story .spec dt { color: var(--color-fg-muted); margin-top: 8px; }
.prostor-story .spec dd { margin: 0; font-weight: var(--font-weight-semibold); }
.prostor-story .spec-catalog {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 20px;
  border-top: 1px solid var(--color-border);
  margin-top: 16px;
  padding-top: 12px;
}
.prostor-story :is(.spec-catalog, .story-quote) a { font-weight: var(--font-weight-semibold); }
.s-post .s-post__text .prostor-story .story-quote { margin-top: 24px; }
.prostor-story .diagram p { font-size: var(--font-size-small); color: var(--color-fg-muted); }
.prostor-story .diagram {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: clamp(12px, 2vw, 18px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
}

.prostor-story .diagram-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-small);
}

.prostor-story .plan {
  position: relative;
  width: 100%;
  height: 34px;
  margin: 1px 0 3px;
  overflow: hidden;
  container-type: inline-size;
}

.prostor-story :is(.track, .blade, .stile, .jamb) { position: absolute; }
.prostor-story .track { top: 8px; height: 2px; width: 100%; background: var(--color-border-strong); }
.prostor-story .jamb { top: 3px; height: 13px; width: 2px; background: var(--color-fg-muted); }
.prostor-story .jamb:last-child { right: 0; }
.prostor-story .blade { height: 2px; transform-origin: left center; background: var(--color-accent); }
.prostor-story .stile { top: 5px; height: 8px; min-width: 3px; background: var(--color-fg); }
.prostor-story .legend { display: flex; flex-wrap: wrap; gap: 5px 14px; border-top: 1px solid var(--color-border); padding-top: 8px; }
.prostor-story .dot { display: inline-block; vertical-align: 1px; width: 10px; height: 5px; margin-inline-end: 4px; background: var(--color-accent); }
.prostor-story .dot.gold { background: var(--color-fg); }

@media (max-width: 720px) {
  .prostor-story .spec-layout { grid-template-columns: minmax(0, 1fr); }
}

.prostor-story .story-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 238px), 1fr));
  gap: clamp(12px, 2vw, 22px);
}

.prostor-story .story-gallery figure { min-width: 0; margin: 0; scroll-margin-top: 100px; }
.prostor-story .story-gallery figure:target { outline: 2px solid currentColor; outline-offset: 4px; }
.prostor-story .story-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.prostor-story .story-gallery figcaption { margin-top: 7px; }
.prostor-story a[data-story-photo] { text-underline-offset: .15em; text-decoration: underline; }

.prostor-story a.prostor-photo-zoom {
  position: relative;
  display: block;
  cursor: zoom-in;
  text-decoration: none;
}

.prostor-story .prostor-photo-zoom__icon,
.prostor-story a.prostor-photo-zoom--comparison {
  position: absolute;
  z-index: 1;
  inset: auto 10px 10px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgb(255 255 255 / 50%);
  border-radius: 7px;
  background: rgb(15 23 42 / 92%);
  color: white;
}

.prostor-story a.prostor-photo-zoom--comparison {
  padding-inline: 10px;
  font-size: .875rem;
  line-height: 1.2;
}

.prostor-photo-zoom svg { display: block; width: 19px; height: 19px; }
.prostor-story .prostor-photo-zoom:hover .prostor-photo-zoom__icon,
.prostor-story a.prostor-photo-zoom--comparison:hover { background: #253550; }

.prostor-story a.prostor-photo-zoom:focus-visible {
  outline: 2px solid white;
  outline-offset: -4px;
  box-shadow: inset 0 0 0 6px #253550;
}

html:has(.prostor-photo-viewer[open]) { overflow: hidden; }

dialog.prostor-photo-viewer {
  box-sizing: border-box;
  width: min(1760px, calc(100% - 20px));
  height: calc(100dvh - 20px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: clamp(6px, 1.2vw, 16px);
  border: 0;
  border-radius: 10px;
  background: #101722;
  color: white;
  font: 400 .875rem/1.4 system-ui, sans-serif;
  color-scheme: dark;
}

.prostor-photo-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
}

.prostor-photo-viewer::backdrop { background: rgb(5 10 17 / 88%); }
.prostor-photo-viewer > img { display: block; width: 100%; height: 100%; object-fit: contain; }

.prostor-photo-viewer__toolbar,
.prostor-photo-viewer__navigation { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prostor-photo-viewer__navigation p { margin: 0; text-align: center; }

.prostor-photo-viewer :is(button, a) {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 9px;
  border: 1px solid #64748b;
  border-radius: 7px;
  background: #202c3d;
  color: white;
  font: inherit;
  cursor: pointer;
}

.prostor-photo-viewer button { font-size: 1.55rem; line-height: 1; }
.prostor-photo-viewer button:disabled { visibility: hidden; }
.prostor-photo-viewer :is(button, a):hover { background: #36465e; }
.prostor-photo-viewer :is(button, a):focus-visible { outline: 2px solid white; outline-offset: 2px; }
