/* ============================================================
   style.css – ПОЛНЫЙ ФАЙЛ (исправлены кнопки и тексты)
   ============================================================ */

/* ========== ОБЩИЕ ПЕРЕМЕННЫЕ ========== */
:root {
    --primary: #1a2f40;
    --gold: #c9aa5f;
    --bg: #f9f6ef;
    --text: #2c2a24;
    --card-bg: #ffffff;
    --border: #e8ddd0;
    --shadow: rgba(0,0,0,0.05);
    --font: 'Georgia', 'Times New Roman', 'Palatino', serif;
}

/* ========== СБРОС ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
    height: auto;
}

/* ========== БАННЕР ========== */
.eparchy-banner {
    background: #1a1a1a;
    padding: 0.8rem 1rem;
    border-bottom: 2px solid var(--gold);
    text-align: center;
}

.banner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.banner-logo-img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 80px;
    width: auto;
    flex-shrink: 0;
}

.banner-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.banner-main {
    font-family: 'Cormorant Uncial', 'Georgia', serif;
    font-size: 2.2rem;
    color: #f2e5c6;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    letter-spacing: 1px;
    font-weight: bold;
}

.banner-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.6rem;
    justify-content: center;
}

.banner-sub-item {
    font-family: 'Cormorant Uncial', 'Georgia', serif;
    font-size: 1rem;
    color: #f2e5c6;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.banner-sub-item:not(:last-child)::after {
    content: "·";
    margin-left: 0.6rem;
    color: var(--gold);
    opacity: 0.6;
}

@media (max-width: 700px) {
    .banner-container {
        flex-direction: column;
        gap: 0.3rem;
    }
    .banner-logo-img {
        max-height: 60px;
    }
    .banner-main {
        font-size: 1.8rem;
    }
    .banner-sub-item {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .banner-logo-img {
        max-height: 50px;
    }
    .banner-main {
        font-size: 1.5rem;
    }
    .banner-sub-item {
        font-size: 0.75rem;
    }
}

/* ========== ШАПКА ========== */
.header {
    background: #1a1a1a;
    padding: 0.5rem 0;
    min-height: 10px;
    border-bottom: 4px solid var(--gold);
    cursor: pointer;
}

/* ========== НАВИГАЦИЯ ========== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 0.4rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 99;
}

.top-bar nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.top-bar nav a.nav-link {
    background: none;
    border: none;
    font-size: 0.95rem;
    padding: 0.3rem 0.8rem;
    border-radius: 40px;
    cursor: pointer;
    font-family: inherit;
    color: #5e4b3a;
    font-weight: 500;
    transition: 0.2s;
    white-space: nowrap;
}

.top-bar nav a.nav-link.active {
    background: var(--gold);
    color: white;
}

.top-bar nav a.nav-link:hover:not(.active) {
    background: #f3ede3;
    color: #ac8e54;
}

.menu-toggle {
    display: none;
}

.menu-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.menu-modal.visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.menu-modal-content {
    background: var(--card-bg, #ffffff);
    width: 95%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 32px;
    padding: 1.5rem 1.5rem 2rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    pointer-events: auto;
}

.menu-modal.visible .menu-modal-content {
    transform: scale(1);
}

.menu-modal-close {
    position: sticky;
    top: 0;
    float: right;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    z-index: 10;
    padding: 0 0.5rem;
    pointer-events: auto;
}

.menu-modal-content a[data-page] {
    display: block;
    padding: 0.7rem 1rem;
    background: var(--bg, #f9f6ef);
    border-radius: 16px;
    text-align: center;
    font-size: 1.1rem;
    font-family: var(--font, Georgia, serif);
    color: var(--text, #2c2a24);
    text-decoration: none;
    border: 1px solid var(--border, #e8ddd0);
    transition: background 0.2s, transform 0.2s;
    pointer-events: auto;
}

.menu-modal-content a[data-page]:hover {
    background: var(--gold, #c9aa5f);
    color: white;
}

@media (max-width: 768px) {
    .top-bar nav .nav-link {
        display: none;
    }
    .menu-toggle {
        display: inline-flex !important;
        background: var(--gold);
        color: white;
        border: none;
        padding: 0.4rem 1rem;
        border-radius: 40px;
        font-family: inherit;
        font-size: 0.95rem;
        cursor: pointer;
        align-items: center;
        justify-content: center;
    }
    .top-bar nav {
        flex-wrap: wrap;
        justify-content: flex-end;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 0.2rem 0.5rem;
        gap: 0.3rem;
    }
    .top-bar nav a.nav-link {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
        white-space: normal;
        line-height: 1.2;
    }
    .top-bar nav {
        gap: 0.3rem;
    }
    .menu-toggle {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
}

/* ========== ПАНЕЛЬ ИНСТРУМЕНТОВ ========== */
.top-bar .tools {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.top-bar .tools button,
.top-bar .tools a {
    background: none;
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    font-size: 0.8rem;
    background: var(--card-bg);
    color: var(--text);
}

.top-bar .tools a.eparchy-link {
    font-size: 1.2rem;
    line-height: 1;
    padding: 0.1rem 0.4rem;
    border-color: var(--gold);
    color: var(--gold);
}

@media (max-width: 480px) {
    .top-bar .tools {
        gap: 0.3rem;
    }
    .top-bar .tools button,
    .top-bar .tools a {
        font-size: 0.7rem;
        padding: 0.1rem 0.4rem;
    }
}

/* ========== КНОПКА ДЛЯ СЛАБОВИДЯЩИХ ========== */
#visionToggle {
    font-size: 1.2rem;
    padding: 0.5rem 1.2rem;
    background: var(--gold);
    color: #fff;
    border: 2px solid var(--gold);
    border-radius: 40px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    white-space: nowrap;
}

#visionToggle:hover {
    background: #b89a4a;
    border-color: #b89a4a;
}

@media (max-width: 480px) {
    #visionToggle {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
        border-width: 1px;
        box-shadow: none;
        white-space: normal;
        line-height: 1.2;
    }
}

/* ========== ВЫПАДАЮЩЕЕ МЕНЮ ========== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 16px;
    padding: 0.5rem 0;
    z-index: 100;
    border: 1px solid var(--border);
    max-height: 60vh;
    overflow-y: auto;
}

.dropdown:hover .dropdown-content,
.dropdown-content.show {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 0.4rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    border-bottom: 1px solid #f3ede3;
}

.dropdown-content a:hover {
    background: var(--gold);
    color: white;
}

@media (max-width: 480px) {
    .dropdown-content {
        min-width: 160px;
        right: 0;
        left: auto;
        font-size: 0.8rem;
    }
    .dropdown-content a {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* ========== КОНТЕЙНЕР ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

@media (max-width: 480px) {
    .container {
        padding: 0.8rem 0.5rem;
    }
}

/* ========== КАРТОЧКИ ========== */
.card {
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 6px 14px var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

@media (max-width: 480px) {
    .card {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
        border-radius: 16px;
    }
}

.card h2 {
    color: var(--primary);
    border-left: 5px solid var(--gold);
    padding-left: 1rem;
    margin-bottom: 1rem;
    font-size: 1.6rem;
}

.card h2::before {
    content: "☦ ";
}

@media (max-width: 480px) {
    .card h2 {
        font-size: 1.2rem;
        padding-left: 0.7rem;
        margin-bottom: 0.7rem;
    }
}

/* ========== ГАЛЕРЕЯ ========== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 700px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
}

.grid-item {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 12px var(--shadow);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border);
}

.grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px var(--shadow);
}

.grid-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #e9e1d4;
}

@media (max-width: 480px) {
    .grid-item img {
        height: 180px;
    }
}

.grid-item .info {
    padding: 1rem;
    text-align: center;
}

.grid-item .info h3 {
    font-size: 1rem;
}

.grid-item .info .status.vacant {
    color: #b45a3b;
}

/* ========== ДУХОВЕНСТВО (ПРЯМОУГОЛЬНЫЕ ФОТО) ========== */
#clergyList .grid-item img {
    height: 400px;
    object-fit: cover;
    object-position: top center;
    border-radius: 20px;
}

@media (max-width: 700px) {
    #clergyList .grid-item img {
        height: 320px;
    }
}

@media (max-width: 480px) {
    #clergyList .grid-item img {
        height: 400px;
        width: 100%;
        object-fit: cover;
        object-position: top center;
    }
}

/* ========== ДЕТАЛЬНАЯ СТРАНИЦА СВЯЩЕННИКА ========== */
#clergyDetail .detail-content img {
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: cover;
    object-position: top center;
    border-radius: 20px;
    display: block;
    margin: 0 auto 1rem;
}

/* ========== МОДАЛЬНОЕ ОКНО ХРАМА (круглые фото 150x150) ========== */
.temple-modal-content .clergy-card img {
    width: 150px;
    height: 150px;
    border-radius: 50% !important;
    object-fit: cover;
    margin: 0 auto 0.5rem;
    display: block;
}

@media (max-width: 480px) {
    .temple-modal-content .clergy-card img {
        width: 120px;
        height: 120px;
    }
}

/* ========== КНОПКИ ДЕЙСТВИЙ НА СТРАНИЦЕ ХРАМА ========== */
.temple-detail-hero .action-buttons .temple-action-btn {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 40px;
    padding: 0.6rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
    color: white;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.temple-detail-hero .action-buttons .temple-action-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.8);
}

.temple-detail-hero .action-buttons .temple-action-btn.phone {
    background: #4caf50;
    border-color: #4caf50;
}

.temple-detail-hero .action-buttons .temple-action-btn.phone:hover {
    background: #45a049;
    border-color: #45a049;
}

@media (max-width: 480px) {
    .temple-detail-hero .action-buttons .temple-action-btn {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
        white-space: normal;
        line-height: 1.2;
        gap: 0.2rem;
    }
    .temple-detail-hero .action-buttons {
        gap: 0.5rem;
    }
}

/* ========== ИСТОРИЯ ХРАМА ========== */
.history-btn {
    padding: 0.3rem 1.2rem;
    border-radius: 30px;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: 0.2s;
}

.history-btn.active {
    background: var(--gold);
    color: white;
    border-color: var(--gold);
}

.history-btn:hover:not(.active) {
    background: #f3ede3;
}

@media (max-width: 480px) {
    .history-btn {
        font-size: 0.8rem;
        padding: 0.2rem 0.8rem;
    }
}

/* ========== ДЕТАЛЬНАЯ СТРАНИЦА ХРАМА ========== */
.temple-detail-hero {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
}

.temple-detail-hero .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    border-radius: 24px;
}

.temple-detail-hero .content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    padding: 2rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.temple-detail-hero .content h1 {
    font-size: 2.5rem;
    font-family: 'Cormorant Uncial', serif;
    margin-bottom: 0.5rem;
}

.temple-detail-hero .content .address {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
    .temple-detail-hero .content h1 {
        font-size: 1.8rem;
    }
    .temple-detail-hero .content .address {
        font-size: 1rem;
    }
}

.detail-back {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--gold);
    cursor: pointer;
    font-weight: 500;
}

.detail-back:hover {
    text-decoration: underline;
}

/* ========== АДМИН-ПАНЕЛЬ ========== */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    visibility: hidden;
    opacity: 0;
    transition: 0.2s;
}

.admin-modal.visible {
    visibility: visible;
    opacity: 1;
}

.admin-panel {
    background: var(--card-bg);
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 32px;
    padding: 1.5rem;
}

@media (max-width: 480px) {
    .admin-panel {
        padding: 0.8rem;
        border-radius: 20px;
        width: 98%;
    }
}

.admin-panel .admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .admin-panel .admin-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
        text-align: center;
    }
    .admin-panel .admin-header > div {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
}

.admin-panel .admin-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.admin-panel .form-group {
    margin-bottom: 0.8rem;
}

.admin-panel .form-group label {
    display: block;
    font-weight: 600;
    color: #6b533c;
    margin-bottom: 0.2rem;
}

.admin-panel .form-group input,
.admin-panel .form-group textarea,
.admin-panel .form-group select {
    width: 100%;
    padding: 0.6rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: inherit;
    color: var(--text);
}

@media (max-width: 480px) {
    .admin-panel .form-group input,
    .admin-panel .form-group textarea,
    .admin-panel .form-group select {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

.admin-panel .btn {
    background: var(--gold);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

@media (max-width: 480px) {
    .admin-panel .btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }
}

.admin-panel .btn-danger {
    background: #b68b6a;
}

.admin-panel .btn-sm {
    padding: 0.2rem 0.8rem;
    font-size: 0.75rem;
}

.admin-panel .admin-item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    background: var(--bg);
    padding: 0.5rem;
    border-radius: 16px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

@media (max-width: 480px) {
    .admin-panel .admin-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

.admin-panel .admin-menu-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: 0.2s;
}

@media (max-width: 480px) {
    .admin-panel .admin-menu-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
    }
}

.admin-panel .admin-menu-btn:hover {
    background: var(--gold);
    color: white;
    border-color: var(--gold);
}

.admin-panel .schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.admin-panel .schedule-table th,
.admin-panel .schedule-table td {
    padding: 0.3rem 0.6rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

@media (max-width: 480px) {
    .admin-panel .schedule-table th,
    .admin-panel .schedule-table td {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* ========== ВЕРСИЯ ДЛЯ СЛАБОВИДЯЩИХ ========== */
body.vision {
    font-size: 20px;
    line-height: 1.8;
    background: #ffffff !important;
    color: #000000 !important;
}

body.vision * {
    font-size: inherit !important;
    line-height: inherit !important;
}

body.vision a {
    color: #0055cc !important;
    text-decoration: underline !important;
}

body.vision .card,
body.vision .detail-content,
body.vision .grid-item {
    background: #f9f9f9 !important;
    border: 2px solid #000 !important;
}

body.vision button,
body.vision .btn {
    font-size: 1.2rem !important;
    padding: 0.7rem 1.5rem !important;
    border: 2px solid #000 !important;
}

body.vision .top-bar nav a {
    font-size: 1.2rem !important;
    padding: 0.5rem 1rem !important;
}

body.vision .top-bar nav a.active {
    background: #000 !important;
    color: #fff !important;
}

body.vision .banner-main,
body.vision .banner-sub-item {
    font-size: 2rem !important;
}

body.vision input,
body.vision select,
body.vision textarea {
    font-size: 1.2rem !important;
    padding: 0.7rem !important;
}

body.vision .admin-panel {
    font-size: 1.2rem !important;
}

body.vision .admin-panel input,
body.vision .admin-panel select,
body.vision .admin-panel textarea {
    font-size: 1.2rem !important;
}

@media (max-width: 480px) {
    body.vision {
        font-size: 18px;
    }
    body.vision .top-bar nav a {
        font-size: 1rem !important;
        padding: 0.3rem 0.6rem !important;
    }
    body.vision #visionToggle {
        font-size: 1rem !important;
        padding: 0.3rem 0.8rem !important;
    }
}

/* ========== ФУТЕР ========== */
footer {
    background: #1a1a1a;
    color: #f2e5c6;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    border-top: 3px solid var(--gold);
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    footer {
        font-size: 0.75rem;
        padding: 0.6rem;
        margin-top: 1rem;
    }
}

footer a {
    color: var(--gold);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ========== КНОПКА НАВЕРХ ========== */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--gold);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: none;
    z-index: 50;
}

.back-to-top.visible {
    display: block;
}

@media (max-width: 480px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
}