/* ShieldForce blog and article pages, on the shared sf-modern.css tokens.
   Class names match the markup the blog scripts generate; do not rename them. */

/* ---------- Blog home ---------- */
.blog-hero { padding-block: var(--pad-hero); background: linear-gradient(180deg, var(--tint) 0%, var(--paper) 100%); }
.blog-hero-inner { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.blog-hero h1 { max-width: 20ch; }
.blog-hero p { margin-top: var(--space-6); font-size: 1.25rem; color: var(--ink-soft); max-width: 40rem; }
.blog-search { margin-top: var(--space-8); display: flex; max-width: 32rem; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); }
.blog-search:focus-within { border-color: var(--blue); outline: 3px solid var(--blue); outline-offset: 1px; }
.blog-search input { flex: 1; min-width: 0; min-height: 3rem; padding: 0 var(--space-4); font: inherit; color: var(--ink); background: transparent; border: 0; outline: none; }
.blog-search input::placeholder { color: var(--ink-soft); opacity: 0.8; }
.blog-search button { min-width: 3rem; border: 0; background: transparent; color: var(--blue-deep); font-size: 1rem; cursor: pointer; border-radius: var(--radius-sm); }
.blog-search button:hover { background: var(--tint); }

.categories-bar { background: var(--surface); border-block: 1px solid var(--line); position: sticky; top: var(--nav-h); z-index: 50; }
.categories-inner { max-width: var(--container); margin-inline: auto; padding: var(--space-3) var(--gutter); display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: thin; }
.cat-btn { flex: none; min-height: 2.5rem; padding: 0 var(--space-4); font: inherit; font-weight: 500; color: var(--ink-soft); background: transparent; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease); }
.cat-btn:hover { color: var(--blue-deep); border-color: var(--blue); }
.cat-btn:active { transform: translateY(1px); }
.cat-btn.active { background: var(--blue-deep); border-color: var(--blue-deep); color: var(--on-blue); }

.blog-body { max-width: var(--container); margin-inline: auto; padding: var(--space-12) var(--gutter) var(--pad-block); }
.featured-label { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; margin-bottom: var(--space-4); color: var(--ink); }
.featured-label i { display: none; }
.featured-post { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.5); overflow: hidden; margin-bottom: var(--space-12); }
.featured-img { min-height: 18rem; background: var(--tint); }
.featured-img img { width: 100%; height: 100%; object-fit: cover; }
.featured-img .img-placeholder, .card-img-placeholder, .sp-placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: var(--tint); color: var(--blue-deep); }
.blog-icon { font-size: 2.5rem; }
.blog-icon-sm { font-size: 1.25rem; }
.featured-content { padding: var(--pad-card); display: flex; flex-direction: column; gap: var(--space-4); justify-content: center; min-width: 0; }
.featured-content h2 { font-size: clamp(1.5rem, 2.6vw, 2.25rem); }
.featured-content h2 a, .card-body h3 a, .sidebar-post h3 a { color: var(--ink); text-decoration: none; }
.featured-content h2 a:hover, .card-body h3 a:hover, .sidebar-post h3 a:hover { color: var(--blue-deep); text-decoration: underline; }
.excerpt { color: var(--ink-soft); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); color: var(--ink-soft); font-size: 0.9375rem; }
.post-meta .author { display: inline-flex; align-items: center; gap: var(--space-2); }
.post-meta .author img { width: 1.5rem; height: 1.5rem; border-radius: 50%; }
.meta-sep { font-size: 0; display: inline-block; width: 1px; height: 0.9em; background: var(--line); }
.read-more { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; color: var(--blue-deep); text-decoration: none; border-bottom: 2px solid var(--sun); padding-bottom: 2px; }
.read-more:hover { color: var(--blue-night); }
.read-more i { display: none; }

/* Category tags: one calm chip, the colour carries the category */
.post-tag { display: inline-flex; align-items: center; gap: var(--space-2); align-self: flex-start; padding: 0.2rem var(--space-3); border-radius: 999px; font-size: 0.875rem; font-weight: 500; background: var(--tint); color: var(--blue-night); }
.tag-threat, .tag-edr, .tag-ransomware, .tag-compliance, .tag-phishing, .tag-howto, .tag-news { background: var(--tint); color: var(--blue-night); }
.tag-ransomware { background: var(--ink); color: var(--on-blue); }
.tag-news { background: var(--sun); color: var(--ink); }

.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-12); align-items: start; }
.blog-layout > aside { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-8) var(--space-6); align-items: start; padding-top: var(--space-8); border-top: 1px solid var(--line); }
.blog-layout > aside .sidebar-section { margin-bottom: 0; }
.section-row-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-6); }
.section-row-header h2 { font-size: 1.75rem; }
.section-row-header a { font-weight: 600; }
.posts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6); }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 0.15s var(--ease); }
.post-card:hover { border-color: var(--blue); }
.card-img { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: var(--tint); }
.card-img img, .card-img .card-img-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); flex: 1; min-width: 0; }
.card-body h3 { font-size: 1.125rem; }
.card-body .excerpt { font-size: 0.9375rem; display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-body { padding: var(--space-4); }
.card-footer { margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--line); }

.sidebar-section { margin-bottom: var(--space-8); }
.sidebar-title { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; margin-bottom: var(--space-4); }
.sidebar-post { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: var(--space-3); padding-block: var(--space-3); border-bottom: 1px solid var(--line); }
.sidebar-post:last-child { border-bottom: 0; }
.sidebar-post-img { width: 4.5rem; height: 4.5rem; border-radius: var(--radius-sm); overflow: hidden; background: var(--tint); }
.sidebar-post-img img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-post h3 { font-size: 1rem; line-height: 1.3; }
.sp-meta { color: var(--ink-soft); font-size: 0.875rem; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag-cloud a { padding: 0.3rem var(--space-3); border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 0.9375rem; transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease); }
.tag-cloud a:hover { border-color: var(--blue); background: var(--tint); }
.newsletter-box { background: var(--blue-deep); color: var(--on-blue); border-radius: var(--radius); padding: var(--space-6); }
.newsletter-box h3 { color: var(--on-blue); }
.newsletter-box p { margin-top: var(--space-2); color: var(--on-blue-soft); font-size: 0.9375rem; }
.newsletter-input { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-4); }
.newsletter-input input { min-height: 3rem; padding: 0 var(--space-4); font: inherit; border-radius: var(--radius-sm); border: 2px solid transparent; background: var(--surface); color: var(--ink); }
.newsletter-input input:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.newsletter-input button { min-height: 3rem; font: inherit; font-weight: 600; border: 2px solid var(--on-blue); border-radius: var(--radius-sm); background: var(--on-blue); color: var(--blue-night); cursor: pointer; transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease); }
.newsletter-input button:hover { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.newsletter-input button:disabled { opacity: 0.6; cursor: not-allowed; }
.bg-threat, .bg-edr, .bg-ransom, .bg-comp, .bg-phish, .bg-howto, .bg-news { background: var(--tint); color: var(--blue-deep); }

/* ---------- Article ---------- */
.post-hero { padding-block: var(--pad-hero); background: linear-gradient(180deg, var(--tint) 0%, var(--paper) 100%); }
.post-hero-inner { max-width: 52rem; margin-inline: auto; padding-inline: var(--gutter); display: grid; gap: var(--space-4); }
.post-hero h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
.post-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); color: var(--ink-soft); }
.post-hero-cover { max-width: 60rem; margin: var(--space-8) auto 0; padding-inline: var(--gutter); }
.post-hero-cover img { width: 100%; height: auto; border-radius: var(--radius); }
.post-body { max-width: 52rem; margin-inline: auto; padding: var(--space-12) var(--gutter) var(--pad-block); }
.post-content { font-size: 1.125rem; line-height: 1.75; }
.post-content h2 { margin: var(--space-12) 0 var(--space-4); font-size: 1.875rem; }
.post-content h3 { margin: var(--space-8) 0 var(--space-3); font-size: 1.375rem; }
.post-content p { margin-bottom: var(--space-4); max-width: none; }
.post-content p.related-inline { padding: var(--space-4); background: var(--tint); border-radius: var(--radius-sm); font-size: 1rem; }
.post-content ul, .post-content ol { margin: 0 0 var(--space-4) var(--space-6); }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: var(--space-2); }
.post-content blockquote { margin: var(--space-6) 0; padding: var(--space-4) var(--space-6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-soft); }
.post-content pre { margin: var(--space-6) 0; padding: var(--space-4); overflow-x: auto; background: var(--ink); color: var(--on-blue); border-radius: var(--radius-sm); font-size: 0.9375rem; }
.post-content code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.9em; background: var(--tint); padding: 0.1em 0.35em; border-radius: 0.25rem; }
.post-content pre code { background: transparent; padding: 0; }
.post-content img { height: auto; border-radius: var(--radius-sm); margin-block: var(--space-6); }
.post-content hr { border: 0; border-top: 1px solid var(--line); margin-block: var(--space-8); }
.post-content table { width: 100%; border-collapse: collapse; margin-block: var(--space-6); font-size: 1rem; display: block; overflow-x: auto; }
.post-content thead th { text-align: left; padding: var(--space-3) var(--space-4); background: var(--tint); font-weight: 600; border-bottom: 2px solid var(--line); }
.post-content tbody td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); vertical-align: top; }
.post-content tbody tr:hover td { background: var(--tint); }
.post-nav { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid var(--line); }
.post-nav a { font-weight: 600; text-decoration: none; padding: var(--space-3) var(--space-4); border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease); }
.post-nav a:hover { border-color: var(--blue); background: var(--tint); }
.loading-state { text-align: center; padding: var(--space-24) var(--gutter); color: var(--ink-soft); }

@media (max-width: 1100px) {
  .posts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .blog-layout > aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .featured-post { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .posts-grid, .blog-layout > aside { grid-template-columns: minmax(0, 1fr); }
}

.offer-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-6); }
.offer-box p { margin-bottom: var(--space-4); color: var(--ink-soft); font-size: 0.9375rem; }

.post-hero-inner > .post-tag { justify-self: start; }
