/*
Theme Name: AppCRM Blog
Theme URI: https://appcrm.by/blog
Author: AppCRM
Author URI: https://appcrm.by
Description: Тема блога AppCRM в стиле лендинга.
Version: 1.0.1
Text Domain: appcrm-blog
*/

/* === Landing page design system (shared with /) === */
:root {
  --lp-ink: #142e35;
  --lp-muted: #506568;
  --lp-green: #17685a;
  --lp-line: #dce3dc;
  --lp-paper: #f6f7f2;
  --lp-lime: #ddf4aa;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--lp-ink); background: #fff;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-weight: 650; line-height: 1.15; letter-spacing: -0.045em; color: var(--lp-ink); margin: 0; }
h2 { font-size: clamp(24px, 2.5vw, 36px); }
h3 { font-size: 22px; }
p { color: var(--lp-muted); margin: 0 0 16px; }
figure { margin: 0; }

/* Skip link */
.lp-skip { position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden; z-index: 100; }
.lp-skip:focus { position: static; width: auto; height: auto; padding: 8px 16px; background: var(--lp-green); color: #fff; }

/* Wrap */
.lp-wrap { width: min(1240px, calc(100% - 80px)); margin-inline: auto; }

/* Eyebrow */
.lp-eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 22px !important; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--lp-green) !important; }
.lp-dot { display: inline-block; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #21806a; }

/* Header */
.lp-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--lp-line); }
.lp-nav { min-height: 85px; display: flex; align-items: center; gap: 35px; }
.lp-logo { display: inline-flex !important; align-items: center; flex-shrink: 0; gap: 0; font-size: 24px; font-weight: 750; letter-spacing: -1px; color: var(--lp-ink) !important; }
.lp-logo > span:last-child { color: var(--lp-green); }
.lp-logo-mark { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-right: 9px; border-radius: 10px; background: var(--lp-ink); color: var(--lp-lime); font-size: 28px; letter-spacing: -2px; padding-bottom: 5px; }
.lp-nav-links { display: flex; gap: 24px; margin-left: auto; }
.lp-nav-links a { font-size: 13px; font-weight: 550; white-space: nowrap; color: var(--lp-ink); }
.lp-nav-links a:hover, .lp-login:hover { color: var(--lp-green); text-decoration: underline; text-underline-offset: 5px; }
.lp-nav-actions { display: flex; align-items: center; gap: 24px; }
.lp-login { font-size: 14px; font-weight: 650; white-space: nowrap; }
.lp-menu { width: 42px; height: 42px; border: 1px solid var(--lp-line); border-radius: 7px; background: white; cursor: pointer; display: none; }
.lp-menu span { display: block; width: 18px; height: 2px; background: var(--lp-ink); margin: 5px auto; }

/* Buttons */
.lp-button { display: inline-flex; justify-content: center; align-items: center; gap: 24px; min-height: 54px; padding: 15px 23px; border: 1px solid var(--lp-green); border-radius: 8px; background: var(--lp-green); color: #fff !important; font-size: 14px; font-weight: 650; line-height: 1.4; transition: background .18s, transform .18s; }
.lp-button:hover { background: #115346; transform: translateY(-2px); }
.lp-button-small { min-height: 44px; padding: 11px 17px; font-size: 13px; }
.lp-button-light { background: var(--lp-lime); color: var(--lp-ink) !important; border-color: var(--lp-lime); }
.lp-button-light:hover { background: #c7e790; }
.lp-text-link { display: inline-flex; align-items: center; gap: 12px; color: var(--lp-green) !important; font-size: 14px; font-weight: 650; }

/* Final CTA section */
.lp-final-section { padding: 0 0 75px; }
.lp-final { padding: 54px 48px; background: var(--lp-green); border-radius: 15px; display: flex; align-items: center; justify-content: space-between; gap: 40px; position: relative; overflow: hidden; }
.lp-final:after { content: ''; position: absolute; width: 350px; height: 350px; border: 1px solid #ffffff15; border-radius: 50%; right: -150px; top: -130px; pointer-events: none; }
.lp-final .lp-eyebrow { color: var(--lp-lime) !important; }
.lp-final h2 { color: #fff; font-size: 38px; }
.lp-final p:not(.lp-eyebrow) { color: #deece5; margin-top: 20px; }
.lp-micro { font-size: 12px; color: var(--lp-muted); margin-top: 12px; }

/* Footer */
.lp-footer { border-top: 1px solid var(--lp-line); padding: 55px 0 25px; background: var(--lp-paper); }
.lp-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 45px; }
.lp-footer-grid h2 { font-size: 13px; letter-spacing: 0; margin: 10px 0 20px; }
.lp-footer-grid a:not(.lp-logo) { display: block; font-size: 13px; color: var(--lp-muted); margin: 10px 0; }
.lp-footer-grid a:not(.lp-logo):hover { text-decoration: underline; }
.lp-footer-grid p { font-size: 12px; margin: 20px 0; line-height: 1.9; }
.lp-footer-note { max-width: 250px; }
.lp-footer-bottom { display: flex; gap: 24px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--lp-line); font-size: 12px; color: var(--lp-muted); }
.lp-footer-bottom a { color: var(--lp-muted); text-decoration: underline; }

/* === Blog content === */
.blog-wrap { max-width: 1240px; width: calc(100% - 80px); margin: 0 auto; padding: 60px 0 40px; }
.blog-main-header { margin-bottom: 48px; }
.blog-main-header h1 { font-size: clamp(28px, 3.4vw, 42px); margin-bottom: 12px; }
.blog-main-header p.lead { font-size: 17px; max-width: 600px; }

/* Post cards */
.post-card { border: 1px solid var(--lp-line); border-radius: 12px; padding: 32px; margin-bottom: 24px; transition: box-shadow .2s, transform .2s; background: #fff; }
.post-card:hover { box-shadow: 0 8px 30px rgba(20,46,53,.08); transform: translateY(-2px); }
.post-card h2 { margin: 0 0 12px; font-size: 24px; }
.post-card h2 a { color: var(--lp-ink); }
.post-card h2 a:hover { color: var(--lp-green); }
.post-meta { font-size: 13px; color: var(--lp-muted); margin-bottom: 16px; display: flex; gap: 16px; flex-wrap: wrap; }
.post-meta span { display: flex; align-items: center; gap: 6px; }
.post-excerpt { font-size: 15px; line-height: 1.75; color: var(--lp-muted); }
.post-excerpt p { margin: 0; }
.read-more { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; font-weight: 650; color: var(--lp-green); }
.read-more:hover { opacity: .8; }

/* Single post */
.single-post { max-width: 780px; margin: 0 auto; }
.single-post .post-header { margin-bottom: 40px; }
.single-post .post-header h1 { margin-bottom: 16px; font-size: clamp(24px, 3vw, 36px); }
.single-post .post-content { font-size: 17px; line-height: 1.85; }
.single-post .post-content h2 { margin: 48px 0 20px; font-size: 28px; }
.single-post .post-content h3 { margin: 36px 0 16px; }
.single-post .post-content p { margin-bottom: 20px; }
.single-post .post-content ul, .single-post .post-content ol { margin: 16px 0 24px; padding-left: 24px; color: var(--lp-muted); }
.single-post .post-content li { margin-bottom: 8px; line-height: 1.75; }
.single-post .post-content blockquote { margin: 24px 0; padding: 20px 24px; border-left: 4px solid var(--lp-green); background: var(--lp-paper); border-radius: 0 8px 8px 0; font-style: italic; color: var(--lp-ink); }
.single-post .post-content code { background: var(--lp-paper); padding: 2px 6px; border-radius: 4px; font-size: 14px; }
.single-post .post-content pre { background: var(--lp-ink); color: #e0e0e0; padding: 20px; border-radius: 8px; overflow-x: auto; font-size: 14px; }
.single-post .post-content img { border-radius: 10px; margin: 24px 0; }
.single-post .post-content a { color: var(--lp-green); font-weight: 500; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--lp-green); margin-bottom: 32px; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; padding: 24px 0; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--lp-line); border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--lp-muted); }
.pagination a:hover { border-color: var(--lp-green); color: var(--lp-green); }
.pagination .current { background: var(--lp-green); color: #fff; border-color: var(--lp-green); }

/* === Responsive === */
@media (max-width: 1150px) {
  .lp-nav { gap: 20px; }
  .lp-nav-links { gap: 16px; }
  .lp-nav-actions { gap: 18px; }
  .lp-nav-start { display: none; }
  .lp-footer-grid { gap: 25px; }
  .lp-final { padding: 40px 32px; }
  .lp-final h2 { font-size: 32px; }
}

@media (max-width: 900px) {
  .blog-wrap { width: calc(100% - 48px); }
  .lp-wrap { width: calc(100% - 48px); }
  .lp-nav { min-height: 74px; flex-wrap: wrap; gap: 0; padding: 14px 0; }
  .lp-nav-actions { margin-left: auto; }
  .lp-nav-links { width: 100%; order: 3; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--lp-line); justify-content: space-between; flex-wrap: wrap; }
  .lp-nav-links[data-enhanced="true"]:not(.is-open) { display: none; }
  .lp-nav-links.is-open { display: flex; }
  .lp-nav-links a { padding: 9px 0; }
  .lp-menu { display: block; }
  .post-card { padding: 24px; }
  .lp-footer-grid { gap: 20px; }
  .lp-final { flex-direction: column; text-align: center; align-items: center; gap: 28px; }
  .lp-final .lp-eyebrow { justify-content: center; }
}

@media (max-width: 640px) {
  .blog-wrap { width: calc(100% - 36px); }
  .lp-wrap { width: calc(100% - 36px); }
  .lp-nav { min-height: 68px; }
  .lp-logo { font-size: 22px; }
  .lp-logo-mark { width: 32px; height: 32px; font-size: 25px; }
  .lp-nav-links.is-open { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
  .post-card { padding: 20px; }
  .post-card h2 { font-size: 20px; }
  .single-post .post-content { font-size: 16px; }
  .lp-footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .lp-footer-bottom { flex-wrap: wrap; gap: 12px; }
  .lp-footer-bottom a, .lp-footer-bottom span { white-space: nowrap; }
  .lp-final h2 { font-size: 28px; }
}

@media (prefers-reduced-motion: no-preference) {
  html:has(.landing) { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  .landing * { animation: none !important; transition: none !important; }
}

/* WordPress overrides */
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 13px; color: var(--lp-muted); margin-top: 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 24px 0; }
.gallery-item { margin: 0; }
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { display: block; margin: 24px auto; }