* {
    margin: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    line-height: 2;
    color: #333;
}

/* Шапка */
.header {
    background: linear-gradient(rgba(0,0,0,0.2), rgba(0,70,143,1)),
                url("/static/main/img/fon.jpg") center/cover;
    color: white;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Герой-секция */
.hero {
    text-align: center;
    padding: 15vh 2rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.ministry-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;   /* растягивает содержимое */
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transition: 0.3s ease;
    height: 100%;
    width: 320px;
}

.ministry-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.ministries-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    max-width: calc(320px * 3 + 2rem * 2);
    margin: 0 auto;
}

.ministry-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

#ministries .ministries-cta {
    width: 100%;
    display: flex;
    justify-content: center;
    text-align: center;
}

#ministries .btn {
    margin-left: 0;
    margin-right: 0;
}

.ministry-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.ministry-photo.placeholder {
    background: #ddd;
}

.ministry-contacts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ministry-contacts a {
    color: inherit;
    text-decoration: none;
}

.ministry-contacts a:hover {
    text-decoration: underline;
}

#contact {
    padding-bottom: 4rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2.5rem;
    align-items: stretch;
}

/* Левая колонка */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-main-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 18px;
    background: white;
    box-shadow: 0 15px 40px rgba(0,0,0,0.06);
    transition: 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.contact-item i {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.contact-item h3 {
    margin-bottom: 0.4rem;
    font-size: 1rem;
    color: var(--primary-blue);
}

.contact-item-content {
    flex: 1;
}

.contact-item p {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

.contact-item a {
    color: #555;              /* такой же цвет как у p */
    text-decoration: none;    /* убрать подчёркивание */
    font-size: 0.95rem;
    line-height: 1.6;
}

.contact-item a:visited {
    color: #555;
}

.contact-item a:hover {
    text-decoration: underline; /* лёгкий эффект при наведении */
}

.contact-social {
    border-radius: 18px;
    padding: 1.25rem 1.25rem 1.5rem;
}

.contact-social h3 {
    margin: 0 0 1rem;
    color: var(--primary-blue);
    font-size: 1rem;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.social-link i {
    font-size: 1rem;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(0,0,0,0.12);
    text-decoration: none;
}

.social-link.tg {
    background: #e8f6ff;
    color: #1688cc;
}

.social-link.ig {
    background: #fff0f6;
    color: #c83d7d;
}

.social-link.wa {
    background: #e9fff1;
    color: #25d366;
}

.social-link.yt {
    background: #ffe9e9;
    color: #d93025;
}

.social-link.fb {
    background: #eaf2ff;
    color: #1877f2;
}

/* Карта */
.map-container {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
    background: white;
    padding: 0;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    min-height: 100%;
    border: 0;
    display: block;
}

/* Адаптив */
@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .map-container {
        height: 350px;
    }
}

.sermon-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(3, 320px);
    justify-content: center; /* центрирует всю сетку */
}

@media (max-width: 1100px) {
    .sermon-grid {
        grid-template-columns: repeat(2, 320px);
        justify-content: center;
    }

    /* если карточек нечётное количество */
    .sermon-grid .sermon-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;   /* занимает обе колонки */
        justify-self: center;  /* центрируется */
        width: 320px;          /* НЕ МЕНЬШЕ, чем колонка */
    }
}

@media (max-width: 737px) {
    .sermon-grid {
        grid-template-columns: repeat(1, 320px);
        justify-content: center;
    }
}

.sermon-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    width: 320px;
}

.sermon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.video-thumbnail {
    position: relative;
    display: block;
    padding-top: 56.25%;
    background: #f5f5f5;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sermon-card:hover .video-thumbnail img {
    transform: scale(1.03);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.9);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-overlay .fab {
    color: white;
    font-size: 1rem;
    margin-left: 2px;
}

.sermon-info {
    padding: 1.2rem 1rem;
    text-align: left;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    display: block;
    overflow: visible;
    text-overflow: clip;
    max-height: none;
    height: auto;
}

.sermon-info h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    color: #333;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    display: block;
    overflow: visible;
    text-overflow: clip;
    max-height: none;
    height: auto;
}

.meta {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
    min-height: 3em;
}

/* Основные секции */
.section {
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    scroll-margin-top: 80px;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-blue);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-gold);
}

.scripture-ref {
    color: var(--primary-blue);
    font-weight: 600;
}

/* Адаптивность */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        font-size: 1.5rem;
        color: white;
        cursor: pointer;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2rem;
    }
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--secondary-blue);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    transition: 0.3s;
    margin-top: 1.5rem;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Карточки */
.card,
.foto {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    transition: 0.3s;
    padding: 10px;
}

.card:hover {
    transform: translateY(-5px);
}

.footer {
    background: #111;
    color: white;
    text-align: center;
    padding: 2rem;
}

/* =========================
   EVENTS SECTION
========================= */

/* Сетка */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 320px));
    gap: 1.5rem;
    justify-content: center;
}

/* Карточка */
.event-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: 0.3s ease;
    overflow: hidden;            /* важно для баннера */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 45px rgba(0,0,0,0.12);
}

/* Баннер */
.event-banner {
    width: 100%;
    aspect-ratio: 16 / 9;   /* квадрат */
    background: #f3f6fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-banner.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-banner.no-image::after {
    content: "Событие";
    color: #2E6DB4;
    font-weight: 600;
    opacity: 0.5;
}

.event-banner img {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* НЕ режет */
}

/* Контент */
.event-content {
    padding: 1.5rem;          /* твой старый padding */
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
}

/* Дата */
.event-date {
    color: #2E6DB4;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Заголовок */
.event-content h3 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

/* Описание */
.event-content p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.no-events {
    text-align: center;
    color: #1A4D8F;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.no-events i {
    font-size: 4rem;
    color: #2E6DB4;
    opacity: 0.8;
}

.no-events h3 {
    font-size: 1.6rem;
    margin: 0;
}

.no-events p {
    font-size: 1rem;
    color: #555;
    max-width: 400px;
}

/* ABOUT SECTION */
.about {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.about-wrapper {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
    background: white;
}

.about-text {
    padding: 3.5rem;
}

.about-text h3 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--primary-blue);
}

.about-text p {
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 2rem;
}

.about-text .mt {
    margin-top: 2rem;
}

.beliefs-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.beliefs-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    color: #333;
}

.beliefs-list i {
    color: var(--primary-blue);
    font-size: 1.1rem;
    min-width: 20px;
}

.about-image {
    background:
        linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.45)),
        url("/static/main/img/favicon.ico") center / cover no-repeat;
    width: 100%;
    background-clip: content-box;
}

@media (max-width: 900px) {
    .about-wrapper {
        grid-template-columns: 1fr;
    }

    .about-text {
        padding: 2.5rem 2rem;
    }
}

.about-actions {
    margin-top: 2rem;
    text-align: center;
    color: var(--primary-blue);
}

.about-btn {
    margin-top: 0;
}
