/**
 * Genius Sounds — блог и страница статьи в стилистике микросервисов.
 * Разметку темы не меняем, только перекрашиваем и переверстываем.
 */

body.gs-blog-page,
body.gs-post-page {
    --gs-bg: #080c14;
    --gs-surface: #131b2b;
    --gs-surface-hover: #1e2a42;
    --gs-border: rgba(148, 163, 184, 0.14);
    --gs-border-strong: rgba(129, 140, 248, 0.38);
    --gs-text: #f1f5f9;
    --gs-muted: #94a3b8;
    --gs-primary: #6366f1;
    --gs-primary-light: #818cf8;
    --gs-accent: #22d3ee;
    --gs-radius: 16px;
    --gs-radius-sm: 10px;
    --gs-ease: cubic-bezier(0.22, 1, 0.36, 1);

    background: var(--gs-bg) !important;
    color: var(--gs-text);
}

body.gs-blog-page .l-canvas,
body.gs-blog-page .l-main,
body.gs-blog-page #page-content,
body.gs-blog-page .l-section,
body.gs-post-page .l-canvas,
body.gs-post-page .l-main,
body.gs-post-page #page-content,
body.gs-post-page .l-section {
    background: transparent !important;
}

body.gs-blog-page h1,
body.gs-blog-page h2,
body.gs-blog-page h3,
body.gs-post-page h1,
body.gs-post-page h2,
body.gs-post-page h3,
body.gs-post-page h4 {
    color: var(--gs-text) !important;
}

body.gs-blog-page p,
body.gs-blog-page li,
body.gs-post-page p,
body.gs-post-page li {
    color: #cbd5e1;
}

/* ---------------------------------------------------------------- Список постов */

body.gs-blog-page .w-grid-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

body.gs-blog-page .w-grid-item {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    position: static !important;
    transform: none !important;
}

body.gs-blog-page .w-grid-item-h {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    background: var(--gs-surface);
    transition: transform 0.16s var(--gs-ease), border-color 0.18s var(--gs-ease);
}

body.gs-blog-page .w-grid-item-h:hover {
    transform: translateY(-3px);
    border-color: var(--gs-border-strong);
}

body.gs-blog-page .w-post-elm.post_image {
    margin: 0 !important;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

body.gs-blog-page .w-post-elm.post_image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.gs-blog-page .w-post-elm.post_title {
    margin: 0 !important;
    padding: 16px 18px 0;
    font-size: 17px !important;
    line-height: 1.3;
    font-weight: 700;
}

body.gs-blog-page .w-post-elm.post_title,
body.gs-blog-page .w-post-elm.post_title *,
body.gs-blog-page .w-post-elm.post_title a {
    color: var(--gs-text) !important;
}

body.gs-blog-page .w-post-elm.post_title a:hover,
body.gs-blog-page .w-post-elm.post_title a:hover * {
    color: var(--gs-primary-light) !important;
}

body.gs-blog-page .w-post-elm.post_content,
body.gs-blog-page .w-post-elm.post_excerpt {
    padding: 8px 18px 0;
    color: var(--gs-muted) !important;
    font-size: 14.5px;
}

body.gs-blog-page .w-post-elm.post_date,
body.gs-blog-page .w-post-elm.post_taxonomy {
    padding: 0 18px;
    color: var(--gs-muted) !important;
    font-size: 13px;
}

body.gs-blog-page .w-post-elm.post_taxonomy a {
    color: var(--gs-primary-light) !important;
}

body.gs-blog-page .w-grid-item-h > *:last-child {
    padding-bottom: 18px;
}

body.gs-blog-page .w-btn,
body.gs-post-page .w-btn {
    background: linear-gradient(135deg, var(--gs-primary) 0%, #8b5cf6 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
}

/* Пагинация темы */

body.gs-blog-page .w-pagination-pages a,
body.gs-blog-page .w-pagination-pages span,
body.gs-blog-page .pagination a,
body.gs-blog-page .pagination span {
    border: 1px solid var(--gs-border) !important;
    border-radius: var(--gs-radius-sm) !important;
    background: var(--gs-surface) !important;
    color: var(--gs-text) !important;
}

body.gs-blog-page .w-pagination-pages .current,
body.gs-blog-page .pagination .current {
    background: linear-gradient(135deg, var(--gs-primary) 0%, #8b5cf6 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
}

/* ---------------------------------------------------------------- Статья */

body.gs-post-page .l-section-h,
body.gs-post-page .w-post-elm.post_content {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

body.gs-post-page .w-post-elm.post_content {
    font-size: 17px;
    line-height: 1.75;
    color: #cbd5e1;
}

body.gs-post-page .w-post-elm.post_content h2 {
    margin: 36px 0 12px;
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
}

body.gs-post-page .w-post-elm.post_content h3 {
    margin: 26px 0 10px;
    font-size: clamp(18px, 2.4vw, 21px);
    font-weight: 700;
}

body.gs-post-page .w-post-elm.post_content p {
    margin: 0 0 16px;
}

body.gs-post-page .w-post-elm.post_content ul,
body.gs-post-page .w-post-elm.post_content ol {
    margin: 0 0 18px 22px;
}

body.gs-post-page .w-post-elm.post_content li {
    margin-bottom: 8px;
}

body.gs-post-page .w-post-elm.post_content a {
    color: var(--gs-primary-light);
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.gs-post-page .w-post-elm.post_content a:hover {
    color: var(--gs-accent);
}

body.gs-post-page .w-post-elm.post_content img {
    border-radius: var(--gs-radius-sm);
}

body.gs-post-page .w-post-elm.post_content blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 3px solid var(--gs-primary);
    border-radius: 0 var(--gs-radius-sm) var(--gs-radius-sm) 0;
    background: var(--gs-surface);
    color: var(--gs-text);
}

body.gs-post-page .w-post-elm.post_content table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    font-size: 15px;
}

body.gs-post-page .w-post-elm.post_content th,
body.gs-post-page .w-post-elm.post_content td {
    padding: 10px 12px;
    border: 1px solid var(--gs-border);
    text-align: left;
}

body.gs-post-page .w-post-elm.post_content th {
    background: var(--gs-surface);
    color: var(--gs-text);
}

body.gs-post-page .w-post-elm.post_title,
body.gs-post-page .entry-title {
    font-size: clamp(26px, 4vw, 40px) !important;
    line-height: 1.2;
}

body.gs-post-page .w-post-elm.post_date,
body.gs-post-page .w-post-elm.post_taxonomy,
body.gs-post-page .w-post-elm.post_author {
    color: var(--gs-muted) !important;
}

/* Блок инструментов в конце статьи */

.gs-post-tools {
    max-width: 820px;
    margin: 40px auto 0;
    padding: 24px;
    border: 1px solid var(--gs-border-strong, rgba(129, 140, 248, 0.38));
    border-radius: 16px;
    background:
        radial-gradient(ellipse 70% 90% at 100% 0%, rgba(34, 211, 238, 0.12), transparent 60%),
        linear-gradient(135deg, rgba(99, 102, 241, 0.16) 0%, rgba(15, 21, 32, 0.92) 55%);
}

.gs-post-tools__title {
    margin: 0 0 16px !important;
    font-size: 20px !important;
    font-weight: 700;
    color: #f1f5f9 !important;
}

.gs-post-tools__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.gs-post-tools__card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 10px;
    background: rgba(19, 27, 43, 0.85);
}

.gs-post-tools__card h3 {
    margin: 0 !important;
    font-size: 15.5px !important;
    font-weight: 700;
}

.gs-post-tools__card h3 a {
    color: #f1f5f9 !important;
    text-decoration: none !important;
}

.gs-post-tools__card h3 a:hover {
    color: #818cf8 !important;
}

.gs-post-tools__card p {
    flex: 1 1 auto;
    margin: 0 !important;
    color: #94a3b8 !important;
    font-size: 13.5px;
    line-height: 1.5;
}

.gs-post-tools__cta {
    align-self: flex-start;
    padding: 9px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
}

/* ---------------------------------------------------------------- Адаптив */

@media (max-width: 600px) {
    body.gs-blog-page .w-grid-list {
        grid-template-columns: 1fr;
    }

    .gs-post-tools {
        padding: 18px;
    }
}

/* ----------------------------------------------------- Поля ввода в блоге
   Поиск, комментарии и формы темы на тёмном фоне оставались белыми
   со светло-серым текстом — набирать было не видно. */

body.gs-blog-page input[type="text"],
body.gs-blog-page input[type="search"],
body.gs-blog-page input[type="email"],
body.gs-blog-page input[type="url"],
body.gs-blog-page textarea,
body.gs-blog-page select,
body.gs-post-page input[type="text"],
body.gs-post-page input[type="search"],
body.gs-post-page input[type="email"],
body.gs-post-page input[type="url"],
body.gs-post-page textarea,
body.gs-post-page select {
    background-color: #0d1320 !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    border-radius: 10px !important;
    caret-color: #818cf8;
    box-shadow: none !important;
}

body.gs-blog-page input::placeholder,
body.gs-blog-page textarea::placeholder,
body.gs-post-page input::placeholder,
body.gs-post-page textarea::placeholder {
    color: #7d8ba1 !important;
    opacity: 1;
}

body.gs-blog-page select option,
body.gs-post-page select option {
    background-color: #0d1320;
    color: #f1f5f9;
}

body.gs-blog-page input:-webkit-autofill,
body.gs-post-page input:-webkit-autofill {
    -webkit-text-fill-color: #f1f5f9 !important;
    box-shadow: 0 0 0 1000px #0d1320 inset !important;
    transition: background-color 9999s ease-in-out 0s;
}

/* --------------------------------------------------- Колонки конструктора
   Тема кладёт статью в колонку со светлым фоном (--color-content-bg-alt),
   а текст мы перекрашиваем в светлый — получалось нечитаемо.
   Красим саму колонку в тёмную карточку. */

body.gs-post-page .wpb_column,
body.gs-post-page .vc_column-inner,
body.gs-blog-page .wpb_column,
body.gs-blog-page .vc_column-inner {
    background: transparent !important;
}

body.gs-post-page .wpb_column.has_bg_color {
    background: var(--gs-surface) !important;
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius) !important;
    padding: 32px !important;
}

body.gs-blog-page .wpb_column.has_bg_color {
    background: transparent !important;
    padding: 0 !important;
}

/* Текст внутри колонки — на случай, если тема задаёт свой цвет инлайном. */
body.gs-post-page .w-post-elm.post_content,
body.gs-post-page .w-post-elm.post_content p,
body.gs-post-page .w-post-elm.post_content li,
body.gs-post-page .w-post-elm.post_content td,
body.gs-post-page .w-post-elm.post_content th,
body.gs-post-page .w-post-elm.post_content strong,
body.gs-post-page .w-post-elm.post_content em {
    color: #dbe3f0 !important;
}

body.gs-post-page .w-post-elm.post_content h2,
body.gs-post-page .w-post-elm.post_content h3,
body.gs-post-page .w-post-elm.post_content h4 {
    color: #f8fafc !important;
}

body.gs-post-page .w-post-elm.post_content a {
    color: #a5b4fc !important;
}

body.gs-post-page .w-post-elm.post_content a:hover {
    color: #67e8f9 !important;
}

@media (max-width: 600px) {
    body.gs-post-page .wpb_column.has_bg_color {
        padding: 18px !important;
    }
}

/* Блок «Читать» от плагина похожих записей: он приходит со своим светлым
   фоном и тёмным текстом, а на тёмной статье это нечитаемо.
   Классы у него генерируются на каждый пост, поэтому цепляемся за структуру. */

body.gs-post-page .w-post-elm.post_content div[class^="u"],
body.gs-post-page .w-post-elm.post_content a[class^="u"] {
    background: #1b2440 !important;
    border: 1px solid var(--gs-border-strong);
    border-radius: var(--gs-radius-sm);
    border-left: 4px solid var(--gs-primary-light) !important;
    margin: 18px 0;
    text-decoration: none !important;
}

body.gs-post-page .w-post-elm.post_content .ctaText {
    color: #a5b4fc !important;
}

body.gs-post-page .w-post-elm.post_content .postTitle {
    color: #f1f5f9 !important;
    text-decoration: none !important;
}
