/* * AJ Collage - Layouts, Shapes, & 3D Animation Engine 
 */

/* =========================================
   1. GLOBAL & CONTAINER STYLING
   ========================================= */
.aj-collage-master-wrapper {
    position: relative;
    width: 100%;
}
   
.aj-collage-wrapper {
    padding: 20px;
    box-sizing: border-box;
    --aj-hover-bg: rgba(13, 43, 29, 0.7); 
}

.aj-collage-tile {
    transition: all 0.4s ease;
    position: relative;
    box-sizing: border-box;
}

.aj-tile-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
}

.aj-text-wrapper {
    width: 100%;
}

.aj-collage-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================================
   2. BUTTON POSITIONS (Hover vs Below)
   ========================================= */
.aj-position-hover_overlay .aj-image-container::after {
    content: ''; 
    position: absolute; 
    inset: 0; 
    background-color: var(--aj-hover-bg); 
    opacity: 0; 
    transition: opacity 0.4s ease; 
    z-index: 1;
}

.aj-position-hover_overlay .aj-text-wrapper {
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -30%); 
    opacity: 0; 
    z-index: 2; 
    transition: all 0.4s ease; 
    pointer-events: none;
}

.aj-position-hover_overlay:hover .aj-image-container::after {
    opacity: 1; 
}

.aj-position-hover_overlay:hover .aj-text-wrapper {
    opacity: 1; 
    transform: translate(-50%, -50%); 
}

.aj-position-hover_overlay:hover .aj-image-container img {
    transform: scale(1.08); 
}

.aj-position-below_image .aj-tile-link {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

.aj-position-below_image .aj-text-wrapper {
    padding-top: 15px; 
}

.aj-position-below_image:hover .aj-image-container img {
    transform: scale(1.05); 
}

/* =========================================
   3. POLAROID FRAME & SCATTER
   ========================================= */
.aj-polaroid-frame .aj-image-container {
    border: 12px solid #ffffff !important; 
    border-bottom-width: 45px !important; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important; 
    background-color: #ffffff !important; 
    border-radius: 0 !important; 
}

.aj-scatter-effect .aj-collage-tile:nth-child(even) {
    transform: rotate(-4deg); 
}

.aj-scatter-effect .aj-collage-tile:nth-child(odd) {
    transform: rotate(5deg); 
}

.aj-scatter-effect .aj-collage-tile:nth-child(3n) {
    transform: rotate(-2deg); 
    margin-top: 15px; 
}

.aj-scatter-effect .aj-collage-tile:hover {
    transform: rotate(0deg) scale(1.05); 
    z-index: 10; 
}

/* =========================================
   4. SHAPES
   ========================================= */
.aj-shape-rounded .aj-image-container { border-radius: 15px; }
.aj-shape-circle .aj-image-container  { border-radius: 50%; aspect-ratio: 1/1; }
.aj-shape-oval .aj-image-container    { border-radius: 50% / 30%; }
.aj-shape-square .aj-image-container  { aspect-ratio: 1/1; }
.aj-shape-triangle .aj-image-container{ clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.aj-shape-star .aj-image-container    { clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

/* =========================================
   5. LAYOUTS
   ========================================= */
.aj-layout-luxury-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(var(--aj-tile-width, 250px), 1fr)); 
    gap: 20px; 
}

.aj-layout-classic-3x3 {
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 15px; 
}

.aj-layout-classic-4x4 {
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 15px; 
}

.aj-layout-masonry {
    column-count: 3; 
    column-gap: 20px; 
    display: block !important; 
}

.aj-layout-masonry .aj-collage-tile {
    margin-bottom: 20px; 
    display: block; 
    break-inside: avoid; 
}

.aj-layout-asymmetric-4 {
    display: grid; 
    grid-template-columns: 2fr 1fr; 
    grid-auto-rows: var(--aj-tile-height, 200px); 
    gap: 15px; 
}

.aj-layout-asymmetric-4 .aj-collage-tile:nth-child(1) {
    grid-row: span 2; 
}

.aj-layout-asymmetric-4 .aj-collage-tile .aj-image-container {
    height: 100% !important; 
}

.aj-layout-scrapbook-column {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 40px; 
}

.aj-layout-scrapbook-column .aj-collage-tile {
    width: var(--aj-tile-width, 400px); 
}

.aj-layout-scrapbook-row {
    display: flex; 
    flex-direction: row; 
    justify-content: center; 
    flex-wrap: wrap; 
    gap: 30px; 
}

.aj-layout-scrapbook-row .aj-collage-tile {
    width: var(--aj-tile-width, 300px); 
}

.aj-layout-editorial-spread {
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    grid-auto-rows: var(--aj-tile-height, 200px); 
    gap: 15px; 
}

.aj-layout-editorial-spread .aj-collage-tile:nth-child(5n+1) { grid-column: span 2; grid-row: span 2; }
.aj-layout-editorial-spread .aj-collage-tile:nth-child(5n+2) { grid-column: span 2; grid-row: span 1; }
.aj-layout-editorial-spread .aj-collage-tile:nth-child(5n+3) { grid-column: span 1; grid-row: span 1; }
.aj-layout-editorial-spread .aj-collage-tile:nth-child(5n+4) { grid-column: span 1; grid-row: span 1; }
.aj-layout-editorial-spread .aj-collage-tile:nth-child(5n+5) { grid-column: span 4; grid-row: span 2; }
.aj-layout-editorial-spread .aj-image-container { height: 100% !important; }

.aj-layout-horizontal-strips {
    display: flex; 
    flex-direction: row; 
    flex-wrap: nowrap; 
    overflow-x: auto; 
    gap: 10px; 
    padding-bottom: 20px; 
}

.aj-layout-horizontal-strips .aj-collage-tile {
    width: var(--aj-tile-width, 250px); 
    flex-shrink: 0; 
}

.aj-layout-film-reel {
    display: flex; 
    flex-direction: row; 
    flex-wrap: nowrap; 
    overflow-x: auto; 
    gap: 15px; 
    background-color: #111; 
    padding: 25px 10px; 
    border-top: 15px dashed #333; 
    border-bottom: 15px dashed #333; 
}

.aj-layout-film-reel .aj-collage-tile {
    width: var(--aj-tile-width, 250px); 
    flex-shrink: 0; 
}

.aj-layout-curved-3d {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 15px; 
    perspective: 1200px; 
    padding: 50px 0; 
    background-color: #050505; 
}

.aj-layout-curved-3d .aj-collage-tile {
    width: var(--aj-tile-width, 220px); 
    border-radius: 15px; 
}

.aj-layout-curved-3d .aj-collage-tile:nth-child(1) { transform: rotateY(25deg) scale(0.85); z-index: 1; }
.aj-layout-curved-3d .aj-collage-tile:nth-child(2) { transform: rotateY(15deg) scale(0.95); z-index: 2; }
.aj-layout-curved-3d .aj-collage-tile:nth-child(3) { transform: rotateY(0deg) scale(1); z-index: 3; box-shadow: 0 10px 30px rgba(0,0,0,0.8); }
.aj-layout-curved-3d .aj-collage-tile:nth-child(4) { transform: rotateY(-15deg) scale(0.95); z-index: 2; }
.aj-layout-curved-3d .aj-collage-tile:nth-child(5) { transform: rotateY(-25deg) scale(0.85); z-index: 1; }
.aj-layout-curved-3d .aj-collage-tile:hover { transform: rotateY(0deg) scale(1.05); z-index: 10; }

/* === CAROUSEL SLIDER SPECIFIC STYLES === */
.aj-layout-slider-buttons {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: hidden; 
    gap: 30px;
    padding: 10px;
}

.aj-layout-slider-buttons .aj-collage-tile {
    flex: 0 0 auto; 
    width: var(--aj-tile-width, 200px);
}

.aj-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.aj-slider-nav i {
    font-size: calc(100% * 0.5); 
}

.aj-slider-prev {
    left: 0px; 
}

.aj-slider-next {
    right: 0px; 
}

/* =========================================
   6. 3D SLIDESHOW ENGINE & KEYFRAMES
   ========================================= */
.aj-animate-ready {
    opacity: 0; 
    animation: aj-slide-up-reveal 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes aj-slide-up-reveal {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

.aj-slideshow {
    position: relative; 
    width: 100%;
    height: var(--aj-tile-height, 300px);
    perspective: 1500px;
    transform-style: preserve-3d;
    overflow: hidden; 
}

.aj-slideshow .aj-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 0;
    backface-visibility: hidden;
    animation-duration: var(--aj-trans-speed, 0.8s);
    animation-timing-function: cubic-bezier(0.4, 0.0, 0.2, 1);
    animation-fill-mode: forwards;
}

.aj-slideshow .aj-slide:first-child {
    position: relative;
}

.aj-slideshow .aj-slide-active {
    z-index: 2;
    opacity: 1;
}

.aj-cube-in-up { animation-name: cubeInUp; z-index: 2; }
.aj-cube-out-up { animation-name: cubeOutUp; z-index: 1; }

@keyframes cubeInUp {
    0% { transform: rotateX(-90deg) translateZ(100px); opacity: 0; }
    100% { transform: rotateX(0deg) translateZ(0); opacity: 1; }
}
@keyframes cubeOutUp {
    0% { transform: rotateX(0deg) translateZ(0); opacity: 1; }
    100% { transform: rotateX(90deg) translateZ(100px); opacity: 0; }
}

.aj-cube-in-down { animation-name: cubeInDown; z-index: 2; }
.aj-cube-out-down { animation-name: cubeOutDown; z-index: 1; }

@keyframes cubeInDown {
    0% { transform: rotateX(90deg) translateZ(100px); opacity: 0; }
    100% { transform: rotateX(0deg) translateZ(0); opacity: 1; }
}
@keyframes cubeOutDown {
    0% { transform: rotateX(0deg) translateZ(0); opacity: 1; }
    100% { transform: rotateX(-90deg) translateZ(100px); opacity: 0; }
}

.aj-cube-in-left { animation-name: cubeInLeft; z-index: 2; }
.aj-cube-out-left { animation-name: cubeOutLeft; z-index: 1; }

@keyframes cubeInLeft {
    0% { transform: rotateY(90deg) translateZ(100px); opacity: 0; }
    100% { transform: rotateY(0deg) translateZ(0); opacity: 1; }
}
@keyframes cubeOutLeft {
    0% { transform: rotateY(0deg) translateZ(0); opacity: 1; }
    100% { transform: rotateY(-90deg) translateZ(100px); opacity: 0; }
}

.aj-cube-in-right { animation-name: cubeInRight; z-index: 2; }
.aj-cube-out-right { animation-name: cubeOutRight; z-index: 1; }

@keyframes cubeInRight {
    0% { transform: rotateY(-90deg) translateZ(100px); opacity: 0; }
    100% { transform: rotateY(0deg) translateZ(0); opacity: 1; }
}
@keyframes cubeOutRight {
    0% { transform: rotateY(0deg) translateZ(0); opacity: 1; }
    100% { transform: rotateY(90deg) translateZ(100px); opacity: 0; }
}

.aj-anim-fade { animation-name: ajFadeIn; }
@keyframes ajFadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}