/* =========================================================
   COMMUNITY
   Блог / Telegram / MAX / Журнал
   ========================================================= */


/* =========================================================
   SECTION
   ========================================================= */

.community-section {
    padding: 90px 0;
    background: #ffffff;
}

.community-container {
    width: min(1380px, calc(100% - 60px));
    margin: 0 auto;
}


/* =========================================================
   GRID
   ========================================================= */

.community-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.05fr)
        minmax(0, 0.95fr)
        minmax(0, 0.9fr);

    gap: 24px;
    align-items: stretch;
}


/* =========================================================
   CARDS
   ========================================================= */

.community-card {
    position: relative;
    min-width: 0;
    overflow: hidden;

    background: #ffffff;

    border: 1px solid rgba(204, 164, 68, 0.58);
    border-radius: 18px;

    box-shadow:
        0 14px 40px rgba(94, 29, 83, 0.08);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.community-card:hover {
    transform: translateY(-3px);

    border-color: rgba(204, 164, 68, 0.85);

    box-shadow:
        0 20px 48px rgba(94, 29, 83, 0.12);
}

.community-card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 28px;

    width: 54px;
    height: 3px;

    background: #cca444;

    z-index: 2;
}


/* =========================================================
   CARD INNER
   ========================================================= */

.community-card-inner {
    display: flex;
    flex-direction: column;

    height: 100%;

    padding: 36px 32px 30px;

    box-sizing: border-box;
}


/* =========================================================
   TYPOGRAPHY
   ========================================================= */

.community-kicker {
    display: block;

    margin-bottom: 9px;

    color: #cca444;

    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.19em;
    line-height: 1.4;

    text-transform: uppercase;
}

.community-title {
    position: relative;

    margin: 0 0 27px;
    padding-bottom: 15px;

    color: #5e1d53;

    font-family: Arial, sans-serif;
    font-size: clamp(25px, 2.2vw, 34px);
    font-weight: 600;

    line-height: 1.12;
    letter-spacing: -0.025em;
}

.community-title::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 44px;
    height: 2px;

    background: #cca444;
}


/* =========================================================
   TELEGRAM / ОБЩИЕ СТИЛИ ЗАГОЛОВКА ПОСТА
   ========================================================= */

.community-post-date {
    margin-bottom: 9px;

    color: #cca444;

    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.08em;
}

.community-post-title {
    margin: 0 0 14px;

    color: #5e1d53;

    font-family: Arial, sans-serif;
    font-size: 19px;
    font-weight: 600;

    line-height: 1.35;
}

.community-post-title a {
    color: inherit;
    text-decoration: none;

    transition: color 0.2s ease;
}

.community-post-title a:hover {
    color: #cca444;
}

.community-post-excerpt {
    color: #51484f;

    font-family: Arial, sans-serif;
    font-size: 13px;

    line-height: 1.65;
}

.community-more {
    display: inline-block;

    margin-top: 14px;

    color: #5e1d53;

    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.04em;

    text-decoration: none;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.community-more:hover {
    color: #cca444;
}


/* =========================================================
   TELEGRAM
   СПОКОЙНЫЙ АККОРДЕОН
   ========================================================= */

.community-blog .community-telegram-panel {
	display: none;
}

.community-blog .community-telegram-panel.is-active {
	display: block;
}

/* Сам текст открытого поста */

.community-blog .community-telegram-content {
	max-height: none;
	height: auto;
	overflow: visible;
	padding: 0;
}

/* Убираем любые анимации у Telegram */

.community-blog .community-telegram-panel,
.community-blog .community-telegram-content,
.community-blog .community-telegram-switch,
.community-blog .community-telegram-switch-title,
.community-blog .community-telegram-switch-arrow {
	transition: none !important;
	animation: none !important;
}

/* Заголовки следующих постов */

.community-blog .community-telegram-switch {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin: 0;
	padding: 18px 0;

	background: transparent;
	border: 0;
	border-top: 1px solid rgba(94, 29, 83, 0.15);

	color: #5e1d53;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	text-align: left;

	cursor: pointer;
}

/* Убираем эффект при наведении */

.community-blog .community-telegram-switch:hover {
	background: transparent;
	color: #5e1d53;
}

/* Активный пункт */

.community-blog .community-telegram-switch.is-active {
	color: #5e1d53;
}

/* Название поста */

.community-blog .community-telegram-switch-title {
	flex: 1;
}

/* Стрелка */

.community-blog .community-telegram-switch-arrow {
	flex: 0 0 auto;
	margin-left: 20px;

	color: #cca444;
	font-size: 20px;
	line-height: 1;
}

/* Последний пост внутри */

.community-blog .community-telegram-panel.is-active
.community-telegram-content {
	padding-bottom: 22px;
}


/* =========================================================
   МОБИЛЬНЫЕ
   ========================================================= */

@media (max-width: 767px) {

	.community-blog .community-telegram-switch {
		padding: 16px 0;
		font-size: 15px;
	}

	.community-blog .community-telegram-switch-arrow {
		margin-left: 15px;
		font-size: 18px;
	}

	.community-blog .community-telegram-panel.is-active
	.community-telegram-content {
		padding-bottom: 18px;
	}

}

/* =========================================================
   ACTIONS
   ========================================================= */

.community-actions {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-top: 27px;

    width: 100%;
}


/* =========================================================
   PREMIUM BUTTONS
   ========================================================= */

.community-button {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 1 1 0;

    min-width: 0;
    min-height: 46px;

    padding: 11px 16px;

    box-sizing: border-box;

    border: 1px solid #cca444;
    border-radius: 8px;

    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.075em;
    line-height: 1.25;

    text-align: center;
    text-transform: uppercase;

    text-decoration: none;

    overflow: hidden;

    transition:
        color 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.community-button::before {
    content: "";

    position: absolute;

    top: 0;
    left: -110%;

    width: 80%;
    height: 100%;

    background: linear-gradient(
        105deg,
        transparent,
        rgba(255, 255, 255, 0.22),
        transparent
    );

    transition: left 0.55s ease;
}

.community-button:hover::before {
    left: 130%;
}

.community-button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 8px 20px rgba(94, 29, 83, 0.12);
}


/* ---------------------------------------------------------
   Outline
   --------------------------------------------------------- */

.community-button-outline {
    color: #5e1d53;
    background: #ffffff;
}

.community-button-outline:hover {
    color: #ffffff;

    background: #5e1d53;

    border-color: #5e1d53;
}


/* ---------------------------------------------------------
   Dark
   --------------------------------------------------------- */

.community-button-dark {
    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #5e1d53 0%,
            #43143b 100%
        );

    border-color: #5e1d53;

    box-shadow:
        0 5px 15px rgba(94, 29, 83, 0.14);
}

.community-button-dark:hover {
    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #6d2460 0%,
            #4b1742 100%
        );

    border-color: #cca444;
}


/* =========================================================
   MAX CARD
   ========================================================= */

.community-chat {
    color: #ffffff;

    background:
        linear-gradient(
            145deg,
            #5e1d53 0%,
            #46163f 100%
        );

    border-color: rgba(204, 164, 68, 0.72);

    box-shadow:
        0 18px 45px rgba(94, 29, 83, 0.18);
}

.community-chat:hover {
    border-color: #cca444;

    box-shadow:
        0 24px 55px rgba(94, 29, 83, 0.24);
}

.community-chat::before {
    background: #cca444;
}

.community-chat .community-kicker {
    color: #cca444;
}

.community-chat .community-title {
    color: #ffffff;
}

.community-chat .community-title::after {
    background: #cca444;
}


/* =========================================================
   MAX MESSAGES
   ========================================================= */

.community-messages {
    flex: 1 1 auto;
}

.community-message {
    padding: 13px 0;

    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.community-message:first-child {
    padding-top: 0;
}

.community-message:last-child {
    border-bottom: 0;
}

.community-message-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 6px;
}

.community-message-author {
    color: #e5c96e;

    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
}

.community-message-time {
    flex: 0 0 auto;

    color: rgba(255, 255, 255, 0.45);

    font-family: Arial, sans-serif;
    font-size: 9px;
}

.community-message-text {
    color: rgba(255, 255, 255, 0.84);

    font-family: Arial, sans-serif;
    font-size: 12px;

    line-height: 1.55;
}


/* MAX empty */

.community-chat .community-chat-empty {
    color: rgba(255, 255, 255, 0.75);
}

.community-chat .community-chat-empty a {
    color: #e5c96e;
}


/* MAX button */

.community-chat .community-button-dark {
    color: #5e1d53;

    background: #ffffff;

    border-color: #ffffff;

    box-shadow: none;
}

.community-chat .community-button-dark:hover {
    color: #ffffff;

    background: transparent;

    border-color: #cca444;
}


/* =========================================================
   JOURNAL
   ========================================================= */

.community-journal-photo {
    position: relative;

    display: block;

    width: 100%;

    margin-bottom: 20px;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    border-radius: 12px;

    background: #f2edf1;

    text-decoration: none;
}

.community-journal-photo::after {
    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(94, 29, 83, 0.18),
            transparent 45%
        );

    pointer-events: none;
}

.community-journal-photo img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.5s ease,
        filter 0.5s ease;
}

.community-journal-photo:hover img {
    transform: scale(1.035);
    filter: saturate(1.04);
}


/* =========================================================
   LAST VK POST
   ========================================================= */

.community-journal-latest {
    margin-bottom: 18px;

    padding-bottom: 17px;

    border-bottom: 1px solid rgba(204, 164, 68, 0.22);
}

.community-journal-latest .community-journal-label {
    margin-bottom: 8px;
}

.community-journal-text {
    margin: 0;

    color: #51484f;

    font-family: Arial, sans-serif;
    font-size: 12px;

    line-height: 1.55;
}


/* =========================================================
   JOURNAL LINKS
   ========================================================= */

.community-journal-links {
    display: flex;
    flex-direction: column;

    gap: 0;
}

.community-journal-link {
    display: grid;

    grid-template-columns: 72px minmax(0, 1fr) auto;

    align-items: center;

    gap: 12px;

    padding: 13px 0;

    color: #5e1d53;

    text-decoration: none;

    border-bottom: 1px solid rgba(94, 29, 83, 0.08);

    transition:
        color 0.2s ease,
        padding-left 0.2s ease;
}

.community-journal-link:last-child {
    border-bottom: 0;
}

.community-journal-link:hover {
    padding-left: 4px;
}

.community-journal-label {
    color: #cca444;

    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.community-journal-description {
    min-width: 0;

    color: #625862;

    font-family: Arial, sans-serif;
    font-size: 11px;

    line-height: 1.45;
}

.community-journal-link:hover .community-journal-description {
    color: #5e1d53;
}

.community-journal-arrow {
    color: #cca444;

    font-size: 15px;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.community-chat-empty {
    color: #625862;

    font-family: Arial, sans-serif;
    font-size: 12px;

    line-height: 1.6;
}

.community-chat-empty p {
    margin: 0 0 10px;
}

.community-chat-empty a {
    color: #5e1d53;

    font-weight: 700;

    text-decoration: none;
}

.community-chat-empty a:hover {
    color: #cca444;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1050px) {

    .community-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .community-journal {
        grid-column: 1 / -1;
    }

    .community-journal-photo {
        aspect-ratio: 16 / 6;
    }

    .community-journal-links {
        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        column-gap: 25px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .community-section {
        padding: 60px 0;
    }

    .community-container {
        width: min(
            calc(100% - 30px),
            600px
        );
    }

    .community-grid {
        grid-template-columns: 1fr;

        gap: 16px;
    }

    .community-journal {
        grid-column: auto;
    }

    .community-card-inner {
        padding: 29px 23px 25px;
    }

    .community-title {
        font-size: 27px;
    }


    /* Кнопки */

    .community-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .community-button {
        width: 100%;
        flex: none;
    }


    /* Journal */

    .community-journal-photo {
        aspect-ratio: 1 / 0.78;
    }

    .community-journal-links {
        display: flex;
        flex-direction: column;
    }


    /* Telegram */

    .community-blog .community-telegram-content {
        font-size: 14px;
        line-height: 1.6;

        max-height: none;
        height: auto;

        overflow: visible;
    }

    .community-blog .community-telegram-content
    .community-telegram-heading {
        font-size: 16px;
    }

    .community-blog .community-telegram-list {
        margin-top: 20px;
    }

    .community-blog .community-telegram-switch {
        padding: 13px 0;

        font-size: 13px;
    }

    /*
     * На телефоне hover не должен менять
     * отступы. Переключение идёт по tap.
     */

    .community-blog .community-telegram-switch:hover {
        padding-left: 0;
        color: #5e1d53;
    }

    .community-blog .community-telegram-switch.is-active {
        padding-left: 0;
        color: #cca444;
    }

    .community-blog .community-telegram-switch:hover
    .community-telegram-switch-arrow {
        transform: none;
    }

    .community-blog .community-telegram-switch.is-active
    .community-telegram-switch-arrow {
        transform: translateX(4px);
    }

}


/* =========================================================
   VERY SMALL SCREENS
   ========================================================= */

@media (max-width: 390px) {

    .community-card-inner {
        padding-left: 19px;
        padding-right: 19px;
    }

    .community-button {
        font-size: 9px;

        padding-left: 10px;
        padding-right: 10px;
    }

}

 /* =========================================================
    MAX
    ФИКСИРОВАННАЯ ОБЛАСТЬ СООБЩЕНИЙ + АККУРАТНЫЙ СКРОЛЛ
    ========================================================= */

.community-messages {
	position: relative;

	height: 400px;

	overflow-y: auto;
	overflow-x: hidden;

	padding: 4px 18px 4px 0;

	scrollbar-width: thin;
	scrollbar-color:
		rgba(94, 29, 83, 0.22)
		transparent;
}


/* =========================================================
   АККУРАТНЫЙ SCROLLBAR
   ========================================================= */

.community-messages::-webkit-scrollbar {
	width: 5px;
}

.community-messages::-webkit-scrollbar-track {
	background: transparent;
}

.community-messages::-webkit-scrollbar-thumb {
	background: rgba(94, 29, 83, 0.20);
	border-radius: 10px;
}

.community-messages::-webkit-scrollbar-thumb:hover {
	background: rgba(94, 29, 83, 0.34);
}


/* =========================================================
   СООБЩЕНИЯ
   ========================================================= */

.community-message {
	padding: 16px 0;
}

.community-message + .community-message {
	border-top: 1px solid rgba(94, 29, 83, 0.10);
}


/* =========================================================
   МЯГКОЕ ЗАТЕНЕНИЕ СВЕРХУ И СНИЗУ
   ========================================================= */

.community-messages {
	mask-image: linear-gradient(
		to bottom,
		transparent 0,
		black 24px,
		black calc(100% - 24px),
		transparent 100%
	);

	-webkit-mask-image: linear-gradient(
		to bottom,
		transparent 0,
		black 24px,
		black calc(100% - 24px),
		transparent 100%
	);
}


/* =========================================================
   МОБИЛЬНЫЕ
   ========================================================= */

@media (max-width: 767px) {

	.community-messages {
		height: 350px;

		padding-right: 12px;

		mask-image: linear-gradient(
			to bottom,
			transparent 0,
			black 20px,
			black calc(100% - 20px),
			transparent 100%
		);

		-webkit-mask-image: linear-gradient(
			to bottom,
			transparent 0,
			black 20px,
			black calc(100% - 20px),
			transparent 100%
		);
	}

}

/* =========================================================
   TELEGRAM
   ПОЛНЫЕ ПОСТЫ СО СКРОЛЛОМ
   ========================================================= */

.community-telegram-feed {
	position: relative;

	height: 400px;

	overflow-y: auto;
	overflow-x: hidden;

	padding: 4px 18px 4px 0;

	scrollbar-width: thin;
	scrollbar-color:
		rgba(94, 29, 83, 0.22)
		transparent;

	mask-image: linear-gradient(
		to bottom,
		transparent 0,
		black 24px,
		black calc(100% - 24px),
		transparent 100%
	);

	-webkit-mask-image: linear-gradient(
		to bottom,
		transparent 0,
		black 24px,
		black calc(100% - 24px),
		transparent 100%
	);
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

.community-telegram-feed::-webkit-scrollbar {
	width: 5px;
}

.community-telegram-feed::-webkit-scrollbar-track {
	background: transparent;
}

.community-telegram-feed::-webkit-scrollbar-thumb {
	background: rgba(94, 29, 83, 0.20);
	border-radius: 10px;
}

.community-telegram-feed::-webkit-scrollbar-thumb:hover {
	background: rgba(94, 29, 83, 0.34);
}


/* =========================================================
   ПОСТ
   ========================================================= */

.community-telegram-post {
	padding: 18px 0;
}

.community-telegram-post + .community-telegram-post {
	border-top: 1px solid rgba(94, 29, 83, 0.12);
}


/* =========================================================
   ДАТА
   ========================================================= */

.community-telegram-post .community-post-date {
	margin-bottom: 10px;
}


/* =========================================================
   ПОЛНЫЙ ТЕКСТ
   ========================================================= */

.community-telegram-post-text {
	color: #30252f;

	font-size: 15px;
	line-height: 1.65;

	white-space: normal;
	word-wrap: break-word;
	overflow-wrap: break-word;
}


/* =========================================================
   КАРТИНКА
   ========================================================= */

.community-telegram-image {
	display: block;

	width: 100%;
	margin-top: 16px;

	overflow: hidden;

	border-radius: 12px;

	background: rgba(94, 29, 83, 0.05);
}

.community-telegram-image img {
	display: block;

	width: 100%;
	height: auto;

	object-fit: cover;
}


/* =========================================================
   ССЫЛКА
   ========================================================= */

.community-telegram-post .community-more {
	display: inline-block;

	margin-top: 14px;

	color: #5e1d53;

	font-size: 13px;
	font-weight: 600;

	text-decoration: none;
}

.community-telegram-post .community-more:hover {
	color: #cca444;
}


/* =========================================================
   МОБИЛЬНЫЕ
   ========================================================= */

@media (max-width: 767px) {

	.community-telegram-feed {
		height: 350px;

		padding-right: 12px;
	}

	.community-telegram-post {
		padding: 15px 0;
	}

	.community-telegram-post-text {
		font-size: 14px;
		line-height: 1.6;
	}

}