html {
    scroll-behavior: smooth;
}

:root {
    --bg-color: #f8f4ed; 
    --text-color: #313131; 
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
}

/* Блокування скролу для Лайтбоксу */
body.no-scroll {
    overflow: hidden;
}

/* --- Механіка вкладок (SPA) --- */
.page {
    display: none; 
    animation: fadeInPage 0.4s ease-in-out;
}

.page.active {
    display: block; 
}

@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Compact Header --- */
header {
    text-align: center;
    padding: 1rem 0 0.5rem; 
    background-color: var(--bg-color);
}

.logo a {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.logo a:hover {
    opacity: 0.8;
}

.logo img {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
}

nav {
    margin-top: 1rem; 
    margin-bottom: 0.5rem; 
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: opacity 0.3s ease;
}

nav a:hover, nav a.active {
    opacity: 0.5;
}

/* --- Main Content --- */
main {
    max-width: 100%;
    margin: 0 auto;
}

/* --- Галерея --- */
.gallery {
    column-count: 3;
    column-gap: 10px;
    padding: 0 1% 4rem; 
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 10px;
    cursor: pointer; 
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.3s ease;
}

.gallery-item:hover img {
    filter: brightness(0.8);
}

/* --- Сторінка Альбомів (Сітка) --- */
.albums-section {
    padding: 0 1% 6rem; 
    text-align: center;
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; 
    width: 100%;
    margin: 0 auto;
}

.album-card {
    position: relative;
    overflow: hidden; 
    cursor: pointer;
}

.album-card img {
    width: 100%;
    aspect-ratio: 3/2; 
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.album-card:hover img {
    transform: scale(1.03); 
    filter: brightness(0.7); 
}

.album-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem 1.5rem 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    color: #ffffff;
    text-align: left;
    transform: translateY(101%); 
    transition: transform 0.4s ease;
    pointer-events: none; 
}

.album-card:hover .album-info {
    transform: translateY(0); 
}

.album-info h3 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 0.3rem;
}

.album-info p {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}

/* --- СТОРІНКА ПЕРЕГЛЯДУ КОНКРЕТНОГО АЛЬБОМУ --- */
.album-view-section {
    padding: 2rem 1% 6rem;
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    margin-bottom: 3rem;
    margin-left: 1%;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.back-btn:hover {
    opacity: 0.5;
}

.album-header {
    text-align: center;
    margin-bottom: 4rem;
}

.album-header h2 {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 1rem;
}

.album-header p {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.7;
}

/* --- КОРОТКА СЕКЦІЯ КОНТАКТІВ (на Головній під галереєю) --- */
.contact {
    position: relative;
    /* Якщо потрібно змінити фонове фото, міняйте цей шлях: */
    background-image: url('../assets/bk1.jpg'); 
    background-size: cover;
    background-position: center;
    color: #ffffff; 
    text-align: center;
    padding: 6rem 2rem;
}

.contact-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.contact h5 {
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.contact h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 5vw, 2.5rem); /* плавно зменшується на мобільних */
    font-weight: 400;
    margin-bottom: 1.5rem;
    font-style: italic;
    word-break: break-word; /* надійний перенос, якщо пошта занадто довга */
}

.contact p {
    font-size: 0.9rem;
    font-weight: 300;
    margin-bottom: 3rem;
    line-height: 1.6;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- Оновлені поля вводу з ефектом "Матового скла" --- */
.contact-form input,
.contact-form textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.15); /* Легке затемнення */
    backdrop-filter: blur(8px); /* Розмиття фону */
    -webkit-backdrop-filter: blur(8px); /* Для підтримки Safari */
    border: 1px solid rgba(255, 255, 255, 0.5); 
    padding: 1.2rem;
    color: #ffffff; 
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.contact-form textarea {
    resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.7); 
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: #ffffff; 
    background: rgba(0, 0, 0, 0.3); /* При фокусі поле стає трохи темнішим */
}

.contact-form button {
    align-self: center;
    background: transparent;
    border: 1px solid #ffffff; 
    color: #ffffff; 
    padding: 1rem 4rem;
    border-radius: 50px;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    margin-top: 1rem;
}

.contact-form button:hover {
    background: #ffffff; 
    color: var(--text-color); 
}


/* --- РОЗШИРЕНА СЕКЦІЯ КОНТАКТІВ (Окрема сторінка) --- */
.contact-split {
    padding: 2rem 5% 6rem;
    background-color: var(--bg-color);
}

.contact-container {
    display: flex;
    gap: 5rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap; 
    align-items: flex-start;
}

.contact-about {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.contact-about h2 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    font-style: italic;
    letter-spacing: 2px;
}

.contact-about img {
    width: 100%;
    max-width: 400px; 
    height: auto;
    object-fit: cover;
    margin-bottom: 2rem;
}

.contact-about p {
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    font-weight: 300;
    text-align: justify; 
}

.contact-form-wrapper {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.contact-form-wrapper h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.contact-form-clean {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
}

.contact-form-clean input,
.contact-form-clean textarea {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(49, 49, 49, 0.3); 
    padding: 1.2rem 1.5rem;
    color: var(--text-color);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.3s ease;
    border-radius: 30px; 
}

.contact-form-clean textarea {
    border-radius: 20px; 
    resize: vertical;
}

.contact-form-clean input::placeholder,
.contact-form-clean textarea::placeholder {
    color: rgba(49, 49, 49, 0.6);
}

.contact-form-clean input:focus,
.contact-form-clean textarea:focus {
    border-color: var(--text-color);
}

.contact-form-clean button {
    align-self: flex-start; 
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 1rem 3rem;
    border-radius: 50px;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    margin-top: 1rem;
    width: 100%; 
}

.contact-form-clean button:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

/* --- Футер з іконками --- */
footer {
    background-color: var(--bg-color);
    padding: 3rem 1% 2rem;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-icon {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.social-icon:hover {
    opacity: 0.5;
}

.social-icon svg {
    fill: var(--text-color); 
    width: 24px;  
    height: 24px; 
}

/* --- Лайтбокс --- */
.lightbox-modal {
    display: none; 
    position: fixed;
    z-index: 9999; 
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center; 
    align-items: center; 
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain; 
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    user-select: none;
}

.lightbox-btn {
    position: absolute;
    background: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 3rem;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    z-index: 10000;
}

.lightbox-btn:hover {
    opacity: 1;
}

.close-button {
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
}

.prev-button {
    left: 20px;
}

.next-button {
    right: 20px;
}

@keyframes fadeInLightbox {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-modal[style*="display: flex"] {
    animation: fadeInLightbox 0.3s ease-out;
}

/* --- Адаптивність (Оптимізація для мобільних) --- */
@media (max-width: 900px) {
    .gallery {
        column-count: 2;
    }
    .albums-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
    .contact-container {
        gap: 3rem;
        flex-direction: column; 
        align-items: center; 
    }
    .contact-about, .contact-form-wrapper {
        width: 100%;
        max-width: 500px; 
        margin: 0 auto;
    }
    .contact-form-wrapper h2 {
        text-align: center; 
    }
}

@media (max-width: 600px) {
    .gallery {
        column-count: 1;
    }
    .albums-grid {
        grid-template-columns: 1fr; 
    }
    nav ul {
        gap: 1rem;
    }
    .lightbox-btn {
        font-size: 2rem;
        width: 40px;
        height: 40px;
    }
    .close-button {
        top: 10px;
        right: 10px;
    }
    .album-header h2 {
        font-size: 2rem;
    }
}