/* gallery v15 — hero image + caption chips.
   Geometry shared by both CSS frameworks (Bootstrap has no utilities for it). */
.gallery-hero-chips__section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.mxw-5xl {
    max-width: 64rem !important;
}

.mxw-2xl {
    max-width: 42rem !important;
}

.gallery-hero-chips__head {
    margin-bottom: 2.5rem;
}

.gallery-hero-chips__title {
    font-size: 1.875rem;
    margin-bottom: 0.75rem;
}

.gallery-hero-chips__lead {
    font-size: 1.125rem;
}

.gallery-hero-chips__stage {
    aspect-ratio: 16 / 9;
}

.gallery-hero-chips__img {
    object-fit: cover;
}

/* The chips sit in a grid overlay — one chip per cell. Grid cells never overlap, so no
   amount of generated copy can make two chips collide (the cell just grows/wraps). */
.gallery-hero-chips__overlay {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 0.75rem;
    padding: 1.5rem;
}

.gallery-hero-chips__chip {
    /* both frameworks position these absolutely; the overlay owns placement now */
    position: static !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 20rem;
    padding: 0.75rem 1rem;
    pointer-events: auto;
    --bs-bg-opacity: 0.95;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* a flex item never shrinks below its min-content width — let the copy wrap instead */
.gallery-hero-chips__chip > :not(i) {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.gallery-hero-chips__chip > i {
    flex-shrink: 0;
}

/* one chip per corner — four distinct grid cells, so two chips can never share a spot */
.gallery-hero-chips__chip--tl {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: start;
}

.gallery-hero-chips__chip--tr {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
}

.gallery-hero-chips__chip--bl {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    align-self: end;
}

.gallery-hero-chips__chip--br {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
    align-self: end;
}

.gallery-hero-chips__chip-text {
    font-size: 0.75rem;
}

/* Phones/tablets: half a stage is too little for a chip, so the whole thing becomes a
   column — photo first, chips under it. Identical in both frameworks. */
@media (max-width: 767.98px) {
    .gallery-hero-chips__stage {
        aspect-ratio: auto;
        display: flex;
        flex-direction: column;
    }

    .gallery-hero-chips__img {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
    }

    .gallery-hero-chips__overlay {
        position: static !important;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        padding: 0.75rem;
    }

    .gallery-hero-chips__chip,
    .gallery-hero-chips__chip--tl,
    .gallery-hero-chips__chip--tr,
    .gallery-hero-chips__chip--bl,
    .gallery-hero-chips__chip--br {
        grid-column: 1;
        grid-row: auto;
        justify-self: stretch;
        align-self: auto;
        max-width: none;
    }
}

@media (min-width: 768px) {
    .gallery-hero-chips__title {
        font-size: 2.25rem;
    }
}

.content-column__body {
    column-gap: 2.5rem;
}

.content-column__body p {
    break-inside: avoid;
}

@media (min-width: 768px) {
    .content-column__body {
        column-count: 2;
    }
}

@media (min-width: 1200px) {
    .content-column__body {
        column-count: 3;
    }
}

/* content companion — hairline width for BS decor */
.content-companion__hair {
    width: 3rem;
}

/* numeric index column width on small screens */
.content-companion__index {
    min-width: 0;
}

.content-companion__index-digit {
    font-variant-numeric: tabular-nums;
}

.content-col-grow {
    flex: 1 1 0%;
    min-width: 0;
}

.content-img-fill {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 16rem;
    min-width: 0;
    object-fit: cover;
    flex-shrink: 0;
}

.prose-bodycopy__text-panel-inset {
    padding: 4rem;
}


.copy-document__body-stack-gap {
    gap: 4rem;
}

.content-flow-gap {
    gap: 4rem;
}

.content-grid-gap {
    gap: 2rem;
}

.content-prose-measure {
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.content-article-frame {
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.content-cta__lift { transition: transform 150ms ease; }
.content-cta__lift:hover { transform: translateY(-2px); }

.content-col-grow {
    flex: 1 1 0%;
    min-width: 0;
}

.content-img-medium {
    display: block;
    width: 100%;
    height: 22rem;
    min-height: 22rem;
    flex-shrink: 0;
    object-fit: cover;
}
@media (min-width: 768px) {
    .content-img-medium {
        height: 28rem;
        min-height: 28rem;
    }
}

.content-thumb-height {
    display: block;
    width: 100%;
    height: 13rem;
    min-height: 13rem;
    flex-shrink: 0;
    object-fit: cover;
}

.content-brief__float-square {
    width: 4rem;
    height: 4rem;
}

.content-brief__float-square--slow {
    animation: content-brief-float-slow 10s ease-in-out infinite;
}

.content-brief__float-square--fast {
    animation: content-brief-float-fast 7s ease-in-out infinite;
}

@keyframes content-brief-float-slow {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-8px) rotate(6deg);
    }
}

@keyframes content-brief-float-fast {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(8px) rotate(-7deg);
    }
}

.content-margin-notes__aside {
    align-self: start;
}

@media (min-width: 992px) {
    .content-margin-notes__aside {
        position: sticky;
        top: 2rem;
    }
}

/* min-width: 0 — довгий текст/флекс у колонці не роздуває рядок */
.content-col-grow {
    min-width: 0;
}

.content-stack-col--text {
    overflow-wrap: anywhere;
}

.content-stack-col--text > :first-child {
    width: 100%;
    max-width: 65ch;
    margin-inline: auto;
}

/* gap лише для Tailwind (grid). У Bootstrap — відступи через g-* у component (row-cols + g-3), без CSS gap на .row */
.content-grid-gap:not(.row) {
    gap: 1rem;
}

.content-full-frame {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.content-section-pad {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

/* Третина рядка: стабільна висота прев’ю, без height:100% від сусіднього тексту */
.content-img-fullheight {
    display: block;
    width: 100%;
    max-width: min(100%, 28rem);
    margin-inline: auto;
    min-width: 0;
    aspect-ratio: 3 / 4;
    max-height: 28rem;
    height: auto;
    flex-shrink: 1;
    object-fit: cover;
    object-position: center;
}

