/* ==========================================================
   TOOLBASE.APP — Blog CSS
   ========================================================== */

/* ----------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   ---------------------------------------------------------- */
:root {
  --blog-prose-color:   #cbd5e1;  /* slate-300 */
  --blog-heading-color: #f1f5f9;  /* slate-100 */
  --blog-accent:        #34d399;  /* emerald-400 */
  --blog-accent-dim:    #059669;  /* emerald-600 */
  --blog-code-bg:       #0f172a;  /* slate-950 */
  --blog-card-bg:       rgba(15, 23, 42, 0.6);
  --blog-border:        rgba(51, 65, 85, 0.7); /* slate-700/70 */
  --blog-max-prose:     68ch;
  --blog-font-size:     clamp(1rem, 2.5vw, 1.125rem);
}

/* ----------------------------------------------------------
   Reading Progress Bar
   ---------------------------------------------------------- */
.blog-reading-bar {
  position: fixed;
  top: 0; /* Attach to top edge of browser */
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #34d399, #38bdf8, #a78bfa);
  z-index: 50; /* Above navbar (z-30) */
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ----------------------------------------------------------
   Blog Hero
   ---------------------------------------------------------- */
.blog-hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  padding: 2.5rem 1.5rem 2rem;
  border-radius: 1.5rem;
  overflow: hidden;
  margin-bottom: 3rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f3460 100%);
}

.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2,6,23,0.85) 0%, rgba(2,6,23,0.3) 60%, transparent 100%);
  border-radius: inherit;
  z-index: 1;
}

.blog-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  opacity: 0.45;
}

.blog-hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.blog-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blog-accent);
  margin-bottom: 0.75rem;
}

.blog-hero-title {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.blog-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.825rem;
  color: #94a3b8; /* slate-400 */
}

.blog-hero-meta span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.blog-tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--blog-accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.2s;
}

.blog-tag:hover {
  background: rgba(52, 211, 153, 0.22);
}

/* ----------------------------------------------------------
   Article Layout
   ---------------------------------------------------------- */
.blog-article-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .blog-article-wrapper {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }
}

/* ----------------------------------------------------------
   Prose (Body Text)
   ---------------------------------------------------------- */
.blog-prose {
  font-size: var(--blog-font-size);
  line-height: 1.8;
  color: var(--blog-prose-color);
  max-width: var(--blog-max-prose);
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.blog-prose h2 {
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--blog-heading-color);
  margin: 2.25rem 0 0.875rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.blog-prose h2::before {
  content: '';
  display: block;
  width: 2.5rem;
  height: 3px;
  background: var(--blog-accent);
  border-radius: 2px;
  margin-bottom: 0.6rem;
}

.blog-prose h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blog-heading-color);
  margin: 1.75rem 0 0.6rem;
}

.blog-prose p {
  margin: 0 0 1.25rem;
}

.blog-prose strong {
  color: #e2e8f0; /* slate-200 */
  font-weight: 700;
}

.blog-prose a {
  color: var(--blog-accent);
  text-decoration: underline;
  text-decoration-color: rgba(52, 211, 153, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

.blog-prose a:hover {
  color: #6ee7b7; /* emerald-300 */
  text-decoration-color: rgba(110, 231, 183, 0.6);
}

.blog-prose ul,
.blog-prose ol {
  margin: 0 0 1.25rem 1.5rem;
}

.blog-prose li {
  margin-bottom: 0.4rem;
}

.blog-prose blockquote {
  border-left: 3px solid var(--blog-accent);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: rgba(52, 211, 153, 0.06);
  border-radius: 0 0.5rem 0.5rem 0;
  color: #94a3b8;
  font-style: italic;
}

.blog-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* ----------------------------------------------------------
   Code Blocks
   ---------------------------------------------------------- */
.blog-prose pre,
.blog-code {
  background: var(--blog-code-bg);
  border: 1px solid var(--blog-border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  font-size: 0.85em;
  line-height: 1.65;
  margin: 1.5rem 0;
  color: #e2e8f0;
  -webkit-overflow-scrolling: touch;
}

.blog-prose code:not(pre code) {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--blog-border);
  border-radius: 0.3rem;
  padding: 0.1em 0.4em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.87em;
  color: #34d399;
  word-break: break-word;
  white-space: pre-wrap;
}

/* ----------------------------------------------------------
   Divider
   ---------------------------------------------------------- */
.blog-divider {
  border: none;
  border-top: 1px solid var(--blog-border);
  margin: 2.5rem 0;
}

/* ----------------------------------------------------------
   Info / Callout Box
   ---------------------------------------------------------- */
.blog-callout {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 0.75rem;
  margin: 1.75rem 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #94a3b8;
}

/* ----------------------------------------------------------
   Ad Slot
   ---------------------------------------------------------- */
.blog-ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 2.5rem 0;
  padding: 0;
}

.blog-ad-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #475569; /* slate-600 */
  font-weight: 500;
}

.blog-ad-inner {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed rgba(51, 65, 85, 0.5);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ----------------------------------------------------------
   Related Tools Section
   ---------------------------------------------------------- */
.related-tools-section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--blog-border);
}

.related-tools-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blog-heading-color);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.related-tools-slider {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1.5rem; /* Space for scrollbar and shadow */
  scrollbar-width: thin;
  scrollbar-color: rgba(52, 211, 153, 0.4) transparent;
}

.related-tools-slider::-webkit-scrollbar {
  height: 6px;
}

.related-tools-slider::-webkit-scrollbar-track {
  background: transparent;
}

.related-tools-slider::-webkit-scrollbar-thumb {
  background-color: rgba(52, 211, 153, 0.4);
  border-radius: 9999px;
}

.related-tools-slider > * {
  flex: 0 0 calc(33.333% - 0.84rem); /* Desktop: 3 cards */
  scroll-snap-align: start;
}

@media (max-width: 900px) {
  .related-tools-slider > * {
    flex: 0 0 calc(50% - 0.625rem); /* Tablet: 2 cards */
  }
}

@media (max-width: 640px) {
  .related-tools-slider > * {
    flex: 0 0 calc(85% - 1.25rem); /* Mobile: 1.5 cards visible */
  }
}

/* Removed old related-tool-card styles since we use Tailwind CSS cards now */

/* ----------------------------------------------------------
   Bookmark Toast (Ctrl+D Reminder)
   ---------------------------------------------------------- */
.bookmark-toast {
  position: fixed;
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8888;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.5rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 9999px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(52, 211, 153, 0.1);
  font-size: 0.875rem;
  color: #e2e8f0;
  white-space: nowrap;
  transition: bottom 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: all;
  cursor: pointer;
}

.bookmark-toast.visible {
  bottom: 1.5rem;
}

.bookmark-toast kbd {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  background: rgba(51, 65, 85, 0.8);
  border: 1px solid #475569;
  border-radius: 0.3rem;
  font-size: 0.75rem;
  font-family: ui-monospace, monospace;
  color: var(--blog-accent);
  font-weight: 700;
}

/* ----------------------------------------------------------
   Blog Index — Card Grid
   ---------------------------------------------------------- */
.blog-index-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .blog-index-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .blog-index-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-index-card {
  display: flex;
  flex-direction: column;
  background: var(--blog-card-bg);
  border: 1px solid var(--blog-border);
  border-radius: 1.25rem;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s, opacity 0.3s;
  backdrop-filter: blur(8px);
}

.blog-index-card:hover {
  border-color: rgba(52, 211, 153, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 0 40px rgba(52, 211, 153, 0.12);
}

.blog-index-card-thumb-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #1e293b 0%, #0f3460 50%, #1a1a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.blog-index-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-index-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.blog-index-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blog-heading-color);
  line-height: 1.35;
  margin-bottom: 0.5rem;
  flex: 1;
}

.blog-index-card-excerpt {
  font-size: 0.825rem;
  color: #64748b;
  line-height: 1.55;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-index-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #475569;
  margin-top: auto;
  padding-top: 0.875rem;
  border-top: 1px solid var(--blog-border);
}

.blog-index-card-cta {
  color: var(--blog-accent);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap 0.2s;
}

.blog-index-card:hover .blog-index-card-cta {
  gap: 0.45rem;
}

/* ----------------------------------------------------------
   Blog Index Hero & Categories
   ---------------------------------------------------------- */
.blog-index-hero {
  text-align: center;
  padding: 3rem 1rem 1rem;
}

.blog-index-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 0.875rem;
}

.blog-index-hero p {
  font-size: 1rem;
  color: #94a3b8;
  max-width: 520px;
  margin: 0 auto 1.5rem;
  line-height: 1.65;
}

/* Category Filters (Pills) */
.blog-category-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.blog-filter-pill {
  background: rgba(30, 41, 59, 0.7); /* slate-800 */
  border: 1px solid var(--blog-border);
  color: #cbd5e1;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.blog-filter-pill:hover {
  background: rgba(51, 65, 85, 0.8); /* slate-700 */
  color: #fff;
  border-color: rgba(148, 163, 184, 0.5); /* slate-400 */
}

.blog-filter-pill.active {
  background: var(--blog-accent);
  color: #020617; /* slate-950 */
  border-color: var(--blog-accent);
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.3);
}

/* Section Header */
.blog-section-header {
  border-bottom: 1px solid var(--blog-border);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
}

.blog-section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blog-heading-color);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ----------------------------------------------------------
   Mobile reading optimizations
   ---------------------------------------------------------- */
@media (max-width: 640px) {
  .blog-hero {
    min-height: 280px;
    padding: 1.5rem 1rem 1.25rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
  }

  .blog-prose {
    max-width: 100%;
  }

  .blog-prose h2::before {
    display: none;
  }

  .bookmark-toast {
    font-size: 0.8rem;
    padding: 0.75rem 1.1rem;
    border-radius: 0.875rem;
    max-width: calc(100vw - 2rem);
  }
}
