/**
 * @license
 * SPDX-License-Identifier: Apache-2.0
 */

/* --------------------------------------------------------------------------
 * "Selling Point Highlight" Grid Layout for sweetPoses
 * -------------------------------------------------------------------------- */

.sweet-poses-module {
    background-color: #fcfcfc;
    position: relative;
    overflow: hidden;
}

/* Container Spacing Optimization */
.sweet-poses-container {
    max-width: var(--macaron-max-width);
    margin: 0 auto;
    padding: 5px var(--macaron-padding-x) 22.5px; /* Further reduced for alignment */
    position: relative;
    z-index: 2;
}

/* Header Area */
.poses-horizontal-header {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 16px;
    width: 100%;
    margin-bottom: 24px;
    padding: 10px 0;
    position: relative;
}

.poses-horizontal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 2px;
    background: var(--macaron-lavender);
    border-radius: 2px;
}

.poses-header-left {
    font-size: calc(23px * var(--scale-factor, 1));
    font-family: var(--normal-font), sans-serif;
    font-weight: 300;
    color: var(--macaron-text-secondary);
    letter-spacing: 2px;
}

.poses-header-right {
    font-size: calc(32px * var(--scale-factor, 1));
    font-family: var(--bold-font), sans-serif;
    font-weight: 300;
    color: var(--macaron-text);
    letter-spacing: 4px;
}

.cp-header-area {
    width: 100%;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

/* Gallery Layout */
.cp-gallery.masonry-layout {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.masonry-row-mixed {
    display: flex;
    gap: 10px;
    width: 100%;
}
.masonry-row-mixed.layout-1-2,
.masonry-row-mixed.layout-2-1,
.masonry-row-mixed.layout-1-1,
.masonry-row-mixed.layout-1-3 {
    display: flex;
}

.masonry-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.masonry-row-mixed.layout-1-3 .col-left {
    flex: 1.4;
}
.masonry-row-mixed.layout-1-3 .col-right {
    flex: 1;
}

/* Aspect ratios for mode 1-3 based on user request */
.masonry-row-mixed.layout-1-3 .col-left .cp-photo-frame:nth-child(1) {
    flex: 1;
}

.masonry-row-mixed.layout-1-3 .col-left .cp-photo-frame:nth-child(1) .cp-image-wrap {
    aspect-ratio: unset;
    height: 100%;
}

.masonry-row-mixed.layout-1-3 .col-right .cp-photo-frame:nth-child(1) .cp-image-wrap {
    aspect-ratio: 1 / 1;
}

.masonry-row-mixed.layout-1-3 .col-right .cp-photo-frame:nth-child(2) .cp-image-wrap,
.masonry-row-mixed.layout-1-3 .col-right .cp-photo-frame:nth-child(3) .cp-image-wrap {
    aspect-ratio: 4 / 3;
}

/* Aspect ratios for other modes (fallback/generics) */
.col-left .cp-photo-frame .cp-image-wrap, 
.col-right .cp-photo-frame .cp-image-wrap {
    aspect-ratio: 3 / 4; /* Generic fallback */
}

.masonry-frame {
    width: 100%;
    /* remove flex: 1 so it respects aspect-ratio rather than stretching equally */
    display: flex;
}
.cp-photo-frame.layout-full {
    width: 100%;
}
.cp-photo-frame.layout-full .cp-image-wrap {
    aspect-ratio: 16 / 9; /* Default 16:9 for full width cards as requested */
}

.cp-image-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    z-index: 1;
    background: linear-gradient(135deg, rgba(248, 187, 208, 0.18), rgba(209, 196, 233, 0.14));
}

.cp-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badge styling */
.masonry-badge {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: calc(14px * var(--scale-factor, 1));
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.masonry-badge .badge-dot {
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 850px) {
    .cp-gallery.masonry-layout {
        gap: 10px;
    }
    .masonry-frame {
        margin-bottom: 0;
    }
    .cp-header-area {
        margin-bottom: 16px;
        padding: 5px var(--macaron-padding-x);
    }
    .poses-header-left {
        font-size: calc(19px * var(--scale-factor, 1));
    }
    .poses-header-right {
        font-size: calc(26px * var(--scale-factor, 1));
    }
}
