/* ==========================================================================
   Insights (blog): listing page + article pages
   Loaded after style.css on blog.html and blog-*.html
   ========================================================================== */

.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; }

/* ---------- Listing: toolbar + filter chips ---------- */
.blog-list { padding-top: 100px; }
.blog-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-bottom: 48px; }
.blog-toolbar .intro { display: flex; flex-direction: column; gap: 20px; max-width: 560px; }
.blog-filter { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-btn {
  padding: 10px 18px; border-radius: 100px;
  border: 1px solid var(--line); background: var(--white); color: var(--title);
  font-size: 15px; font-weight: 500; line-height: 1.2;
  transition: background .3s var(--ease), color .3s, border-color .3s;
}
.filter-btn:hover { border-color: var(--rust); color: var(--rust); }
.filter-btn.is-active { background: var(--brown-deep); border-color: var(--brown-deep); color: var(--cream); }
.filter-btn:focus-visible, .share-btn:focus-visible, .featured-post:focus-visible, .blog-card:focus-visible { outline: 2px solid var(--rust); outline-offset: 4px; }
.blog-list [hidden] { display: none !important; }
.filter-empty { text-align: center; padding: 40px 0 0; color: var(--muted); }

/* ---------- Listing: featured post ---------- */
.featured-post {
  display: grid; grid-template-columns: 1.15fr 1fr;
  border-radius: var(--radius-xl); overflow: hidden;
  background: var(--white); border: 1px solid var(--line);
  margin-bottom: 64px;
  transition: box-shadow .5s var(--ease), transform .5s var(--ease), border-color .4s;
}
.featured-post:hover { box-shadow: var(--shadow); transform: translateY(-4px); border-color: transparent; }
.featured-post .media { position: relative; overflow: hidden; min-height: 440px; }
.featured-post .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.featured-post:hover .media img { transform: scale(1.05); }
.featured-post .body { padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.featured-post .meta { display: flex; gap: 12px 14px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.featured-post .meta .pill { padding: 5px 12px; border-radius: 100px; background: var(--sand); color: var(--rust); font-weight: 600; font-size: 13px; }
.featured-post h2 { font-size: clamp(28px, 3vw, 38px); line-height: 1.15; letter-spacing: -0.03em; transition: color .3s; }
.featured-post:hover h2 { color: var(--rust); }
.featured-post p { color: var(--muted); font-size: 17px; }
.featured-post .foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 22px; margin-top: 4px; border-top: 1px solid var(--line); }
.featured-post .by { font-size: 14px; color: var(--muted); }
.featured-post:hover .link-arrow svg { transform: translateX(4px); }

/* ---------- Listing: grid + "ask us" tile ---------- */
.blog-grid { gap: 56px 30px; }
.topic-card {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: var(--radius-lg); min-height: 340px; padding: 40px;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 18px;
  background: var(--brown-deep);
}
.topic-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: .55; }
.topic-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(28, 20, 12, .35) 0%, rgba(28, 20, 12, .92) 70%), radial-gradient(ellipse at 100% 0%, rgba(160, 78, 18, .45), transparent 60%); }
.topic-card h4 { max-width: 420px; }
.topic-card p { max-width: 440px; }

/* ---------- Listing: WhatsApp / email updates ---------- */
.updates-section { padding-top: 0; }
.updates-box {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center;
  padding: 64px; border-radius: var(--radius-xl); background: var(--brown-deep);
}
.updates-box::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 0% 100%, rgba(160, 78, 18, .38), transparent 55%), radial-gradient(ellipse at 100% 0%, rgba(252, 217, 160, .08), transparent 50%); }
.updates-box .copy { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.updates-box h2 { font-size: clamp(30px, 3.4vw, 42px); }
.updates-box .perks { display: grid; gap: 10px; color: rgba(255, 255, 255, .8); }
.updates-box .perks li { position: relative; padding-left: 30px; }
.updates-box .perks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: rgba(252, 217, 160, .14); }
.updates-box .perks li::after { content: ""; position: absolute; left: 6px; top: 7px; width: 5px; height: 8px; border: solid var(--cream); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.updates-box .form { padding: 34px; border-radius: var(--radius-lg); background: rgba(255, 255, 255, .04); border: 1px solid var(--line-dark); }
.updates-box .form .btn { justify-self: start; }
.updates-box .field label { color: rgba(255, 255, 255, .85); }
.updates-box .field input, .updates-box .field select { background: rgba(255, 255, 255, .06); border-color: rgba(252, 217, 160, .18); color: var(--white); }
.updates-box .field select option { color: var(--title); }
.updates-box .field input::placeholder { color: rgba(255, 255, 255, .42); }
.updates-box .field input:focus, .updates-box .field select:focus { border-color: var(--cream); box-shadow: 0 0 0 4px rgba(252, 217, 160, .14); }
.updates-box .form-success { background: rgba(252, 217, 160, .1); color: var(--cream); border-color: rgba(252, 217, 160, .3); }

/* ---------- Post hero ---------- */
.post-hero h1 { font-size: clamp(34px, 4.8vw, 58px); max-width: 940px; }
.post-hero a.tag { transition: background .3s; }
.post-hero a.tag:hover { background: rgba(255, 255, 255, .14); }
.post-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; font-size: 15px; color: rgba(255, 255, 255, .78); margin-top: 4px; }
.post-byline .author { display: inline-flex; align-items: center; gap: 12px; color: var(--white); font-weight: 500; }
.post-byline .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; flex: none; }
.post-byline .avatar img { width: 17px; height: auto; }
.post-byline .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--rust-400); }

/* Reading progress */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; pointer-events: none; }
.read-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--rust), var(--cream)); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Article typography (~720px column) ---------- */
.article-section { padding: 96px 0 var(--section-y); }
.article { max-width: 720px; margin: 0 auto; font-size: 18px; line-height: 1.75; color: var(--text); }
.article > * + * { margin-top: 1.25em; }
.article .lead { font-size: 21px; line-height: 1.6; color: var(--title); letter-spacing: -0.01em; }
.article h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: -0.03em; margin-top: 2.1em; }
.article h3 { font-size: clamp(20px, 2.2vw, 24px); line-height: 1.3; letter-spacing: -0.02em; margin-top: 1.7em; }
.article h2 + *, .article h3 + * { margin-top: .7em; }
.article strong { color: var(--title); font-weight: 600; }
.article p a, .article li a { color: var(--rust); text-decoration: underline; text-underline-offset: 3px; }
.article ul, .article ol { display: grid; gap: .6em; }
.article ul > li { position: relative; padding-left: 28px; }
.article ul > li::before { content: ""; position: absolute; left: 6px; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--rust); }
.article ol { counter-reset: li; }
.article ol > li { position: relative; padding-left: 44px; counter-increment: li; }
.article ol > li::before { content: counter(li); position: absolute; left: 0; top: .2em; width: 28px; height: 28px; border-radius: 50%; background: var(--sand); color: var(--rust); font-size: 14px; font-weight: 700; line-height: 28px; text-align: center; }
.article figure { margin-top: 2.2em; margin-bottom: 2.2em; }
.article figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); }
.article figcaption { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Pull-quote */
.pull-quote { position: relative; margin: 2.4em 0; padding: 6px 0 6px 34px; border-left: 3px solid var(--rust); }
.pull-quote p { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.35; letter-spacing: -0.02em; font-weight: 500; color: var(--title); }

/* Local note box */
.note { padding: 22px 26px; border-radius: 14px; background: var(--sand); border-left: 3px solid var(--rust); font-size: 16.5px; line-height: 1.65; }
.note strong { display: block; margin-bottom: 6px; color: var(--rust); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--white); -webkit-overflow-scrolling: touch; }
.article table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 16px; line-height: 1.5; }
.article th, .article td { text-align: left; vertical-align: top; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.article th { background: var(--sand); color: var(--title); font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.article tr:last-child td { border-bottom: 0; }
.article td:first-child { font-weight: 600; color: var(--title); }

/* ---------- Share row + author card ---------- */
.article-foot { max-width: 720px; margin: 64px auto 0; }
.share-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px 0; border-block: 1px solid var(--line); }
.share-row > span { font-weight: 600; color: var(--title); }
.share-links { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 100px;
  border: 1px solid var(--line); background: var(--white); color: var(--title);
  font-size: 14px; font-weight: 500; line-height: 1.2;
  transition: background .3s var(--ease), color .3s, border-color .3s;
}
.share-btn svg { width: 16px; height: 16px; color: var(--rust); transition: color .3s; }
.share-btn:hover { background: var(--rust); border-color: var(--rust); color: var(--white); }
.share-btn:hover svg { color: var(--white); }
.share-btn.is-done { background: var(--brown-deep); border-color: var(--brown-deep); color: var(--cream); }
.share-btn.is-done svg { color: var(--cream); }

.author-card { display: flex; gap: 24px; align-items: flex-start; margin-top: 40px; padding: 32px; border-radius: var(--radius-lg); background: var(--sand); }
.author-card .avatar { width: 72px; height: 72px; flex: none; border-radius: 50%; background: var(--brown-deep); display: grid; place-items: center; }
.author-card .avatar img { width: 28px; height: auto; }
.author-card .who { display: flex; flex-direction: column; gap: 10px; }
.author-card small { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--rust); }
.author-card p { color: var(--muted); }
.author-card .row { gap: 10px 26px; margin-top: 4px; }

/* ---------- Related posts ---------- */
.related { padding-top: 0; }
.related-wrap { padding-top: 90px; border-top: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .featured-post { grid-template-columns: 1fr; }
  .featured-post .media { min-height: 0; aspect-ratio: 16 / 10; }
  .featured-post .body { padding: 34px; }
  .updates-box { grid-template-columns: 1fr; gap: 40px; padding: 48px 34px; }
  .related .grid-3 > :nth-child(3) { display: none; }
}
@media (max-width: 640px) {
  .blog-list { padding-top: 72px; }
  .blog-toolbar { margin-bottom: 36px; }
  .filter-btn { padding: 9px 15px; font-size: 14px; }
  .featured-post { margin-bottom: 48px; }
  .featured-post .body { padding: 26px 22px 30px; gap: 18px; }
  .blog-grid { gap: 44px; }
  .topic-card { padding: 30px 24px; min-height: 300px; }
  .updates-box { padding: 36px 22px; }
  .updates-box .form { padding: 24px 20px; }
  .article-section { padding-top: 64px; }
  .article { font-size: 17px; line-height: 1.72; }
  .article .lead { font-size: 19px; }
  .pull-quote { padding-left: 20px; }
  .note { padding: 20px; }
  .article table { min-width: 0; font-size: 15px; }
  .article th, .article td { padding: 12px 14px; }
  .post-byline .author { flex-basis: 100%; }
  .post-byline i.dot:first-of-type { display: none; }
  .article-foot { margin-top: 48px; }
  .author-card { flex-direction: column; gap: 18px; padding: 26px 22px; }
  .author-card .avatar { width: 60px; height: 60px; }
  .related-wrap { padding-top: 64px; }
  .related .grid-3 > :nth-child(3) { display: flex; }
}
