* {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
}

/* Заголовок */
.museum-title {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 12px;
    border-bottom: 2px solid #000; /* черная линия под заголовком */
    padding-bottom: 6px;           /* немного пространства между текстом и линией */
}





/* ===== Поиск ===== */
#searchBlock {
    margin: 5%;
    width: 90%;
    margin-top: 3%;
    padding: 20px;
    background:  rgba(246,236,210,0.9);
    border-radius: 8px;
    box-shadow: 0 0 25px rgba(0,0,0,0.35);
}

#searchControls {
    display: flex;
    justify-content: flex-end; /* уводим вправо */
    gap: 10px;
}


#searchInput {
    width: 20vw;        /* 20% ширины экрана */
    min-width: 120px;   /* чтобы не стало микроскопическим */
    padding: 10px;
    font-size: 16px;
}


#searchBtn {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}

/* ===== Overlay ===== */
#searchOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    z-index: 10000;
}

/* ===== Модальное окно ===== */
#searchModal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 70vh;
    background: rgba(246,236,210,0.9);
    border-radius: 10px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* ===== Крестик ===== */
#closeSearch {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 26px;
    background: none;
    border: none;
    cursor: pointer;
}

/* ===== Результаты ===== */
#searchResults {
    margin-top: 40px;
    overflow-y: auto;
    flex: 1;
    border-top: 1px solid #aaa;
    padding-top: 10px;
}

.result {
    margin-bottom: 12px;
    padding: 6px;
    border-radius: 4px;
}

/* просмотренный результат */
.result.viewed {
    background: rgba(76, 175, 80, 0.25); /* мягкий зелёный */
}

.result a {
    font-weight: bold;
    text-decoration: none;
    color: #000;
}

.result div {
    font-size: 20px;
}


/* ===== Газетный блок ===== */
.b1 {
    margin: 3% auto;
    height: 50%;
    width: 90%;
      /* padding: 2%; */
         padding: 10px 20px;
    /* background: rgba(247,240,223,0.95); */
    border-radius: 8px;
    /* box-shadow: 0 0 25px rgba(0,0,0,0.35); */
    /* padding: 1%; */
    font-size: 20px;

 
    overflow-y:auto;
    box-sizing:border-box;


}

/* 2 блок с картинками */
#infoBlock {
    position: relative;
    background-size: cover;
    background-position: top center; /* 🔥 ВАЖНО */
    background-repeat: no-repeat;
    transition: background-image 0.4s ease;
}


#infoTitle {
    /* background: rgba(0,0,0,0.55); */
    color: #000000;
    font-size: 30px;
    font-weight: bold;
    padding: 12px;
    text-align: center;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* белый с прозрачностью 70% */
    display: inline-block; /* чтобы фон обтекал только текст */
    padding: 0px 6px;      /* немного внутреннего отступа вокруг текста */


}


/* clearfix */
.b1::after {
    content: "";
    display: table;
    clear: both;
}

/* Колонки */
.b11, .b12 {
    width: 25%;
    height: 100%;
    float: left;
    /* border: 1px solid #aaa; */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    overflow: hidden;
    /* margin: 5px, 5px, 5px, 5px; */
}

 .b13{
    width: 15%;
    height: 100%;
    float: left;
    /* border: 1px solid #aaa; */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    overflow: hidden;
}


  .b14 {
    width: 35%;
    height: 100%;
    float: left;
    /* border: 1px solid #aaa; */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    overflow: hidden;
}



.b11 > div,
.b13,
.b14 {
    height: 100%;
    display: flex;
    flex-direction: column;
    
}

.b14 {
    border-right: none;
}

/* Списки */
#papersList, #foldersList, #filesList {
    list-style: none;
    padding: 0;
    margin: 5px auto;
    width: 100%;
    /* background: rgba(246,236,210,0.95); */
    /* border: 1px solid #aaa;
    border-radius: 4px; */
    text-align: center;

    flex: 1;
    overflow-y: auto;
}

#papersList li,
#foldersList li,
#filesList li {
    padding: 6px 10px;
    cursor: pointer;
}

#papersList li.selected,
#foldersList li.selected {
    /* background: rgba(255,235,59,0.3); */
}

#filesList a {
    text-decoration: none;
    color: #000;
    font-weight: bold;
    font-size: 20px;
}


/* ===== Cookie banner ===== */
#cookie-banner {
    position: fixed;
    left: 0;
    bottom: 60px;
    width: 100%;
    background: #e1e1e2;
    color: #000000;
    padding: 15px 20px;
    display: none;
    z-index: 9999;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

#cookie-banner a {
    color: #000;
    text-decoration: underline;
}

#cookie-banner .buttons {
    margin-top: 8px;
}

#cookie-banner button {
    border: none;
    padding: 7px 14px;
    margin-right: 10px;
    cursor: pointer;
    font-weight: bold;
}

#cookie-accept {
    background: #4ea3ff;
    color: #000;
}

#cookie-decline {
    background: #555;
    color: #fff;
}

#cookie-decline:hover {
    background: #777;
}

/* ===== Footer ===== */
#site-footer {
    /* position: fixed; */
    bottom: 0;
    left: 0;
    width: 100%;
    background: #e1e1e2;
    color: #000;
    text-align: center;
    padding: 8px 10px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    z-index: 9998;
    box-sizing: border-box;
}

#site-footer a {
    color: #000000;
    margin: 0 6px;
    text-decoration: none;
}

#site-footer a:hover {
    text-decoration: underline;
}

#site-footer .org {
    display: block;
    margin-top: 6px;
    color: #000;
    font-size: 11px;
}


#mosaic { 
    position: fixed; 
    inset: -8%; 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(25%,1fr)); 
    grid-auto-rows:25%; 
    z-index:-2; /* убираем или ставим 0 */
    perspective:1000px;
}
.tile {
    background-size: cover; 
    background-position: center; 
    opacity: 0.75; 
    filter: saturate(115%) contrast(95%) brightness(1.05); 
    border-radius: 4px; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.35), 0 4px 8px rgba(0,0,0,0.2); 
    transition: transform 0.9s cubic-bezier(0.25, 1, 0.5, 1), 
                box-shadow 0.9s cubic-bezier(0.25, 1, 0.5, 1), 
                z-index 0s; /* плавная анимация */
    position: relative;
    z-index: 1;
}

.tile:hover { 
    transform: scale(3.1) translateY(-15px); /* большее увеличение и подъём */
    box-shadow: 15px 15px 40px rgba(0,0,0,0.45); /* более выраженная тень */
    z-index: 10; /* чтобы плитка была поверх всех */
}


#overlay {
    position: fixed; 
    inset:0; 
    z-index:-1; 
    pointer-events:none; 
    background: rgba(155,148,126,0.25);
}
#content {
    position: relative; 
    z-index:2; 
    max-width:900px; 
    margin:80px auto; 
    padding:48px; 
    background: rgba(246,236,210,0.9); 
    box-shadow: 0 0 40px rgba(0,0,0,0.35), inset 0 0 60px rgba(197,195,195,0.4);
}


/* фото */
.folders-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;

}

.folder-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.folder-item:hover {
    transform: translateY(-5px);
}

.folder-icon {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    object-fit: cover;
    border: 3px solid #ddd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.folder-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-top: 8px;
    padding: 5px;
    background: rgba(255,255,255,0.8);
    border-radius: 5px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* открыть папку с фото */
.folders-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.folder-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
}

.folder-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.folder-icon {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    object-fit: cover;
    border: 3px solid #ddd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.folder-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-top: 8px;
    padding: 8px 5px;
    background: rgba(255,255,255,0.9);
    border-radius: 5px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #ff4444;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.close-modal:hover {
    background: #ff0000;
}
    
.modal-header {
    padding: 20px;
    background:  rgba(247,240,223,0.95);
    color: white;
    text-align: center;
    flex-shrink: 0;
   
}

#modalTitle {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
        color: #000;
}

.images-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    align-content: start;
}

.image-item {
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    height: 200px;
    position: relative;
}

.image-item:hover {
    transform: scale(1.03);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.image-item:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.no-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

/* Стили для скроллбара */
.images-container::-webkit-scrollbar {
    width: 8px;
}

.images-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.images-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.images-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* машина времени */

#timeMachine{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(200px,1fr));
    gap:15px;
    padding:20px;

    /* height:100%;
    overflow-y:auto;
    box-sizing:border-box; */
}

#timeMachine img{
    width:100%;
    height:200px;
    object-fit:cover;
    border-radius:8px;
    box-shadow:0 4px 10px rgba(0,0,0,0.3);
}

#timeMachine img:hover{
    transform:scale(1.05);
}

/* отступ снизу */
#timeMachine{
    margin-bottom:10%;
}

/* модальное окно машина времени */
#compareBox{
    position:relative;
    width:100%;
    height:80vh;
    overflow:hidden;
}

#compareBox img{
    position:absolute;
    width:100%;
    height:100%;
    object-fit:contain;
}

#oldPhoto{
    z-index:2;
    opacity:1;
     top: 40px; /* отступ сверху */
}

#newPhoto{
    z-index:1;
     top: 40px; /* отступ сверху */
}

.compareText{
    text-align:center;
    padding:10px;
    font-size:18px;
}
#timeMachine img{
    cursor:pointer;
}


/* стекло */

.b1 {

      background: rgba(247,240,223,0.35); /* прозрачность */
    
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* для Safari */

    border: 1px solid rgba(255,255,255,0.25);

    border-radius: 14px;

    box-shadow: 
        0 8px 32px rgba(0,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.4);

}

 .b11, .b12, .b13, .b14 {
   
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 14px;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.4);

}


.b1::before,
.b11::before,
.b12::before,
.b13::before,
.b14::before{

    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;

    background: linear-gradient(
        rgba(255,255,255,0.35),
        rgba(255,255,255,0)
    );

    border-radius: 14px 14px 0 0;
    pointer-events: none;

}



/* Адаптивность */
@media (max-width: 768px) {
    .folders-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .folder-icon {
        width: 120px;
        height: 120px;
    }
    
    .modal-content {
        width: 95vw;
        height: 95vh;
        border-radius: 8px;
    }
    
    .images-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .image-item {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .folders-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .folder-icon {
        width: 100px;
        height: 100px;
    }
    
    .folder-name {
        font-size: 14px;
    }
}





@media (max-width: 768px) {
    #searchInput {
        width: 60vw;
    }

    /* Все колонки на всю ширину */
    .b11, .b12, .b13, .b14 {
        width: 100% !important;
        float: none;
        margin-bottom: 10px;
        background: rgba(247,240,223,0.95);
        overflow-y: auto; /* прокрутка */
    }

    .b11 { height: 200px; }
    .b12 { height: 100px; }
    .b13 { height: 100px; }
    .b14 { height: 250px; }

    .b11 > div,
    .b12 > div,
    .b13,
    .b14 {
        flex-direction: column;
        align-items: stretch;
    }

    /* Полоса прокрутки на мобильных */
    .b11::-webkit-scrollbar,
    .b12::-webkit-scrollbar,
    .b13::-webkit-scrollbar,
    .b14::-webkit-scrollbar {
        width: 18px;
    }

    .b11::-webkit-scrollbar-thumb,
    .b12::-webkit-scrollbar-thumb,
    .b13::-webkit-scrollbar-thumb,
    .b14::-webkit-scrollbar-thumb {
        border: 4px solid rgba(246,236,210,0.8);
        border-radius: 10px;
    }
}