/* ============================================================
   BoostMyInsta - Main Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand-1: #833ab4;
  --brand-2: #fd1d1d;
  --brand-3: #fcb045;
  --brand-gradient: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  --brand-soft: #faf7fd;

  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --text: #1a1a1a;
  --text-soft: #555;
  --text-mute: #888;
  --border: #e8e8ec;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.10);

  --container: 1180px;
  --radius: 14px;
  --radius-sm: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --t: 0.25s ease;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-1); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--brand-2); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand-1); color: #fff; padding: 12px 20px;
  z-index: 9999; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 10px; position: relative;
}

.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 18px; color: var(--text);
  letter-spacing: -0.3px; flex-shrink: 0;
}
.logo img { width: 32px; height: 32px; border-radius: 8px; }
.logo-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; white-space: nowrap;
}

.search-box {
  display: none;
  align-items: center; gap: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 4px 4px 4px 14px;
  transition: border-color var(--t), box-shadow var(--t);
}
.search-box:focus-within {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(131,58,180,0.12);
}
.search-box input {
  border: none; background: transparent; outline: none;
  font-size: 14px; color: var(--text); padding: 6px 0;
  font-family: inherit; width: 130px;
}
.search-box input::placeholder { color: var(--text-mute); }
.search-box button {
  background: var(--brand-gradient); color: #fff; border: none;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform var(--t);
}
.search-box button:hover { transform: scale(1.08); }

.main-nav {
  position: absolute;
  top: 60px; left: -16px; right: -16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease;
  z-index: 99;
}
.main-nav.is-open { max-height: 500px; }
.main-nav ul {
  list-style: none; display: flex; flex-direction: column;
  gap: 0; padding: 8px 16px 16px;
}
.main-nav li { border-bottom: 1px solid var(--border); }
.main-nav li:last-of-type { border-bottom: none; }
.main-nav a {
  display: block; color: var(--text-soft); font-weight: 500;
  font-size: 15px; padding: 14px 4px; transition: color var(--t);
}
.main-nav a:hover, .main-nav a.active { color: var(--brand-1); }

.nav-toggle {
  display: flex; background: none; border: none; cursor: pointer;
  padding: 8px; flex-direction: column; gap: 5px;
  margin-left: auto; flex-shrink: 0;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text); transition: var(--t); border-radius: 2px;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   ADS
   ============================================================ */
.ad-container { padding: 16px 0; text-align: center; }
.ad-header { background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.ad-footer { background: var(--bg-alt); border-top: 1px solid var(--border); }
.ad-infeed { padding: 20px 0; }
.ad-infeed-card {
  grid-column: 1 / -1;
  padding: 20px;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.ad-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 90px;
  background: repeating-linear-gradient(45deg, #f7f8fa, #f7f8fa 10px, #f0f1f4 10px, #f0f1f4 20px);
  border: 1px dashed #ccc;
  border-radius: var(--radius-sm);
  color: var(--text-mute);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}
.sidebar-sticky .ad-placeholder { min-height: 600px; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 48px 0 40px;
  background: radial-gradient(ellipse at top, #faf7fd 0%, #ffffff 60%);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(131,58,180,0.1), rgba(253,29,29,0.08));
  color: var(--brand-1);
  font-size: 12px;
  font-weight: 600;
  border-radius: 50px;
  border: 1px solid rgba(131,58,180,0.15);
  letter-spacing: 0.3px;
}
.hero-title {
  font-size: clamp(1.75rem, 7vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  max-width: 900px;
}
.hero-sub {
  max-width: 640px;
  color: var(--text-soft);
  font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  line-height: 1.6;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-top: 6px; width: 100%;
}
.btn-hero {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  background: var(--brand-gradient); color: #fff !important;
  font-weight: 600; font-size: 14px;
  border-radius: 50px;
  box-shadow: 0 6px 18px rgba(131,58,180,0.25);
  transition: transform var(--t), box-shadow var(--t);
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(131,58,180,0.35); }
.btn-hero-ghost {
  display: inline-block;
  padding: 13px 26px;
  background: #fff;
  color: var(--text-soft) !important;
  font-weight: 600; font-size: 14px;
  border-radius: 50px;
  border: 1px solid var(--border);
  transition: border-color var(--t), color var(--t);
}
.btn-hero-ghost:hover { border-color: var(--brand-1); color: var(--brand-1) !important; }
.hero-stats {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 24px; margin-top: 16px; padding-top: 20px;
  border-top: 1px solid var(--border);
  width: 100%; max-width: 500px;
}
.hero-stats .stat { text-align: center; flex: 1; min-width: 80px; }
.hero-stats .stat strong {
  display: block; font-size: clamp(1.3rem, 5vw, 1.6rem); font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.hero-stats .stat span { font-size: 12px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.5px; }
.hero-category { padding: 40px 0 36px; }
.hero-search { padding: 40px 0 30px; }

/* ============================================================
   FEATURED ARTICLE
   ============================================================ */
.featured-section { padding: 30px 0 10px; }
.featured-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t);
}
.featured-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.featured-link { display: flex; flex-direction: column; color: inherit; }
.featured-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
}
.featured-image img { width: 100%; height: 100%; object-fit: cover; }
.featured-tag {
  position: absolute; top: 12px; left: 12px;
  padding: 5px 12px;
  background: var(--brand-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 50px;
  box-shadow: var(--shadow-md);
}
.featured-body { padding: 20px 22px 24px; }
.featured-title {
  font-size: clamp(1.15rem, 5vw, 1.5rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.4px;
  margin: 8px 0 10px;
  color: var(--text);
}
.featured-excerpt {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.btn-read {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 14px;
  color: var(--brand-1);
}

/* ============================================================
   CATEGORIES
   ============================================================ */
.categories-section { padding: 30px 0 20px; }
.category-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-soft) !important;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--t);
}
.cat-tag:hover {
  border-color: var(--brand-1);
  color: var(--brand-1) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.cat-count {
  background: var(--bg-alt);
  padding: 1px 7px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mute);
}
.cat-tag:hover .cat-count { background: var(--brand-1); color: #fff; }

/* ============================================================
   SECTION
   ============================================================ */
.articles-section { padding: 30px 0 50px; }
.section-head { margin-bottom: 22px; }
.section-title {
  font-size: clamp(1.3rem, 5vw, 1.6rem);
  font-weight: 700;
  position: relative;
  padding-left: 14px;
  letter-spacing: -0.4px;
  line-height: 1.3;
}
.section-title::before {
  content: "";
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 22px;
  background: var(--brand-gradient);
  border-radius: 3px;
}
.section-sub {
  margin-top: 6px; padding-left: 14px;
  color: var(--text-mute); font-size: 0.9rem; line-height: 1.5;
}

/* ============================================================
   ARTICLE GRID
   ============================================================ */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.article-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  display: flex; flex-direction: column;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.card-link { display: flex; flex-direction: column; color: inherit; height: 100%; }
.card-image {
  aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--bg-alt); flex-shrink: 0;
}
.card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.article-card:hover .card-image img { transform: scale(1.05); }
.card-body {
  padding: 16px 18px 20px;
  display: flex; flex-direction: column; flex: 1;
}
.card-date {
  display: block; font-size: 11px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 8px; font-weight: 600;
}
.card-title {
  font-size: 1.05rem; font-weight: 700; line-height: 1.35;
  margin-bottom: 10px; color: var(--text); letter-spacing: -0.2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-excerpt {
  font-size: 0.9rem; color: var(--text-soft); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 14px; flex: 1;
}
.card-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--brand-1); margin-top: auto;
}
.article-grid-small { grid-template-columns: 1fr; gap: 16px; }
.article-grid-small .card-body { padding: 12px 14px 16px; }
.article-grid-small .card-title { font-size: 0.92rem; }

/* ============================================================
   TRUST SECTION
   ============================================================ */
.trust-section { padding: 40px 0 60px; background: var(--bg-alt); }
.trust-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.trust-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform var(--t), box-shadow var(--t);
}
.trust-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.trust-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(131,58,180,0.1), rgba(253,29,29,0.08));
  color: var(--brand-1);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.trust-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.trust-card p { font-size: 0.9rem; color: var(--text-soft); line-height: 1.6; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  padding: 14px 0; font-size: 12px; color: var(--text-mute);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.breadcrumb ol {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: 6px; align-items: center;
}
.breadcrumb li:not(:last-child)::after {
  content: "›"; margin-left: 6px; color: var(--text-mute);
}
.breadcrumb a { color: var(--text-soft); }
.breadcrumb a:hover { color: var(--brand-1); }

/* ============================================================
   SINGLE LAYOUT
   ============================================================ */
.layout-single {
  display: grid; grid-template-columns: 1fr; gap: 30px;
  padding: 24px 16px 60px; align-items: start;
}
.single-article { min-width: 0; max-width: 100%; }
.article-header { margin-bottom: 24px; }
.article-title {
  font-size: clamp(1.5rem, 6vw, 2.4rem);
  font-weight: 800; line-height: 1.22;
  letter-spacing: -0.6px; margin-bottom: 14px; color: var(--text);
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 13px; color: var(--text-mute); margin-bottom: 20px;
}
.meta-author { font-weight: 600; color: var(--text-soft); }
.meta-sep { color: var(--text-mute); }
.meta-read { color: var(--text-mute); }
.article-featured {
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 10px; box-shadow: var(--shadow-md);
}
.article-featured img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
.article-content { font-size: 1rem; line-height: 1.8; color: #2a2a2a; }
.article-content p { margin-bottom: 1.25em; }
.article-content h2 {
  font-size: clamp(1.2rem, 5vw, 1.5rem);
  font-weight: 700; margin: 1.8em 0 0.6em;
  letter-spacing: -0.3px; color: var(--text);
  position: relative; padding-left: 14px; line-height: 1.3;
  scroll-margin-top: 80px;
}
.article-content h2::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 4px; background: var(--brand-gradient); border-radius: 2px;
}
.article-content h3 { font-size: 1.15rem; font-weight: 700; margin: 1.5em 0 0.5em; }
.article-content ul, .article-content ol { margin: 0 0 1.25em 1.3em; }
.article-content li { margin-bottom: 0.4em; }
.article-content strong { font-weight: 700; color: var(--text); }
.article-content a {
  color: var(--brand-1); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.article-content img { border-radius: var(--radius-sm); margin: 1.5em 0; }
.article-content blockquote {
  border-left: 4px solid var(--brand-1); background: var(--bg-alt);
  padding: 14px 18px; margin: 1.5em 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic; color: var(--text-soft);
}
.article-content code {
  background: var(--bg-alt); padding: 2px 6px; border-radius: 4px;
  font-family: monospace; font-size: 0.9em; color: var(--brand-2);
}
.internal-link { color: var(--brand-1); font-weight: 600; }

.author-box {
  display: flex; flex-direction: column; gap: 14px; align-items: center;
  text-align: center; background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin: 32px 0 24px;
}
.author-box img {
  width: 60px; height: 60px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.author-box h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.author-box p { font-size: 0.88rem; color: var(--text-soft); line-height: 1.5; margin: 0; }

.related-section {
  margin-top: 32px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.related-section h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 18px; }

.sidebar { display: none; }
.sidebar-sticky { position: sticky; top: 80px; }
.sidebar-sticky ins, .sidebar-sticky .ad-placeholder { display: block; min-height: 600px; }
.back-to-home { margin-top: 40px; text-align: center; }

/* ============================================================
   READING PROGRESS
   ============================================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--brand-gradient);
  z-index: 999;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(131,58,180,0.4);
}

/* ============================================================
   TABLE OF CONTENTS
   ============================================================ */
.toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-1);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 0 0 28px;
}
.toc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.toc-header svg { color: var(--brand-1); flex-shrink: 0; }
.toc ol {
  list-style: none;
  counter-reset: toc;
  margin: 0;
  padding: 0;
}
.toc li {
  counter-increment: toc;
  margin-bottom: 8px;
  padding-left: 26px;
  position: relative;
  font-size: 0.92rem;
  line-height: 1.5;
}
.toc li::before {
  content: counter(toc) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand-1);
  font-weight: 700;
  font-size: 0.85rem;
}
.toc a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color var(--t);
}
.toc a:hover { color: var(--brand-1); text-decoration: underline; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-section {
  margin: 40px 0 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.faq-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-left: 14px;
  position: relative;
  letter-spacing: -0.3px;
}
.faq-section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  background: var(--brand-gradient);
  border-radius: 3px;
}
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t);
}
.faq-item[open] {
  border-color: var(--brand-1);
  box-shadow: 0 2px 10px rgba(131,58,180,0.08);
}
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background var(--t);
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question:hover { background: var(--bg-alt); }
.faq-icon {
  flex-shrink: 0;
  color: var(--brand-1);
  transition: transform var(--t);
}
.faq-item[open] .faq-icon { transform: rotate(180deg); }
.faq-answer {
  padding: 14px 18px 18px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-soft);
  border-top: 1px solid var(--border);
}
.faq-answer p:last-child { margin-bottom: 0; }

/* ============================================================
   404
   ============================================================ */
.error-404 { padding: 60px 0; text-align: center; }
.error-404 h1 {
  font-size: clamp(4rem, 20vw, 9rem);
  font-weight: 900;
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1; margin-bottom: 16px;
}
.error-404 h2 { font-size: clamp(1.2rem, 5vw, 1.6rem); margin-bottom: 12px; font-weight: 700; }
.error-404 p {
  color: var(--text-soft); margin-bottom: 26px;
  max-width: 500px; margin-left: auto; margin-right: auto; padding: 0 16px;
}
.btn-primary {
  display: inline-block; padding: 12px 28px;
  background: var(--brand-gradient); color: #fff;
  font-weight: 600; border-radius: 50px;
  box-shadow: var(--shadow-md);
  transition: transform var(--t), box-shadow var(--t);
  border: none; cursor: pointer;
  font-size: 15px; font-family: inherit; text-align: center;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: #fff; }

/* ============================================================
   NEWSLETTER
   ============================================================ */
.newsletter-box {
  background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  padding: 40px 0;
  margin-top: 40px;
}
.newsletter-inner {
  display: flex; flex-direction: column; gap: 20px;
  align-items: center; text-align: center;
}
.newsletter-text h3 {
  color: #fff; font-size: clamp(1.2rem, 5vw, 1.5rem);
  font-weight: 800; margin-bottom: 6px; letter-spacing: -0.4px;
}
.newsletter-text p { color: rgba(255,255,255,0.9); font-size: 0.9rem; }
.newsletter-form {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%; max-width: 480px;
  background: rgba(255,255,255,0.15);
  padding: 6px; border-radius: 50px;
  backdrop-filter: blur(10px);
}
.newsletter-form input {
  border: none; outline: none;
  background: #fff; color: var(--text);
  padding: 12px 20px; border-radius: 50px;
  font-size: 14px; font-family: inherit; width: 100%;
}
.newsletter-form button {
  background: #fff; color: var(--brand-1);
  border: none; cursor: pointer;
  padding: 12px 24px; border-radius: 50px;
  font-weight: 700; font-size: 14px; font-family: inherit;
  transition: transform var(--t), background var(--t);
  white-space: nowrap;
}
.newsletter-form button:hover { transform: translateY(-1px); background: #f7f8fa; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: #14161a; color: #cfd2d8; }
.footer-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 28px; padding: 40px 16px 30px;
}
.footer-col h3 {
  color: #fff; font-size: 1rem; font-weight: 700;
  margin-bottom: 14px; letter-spacing: -0.2px;
}
.footer-col p { font-size: 0.88rem; line-height: 1.65; color: #9aa0a8; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: #cfd2d8; font-size: 0.88rem; transition: color var(--t); }
.footer-col a:hover { color: #fff; }
.footer-brand { max-width: 420px; }
.footer-logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: #fff !important; font-weight: 800; font-size: 18px;
  margin-bottom: 14px; letter-spacing: -0.3px;
}
.footer-logo img { width: 36px; height: 36px; border-radius: 8px; }
.footer-logo span {
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  color: #cfd2d8 !important;
  transition: background var(--t), transform var(--t);
}
.footer-social a:hover {
  background: var(--brand-1); color: #fff !important;
  transform: translateY(-2px);
}
.footer-bottom {
  border-top: 1px solid #23262b;
  padding: 18px 0; text-align: center;
  font-size: 0.82rem; color: #888e96;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-mute); background: var(--bg-alt);
  border-radius: var(--radius);
}
.empty-state code {
  background: #fff; padding: 2px 8px; border-radius: 4px;
  font-size: 0.9em; color: var(--brand-1);
}

/* ============================================================
   SEARCH FORM
   ============================================================ */
.search-form {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; max-width: 560px; margin: 20px auto 0;
  background: #fff; border: 2px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  transition: border-color var(--t), box-shadow var(--t);
}
.search-form:focus-within {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 4px rgba(131,58,180,0.1);
}
.search-form input {
  flex: 1; border: none; outline: none;
  font-size: 16px; background: transparent; color: var(--text);
  padding: 10px 14px; font-family: inherit; width: 100%;
}
.search-form button {
  background: var(--brand-gradient); color: #fff;
  border: none; padding: 12px 20px;
  border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center;
  justify-content: center; gap: 8px;
  font-weight: 600; font-size: 15px;
  transition: transform var(--t); font-family: inherit; width: 100%;
}
.search-form button:hover { transform: translateY(-1px); }

/* ============================================================
   CONTACT FORM
   ============================================================ */
.contact-form { max-width: 100%; margin: 20px 0 30px; }
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block; font-weight: 600; font-size: 14px;
  margin-bottom: 8px; color: var(--text);
}
.req { color: var(--brand-2); }
.form-row input, .form-row textarea {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 15px; color: var(--text); background: #fff;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-row input:focus, .form-row textarea:focus {
  outline: none; border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(131,58,180,0.1);
}
.form-row textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.form-message {
  padding: 14px 18px; border-radius: var(--radius-sm);
  margin-bottom: 18px; font-size: 14px; font-weight: 500;
}
.form-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; }
.form-error { background: #ffebee; color: #c62828; border-left: 4px solid #f44336; }
.hp-field {
  position: absolute; left: -9999px; top: -9999px;
  width: 1px; height: 1px; overflow: hidden;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed; right: 16px; bottom: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand-gradient); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity var(--t), transform var(--t), visibility var(--t);
  z-index: 90;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px) scale(1.05); }

@media (max-width: 899px) {
  body.nav-open { overflow: hidden; }
}

/* ============================================================
   RESPONSIVE — TABLET (>= 640px)
   ============================================================ */
@media (min-width: 640px) {
  .container { padding: 0 20px; }
  .hero { padding: 60px 0 50px; }
  .hero-actions { width: auto; }
  .hero-category { padding: 50px 0 40px; }
  .hero-search { padding: 50px 0 40px; }

  .article-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .article-grid-small { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  .featured-link { flex-direction: row; align-items: stretch; }
  .featured-image { flex: 1; aspect-ratio: auto; min-height: 280px; }
  .featured-body { flex: 1; padding: 30px 32px; display: flex; flex-direction: column; justify-content: center; }

  .search-form {
    flex-direction: row; border-radius: 50px;
    padding: 6px 6px 6px 22px; align-items: center;
  }
  .search-form button { width: auto; border-radius: 50px; padding: 12px 20px; }

  .newsletter-inner { flex-direction: row; justify-content: space-between; text-align: left; }
  .newsletter-form { flex-direction: row; padding: 5px; }
  .newsletter-form input { flex: 1; width: auto; }

  .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 36px; }
  .author-box { flex-direction: row; text-align: left; }
}

/* ============================================================
   RESPONSIVE — DESKTOP (>= 900px)
   ============================================================ */
@media (min-width: 900px) {
  .header-inner { height: 68px; gap: 20px; }
  .logo { font-size: 20px; }
  .logo img { width: 40px; height: 40px; }

  .search-box {
    display: flex;
    margin-left: auto;
    margin-right: 16px;
  }
  .search-box input { width: 180px; }

  .nav-toggle { display: none; }

  .main-nav {
    position: static; max-height: none; overflow: visible;
    background: transparent; border: none; box-shadow: none;
  }
  .main-nav ul { flex-direction: row; gap: 22px; padding: 0; }
  .main-nav li { border: none; }
  .main-nav a { padding: 6px 0; position: relative; }
  .main-nav a::after {
    content: ""; position: absolute; left: 0; bottom: 0;
    width: 0; height: 2px; background: var(--brand-gradient);
    transition: width var(--t);
  }
  .main-nav a:hover::after { width: 100%; }

  .hero { padding: 80px 0 60px; }
  .hero-category { padding: 60px 0 50px; }

  .article-grid { grid-template-columns: repeat(3, 1fr); gap: 26px; }
  .article-grid-small { grid-template-columns: repeat(3, 1fr); }
  .trust-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }

  .articles-section { padding: 40px 0 60px; }
  .section-head { margin-bottom: 28px; }

  .featured-body { padding: 40px 44px; }

  .layout-single {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px; padding: 40px 20px 80px;
  }
  .sidebar { display: block; }

  .article-title { font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
  .article-content { font-size: 1.06rem; line-height: 1.85; }

  .author-box { padding: 24px; margin: 40px 0 30px; }
  .author-box img { width: 64px; height: 64px; }

  .related-section { margin-top: 40px; padding-top: 30px; }
  .related-section h2 { font-size: 1.3rem; }

  .error-404 { padding: 100px 0; }
  .back-to-top { right: 30px; bottom: 30px; width: 48px; height: 48px; }

  .toc { padding: 22px 24px; }
  .faq-question { font-size: 1.02rem; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .site-footer, .sidebar, .ad-container, .ad-infeed,
  .ad-infeed-card, .ad-placeholder, .author-box, .related-section,
  .breadcrumb, .nav-toggle, .search-box, .search-form, .newsletter-box,
  .hero-actions, .hero-stats, .back-to-top, .reading-progress, .toc {
    display: none !important;
  }
  .layout-single { grid-template-columns: 1fr; padding: 0; }
  .article-content { font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
  .faq-item { page-break-inside: avoid; }
}