*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
i[class*="fa-"] { color: inherit; }

:root {
  --navy:   #031F3E;
  --brown:  #3B0002;
  --red:    #E91518;
  --white:  #FFFFFF;
  --gray:   #F5F5F5;
  --text:   #1A1A1A;
  --muted:  #666;
  --radius: 4px;
  --shadow: 0 4px 24px rgba(3,31,62,.12);

  /* brandbook official aliases */
  --bb-red: #E91518;
  --maroon: #3B0002;
  /* decorative gold (brandbook-д үгүй ч лого/тамгын нийцлээр) */
  --gold:        #C9A24A;
  --gold-light:  #E5C97B;
  --gold-deep:   #8C6A1F;

  /* Хуудасны зайн нэгдсэн стандарт (бүх хуудсанд жигд) */
  --page-max:        1280px;  /* контентын дээд өргөн */
  --page-gutter:     24px;    /* десктоп хажуугийн зай */
  --page-gutter-sm:  20px;    /* мобайл хажуугийн зай */
  --section-y:       72px;    /* section босоо зай */
}

html { scroll-behavior: smooth; }
body { font-family: 'Montserrat', sans-serif; color: var(--text); background: var(--white); }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ───────── SITE HEADER — А хувилбар (лого tier1-д, өндөр) ───────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0,0,0,.14);
}

/* 1-р мөр: Лого + Subdomain холбоосууд */
.tier1 { background: var(--navy); overflow: hidden; }
.tier1-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  height: 44px;
}
.logo-wrap {
  display: flex;
  align-items: center;
  padding-right: 28px;
  border-right: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
  height: 100%;
}
.logo-wrap img { height: 56px; width: auto; }

.subdomains { display: flex; align-items: stretch; flex: 1; height: 100%; }
.subdomains a {
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: rgba(255,255,255,.65);
  text-transform: uppercase;
  border-left: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
  transition: background .2s, color .2s;
  position: relative;
}
.subdomains a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transition: transform .25s;
}
.subdomains a:hover { background: rgba(255,255,255,.16); color: var(--white); }
.subdomains a:hover::after { transform: scaleX(1); }

.tier1-utils {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 24px;
  border-left: 1px solid rgba(255,255,255,.08);
}
.lang-btn {
  border: 1px solid rgba(255,255,255,.28);
  padding: 4px 12px;
  border-radius: 2px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  background: transparent;
  color: rgba(255,255,255,.6);
  font-family: inherit;
  transition: all .2s;
  white-space: nowrap;
}
.lang-btn.active, .lang-btn:hover { background: var(--red); border-color: var(--red); color: var(--white); }
.lang-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ── Google Translate (бусад хэл) topbar widget ── */
/* lang-btn ghost товчнуудтай ижил харагдах нэг pill болгосон */
.gt-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 2px;
  background: transparent;
  color: rgba(255,255,255,.6);
  transition: all .2s;
}
.gt-wrap:hover { background: var(--red); border-color: var(--red); color: var(--white); }
.gt-wrap > i { font-size: .8rem; line-height: 1; }

/* Google gadget-ийн "Powered by", лого, нэмэлт span/img-ийг бүрэн нуух */
#google_translate_element .goog-te-gadget {
  font-size: 0 !important;
  line-height: 0;
  color: transparent;
  margin: 0;
  display: inline-flex;
  align-items: center;
}
#google_translate_element .goog-te-gadget > span,
#google_translate_element .goog-te-gadget img,
#google_translate_element .goog-logo-link { display: none !important; }

/* combo select-ийг тунгалаг ghost болгож, дотор нь custom сум */
#google_translate_element .goog-te-gadget .goog-te-combo {
  font-family: inherit;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: inherit;            /* gt-wrap-аас (цагаан / hover-т улаан) */
  background-color: transparent;
  border: 0;
  margin: 0;
  padding: 0 15px 0 0;
  max-width: 120px;
  line-height: 1.5;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 9px;
}
/* унждаг жагсаалтын мөрүүд (OS popup) уншигдахуйц байх */
#google_translate_element .goog-te-combo option { color: var(--navy); background: #fff; }

/* Google-ийн дээд banner / tooltip-ийг нуух, хуудас доош шилжихээс сэргийлэх */
iframe.goog-te-banner-frame, .goog-te-banner-frame.skiptranslate { display: none !important; }
body { top: 0 !important; }
#goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  color: rgba(255,255,255,.6);
  transition: color .2s;
  padding: 0;
}
.search-btn:hover { color: var(--white); }
.search-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; }

/* 2-р мөр: Үндсэн навигаци */
.tier2 { background: var(--white); border-top: 1px solid rgba(0,0,0,.06); position: relative; }
.tier2-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  height: 76px;
}

.main-nav { display: flex; align-items: stretch; flex: 1; }
.main-nav > ul { display: flex; align-items: stretch; margin: 0; }
.main-nav > ul > li { position: relative; display: flex; align-items: stretch; }
.main-nav > ul > li > a {
  display: flex;
  align-items: center;
  padding: 0 15px;
  font-size: .71rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--navy);
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li:hover > a { color: var(--red); border-bottom-color: var(--red); }

/* Dropdown */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  box-shadow: var(--shadow);
  min-width: 220px;
  padding: 8px 0;
  z-index: 999;
}
.main-nav > ul > li:hover .dropdown { display: block; }
.dropdown a {
  display: block;
  padding: 9px 20px;
  font-size: .76rem;
  color: var(--navy);
  transition: background .15s, color .15s;
}
.dropdown a:hover { background: var(--gray); color: var(--red); }
.dropdown li.dd-group {
  padding: 10px 18px 6px;
  margin-top: 4px;
  border-top: 1px solid rgba(0,0,0,.06);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.dropdown li.dd-group:first-child { border-top: none; margin-top: 0; }
.dropdown li.dd-indent a {
  padding-left: 32px;
  font-size: .74rem;
  position: relative;
}
.dropdown li.dd-indent a::before {
  content: '–';
  position: absolute;
  left: 18px;
  opacity: .45;
}
.dropdown.dd-wide { min-width: 320px; }
.dropdown.dd-2col {
  min-width: 460px;
  columns: 2;
  column-gap: 0;
  padding: 8px 0;
}
.dropdown.dd-2col > li { break-inside: avoid; }

.tier2-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .2s, transform .15s;
  border: none;
  font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: #c81e21; }
.btn-outline { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }


/* Logo — tier2 (цагаан хэсэг) дотор */
.tier2-logo {
  display: flex;
  align-items: center;
  padding-right: 24px;
  border-right: 1px solid rgba(0,0,0,.08);
  flex-shrink: 0;
  height: 100%;
}
.tier2-logo img { height: 54px; width: auto; display: block; }

/* ───────── HERO ───────── */
.hero {
  position: relative;
  height: 620px;
  background: var(--navy);
  overflow: hidden;
  display: flex;
  align-items: center;
}
.hero-bg { position: absolute; inset: 0; }
/* Слайд бүр өөрийн дэвсгэр + агуулгатай; идэвхтэйг нь cross-fade-аар харуулна */
.hero-slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
  z-index: 1;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.hero-slide::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(3,31,62,.92) 0%, rgba(3,31,62,.55) 60%, rgba(3,31,62,.2) 100%);
  z-index: 1;
  pointer-events: none;
}
.hero-slide.active { opacity: 1; z-index: 2; pointer-events: auto; }
.hero-content {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  z-index: 2;
}
.hero-scroll { z-index: 3; }

/* Hero prev/next */
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.35);
  color: var(--white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  transition: background .2s, transform .2s;
  z-index: 4;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.hero-nav:hover { background: rgba(255,255,255,.3); }
.hero-prev { left: 24px; }
.hero-next { right: 24px; }
@media (max-width: 640px) {
  .hero-nav { width: 36px; height: 36px; font-size: .8rem; }
  .hero-prev { left: 10px; }
  .hero-next { right: 10px; }
}
.hero-tag {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 14px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(1.65rem, 3.2vw, 2.4rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  max-width: 600px;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.hero p {
  font-size: 1rem;
  color: rgba(255,255,255,.8);
  max-width: 500px;
  line-height: 1.7;
  margin-bottom: 32px;
}
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.6);
  font-size: .72rem;
  letter-spacing: .08em;
  animation: bounce 2s infinite;
}
.hero-scroll svg { width: 20px; height: 20px; stroke: rgba(255,255,255,.6); fill: none; }
@keyframes bounce { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(6px)} }

/* ───────── QUICK INFO STRIP ───────── */
.quick-info {
  position: relative;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
}
.quick-info::before {
  content: '';
  position: absolute; inset: 0;
  background:
    url('../../pattern/MUSEUM GRAPIC_1.png') left center / contain no-repeat,
    url('../../pattern/MUSEUM GRAPIC_1.png') right center / contain no-repeat;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}
.quick-info-inner {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.qi-item {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-right: 1px solid rgba(255,255,255,.1);
}
.qi-item:last-child { border-right: none; }
.qi-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  background: var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
}
.qi-icon svg { width: 15px; height: 15px; stroke: var(--white); fill: none; }
.qi-label { font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; opacity: .6; margin-bottom: 2px; }
.qi-value { font-size: .8rem; font-weight: 600; line-height: 1.45; }
.qi-value a:hover { color: var(--gold-light); }
.qi-social { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.qi-social .qi-svg { width: 14px; height: 14px; display: block; }
.qi-social a {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.7);
  transition: background .2s, color .2s;
  font-size: .72rem;
}
.qi-social a:hover { background: var(--red); color: var(--white); }

/* ───────── SECTION COMMONS ───────── */
section { padding: var(--section-y) 0; }
.container { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--page-gutter); }
@media (max-width: 768px) { .container { padding: 0 var(--page-gutter-sm); } }
.section-header { text-align: center; margin-bottom: 48px; }
.section-tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 12px;
  overflow-wrap: break-word;
}
.section-desc { font-size: .9rem; color: var(--muted); max-width: 560px; margin: 0 auto; line-height: 1.7; }
.section-line {
  width: 48px; height: 3px;
  background: var(--red);
  margin: 14px auto 0;
}
.view-all {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  color: var(--red);
  background: transparent;
  border: 2px solid var(--red);
  padding: 11px 26px;
  border-radius: 2px;
  text-transform: uppercase;
  margin-top: 36px;
  transition: background .2s, color .2s, gap .2s;
  cursor: pointer;
}
.view-all:hover { background: var(--red); color: var(--white); gap: 12px; }
.view-all i { color: inherit; }
.view-all svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.text-center { text-align: center; }

/* ───────── EXHIBITION ───────── */
.exhibition { background: var(--gray); }
/* Цаг үеийн мэдээ хэсгийн баруун доод буланд барилгын pattern */
#exhibition { position: relative; overflow: hidden; }
#exhibition::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(440px, 42%);
  aspect-ratio: 500 / 300;
  background: url('../img/ckm-building.png') right bottom / contain no-repeat;
  opacity: .13;
  pointer-events: none;
  z-index: 0;
}
#exhibition .container { position: relative; z-index: 1; }
@media (max-width: 700px) { #exhibition::after { display: none; } }
.ex-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 20px;
}
.ex-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--navy);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.ex-card.featured { aspect-ratio: auto; grid-row: 1/3; }
.ex-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s;
}
.ex-card:hover img { transform: scale(1.05); }
.ex-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(3,31,62,.9) 0%, transparent 60%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 24px;
}
.ex-type {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 10px;
  margin-bottom: 8px;
  align-self: flex-start;
}
.ex-title { font-size: 1.1rem; font-weight: 700; color: var(--white); line-height: 1.3; margin-bottom: 6px; }
.ex-card.featured .ex-title { font-size: 1.5rem; }
.ex-desc { font-size: .92rem; color: rgba(255,255,255,.85); line-height: 1.55; margin-bottom: 10px; max-width: 520px; }
.ex-date { font-size: .72rem; color: rgba(255,255,255,.65); }
.ex-date i { margin-right: 4px; }
.ex-date .sep { margin: 0 8px; opacity: .5; }

/* ───────── NEWS ───────── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.news-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  transition: transform .25s, box-shadow .25s;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.news-img { aspect-ratio: 16/9; overflow: hidden; }
.news-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.news-card:hover .news-img img { transform: scale(1.05); }
.news-body { padding: 20px; }
.news-cat {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--red); margin-bottom: 8px;
}
.news-title { font-size: .92rem; font-weight: 700; color: var(--navy); line-height: 1.45; margin-bottom: 10px; }
.news-meta { font-size: .72rem; color: var(--muted); display: flex; gap: 14px; }

/* ───────── DIGITAL COLLECTION ───────── */
.collection {
  position: relative;
  overflow: hidden;
  background:
    url('../img/tamga-tod-white.png') right center / auto 100% no-repeat,
    var(--navy);
}
/* Зүүн талын дэвсгэр — баруунтай ижил зураг, 180° эргүүлсэн.
   Зургийн харьцаагаар (960:3524) box-ыг өндрөөс нь тооцож зүүн ирмэгт бэхэлсэн тул
   эргүүлэхэд байрнаасаа хөдлөхгүй. */
.collection::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  aspect-ratio: 960 / 3524;
  background: url('../img/tamga-tod-white.png') center / cover no-repeat;
  transform: rotate(180deg);
  z-index: 0;
  pointer-events: none;
}
/* navy overlay — зүүн (::before) ба баруун (фон) дэвсгэрийг ижил түвшинд бүдгэрүүлнэ */
.collection::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(3,31,62,.7);
  z-index: 0;
  pointer-events: none;
}
.collection .container { position: relative; z-index: 1; }
@media (max-width: 1000px) {
  .collection { background: var(--navy); }
  .collection::before, .collection::after { display: none; }
}
.collection .section-title { color: var(--white); }
.collection .section-desc { color: rgba(255,255,255,.65); }
.coll-cats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.coll-cat {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.coll-cat:hover { background: rgba(233,21,24,.2); border-color: var(--red); }
.coll-cat-icon { font-size: 2.2rem; margin-bottom: 10px; color: #fff; }
.coll-cat-icon i { color: #fff; }
.coll-cat-icon .coll-svg { width: 40px; height: 40px; display: inline-block; color: #fff;
  transition: transform .2s, color .2s; }
/* Админаас upload хийсэн inline SVG icon (currentColor → цагаан) */
.coll-cat-icon svg { width: 40px; height: 40px; display: inline-block; color: #fff;
  transition: transform .2s, color .2s; }
.coll-cat:hover .coll-svg,
.coll-cat:hover .coll-cat-icon svg { transform: scale(1.08); color: var(--gold-light); }
.coll-cat-name { font-size: .72rem; font-weight: 600; color: rgba(255,255,255,.85); }
/* "Бүгдийг үзэх" — тусдаа товч, search-ийн дээр голлуулсан */
.coll-all {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.coll-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 30px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  background: rgba(255,255,255,.07);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .02em;
  transition: background .2s, border-color .2s, color .2s;
}
.coll-all-btn:hover {
  background: rgba(233,21,24,.2);
  border-color: var(--red);
}
.coll-search {
  display: flex;
  max-width: 540px;
  margin: 0 auto;
}
.coll-search input {
  flex: 1;
  padding: 12px 18px;
  font-size: .88rem;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  outline: none;
  font-family: inherit;
}
.coll-search button {
  padding: 12px 22px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .06em;
  font-family: inherit;
  transition: background .2s;
}
.coll-search button:hover { background: #c81e21; }

/* ───────── EDUCATION ───────── */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.edu-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #e8e8e8;
  transition: box-shadow .25s, transform .25s;
}
.edu-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.edu-head {
  background: var(--navy);
  background-size: cover;
  background-position: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.edu-head-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(3,31,62,.25) 0%, rgba(3,31,62,.85) 100%);
  z-index: 0;
}
.edu-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
/* Бүх icon-ийг ижил дөрвөлжин хайрцагт төвлөрүүлж жигдэлсэн (артворк харьцаа өөр ч хайрцаг нь жигд) */
.edu-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(2px);
  color: #fff;
}
.edu-icon i { color: #fff; font-size: 1.35rem; line-height: 1; }
/* Админаас upload хийсэн inline SVG icon (navy edu-head дээр цагаан) — хайрцагт багтаж, харьцаагаа хадгалж төвлөрнө */
.edu-icon svg {
  display: block;
  width: 28px;
  height: 28px;
  max-width: 100%;
  max-height: 100%;
  color: #fff;
}
.edu-head-title { font-size: 1.05rem; font-weight: 700; color: var(--white); position: relative; z-index: 1; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.edu-body { padding: 20px 24px; }
.edu-desc { font-size: .82rem; color: var(--muted); line-height: 1.65; margin-bottom: 16px; }
.edu-link {
  font-size: .75rem; font-weight: 700; letter-spacing: .06em;
  color: var(--red); text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px;
}
.edu-link svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }

/* ───────── SHOP ───────── */
.shop { background: var(--gray); }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.shop-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  transition: box-shadow .25s, transform .25s;
  cursor: pointer;
}
.shop-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.shop-img { aspect-ratio: 1; overflow: hidden; background: #f0f0f0; }
.shop-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.shop-card:hover .shop-img img { transform: scale(1.08); }
.shop-info { padding: 16px; }
.shop-cat { font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); margin-bottom: 4px; }
.shop-name { font-size: .88rem; font-weight: 600; color: var(--navy); }

/* ───────── TOURISM ───────── */
.tourism-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.tour-card {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 3/4;
  cursor: pointer;
}
.tour-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.tour-card:hover img { transform: scale(1.07); }
.tour-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(3,31,62,.85) 0%, transparent 55%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px;
}
.tour-title { font-size: .95rem; font-weight: 700; color: var(--white); line-height: 1.3; }

/* ───────── PHOTO GALLERY ───────── */
.gallery-section { background: none; padding: 0; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0;
}
.gallery-item { cursor: pointer; }
.gallery-item-media {
  aspect-ratio: 1/1;
  overflow: hidden;
  position: relative;
}
.g-cap { display: none; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; display: block; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item .g-overlay {
  position: absolute; inset: 0;
  background: rgba(3,31,62,.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .3s;
}
.gallery-item:hover .g-overlay { opacity: 1; }
.gallery-item .g-overlay i { font-size: 1.8rem; color: #fff; }
/* Lightbox */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.93); z-index: 9999;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-img { max-width: 88vw; max-height: 82vh; object-fit: contain; border-radius: 3px; }
.lb-close {
  position: absolute; top: 18px; right: 22px;
  background: rgba(255,255,255,.12); border: none; cursor: pointer;
  color: #fff; font-size: 1.5rem; width: 42px; height: 42px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lb-close:hover { background: var(--red); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.12); border: none; cursor: pointer;
  color: #fff; font-size: 1.2rem; padding: 14px 16px;
  border-radius: 3px; transition: background .2s;
}
.lb-nav:hover { background: rgba(255,255,255,.25); }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-caption {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.65); font-size: .82rem; white-space: nowrap;
  max-width: 90vw; padding: 0 12px; overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}
.lb-counter {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.5); font-size: .8rem;
}

/* ───────── YOUTUBE SECTION ───────── */
.yt-section {
  background: var(--gray);
  padding: 32px 0 70px;
}
.yt-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.yt-brand { display: flex; align-items: center; gap: 12px; }
.yt-brand > i { color: #FF0000 !important; font-size: 1.8rem; }
.yt-brand-text { display: flex; flex-direction: column; }
.yt-brand-text strong { color: var(--navy); font-size: 1rem; font-weight: 700; line-height: 1.2; }
.yt-brand-text span { color: var(--muted); font-size: .75rem; }
.yt-subscribe {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--red); color: #fff; font-weight: 700; font-size: .8rem;
  padding: 8px 18px; border-radius: 20px; text-decoration: none;
  transition: background .2s;
}
.yt-subscribe i { color: #fff !important; }
.yt-subscribe:hover { background: var(--navy); }
.yt-subscribe:hover i { color: #FF0000 !important; }
/* One-row embed layout */
.yt-row {
  display: flex;
  gap: 8px;
  height: 248px;
}
.yt-embed {
  border-radius: 8px;
  overflow: hidden;
  background: #ccc;
  flex-shrink: 0;
}
.yt-embed.is-video { flex: 3; }
.yt-embed.is-short { flex: 1; }
.yt-embed iframe {
  width: 100%; height: 100%;
  border: none; display: block;
}
@media (max-width: 860px) { .yt-row { height: 180px; } }
@media (max-width: 600px) {
  .yt-row { height: auto; flex-wrap: wrap; }
  .yt-embed.is-video { flex: 0 0 100%; aspect-ratio: 16/9; }
  .yt-embed.is-short { flex: 0 0 calc(33.33% - 6px); aspect-ratio: 9/16; }
}

/* ───────── FOOTER ───────── */
footer { background: var(--navy); color: rgba(255,255,255,.75); }
.footer-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 24px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand img { height: 60px; width: auto; margin-bottom: 16px; }
.footer-brand p { font-size: .8rem; line-height: 1.7; max-width: 280px; margin-bottom: 20px; }
.footer-socials { display: flex; gap: 10px; }
.f-social {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.f-social:hover { background: var(--red); }
.f-social svg { width: 16px; height: 16px; fill: var(--white); }
.footer-brand-links { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.footer-brand-links a {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem;
  color: rgba(255,255,255,.7);
  transition: color .2s;
}
.footer-brand-links a:hover { color: var(--red); }
.footer-brand-links i { color: inherit; width: 14px; text-align: center; }
.footer-col h4 {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a {
  font-size: .78rem;
  color: rgba(255,255,255,.65);
  transition: color .2s;
}
.footer-col ul li a:hover { color: var(--red); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 24px;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .72rem;
  color: rgba(255,255,255,.45);
}
.footer-bottom a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color .2s;
}
.footer-bottom a:hover { color: #fff; }

/* ───────── MOBILE MENU TOGGLE ───────── */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.burger span { display: block; width: 24px; height: 2px; background: var(--navy); border-radius: 2px; }

/* ───────── SCROLL SHRINK ───────── */
.tier1-inner { transition: height .25s ease, opacity .2s ease; }
.tier2-inner { transition: height .25s ease; }
.tier2-logo img { transition: height .25s ease; }

.site-header.scrolled .tier1-inner {
  height: 0;
  opacity: 0;
}
.site-header.scrolled .tier2-inner {
  height: 52px;
}
.site-header.scrolled .tier2-logo img {
  height: 38px;
}

/* ───────── RESPONSIVE ───────── */
@media (max-width: 1280px) {
  .header-tamga { display: none; }
}
@media (max-width: 1200px) {
  .subdomains a { padding: 0 13px; font-size: .62rem; }
  .main-nav > ul > li > a { padding: 0 11px; font-size: .66rem; }
}

@media (max-width: 1100px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}

.mobile-subsites { display: none; }

@media (max-width: 960px) {
  .subdomains { display: none; }
  .burger { display: flex; }
  .main-nav { display: none; }
  /* tier2-г mobile-д багтаах: logo + Тасалбар + burger нэг мөрөнд */
  .tier2-inner { padding: 0 var(--page-gutter-sm, 20px); height: 64px; gap: 10px; }
  .tier2-logo img { height: 42px; }
  .tier2-actions { gap: 8px; }
  .tier2-actions .btn-primary { padding: 9px 14px; font-size: .72rem; }
  /* Burger дарахад нээгдэх mobile цэс (header.js .is-open toggle) */
  .main-nav.is-open {
    display: block;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    padding: 8px 0 16px;
    box-shadow: 0 12px 28px rgba(0,0,0,.16);
    z-index: 998;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
  .main-nav.is-open > ul { flex-direction: column; align-items: stretch; }
  .main-nav.is-open > ul > li { display: block; }
  .main-nav.is-open > ul > li > a {
    padding: 13px 24px; border-bottom: 1px solid rgba(0,0,0,.06);
    border-left: 3px solid transparent;
  }
  .main-nav.is-open > ul > li > a:hover { border-bottom-color: rgba(0,0,0,.06); border-left-color: var(--red); }
  /* Дэд цэсүүдийг mobile-д харуулахгүй (tap → :hover-ийг ч дарна) */
  .main-nav.is-open .dropdown,
  .main-nav.is-open > ul > li:hover .dropdown { display: none !important; }
  /* Дэд сайтын линкүүд — mobile цэсний хамгийн дээд хэсэгт компакт chip */
  .main-nav.is-open .mobile-subsites {
    display: block;
    padding: 4px 24px 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,.1);
  }
  .mobile-subsites-label {
    display: block; font-size: .62rem; font-weight: 800; letter-spacing: .14em;
    text-transform: uppercase; color: #999; margin-bottom: 11px;
  }
  .mobile-subsites-links { display: flex; flex-wrap: wrap; gap: 8px; }
  .mobile-subsites-links a {
    font-size: .74rem; font-weight: 600; color: var(--navy);
    background: var(--gray, #f3f1ea); border: 1px solid rgba(0,0,0,.08);
    padding: 8px 14px; border-radius: 999px; transition: background .2s, color .2s, border-color .2s;
  }
  .mobile-subsites-links a:hover { background: var(--red); color: #fff; border-color: var(--red); }
  .ex-grid { grid-template-columns: 1fr 1fr; }
  .ex-card.featured { grid-column: 1/3; grid-row: auto; aspect-ratio: 16/7; }
  .coll-cats { grid-template-columns: repeat(4, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  /* Hero доорх 3 багана — mobile дээр хэвтээ swipe slider */
  .quick-info-inner {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 16px;
    gap: 10px;
  }
  .quick-info-inner::-webkit-scrollbar { display: none; }
  .qi-item {
    flex: 0 0 82%;
    scroll-snap-align: center;
    border-right: none;
    border-bottom: none;
    justify-content: center;
    background: rgba(255,255,255,.05);
    border-radius: 10px;
  }
  .news-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .tourism-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2rem; }
  .coll-cats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  /* Нарийн дэлгэцэд "Тасалбар"-ыг зөвхөн icon болгож burger-т зай гаргана */
  .tier2-logo img { height: 38px; }
  .tier2-actions .btn-primary { font-size: 0 !important; padding: 10px 12px; gap: 0; }
  .tier2-actions .btn-primary i { font-size: 1rem !important; }
}

@media (max-width: 540px) {
  /* slider хэвээр — нарийн дэлгэцэд slide арай өргөн (дараагийнх бага зэрэг харагдана) */
  .qi-item { flex: 0 0 86%; }
  .shop-grid { grid-template-columns: 1fr; }
  .tourism-grid { grid-template-columns: 1fr; }
  .coll-cats { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px 24px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* Зургийн цомог — гар утсан дээр хэвтээ свайп слайдер */
@media (max-width: 640px) {
  .gallery-grid {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 8px;
    padding: 0 16px 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .gallery-grid::-webkit-scrollbar { display: none; }
  .gallery-item {
    flex: 0 0 82%;
    scroll-snap-align: center;
  }
  .gallery-item-media { border-radius: 10px; }
  .g-cap {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
    color: var(--navy);
    padding: 8px 6px 0;
  }
}

/* ───────── Хайлтын popup (бүх хуудсанд) ───────── */
.site-search-modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(3,31,62,.75);
  backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 14vh 20px 20px;
}
.site-search-modal.open { display: flex; }
.site-search-box {
  background: var(--white); width: 100%; max-width: 640px;
  border-radius: 8px; padding: 32px 28px 26px; position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: ssm-in .2s ease;
}
@keyframes ssm-in { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
.site-search-close {
  position: absolute; top: 14px; right: 14px; width: 38px; height: 38px;
  border: none; background: var(--gray); color: var(--navy);
  border-radius: 50%; cursor: pointer; font-size: 1rem; transition: background .2s, color .2s;
}
.site-search-close:hover { background: var(--red); color: #fff; }
.site-search-title {
  font-size: 1.4rem; color: var(--navy); margin-bottom: 18px; font-weight: 800;
}
.site-search-form {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--navy); border-radius: 6px; padding: 4px 4px 4px 16px;
}
.site-search-form:focus-within { border-color: var(--red); }
.site-search-ico { color: var(--muted); font-size: 1.05rem; }
.site-search-form input {
  flex: 1; border: none; outline: none; font-size: 1.05rem;
  font-family: inherit; color: var(--text); padding: 12px 4px; background: none;
}
.site-search-submit {
  border: none; background: var(--red); color: #fff; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: .9rem;
  padding: 12px 24px; border-radius: 4px; transition: background .2s;
}
.site-search-submit:hover { background: #c81e21; }
.site-search-hint { margin-top: 12px; font-size: .8rem; color: var(--muted); }
@media (max-width: 600px) {
  .site-search-modal { padding: 8vh 14px 14px; }
  .site-search-submit { padding: 12px 16px; }
}
