/* ================================================================
   BabiaFlow — FlexStart-inspired Clean Theme
   Primary: #4154f1 (blue), Dark: #012970
   Style: White bg, clean cards, professional SaaS
   ================================================================ */

:root {
  --primary: #4154f1;
  --primary-rgb: 65, 84, 241;
  --primary-dark: #3240c7;
  --secondary: #ff6b6b;
  --dark: #012970;
  --dark-light: #013289;
  --light: #f6f9ff;
  --text: #444444;
  --heading: #012970;
  --border: #e2e8f0;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 5px 25px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: 0.3s; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4, h5, h6 { color: var(--heading); font-weight: 700; line-height: 1.3; margin-bottom: 0.75rem; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.25rem; }
img { max-width: 100%; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 28px; border-radius: 5px; font-weight: 600; cursor: pointer;
  transition: 0.3s; border: none; font-size: 0.9rem; gap: 8px;
}
.btn-primary { background: var(--primary); color: var(--white) !important; }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-sm { padding: 7px 18px; font-size: 0.8rem; }
.btn-full { width: 100%; text-align: center; }

/* --- Header (FlexStart: white bg, fixed, shadow on scroll) --- */
.site-header {
  position: fixed; width: 100%; top: 0; z-index: 1000;
  background: var(--white); padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: 0.3s;
}
.site-header.sticky { box-shadow: 0 2px 15px rgba(0,0,0,0.06); }

.header-inner { display: flex; justify-content: space-between; align-items: center; height: 50px; }
.site-logo { font-size: 1.5rem; font-weight: 800; color: var(--heading); display: flex; align-items: center; gap: 10px; }
.site-logo svg { width: 34px; height: 34px; }

.site-nav { display: flex; gap: 5px; align-items: center; }
.nav-link {
  color: var(--text); font-weight: 500; font-size: 0.95rem;
  padding: 8px 16px; border-radius: 5px;
}
.nav-link:hover { color: var(--primary); }
.nav-link.active { color: var(--primary); font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 10px; }
.header-right .btn { font-size: 0.85rem; padding: 8px 20px; }

.lang-switcher { position: relative; }
.lang-btn {
  background: none; border: 1px solid var(--border); border-radius: 5px;
  padding: 6px 14px; font-size: 0.82rem; cursor: pointer; color: var(--text);
  font-weight: 500; white-space: nowrap;
}
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }
.lang-dropdown {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: var(--white); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: var(--shadow); min-width: 130px; z-index: 999; overflow: hidden;
}
.lang-switcher.open .lang-dropdown { display: block; }
.lang-dropdown a {
  display: block; padding: 8px 16px; font-size: 0.85rem; color: var(--text);
  transition: 0.2s;
}
.lang-dropdown a:hover { background: var(--light); color: var(--primary); }
.lang-dropdown a.active { color: var(--primary); font-weight: 600; background: rgba(var(--primary-rgb), 0.05); }

/* mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--heading); margin: 5px 0; transition: 0.3s; }

/* --- Hero (FlexStart: white bg, left-aligned text, right illustration) --- */
.hero {
  padding: 130px 0 60px;
  background: var(--light);
}
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hero-content { max-width: 560px; }
.hero-title { font-size: 2.6rem; margin-bottom: 20px; line-height: 1.15; color: var(--heading); }
.hero-desc { font-size: 1.05rem; margin-bottom: 30px; color: #666; line-height: 1.7; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual { text-align: center; }
.hero-visual svg { width: 100%; max-width: 440px; height: auto; }

/* --- Stats Bar --- */
.stats-bar {
  background: var(--white); padding: 30px 40px; margin-top: -30px;
  position: relative; z-index: 10; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat-item h3 { font-size: 1.8rem; margin-bottom: 4px; color: var(--primary); }
.stat-item p { font-weight: 600; font-size: 0.85rem; color: #888; }

/* --- Section --- */
.section { padding: 80px 0; }
.section-header { text-align: center; max-width: 640px; margin: 0 auto 50px; }
.section-badge {
  display: inline-block; color: var(--primary); font-weight: 600;
  font-size: 0.85rem; margin-bottom: 10px; text-transform: uppercase;
  letter-spacing: 1px;
}
.section-title { font-size: 2rem; color: var(--heading); }
.section-desc { color: #666; font-size: 1rem; margin-top: 10px; }

/* --- Services / Category Grid (FlexStart: 3-col cards w/ icons) --- */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }
.service-card {
  padding: 30px 24px; background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); transition: 0.3s; text-align: center;
}
.service-card:hover { border-color: rgba(var(--primary-rgb), 0.3); box-shadow: var(--shadow); transform: translateY(-4px); }
.service-icon {
  width: 56px; height: 56px; background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary); display: inline-flex; align-items: center;
  justify-content: center; border-radius: 12px; margin-bottom: 18px;
}
.service-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.service-card p { font-size: 0.88rem; color: #666; line-height: 1.6; }

/* --- Blog Cards --- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.blog-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); transition: 0.3s;
}
.blog-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.blog-body { padding: 22px; }
.blog-meta { font-size: 0.8rem; color: #999; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.blog-tag {
  background: rgba(var(--primary-rgb), 0.08); color: var(--primary);
  padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
}
.blog-title { font-size: 1.05rem; line-height: 1.45; margin-bottom: 10px; }
.blog-title a { color: var(--heading); }
.blog-title a:hover { color: var(--primary); }
.blog-excerpt { font-size: 0.88rem; color: #666; margin-bottom: 14px; line-height: 1.6; }
.blog-link { font-weight: 600; font-size: 0.85rem; color: var(--primary); }

/* --- FAQ --- */
.faq-item {
  padding: 20px 25px; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 12px; background: var(--white); transition: 0.3s;
}
.faq-item:hover { border-color: rgba(var(--primary-rgb), 0.3); }
.faq-item h4 { font-size: 1rem; color: var(--heading); margin-bottom: 8px; }
.faq-item p { font-size: 0.92rem; color: #666; line-height: 1.6; }

/* --- Article Detail --- */
.page-header {
  background: var(--light); padding: 110px 0 40px;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 2rem; margin-bottom: 10px; }
.page-header-meta { font-size: 0.9rem; color: #888; display: flex; gap: 20px; flex-wrap: wrap; }

.breadcrumb-bar { padding: 14px 0; border-bottom: 1px solid var(--border); background: var(--white); }
.breadcrumb { font-size: 0.85rem; color: #888; display: flex; align-items: center; gap: 8px; }
.breadcrumb a { color: var(--primary); }
.breadcrumb-sep { color: #ccc; }

.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; padding: 40px 0 80px; }
.article-main { min-width: 0; }
.article-content { font-size: 1rem; color: #444; }
.article-content h2 { font-size: 1.45rem; margin: 35px 0 15px; padding-bottom: 8px; border-bottom: 2px solid var(--light); }
.article-content h3 { font-size: 1.15rem; margin: 25px 0 12px; }
.article-content p { margin-bottom: 1.25rem; }
.article-content img { border-radius: 6px; margin: 20px auto; display: block; max-height: 400px; }
.article-content ul, .article-content ol { margin: 0 0 1.25rem 1.5rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-content a { color: var(--primary); text-decoration: underline; }
.article-content a.btn { text-decoration: none; }

.article-cta {
  padding: 28px; border-radius: var(--radius); margin: 30px 0;
  background: var(--light); border: 1px solid var(--border);
}
.article-cta-dark {
  padding: 28px; border-radius: var(--radius); margin: 40px 0;
  background: var(--dark); color: var(--white);
}
.article-cta-dark h4 { color: var(--white); }
.article-cta-dark p { opacity: 0.8; }

/* Sidebar */
.sidebar-block {
  padding: 24px; margin-bottom: 24px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--white);
}
.sidebar-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 2px solid var(--light);
}
.sidebar-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.sidebar-tag {
  font-size: 0.82rem; padding: 5px 14px; border-radius: 20px;
  background: var(--light); color: var(--text); border: 1px solid var(--border);
  transition: 0.2s;
}
.sidebar-tag:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.sidebar-list { list-style: none; padding: 0; }
.sidebar-list li { padding: 8px 0; border-bottom: 1px solid var(--light); font-size: 0.9rem; }
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list a { color: var(--text); }
.sidebar-list a:hover { color: var(--primary); }

/* --- Related Posts --- */
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.related-item {
  padding: 18px; background: var(--light); border-radius: var(--radius);
  border: 1px solid var(--border); display: block; transition: 0.2s;
}
.related-item:hover { border-color: var(--primary); }
.related-item p { font-weight: 600; color: var(--heading); margin-bottom: 6px; font-size: 0.92rem; }
.related-item span { font-size: 0.8rem; color: #999; }

/* --- Tags/Category Pages --- */
.tags-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tag-card {
  display: block; padding: 28px 20px; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius);
  text-align: center; transition: 0.3s; color: var(--heading);
}
.tag-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-3px); color: var(--primary); }
.tag-card__icon {
  width: 52px; height: 52px; border-radius: 12px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--primary-rgb), 0.08); color: var(--primary);
}
.tag-card__name { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.tag-card__count { font-size: 0.8rem; color: #999; }

/* Article list in tag page */
.post-list { list-style: none; padding: 0; }
.post-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.post-list-item:last-child { border-bottom: none; }
.post-list-title { font-weight: 600; color: var(--heading); font-size: 1rem; }
.post-list-title:hover { color: var(--primary); }
.post-list-date { font-size: 0.82rem; color: #999; flex-shrink: 0; margin-left: 20px; }

/* --- Download Page --- */
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }

/* --- Pagination --- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: 5px; font-size: 0.88rem;
  border: 1px solid var(--border); color: var(--text);
}
.pagination a:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pagination .active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* --- Footer (FlexStart: dark bg, 4 cols) --- */
.site-footer { background: var(--dark); color: #aab4c6; padding: 60px 0 0; font-size: 0.88rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-logo { font-size: 1.5rem; font-weight: 800; color: white; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.footer-logo svg { width: 32px; height: 32px; }
.footer-about p { line-height: 1.7; opacity: 0.8; }
.footer-title { font-size: 1rem; font-weight: 700; margin-bottom: 18px; color: white; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #aab4c6; }
.footer-links a:hover { color: var(--white); padding-left: 4px; }

.footer-lang-row {
  border-top: 1px solid rgba(255,255,255,0.08); padding: 20px 0; margin-bottom: 20px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.footer-lang-row > span { font-weight: 700; color: white; margin-right: 10px; }
.footer-lang-row a {
  color: #8a94a6; padding: 4px 12px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1); font-size: 0.82rem;
}
.footer-lang-row a:hover, .footer-lang-row a.active { background: var(--primary); color: white; border-color: var(--primary); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08); padding: 20px 0;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px;
}
.footer-bottom__risk { font-size: 0.8rem; color: #6a7490; line-height: 1.6; max-width: 700px; }
.footer-bottom__copy { font-size: 0.82rem; color: #6a7490; }

/* --- Responsive --- */
@media (max-width: 992px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-content { max-width: 100%; margin: 0 auto; }
  .hero-btns { justify-content: center; }
  .hero-visual { display: none; }
  .blog-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .tags-grid { grid-template-columns: 1fr 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .site-nav { display: none; }
  .nav-toggle { display: block; }
  .site-nav.open { display: flex; flex-direction: column; position: absolute; top: 74px; left: 0; right: 0; background: var(--white); padding: 20px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
}

@media (max-width: 576px) {
  .services-grid, .tags-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.8rem; }
  .hero { padding: 110px 0 40px; }
  .section { padding: 50px 0; }
}
