Fix carousel height jumping by stacking slides with CSS grid

Replace display:none/flex slide toggling with CSS grid stacking so all
slides always occupy the same layout cell. The container height is now
fixed at the tallest image height — no more text jumping below the
carousel as slides change. Also enables the existing opacity fade
transition which was previously blocked by display:none.

Affects: index.html, articles/why-we-built-hoa-ledgeriq.html,
         articles/hoa-financial-blind-spots.html, and all future articles.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 07:45:49 -04:00
parent 63ef2e59ca
commit 6b6bfea220

View File

@@ -902,13 +902,19 @@ body {
.carousel-slides { .carousel-slides {
position: relative; position: relative;
width: 100%; width: 100%;
display: grid; /* stack all slides — prevents height jump on slide change */
} }
.carousel-slide { .carousel-slide {
display: none; grid-area: 1 / 1; /* all slides share the same grid cell */
display: flex;
flex-direction: column; flex-direction: column;
opacity: 0;
pointer-events: none;
transition: opacity 0.4s ease;
} }
.carousel-slide.active { .carousel-slide.active {
display: flex; opacity: 1;
pointer-events: auto;
} }
.carousel-slide img { .carousel-slide img {
width: 100%; width: 100%;
@@ -972,15 +978,6 @@ body {
border-radius: 4px; border-radius: 4px;
} }
/* Fade transition */
.carousel-slide {
opacity: 0;
transition: opacity 0.4s ease;
}
.carousel-slide.active {
opacity: 1;
}
/* ---- Request Quote pricing ---- */ /* ---- Request Quote pricing ---- */
.price-amount--quote { .price-amount--quote {
font-size: 32px; font-size: 32px;