/* Stratous Gallery v1.1 — Stratous Brand */
:root{
    --sg-blue:#009EE2;
    --sg-purple:#662482;
    --sg-gray:#6F6F6E;
    --sg-grad:linear-gradient(90deg,#009EE2,#662482);
    --sg-font:'Quicksand',sans-serif;
    --sg-heading:'Righteous',sans-serif;
    --sg-radius:20px;
}

/* === GRID === */
.sg-gallery{
    width:100%;
    max-width:1300px;
    margin:0 auto;
    padding:40px 24px;
    font-family:var(--sg-font);
}

.sg-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(250px,1fr));
    gap:20px;
}

/* Force max 4 columns on large screens */
@media(min-width:1100px){
    .sg-grid{grid-template-columns:repeat(4,1fr)}
}

/* === CARD === */
.sg-card{
    position:relative;
    border-radius:var(--sg-radius);
    overflow:hidden;
    cursor:pointer;
    aspect-ratio:3/4;
    background:#1a1a2e;
    /* Animation initial state */
    opacity:0;
    transform:translateY(60px) scale(.92);
    transition:opacity .7s cubic-bezier(.22,1,.36,1),transform .7s cubic-bezier(.22,1,.36,1);
}
.sg-card.visible{
    opacity:1;
    transform:translateY(0) scale(1);
}
/* Different entrance directions */
.sg-card.from-left{transform:translateX(-80px) scale(.92)}
.sg-card.from-right{transform:translateX(80px) scale(.92)}
.sg-card.from-top{transform:translateY(-80px) scale(.92)}
.sg-card.from-bottom{transform:translateY(80px) scale(.92)}
.sg-card.visible.from-left,
.sg-card.visible.from-right,
.sg-card.visible.from-top,
.sg-card.visible.from-bottom{
    transform:translate(0) scale(1);
}

.sg-card:hover{
    transform:translateY(-6px) scale(1.02) !important;
    box-shadow:0 16px 40px rgba(0,0,0,.2);
    z-index:2;
}
.sg-card:hover .sg-card-img{
    transform:scale(1.06);
}

/* Image */
/* Image as background on card itself */
.sg-card-img{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    background-size:cover !important;
    background-position:center center !important;
    background-repeat:no-repeat !important;
    transition:transform .5s cubic-bezier(.22,1,.36,1);
}
/* Hide cards with no image */
.sg-card:not(.has-image){display:none !important}

/* Gradient overlay at bottom */
.sg-card-overlay{
    position:absolute;
    inset:0;
    background:linear-gradient(180deg,transparent 40%,rgba(0,0,0,.7) 100%);
    pointer-events:none;
}

/* Play button */
.sg-card-play{
    position:absolute;
    bottom:80px;
    left:20px;
    width:44px;
    height:44px;
    background:#fff;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 4px 16px rgba(0,0,0,.15);
    transition:transform .3s,box-shadow .3s;
    z-index:2;
}
.sg-card:hover .sg-card-play{
    transform:scale(1.1);
    box-shadow:0 6px 20px rgba(0,0,0,.2);
}
.sg-card-play svg{
    width:18px;
    height:18px;
    margin-left:2px;
    color:#333;
}
/* Hide play btn if no video */
.sg-card-play.hidden{display:none}

/* Text */
.sg-card-info{
    position:absolute;
    bottom:0;
    left:0;
    right:0;
    padding:18px 20px;
    z-index:2;
    pointer-events:none;
}
.sg-card-name{
    font-size:1rem;
    font-family:var(--sg-heading);
    font-weight:400;
    color:#fff;
    text-transform:uppercase;
    letter-spacing:.03em;
    margin-bottom:3px;
    line-height:1.2;
}
.sg-card-sub{
    font-size:.82rem;
    font-weight:400;
    color:rgba(255,255,255,.8);
    line-height:1.3;
}

/* === MODAL === */
.sg-modal{
    position:fixed;
    inset:0;
    z-index:99999;
    display:flex;
    align-items:center;
    justify-content:center;
    opacity:0;
    pointer-events:none;
    transition:opacity .35s;
}
.sg-modal.open{
    opacity:1;
    pointer-events:auto;
}
.sg-modal-overlay{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.85);
    backdrop-filter:blur(12px);
}
.sg-modal-container{
    position:relative;
    z-index:2;
    width:90%;
    max-width:900px;
    max-height:90vh;
    display:flex;
    flex-direction:column;
    transform:scale(.9) translateY(30px);
    transition:transform .4s cubic-bezier(.22,1,.36,1);
}
.sg-modal.open .sg-modal-container{
    transform:scale(1) translateY(0);
}
.sg-modal-close{
    position:absolute;
    top:-16px;
    right:-16px;
    width:44px;
    height:44px;
    border-radius:50%;
    background:#fff;
    border:none;
    font-size:18px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 4px 16px rgba(0,0,0,.2);
    transition:transform .2s;
    z-index:10;
    color:#333;
}
.sg-modal-close:hover{transform:scale(1.1)}

.sg-modal-content{
    display:flex;
    flex-direction:column;
    gap:16px;
}

/* Main selected image */
.sg-modal-main{
    width:100%;
    border-radius:20px;
    overflow:hidden;
    background:#111;
    position:relative;
    aspect-ratio:16/10;
}
.sg-modal-main img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}
.sg-modal-main-info{
    position:absolute;
    bottom:0;
    left:0;
    right:0;
    padding:24px 28px;
    background:linear-gradient(transparent,rgba(0,0,0,.75));
    color:#fff;
}
.sg-modal-main-name{
    font-size:1.4rem;
    font-family:var(--sg-heading);
    font-weight:400;
    text-transform:uppercase;
    letter-spacing:.04em;
    margin-bottom:4px;
}
.sg-modal-main-sub{
    font-size:.95rem;
    color:rgba(255,255,255,.8);
}

/* Thumbnails row */
.sg-modal-thumbs{
    display:flex;
    gap:10px;
    overflow-x:auto;
    padding:4px 0;
    scroll-behavior:smooth;
}
.sg-modal-thumbs::-webkit-scrollbar{height:4px}
.sg-modal-thumbs::-webkit-scrollbar-thumb{background:rgba(255,255,255,.2);border-radius:10px}

.sg-modal-thumb{
    flex-shrink:0;
    width:90px;
    height:90px;
    border-radius:12px;
    overflow:hidden;
    cursor:pointer;
    border:3px solid transparent;
    opacity:.5;
    transition:all .3s;
}
.sg-modal-thumb:hover{opacity:.8}
.sg-modal-thumb.active{
    border-color:var(--sg-blue);
    opacity:1;
    transform:scale(1.05);
}
.sg-modal-thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
}

/* === RESPONSIVE === */
@media(max-width:1024px){
    .sg-grid{grid-template-columns:repeat(3,1fr);gap:16px}
}
@media(max-width:768px){
    .sg-grid{grid-template-columns:repeat(2,1fr);gap:12px}
    .sg-gallery{padding:24px 16px}
    .sg-card{aspect-ratio:3/4.5}
    .sg-card-play{width:38px;height:38px;bottom:70px;left:14px;border-radius:10px}
    .sg-card-play svg{width:15px;height:15px}
    .sg-card-info{padding:14px 16px}
    .sg-card-name{font-size:.88rem}
    .sg-card-sub{font-size:.75rem}
    .sg-modal-container{width:95%}
    .sg-modal-main{aspect-ratio:4/3}
    .sg-modal-main-name{font-size:1.1rem}
    .sg-modal-thumb{width:70px;height:70px}
    .sg-modal-close{top:-10px;right:-10px;width:38px;height:38px}
}
@media(max-width:480px){
    .sg-grid{grid-template-columns:repeat(2,1fr);gap:10px}
    .sg-card{aspect-ratio:3/5}
}
