/* ── Стаття (single post) ───────────────────────────────────────────────── */
.post-single {
    padding: 40px 0 64px;
}

/* На всю ширину контейнера — як на проді (рішення Viktor). Тоді й хлібні
   крихти над статтею стоять рівно по одній лінії з текстом. */

/* ── Шапка статті ───────────────────────────────────────────────────────── */
.entry-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}
.entry-title {
    margin: 0;
    font-family: var(--font-body);
    font-size: 36px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text);
}
.entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-top: 16px;
    font-size: 15px;
    color: var(--color-muted);
}
/* Роздільники між частинами мета-рядка — крапка, а не «злиплий» текст. */
.entry-meta > * + *::before {
    content: '•';
    margin-right: 16px;
    color: var(--color-border);
}
.entry-meta a {
    color: inherit;
    text-decoration: none;
}
.entry-meta a:hover,
.entry-meta a:focus-visible {
    text-decoration: underline;
}

/* ── Обкладинка статті ──────────────────────────────────────────────────── */
/* Джерела квадратні (1024×1024), тож на всю ширину контейнера фото було б
   ~1280px заввишки й з'їдало б увесь перший екран. Обмежуємо шириною і
   центруємо — картинка лишається повністю видимою, без обрізання: у неї
   вписаний текст-заголовок, який не можна різати. */
.entry-thumbnail {
    margin: 0 0 32px;
}
.entry-thumbnail__img {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    margin: 0 auto;
    border-radius: var(--radius);
}

/* ── Текст статті ───────────────────────────────────────────────────────── */
/* Контент іде з редактора, тому стилі — за тегами в межах обгортки, як в
   .pro-nas__content і .about-products__content. */
.entry-content {
    font-family: var(--font-body);
    font-size: 22px;
    line-height: 1.6;
    color: var(--color-text);
}
.entry-content > *:first-child {
    margin-top: 0;
}
.entry-content > *:last-child {
    margin-bottom: 0;
}
.entry-content p {
    margin: 0 0 20px;
}
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-family: var(--font-body);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}
.entry-content h2 {
    margin: 40px 0 16px;
    font-size: 32px;
}
/* У наявних статтях секційні заголовки — саме h3 (успадковано з проду),
   тож h3 має читатись як повноцінний підзаголовок секції. */
.entry-content h3 {
    margin: 36px 0 16px;
    font-size: 26px;
}
.entry-content h4 {
    margin: 28px 0 12px;
    font-size: 22px;
}
.entry-content ul,
.entry-content ol {
    margin: 0 0 20px;
    padding-left: 24px;
}
/* reset.css знімає маркери з усіх списків — у тексті статті повертаємо. */
.entry-content ul {
    list-style: disc;
}
.entry-content ol {
    list-style: decimal;
}
/* reset.css робить li блоковим — блоковий li не малює маркер узагалі,
   тож самого list-style замало. */
.entry-content li {
    display: list-item;
    margin-bottom: 8px;
}
.entry-content a {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity var(--transition);
}
.entry-content a:hover,
.entry-content a:focus-visible {
    opacity: .6;
}
.entry-content strong {
    font-weight: 600;
}
.entry-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}
.entry-content figure {
    margin: 32px 0;
}
.entry-content figcaption {
    margin-top: 8px;
    font-size: 15px;
    color: var(--color-muted);
}
.entry-content blockquote {
    margin: 32px 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--color-primary);
}
.entry-content hr {
    margin: 40px 0;
    border: none;
    border-top: 1px solid var(--color-border);
}

/* ── Таблиця ────────────────────────────────────────────────────────────── */
/* Вузькі екрани: таблиця скролиться всередині себе, а не розпирає сторінку. */
.entry-content .wp-block-table {
    overflow-x: auto;
}
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
}
.entry-content th,
.entry-content td {
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    text-align: center;
    vertical-align: middle;
}
/* Перший рядок цих таблиць — шапка, зроблена через <td><strong>, а не <th>
   (так зберіг редактор), тож підсвічуємо саме перший рядок. */
.entry-content thead tr,
.entry-content tr:first-child {
    background: var(--color-bg-alt);
}

/* ── Теги ───────────────────────────────────────────────────────────────── */
.entry-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    font-size: 16px;
    color: var(--color-muted);
}
.entry-tags a {
    color: var(--color-text);
    text-decoration: none;
}
.entry-tags a:hover,
.entry-tags a:focus-visible {
    text-decoration: underline;
}

/* ── Навігація між статтями ─────────────────────────────────────────────── */
.post-navigation {
    margin-top: 48px;
}
.post-navigation .nav-links {
    display: flex;
    gap: 16px;
}
.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
    min-width: 0;
}
.post-navigation .nav-next {
    text-align: right;
}
.post-navigation a {
    display: block;
    height: 100%;
    padding: 16px 20px;
    color: var(--color-text);
    text-decoration: none;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: background-color var(--transition);
}
.post-navigation a:hover,
.post-navigation a:focus-visible {
    background: var(--color-bg-alt);
}
.post-navigation .nav-label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--color-muted);
}
.post-navigation .nav-subtitle {
    display: block;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

/* ── Коментарі (наразі НЕ виводяться) ───────────────────────────────────── */
/* `comments_template()` прибрано з single.php за рішенням Viktor, тож ці
   правила зараз ні на що не діють. Лишені свідомо: якщо коментарі колись
   знадобляться назад, досить повернути один виклик у шаблон — стилі вже
   готові. Проєкт не під git, тож переписувати їх заново було б дорожче,
   ніж тримати ~2 КБ невживаного CSS. */
.comments-area {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}
.comment-reply-title {
    margin: 0 0 20px;
    font-family: var(--font-body);
    font-size: 26px;
    font-weight: 600;
    color: var(--color-text);
}
.comment-reply-title small {
    margin-left: 12px;
    font-size: 16px;
    font-weight: 500;
}
.comment-form p {
    margin: 0 0 16px;
}
.comment-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
    color: var(--color-muted);
}
.comment-form .required {
    color: var(--color-accent);
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color var(--transition);
}
.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
    border-color: var(--color-primary);
    outline: none;
}
.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}
.comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.comment-form-cookies-consent label {
    margin-bottom: 0;
}
/* WP тут віддає <button class="btn btn-primary">, а не input.submit —
   ловимо обидва варіанти, щоб не залежати від версії розмітки. */
.form-submit button,
.form-submit input[type="submit"] {
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--color-secondary);
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity var(--transition);
}
.form-submit button:hover,
.form-submit button:focus-visible,
.form-submit input[type="submit"]:hover,
.form-submit input[type="submit"]:focus-visible {
    opacity: .85;
}
.comment-list {
    margin: 0 0 32px;
    padding: 0;
    list-style: none;
}
.comment-list .comment-body {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}

@media (max-width: 1024px) {
    .post-single {
        padding: 32px 0 48px;
    }
    .entry-title {
        font-size: 30px;
    }
    .entry-content {
        font-size: 18px;
    }
    .entry-content h2 {
        font-size: 26px;
    }
    .entry-content h3 {
        font-size: 22px;
    }
    .entry-content h4 {
        font-size: 19px;
    }
    .entry-content table {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .post-single {
        padding: 24px 0 40px;
    }
    .entry-header {
        margin-bottom: 24px;
        padding-bottom: 20px;
    }
    .entry-title {
        font-size: 24px;
    }
    .entry-content {
        font-size: 17px;
    }
    .entry-content h2 {
        font-size: 22px;
    }
    .entry-content h3 {
        font-size: 20px;
    }
    .entry-content h4 {
        font-size: 18px;
    }
    .entry-content th,
    .entry-content td {
        padding: 10px 12px;
    }
    /* Редактор ставить блоку таблиці `has-fixed-layout` — колонки строго
       50/50. На вузькому екрані це б'є по читабельності: у вузькій колонці
       («🔴 Червоний») половина ширини марнується, а сусідня з довгим
       текстом ламається на 4 рядки. Віддаємо ширину браузеру.
       Клас у селекторі обов'язковий: ядрове правило
       `.wp-block-table .has-fixed-layout` має вищу вагу за `.entry-content table`. */
    .entry-content table.has-fixed-layout {
        table-layout: auto;
    }
    /* Дві сусідні картки навігації не влазять по ширині — у стовпчик,
       і «наступна» вирівнюється так само зліва, щоб не рвати ритм. */
    .post-navigation .nav-links {
        flex-direction: column;
    }
    .post-navigation .nav-next {
        text-align: left;
    }
    .comment-reply-title {
        font-size: 22px;
    }
}

/* ── Мобільний: крупніший дрібний текст ─────────────────────────────────────
   Сайт читає багато людей старшого віку, їм має бути зрозуміло, де і що
   (запит Viktor). Тому на ≤768px усі шрифти дрібніше 18px піднято за єдиною
   шкалою: 12→14, 13→15, 14→16, 15→16, 16→17, 17→18. Десктоп не чіпали.
   Правила, що вже були у мобільних медіа-блоках, підвищено на місці; сюди
   зібрано ті, що задавались лише для великих екранів. */
@media (max-width: 768px) {
    .entry-meta { font-size: 16px; }
    .entry-content figcaption { font-size: 16px; }
    .entry-footer { font-size: 17px; }
    .post-navigation .nav-label { font-size: 16px; }
    .comment-reply-title small { font-size: 17px; }
    .comment-form label { font-size: 16px; }
    .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { font-size: 17px; }
    .form-submit button, .form-submit input[type="submit"] { font-size: 17px; }
    .entry-content table { font-size: 17px; }
}
