/* ============================================================
   TRASIX — Blog / Resources (built on trasix.css tokens)
   Used by: /resources, /resources/categories/*, /post/*
   ============================================================ */

/* Full-viewport gradient — covers the whole page (behind header + content),
   not just the listing section. Fixed so it stays put on scroll. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-gradient);
  pointer-events: none;
}

/* ── Listing (index + category pages) ──────────────────────── */
.rs-listing {
  padding: 44px 0 96px;
  position: relative;
  overflow: hidden;
  background: transparent;
}
/* soft brand-tinted blobs so the frosted glass has something to refract */
.rs-listing::before,
.rs-listing::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.rs-listing::before {
  width: 540px; height: 540px;
  top: -160px; right: -120px;
  background: radial-gradient(closest-side, rgba(237, 22, 66, .12), transparent 70%);
}
.rs-listing::after {
  width: 460px; height: 460px;
  bottom: -180px; left: -140px;
  background: radial-gradient(closest-side, rgba(108, 93, 211, .12), transparent 70%);
}
.rs-listing .container { position: relative; z-index: 1; }
.rs-listing .section-label { display: block; margin-bottom: 8px; }
.rs-h1 {
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin: 0 0 12px;
}
.rs-sub {
  font-size: var(--text-lg);
  color: var(--fg-secondary);
  max-width: 640px;
  margin: 0 0 32px;
}

/* category filter chips */
.rs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.rs-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  text-decoration: none;
  transition: all .15s ease;
}
.rs-chip:hover { color: var(--fg-primary); background: var(--glass-bg-strong); border-color: var(--glass-border); }
.rs-chip.is-active {
  color: #fff;
  background: var(--action-primary);
  border-color: var(--action-primary);
}

/* card grid */
.rs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.rs-card {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 4px 20px rgba(45, 49, 66, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.rs-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 44px rgba(45, 49, 66, .16);
  border-color: var(--glass-border);
}
.rs-card-media {
  aspect-ratio: 16 / 10;
  background: var(--neutral-100);
  overflow: hidden;
}
.rs-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.rs-card:hover .rs-card-media img { transform: scale(1.04); }
.rs-card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.rs-card-cat {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-accent);
  margin-bottom: 10px;
}
.rs-card-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 10px;
}
.rs-card-excerpt {
  font-size: var(--text-base);
  color: var(--fg-secondary);
  line-height: var(--leading-relaxed);
  margin: 0 0 18px;
}
.rs-card-date {
  margin-top: auto;
  font-size: var(--text-sm);
  color: var(--fg-tertiary);
}

/* ── Post (article) ────────────────────────────────────────── */
.post { padding: 24px 0 96px; }

/* breadcrumb */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: var(--text-sm); color: var(--fg-tertiary);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--fg-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--fg-accent); }
.breadcrumb .bc-sep { opacity: .55; }
.breadcrumb .bc-current { color: var(--fg-primary); font-weight: var(--weight-medium); }

/* two-column: category sidebar (left) + article (right) */
.post-layout { display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: 56px; align-items: start; }
.post-main { max-width: 760px; }

.post-sidebar { position: sticky; top: 96px; }
.ps-panel {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-xl);
  padding: 22px 18px;
  box-shadow: 0 4px 20px rgba(45, 49, 66, .08);
}
.ps-title {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--fg-tertiary); margin: 0 0 14px; padding: 0 12px;
}
.ps-cats { list-style: none; margin: 0; padding: 0; }
.ps-cats a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-md);
  font-size: var(--text-base); color: var(--fg-secondary);
  text-decoration: none; transition: background .15s ease, color .15s ease;
}
.ps-cats a:hover { background: var(--glass-bg); color: var(--fg-primary); }
.ps-cats a.is-active { background: var(--action-primary); color: #fff; }
.ps-cats a.is-active .ps-count { color: rgba(255, 255, 255, .8); }
/* Secondary membership (article in more than one category): light red tint, not
   another solid-red block, so adjacent active categories stay readable. */
.ps-cats a.is-secondary { background: var(--red-50); color: var(--action-primary); }
.ps-cats a.is-secondary .ps-count { color: var(--red-400); }
.ps-cats .ps-all { font-weight: var(--weight-semibold); color: var(--fg-primary); margin-bottom: 6px; }
.ps-count { font-size: var(--text-xs); color: var(--fg-tertiary); }

.post-meta-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.post-cat {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-accent);
  text-decoration: none;
}
.post-cat:hover { text-decoration: underline; }
.post-date { font-size: var(--text-sm); color: var(--fg-tertiary); }
.post-title {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 28px;
}
.post-cover { width: 100%; border-radius: var(--radius-xl); margin: 0 0 36px; display: block; }

/* article body typography */
.post-body { font-size: var(--text-lg); line-height: var(--leading-relaxed); color: var(--neutral-800); }
.post-body > * { margin: 0 0 22px; }
.post-body h2 { font-size: var(--text-2xl); margin: 44px 0 14px; }
.post-body h3 { font-size: var(--text-xl); margin: 36px 0 12px; }
.post-body h4 { font-size: var(--text-lg); font-weight: var(--weight-semibold); margin: 28px 0 10px; }
.post-body a { color: var(--action-primary); text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover { color: var(--action-primary-hover); }
.post-body strong { font-weight: var(--weight-semibold); color: var(--fg-primary); }
.post-body ul, .post-body ol { padding-left: 24px; }
.post-body li { margin-bottom: 8px; }
.post-body blockquote {
  border-left: 3px solid var(--action-primary);
  padding: 4px 0 4px 22px;
  margin: 28px 0;
  color: var(--fg-secondary);
  font-style: italic;
}
.post-body figure { margin: 32px 0; }
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius-lg); display: block; }
.post-body hr { border: none; border-top: 1px solid var(--border-default); margin: 40px 0; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 980px) {
  .rs-grid { grid-template-columns: repeat(2, 1fr); }
  .rs-h1 { font-size: var(--text-4xl); }
}
@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; gap: 40px; }
  .post-main { order: 1; }                 /* article first on mobile */
  .post-sidebar { order: 2; position: static; }  /* categories move below the post */
}
@media (max-width: 620px) {
  .rs-grid { grid-template-columns: 1fr; }
  .rs-listing { padding: 40px 0 64px; }
  .post-title { font-size: var(--text-3xl); }
  .post-body { font-size: var(--text-md); }
}
/* Mobile: center the listing title + category filter pills */
@media (max-width: 760px) {
  .rs-listing .section-label, .rs-h1, .rs-sub { text-align: center; }
  .rs-sub { margin-left: auto; margin-right: auto; }   /* 640px cap → center the box */
  .rs-chips { justify-content: center; }
}

/* ============================================================
   GATED ARTICLES — blur lock + unlock modal
   Markup generated by gen-site.mjs; behaviour in js/includes.js.
   ============================================================ */
/* "Gated" badge on resource cards */
.rs-card-media { position: relative; }
.rs-card-lock {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: var(--radius-full);
  background: rgba(45,49,66,0.78); color: #fff;
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  letter-spacing: 0.04em; backdrop-filter: blur(4px);
}

/* Locked region: blurred + inert until the body gets .ga-unlocked */
.ga-locked { position: relative; }
.ga-locked .ga-fade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 45%, var(--neutral-100) 92%);
}
body:not(.ga-unlocked) .ga-locked { filter: blur(7px); user-select: none; pointer-events: none; }
body.ga-unlocked .ga-locked .ga-fade { display: none; }

/* Modal */
.ga-scrim {
  position: fixed; inset: 0; z-index: 1200;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(30,33,51,0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 20px;
}
.ga-scrim.show { display: flex; }
body.ga-unlocked .ga-scrim { display: none !important; }
@media (min-width: 680px) { .ga-scrim { align-items: center; } }
.ga-modal {
  width: 100%; max-width: 460px;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(30,33,51,0.28);
  padding: 32px clamp(22px,5vw,36px) 28px;
  animation: gaUp .26s cubic-bezier(.16,1,.3,1);
}
@keyframes gaUp { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.ga-lock-badge {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px;
  padding: 6px 12px; border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: var(--weight-bold);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-accent); background: rgba(237,22,66,0.08);
}
.ga-modal h3 { margin: 0 0 8px; font-size: var(--text-2xl); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); color: var(--fg-primary); }
.ga-modal .ga-sub { margin: 0 0 20px; font-size: var(--text-sm); line-height: var(--leading-relaxed); color: var(--fg-secondary); }
.ga-field { margin-bottom: 12px; }
.ga-field label { display: block; margin-bottom: 6px; font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--fg-primary); }
.ga-field input {
  width: 100%; padding: 11px 13px; font: inherit; font-size: var(--text-sm); color: var(--fg-primary);
  background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius-md);
  transition: border-color .12s, box-shadow .12s;
}
.ga-field input:focus { outline: none; border-color: var(--action-primary); box-shadow: 0 0 0 3px rgba(237,22,66,0.16); }
.ga-consent { display: flex; gap: 9px; align-items: flex-start; margin: 8px 0 18px; font-size: var(--text-xs); color: var(--fg-secondary); line-height: var(--leading-relaxed); }
.ga-consent input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--action-primary); flex-shrink: 0; }
.ga-submit {
  width: 100%; padding: 14px; border: none; border-radius: var(--radius-md);
  background: var(--action-primary); color: #fff; font: inherit; font-size: var(--text-base);
  font-weight: var(--weight-semibold); cursor: pointer; transition: background .15s;
}
.ga-submit:hover { background: var(--action-primary-hover); }
.ga-submit:disabled { opacity: .6; cursor: wait; }
.ga-form .form-status { margin: 10px 0 0; color: var(--fg-accent); font-size: var(--text-xs); }
.ga-fine { margin-top: 13px; text-align: center; font-size: var(--text-xs); color: var(--fg-tertiary); }
.ga-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
/* Unlock success panel (if ever shown) inherits .form-success from styles.css */

/* ===== End-of-post CTA (internal links → demo + platform) ===== */
.post-cta {
  margin: 44px 0 8px;
  padding: 34px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  text-align: center;
}
.post-cta-title { font-size: 1.4rem; font-weight: 700; color: var(--fg-primary); margin: 0 0 8px; }
.post-cta-text { color: var(--fg-secondary); max-width: 54ch; margin: 0 auto 22px; line-height: 1.6; }
.post-cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.post-cta-btn {
  display: inline-block; font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem;
  padding: 12px 24px; border-radius: var(--radius-full); text-decoration: none; transition: all .15s ease;
}
.post-cta-btn.primary { background: var(--action-primary); color: #fff; }
.post-cta-btn.primary:hover { background: var(--action-primary-hover); }
.post-cta-btn.ghost { background: transparent; color: var(--fg-primary); border: 1px solid var(--border-strong); }
.post-cta-btn.ghost:hover { border-color: var(--fg-primary); }
@media (max-width: 600px) {
  .post-cta { padding: 26px 20px; }
  .post-cta-actions { flex-direction: column; }
}
