body {
    background-color: white;
    max-width: 1500px; 
    margin: 0 auto; 
}

html {
    overflow-y: scroll; 
}

a {
    cursor: pointer;
}

.site-header {
    width: 100%;
    height: 100px;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header-logo {
    width: fit-content;
    height: 100%;
    padding-left: 60px;
    display: flex;
    flex-direction: row;
}

.site-header-logo img {
    max-height: 57.6px;
    width: auto;
    align-self: center;
}

.site-header-logo p {
    list-style: none;
    padding-left: 10px;
    align-self: center;
    font-family: 'Railway', sans-serif;
    font-weight: 500;
    color: black;
    font-size: 28px;
}

.site-header-nav {
    width: fit-content;
    height: auto;
    display: flex;
    align-items: center;
}

.site-header-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    height: auto;
}

.site-header-nav ul li {
    display: inline-block;
    position: relative; /* needed for dropdown */
}

.site-header-nav ul li a {
    list-style: none;
    padding: 8px 16px;
    display: inline-block;
    font-family: 'Railway', sans-serif;
    font-weight: 500;
    color: black;
    line-height: 70px;
    font-size: 28px;
    text-decoration: none;
}

/* Responsive header */
@media only screen and (max-width: 1055px) {
    .site-header-empty {
        display: none;
    }
}

@media only screen and (max-width: 900px) {
    .site-header {
        flex-direction: column;
        height: auto;
        align-items: center; 
        text-align: center;
    }

    .site-header-logo {
        padding: 20px 0 10px 0;
    }
    
    .site-header-logo img {
        max-height: 21.6px;
    }

    .site-header-logo p {
        font-size: 14px;
    }

    .site-header-nav {
        padding: 10px 0; 
    }

    .site-header-nav ul li a {
        padding: 0 10px;
        line-height: 50px;
        font-size: 14px;
    }

    .site-header-empty {
        display: none;
    }
}

/* Dropdown menu */
li.dropdown:hover .dropdown-content,
.dropdown-content:hover {
    display: block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 350px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    padding: 8px 12px;
    font-size: 14px;
    white-space: nowrap;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.dropdown-content p {
    margin: 0;
    padding: 4px 0;
}

.dropdown-content a {
    display: block;
    color: black;
    text-decoration: none;
}

.dropdown-content a:hover {
    color: orange;
    cursor: pointer;
}


/* MAIN content */
main {
    margin: 80px 5%;
    font-family: 'Raleway', sans-serif;
    font-size: 20px;    
}

main ul a {
    color: orange;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    transition: background-color 0.3s;
}

main ul a:hover {
    background-color: orange; 
    color: white; 
}

main ul {
    list-style: circle;
    list-style-position: outside;
    padding-left: 50px;
}

/* Grid layouts for gallery */
.main-gallery-grid,
.main-gallery-grid-one-row,
.main-gallery-grid-two-rows,
.main-gallery-grid-three-rows,
.main-gallery-grid-four-rows
 {
    display: grid;
    align-items: center;
    justify-content: center;
}

.main-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 0px 60px;
}

.main-gallery-grid-one-row {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
    gap: 0px 60px;
}

.main-gallery-grid-two-rows {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0px 60px;
}

.main-gallery-grid-three-rows {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 40px 60px;
}

.main-gallery-grid-four-rows {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 40px 60px;
}

.grid-item {
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.grid-item-img {
    padding: 0 40px;
    object-fit: contain;
    display: block;
    width: 100%;
    height: 700px;
    transition: opacity 0.1s;
}

.grid-item:hover .grid-item-img {
    opacity: 0.2;
}

.overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    transition: opacity 0.1s;
    background-color: transparent;
}

.grid-item:hover .overlay {
    opacity: 1;
}

.overlay-text {
    color: black;
    font-size: 24px;
    font-weight: 500;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

h1 {
    text-align: center;
    margin: 0 0 40px 0;
    font-size: 24px;
    font-weight: 500;
    font-family: 'Raleway', sans-serif;
    color: black;
}

.contact-links {
    color: orange;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    transition: background-color 0.3s;
}

.contact-links:hover {
    background-color: orange; 
    color: white; 
}

/* Table styling */
.main-table {
    border-collapse: collapse;
    width: 100%;
}
  
.main-table td, .main-table th {
    padding: 8px;
}
  
.main-table tr:nth-child(even){background-color: #f2f2f2;}
.main-table tr:hover {background-color: orange;}
.main-table-header {
    padding-top: 12px;
    padding-bottom: 12px;
    text-align: left;
    background-color: transparent;
    color: black;
    font-weight: 500; 

}

/* FOOTER */
.site-footer {
    width: 100%;
    padding: 30px 0;
    background-color: white;
    font-family: 'Railway', sans-serif;
    font-weight: 300;
    color: black;
}

.site-footer ul {
    list-style: none;
}

.wrapper-main {
    margin: 10px 5%;
}

.wrapper-main-flex {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.right-aligned-list {
    text-align: right;
}

.site-footer-copyright {
    margin: 10px 15%;
    font-size: 12px; 
    font-weight: 200;
}

@media only screen and (max-width: 768px) {
    .wrapper-main-flex {
        flex-direction: column; 
    }

    .right-aligned-list {
        text-align: left;
        margin-top: 10px;
    }
}

/* Responsive gallery grids */
@media only screen and (max-width: 900px) {
    .main-gallery-grid,
    .main-gallery-grid-one-row,
    .main-gallery-grid-two-rows,
    .main-gallery-grid-three-rows,
    .main-gallery-grid-four-rows {
        grid-template-columns: 1fr;
        gap: 10px 0;
    }

    .grid-item-img {
        padding: 0;
        object-fit: cover;
        height: 70vh;
    }
}


/* Buttons JS */
/* Кнопки навигации */
#prev-btn, #next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: white;
    background: rgba(0,0,0,0.3);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 8px;
    user-select: none;
    transition: background 0.3s, transform 0.2s;
    z-index: 1001;
}
#prev-btn { left: 30px; }
#next-btn { right: 30px; }
#prev-btn:hover, #next-btn:hover {
    background: rgba(0,0,0,0.6);
    transform: translateY(-50%) scale(1.2);
}
#gallery-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 50px;           
    color: white;              
    background: rgba(0,0,0,0.3); 
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 8px;
    user-select: none;
    transition: background 0.3s, transform 0.2s;
    z-index: 1001;
}
#gallery-close:hover {
    background: rgba(0,0,0,0.6);
    transform: scale(1.2);
}


/* Мини-галерея поверх изображения */
#thumbnails {
    position: absolute;
    bottom: 20px;         /* отступ от низа окна */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 1002;        /* выше изображения */
    pointer-events: auto; /* чтобы можно было кликать по миниатюрам */
}

#thumbnails img {
    width: 60px;
    height: 40px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
}

#thumbnails img:hover {
    opacity: 1;
}

#thumbnails img.active {
    border-color: orange;
    opacity: 1;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 180px;
    box-shadow: 0px 6px 10px rgba(0,0,0,0.15);
    border-radius: 6px;
    flex-direction: column;
    padding: 10px 5px;
    z-index: 1000;
}

/* Ссылки внутри меню */
.dropdown-content a {
    display: block;
    color: black;
    font-family: 'Railway', sans-serif;
    font-size: 16px !important;
    text-decoration: none;
    line-height: 30px !important;
    padding: 8px 5px !important;
    transition: color 0.3s;
}

/* Эффект при наведении */
.dropdown-content a:hover {
    color: orange;
}

/* Показываем меню при наведении */
.dropdown:hover .dropdown-content {
    display: flex;
}
