/*
 * 2026 design, screens 14 "Blog" and 15 "Članak" (design/Blog.dc.html, BlogPost.dc.html).
 * Loaded on every page: every selector starts with a .sd-blog class. Markup: template-parts/sd/blog/*.php.
 */

/* #page is a flex column: a centred wrapper would shrink to its content without a width. */
.sd-blog, .sd-blog-crumbs { width: 100%; }

/* These two screens are drawn with 6px corners (the shared classes default to pills and 14px cards). */
.sd-blog .sd-btn, .sd-blog .sd-tag, .sd-blog .sd-card { border-radius: var(--sd-radius); }
.sd-blog .sd-h1 { font-size: 34px; font-weight: 700; line-height: 1.2; }
.sd-blog a:focus-visible { outline: 3px solid #1a1a1a; outline-offset: 2px; }

.sd-blog__layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; align-items: start; }
.sd-blog__layout--full { grid-template-columns: minmax(0, 1fr); }
.sd-blog__main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sd-blog__lead { margin: 0; max-width: 720px; font-size: 16px; line-height: 1.5; }
.sd-blog__lead p { margin: 0; }
.sd-blog__empty { margin: 0; font-size: 16px; }

/* Category chips */
.sd-blog-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sd-blog-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid #d0d0d0; border-radius: var(--sd-radius); background: #fff; color: var(--sd-ink); font-size: 13px; font-weight: 600; line-height: 1; text-decoration: none; }
.sd-blog-chip:hover { border-color: var(--sd-orange); color: var(--sd-orange-dark); }
.sd-blog-chip.is-current, .sd-blog-chip.is-current:hover { border-color: var(--sd-orange); background: var(--sd-orange-soft); color: var(--sd-orange-text); }
.sd-blog-chip span { color: var(--sd-muted); font-weight: 500; }

/* Article card: image left, text right; no image column without a featured image */
.sd-blog-post { display: grid; grid-template-columns: min(300px, 40%) minmax(0, 1fr); gap: 20px; border: 1px solid var(--sd-line); border-radius: var(--sd-radius); overflow: hidden; background: #fff; }
.sd-blog-post--noimg { grid-template-columns: minmax(0, 1fr); }
.sd-blog-post__img { position: relative; display: block; min-height: 200px; background: var(--sd-soft); }
.sd-blog-post__img img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.sd-blog-post__body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 18px 20px 18px 0; }
.sd-blog-post--noimg .sd-blog-post__body { padding-left: 20px; }
.sd-blog-post__title { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--sd-ink); }
.sd-blog-post__title a { color: var(--sd-ink); text-decoration: none; }
.sd-blog-post__title a:hover { color: var(--sd-orange-dark); }
.sd-blog-post__excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 0; font-size: 14px; line-height: 1.5; }
.sd-blog-post__body .sd-btn { margin-top: auto; }
.sd-blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; line-height: 1.3; color: var(--sd-muted); }
.sd-blog-meta a.sd-tag { text-decoration: none; }
.sd-blog-meta a.sd-tag:hover { color: #0a6665; text-decoration: underline; }

/* Pagination (paginate_links) */
.sd-blog-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.sd-blog-pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 62px; height: 42px; padding: 0 10px; border: 1px solid #d0d0d0; border-radius: var(--sd-radius); color: var(--sd-ink); line-height: 1; text-decoration: none; }
.sd-blog-pager a.page-numbers:hover { border-color: var(--sd-orange); color: var(--sd-orange-text); }
.sd-blog-pager .page-numbers.current { border-color: var(--sd-orange); background: var(--sd-orange); color: var(--sd-on-orange); }
.sd-blog-pager .page-numbers.dots { min-width: 0; border: 0; }

/* Sidebar */
.sd-blog-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sd-blog-promo { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: var(--sd-radius); background: var(--sd-orange); color: var(--sd-on-orange); }
.sd-blog-promo__kicker { font-size: 13px; font-weight: 600; opacity: .9; }
.sd-blog-promo strong { font-size: 22px; font-weight: 700; line-height: 1.15; }
.sd-blog-promo__text { font-size: 14px; line-height: 1.2; }
.sd-blog-promo .sd-btn, .sd-blog-promo .sd-btn:hover { background: #fff; color: var(--sd-orange-text); }
.sd-blog-promo .sd-btn:hover { background: var(--sd-orange-soft); }
.sd-blog-side__card { display: flex; flex-direction: column; gap: 8px; }
.sd-blog-side__card--recent { gap: 10px; }
.sd-blog-side__title { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.2; color: var(--sd-ink); }
.sd-blog-plist { display: flex; flex-direction: column; gap: 4px; }
.sd-blog-plist a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #eee; border-radius: var(--sd-radius); color: var(--sd-ink); font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none; }
.sd-blog-plist a:hover { border-color: var(--sd-orange); color: var(--sd-orange-dark); }
.sd-blog-plist a.is-current, .sd-blog-plist a.is-current:hover { border-color: var(--sd-orange-line); background: var(--sd-orange-soft); color: var(--sd-orange-text); }
.sd-blog-plist span { color: var(--sd-muted); font-weight: 500; }
.sd-blog-recent { display: flex; align-items: center; gap: 10px; color: var(--sd-ink); font-size: 13px; font-weight: 600; line-height: 1.2; text-decoration: none; }
.sd-blog-recent:hover { color: var(--sd-orange-dark); }
.sd-blog-recent img { flex: none; width: 56px; height: 40px; object-fit: cover; border-radius: 4px; }
.sd-blog-recent span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.sd-blog-guide { gap: 6px; background: #f7f8fa; border-color: #ececec; font-size: 14px; }
.sd-blog-guide a { font-weight: 700; }

/* Article */
.sd-blog-article { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sd-blog-article__img { display: block; width: 100%; height: auto; border-radius: var(--sd-radius); }
.sd-blog-content { font-size: 16px; line-height: 1.65; }
.sd-blog-content > :first-child { margin-top: 0; }
.sd-blog-content > :last-child { margin-bottom: 0; }
.sd-blog-content > p { margin: 0 0 18px; font-size: 16px; line-height: 1.65; }
.sd-blog-content > h2, .sd-blog-content .bloc_title_section h2 { font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--sd-ink); }
.sd-blog-content > h2 { margin: 26px 0 18px; }
.sd-blog-content p a, .sd-blog-content li a { text-decoration: underline; }
.sd-blog-content img { max-width: 100%; height: auto; }
.sd-blog-content iframe { max-width: 100%; }
/* An article in English or Russian (SdPatients::content()): its table of contents keeps the list's look, not the text
   links' underline (sd-patients.css, loaded after this file, still underlines on hover); a heading it leads to keeps a gap. */
.sd-blog-content .sd-patients-toc a { text-decoration: none; }
.sd-blog-content > h2[id] { scroll-margin-top: 16px; }

/* A linked product (SdBlog::product_block): heading, the shared product card as one row with the design's orange
   border, the block's notes. One or two linked products are headed sections, as the design shows them. In a longer
   run every card already shows the name: the list is compact and its headings stay for screen readers. */
.sd-blog-product { margin: 0 0 18px; }
.sd-blog-product > h2 { margin: 0 0 18px; padding-top: 8px; font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--sd-ink); }
.sd-blog-product + .sd-blog-product + .sd-blog-product,
.sd-blog-product + .sd-blog-product:has(+ .sd-blog-product) { margin-top: -6px; }
.sd-blog-product + .sd-blog-product + .sd-blog-product > h2 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sd-blog-product:has(+ .sd-blog-product + .sd-blog-product) > h2,
.sd-blog-product + .sd-blog-product:has(+ .sd-blog-product) > h2 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sd-blog-product .sd-blog-pcard { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 20px; border-color: var(--sd-orange); }
.sd-blog-product .sd-blog-pcard .sd-pcard__name { flex: 1 1 240px; font-size: 16px; line-height: 1.3; }
.sd-blog-product .sd-blog-pcard > span { white-space: nowrap; }
.sd-blog-product .sd-blog-pcard .sd-btn { align-self: center; margin-top: 0; }
.sd-blog-product .sd-blog-pcard .sd-btn--outline { border: 0; background: var(--sd-orange); color: var(--sd-on-orange); }
.sd-blog-product .sd-blog-pcard .sd-btn--outline:hover { background: var(--sd-orange-dark); color: var(--sd-on-orange); }
.sd-blog-product__note { margin: 6px 0 0; font-size: 13px; line-height: 1.4; }

.sd-blog-adjacent { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 16px; border-top: 1px solid #eee; font-size: 14px; line-height: 1.4; }
.sd-blog-adjacent a::before, .sd-blog-adjacent a::after { content: none; } /* main.css adds guillemets to rel="prev" links */
.sd-blog-adjacent__all { margin-left: auto; }
/* Touch screens: each link of this row is one short line. Padding with the same negative margin gives it a touch area
   of about 40 px and moves nothing (the shared ::after box is not available here, see the rule above). */
@media (pointer: coarse) {
  .sd-blog-adjacent a { padding: 10px 0; margin-top: -10px; margin-bottom: -10px; }
}

/* The "Kategorije bloga" page */
.sd-blog-cat { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.sd-blog-cat__name { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.2; color: var(--sd-ink); }
.sd-blog-cat__name span { font-size: 14px; font-weight: 500; }

@media (max-width: 900px) {
  .sd-blog__layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) { /* this design's own phone breakpoint */
  .sd-blog .sd-h1 { font-size: 26px; }
  .sd-blog-post { grid-template-columns: minmax(0, 1fr); }
  .sd-blog-post__img { min-height: 0; aspect-ratio: 3 / 2; }
  .sd-blog-post__body, .sd-blog-post--noimg .sd-blog-post__body { padding: 0 18px 18px; }
  .sd-blog-post--noimg .sd-blog-post__body { padding-top: 18px; }
  .sd-blog-pager .page-numbers { min-width: 42px; }
}
