/* ============================================================
   FOXFOSTER — Blog research portal
   Loaded after style.css + home.css. Consumes the shared design
   tokens only; does not restyle the navbar or footer.
   ============================================================ */

/* Blog-scoped navbar: always-on frosted glass with heavy blur so
   the hero image behind reads as a soft blur, not the full image.
   Background opacity is kept intentionally low. */
.navbar {
  background: rgba(var(--bg-rgb), 0.42);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-bottom: 1px solid var(--border);
}

.navbar.scrolled {
  background: rgba(var(--bg-rgb), 0.55);
}

[data-theme="light"] .navbar {
  background: rgba(var(--bg-rgb), 0.6);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(var(--bg-rgb), 0.72);
}

.b-section-gap { padding: 80px 0; }

.b-section-gap > .container {
  max-width: 1440px;
}

/* ============================================================
   HERO — home-page style: left copy over right-aligned backdrop
   ============================================================ */
.blog-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  padding: 112px 0 88px;
}

.blog-hero-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('../images/blog-dark-02.png');
  background-position: right center;
  background-size: cover;
  background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(to left, #000 0%, transparent 72%);
  mask-image: linear-gradient(to left, #000 0%, transparent 72%);
}

[data-theme="light"] .blog-hero-img {
  background-image: url('../images/blog-light-02.png');
}

.blog-hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(var(--primary-rgb), 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--primary-rgb), 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
}

.blog-hero-glow {
  position: absolute;
  top: -280px;
  left: -120px;
  width: 760px;
  height: 760px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.1), transparent 62%);
  pointer-events: none;
}

.blog-hero .container {
  position: relative;
  z-index: 1;
}

.blog-hero-inner {
  position: relative;
}

/* --- copy --- */
.blog-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.06);
  border: 1px solid rgba(var(--primary-rgb), 0.22);
  border-radius: 100px;
  padding: 8px 18px;
  margin-bottom: 28px;
}

.blog-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.blog-hero-title {
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 24px;
}

.blog-hero-title .gradient-text {
  white-space: nowrap;
}

.blog-hero-desc {
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 620px;
  margin-bottom: 36px;
}

.blog-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 0;
}

/* ============================================================
   STICKY SEARCH TOOLBAR
   ============================================================ */
.b-toolbar {
  position: sticky;
  top: calc(var(--nav-height) + 16px);
  z-index: 40;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(var(--bg-rgb), 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 56px;
  box-shadow: 0 12px 40px -30px rgba(0, 0, 0, 0.5);
}

.b-search {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  min-width: 0;
  transition: border-color var(--transition);
}

.b-search:focus-within { border-color: rgba(var(--primary-rgb), 0.45); }

.b-search svg { flex-shrink: 0; color: var(--text-muted); }

.b-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 12px 0;
}

.b-search input::placeholder { color: var(--text-muted); }

.b-select {
  position: relative;
}

.b-select select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 12px 38px 12px 16px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition), color var(--transition);
}

.b-select select:hover { border-color: rgba(var(--primary-rgb), 0.4); color: var(--text); }

.b-select select option { background: var(--bg); color: var(--text); }

.b-select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.b-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.b-count b { color: var(--primary); font-weight: 600; }

.b-reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.b-reset:hover {
  color: var(--primary);
  border-color: rgba(var(--primary-rgb), 0.4);
}

.b-reset:disabled { opacity: 0.45; cursor: default; }

/* ============================================================
   FEATURED ARTICLE
   ============================================================ */
.featured-article {
  display: grid;
  grid-template-columns: 55fr 45fr;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.06), transparent 55%), var(--bg-card);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.featured-article:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--primary-rgb), 0.35);
  box-shadow: 0 32px 80px -48px rgba(var(--primary-rgb), 0.3);
}

.fa-body {
  padding: 36px;
  display: flex;
  flex-direction: column;
}

.fa-cat {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 100px;
  padding: 6px 14px;
  margin-bottom: 20px;
}

.fa-body h2 {
  font-size: clamp(1.65rem, 2.8vw, 2.35rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}

.fa-body > p {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.fa-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: auto;
  margin-bottom: 24px;
}

.fa-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.35), rgba(var(--primary-rgb), 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.fa-media {
  position: relative;
  min-height: 300px;
  overflow: hidden;
}

.fa-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  transition: transform 0.7s ease;
}

.featured-article:hover .fa-media img { transform: scale(1.05); }

.fa-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, rgba(var(--bg-rgb), 0.7), rgba(var(--bg-rgb), 0) 55%);
}

/* ============================================================
   ARTICLE CARD — gradient border on hover
   ============================================================ */
.b-grid,
.b-band-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.b-card-link {
  display: block;
  height: 100%;
}

.b-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 620px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.b-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.6), transparent 40%, transparent 60%, rgba(var(--primary-rgb), 0.35));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.b-card:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  box-shadow: 0 28px 70px -44px rgba(var(--primary-rgb), 0.4);
}

.b-card:hover::before { opacity: 1; }

.b-card-media {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.b-card-media img {
  display: block;
  width: 100%;
  height: auto;
}

.b-card-body {
  padding: 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.b-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.b-cat {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 100px;
  padding: 5px 12px;
}

.b-bookmark {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card-hover);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.b-bookmark:hover {
  border-color: rgba(var(--primary-rgb), 0.4);
  color: var(--primary);
}

.b-bookmark.saved {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.4);
  color: var(--primary);
}

.b-share {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card-hover);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.b-share:hover {
  border-color: rgba(var(--primary-rgb), 0.4);
  color: var(--primary);
}

.b-share.copied {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.4);
  color: var(--primary);
}

.b-card > .b-bookmark {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  background: rgba(var(--bg-rgb), 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.b-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 10px;
  transition: color var(--transition);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.22rem;
}

.b-card-body h3:hover { color: var(--primary); }

.b-card-body > p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.5rem;
}

.b-card-meta {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.b-card-meta .author { color: var(--text-secondary); }

.b-card-meta .b-share { margin-left: auto; width: 28px; height: 28px; }

.b-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 72px 24px;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.b-empty.show { display: flex; }

.b-empty strong { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: 6px; }

.b-empty .b-reset { margin-top: 14px; }

.b-empty svg { color: var(--primary); opacity: 0.85; margin-bottom: 8px; }

/* ============================================================
   SEE MORE ARTICLES
   ============================================================ */
.b-see-more {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.b-see-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 1px solid rgba(var(--primary-rgb), 0.35);
  border-radius: 100px;
  padding: 13px 30px;
  cursor: pointer;
  transition: all var(--transition);
}

.b-see-more-btn .ico { display: inline-flex; }

.b-see-more-btn:hover {
  background: rgba(var(--primary-rgb), 0.08);
  border-color: var(--primary);
  box-shadow: 0 6px 24px rgba(var(--primary-rgb), 0.18);
}

/* ============================================================
   SEARCH HIGHLIGHT
   ============================================================ */
.b-card-body mark,
.featured-article mark {
  background: rgba(var(--primary-rgb), 0.22);
  color: var(--primary-light);
  border-radius: 3px;
  padding: 0 2px;
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
.b-skeleton { pointer-events: none; }

.b-skeleton .sk {
  background: linear-gradient(90deg, var(--bg-card-hover) 25%, rgba(var(--primary-rgb), 0.08) 37%, var(--bg-card-hover) 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.3s infinite linear;
  border-radius: 10px;
}

.b-skeleton .sk-media { aspect-ratio: 190 / 100; border-radius: 0; }

.b-skeleton .sk-line { height: 13px; margin: 14px 26px 0; }

.b-skeleton .sk-line.short { width: 55%; }

.b-skeleton .sk-line.tiny { width: 38%; height: 10px; margin-top: 18px; }

@keyframes sk-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ============================================================
   EDITORIAL SECTIONS
   ============================================================ */
.b-band { border-top: 1px solid var(--border); }

.b-band-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.b-band-title {
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}

.b-band-title span { color: var(--primary); }

.b-band-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 420px;
  line-height: 1.6;
  margin-top: 8px;
}

.b-band-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  transition: gap var(--transition);
}

.b-band-more:hover { gap: 12px; }

.b-band-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

/* numbered "popular" list */
.b-pop-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.b-pop {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.b-pop:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--primary-rgb), 0.35);
  box-shadow: 0 24px 60px -44px rgba(var(--primary-rgb), 0.35);
}

.b-pop-rank {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: rgba(var(--primary-rgb), 0.55);
  line-height: 1;
}

.b-pop h4 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  transition: color var(--transition);
}

.b-pop:hover h4 { color: var(--primary); }

.b-pop .meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* XnoleX promo card */
.b-promo {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(var(--primary-rgb), 0.14), transparent 55%),
    linear-gradient(180deg, rgba(var(--primary-rgb), 0.06), transparent 60%),
    var(--bg-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

.b-promo:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 70px -44px rgba(var(--primary-rgb), 0.45);
}

.b-promo .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

.b-promo .logo span { color: var(--primary); }

.b-promo p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ============================================================
   NEWSLETTER
   ============================================================ */
.newsletter {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
}

.newsletter-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.newsletter h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 16px;
}

.newsletter h2 span { color: var(--primary); }

.newsletter p {
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 480px;
}

.nl-form {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  padding: 8px 8px 8px 22px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.nl-form:focus-within {
  border-color: rgba(var(--primary-rgb), 0.45);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.nl-form input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  padding: 10px 0;
}

.nl-form input::placeholder { color: var(--text-muted); }

.nl-form button {
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 100px;
  padding: 12px 24px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.nl-form button:hover {
  box-shadow: 0 6px 24px rgba(var(--primary-rgb), 0.35);
  transform: translateY(-1px);
}

.nl-note {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 14px;
}

.nl-note.ok { color: #46A758; }

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.b-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.b-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1440px) {
  .blog-hero-inner { gap: 40px; }

  .b-pop-list { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .b-grid, .b-band-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .b-pop-list { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .b-section-gap { padding: 64px 0; }

  .blog-hero { padding: 88px 0 56px; }

  .blog-hero .container {
    background: linear-gradient(180deg,
      var(--bg) 0%,
      rgba(var(--bg-rgb), 0.94) 55%,
      rgba(var(--bg-rgb), 0.78) 100%);
    padding: 40px 24px 32px;
  }

  .blog-hero-title { font-size: clamp(2.1rem, 8.5vw, 3rem); }

  .featured-article { grid-template-columns: 1fr; }
  .fa-media { min-height: 220px; }
  .fa-body { padding: 26px; }

  .b-toolbar { padding: 12px; }
  .b-count { margin-left: 0; width: 100%; }

  .b-select select, .b-reset { width: 100%; }

  .newsletter-inner { grid-template-columns: 1fr; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .b-reveal { transition: none; opacity: 1; transform: none; }

  .b-card-media img, .fa-media img { transition: none; }

  .b-skeleton .sk { animation: none; }
}
