*,
*::before,
*::after {
    box-sizing: border-box;
}


:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --bg-card: #F7F7F7;
    --link-color: #0077cc;
}


body.dark-theme {
    --bg-color: #B8B8B8;     /* общий фон страницы */
    --text-color: #e0e0e0;   /* цвет текста */
    --bg-card: #2c2c2c;      /* фон блоков */
    --link-color: #66aaff;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}
body.dark-theme .article-page {
    color: var(--bg-card);
}
body.dark-theme  {
    color: var(--bg-card);
}

.layout {
    background-color: var(--bg-color);
}

.header-bar {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    background: #e0e0e0;
    padding: 1rem;
    gap: 1rem;
}
.site-name {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    justify-self: center;
}
.site-name a {
    text-decoration: none; /* Убирает подчёркивание */
    color: inherit; /* Наследует цвет текста от родителя */
}
.site-name a:hover {
   color:blue;
}
.lang-switch a {
    margin-left: 0.5rem;
    text-decoration: none;
    color: #333;
}

.lang-switch a:hover {
    text-decoration: underline;
}
/* Navigation */
.main-nav {
    background: #f0f0f0;
    padding: 1rem;
    text-align: center;
    
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 0;
    margin: 0 auto;
    
}

.main-nav li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.main-nav li a:hover {
    color: #0077cc;
}
.hamburger {
    display: none;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}

/* Базовое меню */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
}
/*.main-nav a.active {
    background-color: #0077cc;
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-weight: bold;
}*/
.main-nav a.active {
    color: #0077cc;
    font-weight: bold;
}



/* Мобильная адаптация */
@media (max-width: 728px) {
    .hamburger {
        display: block;
        margin-bottom: 0.5rem;
    }

    .main-nav ul {
       display: none;
    flex-direction: column;
    align-items: center;
    }

    .main-nav ul.show {
        display: flex;
    }
}
/* submenu */
/* Основное меню */
.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.5rem;
    position: relative;
}

.main-nav li {
    position: relative;
}

/* Подменю */
.main-nav li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1000;
    flex-direction: column;
}

.main-nav li:hover > ul {
    display: flex;
}

.main-nav li ul li {
    width: 100%;
}

.main-nav li ul a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    white-space: nowrap;
}

.main-nav li ul a:hover {
    background: #eee;
}
body.dark-theme .main-nav li ul a:hover {
    background: #444; /* тёмно-серый фон при наведении */
    color: #fff;      /* белый текст */
}

/* Гамбургер-режим — вертикальный */
@media (max-width: 728px) {
    .main-nav ul {
        flex-direction: column;
    }

    .main-nav li ul {
        position: static;
        display: none;
        box-shadow: none;
    }

    .main-nav li:hover > ul,
    .main-nav li ul.show {
        display: flex;
    }
}


.has-submenu {
    position: relative;
    cursor: pointer;
}

@media (max-width: 728px) {
    .main-nav li ul {
        display: none;
        flex-direction: column;
    }

    .main-nav li ul.show {
        display: flex;
    }

    .main-nav a.has-submenu::after {
        content: '';
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
}

/* update */
@media (max-width: 728px) {
    #nav-menu {
        display: none;
        flex-direction: column;
        gap: 0.5rem;
        padding-left: 1rem;
    }

    #nav-menu.show {
        display: flex;
    }

    .main-nav ul {
        flex-direction: column;
    }
}
/* menu arrow */
.has-submenu > a {
    position: relative;
    padding-right: 1.2em; /* место для стрелки */
}

.has-submenu .arrow {
    font-size: 0.6em;
    position: relative;
    top: -1px;
    margin-left: 4px;
    transition: transform 0.3s ease;
}
.has-submenu .arrow {
    transition: transform 0.3s ease;
}

.has-submenu.open .arrow {
    transform: translateY(-50%) rotate(180deg);
}


/* Article+ list of categories */
.main-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
    padding: 2rem;
   background: var(--bg-color);

}


/*  */
.main-article {
    background: var(--bg-card);
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow-x: hidden;
    max-width: 100%;
   
}
body.dark-theme .main-article {
    background: #2a2a2a;
    color: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    margin-top:10px;
}
.main-article img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 300px;
    display: block;
    margin: 1rem 0;
}

.main-article h1,
.main-article h2,
.main-article h3 {
    font-size: 2rem;
    word-break: break-word;
}

.main-article p {
    font-size: 1.3rem;
    line-height: 1.6;
    word-wrap: break-word;
}






/*  */

.categories {
    background: #fff;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-size: 1.1rem;
}

.categories h3 {
    margin-top: 0;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
body.dark-theme .categories h2 {
    color: #f0f0f0;
}
.categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.categories li a {
  /*  display: block;
    padding: 0.5rem 0.75rem;
    background: #f0f0f0;*/
    text-decoration: none;
    border-radius: 4px;
    color: #008AB8;
    transition: background 0.2s;
}

.categories li a:hover {
    background: #dcdcdc;
}

/* footer */

footer {
    background: #ccc;
    padding: 1rem;
    text-align: center;
}





.footer-links a {
    margin-left: 1rem;
    text-decoration: none;
    color: #333;
}



.footer-wrapper {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-left {
    justify-self: start;
}

.footer-center {
    justify-self: center;
}

.footer-right {
    justify-self: end;
}

.footer-right a {
    margin-left: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
}

.footer-right a:hover {
    text-decoration: underline;
}
.footer-wrapper {
    line-height: 1.6; /* увеличивает высоту строки */
}

/* Privjazka footer k nizu */
html, body {
    height: 100%;
    margin: 0;
}

.layout {
    display: grid;
    grid-template-rows: auto auto 1fr auto; /* header, nav, content, footer */
    min-height: 100vh;
}

/* black theme */


a {
    color: var(--link-color);
}

.main-article, .categories, .article-card {
    background: var(--bg-card);
}
header,
.main-nav,
footer {
    background: var(--bg-card);
    color: var(--text-color);
}

.logo,
.site-name,
.lang-switch a,
.main-menu,
.footer-links a {
    color: var(--text-color);
}

.lang-switch a:hover,
.main-nav li a:hover,
.footer-links a:hover {
    color: var(--link-color);
}
body.dark-theme .main-nav li a {
    color: #ffffff;
}
.header-bar {
    background: var(--bg-card);
}
/*templates/article_list */
.article-page {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
    padding: 2rem;
}
.article-page {
    background: var(--bg-color);
}

.article-page .categories {
    font-size: 1.1rem;
}

.article-page .categories h2 {
    font-size: 1.4rem;
}

.article-list article {
    background: var(--bg-card);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-size: 1.1rem;
    line-height: 1.6;
}

.article-list h2 {
    margin-top: 0;
    font-size: 1.4rem;
}

.pagination a {
    margin-right: 0.5rem;
    text-decoration: none;
}
.categories a.active {
    background-color: #0077cc;
    color: white;
    font-weight: bold;
}
.categories a.active {
    background-color: #0077cc;
    color: white;
    font-weight: bold;
    position: relative;
    padding-left: 1.5rem;
}

.categories a.active::before {
    content: "✔";
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}
.logo {
     font-size: 4rem;
  text-align: center;
  margin-left: 100px;
}
.logo {
    margin-left: 100px;
}

.logo-img {
    max-width: 100px; /* или нужный вам размер */
    height: auto;
    display: block;
}
.logo img {
    border-radius: 5%; /* Делает изображение полностью круглым, если оно квадратное */
    width: 70px;       /* Примерная ширина */
    height:  auto;      /* Примерная высота */
   /* object-fit: cover; */ /* Чтобы изображение не искажалось */
}


/* Центрирование на малых экранах */
@media (max-width: 1024px) {
    .logo {
        margin-left: 0;
        text-align: center;
    }
}


/* contact.php */

form {
    max-width: 400px;
    min-width: 250px;
    width:100%;
    margin: 2rem auto;
    padding: 2rem;
    padding-right: 4rem;
    background: var(--bg-card);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
   /* gap: 1rem;*/
    align-items: stretch;
    font-size: 1.1rem;
}

body.dark-theme form {
    background: #2a2a2a;
    color: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    margin-top:10px;
}

form label {
    font-weight: bold;
    font-size: 1.1rem;
}

form input,
form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: var(--bg-color);
    color: #000042;
    font-size: 1rem;
}

form textarea {
    min-height: 150px;
    resize: vertical;
}

form button {
    padding: 0.75rem 1.5rem;
    background: #0077cc;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    align-self: flex-start;
    font-size: 1rem;
}

form button:hover {
    background: #005fa3;
}
/*article_view */
.article-grid-3 {
    display: grid;
    grid-template-columns: 1fr 700px 1fr;
    gap: 2rem;
    padding: 2rem;
    margin-bottom:15px;
}
.article-content {
    font-size: 1.3rem;
    line-height: 1.6;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-page h1,
.article-grid-3 h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}
.lang-switch a {
    font-size: 1.3rem;
}

.main-nav li a {
    font-size: 1.5rem;
}

footer,
.footer-wrapper p,
.footer-links a {
    font-size: 1.3rem;
}
.article-grid-3 article {
    background: var(--bg-card);
    color: var(--text-color);
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 8px;
}
.article-content {
    margin-top: 1.5rem;
}

.article-image {
    margin-top: 1rem;
    text-align: center;
}

/* for tablet and mobile */
@media (max-width: 1024px) {
    .main-grid,
    .article-page,
    .article-grid-3 {
        grid-template-columns: 1fr; /* одна колонка */
    }

    .footer-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.5rem;
    }

    .footer-left,
    .footer-center,
    .footer-right {
        justify-self: center;
    }

    .header-bar {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .site-name {
        justify-self: center;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }

    .article-list article,
    .main-article {
        margin: 0 auto;
        width: 100%;
    }
.categories {
        margin: 0 auto;
        width: 50%;
    }
    form {
        width: 90%;
        padding: 1rem;
    }
    .logo {
        margin-left: 0;
        justify-self: center;
        text-align: center;
    }
}
/* privacy.php */
.privacy-page {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--bg-card);
    color: var(--text-color);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
}

.privacy-page h1,
.privacy-page h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.privacy-page p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* dark theme */
body.dark-theme .article-list article,
body.dark-theme .article-list h2,
body.dark-theme .article-list p,
body.dark-theme .article-list a,
body.dark-theme .moda {
    color: var(--text-color);
 }
 
body.dark-theme .total_articles h2 {
   color: var(--bg-card);
 }
body.dark-theme .moda{
    background: var(--bg-card);
 }


/* === КОПИЯ ИЗ test_style.css === */

/* Минимальный CSS для комментариев */

body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background: #f4f4f4;
  color: #222;
}

.comments {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comments h3,
.comments h4 {
  margin-top: 0;
  font-size: 1.5rem;
}

.comments ul {
  list-style-type: none;
  padding-left: 0;
}

.comments li {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #eef;
  border-left: 4px solid #0077cc;
  border-radius: 4px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.reply-button {
  margin-top: 0.5rem;
  padding: 0.3rem 0.6rem;
  background: #0077cc;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  width: 80px;
}

.reply-form {
  margin-top: 2rem;
  padding: 1rem;
  background: #fefefe;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.reply-form input,
.reply-form textarea {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}

.reply-form button {
  background: #0077cc;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
 
}

/*@media (max-width: 480px) {
  .comments,
  .reply-form {
    margin: 1rem;
    padding: 0.75rem;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
  }

  .comments li {
    padding: 0.5rem;
    font-size: 0.95rem;
  }

  .reply-form input,
  .reply-form textarea {
    font-size: 0.95rem;
  }

  .reply-button {
    font-size: 0.6rem;
    padding: 0.4rem;
      width: 64px;
  }
}
*/

/* === FIX: Комментарии в article-grid-3 === */

/* Адаптация article-grid-3 и article для комментариев */
.article-grid-3 {
    display: grid;
    grid-template-columns: 1fr minmax(0, 800px) 1fr;
    gap: 1rem;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 1rem;
    margin-top:15px;
}

.article-grid-3 > div {
    width: 100%;
    box-sizing: border-box;
}

.article-grid-3 article {
    width: 100%;
    box-sizing: border-box;
}

.article-grid-3 article > .comments {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 480px) {
    .article-grid-3 {
        display: block;
        padding: 0.5rem;
    }

    .article-grid-3 article > .comments {
        padding: 0.5rem;
    }
}


/* === ISOLATION: comments-wrapper to avoid grid conflicts === */

/* Изоляция блока комментариев от сетки article-grid-3 */
.comments-wrapper {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    padding: 1rem 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.comments {
    width: 100%;
    max-width: 700px;
    box-sizing: border-box;
}


/* === DARK THEME: Комментарии === */

/* Тёмная тема для блока комментариев */
body.dark-theme .comments-wrapper {
    background: #B8B8B8;
    color: #f0f0f0;
}

body.dark-theme .comments {
    background: #2a2a2a;
    color: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    margin-top:10px;
}

body.dark-theme .comments li {
    background: #333;
    border-left: 4px solid #3399ff;
    color: #ddd;
}

body.dark-theme .reply-button {
    background: #3399ff;
    color: white;
}

body.dark-theme .reply-form {
    background: #2a2a2a;
    color: #f0f0f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

body.dark-theme .reply-form input,
body.dark-theme .reply-form textarea {
    background: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #555;
}

body.dark-theme .reply-form button {
    background: #3399ff;
    color: white;
}
/* === FOOTER THEME BUTTON STYLING === */

/* Стили для кнопки "Переключить тему" в футере */
.footer-center button {
    padding: 0.6rem 1.2rem;
    background-color: #3399ff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.footer-center button:hover {
    background-color: #1f7ed0;
}

body.dark-theme .footer-center button {
    background-color: #444;
    color: #fff;
}

body.dark-theme .footer-center button:hover {
    background-color: #666;
}
/* ****************************************************************************** */

body {
            margin: 0;
            font-family: Arial, sans-serif;
            background: #f8f8f8;
            color: #333;
        }
        .layout {
            display: grid;
            grid-template-areas:
                "header"
                "nav"
                "main"
                "footer";
            gap: 20px;
            max-width: 1200px;
            padding: 20px;
            margin: auto;
        }

        /* Шапка: 3 колонки */
        header .header-grid {
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
            background: #333;
            padding: 20px;
            color: white;
        }
        .logo {
            justify-self: start;
        }
        .logo-img {
            max-height: 50px;
        }
        .site-name {
            justify-self: center;
            font-size: 2em;
            font-weight: bold;
        }
        .site-name a {
            color: white;
            text-decoration: none;
        }
        .lang-switch {
            justify-self: end;
        }
        .lang-switch a {
            margin-left: 10px;
            color: white;
            text-decoration: none;
            font-weight: bold;
        }
        .lang-switch a.active {
            text-decoration: underline;
        }


        /* Сетка для main */
        main.grid-main {
            display: grid;
            gap: 20px;
            grid-area: main;
        }
        main .top-row {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 20px;
        }
        @media (max-width: 728px) {
    main .top-row {
            display: grid;
            grid-template-columns: 1fr;
            gap: 20px;
        }
}
        .main-feature, .category-list, .recent-category {
            background: #fff;
            padding: 20px;
            border: 1px solid #ddd;
        }
        .main-feature img {
            max-width: 100%;
            height: auto;
            margin-bottom: 15px;
        }
        .case-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 20px;
        }
        .case {
            background: #fff;
            padding: 15px;
            border: 1px solid #ccc;
            box-shadow: 0 0 5px rgba(0,0,0,0.05);
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .case img {
            width: 100%;
            height: auto;
            object-fit: cover;
            max-height: 200px;
        }
        .case h3 {
            margin: 0;
        }
        .case p {
            flex: 1;
        }
        .category-list ul {
            list-style: none;
            margin: 0;
            padding: 0;
        }
        .category-list li {
            margin-bottom: 8px;
        }
        .category-list a {
            color: #0077cc;
            text-decoration: none;
        }

        footer {
            grid-area: footer;
            background: #333;
            color: #fff;
            padding: 15px;
        }
        .footer-wrapper {
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 10px;
        }
        .footer-right a {
            margin-left: 10px;
            color: #fff;
            text-decoration: none;
        }

        
      
    
/* Темная тема */
body.dark-theme {
    background: #121212;
    color: #e0e0e0;
}
.dark-theme header,
.dark-theme nav.main-nav,
.dark-theme .main-feature,
.dark-theme .category-list,
.dark-theme .recent-category,
.dark-theme footer 
.dark-theme .modal-overlay{
    background: #1e1e1e;
    color: #e0e0e0;
}
.dark-theme .main-nav a,
.dark-theme .site-name a,
.dark-theme .lang-switch a,
.dark-theme .footer-right a,
.dark-theme .category-list a {
    color: #90caf9;
}
.dark-theme .main-nav .submenu {
    background: #2c2c2c;
    border-color: #444;
}
.dark-theme .case {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}
.dark-theme .case a {
    color: #81d4fa;
}
.dark-theme .main-feature a {
    color: #bb86fc;
}


/* Темная тема */
body.dark-theme .hamburger {
    color: #e0e0e0; /* светлый текст на темном фоне */
}

/* templates/article_view.php */

.grid-title {
    grid-area: title;
    text-align: center;
}

.grid-tabs {
    grid-area: tabs;
    text-align: center;
}

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

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.tab-btn {
    margin: 0 0.5em;
    padding: 0.5em 1em;
    border: none;
    border-radius: 5px;
    background-color: #0077cc;
    color: white;
    cursor: pointer;
}

.tab-btn.active {
    background-color: #005fa3;
}
.article-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1rem;
}
.grid-content {
    grid-area: content;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}



.content-section.active {
    display: block;
}

.article-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.grid-tabs {
    grid-area: tabs;
    background: #eef3f8;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tab-btn {
    background: #007acc;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.5em 1.2em;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.tab-btn:hover {
    background: #005fa3;
}

.tab-btn.active {
    background: #004c82;
}
body.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-theme .article-grid {
    background-color: #1e1e1e;
}

body.dark-theme .grid-tabs {
    background-color: #2a2a2a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

body.dark-theme .grid-content {
    background-color: #252525;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

body.dark-theme .tab-btn {
    background-color: #444;
    color: #e0e0e0;
}

body.dark-theme .tab-btn.active {
    background-color: #666;
}

body.dark-theme .article-img {
    box-shadow: 0 2px 6px rgba(255,255,255,0.1);
}

body.dark-theme a {
    color: #81caff;
}
body.dark-theme .modal-content{
    background: #1e1e1e;
    color: #e0e0e0;
}
@media (max-width: 500px) {
    .comment-form {
        padding: 10px;
        font-size: 14px;
    }

    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form textarea {
        width: 100%;
        box-sizing: border-box;
        font-size: 14px;
    }

    .comment-form button {
        width: 100%;
        font-size: 16px;
        padding: 10px;
    }
}
@media (max-width: 500px) {
    .comment-form, .comment-form form {
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }

    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form textarea {
        width: 100%;
        box-sizing: border-box;
        font-size: 14px;
    }

    .comment-form button {
        width: 100%;
        font-size: 16px;
        padding: 10px;
    }

    .comment-form label {
        font-size: 14px;
    }
}
/* contact.php */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 6px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}
.article-grid {
    display: grid;
    grid-template-areas:
        ". title ."
        ". . tabs"
        "content content content";
    grid-template-rows: auto auto 1fr;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* update css */
.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
}

.grid-tabs, .grid-content {
    grid-column: 1 / -1;
}

.grid-content {
    overflow-wrap: break-word;
    word-break: break-word;
}
.article-text {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.15rem; /* ~18.4px на большинстве экранов */
    line-height: 1.75;  /* Высокая читаемость и воздушность текста */
    color: #1e1e1e;
    text-align: justify;
    letter-spacing: 0.01em;
    word-spacing: 0.05em;
    padding: 1.5rem 1rem;
    MAX-WIDTH: 850px;
    /*background-color: #ffffff;*/
}

/* Поддержка мобильных устройств */
@media (max-width: 768px) {
    .article-text {
        font-size: 1.05rem; /* ~16.8px */
        line-height: 1.7;
        padding: 1rem;
    }
}
.dark-theme .article-text {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}
body.dark-theme .total_articles  {
    color: var(--bg-card);
 }
 .total_articles{
    padding:15px;
    margin:10px;
    background: var(--bg-card);
    font-size: 1.15rem;   
 }
 
