/* ============================
   KHURAL.MN — submain overrides
   - Switch all fonts to SF Pro Display
   - Uppercase + condensed menu items
   - Loaded LAST so it wins any specificity
   ============================ */

/* Force all text to SF Pro Display */
html, body,
h1, h2, h3, h4, h5, h6,
p, a, span, button, input, select, textarea, label,
.logo-title, .logo-sub,
.hero-tag, .hero h1, .hero p,
.section-head h2, .section-head h3,
.article-title, .article-meta-row,
.news-card h3, .news-card p,
.docs-table th, .docs-table td,
.rep-card h3, .rep-card p,
.chairman-info h3, .chairman-info p,
.panel-head h3,
.breadcrumb, .breadcrumb a,
.page-header h1, .page-header p,
.footer-grid h4, .footer-grid li, .footer-grid a,
.btn,
.tag,
.prose, .prose p, .prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6, .prose li, .prose ol, .prose ul,
.sub-prose, .sub-prose *,
.eyebrow,
.service-info h4, .service-info p,
.stat-num, .stat-label,
.session-info h4, .session-info p,
.sidebar-card h4, .sidebar-card a, .sidebar-card li,
.tab, .tab-head button,
.filter-bar input, .filter-bar select,
.form-field label, .form-field input, .form-field textarea, .form-field select,
.search-panel input,
.top-bar, .top-bar span, .top-bar a,
.main-nav li a,
.dropdown li a {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
}

/* Global token override — anything using CSS var fonts gets SF Pro Display */
:root {
    --ff-sans:    "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    --ff-serif:   "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    --ff-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    --ff-mono:    "SF Mono", Menlo, Monaco, Consolas, monospace !important;
}

/* ============ Menu items — UPPERCASE + SF Pro Display + CENTERED ============ */
.main-nav,
.main-nav ul,
.main-nav li,
.main-nav li a,
.main-nav .dropdown,
.main-nav .dropdown li,
.main-nav .dropdown li a {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
}
.main-nav > ul > li > a {
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-align: center !important;
    justify-content: center !important;
}

/* Dropdown menu items — also UPPERCASE for consistency */
.main-nav .dropdown li a {
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    font-weight: 500 !important;
    font-size: 0.82rem !important;
    text-align: left !important;
    justify-content: flex-start !important;
}

/* Section heads also condensed uppercase for institutional feel */
.section-head h2,
.panel-head h3 {
    letter-spacing: 0.01em;
}

/* Logo title stays uppercase (it already is) but condensed */
.logo-title {
    letter-spacing: 0.08em !important;
    font-weight: 700 !important;
}

/* Hero headline tightens with condensed font */
.hero h1,
.page-header h1,
.article-title {
    letter-spacing: -0.005em !important;
    font-weight: 700 !important;
}

/* Hero title — хэт том бичвэрийг зогсоох + урт гарчигт 3 мөр limit */
.hero-content h1 {
    font-size: clamp(1.3rem, 2.3vw, 2rem) !important;
    line-height: 1.2 !important;
    margin-bottom: 14px !important;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}
.hero-content h1 a {
    color: inherit;
    text-decoration: none;
    transition: opacity .15s ease;
}
.hero-content h1 a:hover { opacity: .9; }

.hero-content p {
    font-size: 0.95rem !important;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Eyebrow + tags keep letterspacing */
.eyebrow,
.hero-tag,
.tag {
    letter-spacing: 0.08em !important;
    font-weight: 600 !important;
}

/* ============================
   Right-fixed menu — Сумд / Дүүргүүд sites switcher
   ============================ */
.right-fixed-menu {
    position: fixed;
    right: 0;
    top: 40vh;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 90;
}
.rfm-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 10px;
    min-width: 76px;
    background: var(--brand, #0b3d91);
    color: #fff;
    border: none;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.2s ease-out;
    box-shadow: -2px 4px 14px rgba(11,61,145,.25);
}
.rfm-item + .rfm-item { margin-top: 4px; }
.rfm-item:hover,
.rfm-item.is-open {
    background: linear-gradient(135deg, var(--accent, #c9a227), var(--accent-warm, #e0b83a));
    color: var(--brand-dark, #061b45);
    transform: translateX(-4px);
}
.rfm-icon { font-size: 1.1rem; }
.rfm-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.rfm-count {
    background: rgba(255,255,255,.2);
    color: inherit;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    min-width: 24px;
    text-align: center;
}
.rfm-item.is-open .rfm-count,
.rfm-item:hover .rfm-count { background: rgba(0,0,0,.12); }

@media (max-width: 720px) {
    .right-fixed-menu {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        flex-direction: row;
        justify-content: space-around;
        background: var(--brand, #0b3d91);
        padding: 8px;
        gap: 8px;
        box-shadow: 0 -4px 20px rgba(0,0,0,.2);
    }
    .rfm-item {
        flex: 1;
        min-width: 0;
        padding: 10px 6px;
        border-radius: 10px;
        box-shadow: none;
        background: transparent;
    }
    .rfm-item + .rfm-item { margin-top: 0; }
    .rfm-label { font-size: 0.68rem; }
}

/* Floating geo panels */
.geo-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6,27,69,.6);
    z-index: 115;
    display: none;
}
.geo-panel-overlay.is-visible { display: block; }

.geo-panel.floating {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(820px, calc(100vw - 32px));
    max-height: calc(100vh - 80px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0,0,0,.4);
    z-index: 120;
    overflow: hidden;
    flex-direction: column;
    padding: 0;
    display: none;
}
.geo-panel.floating:not([hidden]) { display: flex; }

.geo-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line, #e5e7eb);
    background: linear-gradient(90deg, var(--brand-dark, #061b45), var(--brand, #0b3d91));
    color: #fff;
}
.geo-panel-head h3 {
    font-size: 1.1rem;
    margin: 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.geo-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: 0.15s ease-out;
}
.geo-close:hover { background: var(--accent, #c9a227); color: var(--brand-dark, #061b45); }

.geo-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
    padding: 24px;
    overflow-y: auto;
}
.geo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-soft, #f7f8fb);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text, #1a1f2e);
    transition: 0.15s ease-out;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.geo-item i { color: var(--muted, #6b7280); transition: 0.15s ease-out; }
.geo-item:hover {
    background: linear-gradient(135deg, var(--brand, #0b3d91), var(--brand-light, #1a5fb4));
    color: #fff;
    transform: translateX(2px);
}
.geo-item:hover i { color: #fff; transform: translateX(2px); }

@media (max-width: 720px) {
    .geo-panel-grid { grid-template-columns: 1fr 1fr; padding: 16px; }
    .geo-panel.floating { width: calc(100vw - 20px); }
}

/* ============================
   .prose / .sub-prose — article body (news / forum / togtool / CV detail)
   Aggressive reset to neutralize MS Word / Google Docs inline styles pasted
   from Office into content.body. Content typically ships with inline
   font-family / font-size / color / background that break the design.
   ============================ */

.prose,
.sub-prose {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    font-size: 1rem !important;
    line-height: 1.75 !important;
    color: var(--text, #1a1f2e) !important;
}

/* Force all children (Word <span style>, <font>, nested divs) to theme styles */
.prose *,
.prose p *,
.prose div *,
.prose span,
.prose font,
.sub-prose *,
.sub-prose p *,
.sub-prose div *,
.sub-prose span,
.sub-prose font {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    color: inherit !important;
    background-color: transparent !important;
    letter-spacing: normal !important;
}

/* Paragraphs — enforce our rhythm */
.prose p,
.prose div[style],
.prose div > span,
.sub-prose p,
.sub-prose div[style],
.sub-prose div > span {
    font-size: 1rem !important;
    line-height: 1.75 !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    text-indent: 0 !important;
}

/* Headings in article body — SF Pro Display + brand color */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6,
.sub-prose h1, .sub-prose h2, .sub-prose h3, .sub-prose h4, .sub-prose h5, .sub-prose h6 {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    color: var(--brand, #0b3d91) !important;
    margin: 28px 0 10px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.prose h1, .sub-prose h1 { font-size: 1.75rem !important; }
.prose h2, .sub-prose h2 { font-size: 1.4rem !important; }
.prose h3, .sub-prose h3 { font-size: 1.2rem !important; }
.prose h4, .sub-prose h4,
.prose h5, .sub-prose h5,
.prose h6, .sub-prose h6 { font-size: 1.05rem !important; }

/* Emphasis */
.prose strong, .prose b,
.sub-prose strong, .sub-prose b {
    font-weight: 700 !important;
    color: inherit !important;
}
.prose em, .prose i,
.sub-prose em, .sub-prose i {
    font-style: italic;
    color: inherit !important;
}

/* Lists */
.prose ul, .prose ol,
.sub-prose ul, .sub-prose ol {
    margin: 0 0 16px 24px !important;
    padding: 0 !important;
}
.prose li,
.sub-prose li {
    margin-bottom: 8px !important;
    line-height: 1.75 !important;
    font-size: 1rem !important;
}
.prose ul li, .sub-prose ul li { list-style: disc !important; }
.prose ol li, .sub-prose ol li { list-style: decimal !important; }

/* Links */
.prose a,
.sub-prose a {
    color: var(--brand, #0b3d91) !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}
.prose a:hover,
.sub-prose a:hover {
    color: var(--brand-light, #1a5fb4) !important;
}

/* Images — responsive + subtle border */
.prose img,
.sub-prose img {
    max-width: 100% !important;
    height: auto !important;
    margin: 16px 0 !important;
    border: 1px solid var(--line, #e5e7eb) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    display: block;
}

/* Blockquote */
.prose blockquote,
.sub-prose blockquote {
    border-left: 4px solid var(--brand, #0b3d91) !important;
    padding: 12px 20px !important;
    margin: 20px 0 !important;
    background: var(--bg-soft, #f7f8fb) !important;
    color: var(--muted, #6b7280) !important;
    font-style: italic;
    border-radius: 0 10px 10px 0;
}

/* Tables — clean rows */
.prose table,
.sub-prose table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 16px 0 !important;
    font-size: 0.95rem !important;
    background: transparent !important;
}
.prose th, .prose td,
.sub-prose th, .sub-prose td {
    border: 1px solid var(--line, #e5e7eb) !important;
    padding: 10px 12px !important;
    text-align: left !important;
    background: transparent !important;
}
.prose th,
.sub-prose th {
    background: var(--bg-soft, #f7f8fb) !important;
    font-weight: 700 !important;
    color: var(--brand, #0b3d91) !important;
}

/* Word/Docs noise classes — neutralize */
.prose .MsoNormal,
.prose .MsoListParagraph,
.prose .MsoListParagraphCxSpFirst,
.prose .MsoListParagraphCxSpMiddle,
.prose .MsoListParagraphCxSpLast,
.sub-prose .MsoNormal,
.sub-prose .MsoListParagraph,
.sub-prose .MsoListParagraphCxSpFirst,
.sub-prose .MsoListParagraphCxSpMiddle,
.sub-prose .MsoListParagraphCxSpLast {
    margin: 0 0 16px !important;
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    font-size: 1rem !important;
    color: inherit !important;
    background: transparent !important;
}
.prose o\:p,
.sub-prose o\:p { display: none !important; }

/* Kill inline backgrounds/colors/fonts from Word */
.prose [style*="background"],
.prose [style*="font-family"],
.prose [style*="font-size"],
.prose [style*="color"],
.sub-prose [style*="background"],
.sub-prose [style*="font-family"],
.sub-prose [style*="font-size"],
.sub-prose [style*="color"] {
    background-color: transparent !important;
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    color: inherit !important;
}

/* Horizontal rule */
.prose hr,
.sub-prose hr {
    border: 0 !important;
    border-top: 1px solid var(--line, #e5e7eb) !important;
    margin: 24px 0 !important;
}

/* ============================
   CV / rep card — 4-per-row + portrait 3:4 photo
   ============================ */
.rep-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 18px !important;
}
.rep-card {
    background: #fff;
    border: 1px solid var(--line, #e5e7eb) !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    text-decoration: none;
    color: inherit;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 2px 8px rgba(15,23,42,.04);
    transition: all 0.2s ease-out;
}
.rep-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(15,23,42,.1);
    border-color: var(--brand, #0b3d91) !important;
}
.rep-photo {
    aspect-ratio: 3/4 !important;           /* portrait */
    height: auto !important;
    background-size: cover !important;
    background-position: center top !important;
    background-color: var(--bg-soft, #f7f8fb);
    background-image: linear-gradient(135deg, var(--brand, #0b3d91), var(--brand-light, #1a5fb4));
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.35);
    font-size: 3.2rem;
    position: relative;
}
.rep-info {
    padding: 14px 16px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rep-info h3 {
    font-size: 1rem !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    font-weight: 700 !important;
    color: var(--text, #1a1f2e);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.rep-info .rep-role {
    color: var(--muted, #6b7280);
    font-size: 0.78rem !important;
    line-height: 1.4;
    margin: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.rep-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 0.72rem;
    color: var(--muted, #6b7280);
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--line, #e5e7eb);
}
.rep-meta i { color: var(--brand, #0b3d91); margin-right: 3px; font-size: 0.7rem; }

/* Responsive breakdown */
@media (max-width: 1100px) {
    .rep-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 720px) {
    .rep-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
    .rep-info { padding: 12px !important; }
    .rep-info h3 { font-size: 0.92rem !important; }
}
@media (max-width: 420px) {
    .rep-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ============================
   Combined article card — hero + body in one unified card
   (replaces the old 2-card layout)
   ============================ */
.article-combined {
    background: #fff;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15,23,42,.04);
}
.article-combined .article-hero-img {
    height: auto !important;             /* pages.css base-ийн 420px-ийг дарах */
    width: 100%;
    background: #f0f3f8;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.article-combined .article-hero-img img {
    display: block;
    width: 100%;                         /* landscape — бүтэн өргөнөөр дүүрэх */
    height: auto;
    max-height: 560px;                   /* portrait хэт өндөр болохоос хамгаалах */
    object-fit: contain;
}
.article-combined .article-hero-img--empty {
    aspect-ratio: 2 / 1;                 /* зураггүй үеийн gradient placeholder */
}
.article-combined .article-hero-body {
    padding: 28px 32px 16px;
    border-bottom: 1px solid var(--line, #e5e7eb);
}
.article-combined .article-title {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    line-height: 1.2;
    margin: 12px 0 14px;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}
.article-combined .article-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.article-combined .article-meta-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--muted, #6b7280);
}
.article-combined .article-meta-row i {
    color: var(--brand, #0b3d91);
    margin-right: 4px;
}

.article-combined .article-body {
    padding: 28px 32px;
}

@media (max-width: 720px) {
    .article-combined .article-hero-img img { max-height: 380px; }
    .article-combined .article-hero-img--empty { aspect-ratio: 16 / 10; }
    .article-combined .article-hero-body,
    .article-combined .article-body { padding: 20px 18px; }
}

/* ============================
   Site name prefix (2-мөр layout-ийн top line)
   Өнгө нь гарчгийнхтай ижил — зөвхөн хэмжээгээр ялгарна.
   Сайтын төрлөөр хэмжээний hierarchy эсрэг (aimag vs sum):
     - Aimag (type=1): "АРХАНГАЙ" big, "аймгийн ИТХ" small
     - Sum (type=2):   "Архангай аймгийн" small, "СУМЫН ИТХ" big
   ============================ */
.site-header .logo-text .logo-sub {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    font-weight: 700 !important;
    color: var(--brand, #0b3d91) !important;  /* main title-тэй ижил brand өнгө */
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    line-height: 1.2 !important;
    opacity: 1 !important;
}
.site-footer .logo-text .logo-sub {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    font-weight: 700 !important;
    color: #fff !important;                    /* footer dark bg → гарчигтай ижил цагаан */
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    line-height: 1.2 !important;
    opacity: 1 !important;
}

/* Default (sum/duureg) hierarchy: top жижиг, bottom том */
.site-header .logo-text .logo-sub,
.site-footer .logo-text .logo-sub { font-size: 0.72rem !important; font-weight: 600 !important; }

/* Aimag (type=1) + Duureg (type=4) hierarchy эсрэг:
   top ТОМ (aimag/duureg name), bottom жижиг ("аймгийн ИТХ" / "дүүргийн ИТХ") */
.site-header .logo-text.logo-text--type-1 .logo-sub,
.site-header .logo-text.logo-text--type-4 .logo-sub,
.site-footer .logo-text.logo-text--type-1 .logo-sub,
.site-footer .logo-text.logo-text--type-4 .logo-sub { font-size: 1.05rem !important; font-weight: 500 !important; letter-spacing: 0.01em !important; }
.site-header .logo-text.logo-text--type-1 .logo-title,
.site-header .logo-text.logo-text--type-4 .logo-title,
.site-footer .logo-text.logo-text--type-1 .logo-title,
.site-footer .logo-text.logo-text--type-4 .logo-title { font-size: 0.78rem !important; font-weight: 600 !important; letter-spacing: 0.04em !important; }

/* Main title — UPPERCASE + tight letter-spacing (condensed) */
.site-header .logo-text .logo-title,
.site-footer .logo-text .logo-title {
    font-size: 1rem !important;
    line-height: 1.15 !important;
    text-transform: uppercase !important;
    letter-spacing: -0.01em !important;     /* үсгүүд шахсан */
    font-weight: 700 !important;
    font-stretch: condensed;                /* variable font дэмждэг бол илүү нарийн */
}

/* Logo-text 2-мөр stack тохиромжтой */
.site-header .logo-text,
.site-footer .logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ============================
   Service cards — ONE unified outer card with 5 services inside
   (removes the confusing "extra frame" look)
   ============================ */
.services-grid {
    background: #fff !important;
    border: 1px solid var(--line, #e5e7eb) !important;
    border-radius: 18px !important;
    padding: 12px !important;
    box-shadow: 0 10px 30px rgba(15,23,42,.06) !important;
    gap: 4px !important;
}
.service-card {
    background: transparent !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 18px 16px !important;
    box-shadow: none !important;
    transition: background 0.15s ease-out !important;
    min-height: 88px;
    position: relative;
}
.service-card:hover {
    background: var(--bg-soft, #f7f8fb) !important;
    transform: none !important;
    box-shadow: none !important;
}
.service-card + .service-card::before {
    content: "";
    position: absolute;
    top: 20%;
    bottom: 20%;
    left: -2px;
    width: 1px;
    background: var(--line, #e5e7eb);
}
.service-card .service-info h4 {
    margin: 0 !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
    color: var(--text, #1a1f2e) !important;
}

@media (max-width: 720px) {
    .services-grid { padding: 8px !important; }
    .service-card { padding: 14px 12px !important; }
    .service-card + .service-card::before { display: none; }
}

/* ============================
   Logo + site name — grouped together as one unit (no gap breakage)
   ============================ */
.site-header .logo,
.site-footer .logo {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-decoration: none !important;
    white-space: nowrap;
}
.site-header .logo .logo-img,
.site-footer .logo .logo-img,
.site-header .logo img,
.site-footer .logo img {
    flex-shrink: 0 !important;
    display: block !important;
}
.site-header .logo .logo-text,
.site-footer .logo .logo-text {
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
}

/* Prevent flex squeeze on long titles — allow wrapping */
.site-header .logo .logo-text .logo-title,
.site-footer .logo .logo-text .logo-title {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ============================
   Chairman card — constrain photo to 140×170 so it doesn't overflow
   (the placeholder had an implicit size; a real <img> was unconstrained)
   ============================ */
.chairman-photo {
    width: 140px !important;
    height: 170px !important;
    position: relative;
    flex-shrink: 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: var(--bg-soft, #f7f8fb);
}
.chairman-photo img,
.chairman-photo > img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
    display: block !important;
    border-radius: 12px !important;
}
.chairman-photo .photo-placeholder {
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px !important;
}

/* Chairman badge stays above photo bottom-right */
.chairman-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent, #c9a227), var(--accent-warm, #e0b83a));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(201,162,39,.4);
    z-index: 2;
}

@media (max-width: 720px) {
    .chairman-card { flex-direction: column !important; align-items: center !important; text-align: center; }
    .chairman-photo { margin: 0 auto; }
}

/* ============================
   News card image safety — don't let background images stretch cards too tall
   ============================ */
.news-card {
    overflow: hidden;
}
.news-card .news-img {
    aspect-ratio: 16/10 !important;
    height: auto !important;
    background-size: cover !important;
    background-position: center !important;
}
.news-card.featured .news-img {
    aspect-ratio: 16/9 !important;
}

/* Media cards / thumbs */
.media-thumb,
.list-card-img,
.fund-thumb,
.exp-thumb {
    aspect-ratio: 16/10;
    background-size: cover;
    background-position: center;
}

/* ============================
   News section — 2-row layout
   Row 1: 1 big (left, no desc) + 2 small stacked (right)
   Row 2: 4 small cards in one row
   ============================ */
.news-row-top {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
}
.news-row-top-right {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
}

.news-row-bottom {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Featured big card — hide description */
.news-card.featured.no-desc .news-body p {
    display: none !important;
}

/* Row 1 right-side small cards — horizontal layout */
.news-card.compact {
    display: grid !important;
    grid-template-columns: 140px 1fr !important;
    gap: 0 !important;
    min-height: 0;
}
.news-card.compact .news-img {
    aspect-ratio: auto !important;
    height: 100% !important;
    min-height: 120px;
}
.news-card.compact .news-body {
    padding: 14px 16px !important;
    display: flex;
    flex-direction: column;
}
.news-card.compact .news-body h3 {
    font-size: 0.95rem !important;
    line-height: 1.3;
    margin: 4px 0 0 !important;
    font-weight: 700;
}
.news-card.compact .news-meta {
    font-size: 0.72rem !important;
}

/* Responsive */
@media (max-width: 960px) {
    .news-row-top { grid-template-columns: 1fr; }
    .news-row-top-right { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
    .news-row-bottom { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
    .news-row-top-right { grid-template-columns: 1fr; }
    .news-card.compact { grid-template-columns: 110px 1fr !important; }
    .news-row-bottom { grid-template-columns: 1fr; }
}

/* ============================
   News grid — featured card stretches to full grid-cell height
   (fixes the empty white space below the big featured card)
   ============================ */
.news-grid {
    min-height: 0 !important;      /* arbitrary min removed */
    align-items: stretch !important;
}
.news-card.featured {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}
.news-card.featured .news-img {
    flex: 1 1 60% !important;
    height: auto !important;
    min-height: 320px !important;
}
.news-card.featured .news-body {
    flex: 1 1 40% !important;
    display: flex !important;
    flex-direction: column !important;
}
.news-card.featured .news-body h3 {
    flex: 0 0 auto !important;
}
.news-card.featured .news-body p {
    flex: 1 1 auto !important;      /* description-ээр үлдсэн зай дүүрнэ */
}
.news-card.featured .news-body .read-more {
    margin-top: auto !important;    /* button доор түлхэнэ */
}

/* ============================
   Two-col grid — when sessions-panel is missing, chairman-card becomes full width
   ============================ */
.two-col-grid:has(.chairman-card:only-child) {
    grid-template-columns: 1fr !important;
}
.two-col-grid .chairman-card:only-child {
    max-width: 920px;
    margin: 0 auto;
}

/* ============================
   Hide broken images in article body (content from DB with old /medias/ paths)
   ============================ */
.prose img[src=""],
.prose img:not([src]),
.sub-prose img[src=""],
.sub-prose img:not([src]) {
    display: none !important;
}

/* JS-added class after img error */
.prose img.img-broken,
.sub-prose img.img-broken {
    display: none !important;
}

/* Empty paragraph that only wrapped a broken image */
.prose p:empty,
.sub-prose p:empty {
    display: none !important;
}

/* ============================
   Representatives section (home page preview, grouped by appointment)
   ============================ */
.reps-section .reps-group {
    margin-bottom: 36px;
}
.reps-section .reps-group:last-child {
    margin-bottom: 0;
}
.reps-section .reps-group-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brand, #0b3d91);
}
.reps-section .reps-group-head h3 {
    font-family: inherit !important;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: var(--brand, #0b3d91) !important;
    margin: 0 !important;
}
.reps-section .reps-group-count {
    font-size: 0.78rem;
    color: var(--muted, #6b7280);
    font-weight: 600;
}

/* "+ N" Бүгдийг үзэх card */
.rep-card.rep-more { background: var(--bg-soft, #f7f8fb) !important; }
.rep-card.rep-more:hover { border-color: var(--brand, #0b3d91) !important; background: #fff !important; }
.rep-card.rep-more .rep-more-icon {
    background-image: none !important;
    background: var(--bg-soft, #f7f8fb) !important;
    color: var(--brand, #0b3d91) !important;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rep-card.rep-more .rep-info h3 {
    font-family: inherit !important;
    color: var(--brand, #0b3d91) !important;
    font-size: 1.4rem !important;
    font-weight: 800 !important;
}

/* ============================
   Reps rotator — single row, horizontal scroll + arrows
   ============================ */
.reps-section .section-head .section-sub {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: var(--muted, #6b7280);
}
.reps-section .section-head .reps-count {
    font-weight: 600;
    color: var(--muted, #6b7280);
}

.reps-rotator {
    position: relative;
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: stretch;
    gap: 8px;
}
.reps-track-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.reps-track-viewport::-webkit-scrollbar { display: none; }

.reps-track {
    display: flex;
    gap: 16px;
    padding: 4px 2px;
}
.reps-track .rep-card {
    flex: 0 0 calc((100% - 16px * 4) / 5);
    min-width: 170px;
    max-width: 230px;
    scroll-snap-align: start;
}
.reps-track-viewport { scroll-snap-type: x mandatory; }

.reps-track .rep-photo {
    position: relative;
    aspect-ratio: 3 / 4;
    width: 100%;
    height: auto;
}
.reps-track .rep-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    background: var(--brand, #0b3d91);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 3px;
    max-width: calc(100% - 16px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reps-arrow {
    align-self: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line, #e5e7eb);
    background: #fff;
    color: var(--brand, #0b3d91);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.reps-arrow:hover {
    background: var(--brand, #0b3d91);
    color: #fff;
    border-color: var(--brand, #0b3d91);
}

@media (max-width: 1024px) {
    .reps-track .rep-card { flex: 0 0 calc((100% - 16px * 3) / 4); }
}
@media (max-width: 768px) {
    .reps-rotator { grid-template-columns: 32px 1fr 32px; }
    .reps-arrow { width: 32px; height: 32px; font-size: 0.75rem; }
    .reps-track .rep-card { flex: 0 0 calc((100% - 16px * 2) / 3); min-width: 140px; }
}
@media (max-width: 520px) {
    .reps-track .rep-card { flex: 0 0 calc((100% - 16px) / 2); }
}

/* ============================
   Mobile menu — dropdown (has-dropdown) click-to-open behavior
   Default style.css дээр mobile-д `.dropdown { visibility: visible; opacity: 1 }` гэж
   бүхнийг ил тавьсан — одоо click хийхэд `.is-open` class-р нээдэг болгож зохицуулъя.
   ============================ */
@media (max-width: 900px) {
    .main-nav .has-dropdown > a::after {
        content: "\f107";                          /* fa-chevron-down */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        margin-left: auto;
        font-size: 0.7rem;
        transition: transform .2s ease;
        opacity: .6;
    }
    .main-nav .has-dropdown.is-open > a::after { transform: rotate(180deg); }
    .main-nav .has-dropdown > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Mobile: dropdown hidden by default, shown on .is-open */
    .main-nav .has-dropdown .dropdown {
        display: none !important;
    }
    .main-nav .has-dropdown.is-open .dropdown {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }
}

/* ============================
   News card — image + title clickable (→ article), category clickable (→ category list)
   ============================ */
.news-card .news-img { position: relative; }

/* Full-overlay anchor over the image → article. Visually invisible. */
.news-card .news-img-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    text-indent: -9999px;
    overflow: hidden;
    color: transparent;
}

/* Category badge — raised above the image overlay so its click wins */
.news-card .news-cat,
.news-card a.news-cat {
    z-index: 2;
}
.news-card a.news-cat {
    text-decoration: none !important;
    transition: filter .15s ease, transform .15s ease;
}
.news-card a.news-cat:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

/* Title anchor — inherit h3 styling, only color on hover */
.news-card .news-body h3 a,
.news-card .news-body h3 a:visited {
    color: inherit;
    text-decoration: none;
    transition: color .15s ease;
}
.news-card .news-body h3 a:hover {
    color: var(--brand, #0b3d91);
}
