/* Базовый сброс, шрифты и плавная прокрутка */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
}

/* --- Стили для шапки (Header) --- */
.main-header {
    height: 90px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: transparent;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.main-header.scrolled {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4rem;
    height: 100%;
}

.logo img { height: 50px; }
.logo-dark { display: none; }
.logo-light { display: block; }
.main-header.scrolled .logo-dark { display: block; }
.main-header.scrolled .logo-light { display: none; }


.main-nav ul { list-style: none; display: flex; align-items: center; gap: 15px; }

.main-nav ul li a, .lang-switcher a {
    display: block;
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 5px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.main-header:not(.scrolled) .main-nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
}

.main-header.scrolled .main-nav ul li a,
.main-header.scrolled .lang-switcher a {
    color: #333;
}

.main-header.scrolled .main-nav ul li a:hover { 
    color: #007bff;
    background-color: #f0f0f0; 
}


.menu-toggle { display: none; background: none; border: none; cursor: pointer; }
.menu-toggle span { display: block; width: 25px; height: 3px; background-color: #fff; margin: 5px 0; transition: background-color 0.4s ease; }
.main-header.scrolled .menu-toggle span { background-color: #333; }

/* --- Главный экран --- */
.hero-container {
    display: flex;
    align-items: center; 
    height: 100vh;
    min-height: 600px;
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 0 4rem; 
}

.text-content {
    background-color: rgba(0, 53, 82, 0.85);
    max-width: 50%;
    padding: 3rem;
    border-left: 5px solid #00aaff;
    color: #fff;
}
.text-content h1 { font-size: 2.5rem; margin-bottom: 1.5rem; line-height: 1.3; }
.text-content p { font-size: 1rem; margin-bottom: 1rem; }

/* --- Секция с картой --- */
#map-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 20px;
    background-color: #ffffff;
}
#map-container { position: relative; width: 100%; max-width: 1000px; }
#map-background { display: block; width: 100%; height: auto; border-radius: 8px;  }
#interactive-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.building-group { cursor: pointer; }
.building-group polygon { fill: transparent; transition: fill 0.25s ease-in-out; }
.building-group:hover polygon { fill: rgba(0, 191, 255, 0.7); }
.building-group text { font-family: Arial, sans-serif; font-size: 34px; font-weight: bold; fill: #00dbff; text-anchor: middle; dominant-baseline: middle; pointer-events: none; text-shadow: 0 0 5px rgba(0,0,0,0.9); }

/* Стили LightGallery */
.lg-backdrop { background-color: rgba(0, 0, 0, 0.8) !important; }


/* ========================= СТИЛИ СЕКЦИИ КОНТАКТОВ ========================= */

#contacts-section {
    width: 100%;
    background-color: #ffffff;
    padding-top: 110px !important; 
    padding-bottom: 60px;
}

.contacts-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #003552;
    color: #fff;
    padding: 15px 4rem;
    margin-bottom: 30px; 
}
.contact-header-item { display: flex; align-items: center; gap: 15px; font-size: 1.1rem; font-weight: 500; }
.contacts-header a.contact-header-item { color: inherit; text-decoration: none; }
.contact-header-item i { font-size: 1.6rem; }

.contacts-layout-container {
    display: flex;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4rem;
    /* ИЗМЕНЕНИЕ: Выравниваем колонки по центру по вертикали */
    align-items: center; 
}

.contacts-column {
    flex: 1 1 33%;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.map-column {
    flex: 1 1 67%;
    min-height: 550px;
}

.map-column iframe {
    width: 100%;
    height: 550px;
    border: 0;
}

.contact-card { 
    text-align: center;
    border: none;
    padding: 0;
}

.contact-card .contact-photo { 
    width: 110px; 
    height: 110px; 
    border-radius: 50%; 
    object-fit: cover; 
    margin-bottom: 0.75rem; 
    margin-left: auto;
    margin-right: auto;
}

.contact-name { font-size: 1.1rem; font-weight: 700; color: #333; margin-bottom: 0.25rem; }
.contact-title { font-size: 0.75rem; font-weight: 500; color: #888; letter-spacing: 0.5px; margin-bottom: 0.75rem; text-transform: uppercase; }
.contact-email,
.contact-phone { display: block; text-decoration: none; color: #555; font-size: 0.9rem; margin-bottom: 0.25rem; }
.contact-email:hover,
.contact-phone:hover { color: #007bff; }


.contacts-footer { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; background-color: #003552; color: #fff; padding: 20px 4rem; margin-top: 30px; text-align: center; font-weight: 500; letter-spacing: 1px; }

/* ========================= СТИЛИ СТРАНИЦЫ НОВОСТЕЙ ========================= */

.news-page-container { padding-top: 120px; padding-bottom: 60px; background-color: #fff; }
.news-layout { display: flex; max-width: 1200px; margin: 0 auto; padding: 0 2rem; gap: 40px; }
.news-sidebar { flex: 0 0 300px; border-right: 1px solid #e0e0e0; padding-right: 30px; }
.news-sidebar h1 { font-size: 2rem; color: #333; margin-bottom: 2rem; }
.news-sidebar h2 { font-size: 1.2rem; color: #333; margin-top: 3rem; margin-bottom: 1.5rem; border-bottom: 2px solid #e0e0e0; padding-bottom: 10px; }
.news-sidebar nav ul { list-style: none; padding: 0; margin: 0; }
.news-sidebar nav li { margin-bottom: 1.2rem; }
.news-sidebar nav a { text-decoration: none; color: #555; font-weight: 500; line-height: 1.4; transition: color 0.3s ease; }
.news-sidebar nav a:hover { color: #007bff; }
.news-sidebar nav a.active-news { color: #333; font-weight: 700; }

.news-content { flex: 1; }
.breadcrumb { color: #888; margin-bottom: 2rem; font-size: 0.8rem; font-weight: 500; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.news-featured-image { width: 100%; height: auto; margin-bottom: 2rem; }
.news-content h2 { font-size: 1.8rem; color: #333; line-height: 1.3; margin-bottom: 1rem; }
.news-date { color: #888; font-weight: 500; margin-bottom: 2rem; }
.news-body p { color: #333; line-height: 1.7; margin-bottom: 1.5rem; }


/* ========================= СТИЛИ АДМИН-ПАНЕЛИ ========================= */
.login-container, .admin-panel-container { padding-top: 150px; padding-bottom: 60px; display: flex; justify-content: center; align-items: flex-start; min-height: 80vh; background-color: #f4f4f4; }
.login-form, .admin-panel-container { background-color: #fff; padding: 2rem 3rem; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); width: 100%; max-width: 450px; }
.login-form h2 { text-align: center; margin-bottom: 1.5rem; color: #333; }
.login-form p { text-align: center; margin-bottom: 1.5rem; color: #666; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: #555; }
.form-group input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 1rem; }
.login-form button { width: 100%; padding: 15px; background-color: #003552; color: #fff; border: none; border-radius: 5px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background-color 0.3s ease; }
.login-form button:hover { background-color: #004a74; }
.error-message { color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; padding: 10px; border-radius: 5px; text-align: center; margin-bottom: 1rem; }
.success-message { color: #155724; background-color: #d4edda; border-color: #c3e6cb; padding: .75rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: .25rem; }
.back-link { display: block; text-align: center; margin-top: 1rem; color: #007bff; text-decoration: none; }


.admin-content-wide { padding-top: 120px; padding-bottom: 60px; max-width: 1200px; margin: 0 auto; padding-left: 2rem; padding-right: 2rem; }
.admin-content-wide h1 { margin-bottom: 0.5rem; font-size: 2rem; }
.admin-content-wide h1 strong { color: #007bff; }
.admin-content-wide h3 { margin-top: 2.5rem; margin-bottom: 1rem; border-bottom: 1px solid #dee2e6; padding-bottom: 0.5rem; }


.upload-form { background-color: #f8f9fa; padding: 1.5rem; border: 1px solid #dee2e6; border-radius: 5px; margin: 2rem 0; }
.upload-form button { background-color: #003552; color: #fff; border: none; border-radius: 5px; padding: 10px 20px; font-size: 1rem; cursor: pointer; transition: background-color 0.3s ease; }
.upload-form button:hover { background-color: #004a74; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-top: 1rem; }
.gallery-item { position: relative; border: 1px solid #ddd; border-radius: 5px; overflow: hidden; background-color: #f8f8f8; }
.gallery-item img { display: block; width: 100%; height: 120px; object-fit: cover; }
.gallery-item .delete-button { position: absolute; top: 5px; right: 5px; background-color: rgba(217, 48, 37, 0.85); color: white; text-decoration: none; padding: 3px 8px; border-radius: 3px; font-size: 12px; font-weight: 500; opacity: 0; transition: opacity 0.2s ease-in-out; }
.gallery-item:hover .delete-button { opacity: 1; }

.admin-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.add-new-button { background-color: #28a745; color: white; padding: 10px 20px; text-decoration: none; border-radius: 5px; font-weight: 500; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 12px; border: 1px solid #ddd; text-align: left; }
.admin-table th { background-color: #f8f9fa; }
.admin-table .actions a { margin-right: 10px; text-decoration: none; font-weight: 500; }
.admin-table .edit-link { color: #007bff; }
.admin-table .delete-link { color: #dc3545; }
.admin-form { background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.admin-form hr { border: 0; border-top: 1px solid #eee; margin: 2rem 0; }
.admin-form fieldset { border: 1px solid #ddd; padding: 1rem; border-radius: 5px; margin-bottom: 1.5rem; }
.admin-form legend { padding: 0 0.5rem; font-weight: 500; color: #555; }


/* --- Режим редактирования --- */
.editable-block { position: relative; }
.edit-button { position: absolute; top: 50%; right: 0; transform: translateY(-50%); background-color: #007bff; color: white !important; text-decoration: none; padding: 5px 15px; font-size: 14px; font-weight: 500; border-radius: 5px; opacity: 0; transition: opacity 0.3s ease; z-index: 10; }
.editable-block:hover .edit-button { opacity: 1; }
.contacts-footer .edit-button { padding: 3px 10px; font-size: 12px; right: 15px; }

.editable-contact { display: flex; flex-direction: column; align-items: center; position: relative; padding-bottom: 50px; }
.editable-block-photo { position: relative; margin-bottom: 1rem; }
.edit-button-photo { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); background-color: rgba(0, 0, 0, 0.6); color: white !important; text-decoration: none; padding: 3px 10px; font-size: 12px; border-radius: 5px; opacity: 0; transition: opacity 0.3s ease; z-index: 10; width: max-content; }
.editable-block-photo:hover .edit-button-photo { opacity: 1; }
.edit-button-contact { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background-color: #007bff; color: white !important; text-decoration: none; padding: 5px 15px; font-size: 14px; border-radius: 5px; opacity: 0; transition: opacity 0.3s ease; z-index: 10; }
.editable-contact:hover .edit-button-contact { opacity: 1; }

.main-nav .editable-block { padding: 8px 16px; }
.nav-edit { display: flex; align-items: center; gap: 5px; }
.nav-edit .edit-button { position: static; transform: none; padding: 2px 6px; font-size: 10px; opacity: 0.6; }
.nav-edit:hover .edit-button { opacity: 1; }
.main-nav .editable-block a[data-key] { padding: 0 !important; display: inline; }
.edit-bg-button { position: absolute; top: 100px; right: 20px; z-index: 10; background-color: #007bff; color: white; padding: 8px 16px; border-radius: 5px; text-decoration: none; font-weight: 500; opacity: 0.7; transition: opacity 0.3s ease; }
.edit-bg-button:hover { opacity: 1; }

.header-right-controls { display: flex; align-items: center; gap: 20px; }
.main-nav .news-admin-button { background-color: #28a745; color: #fff !important; }
.main-nav .news-admin-button:hover { background-color: #218838; color: #fff !important; }
.main-nav .logout-button { background-color: #dc3545; color: #fff !important; }
.main-nav .logout-button:hover { background-color: #c82333; color: #fff !important; }

/* ========================= СТИЛИ ШАПКИ ДЛЯ ВНУТРЕННИХ СТРАНИЦ ========================= */
.page-with-solid-header .main-header {
    background-color: #003552;
    box-shadow: none;
}
.page-with-solid-header .main-header.scrolled {
    background-color: #003552;
}

/* ========================= Адаптивность ========================= */

@media (max-width: 1024px) {
    .header-content { padding: 0 2rem; }
    .main-nav { display: none; }
    .menu-toggle { display: block; }
    .main-nav.active { display: flex; position: fixed; top: 90px; left: 0; right: 0; background-color: #ffffff; flex-direction: column; align-items: center; padding: 1rem 0; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
    .main-nav.active ul { flex-direction: column; width: 100%; gap: 0; }
    .main-nav.active ul li { margin: 0; width: 100%; text-align: center; }
    .main-nav.active ul li a { padding: 1rem 0; display: block; width: 100%; color: #333; }
    .hero-container { padding: 0 2rem; }
    .text-content { max-width: 70%; padding: 2rem; }
    .text-content h1 { font-size: 2rem; }
    
    .contacts-layout-container { flex-direction: column; padding: 0 2rem; }
    .contacts-column { flex-direction: row; justify-content: space-around; }
    
    .contacts-header, .contacts-footer { padding-left: 2rem; padding-right: 2rem; }
    .news-layout { flex-direction: column; }
    .news-sidebar { flex: 0 0 auto; border-right: none; padding-right: 0; margin-bottom: 40px; border-bottom: 1px solid #e0e0e0; padding-bottom: 20px; }
}

@media (max-width: 768px) {
    .main-header { height: 70px; }
    .main-nav.active { top: 70px; }
    #contacts-section { padding-top: 90px !important; }
    #map-section { padding: 60px 20px; }
    .hero-container { align-items: flex-end; padding-bottom: 4rem; }
    .text-content { max-width: 100%; }
    
    .contacts-column { flex-direction: column; align-items: center; }

    .contacts-footer { grid-template-columns: 1fr; gap: 15px; padding-top: 30px; padding-bottom: 30px; }
    .contacts-header { flex-direction: column; gap: 15px; padding-top: 25px; padding-bottom: 25px; }
}