/* ═══════════════════════════════════════════════════════════════
   EmagineCMS v5.0 — Front-End Stylesheet
   Clean, professional, light theme
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────────── */
:root {
  --primary:     #2563eb;
  --primary-dk:  #1d4ed8;
  --primary-lt:  #eff6ff;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --bg:          #ffffff;
  --bg-alt:      #f8fafc;
  --border:      #e2e8f0;
  --radius:      10px;
  --shadow:      0 4px 20px rgba(0,0,0,0.07);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.12);
  --container:   1160px;
  --font:        'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Container ────────────────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}
.site-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}
.logo-img { max-height: 44px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 7px;
  text-decoration: none;
  transition: all .15s;
}
.nav-link:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.nav-link.active { color: var(--primary); background: var(--primary-lt); }
.nav-cta {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 8px 18px;
  border-radius: 8px;
  text-decoration: none;
  margin-left: 8px;
  transition: background .15s;
}
.nav-cta:hover { background: var(--primary-dk); text-decoration: none; color: #fff; }
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text);
  border-radius: 7px;
  text-decoration: none;
}
.nav-dropdown-menu a:hover { background: var(--bg-alt); }

/* ── Page / Home Content ──────────────────────────────────────── */
.home-content, .page-full-content { width: 100%; }
.home-content section { width: 100%; }
.page-full-content > * { width: 100%; }

/* ── Blog Layout ──────────────────────────────────────────────── */
.blog-section { padding: 60px 0; background: var(--bg); }
.blog-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dk) 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
}
.blog-header h1 { font-size: clamp(30px,4vw,48px); font-weight: 800; margin-bottom: 12px; letter-spacing:-.02em; }
.blog-header p { font-size: 17px; opacity: 0.88; max-width: 520px; margin: 0 auto; }
.blog-layout { max-width: 1160px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 1fr 340px; gap: 48px; }
.blog-posts { }
.blog-sidebar { }
.post-card {
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
}
.post-card:first-child { padding-top: 0; }
.post-card-text { }
.post-card-image { width: 140px; height: 100px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; }
.post-category-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
  margin-bottom: 8px;
}
.post-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 10px;
  letter-spacing: -.01em;
}
.post-title:hover { color: var(--primary); }
.post-excerpt { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: 12px; }
.post-meta { font-size: 12px; color: #94a3b8; display: flex; align-items: center; gap: 12px; }
.read-more { font-size: 13px; font-weight: 600; color: var(--primary); }
.read-more:hover { text-decoration: underline; }

/* ── Single Post ──────────────────────────────────────────────── */
.post-container { max-width: 740px; margin: 0 auto; padding: 60px 24px 0; }
.post-header { margin-bottom: 40px; }
.post-header h1 {
  font-size: clamp(26px,3.5vw,40px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: 16px;
  color: var(--text);
}
.post-featured-image { width: 100%; border-radius: 12px; margin-bottom: 40px; }
.post-body { font-size: 17px; line-height: 1.85; color: #374151; }
.post-body p { margin-bottom: 22px; }
.post-body h2 { font-size: 24px; font-weight: 700; color: var(--text); margin: 40px 0 16px; letter-spacing:-.01em; }
.post-body h3 { font-size: 19px; font-weight: 600; color: var(--text); margin: 32px 0 12px; }
.post-body h4 { font-size: 16px; font-weight: 600; color: var(--text); margin: 24px 0 10px; }
.post-body ul, .post-body ol { padding-left: 24px; margin-bottom: 22px; }
.post-body li { margin-bottom: 6px; }
.post-body blockquote {
  border-left: 3px solid var(--primary);
  padding: 16px 20px;
  margin: 28px 0;
  background: var(--primary-lt);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-muted);
}
.post-body img { border-radius: 10px; margin: 28px 0; }
.post-body a { color: var(--primary); }
.post-body code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: monospace; }
.post-body pre { background: #1e293b; color: #e2e8f0; padding: 20px; border-radius: 10px; overflow-x: auto; margin: 24px 0; }
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar-widget { margin-bottom: 28px; }
.sidebar-widget-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.sidebar-cat { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text); text-decoration: none; }
.sidebar-cat:hover { color: var(--primary); }
.sidebar-cat-count { font-size: 12px; background: var(--bg-alt); padding: 2px 8px; border-radius: 12px; color: var(--text-muted); }

/* ── Contact Form ─────────────────────────────────────────────── */
.contact-form { }
.contact-form .form-group { margin-bottom: 18px; }
.contact-form label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.contact-form input, .contact-form textarea, .contact-form select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.form-error { font-size: 12px; color: #dc2626; display: block; margin-top: 4px; }
.required { color: #dc2626; }
.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 32px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s, transform .1s;
}
.btn-submit:hover { background: var(--primary-dk); transform: translateY(-1px); }
.alert-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 600;
}

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  margin-top: 80px;
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 60px 24px 40px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand { }
.footer-title { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 10px; letter-spacing:-.01em; }
.footer-tagline { font-size: 14px; color: #64748b; line-height: 1.7; }
.footer-logo-img { max-height: 40px; margin-bottom: 12px; }
.footer-col-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #475569; margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-link { font-size: 14px; color: #64748b; text-decoration: none; transition: color .15s; }
.footer-link:hover { color: #94a3b8; }
.footer-contact { font-size: 14px; color: #64748b; line-height: 1.8; }
.footer-contact a { color: #64748b; text-decoration: none; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.social-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: #1e293b; color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; text-decoration: none; transition: .15s;
}
.social-btn:hover { background: #334155; color: #fff; }
.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 20px 24px;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #334155;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom a { color: #334155; text-decoration: none; }
.footer-bottom a:hover { color: #475569; }

/* ── Layout modes ─────────────────────────────────────────────── */
body.layout-full .container { max-width: 100%; padding: 0 40px; }
body.layout-full .footer-inner { max-width: 100%; padding-left: 40px; padding-right: 40px; }
body.layout-full .footer-bottom { max-width: 100%; }
body.layout-boxed { background: #e8edf2; }
body.layout-boxed .site-header { max-width: 1240px; margin: 0 auto; }
body.layout-boxed #main-content { background: #fff; max-width: 1240px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,0.08); }
body.layout-boxed .site-footer { max-width: 1240px; margin-left: auto; margin-right: auto; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { order: -1; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .header-inner { height: 56px; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
  .footer-inner { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; }
  .post-card-image { width: 100%; height: 200px; }
}
