/* ──────────────────────────────────────────────────────────────────────────
   All-posts page — rebranded to the main Genovaflow design system: dark ink +
   frost + orange, Geist type, glassy cards, an animated layered background, and
   a smooth staggered entrance on load. Loaded AFTER all-posts.css so it
   overrides the legacy gold/black styling. Tokens copied from global.css.
   ────────────────────────────────────────────────────────────────────────── */
:root {
  --ink: #0A0908;
  --ink-2: #14110d;
  --frost: #F4F1EB;
  --frost-dim: #C9C3B8;
  --frost-mute: #6A6359;
  --orange: #FF6A1A;
  --line: rgba(244, 241, 235, 0.08);
  --line-strong: rgba(244, 241, 235, 0.14);
  --glass: rgba(244, 241, 235, 0.04);
}

body {
  background: var(--ink) !important;
  font-family: "Geist", system-ui, -apple-system, sans-serif;
}

/* ── Animated brand background (slow-drifting warm + cool mesh over a faint grid) ── */
body::before {
  content: "";
  position: fixed;
  inset: -15%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(46% 42% at 82% 4%, rgba(255, 106, 26, 0.12), transparent 60%),
    radial-gradient(44% 46% at 8% 18%, rgba(96, 128, 170, 0.12), transparent 62%),
    radial-gradient(54% 50% at 50% 102%, rgba(126, 98, 178, 0.10), transparent 60%),
    var(--ink);
  animation: apMeshDrift 26s ease-in-out infinite;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(244, 241, 235, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 235, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 78%);
}
@keyframes apMeshDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-2.5%, 2%) scale(1.06); }
}

/* ── Layout: the shared header spacer already clears the fixed pill ── */
.all-posts-container {
  max-width: 1240px;
  padding: 28px 24px 70px;
}

/* ── Page header ── */
.page-header { margin-bottom: 44px; }
.page-header h1 {
  font-family: "Geist", sans-serif;
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.98;
  color: var(--frost);
}
.page-header p {
  color: var(--frost-dim);
  font-size: 17px;
  line-height: 1.6;
}

/* ── Filter / search / sort bar — glass ── */
.filter-controls {
  margin-bottom: 40px;
  padding-bottom: 0;
}
.filter-btn {
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--frost-dim);
  padding: 9px 16px;
  border-radius: 999px;
  font-family: "Geist Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 200ms ease, background 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.filter-btn:hover {
  color: var(--frost);
  background: rgba(244, 241, 235, 0.07);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.filter-btn.active {
  background: var(--orange);
  color: var(--ink);
  border-color: var(--orange);
  box-shadow: 0 6px 18px rgba(255, 106, 26, 0.32);
}

.filter-search {
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--frost);
  border-radius: 999px;
  padding: 10px 16px;
  font-family: "Geist", sans-serif;
  font-size: 13.5px;
}
.filter-search::placeholder { color: var(--frost-mute); }
.filter-search:focus {
  outline: none;
  border-color: var(--orange);
  background: rgba(244, 241, 235, 0.06);
}
.sort-control { color: var(--frost-dim); }
.sort-control label { font-size: 13px; color: var(--frost-mute); }
.sort-button {
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--frost);
  border-radius: 999px;
  padding: 10px 16px;
  font-family: "Geist", sans-serif;
  font-size: 13.5px;
}
.sort-options {
  background: rgba(20, 17, 13, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 6px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.sort-option { color: var(--frost-dim); font-size: 13.5px; }
.sort-option:hover { background: rgba(244, 241, 235, 0.06); color: var(--orange); }

/* ── Cards — glassy ── */
.all-posts-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 24px;
}
.post-card,
.featured-card {
  background: linear-gradient(180deg, rgba(31, 27, 22, 0.55) 0%, rgba(20, 17, 13, 0.5) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(244, 241, 235, 0.04);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), border-color 300ms ease, box-shadow 320ms ease;
}
.post-card:hover,
.featured-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(244, 241, 235, 0.06);
}
.post-image, .featured-image { border-bottom: 1px solid var(--line); }
.post-content { padding: 22px; }
.post-category, .featured-category {
  color: var(--orange);
  font-family: "Geist Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
}
.post-title, .featured-title {
  color: var(--frost);
  font-family: "Geist", sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.post-excerpt, .featured-excerpt { color: var(--frost-dim); }
.read-more, .featured-link {
  color: var(--orange);
  font-weight: 600;
  letter-spacing: -0.005em;
}
.featured-label {
  background: var(--orange);
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  letter-spacing: 0.06em;
}

/* ── Section titles ── */
.featured-section { margin-top: 90px; }
.section-title {
  font-family: "Geist", sans-serif;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--frost);
  font-size: clamp(30px, 4vw, 48px);
}
.section-description { color: var(--frost-dim); }

.no-results-message { color: var(--frost-dim); font-family: "Geist", sans-serif; }

/* ── Smooth entrance: nothing appears static on load ── */
@keyframes apRise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
.page-header   { animation: apRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.filter-controls { animation: apRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both; }
.featured-section { animation: apRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Staggered card reveal */
.all-posts-grid .post-card,
.featured-grid .featured-card {
  animation: apRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.all-posts-grid .post-card:nth-child(1)  { animation-delay: 0.14s; }
.all-posts-grid .post-card:nth-child(2)  { animation-delay: 0.20s; }
.all-posts-grid .post-card:nth-child(3)  { animation-delay: 0.26s; }
.all-posts-grid .post-card:nth-child(4)  { animation-delay: 0.32s; }
.all-posts-grid .post-card:nth-child(5)  { animation-delay: 0.38s; }
.all-posts-grid .post-card:nth-child(6)  { animation-delay: 0.44s; }
.all-posts-grid .post-card:nth-child(7)  { animation-delay: 0.50s; }
.all-posts-grid .post-card:nth-child(8)  { animation-delay: 0.56s; }
.all-posts-grid .post-card:nth-child(9)  { animation-delay: 0.62s; }
.all-posts-grid .post-card:nth-child(n+10) { animation-delay: 0.68s; }
.featured-grid .featured-card:nth-child(2) { animation-delay: 0.10s; }
.featured-grid .featured-card:nth-child(3) { animation-delay: 0.20s; }

/* ── Newsletter + consultation CTA — brand glass panels ── */
.ap-subscribe, .ap-cta {
  max-width: 1240px;
  margin: 64px auto 0;
  animation: apRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ap-cta { margin-bottom: 8px; }
.ap-panel {
  position: relative;
  overflow: hidden;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 52px 40px;
  background: linear-gradient(180deg, rgba(31, 27, 22, 0.6) 0%, rgba(20, 17, 13, 0.55) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(244, 241, 235, 0.05);
}
.ap-panel-cta {
  background:
    radial-gradient(130% 150% at 50% 0%, rgba(255, 106, 26, 0.16), transparent 58%),
    linear-gradient(180deg, rgba(31, 27, 22, 0.6) 0%, rgba(20, 17, 13, 0.55) 100%);
}
.ap-kicker {
  display: inline-block;
  font-family: "Geist Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 14px;
}
.ap-panel h3, .ap-panel h2 {
  font-family: "Geist", sans-serif;
  color: var(--frost);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.0;
  margin: 0 0 14px;
}
.ap-panel h3 { font-size: clamp(26px, 3.4vw, 40px); }
.ap-panel h2 { font-size: clamp(30px, 4.4vw, 56px); }
.ap-accent { color: var(--orange); }
.ap-panel p {
  color: var(--frost-dim);
  font-size: 15.5px;
  line-height: 1.6;
  max-width: 580px;
  margin: 0 auto 30px;
}
.ap-form { display: flex; gap: 10px; max-width: 520px; margin: 0 auto; }
.ap-form input {
  flex: 1;
  background: rgba(244, 241, 235, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 18px;
  color: var(--frost);
  font-family: "Geist", sans-serif;
  font-size: 14px;
}
.ap-form input::placeholder { color: var(--frost-mute); }
.ap-form input:focus { outline: none; border-color: var(--orange); background: rgba(244, 241, 235, 0.07); }
.ap-form button {
  background: var(--orange);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 13px 28px;
  font-family: "Geist", sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(255, 106, 26, 0.32);
  transition: transform 200ms ease;
}
.ap-form button:hover { transform: translateY(-1px); }
.ap-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--orange);
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-family: "Geist", sans-serif;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(255, 106, 26, 0.32);
  transition: transform 200ms ease;
}
.ap-cta-btn:hover { transform: translateY(-2px); }
@media (max-width: 560px) {
  .ap-form { flex-direction: column; }
  .ap-panel { padding: 34px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .page-header, .filter-controls, .featured-section, .ap-subscribe, .ap-cta,
  .all-posts-grid .post-card, .featured-grid .featured-card { animation: none; }
}
