/**
 * Стили для контента записей (Gutenberg блоки)
 * Современный дизайн с правильными отступами, типографикой и адаптивностью
 */

/* Базовые стили для контейнера контента */
.entry-content.single-page,
.entry-content {
    max-width: 100%;
    line-height: 1.7;
    color: #333;
    font-size: 17px;
}

/* ============================================
   ЗАГОЛОВКИ
   ============================================ */

.entry-content h1,
.entry-content .wp-block-heading h1,
.entry-content h1.wp-block-heading {
    font-size: 2.25em;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 700;
    color: #1a1a1a;
}

.entry-content h2,
.entry-content .wp-block-heading h2,
.entry-content h2.wp-block-heading {
    font-size: 1.875em;
    line-height: 1.35;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 700;
    color: #1a1a1a;
}

.entry-content h3,
.entry-content .wp-block-heading h3,
.entry-content h3.wp-block-heading {
    font-size: 1.5em;
    line-height: 1.4;
    margin-top: 1.25em;
    margin-bottom: 0.625em;
    font-weight: 600;
    color: #1a1a1a;
}

.entry-content h4,
.entry-content .wp-block-heading h4,
.entry-content h4.wp-block-heading {
    font-size: 1.25em;
    line-height: 1.45;
    margin-top: 1.25em;
    margin-bottom: 0.625em;
    font-weight: 600;
    color: #1a1a1a;
}

.entry-content h5,
.entry-content .wp-block-heading h5,
.entry-content h5.wp-block-heading {
    font-size: 1.125em;
    line-height: 1.5;
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #1a1a1a;
}

.entry-content h6,
.entry-content .wp-block-heading h6,
.entry-content h6.wp-block-heading {
    font-size: 1em;
    line-height: 1.5;
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Убираем верхний отступ у первого заголовка */
.entry-content > h1:first-child,
.entry-content > h2:first-child,
.entry-content > h3:first-child,
.entry-content > h4:first-child,
.entry-content > h5:first-child,
.entry-content > h6:first-child,
.entry-content > .wp-block-heading:first-child {
    margin-top: 0;
}

/* ============================================
   ПАРАГРАФЫ
   ============================================ */

.entry-content p,
.entry-content .wp-block-paragraph {
    margin-top: 0;
    margin-bottom: 1.25em;
    line-height: 1.8;
    font-size: 1em;
    color: #333;
}

/* Убираем нижний отступ у последнего параграфа */
.entry-content p:last-child,
.entry-content .wp-block-paragraph:last-child {
    margin-bottom: 0;
}

/* ============================================
   СПИСКИ
   ============================================ */

/* Маркированные списки */
.entry-content ul,
.entry-content .wp-block-list ul,
.entry-content .wp-block-list {
    margin-top: 0;
    margin-bottom: 1.25em;
    padding-left: 1.75em;
    list-style-type: disc;
    line-height: 1.8;
}

.entry-content ul li,
.entry-content .wp-block-list li {
    margin-bottom: 0.625em;
    padding-left: 0.5em;
    color: #333;
}

.entry-content ul ul {
    margin-top: 0.625em;
    margin-bottom: 0.625em;
    list-style-type: circle;
}

.entry-content ul ul ul {
    list-style-type: square;
}

/* Нумерованные списки */
.entry-content ol,
.entry-content .wp-block-list ol {
    margin-top: 0;
    margin-bottom: 1.25em;
    padding-left: 1.75em;
    counter-reset: item;
    line-height: 1.8;
}

.entry-content ol li,
.entry-content .wp-block-list ol li {
    margin-bottom: 0.625em;
    padding-left: 0.5em;
    color: #333;
    list-style-type: decimal;
}

.entry-content ol ol {
    margin-top: 0.625em;
    margin-bottom: 0.625em;
    list-style-type: lower-alpha;
}

.entry-content ol ol ol {
    list-style-type: lower-roman;
}

/* Стили для вложенных списков */
.entry-content li > ul,
.entry-content li > ol {
    margin-top: 0.625em;
}

/* ============================================
   ТАБЛИЦЫ
   ============================================ */

.entry-content table,
.entry-content .wp-block-table {
    width: 100%;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95em;
    overflow-x: auto;
    display: block;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.entry-content table:not(.wp-block-table__is-content-storage) {
    display: table;
}

.entry-content .wp-block-table table {
    display: table;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.entry-content table thead,
.entry-content .wp-block-table thead {
    background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.entry-content table th,
.entry-content .wp-block-table th {
    padding: 1.125em 1.25em;
    text-align: left;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.entry-content table th:not(:last-child),
.entry-content .wp-block-table th:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.entry-content table tbody tr,
.entry-content .wp-block-table tbody tr {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background-color: #fff;
}

.entry-content table tbody tr:nth-child(even),
.entry-content .wp-block-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.entry-content table tbody tr:hover,
.entry-content .wp-block-table tbody tr:hover {
    background-color: #f0f4f8;
    transform: scale(1.001);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.entry-content table td,
.entry-content .wp-block-table td {
    padding: 1em 1.25em;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: #333;
    vertical-align: middle;
}

.entry-content table td:not(:last-child),
.entry-content .wp-block-table td:not(:last-child) {
    border-right: 1px solid rgba(0, 0, 0, 0.04);
}

.entry-content table tbody tr:last-child td,
.entry-content .wp-block-table tbody tr:last-child td {
    border-bottom: none;
}

.entry-content table tbody tr:last-child:hover td,
.entry-content .wp-block-table tbody tr:last-child:hover td {
    border-bottom: none;
}

/* Обертка для прокрутки таблиц на мобильных */
.entry-content .wp-block-table__wrapper {
    overflow-x: auto;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ============================================
   ЦИТАТЫ
   ============================================ */

.entry-content blockquote,
.entry-content .wp-block-quote {
    margin: 1.5em 0;
    padding: 1.25em 1.5em;
    border-left: 4px solid #ce1d54;
    background-color: #f9f9f9;
    font-style: italic;
    color: #555;
    line-height: 1.7;
    position: relative;
}

.entry-content blockquote p,
.entry-content .wp-block-quote p {
    margin-bottom: 0.75em;
    font-size: 1.05em;
}

.entry-content blockquote p:last-child,
.entry-content .wp-block-quote p:last-child {
    margin-bottom: 0;
}

.entry-content .wp-block-quote__citation,
.entry-content blockquote cite {
    display: block;
    margin-top: 0.75em;
    font-size: 0.9em;
    font-style: normal;
    color: #777;
    font-weight: 500;
}

.entry-content .wp-block-quote__citation:before,
.entry-content blockquote cite:before {
    content: "— ";
}

/* Большие цитаты (pullquote) */
.entry-content .wp-block-pullquote {
    margin: 2em 0;
    padding: 2em;
    border-top: 4px solid #ce1d54;
    border-bottom: 4px solid #ce1d54;
    text-align: center;
    background-color: #f9f9f9;
}

.entry-content .wp-block-pullquote blockquote {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font-size: 1.25em;
}

.entry-content .wp-block-pullquote p {
    margin-bottom: 0.75em;
}

/* ============================================
   ИЗОБРАЖЕНИЯ
   ============================================ */

.entry-content img,
.entry-content .wp-block-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5em auto;
    border-radius: 4px;
}

.entry-content .wp-block-image {
    margin: 1.5em 0;
}

.entry-content .wp-block-image figcaption,
.entry-content figure figcaption,
.entry-content img + figcaption {
    margin-top: 0.625em;
    text-align: center;
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    line-height: 1.5;
}

/* Выровненные изображения */
.entry-content .wp-block-image.alignleft,
.entry-content figure.alignleft {
    float: left;
    margin-right: 1.5em;
    margin-top: 0.5em;
    margin-bottom: 1em;
}

.entry-content .wp-block-image.alignright,
.entry-content figure.alignright {
    float: right;
    margin-left: 1.5em;
    margin-top: 0.5em;
    margin-bottom: 1em;
}

.entry-content .wp-block-image.aligncenter,
.entry-content figure.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Широкие изображения */
.entry-content .wp-block-image.alignwide,
.entry-content figure.alignwide {
    margin-left: -10%;
    margin-right: -10%;
    max-width: 120%;
}

.entry-content .wp-block-image.alignfull,
.entry-content figure.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

/* ============================================
   КОД И PRE
   ============================================ */

.entry-content code,
.entry-content .wp-block-code code {
    background-color: #f4f4f4;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Courier New', Courier, monospace;
    color: #ce1d54;
    word-break: break-word;
}

.entry-content pre,
.entry-content .wp-block-code {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1.25em 1.5em;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1.5em 0;
    line-height: 1.6;
    font-size: 0.9em;
    font-family: 'Courier New', Courier, monospace;
    -webkit-overflow-scrolling: touch;
}

.entry-content pre code,
.entry-content .wp-block-code code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
    border-radius: 0;
}

.entry-content .wp-block-preformatted {
    white-space: pre;
    font-family: 'Courier New', Courier, monospace;
    background-color: #f4f4f4;
    padding: 1.25em 1.5em;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1.5em 0;
}

/* ============================================
   HR (РАЗДЕЛИТЕЛИ)
   ============================================ */

.entry-content hr,
.entry-content .wp-block-separator {
    margin: 2em 0;
    border: none;
    border-top: 2px solid #e0e0e0;
    background: none;
    height: 1px;
}

.entry-content .wp-block-separator.is-style-wide {
    border-width: 3px;
}

.entry-content .wp-block-separator.is-style-dots {
    border: none;
    background: none;
    text-align: center;
}

.entry-content .wp-block-separator.is-style-dots:before {
    content: "···";
    color: #ccc;
    font-size: 2em;
    letter-spacing: 1em;
}

/* ============================================
   СПЕЦИАЛЬНЫЕ БЛОКИ GUTENBERG
   ============================================ */

/* Кнопки */
.entry-content .wp-block-buttons {
    margin: 1.5em 0;
}

.entry-content .wp-block-button {
    margin: 0.5em 0;
}

.entry-content .wp-block-button__link {
    display: inline-block;
    padding: 0.75em 1.5em;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.entry-content .wp-block-button.is-style-outline .wp-block-button__link {
    border: 2px solid currentColor;
    background: transparent;
}

/* Колонки */
.entry-content .wp-block-columns {
    margin: 1.5em 0;
    gap: 1.5em;
}

.entry-content .wp-block-column {
    margin-bottom: 0;
}

/* Группа блоков */
.entry-content .wp-block-group {
    margin: 1.5em 0;
}

.entry-content .wp-block-group__inner-container {
    padding: 1.5em;
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* Галерея */
.entry-content .wp-block-gallery {
    margin: 1.5em 0;
}

.entry-content .wp-block-gallery .blocks-gallery-item {
    margin-bottom: 1em;
}

/* Видео */
.entry-content .wp-block-video,
.entry-content .wp-block-embed {
    margin: 1.5em 0;
}

.entry-content .wp-block-video video,
.entry-content .wp-block-embed iframe {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Аудио */
.entry-content .wp-block-audio {
    margin: 1.5em 0;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    .entry-content {
        font-size: 16px;
    }

    .entry-content h1,
    .entry-content .wp-block-heading h1,
    .entry-content h1.wp-block-heading {
        font-size: 1.875em;
    }

    .entry-content h2,
    .entry-content .wp-block-heading h2,
    .entry-content h2.wp-block-heading {
        font-size: 1.625em;
    }

    .entry-content h3,
    .entry-content .wp-block-heading h3,
    .entry-content h3.wp-block-heading {
        font-size: 1.375em;
    }

    .entry-content h4,
    .entry-content .wp-block-heading h4,
    .entry-content h4.wp-block-heading {
        font-size: 1.125em;
    }

    .entry-content p,
    .entry-content .wp-block-paragraph {
        margin-bottom: 1em;
    }

    .entry-content ul,
    .entry-content ol,
    .entry-content .wp-block-list {
        padding-left: 1.5em;
        margin-bottom: 1em;
    }

    .entry-content blockquote,
    .entry-content .wp-block-quote {
        margin: 1.25em 0;
        padding: 1em 1.25em;
        font-size: 0.95em;
    }

    .entry-content table,
    .entry-content .wp-block-table {
        font-size: 0.875em;
        border-radius: 6px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    .entry-content table th,
    .entry-content table td,
    .entry-content .wp-block-table th,
    .entry-content .wp-block-table td {
        padding: 0.875em 1em;
    }

    .entry-content table th,
    .entry-content .wp-block-table th {
        font-size: 0.85em;
    }

    .entry-content table tbody tr:hover,
    .entry-content .wp-block-table tbody tr:hover {
        transform: none;
    }

    /* Отменяем выравнивание изображений на мобильных */
    .entry-content .wp-block-image.alignleft,
    .entry-content .wp-block-image.alignright,
    .entry-content figure.alignleft,
    .entry-content figure.alignright {
        float: none;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    /* Отменяем широкие изображения на мобильных */
    .entry-content .wp-block-image.alignwide,
    .entry-content .wp-block-image.alignfull,
    .entry-content figure.alignwide,
    .entry-content figure.alignfull {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
        width: 100%;
    }

    .entry-content .wp-block-columns {
        flex-direction: column;
        gap: 1em;
    }

    .entry-content pre,
    .entry-content .wp-block-code {
        font-size: 0.85em;
        padding: 1em;
    }
}

@media (max-width: 480px) {
    .entry-content {
        font-size: 15px;
    }

    .entry-content h1,
    .entry-content .wp-block-heading h1,
    .entry-content h1.wp-block-heading {
        font-size: 1.625em;
    }

    .entry-content h2,
    .entry-content .wp-block-heading h2,
    .entry-content h2.wp-block-heading {
        font-size: 1.5em;
    }

    .entry-content h3,
    .entry-content .wp-block-heading h3,
    .entry-content h3.wp-block-heading {
        font-size: 1.25em;
    }

    .entry-content blockquote,
    .entry-content .wp-block-quote {
        padding: 0.875em 1em;
    }

    .entry-content table,
    .entry-content .wp-block-table {
        border-radius: 4px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .entry-content table th,
    .entry-content table td,
    .entry-content .wp-block-table th,
    .entry-content .wp-block-table td {
        padding: 0.75em 0.875em;
        font-size: 0.85em;
    }

    .entry-content table th,
    .entry-content .wp-block-table th {
        font-size: 0.8em;
        padding: 0.875em 0.875em;
    }
}
