/* ============================================================
   Smartphone Buyer Guide — Custom Stylesheet
   Design: HP-inspired consumer electronics style
   Framework: Bootstrap 5 CDN
   Font: Inter (Google Fonts)
   ============================================================ */

/* === Root Variables === */
:root {
  --primary:       #1d4ed8;
  --primary-dark:  #1e40af;
  --primary-soft:  #dbeafe;
  --canvas:        #ffffff;
  --cloud:         #f8fafc;
  --fog:           #f1f5f9;
  --ink:           #0f172a;
  --ink-soft:      #1e293b;
  --body-text:     #374151;
  --muted:         #6b7280;
  --hairline:      #e2e8f0;
  --card-radius:   12px;
  --btn-radius:    6px;
  --shadow-soft:   0 2px 12px rgba(15, 23, 42, 0.08);
  --shadow-card:   0 4px 20px rgba(15, 23, 42, 0.10);
  --transition:    0.2s ease;
}

/* === Base === */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--body-text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; }
h2 { font-size: clamp(1.375rem, 3vw, 1.875rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.375rem); }
h4 { font-size: 1.125rem; }

p { margin-bottom: 1rem; color: var(--body-text); }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* === Navigation === */
.site-nav {
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(15,23,42,0.06);
}

.site-nav .navbar-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav .nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.5rem 0.875rem;
  border-radius: var(--btn-radius);
  transition: background var(--transition), color var(--transition);
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.site-nav .nav-link.active {
  font-weight: 600;
}

/* === Hero Section === */
.hero-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1d4ed8 100%);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(29, 78, 216, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  color: #93c5fd;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(147, 197, 253, 0.3);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: #cbd5e1;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero-image-wrapper {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.hero-image-wrapper img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
}

/* === Category Cards === */
.category-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--card-radius);
  padding: 1.75rem;
  height: 100%;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: var(--primary);
  text-decoration: none;
  color: inherit;
}

.category-card .card-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-soft);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.375rem;
  flex-shrink: 0;
}

.category-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.category-card .card-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.category-card .card-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* === Article Cards (Featured) === */
.article-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--card-radius);
  overflow: hidden;
  height: 100%;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.article-card .card-img-top {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.article-card .card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card .card-category {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.article-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.625rem;
  line-height: 1.4;
}

.article-card .card-text {
  font-size: 0.875rem;
  color: var(--muted);
  flex: 1;
}

.article-card .card-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 1rem;
}

/* === Sections === */
.section-cloud {
  background: var(--cloud);
}

.section-fog {
  background: var(--fog);
}

.section-dark {
  background: var(--ink);
  color: #f1f5f9;
}

.section-dark h2,
.section-dark h3 {
  color: #ffffff;
}

.section-dark p {
  color: #cbd5e1;
}

.section-padding {
  padding: 72px 0;
}

.section-padding-sm {
  padding: 48px 0;
}

/* === Section Headers === */
.section-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: block;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.section-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 600px;
}

/* === Buttons === */
.btn-primary-custom {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--btn-radius);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 24px;
  letter-spacing: 0.2px;
  transition: background var(--transition), transform var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary-custom:hover {
  background: var(--primary-dark);
  color: #ffffff;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-outline-custom {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--btn-radius);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 24px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
}

.btn-outline-custom:hover {
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
}

/* === Breadcrumb === */
.site-breadcrumb {
  background: var(--fog);
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}

.site-breadcrumb .breadcrumb {
  margin: 0;
  font-size: 0.8rem;
}

.site-breadcrumb .breadcrumb-item a {
  color: var(--primary);
}

.site-breadcrumb .breadcrumb-item.active {
  color: var(--muted);
}

/* === Table of Contents === */
.toc-box {
  background: var(--cloud);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--primary);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.toc-box h4 {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.875rem;
}

.toc-box ol {
  margin: 0;
  padding-left: 1.25rem;
}

.toc-box li {
  margin-bottom: 0.375rem;
}

.toc-box a {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
}

/* === Article Content === */
.article-content {
  max-width: 760px;
}

.article-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--hairline);
}

.article-content h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.article-content ul,
.article-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-content li {
  margin-bottom: 0.375rem;
}

.article-content .callout {
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--btn-radius) var(--btn-radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.article-content .callout strong {
  color: var(--primary-dark);
}

/* === FAQ / Details === */
details.faq-item {
  border: 1px solid var(--hairline);
  border-radius: var(--card-radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: box-shadow var(--transition);
}

details.faq-item[open] {
  box-shadow: var(--shadow-soft);
}

details.faq-item summary {
  cursor: pointer;
  padding: 1.125rem 1.375rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--canvas);
  user-select: none;
}

details.faq-item summary::-webkit-details-marker { display: none; }

details.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform var(--transition);
}

details.faq-item[open] summary::after {
  content: '−';
}

details.faq-item .faq-answer {
  padding: 0 1.375rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--body-text);
  line-height: 1.65;
  border-top: 1px solid var(--hairline);
  padding-top: 1rem;
}

/* === Related Articles === */
.related-articles {
  background: var(--fog);
  border-radius: var(--card-radius);
  padding: 1.75rem;
  margin-top: 3rem;
}

.related-articles h4 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.related-articles ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.related-articles ul li a {
  display: block;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  transition: border-color var(--transition), color var(--transition);
}

.related-articles ul li a:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

/* === Spec / Info Cards === */
.spec-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.spec-card .spec-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.375rem;
}

.spec-card .spec-label {
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
}

/* === Stats / Feature Band === */
.feature-band {
  background: var(--ink);
  padding: 56px 0;
}

.feature-band h2 {
  color: #ffffff;
}

.feature-band p {
  color: #94a3b8;
}

/* === Comparison Table === */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.comparison-table th {
  background: var(--ink);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 1rem 1.25rem;
  text-align: left;
}

.comparison-table td {
  padding: 0.875rem 1.25rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--hairline);
  color: var(--body-text);
}

.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:nth-child(even) td { background: var(--cloud); }

/* === Step Cards === */
.step-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--card-radius);
  margin-bottom: 1rem;
  align-items: flex-start;
  box-shadow: var(--shadow-soft);
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.375rem;
}

.step-content p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

/* === Footer === */
.site-footer {
  background: var(--ink);
  color: #94a3b8;
  padding: 56px 0 32px;
}

.site-footer .footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.site-footer .footer-tagline {
  font-size: 0.875rem;
  color: #64748b;
  max-width: 260px;
  line-height: 1.6;
}

.site-footer h6 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 1rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer ul li {
  margin-bottom: 0.5rem;
}

.site-footer ul li a {
  font-size: 0.875rem;
  color: #94a3b8;
  transition: color var(--transition);
}

.site-footer ul li a:hover {
  color: #ffffff;
  text-decoration: none;
}

.site-footer .footer-divider {
  border-color: #1e293b;
  margin: 2rem 0 1.5rem;
}

.site-footer .footer-bottom {
  font-size: 0.8rem;
  color: #475569;
}

/* === Price Badge === */
.price-badge {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid rgba(29, 78, 216, 0.2);
}

/* === Alert Callout === */
.alert-info-custom {
  background: var(--primary-soft);
  border: 1px solid rgba(29, 78, 216, 0.25);
  border-left: 4px solid var(--primary);
  border-radius: var(--btn-radius);
  padding: 1rem 1.25rem;
  color: #1e40af;
  font-size: 0.9rem;
}

/* === Image Card === */
.img-card {
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.img-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

/* === Mobile Adjustments === */
@media (max-width: 768px) {
  .section-padding { padding: 48px 0; }
  .hero-section { padding: 56px 0; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero-image-wrapper { margin-top: 2rem; }
  .hero-image-wrapper img { height: 260px; }
  .category-card { padding: 1.25rem; }
  .related-articles ul { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
  .hero-title { font-size: 1.75rem; }
  .section-title { font-size: 1.5rem; }
  .step-card { flex-direction: column; gap: 0.875rem; }
}

/* === Utility === */
.text-primary-custom { color: var(--primary) !important; }
.bg-primary-custom { background: var(--primary) !important; }
.border-primary-custom { border-color: var(--primary) !important; }
.font-weight-600 { font-weight: 600; }

.sticky-sidebar {
  position: sticky;
  top: 80px;
}

/* === Back-to-top === */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.4);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 999;
}

#back-to-top.visible {
  display: flex;
}

#back-to-top:hover {
  transform: translateY(-2px);
}
