/* ============================================================
   AK Group — Knowledge Centre (blog hub + article pages)
   Loaded after styles.css, reuses its tokens and components.
   ============================================================ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------- hub ---------------- */

.blog-hero {
  background: #fff;
  padding-top: 56px;
  padding-bottom: 8px;
}

.blog-hero {
  background: #fff;
  padding-top: 56px;
  padding-bottom: 8px;
}

.blog-hero .wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.blog-hero .h1-page {
  margin-top: 4px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: 22ch;
}

.blog-hero .lede {
  max-width: 42rem;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.blog-stats {
  margin-top: 0;
}
.blog-stats span {
  border: 1px solid var(--line);
  background: var(--gray);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(15, 17, 19, 0.6);
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.hub-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.hub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hub-filters button {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: rgba(15, 17, 19, 0.65);
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.hub-filters button:hover {
  border-color: rgba(15, 17, 19, 0.3);
  color: var(--ink);
}
.hub-filters button.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.hub-count {
  font-size: 12.5px;
  color: rgba(15, 17, 19, 0.5);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 639px) {
  .hub-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .hub-count {
    text-align: center;
    margin-top: 2px;
  }
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding-top: 32px;
  padding-bottom: 96px;
}

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-card);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}
.post-card[hidden] {
  display: none;
}

/* Knowledge Centre: keep the existing 3-col hub rhythm on wide screens, but lay cards out side-by-side
   as soon as there is room for at least two columns. */
#blogCards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 22px;
}
#blogCards .post-card {
  box-shadow: var(--shadow-card);
}
#blogCards .post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}
@media (max-width: 900px) {
  #blogCards {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 16px;
  }
}

.post-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--ink);
  overflow: hidden;
}
.post-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.post-card:hover .post-card-media img {
  transform: scale(1.04);
}

.post-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px;
}
.post-card-cat {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--blue);
}
.post-card-body {
  padding: 18px;
}
.post-card-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--blue);
}
.post-card-title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.018em;
}
.post-card-excerpt {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(15, 17, 19, 0.6);
  flex: 1;
}
.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: rgba(15, 17, 19, 0.45);
}
.post-card-meta a {
  color: rgba(15, 17, 19, 0.6);
  flex: 1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* ---------------- article ---------------- */

.post-head {
  background: #fff;
  padding-top: 40px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: rgba(15, 17, 19, 0.45);
}
.breadcrumb a {
  color: rgba(15, 17, 19, 0.55);
}
.breadcrumb a:hover {
  color: var(--blue);
}
.breadcrumb span[aria-hidden] {
  color: rgba(15, 17, 19, 0.25);
}
.breadcrumb span {
  min-height: 18px;
}

.post-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: rgba(0, 71, 255, 0.08);
  padding: 7px 14px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--blue);
  min-height: 32px;
}

.post-title {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.9vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -0.032em;
  max-width: 22ch;
}

.post-standfirst {
  margin-top: 18px;
  max-width: 42rem;
  font-size: 17.5px;
  line-height: 1.6;
  color: rgba(15, 17, 19, 0.7);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: rgba(15, 17, 19, 0.5);
  min-height: 24px;
}
.post-meta strong {
  font-weight: 600;
  color: rgba(15, 17, 19, 0.75);
}
.post-meta .dot {
  color: rgba(15, 17, 19, 0.2);
}

@media (max-width: 639px) {
  .post-head {
    padding-top: 26px;
  }
  .breadcrumb {
    gap: 6px;
    font-size: 12px;
  }
  .post-cat-pill {
    padding: 6px 12px;
    font-size: 10px;
  }
  .post-title {
    margin-top: 12px;
    font-size: clamp(1.6rem, 6vw, 2rem);
  }
  .post-standfirst {
    margin-top: 14px;
    font-size: 16.5px;
  }
  .post-meta {
    gap: 6px 14px;
    font-size: 12px;
    margin-top: 18px;
    padding-top: 14px;
  }
  .post-meta .dot {
    display: none;
  }
}

.post-hero {
  margin-top: 28px;
  border-radius: 1.75rem;
  overflow: hidden;
  background: var(--ink);
  box-shadow: var(--shadow-media);
}
.post-hero img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-layout {
  display: grid;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 88px;
}

/* ---------------- prose ---------------- */

.prose {
  max-width: 44rem;
  font-size: 17px;
  line-height: 1.7;
  color: rgba(15, 17, 19, 0.82);
}
.prose > *:first-child {
  margin-top: 0;
}
.prose p {
  margin-top: 18px;
}
.prose h2 {
  margin-top: 40px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.026em;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.prose h3 {
  margin-top: 26px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.prose strong {
  font-weight: 600;
  color: var(--ink);
}
.prose a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:hover {
  color: var(--blue-dark);
}

.prose ul,
.prose ol {
  margin-top: 16px;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.prose ul li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.prose ul li::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--blue);
}
.prose ol {
  counter-reset: li;
}
.prose ol li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.prose ol li::before {
  counter-increment: li;
  content: counter(li);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  background: rgba(0, 71, 255, 0.08);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.prose blockquote {
  margin: 24px 0;
  padding: 18px 22px;
  border-left: 3px solid var(--blue);
  border-radius: 0 12px 12px 0;
  background: var(--gray);
  font-size: 16px;
  line-height: 1.6;
  color: rgba(15, 17, 19, 0.78);
}
.prose blockquote p {
  margin: 0;
}
.prose blockquote p + p {
  margin-top: 10px;
}

.prose figure {
  margin: 28px 0;
}
.prose figure img {
  display: block;
  width: 100%;
  border-radius: 16px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.prose figcaption {
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(15, 17, 19, 0.45);
}

.prose table {
  width: 100%;
  margin: 22px 0;
  border-collapse: collapse;
  font-size: 14px;
}
.prose thead {
  background: var(--gray);
}
.prose th {
  padding: 11px 13px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(15, 17, 19, 0.5);
}
.prose td {
  padding: 11px 13px;
  border-top: 1px solid var(--line);
}

.callout {
  margin: 24px 0;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--gray);
  font-size: 14.5px;
  line-height: 1.65;
  color: rgba(15, 17, 19, 0.75);
}
.callout b {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.callout.accent {
  background: rgba(0, 71, 255, 0.05);
  border-color: rgba(0, 71, 255, 0.16);
}

.takeaway {
  margin-top: 34px;
  padding: 22px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
}
.takeaway h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.takeaway ul {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.takeaway li {
  display: flex;
  gap: 9px;
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  align-items: flex-start;
}
.takeaway li::before {
  content: "→";
  color: var(--blue-soft, #7fb8ff);
  flex-shrink: 0;
  font-size: 16px;
}

.faq {
  margin-top: 38px;
  padding-top: 6px;
}
.faq h2 {
  margin-top: 0;
}
.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-item summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  min-height: 44px;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  color: var(--blue);
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
}
.faq-item p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(15, 17, 19, 0.72);
}

@media (max-width: 639px) {
  .post-layout {
    gap: 28px;
    padding-top: 28px;
    padding-bottom: 56px;
  }
  .prose {
    font-size: 17px;
    line-height: 1.65;
    max-width: 100%;
  }
  .prose p {
    margin-top: 16px;
  }
  .prose h2 {
    margin-top: 32px;
    font-size: clamp(1.45rem, 5vw, 1.7rem);
  }
  .prose h3 {
    margin-top: 22px;
    font-size: 16px;
  }
  .prose ul,
  .prose ol {
    gap: 8px;
  }
  .prose blockquote {
    margin: 20px 0;
    padding: 16px 18px;
    font-size: 15.5px;
  }
  .prose figure {
    margin: 22px 0;
  }
  .prose table {
    margin: 18px 0;
  }
  .callout {
    margin: 20px 0;
    font-size: 14px;
  }
  .takeaway {
    margin-top: 26px;
    padding: 18px;
  }
  .faq {
    margin-top: 30px;
  }
}
.prose > *:first-child {
  margin-top: 0;
}
.prose p {
  margin-top: 20px;
}
.prose h2 {
  margin-top: 48px;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.4vw, 1.95rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.028em;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.prose h3 {
  margin-top: 30px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.prose strong {
  font-weight: 600;
  color: var(--ink);
}
.prose a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:hover {
  color: var(--blue-dark);
}

.prose ul,
.prose ol {
  margin-top: 18px;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prose ul li {
  display: flex;
  gap: 11px;
}
.prose ul li::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--blue);
}
.prose ol {
  counter-reset: li;
}
.prose ol li {
  display: flex;
  gap: 12px;
}
.prose ol li::before {
  counter-increment: li;
  content: counter(li);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 3px;
  border-radius: 50%;
  background: rgba(0, 71, 255, 0.08);
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.prose blockquote {
  margin: 28px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--blue);
  border-radius: 0 12px 12px 0;
  background: var(--gray);
  font-size: 16.5px;
  line-height: 1.65;
  color: rgba(15, 17, 19, 0.78);
}
.prose blockquote p {
  margin: 0;
}
.prose blockquote p + p {
  margin-top: 12px;
}

.prose figure {
  margin: 32px 0;
}
.prose figure img {
  display: block;
  width: 100%;
  border-radius: 16px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.prose figcaption {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(15, 17, 19, 0.45);
}

.prose table {
  width: 100%;
  margin: 26px 0;
  border-collapse: collapse;
  font-size: 14.5px;
}
.prose thead {
  background: var(--gray);
}
.prose th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(15, 17, 19, 0.5);
}
.prose td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.callout {
  margin: 28px 0;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--gray);
  font-size: 15px;
  line-height: 1.7;
  color: rgba(15, 17, 19, 0.75);
}
.callout b {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.callout.accent {
  background: rgba(0, 71, 255, 0.05);
  border-color: rgba(0, 71, 255, 0.16);
}

.takeaway {
  margin-top: 40px;
  padding: 24px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
}
.takeaway h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.takeaway ul {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.takeaway li {
  display: flex;
  gap: 10px;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.85);
}
.takeaway li::before {
  content: "→";
  color: var(--blue-soft, #7fb8ff);
  flex-shrink: 0;
}

.faq {
  margin-top: 44px;
  padding-top: 8px;
}
.faq h2 {
  margin-top: 0;
}
.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-item summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  color: var(--blue);
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
}
.faq-item p {
  margin: 0 0 18px;
  font-size: 15.5px;
  line-height: 1.7;
  color: rgba(15, 17, 19, 0.72);
}

/* ---------------- sidebar ---------------- */

.post-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toc {
  position: sticky;
  top: 104px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.toc h2 {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(15, 17, 19, 0.45);
}
.toc ol {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
}
.toc a {
  display: flex;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(15, 17, 19, 0.62);
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(0, 71, 255, 0.7);
  padding-top: 2px;
}
.toc a:hover {
  color: var(--blue);
}

.side-cta {
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  padding: 22px;
}
.side-cta h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.side-cta p {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.65);
}
.side-cta .btn {
  margin-top: 16px;
  width: 100%;
}

/* ---------------- author + related ---------------- */

.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 44px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--gray);
}
.author-avatar {
  display: grid;
  place-items: center;
  height: 44px;
  width: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.author-box b {
  display: block;
  font-size: 13.5px;
}
.author-box span {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(15, 17, 19, 0.55);
}

.related {
  background: var(--gray);
  padding-bottom: 88px;
}

.related-grid {
  display: grid;
  gap: 20px;
  margin-top: 32px;
}

/* ---------------- responsive ---------------- */

@media (min-width: 1024px) {
  .post-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 64px;
    align-items: start;
  }
  /* Desktop article body + sidebar: keep the sidebar from running taller than
     the article and pushing the related block below the fold. When the prose/
     structure is short, give the sidebar a floor so the right column stays
     visually balanced with a real related block underneath it. */
  .post-side {
    align-self: start;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
  .post-side > *:first-child {
    margin-top: 0;
  }
  .post-layout:has(.toc) .toc {
    position: sticky;
    top: 104px;
  }
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 36px;
  }
  .related {
    padding-bottom: 88px;
  }
  .blog-hero {
    padding-top: 72px;
  }
}

/* ============ MOBILE ARTICLE HEAD ============ */
/* The dot separators are separate flex items, so they were being left dangling
   at the end of a wrapped line. On phones the row relies on spacing instead. */
@media (max-width: 639px) {
  .post-meta {
    gap: 6px 18px;
    font-size: 12px;
    margin-top: 20px;
    padding-top: 16px;
  }
  .post-meta .dot {
    display: none;
  }
  .post-head {
    padding-top: 28px;
  }
}
