@import url('https://fonts.googleapis.com/css2?family=Cuprum:ital,wght@0,400..700;1,400..700&display=swap');

/* ==========================================================================
   1. ГЛОБАЛНИ НАСТРОЙКИ
   ========================================================================== */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Cuprum", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #e8f3fa; 
    color: #fff;
}

.btn {
    display: inline-block;
    background: rgba(0,0,0,0.1);
    color: #333;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid rgba(0,0,0,0.2);
    transition: 0.3s;
    margin-bottom: 20px;
}
.btn:hover { background: rgba(0,0,0,0.2); border-color: #000; }

/* ==========================================================================
   2. СЪСТОЯНИЯ
   ========================================================================== */
body.state-home {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

body.state-album_info, 
body.state-albums_list {
    background: #e8f3fa; 
    color: #333;
    min-height: 100vh;
    display: block;
    height: auto;
    overflow-y: auto;
}

body.state-viewer {
    height: 100vh;
    overflow: hidden;
    background: #000; 
}

/* ==========================================================================
   3. ХЕДЪРИ И НАВИГАЦИЯ
   ========================================================================== */
.top-logo-bar {
    width: 100%;
    padding: 10px 0 20px 0;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box; 
}

.state-viewer .top-logo-bar {
    position: absolute;
    top: 0;
    left: 0;
    padding: 15px 20px 20px 60px; 
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index: 100;
}
.state-viewer .top-logo-bar a { pointer-events: auto; }

.viewer-back-btn {
    display: block;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-family: "Cuprum", sans-serif;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    margin: 0;
    pointer-events: auto;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.viewer-back-btn:hover { background: rgba(0, 0, 0, 0.8); border-color: #fff; }

.site-logo {
    max-height: 45px;
    width: auto;
    display: block;
    transition: transform 0.2s ease;
}

.gh-logo-link:hover .site-logo { transform: scale(1.05); }

.album-nav-title-row {
    position: relative;
    width: 100%;
    margin: 0 auto 40px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 46px; 
}

.nav-cell.left-cell { position: absolute; left: 0; top: 0; z-index: 10; }
.nav-cell.right-cell { position: absolute; right: 0; top: 0; z-index: 10; }

.title-cell {
    text-align: center;
    padding: 0 100px;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.title-cell h1, .section-title-wrapper h1 {
    display: inline-block;
    margin: 0;
    font-family: "Cuprum", sans-serif;
    font-weight: 700;
    font-size: 38px;
    letter-spacing: -0.8px;
    border-bottom: none !important; /* МАХНАТА ЧЕРТА */
    padding-bottom: 8px;
    line-height: 1;
    color: #444;
}

.album-desc {
    font-size: 1.15em; 
    line-height: 1.6; 
    color: #444; 
    max-width: 700px; 
    width: 100%; 
    margin: 15px auto 0 auto;
    text-align: center;
}

.section-title-wrapper { text-align: center; margin-bottom: 40px; }

.gh-right { display: flex; align-items: center; justify-content: flex-end; }

.mail-link {
    text-decoration: none;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    margin-right: 5px;
}

.mail-icon { font-size: 2.2rem; color: #888; transition: color 0.3s ease; }
.mail-link:hover .mail-icon { color: #000; }
.state-home .mail-icon, .state-viewer .mail-icon { color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.mail-link:hover { transform: scale(1.1); opacity: 0.8; }

/* ==========================================================================
   4. КОНТЕЙНЕРИ И МРЕЖИ (GRIDS)
   ========================================================================== */
.home-container, .album-container {
    max-width: 100% !important;
    width: 100%;
    padding: 20px 3%;
    box-sizing: border-box;
}

.folders-grid, .panos-grid {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 20px;
    width: 100%;
}

/* ФИКС ЗА ГАЛЕРИЯТА - СПИРА РАЗТЯГАНЕТО */
.gallery-photo-grid {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center; 
    align-items: flex-start !important; /* Важно: държи ги подредени горе, без да ги разпъва */
    gap: 20px;
    width: 100%;
}

.state-albums_list .folders-grid {
    gap: 100px 40px !important; /* ВЪЗДУХ МЕЖДУ РЕДОВЕТЕ */
    padding-top: 40px;
}

/* ==========================================================================
   5. КАРТИ И СНИМКИ (АЛБУМИ, ПАНОРАМИ, ГАЛЕРИЯ)
   ========================================================================== */
.folder-wrapper { text-align: center; width: 280px; flex-shrink: 0; }

.folder-title {
    margin: 0 0 30px 0 !important; /* ВЪЗДУХ ПОД ИМЕТО */
    font-size: 1.3em;
    font-weight: 600; 
    border-bottom: none !important; 
    display: block;
    color: #444; 
    text-decoration: none;
}

.folder-thumb {
    display: block;
    height: 220px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    transition: 0.4s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 3px solid #fff;
}

.folder-thumb:hover { transform: scale(1.05); border-color: #8cf; }

.pano-card { 
    display: block; 
    width: 280px;
    flex-shrink: 0; 
    aspect-ratio: 1 / 1; 
    border-radius: 4px; 
    overflow: hidden; 
    background-size: cover; 
    background-position: center; 
    transition: 0.3s; 
    border: 4px solid #fff; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pano-card:hover { border-color: #8cf; transform: scale(1.05); }

/* 2. КАРТАТА - Заковаваме я на 360px */
/* КОНТЕЙНЕРЪТ - Намаляваме разстоянието тук */
.gallery-photo-grid {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center
    align-items: flex-start !important;
    gap: 10px !important; /* ТУК контролираш разстоянието (беше 20px) */
    width: 100%;
    padding: 0;
	
}

/* КАРТАТА - Твърдо 260px */
.gallery-photo-card {
    display: block !important;
    height: 260px !important;
    width: auto !important;
    flex: 0 0 auto !important; /* Забранява на картата да расте или да се свива */
    border-radius: 3px;
    border: 3px solid #fff;
    overflow: hidden;
    margin: 0 !important; /* Махаме всякакви външни маргини */
}

.gallery-photo-card img {
    height: 260px !important;
    width: auto !important;
    display: block;
    object-fit: contain;
}

.gallery-photo-card:hover { border-color: #8cf; transform: scale(1.02); }

/* ОСТАНАЛИТЕ СЕКЦИИ (ГЛАВНИ, СТРЕЛКИ, ПЛЕЙЪР, МОБИЛНИ) */
.main-sections-wrapper { display: flex; justify-content: center; align-items: center; gap: 40px; margin-top: 10vh; flex-wrap: wrap; }
.main-card { display: block; width: 450px; height: 300px; border-radius: 3px; border: 3px solid #ffffff; background-size: cover; background-position: center; position: relative; text-decoration: none; transition: all 0.3s ease; overflow: hidden; }
.main-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 50%; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); }
.main-card:hover { border-color: #8cf; transform: scale(1.02); }
.main-card-title { position: absolute; bottom: 20px; left: 20px; z-index: 2; color: #fff; font-size: 2.2rem; font-weight: 700; font-family: "Cuprum", sans-serif; text-transform: uppercase; letter-spacing: 1px; }

.arrow-btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; padding: 10px 15px; overflow: hidden; transition: all 0.3s ease; min-height: 44px; box-sizing: border-box; border: 1px solid rgba(150, 150, 150, 0.4); background-color: transparent; text-decoration: none; color: inherit; white-space: nowrap; }
.arrow-btn:hover { background-color: #007bff; border-color: #007bff; color: #ffffff; }
.arrow-btn .arrow { font-weight: 900; font-size: 1.4rem; line-height: 1; display: inline-block; }
.arrow-btn .hover-text { display: inline-block; vertical-align: middle; max-width: 0; opacity: 0; white-space: nowrap; overflow: hidden; transition: max-width 0.4s ease, opacity 0.3s ease, margin 0.3s ease; }
.left-arrow:hover .hover-text { max-width: 250px; opacity: 1; margin-left: 10px; }
.right-arrow:hover .hover-text { max-width: 250px; opacity: 1; margin-right: 10px; }

#panorama { width: 100%; height: 100vh; }
.pnlm-ui { z-index: 110 !important; }
#gallery-strip { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0, 0, 0, 0.7); padding: 15px; display: flex; gap: 15px; overflow-x: auto; white-space: nowrap; z-index: 10; backdrop-filter: blur(5px); }
.strip-thumb { width: 120px; height: 65px; background-size: cover; background-position: center; border: 2px solid transparent; border-radius: 4px; cursor: pointer; opacity: 0.5; transition: 0.3s; flex-shrink: 0; }
.strip-thumb:hover, .strip-thumb.active { border-color: #fff; opacity: 1; }

@media (max-width: 768px) {
    .album-nav-title-row { flex-direction: row; justify-content: space-between; padding: 0; }
    .nav-cell.left-cell, .nav-cell.right-cell { position: relative; }
    .title-cell { padding: 0 10px; }
    .title-cell h1, .section-title-wrapper h1 { font-size: 26px; }
    .arrow-btn .hover-text { display: none !important; }
    .main-card { width: 100%; max-width: 400px; height: 220px; }
    .folder-wrapper, .pano-card { width: 100%; max-width: 350px; }
     
    .viewer-back-btn { max-width: 160px; font-size: 0.9rem; padding: 6px 10px; }
    .mail-icon { font-size: 2.8rem; }
    .mail-link { width: 50px; height: 50px; margin-right: 15px; }

	.gallery-photo-card {height: 260px !important; width: auto !important;   max-width: 100% !important; margin: 0 auto;  }
	.gallery-photo-card img {height: 100% !important;  	width: auto !important;	object-fit: contain; }
}