* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', serif;
    background-color: #FFF8F0;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Главная страница */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

.container {
    display: flex;
    flex: 1;
    padding: 0.5cm;
    gap: 1cm;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFF8F0 0%, #FFF0E0 100%);
    min-height: calc(100vh - 70px);
}

.left-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-width: 50%;
}

.temple-photo {
    width: auto;
    height: 80vh;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: block;
}

.right-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0.5cm 0;
    max-width: 50%;
    gap: 1cm;
}

.temple-title {
    font-size: 2.5em;
    color: #2C3E50;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    line-height: 1.2;
}

.icons-container {
    display: flex;
    gap: 0.5cm;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.icon {
    width: 158px;
    height: 211px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid gold;
    background-color: rgba(255, 255, 255, 0.8);
}

.navigation {
    display: flex;
    flex-direction: column;
    gap: 0.3cm;
    width: 100%;
    max-width: 350px;
}

.nav-button {
    display: block;
    padding: 12px 25px;
    background-color: #8B4513;
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 8px;
    font-size: 1.1em;
    transition: all 0.3s ease;
    border: 2px solid #654321;
    font-weight: bold;
}

.nav-button:hover {
    background-color: #A0522D;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Стили для кнопки помощи храму */
.donate-button {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    border-color: #654321;
    position: relative;
    overflow: hidden;
}

.donate-button::before {
    content: '❤️';
    margin-right: 8px;
}

.donate-button:hover {
    background: linear-gradient(135deg, #A0522D, #8B4513);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(139, 69, 19, 0.4);
}

/* Подвал */
.footer {
    background: linear-gradient(135deg, #D4B896 0%, #C8A87C 100%);
    padding: 15px 0;
    text-align: center;
    border-top: 3px solid #8B4513;
    width: 100%;
    flex-shrink: 0;
}

.footer-content {
    font-size: 1.1em;
    color: #2C3E50;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
    font-family: 'Times New Roman', serif;
}

/* Вторая страница */
.about-container {
    min-height: 100vh;
    padding: 1cm;
    background: linear-gradient(135deg, #FFF8F0 0%, #FFF0E0 100%);
    display: flex;
    flex-direction: column;
}

.about-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5cm;
    text-align: center;
    flex-shrink: 0;
}

.about-header h1 {
    font-size: 2.5em;
    color: #2C3E50;
    text-align: center;
    flex: 1;
    margin: 0;
}

.back-button {
    padding: 8px 16px;
    background-color: #8B4513;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-size: 1em;
    white-space: nowrap;
}

.back-button:hover {
    background-color: #A0522D;
}

.about-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3cm;
    margin-bottom: 1cm;
    justify-content: center;
    flex-shrink: 0;
}

.about-navigation .nav-button {
    flex: 1;
    min-width: 130px;
    max-width: 180px;
}

.nav-button.active {
    background-color: #654321;
    border-color: #8B4513;
}

.content {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 1cm;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-height: 300px;
    border: 1px solid #e8d4b5;
    flex: 1;
    overflow-y: auto;
}

.info-section h2 {
    color: #2C3E50;
    margin-bottom: 0.5cm;
    font-size: 2em;
    border-bottom: 2px solid #8B4513;
    padding-bottom: 0.3cm;
    text-align: center;
}

.info-section p {
    font-size: 1.1em;
    line-height: 1.5;
    margin-bottom: 0.3cm;
    color: #333;
    text-align: justify;
}

.info-section strong {
    color: #8B4513;
}

/* Стили для контактных ссылок */
.contact-link {
    color: #8B4513;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.contact-link:hover {
    color: #A0522D;
    border-bottom: 1px solid #A0522D;
    text-decoration: none;
}

/* Стили для навигационных ссылок */
.nav-links {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.nav-app {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 1px solid #654321;
}

.nav-app:hover {
    background: linear-gradient(135deg, #A0522D, #8B4513);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(139, 69, 19, 0.3);
}

/* Стили для фотогалереи */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 1cm 0;
    padding: 0;
}

.photo-item {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid #e8d4b5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    border-color: #8B4513;
}

.photo-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
    border: none;
    border-bottom: 3px solid #8B4513;
    transition: transform 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-item p {
    font-size: 1.1em;
    color: #2C3E50;
    margin: 0;
    font-weight: bold;
    padding: 12px 8px;
    background: linear-gradient(135deg, #f8f4e9, #e8d4b5);
    border-radius: 0 0 10px 10px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

/* Стили для галереи святынь */
.shrines-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 1cm 0;
}

.shrine-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid #e8d4b5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.shrine-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    border-color: #8B4513;
}

.shrine-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 3px solid #8B4513;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.shrine-item:hover img {
    transform: scale(1.05);
}

.shrine-item p {
    font-size: 1.1em;
    color: #2C3E50;
    margin: 0;
    font-weight: bold;
    line-height: 1.4;
    padding: 10px 5px;
    background: linear-gradient(135deg, #f8f4e9, #e8d4b5);
    border-radius: 6px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
}

.gallery-notice {
    font-size: 1em;
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 1cm;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 8px;
    border-left: 4px solid #8B4513;
}

/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 80%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
    animation: zoomIn 0.3s ease;
    object-fit: contain;
}

.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.2em;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 5px;
    max-width: 80%;
}

.close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.close:hover {
    color: #8B4513;
}

/* Кнопки навигации в модальном окне */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(139, 69, 19, 0.7);
    color: white;
    border: none;
    font-size: 20px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.modal-nav:hover {
    background: rgba(139, 69, 19, 0.9);
}

.modal-nav.prev {
    left: 15px;
}

.modal-nav.next {
    right: 15px;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.temple-photo, .temple-title, .icons-container, .navigation {
    animation: fadeIn 0.8s ease-out;
}

.navigation {
    animation-delay: 0.3s;
}

/* Стили для списков */
.clergy-list, .schedule-list, .contacts-list {
    list-style: none;
    padding: 0;
}

.clergy-list li, .schedule-list li, .contacts-list li {
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
    font-size: 1.1em;
}

.clergy-list li:last-child, .schedule-list li:last-child, .contacts-list li:last-child {
    border-bottom: none;
}

/* Стили для раздела помощи храму */
.donation-content {
    max-width: 800px;
    margin: 0 auto;
}

.donation-text {
    font-size: 1.1em;
    line-height: 1.6;
    color: #333;
}

.donation-methods {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 1cm 0;
}

.donation-method {
    background: linear-gradient(135deg, #f8f4e9, #e8d4b5);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #8B4513;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.donation-method h3 {
    color: #8B4513;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.donation-method p {
    margin: 5px 0;
    font-size: 1em;
}

.donation-notice {
    background: rgba(139, 69, 19, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin: 1cm 0;
    border: 1px solid #e8d4b5;
}

.donation-notice strong {
    color: #8B4513;
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.donation-notice ul {
    list-style: none;
    padding-left: 0;
}

.donation-notice li {
    padding: 5px 0;
    padding-left: 25px;
    position: relative;
}

.donation-notice li::before {
    content: '✓';
    color: #8B4513;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.prayer-text {
    text-align: center;
    font-style: italic;
    color: #8B4513;
    font-size: 1.2em;
    margin-top: 1cm;
    padding: 15px;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 8px;
}

/* Адаптивность для ноутбуков и планшетов */
@media (max-width: 1200px) {
    .temple-title {
        font-size: 2.2em;
    }
    
    .about-header h1 {
        font-size: 2.2em;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
    }
    
    .photo-item img {
        height: 220px;
    }
    
    .shrines-gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .shrine-item img {
        height: 220px;
    }
    
    .icon {
        width: 143px;
        height: 190px;
    }
}

@media (max-width: 1024px) {
    .container {
        padding: 0.3cm;
        gap: 0.8cm;
    }
    
    .temple-title {
        font-size: 2em;
    }
    
    .right-section {
        gap: 0.8cm;
    }
    
    .icon {
        width: 140px;
        height: 186px;
    }
}

/* Адаптивность для планшетов и мобильных */
@media (max-width: 768px) {
    .main-container {
        overflow-y: auto;
    }
    
    .container {
        flex-direction: column;
        padding: 0.3cm;
        gap: 0.5cm;
        min-height: auto;
        overflow-y: auto;
    }
    
    .left-section, .right-section {
        max-width: 100%;
        width: 100%;
    }
    
    .temple-photo {
        height: auto;
        max-height: 50vh;
        width: auto;
        max-width: 100%;
    }
    
    .temple-title {
        font-size: 1.8em;
        margin-bottom: 0;
    }
    
    .icons-container {
        margin-bottom: 0;
    }
    
    .right-section {
        padding: 0.3cm 0;
        margin-top: 0;
        justify-content: flex-start;
        gap: 0.5cm;
    }
    
    .navigation {
        margin-top: 0;
    }
    
    .icon {
        width: 126px;
        height: 168px;
    }
    
    .about-container {
        padding: 0.5cm;
        min-height: 100vh;
        overflow-y: auto;
    }
    
    .about-header {
        flex-direction: column;
        gap: 0.3cm;
    }
    
    .about-header h1 {
        font-size: 1.6em;
    }
    
    .back-button {
        margin-top: 0;
    }
    
    .about-navigation {
        flex-direction: column;
        gap: 0.2cm;
        margin-bottom: 0.5cm;
    }
    
    .about-navigation .nav-button {
        max-width: none;
        width: 100%;
    }
    
    .content {
        padding: 0.5cm;
        min-height: 200px;
        overflow-y: visible;
    }
    
    .info-section h2 {
        font-size: 1.6em;
    }
    
    .info-section p {
        font-size: 1em;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 10px;
        margin: 0.5cm 0;
    }
    
    .photo-item img {
        height: 180px;
    }
    
    .shrines-gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
        margin: 0.5cm 0;
    }
    
    .shrine-item img {
        height: 200px;
    }
    
    .shrine-item p {
        font-size: 1em;
        min-height: 60px;
    }
    
    .footer {
        padding: 10px 0;
    }
    
    .footer-content {
        font-size: 0.9em;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 70%;
    }
    
    .modal-caption {
        font-size: 1em;
        bottom: 10px;
        padding: 6px 12px;
    }
    
    .close {
        top: 10px;
        right: 15px;
        font-size: 25px;
    }
    
    .modal-nav {
        padding: 8px 12px;
        font-size: 20px;
    }
    
    .modal-nav.prev {
        left: 10px;
    }
    
    .modal-nav.next {
        right: 10px;
    }
    
    /* Адаптивность для раздела помощи */
    .donation-methods {
        gap: 15px;
    }
    
    .donation-method {
        padding: 15px;
    }
    
    .donation-method h3 {
        font-size: 1.2em;
    }
    
    .prayer-text {
        font-size: 1.1em;
        padding: 12px;
    }
    
    /* Адаптивность для навигационных ссылок */
    .nav-links {
        gap: 8px;
    }
    
    .nav-app {
        padding: 5px 10px;
        font-size: 0.85em;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 480px) {
    body {
        overflow-y: auto;
    }
    
    .main-container {
        overflow-y: auto;
        min-height: 100vh;
    }
    
    .container {
        padding: 0.2cm;
        gap: 0.3cm;
        overflow-y: auto;
    }
    
    .temple-title {
        font-size: 1.5em;
        margin-bottom: 0;
    }
    
    .icons-container {
        flex-direction: column;
        gap: 0.3cm;
        margin-bottom: 0;
    }
    
    .icon {
        width: 110px;
        height: 146px;
    }
    
    .nav-button {
        padding: 10px 20px;
        font-size: 1em;
    }
    
    .navigation {
        margin-top: 0;
        gap: 0.2cm;
    }
    
    .about-header h1 {
        font-size: 1.4em;
    }
    
    .info-section h2 {
        font-size: 1.4em;
    }
    
    .photo-gallery {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .photo-item img {
        height: 200px;
    }
    
    .photo-item p {
        font-size: 1em;
        min-height: 50px;
        padding: 10px 8px;
    }
    
    .shrines-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .shrine-item img {
        height: 220px;
    }
    
    .shrine-item p {
        font-size: 1em;
        min-height: 50px;
        padding: 10px 8px;
    }
    
    .temple-photo {
        height: auto;
        max-height: 40vh;
    }
    
    .footer {
        padding: 8px 0;
    }
    
    .footer-content {
        font-size: 0.8em;
        padding: 0 10px;
    }
    
    .modal-content {
        max-width: 98%;
        max-height: 60%;
    }
    
    .modal-caption {
        font-size: 0.9em;
        bottom: 5px;
        padding: 5px 10px;
    }
    
    .close {
        top: 5px;
        right: 10px;
        font-size: 20px;
    }
    
    .modal-nav {
        padding: 6px 10px;
        font-size: 16px;
    }
    
    /* Адаптивность для контактных ссылок */
    .contact-link {
        word-break: break-all;
        display: inline-block;
        max-width: 100%;
    }
    
    /* Адаптивность для раздела помощи */
    .donation-method {
        padding: 12px;
    }
    
    .donation-method h3 {
        font-size: 1.1em;
    }
    
    .donation-notice {
        padding: 15px;
    }
    
    /* Адаптивность для навигационных ссылок */
    .nav-links {
        flex-direction: column;
        gap: 5px;
    }
    
    .nav-app {
        text-align: center;
        padding: 8px 12px;
    }
}

/* Особые стили для очень маленьких экранов */
@media (max-width: 360px) {
    .temple-title {
        font-size: 1.3em;
    }
    
    .icon {
        width: 99px;
        height: 132px;
    }
    
    .nav-button {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .about-header h1 {
        font-size: 1.2em;
    }
    
    .photo-item img {
        height: 150px;
    }
    
    .shrine-item img {
        height: 180px;
    }
}

/* Улучшения для читаемости */
.info-section {
    line-height: 1.6;
}

.info-section p {
    margin-bottom: 0.3cm;
}

/* Стили для активных состояний */
.nav-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Подсветка для особых элементов */
.shrines-list {
    background: rgba(139, 69, 19, 0.1);
    padding: 0.5cm;
    border-radius: 10px;
    border-left: 4px solid #8B4513;
}

/* Прокрутка для фотогалереи */
.photo-gallery-container {
    max-height: 80vh;
    overflow-y: auto;
    padding-right: 10px;
}

/* Стили для скроллбара */
.photo-gallery-container::-webkit-scrollbar {
    width: 8px;
}

.photo-gallery-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.photo-gallery-container::-webkit-scrollbar-thumb {
    background: #8B4513;
    border-radius: 10px;
}

.photo-gallery-container::-webkit-scrollbar-thumb:hover {
    background: #654321;
}

/* Улучшения для изображений в галерее */
.photo-item img {
    transition: all 0.3s ease;
}

.photo-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

/* Обеспечиваем прокрутку на мобильных устройствах */
html, body {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

.main-container, .container, .about-container, .content {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}