/* ==========================================================================
   Твій формат — сторінка новини
   ========================================================================== */

/* Смужка прогресу читання */
.progress { position: sticky; top: 0; z-index: 36; height: 3px; background: var(--line); }
.progress span { display: block; width: 0; height: 100%; background: var(--accent); }

.article { display: flex; flex-direction: column; gap: 26px; min-width: 0; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }

.article__head { display: flex; flex-direction: column; gap: 18px; max-width: 800px; }
.article__title {
  font-family: var(--serif); font-weight: 700; font-size: clamp(1.8rem, 3.4vw, 2.9rem);
  line-height: 1.1; letter-spacing: -0.015em; text-wrap: balance;
}
.article__lead { font-size: 20px; line-height: 1.5; color: var(--ink-2); }

/* Автор, дата, кнопки «поділитися» */
.byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding-block: 14px; border-block: 1px solid var(--line); }
.byline__author { display: flex; align-items: center; gap: 12px; }
.byline__author strong, .byline__name { font-size: 14px; font-weight: 700; }
.byline__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.avatar { display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--bg-soft); font-weight: 700; }
.share { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn.is-done { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.article__cover { display: flex; flex-direction: column; gap: 10px; }
.article__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article__cover figcaption, .prose figcaption { font-family: var(--sans); font-size: 13px; line-height: 1.4; color: var(--ink-3); }

/* Блок «Коротко» */
.summary { display: flex; flex-direction: column; gap: 12px; max-width: 760px; padding: 22px 26px; background: var(--bg-soft); }
.summary ul { display: flex; flex-direction: column; gap: 8px; padding-left: 20px; list-style: disc; font-size: 16px; font-weight: 500; }

/* ---------- Текст статті ---------- */

.prose { max-width: 760px; font-family: var(--serif); font-size: 19px; line-height: 1.65; text-wrap: pretty; }
.prose > * + * { margin-top: 22px; }
.prose h2 { margin-top: 36px; font-weight: 700; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
.prose h3 { margin-top: 30px; font-weight: 700; font-size: 22px; line-height: 1.25; }
.prose a { text-decoration: underline; text-decoration-color: var(--accent-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 8px; }
.prose img { width: 100%; }
.prose figure { display: flex; flex-direction: column; gap: 10px; }

.prose blockquote { margin: 32px 0; padding: 22px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.prose blockquote p { font-style: italic; font-weight: 500; font-size: 26px; line-height: 1.35; }
.prose blockquote footer { margin-top: 12px; font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink-3); }

.callout { padding: 18px 22px; background: var(--bg-soft); font-family: var(--sans); font-size: 16px; line-height: 1.5; }

/* Відео: обкладинка, плеєр вантажиться після натискання */
.embed__play, .embed iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.embed__play { position: relative; background: var(--band) center / cover no-repeat; }

/* Дописи із соцмереж */
.embed--social { align-items: center; font-family: var(--sans); }
.embed--social iframe { width: 100%; max-width: 550px; border: 0; }
.embed--social blockquote { margin: 0 !important; padding: 0; border: 0; }
.embed__link { font-size: 13px; font-weight: 600; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }

/* Галерея */
.gallery__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px; }
.gallery__grid a { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ph); }
.gallery__grid img { width: 100%; height: 100%; object-fit: cover; }

/* Таблиця */
.table-scroll { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 15px; line-height: 1.4; }
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--bg-soft); font-weight: 700; }

.prose hr { height: 1px; margin-block: 32px; border: 0; background: var(--line); }
.prose s { color: var(--ink-3); }

/* Картка «Читайте також» у тексті */
.readalso { display: flex; align-items: center; gap: 18px; padding-block: 16px; border-block: 1px solid var(--line); font-family: var(--sans); text-decoration: none !important; }
.readalso__img { flex: 0 0 120px; width: 120px; height: 80px; object-fit: cover; }
.readalso > span { display: flex; flex-direction: column; gap: 6px; }
.readalso__title { font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.25; }
.readalso:hover .readalso__title { text-decoration: underline; text-underline-offset: 4px; }

.prose .ad { font-family: var(--sans); }

/* ---------- Реакції ---------- */

.reactions { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.reactions__list { display: flex; flex-wrap: wrap; gap: 10px; }
.reaction {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  font-size: 14px; font-weight: 600;
}
.reaction:hover { border-color: var(--ink); }
.reaction[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.reaction__count { font-variant-numeric: tabular-nums; opacity: 0.75; }

img.avatar { object-fit: cover; }
.static-page { max-width: 800px; padding-top: 28px; }

/* ---------- Коментарі ---------- */

.comments { display: flex; flex-direction: column; gap: 20px; max-width: 760px; padding-top: 28px; border-top: 2px solid var(--ink); }
.comments__title { font-family: var(--serif); font-weight: 700; font-size: 26px; }
.comments__empty { color: var(--ink-3); }
.byline .meta a { text-decoration: underline; text-underline-offset: 3px; }

.comment-form { display: flex; flex-direction: column; gap: 12px; }
.comment-form .field { display: flex; flex-direction: column; gap: 6px; }
.comment-form .field > span { font-size: 13px; font-weight: 600; }
.comment-form input[type="text"], .comment-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 0;
  background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--sans);
}
.comment-form input[type="text"] { max-width: 360px; height: 46px; }
.comment-form textarea { resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--ink); outline: none; }
.comment-form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.comment-form__status { font-size: 14px; color: var(--ink-2); }
.comment-form__status.is-error { color: var(--accent-ink); }
.comment-form__reply { padding: 10px 14px; background: var(--bg-soft); font-size: 14px; }
.comment-form__reply button, .comment__actions button { padding: 0; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.comment-form__reply button { margin-left: 10px; text-decoration: underline; text-underline-offset: 3px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.comments__list { display: flex; flex-direction: column; }
.comment { display: flex; gap: 14px; padding-block: 18px; border-top: 1px solid var(--line); }
.comment--reply { margin-left: 54px; }
.comment__main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.comment__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.comment__body { font-size: 15.5px; line-height: 1.5; overflow-wrap: anywhere; }
.comment__actions { display: flex; gap: 18px; }
.comment__actions button:hover { color: var(--ink); }
.comment__actions [aria-pressed="true"] { color: var(--accent-ink); }

/* ---------- Телефон ---------- */

@media (max-width: 760px) {
  .article { gap: 20px; }
  .article__head { gap: 12px; }
  .article__lead { font-size: 16.5px; }
  .article__cover { margin-inline: calc(var(--gutter) * -1); }
  .article__cover figcaption { padding-inline: var(--gutter); }
  .summary { padding: 18px; }
  .summary ul { font-size: 15px; }
  .prose { font-size: 18px; line-height: 1.6; }
  .prose h2 { font-size: 24px; }
  .prose blockquote p { font-size: 22px; }
  .readalso__img { flex-basis: 96px; width: 96px; height: 68px; }
  .reactions__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reaction { height: 48px; }
  .reaction__count { margin-left: auto; }
  .comment--reply { margin-left: 24px; }
  .comment-form input[type="text"] { max-width: none; }
}
