.fag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.fag-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 5px;
    transition: transform 0.2s;
    cursor: pointer;
}

.fag-grid img:hover {
    transform: scale(1.05);
}


.fag-albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.fag-album-item {
    cursor: pointer;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: fit-content;
    border-radius: 5px;
}
.fag-album-item:hover:after{
 top: -3px;
 background-color: #8c9296;
}
.fag-album-item:hover:before{
 top: -5px;
 background-color: #8c9296;
}
.fag-album-item:after, .fag-album-item:before {
    background: #afb7bc;
    content: "";
    height: 1px;
    position: absolute;
    transition: all .15s ease-in-out;
}
.fag-album-item:after {
    left: 10px;
    right: 10px;
    top: -2px;
}
.fag-album-item:before {
   left: 15px;
    right: 15px;
      top: -4px;
}

#fag-albums-grid .fag-album-item img {
    width: 100%;
    border-radius: 5px;
    transition: transform 0.2s;
    position: relative;
        border-radius: 5px !important;
            height: 170px;
    object-fit: cover;
}
.fag-album-item-img-cont{
    position: relative;
    display: flex;
        width: 100%;
}
.fag-album-item-img-cont::after {
  content: "";
  position: absolute;
  bottom: 0;         /* прив’язка до низу */
  left: 0;
  width: 100%;
  height: 100px;     /* висота градієнта */
    background: linear-gradient(to top, rgb(0 0 0 / 87%), rgba(0, 0, 0, 0));
  pointer-events: none; /* щоб не перекривати клік по зображенню */
      border-radius: 0 0 5px 5px;
      transition: height .3s, background .3s;
}
.fag-album-item:hover .fag-album-item-img-cont::after{
      height: 110px; 
       background: linear-gradient(to top, rgb(0 0 0 / 100%), rgba(0, 0, 0, 0));
}

.fag-album-title {
  position: absolute;
    bottom: 24px;
    color: white;
    left: 0;
    width: 100%;
    text-align: left;
    font-weight: 700;
    font-size: 16px;
    padding: 0 10px;
    transition: bottom .3s;
}
.fag-album-item:hover .fag-album-title{
    bottom: 29px;
}
/* Контейнер для фото альбому */
#fag-album-container {
    display: none;
}

/* Прелоадер всередині контейнера */
.fag-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    color: #555;
    height: 100%; /* займатиме всю висоту контейнера */
}

/* Простий анімований спіннер */
.fag-loading::after {
    content: "";
    display: block;
    width: 30px;
    height: 30px;
    margin-left: 10px;
    border: 4px solid #999;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
#fag-back-to-albums{
        margin-bottom: 25px;
    display: block;
}
#fag-back-to-albums:hover{
    color: #B69E1A;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
