/*
Theme Name: Ivarsoft Insights
Theme URI: https://ivarsoft.com/insights/
Author: Ivarsoft
Author URI: https://ivarsoft.com/
Description: Blog theme for ivarsoft.com/insights. Reuses the main website's header, footer, fonts and styles so the blog looks like part of ivarsoft.com.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: ivarsoft-insights
*/

/* Intro (inside the dark hero) */
.blog-intro { padding-top: 64px; gap: 16px; }
.blog-intro__eyebrow { color: var(--amber); }
.blog-intro__eyebrow a { color: inherit; text-decoration: none; }
.blog-intro__title { font-size: clamp(34px, 4.6vw, 56px); max-width: 920px; }
.blog-intro__sub { max-width: 760px; color: var(--mut-d); }
.blog-intro__sub time { color: inherit; }

/* Topic filter */
.blog-list { padding-top: 56px; }
.blog-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.blog-cats a { font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--navy); text-decoration: none; }
.blog-cats a:hover { border-color: var(--line-2); }
.blog-cats a.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Post cards */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.post-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover, .post-card:focus-within { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(11, 22, 48, .10); }
.post-card__img { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #0B1630, #1d3a9e); overflow: hidden; }
.post-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__img--ph { display: grid; place-items: center; }
.post-card__img--ph svg { width: 56px; height: 56px; opacity: .9; }
.post-card__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 22px 24px 24px; }
.post-card__cat { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.post-card__title { margin: 0; font-family: var(--display); font-size: 20px; line-height: 1.3; letter-spacing: -.02em; }
.post-card__title a { color: var(--navy); text-decoration: none; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card__title a:focus-visible { outline: none; }
.post-card:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.post-card p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--slate); }
.post-card__meta { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--slate); }
.post-card--feature { grid-column: 1 / -1; flex-direction: row; }
.post-card--feature .post-card__img { flex: 1.15; aspect-ratio: auto; display: flex; align-items: center; background: linear-gradient(135deg, #070E1F, #0B1630 55%, #122461); }
.post-card--feature .post-card__img img { height: auto; aspect-ratio: 16 / 9; }
.post-card--feature .post-card__body { flex: 1; padding: 40px; justify-content: center; gap: 14px; }
.post-card--feature .post-card__title { font-size: clamp(24px, 2.6vw, 32px); }
.post-card--feature p { font-size: 16px; }
.post-card--feature .post-card__meta { margin-top: 6px; }

.blog-empty { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 40px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

/* Pagination */
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 48px; }
.pagination .page-numbers { min-width: 44px; height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--navy); font-weight: 600; text-decoration: none; }
.pagination .page-numbers.current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination .screen-reader-text, .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Article */
.post-section { padding-top: 56px; }
.wrap.post-layout { max-width: 800px; }
.post-cover { margin: 0 0 44px; border-radius: 20px; overflow: hidden; background: var(--soft); }
.post-cover img { display: block; width: 100%; height: auto; }
.post-body { font-size: 18px; line-height: 1.75; color: var(--slate-2); }
.post-body > * { margin: 0; }
.post-body > * + * { margin-top: 1.15em; }
.post-body h2 { margin-top: 1.9em; font-family: var(--display); font-size: clamp(24px, 3vw, 30px); line-height: 1.25; letter-spacing: -.02em; color: var(--navy); }
.post-body h3 { margin-top: 1.6em; font-family: var(--display); font-size: 21px; line-height: 1.3; color: var(--navy); }
.post-body h2 + *, .post-body h3 + * { margin-top: .6em; }
.post-body strong { color: var(--navy); }
.post-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li + li { margin-top: .45em; }
.post-body li::marker { color: var(--blue); }
.post-body blockquote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--amber); font-family: var(--display); font-size: 21px; line-height: 1.5; color: var(--navy); }
.post-body blockquote p { margin: 0; }
.post-body img { max-width: 100%; height: auto; border-radius: 14px; }
.post-body figure { margin-left: 0; margin-right: 0; }
.post-body figcaption { margin-top: 8px; font-size: 14px; color: var(--slate); text-align: center; }
.post-body table { width: 100%; border-collapse: collapse; font-size: 16px; }
.post-body th, .post-body td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.post-body th { background: var(--soft); color: var(--navy); }
.post-body .wp-block-table { overflow-x: auto; }
.post-body code { font-family: var(--mono); font-size: .86em; background: var(--soft); padding: 2px 6px; border-radius: 6px; }
.post-body pre { background: var(--navy); color: #DCE3F5; padding: 18px 20px; border-radius: 12px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.post-body .wp-block-button__link { background: var(--blue); color: #fff; border-radius: 12px; padding: 14px 22px; font-weight: 600; text-decoration: none; }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.post-tags a { font-size: 14px; padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--slate-2); text-decoration: none; }
.post-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; }
.post-share span { font-weight: 600; color: var(--navy); margin-right: 4px; }
.post-share a { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-weight: 600; text-decoration: none; }
.post-share a:hover { border-color: var(--line-2); }

.post-cta { margin-top: 44px; display: flex; gap: 24px; align-items: center; justify-content: space-between; padding: 32px; border-radius: 20px; background: linear-gradient(135deg, #0B1630, #13245a); color: #fff; }
.post-cta .eyebrow { color: var(--amber); margin: 0 0 6px; }
.post-cta h2 { margin: 0 0 6px; font-family: var(--display); font-size: 22px; line-height: 1.3; }
.post-cta p { margin: 0; color: var(--mut-d); font-size: 15px; line-height: 1.6; }
.post-cta .btn { flex-shrink: 0; }

.related { padding-top: 24px; }
.related .h2 { margin-bottom: 28px; }

@media (max-width: 960px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-card--feature { flex-direction: column; }
  .post-card--feature .post-card__img { min-height: 0; aspect-ratio: 16 / 9; }
  .post-card--feature .post-card__body { padding: 24px; }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-body { font-size: 17px; }
  .post-cta { flex-direction: column; align-items: flex-start; padding: 24px; }
  .post-cta .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .post-card { transition: none; } .post-card:hover { transform: none; } }
