/* ═══════════════════════════════════════════════════════════
   WhatPhone — Guides CSS
   Extends style.css — import after it
═══════════════════════════════════════════════════════════ */

/* ── Screen-reader only ─────────────────────────────────── */
.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;
}

/* ══════════════════════════════════════════════════════════
   BREADCRUMB
══════════════════════════════════════════════════════════ */
.breadcrumb { margin-bottom: 2rem; }
.breadcrumb ol {
  display: flex; align-items: center; gap: 0.5rem;
  list-style: none; padding: 0; margin: 0;
  font-size: 0.82rem; color: var(--text3);
}
.breadcrumb li + li::before { content: '/'; opacity: 0.4; }
.breadcrumb a { color: var(--text2); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--accent2); }
.breadcrumb [aria-current] { color: var(--accent2); }

/* ══════════════════════════════════════════════════════════
   GUIDES HERO
══════════════════════════════════════════════════════════ */
.guides-hero {
  padding: 9rem 0 5rem; position: relative; overflow: hidden;
}
.guides-hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(59,130,246,0.1) 0%, transparent 70%),
              radial-gradient(ellipse 50% 40% at 90% 80%, rgba(167,139,250,0.06) 0%, transparent 60%),
              var(--bg);
}
.guides-hero .container { position: relative; z-index: 1; }
.guides-hero-content { max-width: 680px; }
.guides-hero-title {
  font-family: var(--font-display); font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  font-weight: 800; color: #fff; line-height: 1.1; letter-spacing: -0.02em;
  margin: 1rem 0 1.25rem;
}
.guides-hero-sub {
  font-size: 1.1rem; color: var(--text2); line-height: 1.7; margin-bottom: 1.75rem;
}
.guides-meta-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; font-size: 0.82rem; color: var(--text2);
}

/* ══════════════════════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════════════════════ */
.guides-filter-bar {
  padding: 0 0 2.5rem; position: sticky; top: 72px; z-index: 100;
  background: rgba(8,12,20,0.9); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.filter-inner {
  display: flex; gap: 0.5rem; padding: 1rem 0; overflow-x: auto;
  scrollbar-width: none;
}
.filter-inner::-webkit-scrollbar { display: none; }
.filter-btn {
  padding: 0.45rem 1.1rem; border-radius: 100px;
  font-size: 0.875rem; font-weight: 500; color: var(--text2);
  border: 1px solid var(--border); white-space: nowrap;
  transition: all var(--transition);
}
.filter-btn:hover { color: var(--text); border-color: var(--border2); }
.filter-btn.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 0 20px rgba(59,130,246,0.3);
}

/* ══════════════════════════════════════════════════════════
   GUIDES GRID
══════════════════════════════════════════════════════════ */
.guides-grid-section { padding: 3rem 0 6rem; }
.guides-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.75rem;
}

/* ── Guide Card ─────────────────────────────────────────── */
.guide-card {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.guide-card.in-view { opacity: 1; transform: translateY(0); }
.guide-card:nth-child(2) { transition-delay: 0.08s; }
.guide-card:nth-child(3) { transition-delay: 0.16s; }
.guide-card:nth-child(4) { transition-delay: 0.24s; }

.guide-card-inner {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  height: 100%;
}
.guide-card-inner:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), var(--shadow-accent);
}

/* Visual panel */
.guide-card-visual {
  position: relative; height: 160px;
  background: var(--bg3); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.guide-card-icon-wrap {
  width: 80px; height: 80px; border-radius: 22px;
  background: rgba(var(--card-color-rgb, 59,130,246), 0.12);
  border: 1px solid color-mix(in srgb, var(--card-color) 30%, transparent);
  display: flex; align-items: center; justify-content: center;
  color: var(--card-color); position: relative; z-index: 2;
  box-shadow: 0 0 30px color-mix(in srgb, var(--card-color) 20%, transparent);
  transition: transform var(--transition), box-shadow var(--transition);
}
.guide-card-inner:hover .guide-card-icon-wrap {
  transform: scale(1.08);
  box-shadow: 0 0 50px color-mix(in srgb, var(--card-color) 35%, transparent);
}
.guide-card-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--card-color) 10%, transparent), transparent 70%);
  opacity: 0; transition: opacity var(--transition);
}
.guide-card-inner:hover .guide-card-glow { opacity: 1; }
.guide-card-lines {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px; gap: 5px; opacity: 0.12;
}
.guide-card-lines span {
  height: 2px; border-radius: 1px; background: var(--text);
}
.guide-card-lines span:nth-child(1) { width: 40%; }
.guide-card-lines span:nth-child(2) { width: 70%; }
.guide-card-lines span:nth-child(3) { width: 55%; }

/* Body */
.guide-card-body {
  padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; flex: 1;
}
.guide-card-tags {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.guide-tag {
  padding: 0.2rem 0.65rem; border-radius: 6px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.guide-tag.camera { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.guide-tag.network { background: rgba(34,211,238,0.1); color: #22d3ee; border: 1px solid rgba(34,211,238,0.2); }
.guide-tag.hardware { background: rgba(245,158,11,0.1); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.guide-read-time { font-size: 0.78rem; color: var(--text3); font-family: var(--font-mono); }
.guide-card-title {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  color: #fff; line-height: 1.35; flex: 1;
  transition: color var(--transition);
}
.guide-card-inner:hover .guide-card-title { color: var(--accent2); }
.guide-card-excerpt { font-size: 0.875rem; color: var(--text2); line-height: 1.65; }
.guide-card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: 0.75rem; border-top: 1px solid var(--border); margin-top: auto;
}
.guide-card-meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.guide-date {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; color: var(--text3); font-family: var(--font-mono);
}
.guide-level {
  padding: 0.15rem 0.5rem; border-radius: 4px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
}
.guide-level.beginner { background: rgba(34,197,94,0.1); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.guide-level.intermediate { background: rgba(245,158,11,0.1); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.guide-level.advanced { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.guide-read-more {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; font-weight: 600; color: var(--accent2); white-space: nowrap;
  transition: gap var(--transition);
}
.guide-card-inner:hover .guide-read-more { gap: 0.65rem; }

/* ══════════════════════════════════════════════════════════
   GUIDES CTA
══════════════════════════════════════════════════════════ */
.guides-cta-section { padding: 5rem 0; border-top: 1px solid var(--border); background: var(--bg2); }
.guides-cta-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 2.5rem 3rem;
  position: relative; overflow: hidden;
}
.guides-cta-inner::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(59,130,246,0.07), transparent 60%);
  pointer-events: none;
}
.guides-cta-text h2 {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem;
}
.guides-cta-text p { color: var(--text2); font-size: 0.95rem; max-width: 480px; }

/* ══════════════════════════════════════════════════════════
   ARTICLE PAGE — SHARED
══════════════════════════════════════════════════════════ */
.article-hero {
  padding: 8rem 0 4rem; position: relative; overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.article-hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 60% 70% at 50% 0%, rgba(59,130,246,0.09) 0%, transparent 70%),
              var(--bg);
}
.article-hero .container { position: relative; z-index: 1; }
.article-hero-inner { max-width: 780px; margin: 0 auto; }
.article-tag-row {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.article-title {
  font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800; color: #fff; line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.article-subtitle {
  font-size: 1.1rem; color: var(--text2); line-height: 1.7; margin-bottom: 1.75rem;
}
.article-meta {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.25rem 1.5rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r);
}
.article-meta-item {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; color: var(--text2);
}
.article-meta-item svg { color: var(--accent2); flex-shrink: 0; }

/* Article Layout */
.article-layout {
  max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem 6rem;
  display: grid; grid-template-columns: 1fr 280px; gap: 3.5rem; align-items: start;
}
.article-body { min-width: 0; }

/* TOC Sidebar */
.article-toc {
  position: sticky; top: 100px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem; font-size: 0.85rem;
}
.toc-title {
  font-family: var(--font-display); font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text3); margin-bottom: 1rem;
}
.toc-list { display: flex; flex-direction: column; gap: 0.35rem; }
.toc-link {
  display: block; padding: 0.35rem 0.6rem; border-radius: 6px;
  color: var(--text2); font-size: 0.82rem; transition: all var(--transition);
  border-left: 2px solid transparent;
}
.toc-link:hover, .toc-link.active {
  color: var(--accent2); background: rgba(59,130,246,0.07);
  border-left-color: var(--accent);
}
.toc-link.sub { padding-left: 1.2rem; font-size: 0.78rem; }

/* Article Prose */
.prose { color: var(--text2); line-height: 1.8; }
.prose h2 {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 800;
  color: #fff; margin: 3rem 0 1rem; letter-spacing: -0.01em;
  padding-top: 1rem;
}
.prose h3 {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
  color: var(--text); margin: 2rem 0 0.75rem;
}
.prose p { margin-bottom: 1.25rem; }
.prose a { color: var(--accent2); text-decoration: underline; text-decoration-color: rgba(96,165,250,0.3); transition: color var(--transition), text-decoration-color var(--transition); }
.prose a:hover { color: #fff; text-decoration-color: rgba(96,165,250,0.8); }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--accent3); }
.prose ul, .prose ol {
  margin: 0 0 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.prose ul { list-style: none; margin-left: 0; }
.prose ul li {
  padding-left: 1.4rem; position: relative;
}
.prose ul li::before {
  content: ''; position: absolute; left: 0; top: 0.55em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.prose ol { list-style: decimal; }
.prose ol li { padding-left: 0.25rem; }
.prose code {
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--surface2); border: 1px solid var(--border);
  padding: 0.15em 0.45em; border-radius: 5px; color: var(--neon);
}

/* Tip/Note/Warning boxes */
.prose-tip, .prose-note, .prose-warning {
  padding: 1.1rem 1.4rem; border-radius: var(--r); margin: 1.75rem 0;
  display: flex; gap: 0.9rem; align-items: flex-start;
}
.prose-tip {
  background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.2); color: var(--text2);
}
.prose-note {
  background: rgba(59,130,246,0.06); border: 1px solid rgba(59,130,246,0.2); color: var(--text2);
}
.prose-warning {
  background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.2); color: var(--text2);
}
.prose-tip-icon, .prose-note-icon, .prose-warning-icon {
  font-size: 1.1rem; flex-shrink: 0; margin-top: 0.05rem;
}
.prose-tip strong { color: #4ade80; }
.prose-note strong { color: var(--accent2); }
.prose-warning strong { color: #fbbf24; }

/* Step block */
.step-block {
  display: flex; gap: 1.25rem; margin: 0 0 1.5rem; padding: 1.25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  transition: border-color var(--transition);
}
.step-block:hover { border-color: var(--border2); }
.step-block-num {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.3); color: var(--accent2);
  font-family: var(--font-display); font-weight: 800; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-block-content h4 { font-family: var(--font-display); font-weight: 700; color: #fff; margin-bottom: 0.35rem; }
.step-block-content p { font-size: 0.9rem; color: var(--text2); margin: 0; }

/* Comparison table */
.compare-table {
  width: 100%; border-collapse: collapse; margin: 1.75rem 0; font-size: 0.875rem;
}
.compare-table th {
  text-align: left; padding: 0.75rem 1rem;
  background: var(--surface2); color: var(--text3);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; font-family: var(--font-mono);
  border-bottom: 1px solid var(--border);
}
.compare-table td {
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
  color: var(--text2); vertical-align: top;
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: var(--surface); }
.compare-table td:first-child { color: var(--text); font-weight: 600; }
.compare-table td .check { color: var(--green); }
.compare-table td .cross { color: var(--red); }
.compare-table td .partial { color: var(--amber); }
.compare-table-wrap {
  border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin: 1.75rem 0;
  overflow-x: auto;
}

/* FAQ in article */
.article-faq { margin: 3rem 0; }
.article-faq-title {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: #fff;
  margin-bottom: 1.25rem;
}
.article-faq .faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 0.6rem; overflow: hidden; }
.article-faq .faq-item.open { border-color: var(--accent); }
.article-faq .faq-q { width: 100%; padding: 1.1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; text-align: left; font-weight: 600; color: #fff; font-size: 0.925rem; transition: color var(--transition); }
.article-faq .faq-q:hover { color: var(--accent2); }
.article-faq .faq-icon { width: 22px; height: 22px; border-radius: 5px; background: var(--surface2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--transition); }
.article-faq .faq-item.open .faq-icon { background: var(--accent); transform: rotate(45deg); }
.article-faq .faq-a { max-height: 0; overflow: hidden; transition: max-height 0.35s ease, padding 0.35s ease; font-size: 0.875rem; color: var(--text2); line-height: 1.7; }
.article-faq .faq-item.open .faq-a { max-height: 400px; padding: 0 1.25rem 1.1rem; }

/* Related articles */
.related-articles { margin: 4rem 0 0; padding-top: 3rem; border-top: 1px solid var(--border); }
.related-title {
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; color: #fff; margin-bottom: 1.25rem;
}
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.related-card {
  padding: 1.1rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); transition: all var(--transition);
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related-tag { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent2); margin-bottom: 0.4rem; }
.related-card-title { font-size: 0.875rem; font-weight: 600; color: #fff; line-height: 1.4; margin-bottom: 0.4rem; transition: color var(--transition); }
.related-card:hover .related-card-title { color: var(--accent2); }
.related-read { font-size: 0.75rem; color: var(--text3); font-family: var(--font-mono); }

/* Detect CTA in article sidebar */
.sidebar-detect-cta {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 1.5rem; margin-top: 1.5rem; text-align: center;
}
.sidebar-detect-cta p { font-size: 0.85rem; color: var(--text2); margin-bottom: 1rem; line-height: 1.6; }
.sidebar-detect-cta .btn-primary { width: 100%; justify-content: center; font-size: 0.875rem; padding: 0.7rem 1rem; }

/* Share bar */
.article-share {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1.25rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin: 2rem 0; flex-wrap: wrap;
}
.share-label { font-size: 0.82rem; color: var(--text3); font-weight: 600; }
.share-btn {
  padding: 0.4rem 0.9rem; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text2); transition: all var(--transition);
}
.share-btn:hover { color: var(--text); border-color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; gap: 2rem; }
  .article-toc { position: static; }
  .toc-list { display: grid; grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .guides-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .guides-cta-inner { flex-direction: column; padding: 2rem; text-align: center; }
  .guides-hero { padding: 7rem 0 3.5rem; }
  .article-hero { padding: 7rem 0 3rem; }
  .article-title { font-size: 1.8rem; }
  .toc-list { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .article-meta { flex-direction: column; gap: 0.75rem; }
  .guides-filter-bar { top: 64px; }
}
