/* MED.mn — нийтийн сайтын загвар. Mobile-first. */

:root {
  /* Брэндийн өнгө — толгой, хөл хэсэг хоёр горимд хоёуланд нь бараан байна. */
  --brand: #19e68c;
  --brand-bg: #03120c;
  --brand-bg-2: #071f16;
  --brand-ink: #eaf4ef;
  --brand-muted: #8fa69b;
  --brand-line: rgba(255, 255, 255, .1);

  --bg: #f3f6f4;
  --surface: #ffffff;
  --ink: #0c1612;
  --muted: #5b6963;
  --line: #dfe6e2;
  --accent: #008552;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(6, 30, 20, .05), 0 6px 20px rgba(6, 30, 20, .06);
  --shadow-lift: 0 2px 4px rgba(6, 30, 20, .06), 0 16px 36px rgba(6, 30, 20, .13);
  --head: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", Arial, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --radius: 12px;
}

[data-theme="dark"] {
  --bg: #06100c;
  --surface: #0d1a15;
  --ink: #e8f1ec;
  --muted: #8fa198;
  --line: #1b2a24;
  --accent: #19e68c;
  --accent-ink: #03120c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lift: 0 0 0 1px rgba(25, 230, 140, .35), 0 16px 36px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  overflow-wrap: break-word;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.25; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: 16px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-bg); padding: 8px 14px; border-radius: 6px; z-index: 100; font-weight: 700; }
.skip:focus { left: 8px; }

/* ---------- Толгой ---------- */

/* display: contents — цэс хуудасны дээд талд наалдаж үлдэхийн тулд. */
#site-header { display: contents; }

.topbar { background: #010906; color: var(--brand-muted); font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 42px; }
.today { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 8px; flex: none; }

.socials { display: flex; gap: 6px; }
.soc, .theme-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--brand-line); background: rgba(255, 255, 255, .04); color: var(--brand-ink); cursor: pointer; padding: 0; transition: background .15s, color .15s, border-color .15s, transform .15s; }
.soc:hover, .theme-btn:hover { transform: translateY(-2px); color: #fff; border-color: transparent; }
.theme-btn:hover { background: var(--brand); color: var(--brand-bg); }
.soc-facebook:hover { background: #1877f2; }
.soc-youtube:hover { background: #ff0033; }
.soc-x:hover { background: #fff; color: #000; }
.soc-instagram:hover { background: linear-gradient(45deg, #f9ce34, #ee2a7b 50%, #6228d7); }

.masthead {
  color: var(--brand-ink);
  background:
    repeating-radial-gradient(circle at 0 130%, transparent 0 139px, rgba(25, 230, 140, .16) 139px 140px),
    repeating-radial-gradient(circle at 100% -40%, transparent 0 89px, rgba(25, 230, 140, .12) 89px 90px),
    radial-gradient(ellipse at 70% 0, var(--brand-bg-2), var(--brand-bg) 70%);
}
.masthead .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding-block: 18px; }

.logo { display: inline-flex; color: #fff; flex: none; }
.logo:hover { color: #fff; }
.logo-svg { display: block; height: 34px; width: auto; }

.tagline { display: none; margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase; color: var(--brand-muted); max-width: 300px; line-height: 1.6; }

.search { display: flex; flex: 1 1 220px; margin-left: auto; max-width: 420px; border: 1px solid var(--brand-line); border-radius: 999px; background: rgba(255, 255, 255, .06); transition: border-color .15s, background .15s; }
.search:focus-within { border-color: var(--brand); background: rgba(255, 255, 255, .1); }
.search input { flex: 1; min-width: 0; padding: 10px 6px 10px 18px; border: 0; background: none; color: #fff; outline: none; }
.search input::placeholder { color: var(--brand-muted); }
.search button { display: grid; place-items: center; width: 44px; border: 0; border-radius: 999px; background: none; color: var(--brand); cursor: pointer; }
.search button:hover { color: #fff; }

.mainnav { position: sticky; top: 0; z-index: 20; background: var(--brand-bg); border-top: 1px solid var(--brand-line); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.mainnav .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.mainnav .wrap::-webkit-scrollbar { display: none; }
.mainnav a { flex: none; position: relative; padding: 14px 14px; font-weight: 600; font-size: 15px; white-space: nowrap; color: var(--brand-ink); opacity: .82; transition: opacity .15s, color .15s; }
.mainnav a::after { content: ""; position: absolute; inset: auto 14px 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); transform: scaleX(0); transition: transform .2s; }
.mainnav a:hover { opacity: 1; color: #fff; }
.mainnav a.active { opacity: 1; color: var(--brand); }
.mainnav a.active::after, .mainnav a:hover::after { transform: scaleX(1); }

/* ---------- Шуурхай мэдээний мөр ---------- */

.ticker { background: var(--surface); border-bottom: 1px solid var(--line); font-size: 14px; }
.ticker .wrap { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.ticker strong { flex: none; display: inline-flex; align-items: center; gap: 7px; background: var(--brand-bg); color: var(--brand); padding: 4px 11px; border-radius: 999px; font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; }
.ticker strong::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.ticker-view { overflow: hidden; flex: 1; min-width: 0; mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ticker-track { display: flex; width: max-content; animation: ticker 45s linear infinite; }
.ticker-track:hover, .ticker-track:focus-within { animation-play-state: paused; }
.ticker-track span { display: flex; flex: none; }
.ticker-track a { padding: 0 22px; white-space: nowrap; position: relative; font-weight: 500; }
.ticker-track a::before { content: ""; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: var(--accent); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Хэсгийн гарчиг, товч ---------- */

main { padding-top: 28px; padding-bottom: 56px; }

.section-title { display: flex; align-items: center; gap: 10px; font-size: 20px; padding-bottom: 12px; margin-bottom: 20px; border-bottom: 2px solid var(--line); position: relative; }
.section-title::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); flex: none; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 72px; height: 2px; background: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 26px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; transition: transform .15s, filter .15s, border-color .15s, color .15s; }
.btn:hover { color: var(--accent-ink); filter: brightness(1.1); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); padding: 8px 16px; font-size: 14px; font-weight: 600; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.btn.more { display: flex; margin: 32px auto 0; }

.tag { display: inline-block; font: 800 11px var(--sans); letter-spacing: .9px; text-transform: uppercase; color: var(--c, var(--accent)); }
[data-theme="dark"] .tag:not(.solid) { color: color-mix(in srgb, var(--c, var(--accent)) 50%, #fff); }
.tag.solid { background: var(--c, var(--accent)); color: #fff; padding: 5px 11px; border-radius: 999px; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); }
.meta > * + *::before { content: "·"; margin-right: 8px; }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty h1 { color: var(--ink); margin-bottom: 8px; }
.empty .btn { margin-top: 16px; }
.list-note { color: var(--muted); margin: -8px 0 16px; font-size: 14px; }

/* ---------- Зураг ---------- */

.media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--line); border-radius: var(--radius); }
.media img, .media .ph { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.ph { display: grid; place-items: center; padding: 8px; text-align: center; color: #fff; font: 800 14px var(--head); letter-spacing: 1px; text-transform: uppercase; background: linear-gradient(135deg, var(--c, #666), color-mix(in srgb, var(--c, #666) 45%, #000)); }
.card:hover .media img, .mini:hover .media img, .hero-main:hover .media img { transform: scale(1.05); }

/* ---------- Онцлох хэсэг ---------- */

.hero { display: grid; gap: 20px; margin-bottom: 44px; }
.hero > * { min-width: 0; }
.hero-main a { position: relative; display: block; border-radius: 16px; overflow: hidden; color: #fff; box-shadow: var(--shadow); }
.hero-main .media { aspect-ratio: 4 / 3; border-radius: 0; }
.hero-text { position: absolute; inset: auto 0 0 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 72px 18px 18px; background: linear-gradient(transparent, rgba(1, 12, 8, .72) 45%, rgba(1, 12, 8, .95)); }
.hero-title { font: 800 22px/1.2 var(--head); letter-spacing: -.01em; text-wrap: balance; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-main a:hover .hero-title { color: var(--brand); }
.hero-excerpt { display: none; font-size: 15px; opacity: .88; max-width: 62ch; }
.hero-side { display: grid; gap: 14px; align-content: start; }
.hero-side .mini { padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, box-shadow .2s; }
.hero-side .mini:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow); }

.mini { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: start; }
.mini .media { border-radius: 8px; aspect-ratio: 4 / 3; }
.mini .ph { font-size: 10px; }
.mini h3 { font-size: 15.5px; font-weight: 700; margin: 2px 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Жагсаалт ---------- */

.layout { display: grid; gap: 44px; }
.layout > * { min-width: 0; }

.grid { display: grid; gap: 24px; }
/* Карт бүхэлдээ дарагдана: гарчгийн холбоосыг картын бүх талбайд сунгана. */
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card .media { border-radius: 0; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.card h3 { font-size: 18px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card .tag { position: relative; z-index: 2; align-self: flex-start; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.card-foot .meta { flex-wrap: nowrap; white-space: nowrap; }
.read-more { flex: none; font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.read-more span { display: inline-block; transition: transform .15s; }
.card:hover .read-more span { transform: translateX(4px); }

/* ---------- Хажуугийн багана ---------- */

.sidebar { display: grid; gap: 28px; align-content: start; }
.sidebar > section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

.popular { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.popular li { counter-increment: n; display: grid; grid-template-columns: 38px 1fr; column-gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.popular li:first-child { padding-top: 0; }
.popular li:last-child { border: 0; padding-bottom: 0; }
.popular li::before { content: counter(n); grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--brand-bg); color: var(--brand); font: 800 17px var(--head); }
.popular a { font: 700 15px/1.35 var(--head); min-height: 2.7em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.popular span { font-size: 13px; color: var(--muted); }

.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-inline: -10px; border-radius: 8px; font-weight: 600; transition: background .15s; }
.cat-list a:hover { background: var(--bg); }
.cat-list i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cat-list span { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 12px; background: var(--bg); border-radius: 999px; padding: 1px 9px; }

.related { display: grid; gap: 16px; }

/* ---------- Мэдээний хуудас ---------- */

.article { max-width: 780px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--accent); font-weight: 700; }
.article > h1 { font-size: clamp(26px, 5vw, 42px); line-height: 1.15; letter-spacing: -.02em; margin-bottom: 16px; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 18px; }
.byline { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--muted); padding: 12px 0; border-block: 1px solid var(--line); margin-bottom: 22px; }
.byline b { color: var(--ink); }
.cover { margin: 0 0 26px; }
.cover img, .cover .ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; }
.draft-note { background: #fff3cd; color: #664d03; padding: 10px 14px; border-radius: 8px; font-weight: 600; }

.article-body { font-size: 18px; line-height: 1.8; }
.article-body > * { margin: 0 0 1.15em; }
.article-body h2 { font-size: 26px; margin-top: 1.6em; }
.article-body h3 { font-size: 21px; margin-top: 1.4em; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body img { border-radius: var(--radius); height: auto; margin-inline: auto; }
.article-body figure { margin-inline: 0; }
.article-body figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 6px; }
.article-body blockquote { margin-inline: 0; padding: 14px 20px; border-left: 4px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; background: color-mix(in srgb, var(--brand) 9%, var(--surface)); font: 600 20px/1.55 var(--head); }
.article-body blockquote p { margin: 0; }
.article-body ul, .article-body ol { padding-left: 1.4em; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 600; }

/* ---------- Хөл ---------- */

#site-footer {
  color: var(--brand-muted);
  padding: 44px 0 22px;
  background:
    repeating-radial-gradient(circle at 100% 140%, transparent 0 119px, rgba(25, 230, 140, .12) 119px 120px),
    var(--brand-bg);
}
#site-footer .wrap { display: grid; gap: 28px; }
#site-footer a:hover { color: var(--brand); }
#site-footer h2 { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--brand); margin-bottom: 14px; }
.foot-brand { display: grid; gap: 14px; justify-items: start; }
.foot-brand .logo-svg { height: 40px; }
.foot-brand p { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; max-width: 30ch; line-height: 1.6; }
.foot-brand .soc { width: 38px; height: 38px; }
#site-footer nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; font-weight: 600; font-size: 15px; color: var(--brand-ink); }
#site-footer .copy { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; border-top: 1px solid var(--brand-line); padding-top: 18px; margin: 0; font-size: 13px; }

/* ---------- Таблет ---------- */

@media (min-width: 640px) {
  .wrap { padding-inline: 24px; }
  .logo-svg { height: 42px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero-side { grid-template-columns: repeat(2, 1fr); }
  .hero-main .media { aspect-ratio: 16 / 9; }
  .hero-text { padding: 96px 28px 26px; }
  .hero-title { font-size: 30px; }
  .hero-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .sidebar { grid-template-columns: repeat(2, 1fr); }
  #site-footer .wrap { grid-template-columns: 1.2fr 1fr; }
  #site-footer .copy { grid-column: 1 / -1; }
}

/* ---------- Компьютер ---------- */

@media (min-width: 1000px) {
  .masthead .wrap { padding-block: 26px; }
  .logo-svg { height: 52px; }
  .tagline { display: block; padding-left: 28px; border-left: 1px solid var(--brand-line); }
  .hero { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
  .hero-main, .hero-main a, .hero-main .media { height: 100%; }
  /* Том мэдээний зураг яг 490px өндөртэй; хажуугийн жижиг мэдээнүүд тэр өндрийг тэнцүү хувааж авна. */
  .hero { grid-template-rows: 490px; }
  .hero-main .media { aspect-ratio: auto; min-height: 0; }
  .hero-title { font-size: 38px; line-height: 1.12; }
  .hero-side { grid-template-columns: 1fr; align-content: stretch; grid-auto-rows: minmax(0, 1fr); min-height: 0; }
  .hero-side .mini { align-items: center; overflow: hidden; padding-block: 6px; }
  .layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 44px; }
  .sidebar { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Нүүр хуудас: баруун багана «Сүүлийн мэдээ»-ний сүүлийн мөртэй нэг шугамд дуусна (өндрийг main.js тохируулна),
     «Их уншсан» самбар үлдсэн зайг дүүргэж, мөрүүд нь жигд тарна. */
  .layout.home { align-items: start; }
  .layout.home .sidebar { display: flex; flex-direction: column; }
  .layout.home .sidebar > section:last-child { flex: 1; display: flex; flex-direction: column; }
  .layout.home .popular { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
  #site-footer nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Дээд мөрийн цаг агаар, ханш ---------- */

.top-info { display: flex; align-items: center; gap: 6px 16px; min-width: 0; }
.chip { white-space: nowrap; }
.chip:empty { display: none; }
.chip b { color: #fff; font-weight: 700; }
.chip + .chip, .today + .chip { padding-left: 16px; border-left: 1px solid var(--brand-line); }

/* ---------- Гар утасны цэс (hamburger) ---------- */

.menu-btn, .nav-head, .nav-search, .nav-foot { display: none; }
.nav-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 6, 4, .65); backdrop-filter: blur(2px); }

@media (max-width: 899px) {
  .topbar .socials, .today { display: none; }
  .today + .chip { padding-left: 0; border-left: 0; }

  .masthead { position: sticky; top: 0; z-index: 20; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
  .masthead .wrap { flex-wrap: nowrap; padding-block: 12px; }
  .head-search { display: none; }

  .menu-btn, .nav-close { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--brand-line); background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer; padding: 0; flex: none; }
  .menu-btn { margin-left: auto; }
  .menu-btn svg, .nav-close svg { width: 24px; height: 24px; }
  .menu-btn:hover, .nav-close:hover { background: var(--brand); color: var(--brand-bg); border-color: transparent; }

  .mainnav { position: fixed; inset: 0 0 0 auto; z-index: 50; width: min(330px, 88vw); display: flex; flex-direction: column; gap: 14px; padding: 16px; overflow-y: auto; overscroll-behavior: contain; border-top: 0; border-left: 1px solid var(--brand-line); box-shadow: -20px 0 50px rgba(0, 0, 0, .45); transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility 0s .25s; }
  .mainnav.open { transform: none; visibility: visible; transition: transform .25s ease; }
  .nav-head { display: flex; align-items: center; justify-content: space-between; color: var(--brand-muted); font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
  .nav-search { display: flex; flex: none; max-width: none; margin: 0; }
  .mainnav .wrap { flex-direction: column; gap: 2px; padding: 0; overflow: visible; }
  .mainnav a { padding: 13px 14px; border-radius: 10px; font-size: 16px; opacity: 1; }
  .mainnav a::after { display: none; }
  .mainnav a:hover { background: rgba(255, 255, 255, .06); }
  .mainnav a.active { background: rgba(25, 230, 140, .13); }
  .nav-foot { display: block; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--brand-line); }
  .nav-foot .soc { width: 40px; height: 40px; }
  body.nav-open { overflow: hidden; }
}

/* ---------- Цаг агаар, ханшийн самбар ---------- */

.w-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.w-head .section-title { flex: 1; }
.w-head select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: 600 13px var(--sans); max-width: 55%; cursor: pointer; }
.w-now { display: flex; align-items: center; gap: 12px; }
.w-emoji { font-size: 44px; line-height: 1; }
.w-temp { font: 800 44px/1 var(--head); letter-spacing: -.03em; }
.w-desc { display: grid; font-size: 13px; color: var(--muted); }
.w-desc b { color: var(--ink); font-size: 15px; }
.w-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 0; }
.w-facts div { background: var(--bg); border-radius: 10px; padding: 8px 4px; text-align: center; }
.w-facts dt { font-size: 11px; color: var(--muted); }
.w-facts dd { margin: 0; font-weight: 700; font-size: 14px; }
.w-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

.rates { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.rates li { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rates li:first-child { padding-top: 0; }
.rates li:last-child { border: 0; }
.r-code { font: 800 12px var(--sans); letter-spacing: .5px; background: var(--brand-bg); color: var(--brand); border-radius: 6px; padding: 4px 0; text-align: center; }
.r-name { color: var(--muted); font-size: 14px; }

/* ---------- Нүүр хуудасны ангиллын хэсгүүд ---------- */

.sections { display: grid; gap: 48px; margin-top: 56px; }
.sections:empty { display: none; }
.cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--line); position: relative; }
.cat-head::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 72px; height: 2px; background: var(--c); }
.cat-head h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.cat-head h2::before { content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--c); }
.see-all { font-weight: 700; font-size: 14px; color: var(--accent); white-space: nowrap; }
.see-all span { display: inline-block; transition: transform .15s; }
.see-all:hover span { transform: translateX(4px); }
.cat-grid { display: grid; gap: 20px; }
.cat-grid > * { min-width: 0; }
.cat-rest { display: grid; gap: 14px; align-content: start; }
.cat-rest .mini { padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, box-shadow .2s; }
.cat-rest .mini:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow); }
.cat-section .tag { display: none; }

@media (min-width: 800px) {
  .cat-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .cat-rest { align-content: stretch; }
  .cat-rest .mini { grid-template-columns: 150px 1fr; align-items: center; }
  .cat-rest .mini h3 { font-size: 17px; }
  .cat-section .card h3 { font-size: 23px; }
}

/* ---------- Видео мэдээ ---------- */

.video-section { --c: var(--brand); margin-top: 56px; padding: 22px 16px; border-radius: 18px; color: var(--brand-ink); background: repeating-radial-gradient(circle at 100% 130%, transparent 0 119px, rgba(25, 230, 140, .1) 119px 120px), var(--brand-bg); }
.video-section .cat-head { border-bottom-color: var(--brand-line); }
.video-section .see-all { color: var(--brand); }
.video-grid { display: grid; gap: 20px; }
.video-grid > * { min-width: 0; }
.video-frame { aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-main h3 { margin-top: 14px; font-size: 19px; color: #fff; }
.video-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; max-height: 420px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.video-list button { display: grid; grid-template-columns: 38px 1fr; gap: 2px 12px; align-items: center; width: 100%; padding: 12px; border: 1px solid var(--brand-line); border-radius: 12px; background: rgba(255, 255, 255, .04); color: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.video-list button:hover { background: rgba(255, 255, 255, .09); }
.video-list button.active { border-color: var(--brand); background: rgba(25, 230, 140, .12); }
.video-play { grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand); }
.video-play::before { content: ""; margin-left: 3px; border-left: 11px solid var(--brand-bg); border-block: 7px solid transparent; }
.video-name { font: 700 15px/1.35 var(--head); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { grid-column: 2; font-size: 12px; color: var(--brand-muted); }

.video-section.page { margin-top: 0; }
.video-section h1 { font-size: 26px; }
.video-section .cat-head a:not(.see-all) { color: inherit; }
.video-count, .video-empty-note { color: var(--brand-muted); font-size: 14px; }
.video-empty-note { margin: 0; padding: 40px 0; text-align: center; }
.video-tiles { display: grid; gap: 22px; }
.video-tile { min-width: 0; display: grid; gap: 8px; align-content: start; }
.video-tile .video-meta { grid-column: auto; }
.video-tile .video-frame { aspect-ratio: auto; height: 480px; }
.video-tile h3 { font-size: 16px; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-section .btn.more { background: var(--brand); border-color: var(--brand); color: var(--brand-bg); }
@media (min-width: 640px) { .video-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .video-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.fb-feed { height: 440px; max-width: 500px; width: 100%; margin-inline: auto; border-radius: 12px; overflow: hidden; background: #fff; }
.fb-feed iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-cta { display: grid; gap: 14px; align-content: center; justify-items: start; }
.video-cta h3 { font-size: 24px; color: #fff; }
.video-cta p { margin: 0; color: var(--brand-muted); max-width: 46ch; }
.video-cta .video-play { width: 56px; height: 56px; }
.video-cta .video-play::before { border-left-width: 16px; border-block-width: 10px; margin-left: 4px; }
.video-links { display: flex; flex-wrap: wrap; gap: 10px; }
.video-links .btn { background: var(--brand); border-color: var(--brand); color: var(--brand-bg); }
.video-links .btn.ghost { background: transparent; border-color: var(--brand-line); color: #fff; padding: 11px 26px; font-size: 16px; font-weight: 700; }
.video-links .btn.ghost:hover { border-color: var(--brand); color: var(--brand); }

@media (min-width: 900px) {
  .video-grid.video-empty { grid-template-columns: 500px minmax(0, 1fr); gap: 40px; }
  .video-section { padding: 28px; }
  .video-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
  .video-list { max-height: none; height: 0; min-height: 100%; }
}

/* ---------- Сурталчилгаа ---------- */

.ad { display: grid; gap: 6px; }
.ad-label { font-size: 10px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); text-align: center; }
.ad a { display: block; border-radius: var(--radius); overflow: hidden; }
.ad img { width: 100%; height: auto; border-radius: var(--radius); }
.ad-ph { display: grid; place-content: center; justify-items: center; gap: 4px; min-height: 100px; padding: 16px; text-align: center; border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius); color: var(--muted); background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--accent) 5%, transparent) 14px 28px), var(--surface); }
.ad-ph b { font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); }
.ad-ph span { font-size: 12px; font-variant-numeric: tabular-nums; }
.ad-top { margin-bottom: 40px; }
.ad-top .ad-ph, .ad-middle .ad-ph { min-height: 110px; }
.ad-sidebar .ad-ph { aspect-ratio: 6 / 5; }
.ad-inner { border-radius: var(--radius); overflow: hidden; }

/* Өндөр баннер: эхлээд дээд хэсэг нь, хулгана очиход доошоо задарч бүтнээрээ харагдана (доорх агуулгыг түлхэхгүй, дээр нь давхарлана). */
.ad.can-expand .ad-box { position: relative; height: var(--ad-h); }
.ad.can-expand .ad-inner { position: absolute; inset: 0 0 auto 0; z-index: 15; height: var(--ad-h); transition: height .45s cubic-bezier(.2, .7, .2, 1), box-shadow .3s; }
.ad.can-expand:hover .ad-inner, .ad.can-expand:focus-within .ad-inner { height: var(--ad-full); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.ad.can-expand .ad-inner::after { content: "▾"; position: absolute; right: 10px; bottom: 8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-bg); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); font-size: 16px; line-height: 1; pointer-events: none; transition: opacity .2s, transform .3s; }
.ad.can-expand:hover .ad-inner::after, .ad.can-expand:focus-within .ad-inner::after { opacity: 0; transform: translateY(6px); }
#ad-top:empty, #ad-sidebar:empty { display: none; }

/* ---------- Дээш буцах товч, уншилтын явц ---------- */

.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 30; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--brand-bg); color: var(--brand); box-shadow: 0 8px 24px rgba(0, 0, 0, .3), 0 0 0 1px rgba(25, 230, 140, .4); cursor: pointer; transition: transform .15s; }
.to-top:hover { transform: translateY(-3px); }
.to-top svg { width: 22px; height: 22px; }

.progress { position: fixed; inset: 0 0 auto 0; z-index: 60; height: 3px; background: var(--brand); transform: scaleX(0); transform-origin: left; }

@media (prefers-reduced-motion: reduce) {
  .mainnav, .mainnav.open { transition: none; }
  .ad.can-expand .ad-inner { transition: none; }
  html { scroll-behavior: auto; }
  .ticker-track, .ticker strong::before { animation: none; }
  .ticker-view { overflow-x: auto; }
  .ticker-track span[aria-hidden] { display: none; }
  .media img, .card, .btn, .soc, .theme-btn { transition: none; }
  .card:hover, .btn:hover, .soc:hover, .theme-btn:hover { transform: none; }
}

@media print {
  #site-header, #site-footer, .sidebar, .share, .ticker, .ad, .video-section { display: none; }
  body { background: #fff; }
}
