/* блок контента*/
main {
    flex: 1;
    /* Растяжка main по высоте */
}



/* avatar */
.ava,
.ava img {
    border-radius: 0px;
}

.ava-ssmall,
.ava-ssmall img {
    height: 30px;
    width: 30px;
}

.ava-small,
.ava-small img {
    height: 46px;
    width: 46px;
}

.ava-middle,
.ava-middle img {
    height: 80px;
    width: 80px;
}

.ava-big,
.ava-big img {
    height: 100px;
    width: 100px;
    border-radius: 9999px;
}



/*full name*/
.fio {
    font-weight: bold;
    line-height: 1.2em;
}

.fio a {
    color: var(--text-color);
}

.fio i {
    color: var(--secondary-text);
}

.fio-small {
    font-size: 1em !important;
}

.fio-middle {
    font-size: 1.2em !important;
}

.fio-big {
    font-size: 1.6em !important;
}




/* карточка пользователя */
.user-card {
    display: grid;
    grid-template-columns: 1fr auto;
    /* Две колонки */
    grid-template-rows: repeat(3, auto);
    /* Три строки */
    gap: 10px 20px;
    /* Расстояние между элементами */
    margin-bottom: 30px;
}

.user-card> :first-child {
    grid-column: 1;
    /* Первая колонка */
    grid-row: span 3;
    /* Занимает три строки */
}

.user-card> :nth-child(n+2) {
    grid-column: 2;
    /* Вторая колонка */
}

.user-card>div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    font-size: 0.95rem;
}

.user-card p {
    margin: 0px;
    color: var(--text-color);
}


.user-card .ava {
    display: flex;
    height: 100%;
    align-items: center;
}



/* галерея-стрим */

.photo-stream {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 auto;
    position: relative;
    justify-content: start;
}


.photo-stream::after {
    content: "";
    flex: 999 1 0px; /* Базовый размер 0px вместо 0% */
    min-width: 0;
    height: 0;
}



.photo-stream-item {
    height: 300px;
    flex: 0 1 auto;
    overflow: hidden;
    background: var(--background);
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px;
    position: relative;    
    border-radius: 4px;
}


.photo-stream-item:hover {
    background: linear-gradient(to bottom, rgba(53, 53, 53, 0.6), rgba(53, 53, 53, 0.3), transparent);
}


.photo-stream-item img {
    height: 100%;
    max-height: 300px;
    width: auto;
    max-width: 100%;
    object-fit: contain;    
    border-radius: 4px;
    margin:0px 0px;
}


/* Контейнер для информации */
.info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(53, 53, 53, 0.9), rgba(53, 53, 53, 0.7), transparent);
    color: whitesmoke;
    padding: 20px 10px 5px 10px;
    transform: translateY(100%);    
    opacity: 0;
}

.photo-stream-item:hover .info-overlay {
    transform: translateY(0);
    opacity: 1;
    
}

.top-overlay {
    bottom: auto;
    top:0;
    padding: 5px 10px 5px 10px;
    background: linear-gradient(to bottom, rgba(53, 53, 53, 0.9), rgba(53, 53, 53, 0.7), transparent);
}

/* Стили для текста */
.photo-stream .image-title {
    font-size: 15px;
    font-weight: 500;
    margin: 0px 0px 5px 0px;
    color: whitesmoke;
    text-shadow: 0 1px 3px var(--shadow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



.photo-stream .image-info {
    display: flex;
    justify-content: space-between;
    align-items: last baseline;
    font-size: 12px;
    color: whitesmoke;
}


.photo-stream a {
    color: #f5f5f5;
    opacity: 1;
}


.author {
    font-weight: 500;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 15px;
    white-space: nowrap;
}
/*
.author::before {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='20px' viewBox='0 -960 960 960' width='20px' fill='%23fff'%3E%3Cpath d='M480-480q-60 0-102-42t-42-102q0-60 42-102t102-42q60 0 102 42t42 102q0 60-42 102t-102 42ZM192-192v-96q0-23 12.5-43.5T239-366q55-32 116.29-49 61.29-17 124.5-17t124.71 17Q666-398 721-366q22 13 34.5 34t12.5 44v96H192Zm72-72h432v-24q0-5.18-3.03-9.41-3.02-4.24-7.97-6.59-46-28-98-42t-107-14q-55 0-107 14t-98 42q-5 4-8 7.72-3 3.73-3 8.28v24Zm216.21-288Q510-552 531-573.21t21-51Q552-654 530.79-675t-51-21Q450-696 429-674.79t-21 51Q408-594 429.21-573t51 21Zm-.21-72Zm0 360Z'/%3E%3C/svg%3E");
    margin-right: 1px;
    margin-top: -4px;
    transform: scale(0.8);
}
*/
.stats {
    display: flex;
    gap: 7px;
    
}

.stats .faves,
.stats .comments {
    display: flex;
    align-items: center;
    gap: 5px 0px 5px 0px; 
    color: whitesmoke; 
    transform: scale(0.85);
}



/* Адаптивность */
@media (max-width: 1200px) {

    .photo-stream-item {
        height: 260px;
        width: 260px;
        overflow: hidden;
    }

    .photo-stream-item img {
        height: 100%;
        width: auto;

        object-fit: contain;
        transition: transform 0.3s ease;
        border-radius: 4px;
    }

    .info-overlay {
        padding: 15px 10px 10px;
    }

    .photo-stream .image-title {
        margin-bottom: 8px;
    }

    .author,
    .likes,
    .comments {
        font-size: 12px;
    }
}


/* Список альбомов */

.album-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;

}

.album-card {
    width: 250px;
    height: 250px;
    background: var(--background);
    border: 1px solid var(--modal-border);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);    
    position: relative;
    box-shadow: var(--shadow) 3px 3px, var(--shadow) 6px 6px;

}

.album-card:hover {
    /*box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);*/
}


.album-card .zerocard {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.album-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(53, 53, 53, 0.9), rgba(53, 53, 53, 0.7), transparent);
    color: whitesmoke;
    padding: 20px 10px 10px;
    transition: transform 0.05s ease;
}

.album-title {
    font-family: "Montserrat", sans-serif;
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.album-info {
    font-size: 0.9rem;
    color: var(--panel-text-color);
}



/*  Альбом  */


.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: auto;    
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 2px;    
    max-width: 800px;
    min-width: 300px;
    max-height:800px;
    min-height: 300px;
    padding:8px 8px 0px 8px;
}

.gallery-item .image-container {
    width:100%;
    height: 400px;    
    overflow: hidden; /* обрезаем излишки изображения */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-item .image-container a {
    height: 400px;    
    width: auto;
    display: flex;
    justify-content: center;
    align-items: center;

}

.gallery-item .image-container img {
    height: 100%;    
    width: 100%;
    object-fit: cover; 
    border-radius: 4px 4px 0 0;
}


.caption {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: center;
    padding: 4px 2px 4px 4px;        
    min-width: 100%;
    /* Ограничение максимальной ширины */
    background: var(--bg-color);
    color: var(--text-color);
}

.caption .image-title {
    font-size: 16px;
    color: var(--text-color);
    white-space: nowrap;
    /* Запрещаем перенос текста */
    overflow: hidden;
    /* Скрываем лишний текст */
    text-overflow: ellipsis;
    /* Добавляем многоточие для длинных текстов */
    text-shadow: none;
}

.caption .image-info {
    color: var(--secondary-text);
    font-size: 14px;
}

.caption a {
    color: var(--text-color);
    opacity: 1;
}




/* Стили для режима редактирования альбома */
.edit-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: none;
}


.settings-area {
    display:none;
}

.edit-mode header, .edit-mode footer, .edit-mode .addphoto {
    display: none;
}

.edit-mode .edit-checkbox {
    display: block;
}

.edit-mode .settings-area {
    display: block;
}
/*.edit-mode .image-container::after {*/
.edit-mode .gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;    
    border-radius: 4px 4px 0 0;
    pointer-events: none;
}

/*.gallery-item:has(input[type="checkbox"]:checked) .image-container::after {*/
.gallery-item:has(input[type="checkbox"]:checked)::after {
    background-color:  rgba(0, 0, 0, 0.1);
    border: 3px solid var(--button-warning-hover);
}

.controls {
    display: flex;
    justify-content: flex-end;
    margin-top: 2px;
    padding:2px 10px;
    top: auto;
    gap: 10px;    
    background: var(--background);
}


.edit-mode .userhead {    
    position: fixed;
    width: 100vw;
    z-index: 99999;
    top:1;    
}

.edit-mode .content {
    padding-top: 100px;    
}


.edit-mode .gallery a {
    pointer-events: none !important;   /* полностью отключает клики */
    cursor: default !important; 
}


.edit-mode .content .system-links,
.edit-mode .content .system-info, 
.edit-mode .content h2, 
.edit-mode .content .text-block,
.edit-mode .content .image-info
{
    display: none;    
}

.edit-mode .content .gallery {
    visibility: visible;    
}


.delete-btn,
.move-btn,
.cancel-btn, .copy-btn,
.edit-mode-head {
    display: none;
}

.edit-mode .edit-btn,
.edit-mode .editalbum-btn {
    display: none;    
}

.edit-mode .delete-btn,
.edit-mode .move-btn,
.edit-mode .cancel-btn, .edit-mode .copy-btn,
.edit-mode .edit-mode-head {
    display: block;
}

.move-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--modal-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 300px;
}

.move-dialog h3 {
    margin-bottom: 20px;
    color: var(--heading-color);
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5); 
    z-index: 900;
}

.move-dialog.active,
.overlay.active {
    display: block; 
}



@media (max-width: 768px) {

    .gallery {
        gap: 20px;
    }

    .controls {
        position: static;
        margin-bottom: 20px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .edit-btn,
    .delete-btn,
    .move-btn,
    .cancel-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .move-dialog {
        width: 90%;
        max-width: 400px;
        padding: 20px;
    }
}



