/* ============================================================
   СлужбаОрг — slugba.org
   Military Olive theme
   ============================================================ */

:root {
  --primary-dark: #1A3009;
  --primary: #2D5016;
  --primary-light: #4A7C2E;
  --accent: #D4A843;
  --accent-light: #E8C96A;
  --bg: #F5F3EF;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #666666;
  --border: #E5E2DA;
  --success: #4CAF50;
  --warning: #FF9800;
  --error: #E53935;
  --info: #2196F3;

  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1120px;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { font-family: var(--font-heading); font-weight: 700; line-height: 1.25; color: var(--primary-dark); }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.5rem); }
h2 { font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem); margin-bottom: 1rem; }
h3 { font-size: 1.35rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary-light); text-decoration: underline; }
ul, ol { padding-left: 1.3rem; margin-bottom: 1rem; }
li { margin-bottom: .35rem; }
img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Header ---------- */
header.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  max-width: var(--container); margin: 0 auto;
}
.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.3rem; font-weight: 700;
  color: var(--primary-dark);
  display: flex; align-items: center; gap: .4rem;
}
.nav-logo:hover { text-decoration: none; }
.nav-links {
  display: flex; gap: 1.5rem; list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  color: var(--text); font-weight: 500; font-size: .95rem;
  padding: .5rem 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); text-decoration: none; border-bottom: 2px solid var(--accent); }
.nav-burger {
  display: none; background: none; border: 0; font-size: 1.6rem;
  cursor: pointer; color: var(--primary-dark); padding: .25rem .5rem;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff; padding: 4rem 1.25rem 3.5rem;
  position: relative; overflow: hidden;
}
.hero::after {
  content:''; position:absolute; inset:0;
  background: radial-gradient(ellipse at top right, rgba(212,168,67,.15), transparent 60%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero .lead { font-size: 1.25rem; color: rgba(255,255,255,0.92); max-width: 760px; margin-bottom: 1.5rem; }
.hero .sub { font-size: 1.05rem; color: rgba(255,255,255,0.82); max-width: 720px; margin-bottom: 2rem; }
.hero .cta { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: .85rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: all .18s ease;
  font-family: var(--font-body);
}
.btn-primary { background: var(--accent); color: var(--primary-dark); }
.btn-primary:hover { background: var(--accent-light); color: var(--primary-dark); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-outline:hover { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; border-color: #fff; }
.btn-solid { background: var(--primary); color: #fff; }
.btn-solid:hover { background: var(--primary-light); color: #fff; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* ---------- Sections ---------- */
section { padding: 3.5rem 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
section.dark { background: var(--primary-dark); color: #fff; }
section.dark h1, section.dark h2, section.dark h3 { color: #fff; }
section.dark a { color: var(--accent-light); }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2 { margin-bottom: .6rem; }
.section-title p { color: var(--text-secondary); max-width: 680px; margin: 0 auto; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card .icon { font-size: 2.2rem; margin-bottom: .75rem; display: block; }
.card h3 { color: var(--primary-dark); }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- Big numbers (stats) ---------- */
.stat { text-align: center; padding: 1.5rem 1rem; }
.stat .num {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 3.75rem);
  font-weight: 700; color: var(--accent);
  line-height: 1; display: block; margin-bottom: .5rem;
}
.stat .label { color: var(--text); font-weight: 500; font-size: 1rem; }
.stat .small { color: var(--text-secondary); font-size: .9rem; margin-top: .25rem; }

/* variants */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.stats-row.on-dark .stat .num { color: var(--accent-light); }
.stats-row.on-dark .stat .label { color: rgba(255,255,255,0.92); }
.stats-row.on-dark .stat .small { color: rgba(255,255,255,0.7); }

/* ---------- Quote ---------- */
.quote {
  border-left: 4px solid var(--accent);
  padding: .75rem 0 .75rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic; color: var(--text-secondary);
  font-size: 1.1rem;
}
.quote .author { display: block; margin-top: .5rem; color: var(--text); font-size: .95rem; font-style: normal; }
.quote-hero {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  color: var(--primary-dark);
  border-left: 5px solid var(--accent);
  padding: 1rem 1.5rem; background: var(--surface);
  border-radius: var(--radius); margin: 2rem 0;
  font-style: italic;
}
.quote-hero .author { font-size: .95rem; color: var(--text-secondary); display: block; margin-top: .75rem; font-style: normal; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: .95rem;
}
thead th {
  background: var(--primary); color: #fff; font-weight: 600;
  padding: .75rem .9rem; text-align: left; font-family: var(--font-body);
}
tbody td { padding: .7rem .9rem; border-top: 1px solid var(--border); vertical-align: top; }
tbody tr:nth-child(even) { background: #F5F5F0; }
tbody tr:hover { background: #F0EDE5; }

/* ---------- Badges / labels ---------- */
.badge {
  display: inline-block; padding: .2rem .6rem; border-radius: 12px;
  font-size: .8rem; font-weight: 600;
}
.badge-green { background: rgba(76,175,80,.15); color: #2E7D32; }
.badge-orange { background: rgba(255,152,0,.15); color: #E65100; }
.badge-red { background: rgba(229,57,53,.15); color: #B71C1C; }
.badge-gray { background: #E5E2DA; color: var(--text-secondary); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2.2rem; }
.timeline::before {
  content:''; position: absolute; left: .7rem; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
}
.timeline .item { position: relative; margin-bottom: 2rem; }
.timeline .item::before {
  content:''; position: absolute; left: -1.8rem; top: .4rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
}
.timeline .item h3 { color: var(--primary-dark); margin-bottom: .25rem; }
.timeline .item .meta { color: var(--text-secondary); font-size: .85rem; margin-bottom: .5rem; }

/* ---------- Chain/arrow list ---------- */
.chain {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  justify-content: center; margin: 1.5rem 0;
}
.chain .node {
  background: var(--surface); padding: .65rem 1rem;
  border-radius: var(--radius); border: 1px solid var(--border);
  font-weight: 600; text-align: center;
  box-shadow: var(--shadow-sm); min-width: 120px;
  color: var(--text); /* force dark text even inside section.dark */
}
.chain .node .sub { display: block; font-size: .75rem; color: var(--text-secondary); font-weight: 400; margin-top: .15rem; }
.chain .arrow { color: var(--accent); font-weight: 700; font-size: 1.3rem; }

/* force card text color when placed inside a dark section */
section.dark .card { color: var(--text); }
section.dark .card h3 { color: var(--primary-dark); }
section.dark .card p { color: var(--text); }
section.dark .card .muted { color: var(--text-secondary); }
section.dark .card a { color: var(--primary); }

/* ---------- Accordion (for j1.html) ---------- */
.accordion details {
  background: var(--surface); margin-bottom: .75rem;
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.accordion summary {
  padding: 1rem 1.25rem; cursor: pointer; font-weight: 600;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  gap: .75rem;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: '+'; font-size: 1.4rem; color: var(--accent); font-weight: 700; }
.accordion details[open] summary::after { content: '−'; }
.accordion details[open] summary { border-bottom: 1px solid var(--border); }
.accordion .body { padding: 1rem 1.25rem 1.25rem; }
.accordion .sum-title { flex: 1; }
.accordion .sum-pct { font-size: .9rem; font-weight: 700; color: var(--primary); }

/* ---------- Research page TOC ---------- */
.research-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; }
.research-toc {
  position: sticky; top: 90px; align-self: start;
  background: var(--surface); padding: 1.25rem; border-radius: var(--radius);
  border: 1px solid var(--border); font-size: .92rem;
}
.research-toc h4 { margin-bottom: .75rem; font-size: 1rem; }
.research-toc ul { list-style: none; padding: 0; margin: 0; }
.research-toc li { margin-bottom: .4rem; }
.research-toc a { color: var(--text); }
.research-toc a:hover { color: var(--primary); }
.research-content h2 { margin-top: 2.5rem; scroll-margin-top: 80px; }
.research-content h2:first-child { margin-top: 0; }
.research-content h3 { margin-top: 1.75rem; color: var(--primary); }
@media (max-width: 820px) {
  .research-layout { grid-template-columns: 1fr; }
  .research-toc { position: static; }
}

/* ---------- Forms ---------- */
.form-iframe {
  width: 100%; min-height: 820px; border: 0;
  border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--primary-dark); color: rgba(255,255,255,0.85);
  padding: 2.5rem 1.25rem 1.5rem;
  margin-top: 3rem;
}
.footer-inner {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem;
  padding-bottom: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.12);
}
footer.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: .75rem; }
footer.site-footer a { color: rgba(255,255,255,0.85); }
footer.site-footer a:hover { color: var(--accent-light); }
footer.site-footer ul { list-style: none; padding: 0; margin: 0; }
footer.site-footer li { margin-bottom: .4rem; }
.footer-bottom {
  max-width: var(--container); margin: 1rem auto 0;
  font-size: .85rem; color: rgba(255,255,255,0.55);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}

/* ---------- Breadcrumb / page header ---------- */
.page-header {
  background: var(--primary-dark); color: #fff;
  padding: 3rem 1.25rem 2.5rem;
}
.page-header h1 { color: #fff; margin-bottom: .5rem; }
.page-header p { color: rgba(255,255,255,0.85); max-width: 720px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--text-secondary); }
.small { font-size: .9rem; }
.highlight-box {
  background: var(--surface); border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem; border-radius: 4px; margin: 1rem 0;
}
.highlight-box.primary { border-left-color: var(--primary); background: rgba(45,80,22,.05); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }

.callout {
  background: linear-gradient(135deg, rgba(212,168,67,.08), rgba(45,80,22,.06));
  border: 1px solid var(--border);
  padding: 1.5rem; border-radius: var(--radius);
  margin: 1.5rem 0;
}

/* scenarios cards */
.scenario { padding: 1.5rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.scenario.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.scenario h3 { margin-bottom: 1rem; }
.scenario .big { font-size: 2rem; font-weight: 700; color: var(--primary); font-family: var(--font-heading); }
.scenario .delta { font-size: 1.05rem; color: var(--primary-light); font-weight: 600; }

/* screenshot placeholder */
.screenshot-placeholder {
  background: #EEEAE0; border: 2px dashed var(--border); padding: 2.5rem 1rem;
  text-align: center; color: var(--text-secondary); font-style: italic;
  border-radius: var(--radius); margin: 1rem 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); flex-direction: column;
    padding: 1rem 1.25rem; gap: 0;
    box-shadow: var(--shadow); border-top: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: .75rem 0; border-bottom: 1px solid var(--border); min-height: 44px; }
  .nav-burger { display: inline-block; }
  .footer-inner { grid-template-columns: 1fr; }
  section { padding: 2.5rem 0; }
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .btn { width: 100%; text-align: center; }
  .hero .cta { flex-direction: column; }
}
