/* Unie Testimonials Polaroid Styles */

:root {
    --unie-primary: #a0110e;
    --unie-primary-container: #c32e24;
    --unie-surface: #fef9f2;
    --unie-surface-container: #f2ede7;
    --unie-on-surface: #1d1b18;
    --unie-paper-texture: url('https://www.transparenttextures.com/patterns/natural-paper.png');
}

.unie-tp-grid-container {
    width: 100%;
    padding: 40px 0;
    background-color: var(--unie-surface);
    background-image: var(--unie-paper-texture);
}

.unie-tp-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 60px 30px; /* 60px vertical, 30px horizontal gap */
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.unie-tp-polaroid-wrapper {
    grid-column: span 3;
    perspective: 1000px;
    position: relative;
    width: 100%;
    max-width: 260px;
    justify-self: center;
}

/* Row 1: 3 items centered (each spans 3 columns, starts at col 2, 5, 8) */
.unie-tp-polaroid-wrapper:nth-child(1) { grid-column: 2 / span 3; }
.unie-tp-polaroid-wrapper:nth-child(2) { grid-column: 5 / span 3; }
.unie-tp-polaroid-wrapper:nth-child(3) { grid-column: 8 / span 3; }

/* Row 2: 4 items (each spans 3 columns, filling the row) */
.unie-tp-polaroid-wrapper:nth-child(4) { grid-column: 1 / span 3; }
.unie-tp-polaroid-wrapper:nth-child(5) { grid-column: 4 / span 3; }
.unie-tp-polaroid-wrapper:nth-child(6) { grid-column: 7 / span 3; }
.unie-tp-polaroid-wrapper:nth-child(7) { grid-column: 10 / span 3; }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .unie-tp-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 40px 30px;
    }
    .unie-tp-polaroid-wrapper {
        flex: 0 0 calc(33.33% - 30px);
        max-width: 260px;
    }
    /* Remove grid positions on mobile */
    .unie-tp-polaroid-wrapper:nth-child(n) { grid-column: auto; }
}

@media (max-width: 768px) {
    .unie-tp-polaroid-wrapper {
        flex: 0 0 calc(50% - 30px);
    }
}

@media (max-width: 480px) {
    .unie-tp-polaroid-wrapper {
        flex: 0 0 100%;
    }
}

/* Tilted positioning - keeping it subtle */
.unie-tp-polaroid-wrapper:nth-child(odd) { transform: rotate(-1.5deg); }
.unie-tp-polaroid-wrapper:nth-child(even) { transform: rotate(2deg); }
.unie-tp-polaroid-wrapper:nth-child(3n) { transform: rotate(-2.5deg); }
.unie-tp-polaroid-wrapper:nth-child(4n) { transform: rotate(1deg); }

/* Stickers (Masking Tape) */
.unie-tp-polaroid-wrapper::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    width: 70px;
    height: 25px;
    background-color: rgba(227, 218, 195, 0.6);
    backdrop-filter: blur(1px);
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.unie-tp-polaroid-wrapper:nth-child(even)::before {
    transform: translateX(-50%) rotate(4deg);
    top: -18px;
}

/* Subtle vertical offsets for scrapbook look (much smaller than before) */
.unie-tp-polaroid-wrapper:nth-child(2n) { margin-top: 15px; }
.unie-tp-polaroid-wrapper:nth-child(3n) { margin-top: -10px; }

.unie-tp-polaroid {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.25; /* Fixed ratio for identical dimensions */
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
    background: #fff;
    padding: 12px 12px 55px 12px;
    box-shadow: 3px 10px 20px rgba(0,0,0,0.15);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.unie-tp-polaroid-wrapper:hover .unie-tp-polaroid {
    transform: rotateY(180deg);
}

.unie-tp-polaroid-front,
.unie-tp-polaroid-back {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 55px; /* Matches padding */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
}

.unie-tp-polaroid-front {
    z-index: 2;
}

.unie-tp-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #eee;
}

.unie-tp-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%);
}

.unie-tp-caption {
    position: absolute;
    bottom: -55px; /* Positions it exactly in the bottom white space */
    left: 0;
    right: 0;
    height: 55px; /* Matches the padding-bottom of the parent card */
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.unie-tp-name {
    font-family: 'cerigo', sans-serif !important;
    font-size: 2.2rem;
    color: var(--unie-on-surface);
    margin: 0;
    line-height: 0.9;
    font-weight: 700;
}

.unie-tp-front-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.unie-tp-front-btn {
    font-family: 'cerigo', sans-serif;
    font-size: 11px;
    padding: 2px 10px;
    border: 1px solid #8b7d6b;
    color: #5d5448;
    background-color: #f2ede7;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.unie-tp-front-btn:hover {
    background-color: #e3dbc9;
    border-color: #5d5448;
}

.unie-tp-polaroid-back {
    background-color: var(--unie-surface-container);
    background-image: var(--unie-paper-texture);
    transform: rotateY(180deg);
    padding: 20px;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.unie-tp-quote {
    font-family: 'cerigo', sans-serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--unie-on-surface);
    margin-bottom: 20px;
    line-height: 1.4;
}

.unie-tp-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.unie-tp-btn {
    display: inline-block;
    padding: 10px 15px;
    background-color: var(--unie-primary);
    color: #fff !important;
    text-decoration: none !important;
    font-family: 'cerigo', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: background-color 0.3s;
}

.unie-tp-btn:hover {
    background-color: var(--unie-primary-container);
}

/* Lightbox Styles */
.unie-tp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(29, 27, 24, 0.9);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.unie-tp-lightbox-content {
    position: relative;
    width: 80%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
}

.unie-tp-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}

.unie-tp-video-wrapper {
    width: 100%;
    height: 100%;
}

.unie-tp-video-wrapper iframe {
    width: 100%;
    height: 100%;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .unie-tp-polaroid-wrapper {
        flex: 0 0 calc(33.33% - 30px);
        max-width: calc(33.33% - 30px);
    }
}

@media (max-width: 768px) {
    .unie-tp-polaroid-wrapper {
        flex: 0 0 calc(50% - 30px);
        max-width: calc(50% - 30px);
    }
}

@media (max-width: 480px) {
    .unie-tp-polaroid-wrapper {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
