/* ===================================================
   AI Tool Radar – Blog Page Styles
   Shared CSS for all standalone blog article pages
   =================================================== */

:root {
  --bg: #f8f7fc;
  --bg-card: #ffffff;
  --bg-card-hover: #f0eef8;
  --surface: #eeedf5;
  --border: #d8d6e3;
  --border-glow: #6c63ff;
  --text: #1a1a2e;
  --text-dim: #5a5870;
  --text-muted: #8a89a0;
  --accent: #6c63ff;
  --accent-bright: #8b83ff;
  --accent2: #00e5a0;
  --accent3: #ff6b6b;
  --accent4: #ffd93d;
  --accent5: #4ecdc4;
  --gradient1: linear-gradient(135deg, #6c63ff 0%, #00e5a0 100%);
  --gradient2: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 30px rgba(108,99,255,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* === BLOG HEADER === */
.blog-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248,247,252,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 2rem;
  display: flex;
  align-items: center;
}

.blog-header a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  transition: color 0.2s;
}

.blog-header a:hover {
  color: var(--accent);
}

.blog-header .logo-icon {
  width: 28px;
  height: 28px;
}

/* === ARTICLE LAYOUT === */
.blog-article {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

/* === BANNER === */
.article-banner {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  margin: 0 -1.5rem 1.5rem -1.5rem;
  border-radius: var(--radius);
  position: relative;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.article-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.5;
  border-radius: var(--radius);
}

.article-banner::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  border-radius: 0 0 var(--radius) var(--radius);
}

/* === TITLE & META === */
.blog-article h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 2rem;
  line-height: 1.25;
  margin-bottom: 0.8rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-tag {
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  background: rgba(108,99,255,0.12);
  color: var(--accent-bright);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* === ARTICLE BODY === */
.article-body h3 {
  font-size: 1.15rem;
  margin: 2.5rem 0 0.8rem;
  color: var(--text);
}

.article-body p {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.75;
  margin-bottom: 0.8rem;
}

.article-body strong {
  color: var(--text);
}

.article-body ul,
.article-body ol {
  margin: 0.8rem 0 1.2rem 1.2rem;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.75;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body li strong {
  color: var(--text);
}

/* === CTAs === */
.article-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.article-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  border-radius: 99px;
  background: var(--gradient1);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  transition: transform 0.2s;
}

.article-cta:hover { transform: scale(1.04); }

/* === GLOSSAR TOOLTIPS === */
dfn[data-tooltip] {
  font-style: normal;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
  cursor: help;
  position: relative;
}

dfn[data-tooltip]:hover::after,
dfn[data-tooltip]:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  white-space: normal;
  width: max-content;
  max-width: 260px;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  animation: fadeUp 0.2s ease;
}

dfn[data-tooltip]:hover::before,
dfn[data-tooltip]:focus::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--text);
  z-index: 50;
  pointer-events: none;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === SOCIAL SHARE === */
.share-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.share-bar span {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-right: 0.3rem;
}

.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  text-decoration: none;
}

.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.08);
}

.share-btn.copied {
  border-color: var(--accent2);
  color: var(--accent2);
}

/* === RELATED / MENTIONED TOOLS === */
.detail-related {
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.detail-related h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.detail-related-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0;
  color: var(--accent-bright);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.detail-related-link:hover { color: var(--accent); }

/* === AFFILIATE NOTE === */
.affiliate-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 1.2rem 2rem 2rem;
  max-width: 700px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

/* === FOOTER === */
.blog-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.blog-footer a {
  color: var(--accent-bright);
  text-decoration: none;
}

.blog-footer a:hover {
  text-decoration: underline;
}

/* === BREADCRUMB === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--accent-bright);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .blog-header { padding: 0.8rem 1.2rem; }
  .blog-article { padding: 1.5rem 1.2rem 3rem; }
  .blog-article h1 { font-size: 1.5rem; }
  .article-banner { margin: 0 -1.2rem 1.5rem -1.2rem; }

  dfn[data-tooltip]:hover::after,
  dfn[data-tooltip]:focus::after {
    left: 0;
    transform: none;
    max-width: 220px;
  }
  dfn[data-tooltip]:hover::before,
  dfn[data-tooltip]:focus::before {
    left: 1rem;
    transform: none;
  }
}

@media (max-width: 480px) {
  .blog-article h1 { font-size: 1.3rem; }
  .article-ctas { flex-direction: column; }
  .article-cta { text-align: center; justify-content: center; }
}

/* === FOCUS INDICATORS (Accessibility) === */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === REDUCED MOTION (Accessibility) === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
