/* ============================================
   BLOG CARDS SECTION
   ============================================ */

/* MEDIA QUERIES */

.article-info-theme {
    display: flex;
    gap: 0;
    border-radius: 10px;
    padding: 0;
    position: relative;
}

.article-info-theme-mobileTablet {
    display: none;
    gap: 0;
    border-radius: 10px;
    padding: 0;
    position: relative;
}

.article-info-theme-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    padding: 0;
    height: 50px;
}

.article-info-theme-button svg {
    transition: all 0.3s ease;
}

/* Inner divs reset */
.dark-theme {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* ===========================
   LIGHT MODE (Default)
   =========================== */
body:not(.dark) .light-theme-btn {
    width: 130px;
    background-color: var(--color-bg-alt);
    display: flex;
    justify-content: end;
    padding-right: 10px;
}

body:not(.dark) .light-theme-btn svg {
    width: 30px;
    height: 30px;
}

body:not(.dark) .dark-theme-btn {
    width: 52px;
    background-color: #2C2C2C;
}

body:not(.dark) .dark-theme-btn svg {
    width: 20px;
    height: 20px;
}

/* ===========================
   DARK MODE
   =========================== */
body.dark .dark-theme-btn {
    width: 130px;
    background-color: #2C2C2C;
    /* Dark background for active dark button */
}

body.dark .dark-theme-btn svg {
    width: 30px;
    height: 30px;
}

body.dark .light-theme-btn {
    width: 52px;
    background-color: #fff;
}

body.dark .light-theme-btn svg {
    width: 20px;
    height: 20px;
}

/* Specific SVG styling for light button in dark mode */
body.dark .light-theme-btn .white-theme svg path {
    stroke: #000;
    /* Make stroke black */
    fill: #000;
    /* Make fill black if needed, or adjust based on specific paths */
}

/* Adjusting paths for the specific SVGs provided */
/* The light theme SVG has both stroke and fill paths. 
   The user said "svg в ней черной". */
body.dark .light-theme-btn .white-theme svg path[stroke] {
    stroke: #000;
}

body.dark .light-theme-btn .white-theme svg path[fill] {
    fill: #000;
}

.article-content {
    margin-top: 40px;
}

.text-section {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    gap: 10px;
}

.text-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    font-weight: 400;
    font-size: 15px;
}

.critic-list {
    padding-left: 50px;
}

.intro-text {
    font-size: 24px;
}

.section-title {
    font-size: 20px;
}

.section-text {
    font-weight: 400;
    font-size: 15px;
}

.section-text.emphasis {
    font-weight: 400;
    font-size: 15px;
}

.step-title {
    color: var(--color-primary);
    font-size: 15px;
}

.question-item {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
    align-items: flex-start;
}

.comments-section {
    margin-top: 40px;
}

textarea {
    width: 100%;
    max-width: 522px;
    min-height: 150px;
    padding: 15px;
    border: none;
    border-radius: 15px;
    /* Закруглённые углы */
    background-color: var(--color-bg-alt);
    font-size: 15px;
    resize: vertical;
    /* Разрешить вертикальное изменение размера */
    box-sizing: border-box;
}

textarea::placeholder {
    color: #2C2C2C80;
    /* Чёрный плейсхолдер */
    opacity: 0.5;
    /* Немного прозрачности для читаемости */
    font-size: 15px;
    font-weight: 400;
    font-size: 15px;
    line-height: 120%;
    letter-spacing: 0%;

}

textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    /* Опционально: зелёная обводка при фокусе */
    box-shadow: 0 0 0 2px rgba(154, 195, 85, 0.2);
}

.container.comments-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 20px;

}

.article-send-comment-button {
    background-color: var(--color-primary);
    color: var(--color-bg);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
}

.article-review {
    display: flex;
    gap: 20px;
}

.mobile-text {
    display: none;
}

.article-review-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.container.article-reviews {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-review-avatar {
    width: auto;
    height: 88px;
}

.line-separator {
    display: flex;
    width: 100%;
    height: 1px;
    background-color: var(--color-bg-alt);
}

@media (min-width: 768px) and (max-width: 1280px) {

    /* Header адаптация для планшетов */
    .logo-desktop {
        display: none;
    }

    .header-left {
        display: none;
    }

    .header-content {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* ЛОГО по центру */
    .header-center {
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    /* бургер слева */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 32px;
        height: 32px;
        background: transparent;
        border: 0;
        cursor: pointer;
    }

    .mobile-nav__panel {
        display: flex;
        flex-direction: column;
    }

    .mobile-menu-toggle span {
        display: block;
        height: 2px;
        background: #9AC355;
        border-radius: 2px;
    }

    .mobile-panel-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .mobile-nav__socials {
        margin-bottom: 30px;
        gap: 5px;
    }

    /* справа только «Войти» */
    .header-right {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .login-btn {
        background: #9AC355;
        color: #fff;
        padding: 8px 14px;
        border-radius: 10px;
        font-weight: 500;
        font-style: Medium;
        font-size: 20px;
        line-height: 100%;
        letter-spacing: 0%;
        text-align: center;
    }

    .header-right .social-icons {
        display: none;
    }

    .top-header-title {
        font-size: 34px;
    }

    .top-header-link {
        font-size: 20px;
    }

    /* Blog Cards Tablet */
    .blog-card-left {
        display: flex;
        justify-content: center;
        margin-top: 30px;
        grid-column: 1;
        grid-row: 1;
    }

    .blog-card-center {
        grid-column: 1 / span 2;
        grid-row: 3;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 15px;
        gap: 20px;
    }

    .blog-card-media {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: center;
        max-width: 180px;
        max-height: 100%;
    }

    .blog-card-media img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
        display: block;
    }

    .blog-card-media img {
        height: auto;
    }

    .next-article-btn,
    .prev-article-btn {
        display: none;
    }

    .blog-card {
        display: grid;
        grid-template-columns: 1fr auto;
        background: #F1F2F5;
        grid-template-rows: auto 1fr;
        border-radius: 20px;
        width: 100%;
        height: auto;
    }

    .blog-card-title {
        font-size: 15px;
    }

    .blog-card-excerpt {
        font-size: 15px;
    }

    .blog-card-button {
        font-size: 15px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
    }

    .footer-content-left {
        order: 2;
    }

    .footer-content-right {
        order: 1;
    }

    /* Pagination Tablet */
    .pagination {
        gap: 15px;
        margin-top: 30px;
    }

    .pagination-arrow svg {
        width: 28px;
        height: 18px;
    }

    .pagination-info {
        font-size: 15px;
    }

    .article-info-theme {
        display: none;
    }

    .article-info-theme-mobileTablet {
        display: flex;
        margin-top: 10px;
    }
}

@media (max-width: 767px) {
    .header {
        padding: 1rem 0;
    }

    /* Header and Hero компоненты */
    .header-left {
        display: none;
    }

    .header-content {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
        width: 100%;
    }

    /* ЛОГО по центру */
    .header-center {
        display: block;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .logo-desktop {
        display: none;
    }

    .logo-tablet-mobile {
        display: block;
    }

    /* бургер слева */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 32px;
        height: 32px;
        background: transparent;
        border: 0;
        cursor: pointer;
        position: relative;
        z-index: 1001;
    }

    .mobile-nav__panel {
        display: flex;
        flex-direction: column;
    }

    .mobile-panel-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
    }

    .mobile-nav__socials {
        margin-bottom: 30px;
        gap: 5px;
        padding: 0 20px;
        justify-content: flex-start;
    }

    /* справа только «Войти» */
    .header-right {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .login-btn {
        background: #9AC355;
        color: #fff;
        padding: 12px 20px;
        border-radius: 8px;
        font-weight: 500;
        font-size: 14px;
        line-height: 100%;
        text-align: center;
    }

    .header-right .social-icons {
        display: none;
    }

    .top-header-title {
        font-size: 20px;
    }

    .top-header-link {
        font-size: 16px;
    }

    /* Модалки регистрации и входа */
    .login-modal,
    .registration-modal {
        display: none;
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    /* Когда модалка открыта на мобильных */
    .login-modal[style*="display: block"],
    .registration-modal[style*="display: block"] {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .login-modal-content,
    .registration-modal .login-modal-content {
        width: 90%;
        max-width: 340px;
        background: var(--color-bg);
        border-radius: var(--radius-md);
        padding: var(--spacing-md);
        box-sizing: border-box;
        margin: 0;
    }

    /* Заголовок */
    .login-top-header {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .login-title {
        font-size: 18px;
        font-weight: 600;
        text-align: center;
    }

    .login-close {
        display: flex;
    }

    .login-close svg {
        width: 20px;
        height: 20px;
    }

    /* Поля формы */
    .login-form input {
        width: 100%;
        height: 60px;
        padding: 5px 12px;
        margin-bottom: 12px;
        font-size: 16px;
        border: 1px solid #F1F2F5;
        border-radius: 20px;
        box-sizing: border-box;
    }

    /* Кнопки */
    .login-form-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
    }

    .login-form-buttons button {
        width: 100%;
        padding: 12px;
        background: var(--color-primary);
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        border: none;
        border-radius: 12px;
        cursor: pointer;
    }

    .login-form-buttons {
        font-size: 16px;
        color: #7cc400;
        text-align: center;
        text-decoration: none;
        cursor: pointer;
    }

    .registration-button {
        display: block;
        margin-top: 8px;
        font-size: 16px;
    }

    .forget-email-text {
        display: block;
        font-size: 14px;
        margin-top: 8px;
        color: rgb(0, 0, 0, 0.5);
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
    }

    .footer-content-left {
        order: 2;
        width: 100%;
    }

    .footer-content-right {
        order: 1;
        flex-direction: row;
        width: 100%;
    }

    .footer-content-right img {
        width: 80px;
        height: 80px;
    }

    .footer-content-left-links {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        width: 85%;
    }

    .footer-content-left-links-bottom {
        flex-direction: column;
        gap: 40px;
    }

    .footer-copyright {
        bottom: 20px;
        font-size: 14px;
    }

    .footer-wave {
        bottom: -20px;
        width: 100%;
    }

    /* Blog Cards Mobile */

    .blog-list {
        display: flex;
        overflow-x: auto;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        scroll-snap-type: x mandatory;
    }

    .blog-list::-webkit-scrollbar {
        display: none;
    }

    .blog-list-item {
        flex: 0 0 100%;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        box-sizing: border-box;
    }

    .blog-card {
        display: grid;
        grid-template-columns: 1fr 180px;
        grid-template-rows: auto 1fr;
        gap: 10px;
        width: 100%;
        height: 440px;
    }

    .blog-card-left {
        display: flex;
        justify-content: start;
        grid-column: 1;
        grid-row: 1;
    }

    .blog-card-media {
        grid-column: 2;
        grid-row: 1;
    }

    .blog-card-center {
        grid-column: 1 / span 2;
        grid-row: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 15px;
        gap: 10px;
    }

    .next-article-btn,
    .prev-article-btn {
        display: none;
    }

    .blog-card-title {
        font-weight: 600;
        font-size: 18px;
        line-height: 100%;
    }

    .blog-card-excerpt {
        font-size: 18px;
        color: #666;
        margin: 0 0 16px 0;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        display: -moz-box;
        -moz-line-clamp: 3;
        -moz-box-orient: vertical;
        box-orient: vertical;
        max-height: calc(1.4em * 3);
    }

    .blog-card-button {
        text-align: start;
        font-size: 18px;
    }

    /* Pagination Mobile */
    .pagination {
        gap: 12px;
        margin-top: 25px;
    }

    .pagination-arrow svg {
        width: 24px;
        height: 16px;
    }

    .pagination-info {
        font-size: 14px;
        gap: 4px;
    }

    .article-info-theme {
        display: none;
    }

    .article-info-theme-mobileTablet {
        display: flex;
        margin-top: 10px;
    }

    .article-info-author {
        flex-direction: column;
    }

    .article-review {
        display: grid;
        grid-template-areas:
            "avatar content"
            "text text";
        grid-template-columns: 88px 1fr;
        gap: 8px 12px;
    }

    .article-review-avatar {
        grid-area: avatar;
    }

    .article-review-content {
        grid-area: content;
    }

    /* Скрываем десктопный текст */
    .desktop-text {
        display: none;
    }

    /* Показываем мобильный текст */
    .mobile-text {
        display: block;
        grid-area: text;
        margin: 0;
    }

}

/* === ТЁМНАЯ ТЕМА === */
body.dark {
    --color-text: #ffffff;
    --color-text-muted: rgba(255, 255, 255, 0.65);
    --color-bg: #2C2C2C;
    --color-bg-alt: #1e1e1e;
    --color-border: #333333;
    --color-secondary: #252525;
}

body.dark .dark-theme {
    background-color: transparent;
    border: 1px solid white;
    display: flex;
    justify-content: start;
    padding-left: 10px;
}

body.dark .header {
    background-color: #484846;
}

body.dark .login-btn {
    color: var(--color-text);
}

/* Карточки статей в тёмной теме */
body.dark .blog-card {
    background: #484846;
}

body.dark .blog-card::after {
    background: linear-gradient(to top, rgba(154, 195, 85, 0.45), transparent);
}

/* Текстовое поле комментариев */
body.dark textarea {
    background: #484846;
    color: #fff;
}

body.dark textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Мобильное меню */
body.dark .mobile-nav__panel {
    background: var(--color-bg-alt);
}

body.dark .mobile-nav__list a {
    color: #fff;
}

/* Модалки */
body.dark .login-modal-content {
    background: var(--color-bg-alt);
}

/* Луна */
.dark-theme svg path {
    fill: #9AC355;
    fill-opacity: 0.4;
    transition: fill-opacity 0.3s ease;
}

body.dark .dark-theme svg path {
    fill-opacity: 1;
}

/* Солнце */
.white-theme svg *,
.white-theme svg path {
    fill: #2C2C2C;
    stroke: #2C2C2C;
    transition: all 0.3s ease;
}

body.dark .white-theme svg *,
body.dark .white-theme svg path {
    fill: rgba(255, 255, 255, 0.5);
    stroke: rgba(255, 255, 255, 0.5);
}

body.dark .line-separator {
    background-color: white;
}

body.dark .article-info-author-button {
    color: white;
}

/* Ползунок в тёмной теме (справа) */
body.dark .article-info-theme::before,
body.dark .article-info-theme-mobileTablet::before {
    left: 48px;
    /* 84px - 4px - 32px = 48px */
}

body.dark .article-send-comment-button {
    color: white;
}