/* =========================================================
   Мэдээ — жагсаалт ба дэлгэрэнгүй
   Сайтын бусад хуудасны (Leoson list / static page) загвар дээр суурилсан.
   style.css-ийн дараа холбоно.
   ========================================================= */

/* Сайтын бусад хуудастай ижил фонт */
.nw { font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif; }
html[lang="ja"] .nw { font-family: "Roboto", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif; }
.nw-card, .nw-card * { font-family: inherit; }
.nw .icon { width: 16px; height: 16px; }
.nw-section { background: var(--bg); padding: 24px 0 48px; }
.nw-section .container { display: flex; flex-direction: column; gap: 24px; }

/* ---------- Гарчиг + таб ---------- */
.nw-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.nw-title { margin: 0; font-size: 36px; font-weight: 700; line-height: 1.4; color: #000; }

/* Figma "tab" (type=Bottom, style=Primary, size=Large) */
.nw-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.nw-tab {
    display: flex; align-items: center; height: 40px; padding: 12px 24px; border-radius: 999px;
    font-size: 18px; font-weight: 500; line-height: 1; color: rgba(0, 0, 0, .7); white-space: nowrap;
    transition: background-color .15s, color .15s;
}
.nw-tab:hover { background: rgba(0, 0, 0, .05); color: #3232b5; }
.nw-tab.is-active { background: rgba(0, 0, 255, .05); color: #3232b5; }

/* ---------- Огноо ---------- */
.nw-date { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; line-height: 1; color: #999; }
.nw-date .icon { width: 16px; height: 16px; color: rgba(0, 0, 255, .3); }

/* ---------- Онцлох (том) мэдээ ---------- */
.nw-top {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); overflow: hidden;
    background: #fff; border: 1px solid var(--grey-200); border-radius: 24px; color: inherit;
    transition: box-shadow .25s;
}
.nw-top:hover { box-shadow: 0 16px 40px rgba(13, 39, 80, .08); }
.nw-top__img { position: relative; min-height: 360px; overflow: hidden; background: rgba(0, 0, 0, .05); }
.nw-top__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.nw-top:hover .nw-top__img img { transform: scale(1.04); }
.nw-top__body { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 48px; min-width: 0; }
.nw-top__title { margin: 0; font-size: 32px; font-weight: 700; line-height: 1.3; color: rgba(0, 0, 0, .9); transition: color .2s; }
.nw-top:hover .nw-top__title { color: #3232b5; }
.nw-top .nw-desc { -webkit-line-clamp: 5; font-size: 16px; line-height: 1.6; min-height: 0; }
.nw-top .nw-more { align-self: flex-start; margin-top: 8px; height: 48px; padding: 12px 24px; font-size: 18px; }

/* ---------- Карт ---------- */
.nw-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }   /* нэг мөрөнд 4 */
.nw-card {
    display: flex; flex-direction: column; overflow: hidden; height: 100%; color: inherit;
    background: #fff; border: 1px solid var(--grey-200); border-radius: 12px;
    transition: box-shadow .25s;
}
.nw-card:hover { box-shadow: 0 12px 32px rgba(13, 39, 80, .08); }
.nw-card__img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: rgba(0, 0, 0, .05); }
.nw-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.nw-card:hover .nw-card__img img { transform: scale(1.05); }
.nw-ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; color: rgba(0, 0, 0, .08); }
.nw-cat {
    position: absolute; left: 12px; top: 12px; z-index: 1; max-width: calc(100% - 24px);
    padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .92);
    font-size: 13px; line-height: 1.4; color: #3232b5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nw-card__body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 20px; }
.nw-card__title {
    margin: 0; font-size: 18px; font-weight: 500; line-height: 1.4; color: rgba(0, 0, 0, .8);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    transition: color .2s;
}
.nw-card:hover .nw-card__title { color: #3232b5; }

/* Товч тайлбар (editor-ийн HTML-ийг энгийн текст мэт харуулна) */
.nw-desc {
    margin: 0; font-size: 14px; line-height: 1.5; color: rgba(0, 0, 0, .5); min-height: 63px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.nw-desc * {
    display: inline; margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important;
    /* editor-оос ирсэн inline font/өнгийг дарж, бүх карт ижил фонттой харагдана */
    font: inherit !important; font-family: inherit !important; font-size: inherit !important; font-weight: inherit !important;
    font-style: normal !important; line-height: inherit !important; color: inherit !important; text-decoration: none !important;
}
.nw-desc img, .nw-desc table, .nw-desc iframe, .nw-desc video, .nw-desc br, .nw-desc style, .nw-desc script { display: none; }

/* "Үргэлжлүүлэн унших" — Figma button Medium/Outline */
.nw-more {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: auto;
    height: 40px; padding: 8px 20px; border: 1px solid rgba(0, 0, 255, .2); border-radius: 999px;
    color: #3232b5; font-size: 16px; font-weight: 500; line-height: 1; white-space: nowrap;
    transition: background-color .2s, border-color .2s;
}
.nw-more .icon { width: 20px; height: 20px; transition: transform .2s; }
.nw-card:hover .nw-more, .nw-top:hover .nw-more { border-color: rgba(0, 0, 255, .5); background: linear-gradient(90deg, rgba(102, 126, 234, .1), rgba(118, 75, 162, .1)); }
.nw-card:hover .nw-more .icon, .nw-top:hover .nw-more .icon { transform: translate(2px, -2px); }

/* Хоосон */
.nw-empty {
    display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 24px; text-align: center;
    background: #fff; border: 1px dashed rgba(0, 0, 0, .2); border-radius: 24px;
}
.nw-empty b { font-size: 24px; font-weight: 700; color: rgba(0, 0, 0, .8); }
.nw-empty p { margin: 0; font-size: 16px; color: rgba(0, 0, 0, .5); }

/* Хуудаслалт (Figma "pages") */
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; }
.pager__item {
    display: flex; align-items: center; justify-content: center;
    min-width: 48px; height: 48px; padding: 12px; border-radius: 999px;
    border: 1px solid rgba(0, 0, 255, .2); color: #3232b5;
    font-size: 18px; font-weight: 500; line-height: 1.32;
    transition: background-color .2s, border-color .2s, opacity .2s;
}
.pager__item .icon { width: 24px; height: 24px; }
.pager__next { width: 48px; padding: 0; }
a.pager__item:hover { background: rgba(0, 0, 255, .05); border-color: rgba(0, 0, 255, .5); }
.pager__item.is-active { border-color: transparent; background: var(--gradient); color: #fff; }
.pager__gap { cursor: default; }

/* =========================================================
   Дэлгэрэнгүй (Figma "static page" бүтэц: агуулга + баруун багана)
   ========================================================= */
.nwd { background: var(--bg); padding: 48px 0; }
.nwd__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.nwd__main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.nwd__cat { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; line-height: 1.6; color: #999; }
.nwd__cat .icon { width: 18px; height: 18px; color: rgba(0, 0, 255, .3); fill: currentColor; stroke: none; }
.nwd__title { margin: 0; font-size: 36px; font-weight: 700; line-height: 1.3; color: rgba(0, 0, 0, .9); overflow-wrap: anywhere; }
.nwd__head { display: flex; flex-direction: column; gap: 12px; }

.nwd__bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    padding-bottom: 16px; border-bottom: 1px solid rgba(0, 0, 0, .1);
}
.nwd__share { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #999; }
.nwd__share a, .nwd__share button {
    display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
    border: 1px solid rgba(0, 0, 255, .2); border-radius: 999px; background: #fff; color: #3232b5; cursor: pointer;
    transition: background-color .2s, border-color .2s;
}
.nwd__share a:hover, .nwd__share button:hover { background: rgba(0, 0, 255, .05); border-color: rgba(0, 0, 255, .5); }
.nwd__share .icon { width: 18px; height: 18px; }
.nwd__share .icon--fill { fill: currentColor; stroke: none; }
.nwd__share button.is-copied { background: rgba(0, 255, 0, .05); border-color: rgba(0, 255, 0, .3); color: #1a7f37; }

.nwd__cover { border-radius: 24px; overflow: hidden; background: rgba(0, 0, 0, .05); }
.nwd__cover img { width: 100%; height: auto; display: block; }

.nwd__text { font-size: 16px; line-height: 1.6; color: rgba(0, 0, 0, .7); text-align: justify; overflow-wrap: anywhere; }
.nwd__text p { margin: 0 0 12px; }
.nwd__text > :last-child { margin-bottom: 0; }
.nwd__text img { max-width: 100%; height: auto; border-radius: 12px; }
.nwd__text h2, .nwd__text h3, .nwd__text h4 { color: rgba(0, 0, 0, .9); margin: 1.2em 0 .5em; line-height: 1.3; text-align: left; }
.nwd__text a { color: var(--blue); text-decoration: underline; }
.nwd__text ul, .nwd__text ol { padding-left: 1.3em; margin: 0 0 12px; }
.nwd__text blockquote { margin: 0 0 12px; padding: 12px 20px; border-left: 3px solid #667eea; background: rgba(0, 0, 255, .03); border-radius: 0 12px 12px 0; }
.nwd__text table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.nwd__text td, .nwd__text th { border: 1px solid var(--grey-200); padding: 8px 10px; }
.nwd__text iframe { max-width: 100%; border-radius: 12px; }
.nwd__video { width: 100%; border-radius: 24px; background: #000; display: block; }

/* Зургийн цомог */
.nwd__gallery { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; border-top: 1px solid rgba(0, 0, 0, .1); }
.nwd__h2 { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.4; color: rgba(0, 0, 0, .9); }
.nwd__photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nwd__photo {
    position: relative; display: block; padding: 0; border: 0; cursor: zoom-in;
    aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, .05);
}
.nwd__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.nwd__photo:hover img { transform: scale(1.05); }
.nwd__photo span {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 12px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .6)); color: #fff; font-size: 13px; line-height: 1.3; text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Lightbox */
.nw-lb {
    position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    padding: 56px 72px; background: rgba(0, 0, 0, .88); animation: fadeIn .2s ease;
}
.nw-lb[hidden] { display: none; }
.nw-lb img { max-width: 100%; max-height: calc(100vh - 160px); border-radius: 12px; object-fit: contain; }
.nw-lb p { margin: 0; color: rgba(255, 255, 255, .85); font-size: 15px; text-align: center; }
.nw-lb button {
    position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
    border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer;
    transition: background-color .2s;
}
.nw-lb button:hover { background: rgba(255, 255, 255, .2); }
.nw-lb button .icon { width: 24px; height: 24px; }
.nw-lb__close { top: 16px; right: 16px; }
.nw-lb__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.nw-lb__next { right: 16px; top: 50%; transform: translateY(-50%); }

/* Баруун багана — сүүлийн мэдээ */
.nwd__aside { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 16px; padding: 24px; background: #fff; border-radius: 24px; border: 1px solid var(--grey-200); }
.nwd__aside .nwd__h2 { font-size: 20px; }
.nw-side { display: flex; flex-direction: column; }
.nw-side__item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(0, 0, 0, .08); color: inherit; }
.nw-side__item:first-child { border-top: 0; padding-top: 0; }
.nw-side__img { position: relative; flex: none; width: 96px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: rgba(0, 0, 0, .05); }
.nw-side__img img { width: 100%; height: 100%; object-fit: cover; }
.nw-side__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nw-side__title {
    margin: 0; font-size: 15px; font-weight: 500; line-height: 1.4; color: rgba(0, 0, 0, .8);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .2s;
}
.nw-side__item:hover .nw-side__title { color: #3232b5; }
.nw-side__item .nw-date { font-size: 12px; }
.nw-side__item .nw-date .icon { width: 14px; height: 14px; }
.nwd__all { width: 100%; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .nw-top__body { padding: 32px; } .nw-top__title { font-size: 26px; } }
@media (max-width: 1400px) { .nw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
    .nw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nw-top { grid-template-columns: 1fr; }
    .nw-top__img { min-height: 0; aspect-ratio: 16 / 9; }
    .nwd__grid { grid-template-columns: 1fr; }
    .nwd__aside { position: static; }
}
@media (max-width: 768px) {
    .nw-title { font-size: 28px; }
    .nw-tab { padding: 10px 16px; font-size: 16px; }
    .nw-grid { gap: 16px; }
    .nw-card__body { padding: 16px; }
    .nw-top__body { padding: 20px; gap: 12px; }
    .nw-top__title { font-size: 22px; }
    .nwd { padding: 24px 0; }
    .nwd__title { font-size: 26px; }
    .nwd__cover { border-radius: 16px; }
    .nwd__photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nwd__text { text-align: left; }
    .nw-lb { padding: 56px 12px; }
    .nw-lb__prev, .nw-lb__next { top: auto; bottom: 16px; transform: none; }
    .pager { gap: 6px; }
    .pager__item { min-width: 40px; height: 40px; padding: 8px; font-size: 16px; }
    .pager__next { width: 40px; }
}
@media (max-width: 560px) { .nw-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .nw *, .nw-lb { animation: none !important; transition: none !important; } }

/* =========================================================
   Мэдээний жагсаалт — Figma "layout" 1073:13896
   Карт = "content" type=room (товчгүй): 4 багана, gap 24, radius 12, хүрээ #e4e4e4
   ========================================================= */
.nwl { display: flex; flex-direction: column; gap: 24px; padding-top: 24px; padding-bottom: 84px; }
.nwl__title { margin: 0; font-size: 36px; font-weight: 700; line-height: 1.4; color: #000; }
.nwl__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; align-items: stretch; }

.nwl-card {
    display: flex; flex-direction: column; overflow: hidden; height: 100%;
    background: #fff; border: 1px solid var(--grey-200, #e4e4e4); border-radius: 12px; color: inherit;
    transition: box-shadow .25s, border-color .25s;
}
.nwl-card:hover { border-color: rgba(0, 0, 255, .2); box-shadow: 0 12px 32px rgba(13, 39, 80, .08); }
.nwl-card__img { position: relative; aspect-ratio: 385 / 217; overflow: hidden; background: rgba(0, 0, 0, .05); }
.nwl-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.nwl-card:hover .nwl-card__img img { transform: scale(1.05); }
.nwl-card__body { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px 24px; min-width: 0; }
.nwl-card__title {
    margin: 0; font-size: 20px; font-weight: 500; line-height: 1.4; color: rgba(0, 0, 0, .8);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s;
}
.nwl-card:hover .nwl-card__title { color: #3232b5; }
/* Тайлбар — 16px, 60%, 2 мөрөөр тасарна (Figma: maxLines 2) */
.nwl-card__desc {
    margin: 0; font-size: 16px; line-height: 1.25; color: rgba(0, 0, 0, .6);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.nwl-card__desc * {
    display: inline; margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important;
    font: inherit !important; color: inherit !important; text-decoration: none !important;
}
.nwl-card__desc img, .nwl-card__desc table, .nwl-card__desc iframe, .nwl-card__desc video,
.nwl-card__desc br, .nwl-card__desc style, .nwl-card__desc script { display: none !important; }
.nwl-card__date { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 14px; line-height: 1; color: #999; }
.nwl-card__date .icon { width: 14px; height: 14px; color: rgba(0, 0, 255, .3); }

@media (max-width: 1400px) { .nwl__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .nwl__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
    .nwl { padding-bottom: 48px; }
    .nwl__title { font-size: 28px; }
    .nwl__grid { gap: 16px; }
    .nwl-card__body { padding: 16px; }
    .nwl-card__title { font-size: 17px; }
    .nwl-card__desc { font-size: 14px; line-height: 1.3; }
}
@media (max-width: 560px) { .nwl__grid { grid-template-columns: 1fr; } }