/* Posts, news listings and comments (WordPress templates of the plugin) — loaded after style.css, so they share
   its tokens, nav, footer, cards and contact form. */

body.khl-page { background: var(--white); --col: 860px; } /* one reading column: title, body, comments */
.post { padding-bottom: clamp(48px, 8vw, 96px); }

/* ---------- head ---------- */
.post-head { padding-top: calc(clamp(120px, 16vh, 168px) + env(safe-area-inset-top, 0px)); padding-bottom: clamp(28px, 4vw, 48px); max-width: var(--col); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 28px; font-size: 16px; color: var(--ash); }
.post-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 1000px;
  border: 1px solid var(--pebble); color: var(--ink); font-size: 15px; font-weight: 500; transition: background .3s var(--ease), border-color .3s var(--ease);
}
.post-chip:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }
.post-chip svg { width: 15px; height: 15px; }
.post-title { margin: 0; font-weight: 600; font-size: clamp(36px, 5vw, 68px); line-height: 1.04; letter-spacing: -0.045em; text-wrap: balance; }
.archive .post-title { font-size: clamp(48px, 8vw, 112px); line-height: .95; letter-spacing: -0.055em; }
.archive .eyebrow { margin-bottom: 20px; }
.archive .lead { margin-top: 24px; }

/* ---------- body: a readable column, rounded images ---------- */
.prose { max-width: var(--col); font-size: clamp(17px, 1.3vw, 19px); line-height: 1.75; color: #1d2a2e; }
.prose > * { margin: 0 0 1.25em; }
.prose p { margin-top: 0; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--clay); text-underline-offset: .18em; text-decoration-thickness: 2px; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); line-height: 1.15; letter-spacing: -0.03em; margin: 1.8em 0 .6em; }
.prose h2 { font-size: 1.7em; }
.prose h3 { font-size: 1.35em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--clay); font-size: 1.12em; color: var(--ink); }
.prose figure, .prose .wp-block-image { margin: clamp(28px, 4vw, 44px) 0; }
.prose .wp-block-image figure { margin: 0; }
.prose img { display: block; width: 100% !important; height: auto !important; max-width: 100%; border-radius: clamp(14px, 2vw, 22px); }
.prose figcaption { margin-top: 10px; font-size: 14px; color: var(--ash); text-align: center; }
.prose .wp-block-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.prose iframe, .prose video { width: 100%; border-radius: 18px; }

/* ---------- previous / next ---------- */
.post-nav { max-width: var(--col); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: clamp(32px, 5vw, 56px); }
.post-nav-link {
  display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; border-radius: 18px; background: #f3f0ea;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.post-nav-link span { font-size: 14px; color: var(--ash); }
.post-nav-link strong { font-size: 18px; line-height: 1.25; letter-spacing: -0.01em; }
.post-nav-link.is-next { text-align: right; grid-column: 2; }
.post-nav-link:hover { background: var(--ink); color: var(--white); }
.post-nav-link:hover span { color: rgba(255, 255, 255, .6); }

/* ---------- comments ---------- */
.post-comments { margin-top: clamp(56px, 8vw, 96px); }
.post-comments-inner { max-width: var(--col); }
.comments-title { margin: 0 0 24px; font-size: clamp(28px, 3vw, 40px); letter-spacing: -0.035em; font-weight: 600; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { margin-left: clamp(16px, 4vw, 48px); }
.comment-card { margin: 0 0 14px; }
.comment-body { background: #f6f4ef; border-radius: 18px; padding: 18px 20px; }
.comment-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.comment-avatar { width: 44px; height: 44px; border-radius: 100%; display: block; }
.comment-author { display: block; font-size: 16px; }
.comment-head time { font-size: 13px; color: var(--ash); }
.comment-text { font-size: 16px; line-height: 1.6; }
.comment-text p { margin: 0 0 .6em; }
.comment-pending { margin: 0 0 8px; font-size: 14px; color: var(--clay); }
.comment-reply a, #cancel-comment-reply-link {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 1000px; border: 1px solid var(--pebble);
  font-size: 14px; font-weight: 500; transition: background .3s var(--ease), color .3s var(--ease);
}
.comment-reply a:hover, #cancel-comment-reply-link:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.comment-respond { margin-top: 32px; }
.comment-reply-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; font-size: 24px; letter-spacing: -0.02em; }
.comment-reply-title small { font-size: 0; }
.comment-reply-title small a { font-size: 14px; }
.comment-form p { margin: 0; }
.comment-notes, .logged-in-as { font-size: 14px; color: var(--ash); }
.logged-in-as a { text-decoration: underline; }
.comment-form .form-submit { margin-top: 4px; }
.comment-form .contact-send { width: 100%; }

/* ---------- more news / listings ---------- */
.post-more {
  margin-top: clamp(64px, 9vw, 112px); padding: clamp(48px, 7vw, 88px) 0; background: #f3f0ea;
  border-radius: var(--radius-panel) var(--radius-panel) 0 0;
}
.post-more + * { margin-top: 0; }
.post-more-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.post-more-title { margin: 0; font-size: clamp(32px, 4vw, 56px); letter-spacing: -0.045em; font-weight: 600; line-height: 1; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.4vw, 32px); }
.post-grid .card { width: auto; }

/* ---------- News page: post cards (after 21st.dev efferd/blog-section, light) ---------- */
.post-list { border-top: 1px dashed var(--pebble); padding-top: clamp(12px, 2vw, 20px); }
/* listings use the full screen width (up to 2400px) with as many columns as fit: 1 → 6 */
.archive .wrap { max-width: 2400px; }
.archive .post-head { max-width: 2400px; } /* the title lines up with the grid */
.archive .post-grid {
  --cols: 3; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: clamp(8px, 1.2vw, 24px); row-gap: clamp(20px, 2.2vw, 40px);
  margin-inline: -8px; /* the cards' own padding is the gutter; edges line up with the title */
}
@media (min-width: 1361px) { .archive .post-grid { --cols: 4; } }
@media (min-width: 1761px) { .archive .post-grid { --cols: 5; } }
@media (min-width: 2201px) { .archive .post-grid { --cols: 6; } }
@media (max-width: 960px) { .archive .post-grid { --cols: 2; } }
@media (max-width: 600px) { .archive .post-grid { --cols: 1; } }
.post-card {
  display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 18px;
  transition: background-color .2s var(--ease);
}
.post-card:hover { background: rgba(0, 0, 104, .04); }
.post-card:active { background: rgba(0, 0, 104, .07); }
.post-card:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.post-card-img {
  position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, .07); background: #eef0f1;
}
.post-card-img:not(.is-loaded)::before { content: ""; position: absolute; inset: 0; background: #e3e7ea; animation: postPulse 1.6s ease-in-out infinite; }
.post-card-img img { position: relative; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--ease), transform 1.2s var(--ease); }
.post-card-img.is-loaded img { opacity: 1; }
.post-card:hover .post-card-img img { transform: scale(1.04); }
@keyframes postPulse { 50% { opacity: .45; } }
.post-card-body { display: flex; flex-direction: column; gap: 8px; padding: 4px 8px 8px; }
.post-card time { font-size: 13px; color: var(--ash); line-height: 1.2; }
.post-card h2 {
  margin: 0; font-size: 18px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .3s var(--ease);
}
.post-card:hover h2, .post-card:focus-visible h2 { color: #000068; }
.post-card p {
  margin: 0; font-size: 14px; line-height: 1.45; color: #62686e;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* newly loaded cards rise in */
.post-card.is-new { animation: postIn .7s var(--ease) both; }
@keyframes postIn { from { opacity: 0; transform: translateY(18px); } }

/* pages: pill numbers, the current one black with a white number; js/post.js turns them over without a reload */
.post-pages { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: clamp(32px, 5vw, 56px); }
.post-pages .page-numbers {
  min-width: 44px; height: 44px; padding: 0 14px; border-radius: 1000px; display: inline-grid; place-items: center;
  border: 1px solid var(--pebble); background: none; color: var(--ink); font: inherit; font-size: 16px; cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.post-pages .page-numbers.current, .post-pages a.page-numbers:hover, .post-pages button.page-numbers:hover {
  background: var(--ink); color: var(--white); border-color: var(--ink);
}
.post-pages .current { cursor: default; }
.post-pages .dots { border: 0; cursor: default; }
.post-pages .page-numbers:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
.post-list.is-loading .post-grid { opacity: .4; pointer-events: none; transition: opacity .25s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .post-card.is-new, .post-card-img::before { animation: none; }
}

/* the footer sits right after the "more news" panel on posts */
.khl-page .footer { position: relative; }

@media (max-width: 960px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-pages { gap: 6px; }
  .post-pages .page-numbers { min-width: 38px; height: 38px; padding: 0 10px; font-size: 15px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-link.is-next { grid-column: 1; }
}

/* logged-in editors: keep the nav clear of WordPress's admin bar */
.admin-bar .nav { top: calc(18px + 32px + env(safe-area-inset-top, 0px)); }
@media (max-width: 782px) { .admin-bar .nav { top: calc(18px + 46px + env(safe-area-inset-top, 0px)); } }

/* GeneratePress Premium prints its off-canvas menu panel (and a "×" close button) at the end of every page;
   its styles are left out here, so keep the leftovers out of sight — the nav above has its own menu */
#generate-slideout-menu, .slideout-overlay, .slideout-navigation, .generate-back-to-top, .search-modal { display: none !important; }
