/* ============================================================
   VidSave Pro — Blog Stylesheet
   Matches main site: Bricolage Grotesque + DM Sans
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

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

:root {
  --blue:        #1a56db;
  --blue-dark:   #1246c4;
  --blue-light:  #eff6ff;
  --blue-100:    #dbeafe;
  --coral:       #ff6b35;
  --coral-dark:  #e85a26;
  --navy:        #0f172a;
  --slate:       #334155;
  --muted:       #64748b;
  --border:      #e2e8f0;
  --bg:          #ffffff;
  --bg-subtle:   #f8fafc;
  --bg-blue:     #f0f7ff;
  --success:     #16a34a;
  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   22px;
  --shadow-sm:   0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.06);
  --shadow:      0 4px 16px rgba(26,86,219,.10), 0 1px 4px rgba(15,23,42,.06);
  --shadow-lg:   0 12px 40px rgba(26,86,219,.14), 0 4px 12px rgba(15,23,42,.08);
  --transition:  0.2s cubic-bezier(0.4,0,0.2,1);
  --max-w:       1120px;
  --content-w:   760px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--navy);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5 {
  font-family: 'Bricolage Grotesque', sans-serif;
  line-height: 1.2;
  font-weight: 700;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 32px;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.2rem; font-weight: 800; color: var(--navy);
  white-space: nowrap; text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }

.nav-logo span {
  background: linear-gradient(135deg, var(--blue), var(--coral));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px;
  flex-shrink: 0;
}

.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none;
}

.nav-links a {
  padding: 7px 13px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; color: var(--slate);
  transition: background var(--transition), color var(--transition);
}

.nav-links a:hover { background: var(--bg-subtle); color: var(--navy); text-decoration: none; }
.nav-links a.active { color: var(--blue); background: var(--blue-light); }

.nav-cta {
  background: var(--coral) !important;
  color: white !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 16px !important;
  font-weight: 600 !important;
  font-size: .88rem !important;
}
.nav-cta:hover { background: var(--coral-dark) !important; transform: translateY(-1px); text-decoration: none !important; }

.nav-hamburger { display: none; border: none; background: none; font-size: 1.4rem; color: var(--navy); }

/* ── Blog List / Index ────────────────────────────────────── */
.blog-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a2d5a 100%);
  color: white;
  padding: 72px 0 64px;
  text-align: center;
}

.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 16px;
  color: white;
}

.blog-hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,.75);
  max-width: 560px;
  margin: 0 auto 32px;
}

.blog-search-wrap {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.blog-search {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border-radius: 50px;
  border: none;
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  background: rgba(255,255,255,.12);
  color: white;
  outline: none;
  transition: background var(--transition);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2);
}

.blog-search::placeholder { color: rgba(255,255,255,.5); }
.blog-search:focus { background: rgba(255,255,255,.2); }

.blog-search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.6); pointer-events: none;
}

.blog-section { padding: 64px 0; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
  margin-top: 0;
}

.blog-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  display: flex; flex-direction: column; gap: 12px;
}

.blog-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--blue-100);
  text-decoration: none;
}

.blog-card-category {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--blue); background: var(--blue-light);
  padding: 4px 10px; border-radius: 50px;
  width: fit-content;
}

.blog-card h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--navy);
  transition: color var(--transition);
}

.blog-card:hover h2 { color: var(--blue); }

.blog-card p {
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.blog-card-meta {
  display: flex; align-items: center; gap: 16px;
  font-size: .8rem; color: var(--muted);
  margin-top: 4px;
}

.blog-card-meta span { display: flex; align-items: center; gap: 4px; }

.read-more {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .88rem; font-weight: 600; color: var(--blue);
  margin-top: 4px;
}

/* ── Article Layout ───────────────────────────────────────── */
.article-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a2d5a 100%);
  color: white;
  padding: 52px 0 48px;
}

.article-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: .83rem; color: rgba(255,255,255,.55);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.article-breadcrumb a { color: rgba(255,255,255,.7); }
.article-breadcrumb a:hover { color: white; text-decoration: none; }
.article-breadcrumb svg { flex-shrink: 0; }

.article-category {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: white; background: rgba(255,255,255,.18);
  padding: 4px 12px; border-radius: 50px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.2);
}

.article-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: white;
  max-width: 820px;
  margin-bottom: 16px;
  line-height: 1.15;
}

.article-hero-desc {
  font-size: 1.05rem;
  color: rgba(255,255,255,.75);
  max-width: 680px;
  margin-bottom: 24px;
}

.article-meta {
  display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap;
  font-size: .85rem; color: rgba(255,255,255,.6);
}

.article-meta span { display: flex; align-items: center; gap: 6px; }

/* ── Article Body ─────────────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  gap: 48px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 52px 24px 80px;
  align-items: start;
}

.article-body {
  min-width: 0;
}

.article-body h2 {
  font-size: 1.55rem;
  margin: 40px 0 16px;
  color: var(--navy);
  padding-top: 8px;
  border-top: 3px solid var(--blue-100);
  padding-top: 24px;
}

.article-body h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }

.article-body h3 {
  font-size: 1.2rem;
  margin: 28px 0 12px;
  color: var(--navy);
}

.article-body p {
  margin-bottom: 18px;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--slate);
}

.article-body ul, .article-body ol {
  margin: 0 0 20px 0;
  padding-left: 0;
  list-style: none;
}

.article-body ul li, .article-body ol li {
  padding: 6px 0 6px 28px;
  position: relative;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--slate);
}

.article-body ul li::before {
  content: '→';
  position: absolute; left: 0;
  color: var(--blue); font-weight: 700;
}

.article-body ol {
  counter-reset: list-counter;
}

.article-body ol li {
  counter-increment: list-counter;
}

.article-body ol li::before {
  content: counter(list-counter);
  position: absolute; left: 0;
  width: 20px; height: 20px;
  background: var(--blue);
  color: white;
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  top: 10px;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

.article-body strong { font-weight: 600; color: var(--navy); }

.article-body a { font-weight: 500; }

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: .93rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.article-body th {
  background: var(--navy);
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: .85rem;
}

.article-body td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--slate);
}

.article-body tr:last-child td { border-bottom: none; }
.article-body tr:nth-child(even) td { background: var(--bg-subtle); }

/* ── Callout / Info box ───────────────────────────────────── */
.callout {
  background: var(--bg-blue);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: .95rem;
  color: var(--slate);
}

.callout-warn {
  background: #fffbeb;
  border-color: #f59e0b;
}

.callout strong { display: block; margin-bottom: 4px; color: var(--navy); }

/* ── CTA Block ────────────────────────────────────────────── */
.article-cta {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  color: white;
  margin: 40px 0;
}

.article-cta h3 { color: white; font-size: 1.3rem; margin-bottom: 10px; }
.article-cta p { color: rgba(255,255,255,.8); font-size: .95rem; margin-bottom: 20px; }

.btn-white {
  display: inline-flex; align-items: center; gap: 8px;
  background: white; color: var(--blue);
  padding: 12px 24px; border-radius: 50px;
  font-weight: 700; font-size: .95rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.2); text-decoration: none; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar { position: sticky; top: 88px; }

.toc-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
}

.toc-box h4 {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 14px;
}

.toc-list { list-style: none; }

.toc-list li { margin-bottom: 2px; }

.toc-list a {
  font-size: .88rem;
  color: var(--slate);
  display: block;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  line-height: 1.4;
}

.toc-list a:hover { background: var(--blue-light); color: var(--blue); text-decoration: none; }
.toc-list a.active { background: var(--blue-light); color: var(--blue); font-weight: 500; }

.toc-list .toc-h3 { padding-left: 20px; }

.sidebar-cta {
  background: linear-gradient(135deg, var(--navy) 0%, #1a2d5a 100%);
  border-radius: var(--radius);
  padding: 22px;
  color: white;
  text-align: center;
}

.sidebar-cta h4 { color: white; font-size: 1rem; margin-bottom: 8px; }
.sidebar-cta p { font-size: .85rem; color: rgba(255,255,255,.7); margin-bottom: 16px; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--coral);
  color: white;
  padding: 11px 20px; border-radius: 50px;
  font-weight: 700; font-size: .9rem;
  transition: background var(--transition), transform var(--transition);
  width: 100%; justify-content: center;
}

.btn-primary:hover { background: var(--coral-dark); transform: translateY(-1px); text-decoration: none; }

/* ── Related Posts ────────────────────────────────────────── */
.related-section {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding: 56px 0 64px;
}

.related-section h2 {
  font-size: 1.5rem;
  margin-bottom: 32px;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.related-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: box-shadow var(--transition), transform var(--transition);
  display: block; color: inherit;
}

.related-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}

.related-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--navy);
  transition: color var(--transition);
  line-height: 1.35;
}

.related-card:hover h3 { color: var(--blue); }
.related-card p { font-size: .88rem; color: var(--muted); line-height: 1.5; }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,.7);
  padding: 52px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}

.footer-brand .nav-logo { color: white; margin-bottom: 14px; text-decoration: none; }
.footer-brand .nav-logo:hover { text-decoration: none; }
.footer-brand .nav-logo-icon { background: rgba(255,255,255,.12); }
.footer-brand p { font-size: .88rem; line-height: 1.7; max-width: 260px; }

.footer-col h4 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.45); margin-bottom: 18px;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: .9rem; color: rgba(255,255,255,.55); transition: color var(--transition); }
.footer-col a:hover { color: white; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 20px 0;
  display: flex; align-items: center; justify-content: space-between;
}

.footer-bottom p { font-size: .82rem; }
.footer-legal-links { display: flex; gap: 20px; }
.footer-legal-links a { font-size: .82rem; color: rgba(255,255,255,.4); }
.footer-legal-links a:hover { color: rgba(255,255,255,.7); text-decoration: none; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
    padding: 36px 20px 60px;
  }
  .sidebar { position: static; }
  .toc-box { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 64px; left: 0; right: 0;
    background: white; border-bottom: 1px solid var(--border);
    padding: 12px; gap: 4px; z-index: 99;
  }
  .nav-hamburger { display: block; }
  .blog-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
  .article-hero h1 { font-size: 1.5rem; }
}

/* ── Skip link ────────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--blue); color: white;
  padding: 8px 16px; border-radius: 0 0 8px 0;
  font-weight: 600; z-index: 200;
  transition: top .2s;
}
.skip-link:focus { top: 0; }
