/* =========================================================
   SB Global Solution — Blog list, article cards and Subscribe box. Loaded on the Blogs template (page-blogs.php) and every article (blog-detail.php).
   Same rules as html-work/css/style.css. Article page layout: blog-detail.css.
   ========================================================= */
/* Visually hidden, still read by screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---- Subscribe (blog pages) ---- */
.subscribe { padding: var(--sec-pad) 0 0; background: #fff; }
.blog + .subscribe { padding-top: 0; }
.subscribe__card {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: center;
  padding: 40px 44px; border-radius: 26px;
  background:
    radial-gradient(360px 220px at 0% 0%, rgba(255,122,26,.14), transparent 70%),
    radial-gradient(420px 260px at 100% 100%, rgba(59,79,216,.16), transparent 70%),
    #F6F8FC;
  border: 1px solid var(--line); box-shadow: var(--shadow-2);
}
.subscribe__text { display: flex; gap: 18px; align-items: flex-start; }
.subscribe__ic { display: grid; place-items: center; flex-shrink: 0; width: 58px; height: 58px; border-radius: 18px; background: var(--grad-brand); box-shadow: 0 14px 26px -14px rgba(59,79,216,.8); }
.subscribe__ic svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.subscribe h2 { margin: 0; font-family: var(--font-head); font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; line-height: 1.3; color: var(--ink); }
.subscribe__text p { margin: 10px 0 0; font-size: 16px; line-height: 1.7; color: var(--text); }
.subscribe__points { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; padding: 0; list-style: none; }
.subscribe__points li { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--navy-900); }
.subscribe__points svg { width: 16px; height: 16px; fill: none; stroke: var(--orange-500); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.subscribe__field { display: flex; gap: 8px; padding: 7px; border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.subscribe__field:focus-within { border-color: var(--blue-600); }
.subscribe__field input { flex: 1; min-width: 0; padding: 0 16px; border: 0; background: transparent; font: inherit; font-size: 15.5px; color: var(--ink); outline: none; }
.subscribe__field.is-invalid { border-color: #DC2626; }
.subscribe__field .btn { flex-shrink: 0; }
.subscribe__msg { margin: 10px 0 0 18px; min-height: 1.4em; font-size: 14px; font-weight: 600; }
.subscribe__msg.is-ok { color: #16A34A; }
.subscribe__msg.is-err { color: #DC2626; }
@media (max-width: 960px) {
  .subscribe__card { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 32px 28px; }
}
@media (max-width: 600px) {
  .subscribe__card { padding: 26px 20px; }
  .subscribe__text { flex-direction: column; }
  .subscribe__field { flex-direction: column; border-radius: 18px; }
  .subscribe__field input { padding: 12px 12px; }
  .subscribe__field .btn { justify-content: center; }
  .subscribe__msg { margin-left: 4px; }
}

/* ---- Blog listing & article pages ---- */
.blog { padding: var(--sec-pad) 0; background: #fff; }
.blog-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 34px; }
.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-filter { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--navy-900); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.blog-filter:hover { border-color: var(--orange-500); color: var(--orange-600); }
.blog-filter.is-active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
a.blog-filter { text-align: center; }   /* filters are links to the category pages: same look as the design's buttons */
/* Search icon at the end of the filters — opens the search box (hidden until clicked) */
.blog-filter--search { display: inline-grid; place-items: center; padding: 9px 13px; }
.blog-filter--search svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.blog-filter--search[aria-expanded="true"] { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.blog-search[hidden] { display: none; }
.blog-search { flex: 1 0 100%; }   /* opened search box: its own row, as wide as the featured card */
.blog-search { display: flex; align-items: center; gap: 8px; min-width: 260px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #F6F8FC; }
.blog-search svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.blog-search input { flex: 1; min-width: 0; padding: 11px 0; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); outline: none; }
.blog-search:focus-within { border-color: var(--blue-600); background: #fff; }

.post-tag { display: inline-block; align-self: flex-start; padding: 5px 12px; border-radius: 999px; background: var(--orange-50); color: var(--orange-600); font-size: 12.5px; font-weight: 700; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--muted); }
.post-meta span { display: inline-flex; align-items: center; gap: 6px; }
.post-meta svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.post-featured { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); overflow: hidden; margin-bottom: 30px; border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.post-featured__img { position: relative; display: block; min-height: 340px; background: var(--blue-50); }
.post-featured__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.post-featured:hover .post-featured__img img { transform: scale(1.04); }
.post-featured__badge { position: absolute; left: 18px; top: 18px; padding: 6px 14px; border-radius: 999px; background: var(--grad-brand); color: #fff; font-family: var(--font-head); font-size: 12.5px; font-weight: 700; }
.post-featured__body { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 38px 40px; }
.post-featured h2 { margin: 0; font-family: var(--font-head); font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; line-height: 1.3; color: var(--ink); }
.post-featured h2 a:hover, .post-card h3 a:hover { color: var(--orange-600); }
.post-featured p { margin: 0; font-size: 16px; line-height: 1.75; color: var(--text); }
.post-featured .btn { align-self: flex-start; margin-top: 6px; }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.post-grid .post-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform .25s, box-shadow .25s; }
.post-grid .post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); }
.post-card__img { display: block; overflow: hidden; aspect-ratio: 16 / 10; background: var(--blue-50); }
.post-card__img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.post-card:hover .post-card__img img { transform: scale(1.05); }
.post-card__body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 22px 22px 24px; }
.post-card h3 { margin: 0; font-family: var(--font-head); font-size: 18px; font-weight: 800; line-height: 1.35; color: var(--ink); }
.post-card__body > p { margin: 0; flex-grow: 1; font-size: 14.5px; line-height: 1.65; color: var(--text); }
.post-card__link { display: inline-flex; align-items: center; gap: 7px; margin-top: 4px; font-family: var(--font-head); font-size: 14.5px; font-weight: 700; color: var(--orange-600); }
.post-card__link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.post-card__link:hover svg { transform: translateX(4px); }
.post-card.is-hidden { display: none !important; }
.blog-empty { display: grid; justify-items: center; gap: 6px; padding: 50px 20px; text-align: center; color: var(--text); }
.blog-empty[hidden] { display: none; }
.blog-empty svg { width: 42px; height: 42px; fill: none; stroke: var(--orange-500); stroke-width: 1.8; stroke-linecap: round; }
.blog-empty b { font-family: var(--font-head); font-size: 19px; color: var(--ink); }
.blog-empty p { margin: 0; }
/* "Load More" button under the cards (same spacing as the other centred section buttons) */
.blog-more { margin-top: 36px; text-align: center; }
.blog-more .btn[aria-busy="true"] { opacity: .7; pointer-events: none; }

@media (max-width: 1100px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .post-featured { grid-template-columns: minmax(0, 1fr); }
  .post-featured__img { min-height: 0; aspect-ratio: 16 / 9; }
  .post-featured__body { padding: 24px 22px 26px; }
  .blog-search { min-width: 0; width: 100%; }
}
@media (max-width: 600px) {
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .blog-filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .blog-filters::-webkit-scrollbar { display: none; }
  .blog-filter { flex-shrink: 0; }
}
