/* ==========================================================================
   STYLESHEET — single file, no external dependencies.
   Article-first reading layout · centered measure · CSS Grid.
   ========================================================================== */

/* --- Tokens --- */
:root {
  --brand:    #1b6599;
  --brand-d:  #155080;
  --accent:   #289a99;
  --accent-d: #22807f;
  --accent-soft: rgba(40, 154, 153, .1);
  --ink:    #1d222b;
  --text:   #3f4651;
  --muted:  #737a86;
  --faint:  #a2a8b2;
  --line:   #e4e7ec;
  --soft:   #eef1f5;
  --paper:  #ffffff;
  --wash:   #f5f6f9;
  --dark:   #15181f;
  --rad:    6px;
  --rad-s:  4px;
  --rad-l:  10px;
  --wrap:   860px;
  --ff: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --tr: .2s ease;
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--ff);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--wash);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--brand); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--brand-d); }

h1 { color: var(--ink); margin: 0; line-height: 1.22; font-weight: 800; letter-spacing: -.015em; }

p { margin: 0 0 1.1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lx-vh {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.lx-muted { color: var(--muted); font-size: .9rem; margin: 0 0 14px; }

/* --- Wrap / sections / grid --- */
.lx-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.lx-section { padding: 30px 20px 0; }
.lx-section > .lx-htitle { max-width: var(--wrap); margin-left: auto; margin-right: auto; }

.lx-grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 680px) { .lx-grid-2 { grid-template-columns: 1fr 1fr; } }

/* --- Section title (span, styled — no heading tags outside content) --- */
.lx-htitle {
  display: block;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.lx-htitle--sm { font-size: 1.02rem; margin-bottom: 10px; }

/* --- Reading progress --- */
.lx-progress {
  position: fixed; inset: 0 auto auto 0;
  width: 0; height: 3px;
  background: var(--accent);
  z-index: 1200;
  transition: width .1s linear;
}

/* --- Top bar (static, content stays high) --- */
.lx-top { background: var(--paper); border-bottom: 2px solid var(--accent); }
.lx-top__inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.lx-logo { display: inline-flex; align-items: center; color: var(--brand); margin-right: auto; }
.lx-logo img, .lx-logo svg { display: block; height: 28px; width: auto; }

.lx-nav { display: flex; gap: 4px; }
.lx-nav__link {
  display: block; padding: 8px 13px;
  color: var(--text); font-size: .9rem; font-weight: 600;
  border-radius: var(--rad-s);
  transition: color var(--tr), background var(--tr);
}
.lx-nav__link:hover { color: var(--brand); background: var(--accent-soft); }
.lx-auth { display: flex; align-items: center; gap: 8px; }

@media (max-width: 560px) {
  .lx-nav { display: none; }
}

/* --- Buttons --- */
.lx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  font-family: var(--ff); font-size: .9rem; font-weight: 600;
  color: #fff; background: var(--brand);
  border: 1.5px solid var(--brand); border-radius: var(--rad);
  cursor: pointer; line-height: 1.4; white-space: nowrap;
  transition: background var(--tr), border-color var(--tr), color var(--tr), transform var(--tr);
}
.lx-btn:hover { background: var(--brand-d); border-color: var(--brand-d); color: #fff; }
.lx-btn:active { transform: translateY(1px); }
.lx-btn--sm { padding: 7px 15px; font-size: .84rem; }
.lx-btn--ghost { background: transparent; color: var(--brand); }
.lx-btn--ghost:hover { background: var(--brand); color: #fff; }
.lx-btn--accent { background: var(--accent); border-color: var(--accent); }
.lx-btn--accent:hover { background: var(--accent-d); border-color: var(--accent-d); }
.lx-btn--block { display: flex; width: 100%; }
.lx-btn--icon { padding: 10px 12px; }
.lx-btn--icon svg { width: 16px; height: 16px; }

/* --- Cards --- */
.lx-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--rad-l);
}
.lx-card--pad { padding: 22px 24px; }

/* --- Post (article) — first block, content high --- */
.lx-post {
  max-width: var(--wrap);
  margin: 26px auto 0;
  padding: 34px 38px;
  overflow: hidden;
}
.lx-post__title { font-size: 1.85rem; margin-bottom: 14px; }
.lx-post__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  font-size: .82rem; color: var(--muted);
  padding-bottom: 22px; border-bottom: 1px solid var(--soft);
}
.lx-meta-item { display: inline-flex; align-items: center; }
.lx-meta-item svg { width: 14px; height: 14px; margin-right: 5px; opacity: .55; }
.lx-meta-item--upd { font-style: italic; opacity: .8; }

/* --- TOC --- */
.lx-toc {
  margin: 24px 0 4px;
  background: var(--wash);
  border: 1px solid var(--soft);
  border-radius: var(--rad);
  padding: 16px 20px;
}
.lx-toc__bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lx-toc__title { font-weight: 700; font-size: .92rem; color: var(--ink); }
.lx-toc__btn { background: none; border: 0; color: var(--brand); cursor: pointer; font-size: .82rem; padding: 2px 6px; }
.lx-toc__list { display: flex; flex-direction: column; }
.lx-toc__list a {
  padding: 5px 0; font-size: .88rem; color: var(--text);
  border-left: 2px solid transparent;
  transition: color var(--tr), padding-left var(--tr), border-color var(--tr);
}
.lx-toc__list a:hover { color: var(--brand); padding-left: 7px; border-left-color: var(--brand); }
.lx-toc__lvl-3 { padding-left: 16px !important; }
.lx-toc__lvl-3:hover { padding-left: 23px !important; }

/* --- Rich text (the only place with headings, coming from content) --- */
.lx-rte { font-size: 1.07rem; line-height: 1.85; color: var(--text); padding-top: 24px; }
.lx-rte > :first-child { margin-top: 0; }
.lx-rte h2 { margin: 1.9em 0 .5em; padding-bottom: .3em; border-bottom: 2px solid var(--accent-soft); font-size: 1.42rem; color: var(--ink); line-height: 1.3; font-weight: 700; }
.lx-rte h3 { margin: 1.5em 0 .45em; font-size: 1.2rem; color: var(--ink); line-height: 1.3; font-weight: 700; }
.lx-rte h4 { margin: 1.3em 0 .4em; font-size: 1.05rem; color: var(--ink); font-weight: 700; }
.lx-rte p { margin: 0 0 1.15em; }
.lx-rte img { border-radius: var(--rad); margin: 1.5em 0; }
.lx-rte a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.lx-rte a:hover { color: var(--brand-d); }
.lx-rte ul, .lx-rte ol { margin: 1em 0; padding-left: 1.7em; }
.lx-rte li { margin-bottom: .4em; }
.lx-rte blockquote {
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  margin: 1.5em 0; padding: 16px 22px; border-radius: 0 var(--rad) var(--rad) 0;
  font-style: italic; color: var(--ink);
}
.lx-rte table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; }
.lx-rte th, .lx-rte td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; }
.lx-rte th { background: var(--wash); font-weight: 700; }
.lx-rte pre { background: #1b1f29; color: #d6dbe7; padding: 18px; border-radius: var(--rad); overflow-x: auto; font-size: .88rem; line-height: 1.6; margin: 1.5em 0; }
.lx-rte code { background: var(--wash); padding: 2px 6px; border-radius: 3px; font-size: .9em; }
.lx-rte pre code { background: none; padding: 0; }

/* --- Share (rounded-square icons) --- */
.lx-share { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--soft); }
.lx-share__label { font-size: .86rem; font-weight: 600; color: var(--muted); }
.lx-share__row { display: flex; gap: 8px; }
.lx-share__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--paper); color: var(--muted);
  cursor: pointer; transition: color var(--tr), border-color var(--tr), background var(--tr);
}
.lx-share__btn:hover { color: #fff; background: var(--brand); border-color: var(--brand); }
.lx-share__btn svg { width: 16px; height: 16px; }

/* --- Related --- */
.lx-related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.lx-related__item {
  display: block; padding: 15px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--rad);
  transition: border-color var(--tr), box-shadow var(--tr);
}
.lx-related__item:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(20,28,48,.06); }
.lx-related__t { font-size: .9rem; font-weight: 600; color: var(--ink); line-height: 1.4; }

/* --- Forms --- */
.lx-form { display: block; }
.lx-input {
  display: block; width: 100%; padding: 11px 15px;
  font-family: var(--ff); font-size: .9rem; color: var(--text);
  background: var(--wash); border: 1px solid var(--line); border-radius: var(--rad);
  outline: none; transition: border-color var(--tr), box-shadow var(--tr), background var(--tr);
}
.lx-input:focus { background: var(--paper); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(40,154,153,.14); }
.lx-textarea { min-height: 130px; resize: vertical; margin-top: 14px; }
.lx-textarea--sm { min-height: 96px; }
.lx-form .lx-btn { margin-top: 16px; }
.lx-inline { display: flex; gap: 8px; }
.lx-inline .lx-input { flex: 1; }
.lx-inline .lx-btn { margin-top: 0; flex-shrink: 0; }

/* --- Engage band (newsletter + contact) --- */
.lx-band { background: var(--paper); border-top: 1px solid var(--line); margin-top: 34px; padding: 40px 20px; }
.lx-band .lx-card { background: var(--wash); }

/* --- Footer (slim, grid) --- */
.lx-foot { background: var(--dark); color: rgba(255,255,255,.66); padding: 34px 20px 28px; }
.lx-foot a { color: rgba(255,255,255,.6); }
.lx-foot a:hover { color: #fff; }
.lx-foot__inner { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: center; }
@media (min-width: 720px) { .lx-foot__inner { grid-template-columns: auto 1fr auto; } }
.lx-foot__logo img { height: 26px; width: auto; filter: brightness(0) invert(1); opacity: .85; }
.lx-foot__nav { display: flex; flex-wrap: wrap; gap: 16px; font-size: .88rem; justify-content: center; }
.lx-foot__copy { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: .82rem; color: rgba(255,255,255,.5); text-align: center; }

/* Social (rounded squares, new set) */
.lx-soc { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; justify-content: center; }
.lx-soc__link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.16); color: rgba(255,255,255,.55);
  transition: color var(--tr), border-color var(--tr), background var(--tr);
}
.lx-soc__link:hover { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); }
.lx-soc__link svg { width: 16px; height: 16px; }

/* --- Back to top --- */
.lx-up {
  position: fixed; bottom: 26px; right: 26px;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--brand); color: #fff; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(20,28,48,.18);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity var(--tr), visibility var(--tr), transform var(--tr), background var(--tr);
  z-index: 900;
}
.lx-up--on { opacity: 1; visibility: visible; transform: translateY(0); }
.lx-up:hover { background: var(--brand-d); transform: translateY(-2px); }

/* --- Cookie --- */
.lx-cookie {
  position: fixed; inset: auto 0 0 0;
  background: var(--dark); color: rgba(255,255,255,.82);
  padding: 16px 20px; z-index: 1050;
  box-shadow: 0 -4px 18px rgba(0,0,0,.15);
  transform: translateY(110%); transition: transform var(--tr);
}
.lx-cookie--on { transform: translateY(0); }
.lx-cookie__inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.lx-cookie span { font-size: .85rem; flex: 1; min-width: 220px; }
.lx-cookie a { color: var(--accent); text-decoration: underline; }

/* --- Modals (popups at the very bottom, opened via #) --- */
.lx-modal {
  position: fixed; inset: 0;
  display: none; align-items: flex-start; justify-content: center;
  padding: 6vh 16px;
  background: rgba(15, 18, 28, .62);
  z-index: 1300; overflow-y: auto;
}
.lx-modal:target { display: flex; }          /* no-JS fallback via # */
.lx-modal--open { display: flex; }            /* JS-enhanced state   */
.lx-modal__box {
  position: relative; width: 100%; max-width: 420px;
  background: var(--dark); border-radius: var(--rad-l);
  padding: 36px 30px; box-shadow: 0 18px 44px rgba(0,0,0,.4);
}
.lx-modal__box--light { background: var(--paper); }
.lx-modal__title {
  display: block; color: #fff; font-size: 1.25rem; font-weight: 700;
  text-align: center; margin-bottom: 22px;
}
.lx-modal__box--light .lx-modal__title { color: var(--ink); }
.lx-modal__x {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5); cursor: pointer;
}
.lx-modal__x:hover { color: #fff; background: rgba(255,255,255,.08); }
.lx-modal__box--light .lx-modal__x { color: var(--faint); }
.lx-modal__box--light .lx-modal__x:hover { color: var(--ink); background: var(--soft); }
.lx-modal__x svg { width: 18px; height: 18px; }
.lx-modal .lx-input { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.18); color: #fff; margin-bottom: 12px; }
.lx-modal .lx-input::placeholder { color: rgba(255,255,255,.5); }
.lx-modal .lx-input:focus { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.45); box-shadow: none; }
.lx-modal__box--light .lx-input { background: var(--wash); border-color: var(--line); color: var(--text); }
.lx-modal__box--light .lx-input::placeholder { color: var(--faint); }
.lx-modal .lx-btn { margin-top: 4px; }
.lx-modal__alt { display: flex; justify-content: space-between; font-size: .84rem; margin-top: 14px; }
.lx-modal__alt--center { justify-content: center; }
.lx-modal__intro { font-size: .9rem; color: var(--muted); text-align: center; margin: -6px 0 16px; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .lx-post { padding: 24px 20px; margin-top: 18px; }
  .lx-post__title { font-size: 1.5rem; }
  .lx-share { flex-direction: column; align-items: flex-start; }
  .lx-related { grid-template-columns: 1fr; }
  .lx-cookie__inner { flex-direction: column; text-align: center; }
  .lx-modal__box { padding: 30px 22px; }
}
