/* ==========================================================================
   ШУТИС Дижитал Шилжилтийн Алба — Portal & Documentation Theme
   ========================================================================== */

:root {
  --bg: #FFFFFF;
  --surface: #FAFAFB;
  --surface-2: #F1F1F6;
  --ink: #1A1A22;
  --ink-soft: #57576B;
  --line: #E1E1E9;
  --line-strong: #C9C9D6;
  --navy: #08158F;
  --navy-light: rgba(8, 21, 143, 0.08);
  --on-navy: #FFFFFF;
  --gold: #FFC10E;
  --gold-light: rgba(255, 193, 14, 0.15);
  --red-text: #C1121A;
  --ok: #0F7A5A;
  --ok-bg: #E8F5EE;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;

  --serif: "PT Serif", Georgia, serif;
  --sans: "Inter", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  --container: 1160px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--navy);
  text-underline-offset: 3px;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  border-radius: 2px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--sp-4);
  top: var(--sp-4);
  background: var(--navy);
  color: var(--on-navy);
  padding: var(--sp-2) var(--sp-4);
  z-index: 100;
  border-radius: 4px;
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */
header.site {
  border-bottom: 1px solid var(--line);
  background: #FFFFFF;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.hrow {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-3) 0;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 38px;
  width: auto;
  max-width: 230px;
  object-fit: contain;
  display: block;
}

.brand-divider {
  width: 1px;
  height: 26px;
  background: var(--line-strong);
  margin: 0 2px;
}

.brand .bs {
  font-size: 13.5px;
  color: var(--navy);
  letter-spacing: .01em;
  font-weight: 700;
  white-space: nowrap;
}

nav.main {
  display: flex;
  gap: var(--sp-6);
  align-items: center;
  flex-wrap: wrap;
}

nav.main a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  padding: var(--sp-2) 0;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

nav.main a:hover,
nav.main a.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

.hutil {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
}

.search {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 6px var(--sp-3);
  background: var(--surface);
  transition: border-color 0.15s ease;
}

.search:focus-within {
  border-color: var(--navy);
}

.search input {
  border: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  width: 140px;
  outline: none;
}

.search svg {
  flex-shrink: 0;
  opacity: .6;
  color: var(--ink);
}

/* Quick Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-height: 380px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.search-result-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  display: block;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--surface);
  text-decoration: none;
}

.search-result-cat {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 2px;
}

.search-result-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}

.lang {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--navy);
  text-decoration: none;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 6px 10px;
}

.lang:hover {
  background: var(--surface);
  text-decoration: none;
}

.nav-dash-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  background: var(--navy);
  color: var(--on-navy) !important;
  padding: 6px 14px;
  border-radius: 4px;
  text-decoration: none !important;
  border: 1px solid var(--navy);
  transition: all 0.15s ease;
}

.nav-dash-btn:hover {
  background: transparent;
  color: var(--navy) !important;
}

.nav-user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.nav-user-name {
  color: var(--ink-soft);
  font-weight: 600;
}

.nav-logout-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}

.nav-logout-btn:hover {
  color: var(--red-text);
  border-color: var(--red-text);
}

/* ==========================================================================
   HERO / INTRO SECTION
   ========================================================================== */
.intro {
  padding: var(--sp-16) 0 var(--sp-12);
  border-bottom: 1px solid var(--line);
  background: #FFFFFF;
}

.intro .eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: var(--sp-4);
}

.intro h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.28;
  margin-bottom: var(--sp-5);
  color: var(--ink);
}

.intro p {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 var(--sp-8);
  line-height: 1.65;
}

.cta-row {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  padding: 11px var(--sp-6);
  border-radius: 4px;
  border: 2px solid var(--navy);
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn.primary {
  background: var(--navy);
  color: var(--on-navy);
}

.btn.primary:hover {
  background: transparent;
  color: var(--navy);
  text-decoration: none;
}

.btn.ghost {
  background: transparent;
  color: var(--navy);
}

.btn.ghost:hover {
  background: var(--navy);
  color: var(--on-navy);
  text-decoration: none;
}

.btn.gold-accent {
  background: var(--gold);
  border-color: var(--gold);
  color: #1A1A22;
}

.btn.gold-accent:hover {
  background: transparent;
  color: var(--ink);
  text-decoration: none;
}

/* ==========================================================================
   CONTENT BANDS / SECTIONS
   ========================================================================== */
section.band {
  padding: var(--sp-16) 0;
  border-bottom: 1px solid var(--line);
}

.shead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--gold);
  flex-wrap: wrap;
}

.shead h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.shead .more {
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  color: var(--navy);
}

.shead .more:hover {
  text-decoration: underline;
}

/* Guide Tiles Grid */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.tile {
  background: var(--bg);
  padding: var(--sp-6);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-height: 132px;
  transition: background 0.15s ease;
}

.tile:hover {
  background: var(--surface);
  text-decoration: none;
}

.tile .tt {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}

.tile:hover .tt {
  text-decoration: underline;
}

.tile .td {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.tile .tm {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  padding-top: var(--sp-2);
}

/* Events */
.events {
  display: flex;
  flex-direction: column;
}

.ev {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: var(--sp-5);
  align-items: center;
  padding: var(--sp-5) 0;
  border-top: 1px solid var(--line);
}

.ev:last-child {
  border-bottom: 1px solid var(--line);
}

.ev .date {
  text-align: center;
  border-right: 1px solid var(--line);
  padding-right: var(--sp-4);
}

.ev .date .d {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  color: var(--navy);
}

.ev .date .m {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-top: 3px;
}

.ev .body .et {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.ev .body .em {
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  font-family: var(--mono);
}

.ev .act {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--navy);
}

/* News */
.news {
  display: flex;
  flex-direction: column;
}

.nw {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--sp-5);
  padding: var(--sp-4) 0 var(--sp-4) var(--sp-4);
  border-top: 1px solid var(--line);
  border-left: 3px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.nw:last-child {
  border-bottom: 1px solid var(--line);
}

.nw:hover {
  background: var(--surface);
  text-decoration: none;
}

.nw.feat {
  border-left-color: var(--gold);
}

.nw .nd {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}

.nw .nt {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: 2px;
}

.nw:hover .nt {
  text-decoration: underline;
}

.nw .ns {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.nw .tagline {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 3px;
}

/* Cases */
.cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: var(--sp-4);
}

.case {
  border: 1px solid var(--line);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  background: var(--bg);
  transition: all 0.15s ease;
}

.case:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  text-decoration: none;
}

.case .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
}

.case .unit {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.3;
}

.case .ct {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
}

.case:hover .ct {
  text-decoration: underline;
}

.metric {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: var(--sp-3);
  font-family: var(--mono);
  font-size: 12.5px;
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}

.metric .lbl {
  color: var(--ink-soft);
  font-size: 11px;
  width: 100%;
  letter-spacing: .04em;
}

.metric .was {
  color: var(--ink-soft);
  text-decoration: line-through;
}

.metric .arrow {
  color: var(--gold);
  font-weight: 500;
}

.metric .now {
  color: var(--ink);
  font-weight: 600;
}

.pill {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 2px;
  white-space: nowrap;
  text-transform: uppercase;
}

.pill.live {
  background: var(--ok);
  color: #FFFFFF;
}

.pill.pilot {
  background: var(--gold);
  color: #1A1A22;
}

.pill.stop {
  background: transparent;
  color: var(--red-text);
  border: 1px solid currentColor;
}

/* Feedback Banner */
.feedback {
  background: #FFFFFF;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: var(--sp-12) 0;
}

.fb {
  display: flex;
  gap: var(--sp-8);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.fb h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: var(--sp-2);
  color: var(--navy);
}

.fb p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 52ch;
}

.fb .btn-gold {
  background: var(--navy);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 14.5px;
  padding: 12px var(--sp-6);
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  border: 2px solid var(--navy);
  transition: all 0.15s ease;
}

.fb .btn-gold:hover {
  background: transparent;
  color: var(--navy);
}

/* Site Footer */
footer.site {
  padding: var(--sp-12) 0 var(--sp-8);
  font-size: 13.5px;
  color: var(--ink-soft);
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.fgrid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--sp-8);
  margin-bottom: var(--sp-8);
}

footer.site h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink);
  margin-bottom: var(--sp-3);
  font-weight: 800;
}

footer.site ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

footer.site a {
  color: var(--navy);
  text-decoration: none;
}

footer.site a:hover {
  text-decoration: underline;
}

.fbot {
  border-top: 1px solid var(--line);
  padding-top: var(--sp-4);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  font-size: 12.5px;
}

/* ==========================================================================
   ARTICLE / DOCUMENTATION LAYOUT (/news/<slug>/)
   ========================================================================== */
.article-page-wrap {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--sp-8);
  padding: var(--sp-8) 0 var(--sp-16);
  align-items: start;
}

/* Article Sidebar */
.article-sidebar {
  position: sticky;
  top: 80px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: var(--sp-4);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sidebar-back-home {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-group {
  margin-bottom: var(--sp-4);
}

.sidebar-group:last-child {
  margin-bottom: 0;
}

.sidebar-group-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
  margin-bottom: 6px;
  padding: 4px 6px;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-list a {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.sidebar-list a:hover {
  background: var(--surface-2);
  color: var(--navy);
  text-decoration: none;
}

.sidebar-list a.active {
  background: var(--navy);
  color: var(--on-navy);
  font-weight: 700;
}

/* Article Content Body */
.article-main-body {
  min-width: 0;
}

/* Breadcrumbs */
.breadcrumb-nav {
  margin-bottom: var(--sp-4);
}

.breadcrumb-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}

.breadcrumb-nav-list li:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: var(--line-strong);
}

.breadcrumb-nav-list a {
  color: var(--ink-soft);
}

.breadcrumb-nav-list a:hover {
  color: var(--navy);
}

.article-content {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
}

.article-content h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 700;
  line-height: 1.3;
  margin: var(--sp-4) 0 var(--sp-4);
  color: var(--navy);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--gold);
}

.article-content h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin: var(--sp-8) 0 var(--sp-3);
  color: var(--ink);
}

.article-content h3 {
  font-size: 17px;
  font-weight: 700;
  margin: var(--sp-5) 0 var(--sp-2);
  color: var(--ink);
}

.article-content p {
  margin: 0 0 var(--sp-4);
}

.article-content hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: var(--sp-8) 0;
}

.article-content ul,
.article-content ol {
  margin: 0 0 var(--sp-4);
  padding-left: var(--sp-6);
}

.article-content li {
  margin-bottom: var(--sp-2);
}

/* Callouts / Blockquotes */
.article-content blockquote {
  margin: var(--sp-6) 0;
  padding: var(--sp-4) var(--sp-5);
  border-left: 4px solid var(--navy);
  background: var(--surface);
  border-radius: 0 4px 4px 0;
}

.article-content blockquote.note {
  border-left-color: var(--navy);
  background: var(--navy-light);
}

.article-content blockquote.important {
  border-left-color: var(--gold);
  background: var(--gold-light);
}

.article-content blockquote.warning {
  border-left-color: var(--red-text);
  background: rgba(193, 18, 26, 0.08);
}

/* Tables */
.article-content .table-wrapper {
  overflow-x: auto;
  margin: var(--sp-5) 0 var(--sp-6);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  text-align: left;
}

.article-content th {
  background: var(--surface-2);
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
}

.article-content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.article-content tr:last-child td {
  border-bottom: none;
}

/* Checklists */
.article-content .task-list {
  list-style: none;
  padding-left: 0;
}

.article-content .task-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: var(--sp-2);
}

.article-content .task-list-item-checkbox {
  margin-top: 5px;
  accent-color: var(--navy);
  width: 16px;
  height: 16px;
}

/* Code */
.article-content code {
  font-family: var(--mono);
  font-size: 13.5px;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--navy);
}

.article-content pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: var(--sp-4);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
}

.anchor-heading {
  display: none !important;
}

/* Responsive */
@media (max-width: 940px) {
  .hrow {
    flex-wrap: wrap;
    gap: var(--sp-4);
  }

  nav.main {
    order: 3;
    width: 100%;
    gap: var(--sp-5);
    padding-top: var(--sp-2);
    border-top: 1px solid var(--line);
    overflow-x: auto;
  }

  .fgrid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  .article-page-wrap {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 620px) {
  .ev {
    grid-template-columns: 54px 1fr;
  }

  .ev .act {
    grid-column: 2;
    justify-self: start;
  }

  .nw {
    grid-template-columns: 1fr;
    gap: var(--sp-1);
  }

  .nw .nd {
    padding-top: 0;
  }

  section.band {
    padding: var(--sp-12) 0;
  }

  .intro {
    padding: var(--sp-12) 0 var(--sp-10);
  }

  .search input {
    width: 100px;
  }
}