/* --- ШРИФТЫ --- */
@font-face {
    font-family: 'Minimax';
    src: url('/font/AeroportMono.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'HomeVideo';
    src: url('/font/HomeVideo-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* --- Общие стили и сбросы --- */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'HomeVideo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    color: #111111;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }

/* --- Хедер и Навигация --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: transparent;
    padding: 25px 40px;
    box-sizing: border-box;
}
body {
    padding-top: 90px;
}

.main-nav {
    display: flex;
    align-items: center;
    width: 100%;
}
.nav-logo {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1em;
}
.nav-links {
    display: flex;
    margin-left: 20vw;
}
.nav-links > li {
    margin-left: 35px;
    position: relative;
    font-weight: normal;
    text-transform: none;
    font-size: 1em;
}
.nav-links > li:first-child {
    margin-left: 0;
}
.nav-links > li > a:hover,
.main-nav .dropdown-content li a:hover {
    color: #888888;
}

/* Выпадающие списки для "Съемки" */
.main-nav .dropdown .dropdown-content {
    position: absolute;
    background-color: transparent;
    color: #111111;
    min-width: 180px;
    z-index: 10;
    padding: 5px 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out, visibility 0s linear 0.2s;
}

.main-nav .dropdown .dropdown-content.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.main-nav .dropdown .dropdown-content.year-dropdown {
    top: 100%;
    left: 0;
}

.main-nav .dropdown-submenu {
    position: relative;
}

.main-nav .dropdown-content.location-dropdown {
    position: absolute;
    top: 0;
    left: 180px; /* Смещение для выравнивания под годом */
    background-color: transparent;
    color: #111111;
    min-width: 180px;
    z-index: 10;
    padding: 0px 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out, visibility 0s linear 0.2s;
}

.main-nav .dropdown-content.location-dropdown.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.main-nav .dropdown .dropdown-content li a {
    padding: 8px 15px;
    display: block;
    white-space: nowrap;
    font-size: 0.9em;
    color: #111111;
    background-color: transparent;
    transition: background-color 0.2s, color 0.2s;
}
.main-nav .dropdown .dropdown-content li a:hover {
    background-color: rgba(28, 28, 28, 0.9);
    color: #ffffff;
}

.main-nav .dropdown:hover > .dropdown-content.year-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.main-nav .dropdown-submenu .arrow {
    font-size: 0.8em;
    margin-left: 6px;
    display: inline-block;
}

/* --- Текст-заглушка на главной --- */
.intro-placeholder {
    padding: 40px 40px 70px 40px;
    max-width: 1600px;
    margin: 0 auto;
}
.intro-placeholder h2 {
    font-family: 'Minimax', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 3.2em;
    font-weight: bold;
    line-height: 1.15;
    margin: 0 0 5px 0;
    color: #111111;
    margin-left: calc(20vw - 40px);
    max-width: 80%;
}

/* --- Сетка альбомов на главной (portfolio-grid) --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    padding: 0 40px 40px 40px;
    max-width: 1600px;
    margin: 0 auto;
}
.album-card {
    background-color: transparent;
    text-align: left;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.portfolio-grid .album-card:nth-child(1) { animation-delay: 0.1s; }
.portfolio-grid .album-card:nth-child(2) { animation-delay: 0.2s; }
.portfolio-grid .album-card:nth-child(3) { animation-delay: 0.3s; }
.portfolio-grid .album-card:nth-child(4) { animation-delay: 0.4s; }
.portfolio-grid .album-card:nth-child(5) { animation-delay: 0.5s; }
.portfolio-grid .album-card:nth-child(6) { animation-delay: 0.6s; }
.portfolio-grid .album-card:nth-child(7) { animation-delay: 0.7s; }
.portfolio-grid .album-card:nth-child(8) { animation-delay: 0.8s; }
.album-card a {
    display: block;
}
.album-card img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    margin-bottom: 8px;
}
.album-card:hover img {
    transform: scale(1.03);
}
.album-card p {
    font-family: 'HomeVideo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    font-size: 0.85em;
    font-weight: normal;
    background-color: transparent;
    color: #333;
    line-height: 1.3;
}

/* --- Стили для страницы альбома (album.php) --- */
.album-container {
    padding: 20px 40px;
    max-width: 1600px;
    margin: 0 auto;
}
.album-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.2em;
    font-weight: bold;
    margin-left: calc(20vw - 40px);
    max-width: 60%;
    text-align: left;
}
.album-description {
    font-family: 'HomeVideo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0 0 40px calc(20vw - 40px);
    max-width: 60%;
    font-size: 1em;
    color: #555;
    line-height: 1.5;
}
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}
.photo-grid .photo-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    background-color: #efefef;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}
.photo-grid .photo-item:nth-child(1) { animation-delay: 0.1s; }
.photo-grid .photo-item:nth-child(2) { animation-delay: 0.2s; }
.photo-grid .photo-item:nth-child(3) { animation-delay: 0.3s; }
.photo-grid .photo-item:nth-child(4) { animation-delay: 0.4s; }
.photo-grid .photo-item:nth-child(5) { animation-delay: 0.5s; }
.photo-grid .photo-item:nth-child(6) { animation-delay: 0.6s; }
.photo-grid .photo-item:nth-child(7) { animation-delay: 0.7s; }
.photo-grid .photo-item:nth-child(8) { animation-delay: 0.8s; }
.photo-grid img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    box-sizing: border-box;
    transition: opacity 0.3s;
}
.photo-grid img:hover {
    opacity: 0.7;
}

/* Лайтбокс (общий для album.php) */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow: hidden;
    background-color: #000000;
    justify-content: center;
    align-items: center;
}
.lightbox-content-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%; height: 100%;
}
.lightbox-content {
    display: block;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    margin: 0;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    z-index: 1001;
    padding: 10px;
    background-color: rgba(30,30,30,0.5);
    border-radius:3px;
    transition: background-color 0.2s;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(50,50,50,0.8);
}
.lightbox-close { top: 15px; right: 25px; line-height: 20px; }
.lightbox-prev { top: 50%; left: 15px; transform: translateY(-50%); }
.lightbox-next { top: 50%; right: 15px; transform: translateY(-50%); }

/* --- Подвал (общий) --- */
footer {
    font-family: 'HomeVideo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 30px 40px;
    font-size: 0.85em;
    color: #555;
    margin-top: 30px;
    text-align: left;
}

/* --- Стили для Попапа Контактов --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    border-radius: 5px;
    position: relative;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.2s ease-out;
}
.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.close-modal-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.close-modal-btn:hover,
.close-modal-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content h2 {
    margin-top: 0;
    font-family: 'Minimax', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.modal-content p a {
    color: #007bff;
    text-decoration: underline;
}
.modal-content p a:hover {
    color: #0056b3;
}

/* --- Адаптивность --- */
@media (max-width: 1200px) {
    .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
    .intro-placeholder h2 { font-size: 2.8em; max-width: 70%; margin-left: calc(15vw - 40px); }
    .nav-links { margin-left: 15vw; }
    .album-title { margin-left: calc(15vw - 40px); max-width: 70%; }
    .album-description { margin-left: calc(15vw - 40px); max-width: 70%; }
}
@media (max-width: 900px) {
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
    header, .intro-placeholder, .portfolio-grid, footer, .album-container { padding-left: 25px; padding-right: 25px; }
    body { padding-top: 75px; }
    .nav-links { margin-left: 10vw; }
    .nav-links > li { margin-left: 25px; font-size: 0.9em; }
    .intro-placeholder h2 { font-size: 2.3em; max-width: 80%; margin-left: calc(10vw - 25px); }
    .album-title { font-size: 1.8em; margin-left: calc(10vw - 25px); max-width: 80%; }
    .album-description { margin-left: calc(10vw - 25px); max-width: 80%; }
}
@media (max-width: 600px) {
    .portfolio-grid { grid-template-columns: repeat(1, 1fr); gap: 30px; }
    header, .intro-placeholder, .portfolio-grid, footer, .album-container { padding-left: 20px; padding-right: 20px; }
    body { padding-top: 70px; }
    .main-nav { flex-wrap: wrap; }
    .nav-logo { width: 100%; text-align: center; margin-bottom: 10px; }
    .nav-links { width: 100%; display: flex; flex-direction: column; align-items: center; }
    .nav-links > li { margin: 10px 0; font-size: 1em; }
    .main-nav .dropdown .dropdown-content { position: static; background-color: #f8f8f8; }
    .main-nav .dropdown-content.location-dropdown { position: static; left: 0; padding-left: 20px; }
    .intro-placeholder h2 { font-size: 1.8em; max-width: 95%; margin-left: 0; text-align: center; }
    .album-card img { aspect-ratio: 4 / 3; }
    .album-title { font-size: 1.5em; margin-left: 0; text-align: center; max-width: 95%; }
    .album-description { margin-left: 0; text-align: center; max-width: 95%; }
}
