/* core/static/core/assets/css/gallery.css */
*{
	box-sizing: border-box;	
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 5px 0;
}

p {
 	margin: 0 0 20px 0;
}

/* Wrapper: keeps gallery centered & contained */
.gallery-wrapper {
    max-width: 670px;   /* adjust as needed */
    margin: 0 auto;      /* center horizontally */
    padding: 0 12px;     /* small side padding */
    position: relative; /* ensures CTA positions relative to this */

}

/* Keep your existing .third rules */
.third {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    height: auto;
    grid-auto-flow: dense;
	position: relative;
    perspective: 1000px;
	perspective-origin: center;
}

.item_third{
	overflow: hidden;
	display: grid;
	grid-template-columns: 1;
	grid-template-rows: 1;
	
}

.item_third {
  backface-visibility: hidden;
  will-change: transform;
}

.item_third img {
  backface-visibility: hidden;
}

.item_third:first-child {
  transform: rotateY(20deg); 
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}


.item_third:first-child:hover {
  transform: rotateY(0deg);
}



.item_third:nth-child(2) {
  transform: scale(0.9);
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
  backface-visibility: hidden;
  opacity: 0.9;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.item_third:nth-child(2):hover {
  transform: scale(1);
  opacity: 1;
}

.item_third:nth-child(3) {
  transform: scale(1) ;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.item_third:nth-child(4) {
  transform: scale(1); 
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.item_third:nth-child(3):hover {
  transform: scale(1.1);
}

.item_third:nth-child(4):hover {
  transform: scale(1.1);
}

.item_third img{
	grid-column: 1/ -1;
	grid-row: 1/ -1;
	width: 100%;
	height: 100%;
}


.item_third.h1{
	grid-column: span 1;
}


.overlay_third{
	position: fixed;
	background: rgba(0, 0, 0, 0.7);
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: none;
	z-index: 2;
}

.overlay_third.open{
	display: grid;
	align-items: center;
	justify-items: left;
	padding: 10px;
}

.overlay_third-inner {
	background: #fff;
	width: 100%;
    max-width: 100%;
    padding: 1px;
    margin-top: 55px;
    border-radius: 0;
}

.overlay_third img {
 	width: 100%;
    height: 300px;
	max-height: 666px;
    /* object-fit: cover; */
    border-radius: 0;
    z-index: 3;
	position: relative;
}

.item_third__overlay .view{
	color: #fff;
    background-color: #fff;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    transition-property: background-color,border-color,color,box-shadow,filter;
    transition-duration: .6s;
    letter-spacing: 3px;
    min-width: auto;
    text-transform: capitalize;
    white-space: normal;
 	outline: 0;
}

section#login_galleryThird_Section {
	overflow: visible;
    overflow-x: clip;
}

#login_galleryThird_Section .third {
  position: relative;
  z-index: 1;
}

/* Mobile (≤ 575px) */
@media screen and (max-width: 575px) {
    section#login_galleryThird_Section {
        top: 200px;
    }

    .third {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        max-height: 90vh; 
        overflow: visible;
        align-content: start; 
    }

    .third .item_third {
        position: relative;
        width: 100%;
        aspect-ratio: 1 / 1;
        overflow: hidden;
    }

    .third .item_third img.cover {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Instagram-like */
    }

    /* Featured tall item */
    .item_third.v1 {
        grid-row: span 13;      /* taller than normal */
        min-height: 20vh;       
        margin-top: auto;       /* pushes it downward in the grid */
        margin-bottom: auto;       /* lock it at bottom */
    }
}


/* Small tablets (576px – 766px) */
@media (min-width: 576px) and (max-width: 766px) {
    section#login_galleryThird_Section {
        top: 160px;
    }
    .third {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        height: auto;
        max-height: none;

        justify-content: center;
        max-width: 600px;
        margin: 0 auto;
    }

    .third .item_third {
        width: 100%;
        height: auto;
    }

    .third .item_third img.cover {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
}

/* Tablets & up (≥ 767px, covers up to 991px and beyond until next breakpoint) */
@media (min-width: 767px) {
    section#login_galleryThird_Section {
        top: 140px;
    }

    .third {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
        gap: 12px;
        justify-content: center;
        max-width: 600px;
        margin: 0 auto;
    }

    .third .item_third {
        aspect-ratio: 1 / 1;
        overflow: hidden;
    }

    .third .item_third img.cover {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}


/* Large screens (≥ 992px) */
@media (min-width: 992px) {
    .third {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        height: auto;
        max-height: none; /* no restriction */
    }

    .third .item_third {
        position: relative;
        width: 100%;
        height: auto;
        background:#fff;
    }

    .third .item_third img.cover {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
}
