/* ============================================================================
   StairCalc3D — blog styles (shared by every generated page)
   Palette mirrors the app: deep emerald + warm gold on a soft paper background.
   ========================================================================== */
:root {
  --ink: #1c2b26;
  --ink-soft: #3d524b;
  --paper: #f7f5ef;
  --paper-2: #fffdf7;
  --line: #e3ded1;
  --line-soft: #ece7da;
  --brand: #14584a;
  --brand-2: #1c7260;
  --brand-deep: #0d3a31;
  --gold: #b8860b;
  --gold-2: #d9a83c;
  --danger: #b3342a;
  --ok: #1f7a52;
  --muted: #6b7c75;
  --shadow: 0 1px 2px rgba(20, 40, 34, 0.06), 0 14px 34px rgba(20, 40, 34, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.65 Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-2); text-decoration-color: rgba(28, 114, 96, 0.35); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
::selection { background: #f2dfae; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }

/* ---------------- Header ---------------- */
.site-header {
  background: linear-gradient(180deg, var(--brand-deep), var(--brand));
  color: #eaf4f0;
  border-bottom: 3px solid var(--gold);
  position: sticky; top: 0; z-index: 40;
}
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 22px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto;
  background: radial-gradient(circle at 35% 30%, #f3cd7d, #b8860b 62%, #7a5404);
  display: grid; place-items: center; font: 700 20px/1 Georgia, serif; color: #fff;
}
.brand-name { font: 600 19px/1.1 Georgia, serif; color: #fff; letter-spacing: 0.2px; }
.brand-name small { display: block; font: 11px/1.4 'Segoe UI', Arial, sans-serif; color: #bfd8cf; letter-spacing: 0.4px; margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  font: 600 13.5px/1 'Segoe UI', Arial, sans-serif; color: #dcebe5;
  padding: 9px 13px; border-radius: 8px; text-decoration: none;
}
.nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, 0.16); color: #fff; box-shadow: inset 0 -2px 0 var(--gold-2); }

/* ---------------- Language switcher ---------------- */
.lang-nav { display: flex; align-items: center; gap: 3px; margin-left: 8px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,0.2); }
.lang-nav a { font: 700 11px/1 'Segoe UI', Arial, sans-serif; color: #bfd8cf; padding: 5px 6px; text-decoration: none; text-transform: uppercase; letter-spacing: 0.4px; border-radius: 6px; }
.lang-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.lang-nav a.current { color: #f4d48f; background: rgba(184,134,11,0.22); }

/* ---------------- Hero / landing ---------------- */
.hero { background: var(--brand-deep); color: #eef6f2; padding: 34px 0 40px; border-bottom: 3px solid var(--gold); }
.hero .wrap { max-width: 900px; }
.eyebrow { display: inline-block; font: 700 11.5px/1 'Segoe UI', Arial, sans-serif; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-2); background: rgba(217,168,60,0.12); border: 1px solid rgba(217,168,60,0.35); padding: 6px 12px; border-radius: 999px; }
.hero h1 { margin: 18px 0 12px; font: 600 clamp(28px, 5vw, 44px)/1.12 Georgia, serif; color: #fff; letter-spacing: -0.2px; }
.hero p { margin: 0; font: 18px/1.65 'Segoe UI', Arial, sans-serif; color: #c9ddd5; }
.hero .stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 22px; }
.hero .stats span { font: 700 13px/1.4 'Segoe UI', Arial, sans-serif; color: #bcd6cc; }
.hero .stats b { display: block; font: 700 24px/1 Georgia, serif; color: var(--gold-2); }

/* ---------------- Landing grids ---------------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 18px; }
.section-title h2 { margin: 0; font: 600 25px/1.2 Georgia, serif; color: var(--brand-deep); }
.section-title .more { font: 600 13px 'Segoe UI', Arial, sans-serif; text-decoration: none; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 22px; margin-bottom: 14px; }
.card {
  display: flex; flex-direction: column; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform 0.16s ease, box-shadow 0.16s ease;
  text-decoration: none; color: inherit;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 12px rgba(20,40,34,0.06), 0 22px 44px rgba(20,40,34,0.14); }
.card .thumb { aspect-ratio: 16/9; overflow: hidden; background: #e8e2d3; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .thumb img { transform: scale(1.05); }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { font: 700 10.5px/1 'Segoe UI', Arial, sans-serif; letter-spacing: 0.6px; text-transform: uppercase; color: var(--gold); background: #f6ecd2; border-radius: 999px; padding: 5px 10px; }
.card h3 { margin: 0; font: 600 19px/1.3 Georgia, serif; color: var(--brand-deep); }
.card p { margin: 0; font: 14px/1.55 'Segoe UI', Arial, sans-serif; color: var(--ink-soft); flex: 1; }
.card .read { font: 700 12.5px 'Segoe UI', Arial, sans-serif; color: var(--brand-2); }

/* ---------------- Article page ---------------- */
.article-head { padding: 30px 0 8px; }
.breadcrumbs { font: 700 12px/1.4 'Segoe UI', Arial, sans-serif; color: var(--muted); margin: 0 0 16px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand-2); }
.breadcrumbs .sep { margin: 0 6px; opacity: 0.6; }
.article-head h1 { margin: 12px 0 14px; font: 600 clamp(27px, 4.4vw, 42px)/1.15 Georgia, serif; color: var(--brand-deep); letter-spacing: -0.3px; }
.article-head .lead { font: 20px/1.6 Georgia, serif; color: var(--ink-soft); margin: 0 0 20px; max-width: 46rem; }
.byline { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; color: var(--muted); font: 13.5px/1.4 'Segoe UI', Arial, sans-serif; margin-top: 6px; }
.byline .dot { opacity: 0.5; }

.hero-img { margin: 26px auto 0; max-width: 960px; }
.hero-img figure { margin: 0; }
.hero-img img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.hero-img figcaption { font: 12.5px/1.5 'Segoe UI', Arial, sans-serif; color: var(--muted); margin-top: 10px; }

.article { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; padding-bottom: 26px; }
.article-body { min-width: 0; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow); }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.1em; }
.article-body a { font-weight: 600; }
.article-body h2 { font: 600 25px/1.25 Georgia, serif; color: var(--brand-deep); margin: 1.6em 0 0.6em; padding-left: 13px; border-left: 4px solid var(--gold); }
.article-body h3 { font: 600 19px/1.3 Georgia, serif; color: var(--brand); margin: 1.5em 0 0.5em; }
.article-body ul, .article-body ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.article-body li { margin: 0.35em 0; }
.article-body li::marker { color: var(--gold); }
.article-body strong { color: #15332b; }
.article-body blockquote {
  margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--gold-2);
  background: linear-gradient(90deg, #f7efd9, transparent); border-radius: 0 10px 10px 0;
  font-style: italic; color: #4b4330;
}
.article-body code { font: 0.85em Consolas, 'Courier New', monospace; background: #efe9da; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: #7a5404; }
.article-body .formula {
  margin: 1.5em 0; background: var(--brand-deep); color: #f3e6bf; border-radius: 12px;
  padding: 20px 24px; text-align: center; font: 600 26px/1.3 Georgia, serif;
  box-shadow: inset 0 0 0 1px rgba(217,168,60,0.5), var(--shadow);
}
.article-body .formula small { display: block; font: 12px/1.5 'Segoe UI', Arial, sans-serif; color: #bcd6cc; font-weight: 500; margin-top: 10px; font-style: italic; }
.article-body figure { margin: 1.6em 0; }
.article-body figure img { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); width: 100%; }
.article-body figcaption { font: 12.5px/1.5 'Segoe UI', Arial, sans-serif; color: var(--muted); margin-top: 8px; }
.article-body .note {
  display: flex; gap: 12px; background: #eef6f2; border: 1px solid #cfe3db; color: #21543f;
  border-radius: 12px; padding: 14px 16px; font: 14.5px/1.6 'Segoe UI', Arial, sans-serif; margin: 1.4em 0;
}
.article-body .note b { color: var(--brand-deep); }

/* ---- sticky aside ---- */
.aside { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 18px; }
.box { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.box h3 { margin: 0 0 12px; font: 700 12px/1 'Segoe UI', Arial, sans-serif; text-transform: uppercase; letter-spacing: 1.4px; color: var(--gold); }
.box.try { background: linear-gradient(160deg, var(--brand-deep), var(--brand)); border: 0; color: #eaf4f0; }
.box.try h3 { color: var(--gold-2); }
.box.try p { font: 13.5px/1.6 'Segoe UI', Arial, sans-serif; color: #cfe2da; margin: 0 0 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 14px/1 'Segoe UI', Arial, sans-serif; text-decoration: none;
  padding: 12px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
}
.btn-gold { background: linear-gradient(180deg, #e2b64d, #b8860b); color: #3a2a04; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.btn-gold:hover { filter: brightness(1.05); color: #3a2a04; }
.btn-ghost { border-color: #6f968a; color: #eaf4f0; background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }
.mini-list a { display: block; font: 14.5px/1.5 'Segoe UI', Arial, sans-serif; padding: 7px 0; text-decoration: none; color: var(--ink); border-bottom: 1px dashed var(--line-soft); }
.mini-list a:last-child { border-bottom: 0; }
.mini-list a:hover { color: var(--brand-2); }
.inline-img { border-radius: 12px; margin: 0.6em 0 1.6em; }

/* ---- live app iframe ---- */
.live { margin: 26px 0 0; }
.live .box { padding: 0; overflow: hidden; }
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--brand-deep); color: #fff; }
.live-head .tt { display: flex; align-items: center; gap: 10px; font: 700 15px/1.2 'Segoe UI', Arial, sans-serif; }
.live-head .tt span { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(31,122,82,0.25); }
.live-head a { font: 700 12.5px 'Segoe UI', Arial, sans-serif; color: #f4d48f; text-decoration: none; white-space: nowrap; }
.live-head a:hover { color: #fff; }
.live-iframe { position: relative; width: 100%; }
.live-iframe iframe { display: block; width: 100%; height: 540px; border: 0; background: #15211e; }
.live .live-cap { font: 13px/1.6 'Segoe UI', Arial, sans-serif; color: var(--muted); padding: 10px 18px; border-top: 1px solid var(--line); }

/* ---------------- Related ---------------- */
.related { padding: 34px 0 6px; border-top: 1px solid var(--line-soft); }

/* ---------------- Footer ---------------- */
.site-footer { margin-top: 46px; background: var(--brand-deep); color: #b9d0c8; }
.footer-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px; padding: 40px 22px 26px; max-width: 1180px; margin: 0 auto; }
.site-footer h4 { margin: 0 0 10px; color: #fff; font: 700 13px 'Segoe UI', Arial, sans-serif; text-transform: uppercase; letter-spacing: 1px; }
.site-footer p { font: 14px/1.65 'Segoe UI', Arial, sans-serif; margin: 0; }
.site-footer a { color: #d6e7e0; font: 14px/1.5 'Segoe UI', Arial, sans-serif; }
.site-footer a:hover { color: #fff; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 16px 0 22px; }
.footer-bottom .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font: 12.5px 'Segoe UI', Arial, sans-serif; color: #8fb2a6; }

/* ---------------- Responsive ---------------- */
@media (max-width: 940px) {
  .article { grid-template-columns: 1fr; }
  .aside { position: static; }
  .footer-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand-name { font-size: 16px; }
  .brand-name small { font-size: 10px; }
  .lang-nav { display: none; } /* language links stay in footer + <link> hreflang */
  .hero .stats { gap: 18px; }
  .live-iframe iframe { height: 440px; }
  .footer-in { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
