
/* Blog Archive — page-scoped visual reset to match the new site */
/*
 * Additional CSS variables and styling for blog archive and post pages.
 * These definitions ensure the archive cards have a stronger border on hover
 * and that the legacy blog navbar matches the new marketing site header.
 */

/* Define a stronger border color for hover states. Fall back to the
 * standard border colour if custom properties are unavailable.
 */
:root {
  --color-border-strong: #d2cdf5;
}
[data-theme='dark'] {
  --color-border-strong: #39365a;
}

/* Navbar overhaul: apply marketing styles to the old .navbar used in
 * blog pages. This makes the header sticky with a blurred backdrop,
 * uses the primary colour for the logo and menu highlights, and aligns
 * spacing and typography with the main site. On mobile, the JS from
 * /static/script.js will toggle the .open class on the mobile menu.
 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}
[data-theme='dark'] .navbar {
  background-color: rgba(14, 14, 23, 0.9);
}

.navbar .logo,
.navbar .neon-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
  text-decoration: none;
}
.navbar .logo img,
.navbar .neon-logo img {
  height: 24px;
  width: auto;
  vertical-align: middle;
  margin-right: 6px;
}

/* Horizontal nav list for desktop */
.navbar .nav-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.navbar .nav-menu a {
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  text-decoration: none;
}
.navbar .nav-menu a:hover,
.navbar .nav-menu a:focus-visible {
  color: var(--color-primary);
}

/* Mobile toggle (hamburger) */
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.menu-toggle .bar {
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 1px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}
/* Cards -> light, clean surface (same feel as .feature-card) */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.archive-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.archive-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

.archive-card h3 {
  margin: 0 0 .5rem 0;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--color-text); /* ensure no neon */
}

.archive-card time {
  display: block;
  margin-bottom: .35rem;
  font-size: .85rem;
  color: var(--color-muted);
}

.archive-card .excerpt {
  margin: .25rem 0 .5rem 0;
  color: var(--color-muted);
}

.archive-card .read-more {
  font-weight: 600;
  color: var(--color-primary); /* brand accent */
}

.features[aria-label="Blog archive list"] .container {
  max-width: 1100px; /* match content width of other pages */
}

/* Search input styling */
#blog-search {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  min-width: 280px;
  padding: .7rem .9rem;
  outline: none;
  box-shadow: var(--shadow-sm) inset;
}
#blog-search::placeholder { color: var(--color-muted); }

/* Hero image balance (smaller on desktop, room for copy) */
.hero .device-frame {
  max-width: 420px;
  margin-left: auto;
}
@media (min-width: 1400px) {
  .hero .device-frame { max-width: 460px; }
}
@media (max-width: 767px) {
  .hero .device-frame { max-width: 85%; }
}

/* Reduce bright badge links in older markup if any slip through */
.archive-card a, .archive-card a:visited {
  color: var(--color-primary);
}

/*
 * Override neon-styled cards from legacy stylesheets. In both light and
 * dark themes the archive cards should use the neutral surface and text
 * colours from our palette. Use !important to trump older hero.css rules.
 */
.archive-card {
  background-color: var(--color-surface) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}
.archive-card h3 {
  color: var(--color-text) !important;
}
.archive-card time,
.archive-card .excerpt {
  color: var(--color-muted) !important;
}
.archive-card .read-more {
  color: var(--color-primary) !important;
}

/* Sidebar (monthly archives) styling. Apply our card treatment to any
 * sidebar block listing months or categories. This targets common
 * class names used in the old template. */
.blog-archives,
.archive-sidebar,
.blog-archive-sidebar {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}
.blog-archives a,
.archive-sidebar a,
.blog-archive-sidebar a {
  color: var(--color-primary);
  text-decoration: none;
}
.blog-archives a:hover,
.archive-sidebar a:hover,
.blog-archive-sidebar a:hover {
  color: var(--color-primary-dark);
}

/* === Archive list refresh shell ================================================= */
:root {
  --font-heading: "Space Grotesk", "Inter", system-ui, sans-serif;
  --color-border-strong: #d2cdf5;
}
[data-theme='dark'] {
  --color-border-strong: #39365a;
}

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

.archive-page {
  background:
    radial-gradient(circle at top left, rgba(127, 90, 240, 0.10), transparent 34%),
    radial-gradient(circle at top right, rgba(99, 211, 255, 0.12), transparent 28%),
    var(--color-bg);
}

.beta-banner {
  position: relative;
  z-index: 1001;
  background: linear-gradient(90deg, #6d5ce6 0%, #7f5af0 45%, #63d3ff 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(87, 68, 180, 0.16);
}
.beta-banner__inner {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.beta-banner p {
  margin: 0;
  font-size: 0.95rem;
}
.beta-banner a {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.beta-banner a:hover,
.beta-banner a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  left: auto;
  width: 100%;
  z-index: 1000;
  background: rgba(253, 252, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(230, 228, 240, 0.92);
}
[data-theme='dark'] .site-header {
  background: rgba(15, 14, 26, 0.86);
  border-bottom-color: rgba(42, 41, 67, 0.95);
}
.site-header.scrolled {
  box-shadow: 0 16px 38px rgba(31, 31, 46, 0.08);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 78px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--color-text);
  text-decoration: none;
}
.brand:hover,
.brand:focus-visible {
  color: var(--color-text);
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7f5af0 0%, #63d3ff 100%);
  color: #fff;
  font-weight: 800;
  font-family: var(--font-heading);
  letter-spacing: 0.03em;
  box-shadow: 0 14px 30px rgba(127, 90, 240, 0.28);
}
.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  line-height: 1.1;
}
.brand-copy strong {
  font-family: var(--font-heading);
  font-size: 1rem;
}
.brand-copy small {
  color: var(--color-muted);
  font-size: 0.82rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}
.main-nav a {
  color: var(--color-muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}
.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a[aria-current='page'] {
  color: var(--color-text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn-ghost {
  background: rgba(127, 90, 240, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(127, 90, 240, 0.15);
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgba(127, 90, 240, 0.16);
  color: var(--color-primary-dark);
}
[data-theme='dark'] .btn-ghost {
  background: rgba(163, 139, 244, 0.12);
  border-color: rgba(163, 139, 244, 0.22);
}
[data-theme='dark'] .btn-ghost:hover,
[data-theme='dark'] .btn-ghost:focus-visible {
  background: rgba(163, 139, 244, 0.2);
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(127, 90, 240, 0.16);
  border-radius: 14px;
  background: rgba(127, 90, 240, 0.08);
  cursor: pointer;
}
.mobile-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--color-primary);
}

.mobile-menu[hidden] {
  display: none !important;
}
.mobile-menu {
  position: fixed;
  top: 102px;
  right: 1rem;
  left: 1rem;
  max-width: 420px;
  margin-left: auto;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 48px rgba(31, 31, 46, 0.14);
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
[data-theme='dark'] .mobile-menu {
  background: rgba(23, 23, 43, 0.97);
}
.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.mobile-menu a {
  display: block;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}
.mobile-menu a:hover,
.mobile-menu a:focus-visible,
.mobile-menu a[aria-current='page'] {
  background: var(--color-accent);
  color: var(--color-primary);
}

.archive-page main {
  flex: 1 0 auto;
}
.archive-hero {
  padding: clamp(3rem, 5vw, 4.75rem) 0 1.6rem;
}
.archive-hero__panel {
  position: relative;
  overflow: hidden;
  padding: clamp(1.8rem, 4vw, 3rem);
  border-radius: 32px;
  border: 1px solid rgba(127, 90, 240, 0.14);
  background:
    radial-gradient(circle at top right, rgba(99, 211, 255, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(127, 90, 240, 0.14) 0%, rgba(255, 255, 255, 0.92) 58%);
  box-shadow: 0 28px 46px rgba(31, 31, 46, 0.08);
}
[data-theme='dark'] .archive-hero__panel {
  border-color: rgba(163, 139, 244, 0.18);
  background:
    radial-gradient(circle at top right, rgba(99, 211, 255, 0.12), transparent 26%),
    linear-gradient(135deg, rgba(163, 139, 244, 0.18) 0%, rgba(29, 25, 64, 0.95) 64%);
}
.archive-eyebrow {
  margin: 0 0 0.9rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
}
.archive-hero h1 {
  max-width: 12ch;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.archive-lead {
  max-width: 62ch;
  margin: 1rem 0 0;
  font-size: 1.05rem;
  color: var(--color-muted);
}
.archive-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.35rem;
}
.archive-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.62rem 0.88rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 600;
}
[data-theme='dark'] .archive-chip {
  background: rgba(255, 255, 255, 0.05);
}
.archive-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.archive-section {
  padding: 0 0 5rem;
}
.archive-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.archive-toolbar__copy h2 {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  letter-spacing: -0.02em;
}
.archive-results {
  margin: 0.4rem 0 0;
  color: var(--color-muted);
}
.archive-search-wrap {
  flex: 0 1 360px;
}
#blog-search {
  width: 100%;
  min-width: 0;
  padding: 0.95rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 2px rgba(31, 31, 46, 0.04);
  font-size: 0.98rem;
}
[data-theme='dark'] #blog-search {
  background: rgba(255, 255, 255, 0.05);
}
#blog-search:focus {
  border-color: rgba(127, 90, 240, 0.55);
  box-shadow: 0 0 0 4px rgba(127, 90, 240, 0.12);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.archive-card {
  display: block;
  height: 100%;
  padding: 1.3rem 1.3rem 1.2rem;
  border-radius: 22px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-text) !important;
  box-shadow: 0 16px 34px rgba(31, 31, 46, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
[data-theme='dark'] .archive-card {
  background: rgba(23, 23, 43, 0.96) !important;
}
.archive-card:hover,
.archive-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 24px 40px rgba(31, 31, 46, 0.11);
  border-color: var(--color-border-strong) !important;
}
.archive-meta {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.archive-card h3 {
  margin: 0 0 0.75rem;
  color: var(--color-text) !important;
  font-size: 1.1rem;
  line-height: 1.35;
}
.archive-card time {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--color-muted) !important;
  font-size: 0.87rem;
}
.archive-card .excerpt {
  flex: 1;
  margin: 0 0 0.95rem;
  color: var(--color-muted) !important;
}
.archive-card .read-more {
  margin-top: auto;
  color: var(--color-primary) !important;
  font-weight: 700;
}

.archive-empty {
  margin-top: 1.2rem;
  padding: 1.2rem 1.25rem;
  border: 1px dashed var(--color-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.75);
}
[data-theme='dark'] .archive-empty {
  background: rgba(255, 255, 255, 0.04);
}
.archive-empty h3 {
  margin-bottom: 0.35rem;
}
.archive-empty p {
  margin-bottom: 0;
  color: var(--color-muted);
}

.site-footer {
  margin-top: auto;
  padding-top: 3.8rem;
  background:
    linear-gradient(180deg, rgba(127, 90, 240, 0.06) 0%, rgba(127, 90, 240, 0) 18%),
    var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  padding-bottom: 2.4rem;
}
.site-footer h3 {
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer li {
  margin-bottom: 0.65rem;
}
.site-footer li a {
  color: var(--color-muted);
}
.site-footer li a:hover,
.site-footer li a:focus-visible {
  color: var(--color-primary);
}
.brand--footer {
  align-items: flex-start;
}
.footer-copy {
  margin: 1rem 0 0;
  max-width: 34rem;
  color: var(--color-muted);
}
.site-footer .footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 2rem;
  border-top: 1px solid var(--color-border);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-links a {
  color: var(--color-muted);
}
.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--color-primary);
}

@media (max-width: 980px) {
  .main-nav,
  .nav-actions .btn {
    display: none;
  }
  .mobile-toggle {
    display: flex;
  }
  .nav-actions {
    margin-left: auto;
  }
  .archive-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .archive-search-wrap {
    flex-basis: auto;
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .beta-banner__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-shell {
    min-height: 72px;
  }
  .archive-hero h1 {
    max-width: none;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .site-footer .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .brand-copy small {
    display: none;
  }
  .archive-hero__panel {
    padding: 1.5rem;
    border-radius: 26px;
  }
  .archive-card {
    border-radius: 18px;
  }
  .archive-hero__actions .btn,
  .beta-banner a {
    width: 100%;
    justify-content: center;
  }
}
