/* Blog index and posts. Layered on styles.css + services.css. */

/* ---------- cards ---------- */

.post-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.post-card {
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.4s var(--ease-out);
}
.post-card:hover {
  border-color: rgba(69, 216, 195, 0.45);
  transform: translateY(-3px);
}
.post-card[hidden] {
  display: none;
}
.post-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 20px 22px 22px;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.card-meta .cat {
  color: var(--mint);
  font-weight: 600;
}
.post-card h3,
.post-card h2 {
  font-size: 19px;
  line-height: 1.3;
}
.card-desc {
  color: var(--ink-2);
  font-size: 14.5px;
}
.post-card .go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--mint);
}
.post-card .go svg {
  transition: transform 0.25s var(--ease-out);
}
.post-card:hover .go svg {
  transform: translateX(4px);
}
[dir='rtl'] .post-card:hover .go svg {
  transform: scaleX(-1) translateX(4px);
}

/* Dotted artwork: the site's dot grid with a glow placed per topic. */
.card-art {
  --gx: 30%;
  --gy: 40%;
  position: relative;
  height: 150px;
  background:
    radial-gradient(circle, rgba(69, 216, 195, 0.55) 1.3px, transparent 1.8px) 0 0 / 14px 14px,
    radial-gradient(260px 160px at var(--gx) var(--gy), rgba(69, 216, 195, 0.35), transparent 70%),
    linear-gradient(160deg, rgba(13, 130, 116, 0.35), rgba(3, 17, 18, 0.6));
  -webkit-mask-image: linear-gradient(180deg, #000 55%, rgba(0, 0, 0, 0.75));
  mask-image: linear-gradient(180deg, #000 55%, rgba(0, 0, 0, 0.75));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.card-art span {
  position: absolute;
  inset-inline-start: 20px;
  bottom: 14px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 246, 243, 0.85);
}
.card-art[data-art='compliance'] { --gx: 78%; --gy: 30%; }
.card-art[data-art='threats'] { --gx: 22%; --gy: 70%; }
.card-art[data-art='ai-security'] { --gx: 55%; --gy: 20%; }
.card-art[data-art='resilience'] { --gx: 85%; --gy: 75%; }
.card-art[data-art='governance'] { --gx: 40%; --gy: 55%; }
.card-art[data-art='security-testing'] { --gx: 15%; --gy: 25%; }
.card-art[data-art='cloud-ot'] { --gx: 65%; --gy: 65%; }

.post-card.featured .card-art {
  height: 200px;
}
.post-card.featured h2 {
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.2;
}
.post-card.featured .card-desc {
  font-size: 16px;
}

/* ---------- index filters ---------- */

.blog-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filters button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
.filters button span {
  font-size: 12px;
  color: var(--ink-3);
}
.filters button:hover {
  color: var(--ink);
  border-color: rgba(69, 216, 195, 0.4);
}
.filters button[aria-pressed='true'] {
  background: var(--mint);
  border-color: var(--mint);
  color: #032220;
}
.filters button[aria-pressed='true'] span {
  color: #0b4a43;
}

/* ---------- post page ---------- */

.read-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 3px;
  pointer-events: none;
}
.read-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}
[dir='rtl'] .read-progress span {
  transform-origin: right;
  background: linear-gradient(90deg, var(--teal), var(--mint));
  box-shadow: 0 0 10px rgba(69, 216, 195, 0.6);
}

.post-head {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 8px;
}
.post-head h1 {
  max-width: 900px;
  margin-top: 14px;
  font-size: clamp(30px, 7vw, 52px);
  line-height: 1.1;
}
.post-cat {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid rgba(69, 216, 195, 0.35);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mint);
  text-decoration: none;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 18px;
  font-size: 14px;
  color: var(--ink-3);
}
.post-meta span:first-child {
  color: var(--ink-2);
}

.post-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 0;
}
.toc {
  display: none;
}

/* Article typography. */
.prose {
  max-width: 720px;
  font-size: 17px;
  line-height: 1.75;
  color: #d7ebe7;
}
.prose > * + * {
  margin-top: 1.1em;
}
.prose .dek {
  font-family: var(--font-head);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
}
.prose h2 {
  margin-top: 2em;
  font-size: 26px;
  line-height: 1.25;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.prose h3 {
  margin-top: 1.6em;
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.prose h4 {
  margin-top: 1.4em;
  font-size: 17px;
  color: var(--ink);
}
.prose a {
  color: var(--mint);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:hover {
  text-decoration-thickness: 2px;
}
.prose strong {
  color: var(--ink);
}
.prose ul,
.prose ol {
  padding-inline-start: 1.3em;
}
.prose li + li {
  margin-top: 0.45em;
}
.prose li::marker {
  color: var(--mint);
}
.prose blockquote {
  margin-inline: 0;
  padding: 4px 0 4px 20px;
  border-inline-start: 3px solid var(--mint);
  color: var(--ink);
  font-style: italic;
}
.prose code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(69, 216, 195, 0.1);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: #bff3ea;
}
.prose pre {
  overflow-x: auto;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(3, 17, 18, 0.7);
  line-height: 1.55;
}
.prose pre code {
  padding: 0;
  background: none;
  font-size: 13.5px;
}
.prose table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
.prose th,
.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: start;
  vertical-align: top;
}
.prose th {
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 600;
  background: rgba(69, 216, 195, 0.06);
}

/* Service CTA at the end of the article. */
.post-cta {
  margin-top: 48px !important;
  padding: 28px;
  border-radius: 20px;
  line-height: 1.6;
}
.post-cta .eyebrow {
  margin-bottom: 8px;
}
.post-cta h2 {
  margin-top: 0;
  font-size: 24px;
}
.post-cta p:not(.eyebrow) {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 16px;
}
.post-cta .actions {
  margin-top: 20px;
}
/* Article links are mint and underlined; buttons inside the article keep
   their own colours. */
.prose .post-cta .btn {
  text-decoration: none;
}
.prose .post-cta .btn-primary {
  color: #032220;
}
.prose .post-cta .btn-ghost {
  color: var(--ink);
}

/* ---------- desktop ---------- */

@media (min-width: 900px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .post-card.featured > a {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
  }
  .post-card.featured .card-art {
    height: auto;
    min-height: 320px;
    border-bottom: 0;
    border-inline-end: 1px solid rgba(255, 255, 255, 0.06);
  }
  .post-card.featured .card-body {
    justify-content: center;
    padding: 40px;
    gap: 14px;
  }
  .blog-bar {
    flex-direction: row;
    align-items: end;
    justify-content: space-between;
  }

  .post-head {
    padding: 36px 40px 8px;
  }
  .post-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 720px);
    gap: 72px;
    padding: 32px 40px 0;
  }
  .toc {
    display: block;
    position: sticky;
    top: 110px;
    align-self: start;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
  .toc p {
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
  }
  .toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-inline-start: 1px solid rgba(255, 255, 255, 0.08);
  }
  .toc a {
    display: block;
    padding: 6px 0 6px 14px;
    margin-inline-start: -1px;
    border-inline-start: 2px solid transparent;
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--ink-3);
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
  }
  .toc .toc-h3 a {
    padding-inline-start: 26px;
  }
  .toc a:hover {
    color: var(--ink);
  }
  .toc a.on {
    color: var(--mint);
    border-inline-start-color: var(--mint);
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-card,
  .post-card .go svg,
  .filters button,
  .toc a {
    transition: none;
  }
}
