/* THAIFA — news presentation (homepage feed, news listing, article, gallery, lightbox)
   CI: navy #303a56 · royal blue #3357a3 · pale blue #d9e7ef · white · red accent #d51d3c · font Prompt */
:root { --nw-navy: #303a56; --nw-blue: #3357a3; --nw-pale: #d9e7ef; --nw-tint: #eef4f8; --nw-muted: #5a6380; --nw-line: #e3eaf1; --nw-red: #d51d3c; }
html { scroll-padding-top: 132px; }

/* ---------- photo collage (1 / 2 / 3 / 4+) ---------- */
.nc { display: grid; gap: 3px; border-radius: 12px; overflow: hidden; aspect-ratio: 3 / 2; background: #fff; }
.nc__tile { position: relative; display: block; overflow: hidden; background: var(--nw-tint); border: 0; padding: 0; margin: 0; cursor: zoom-in; min-height: 0; }
.nc__tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; transition: transform .5s cubic-bezier(.22, .61, .36, 1); }
a.nc__tile:hover img, button.nc__tile:hover img { transform: scale(1.025); }
.nc__tile:focus-visible { outline: 3px solid rgba(51, 87, 163, .55); outline-offset: -3px; z-index: 1; }
.nc--2 { grid-template-columns: 1fr 1fr; }
.nc--3 { grid-template-columns: 3fr 2fr; grid-template-rows: 1fr 1fr; }
.nc--3 > .nc__tile:first-child { grid-row: 1 / 3; }
.nc--4 { grid-template-columns: 3fr 2fr; grid-template-rows: repeat(3, 1fr); }
.nc--4 > .nc__tile:first-child { grid-row: 1 / 4; }
.nc__more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(23, 30, 52, .58); color: #fff; font-size: clamp(20px, 2.6vw, 30px); font-weight: 500; letter-spacing: .02em; }
.nc--natural { aspect-ratio: auto; display: block; }
.nc--natural > .nc__tile { width: 100%; }
.nc--natural > .nc__tile img { position: static; width: 100%; height: auto; max-height: 72vh; object-fit: contain; }
@media (max-width: 640px) {
    .nc--4 { grid-template-columns: repeat(3, 1fr); grid-template-rows: 2fr 1fr; aspect-ratio: 4 / 3; }
    .nc--4 > .nc__tile:first-child { grid-row: auto; grid-column: 1 / 4; }
}
.nw-count { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 1; padding: 6px 10px; border-radius: 999px; background: rgba(23, 30, 52, .72); color: #fff; }
.nw-count svg { width: 14px; height: 14px; }

/* ---------- shared text bits ---------- */
.nw-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; color: var(--nw-muted); }
.nw-meta__cat { color: var(--nw-blue); font-weight: 500; }
.nw-title { color: var(--nw-navy); font-weight: 500; text-wrap: balance; }
.nw-title a { color: inherit; text-decoration: none; }
.nw-title a:hover { color: var(--nw-blue); }
.nw-clamp2, .nw-clamp3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.nw-clamp2 { -webkit-line-clamp: 2; }
.nw-clamp3 { -webkit-line-clamp: 3; }
.nw-link { display: inline-flex; align-items: center; gap: 6px; color: var(--nw-blue); font-size: 15px; font-weight: 500; text-decoration: none; }
.nw-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.nw-link svg { width: 16px; height: 16px; }

/* ---------- homepage feed ---------- */
.hn { padding: clamp(56px, 8vw, 96px) 0; background: #fff; border-top: 1px solid var(--nw-line); }
.hn__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: clamp(24px, 4vw, 40px); }
.hn__eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--nw-blue); margin-bottom: 8px; }
.hn__eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--nw-red); }
.hn__h { font-size: clamp(30px, 4.2vw, 44px); line-height: 1.2; color: var(--nw-navy); font-weight: 500; margin: 0; }
.hn__grid { display: grid; gap: clamp(28px, 4vw, 48px); }
@media (min-width: 1024px) { .hn__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.hn-feature__body { margin-top: 20px; }
.hn-feature__title { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.4; margin: 10px 0 10px; }
.hn-feature__sum { font-size: 17px; line-height: 1.8; color: #4a5571; margin: 0 0 16px; }
.hn-feature__acts { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.hn-list { display: flex; flex-direction: column; }
.hn-item { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 18px; padding: 20px 0; border-top: 1px solid var(--nw-line); }
.hn-item:first-child { padding-top: 0; border-top: 0; }
.hn-item__img { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--nw-tint); }
.hn-item__img img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; transition: transform .5s cubic-bezier(.22, .61, .36, 1); }
.hn-item__img:hover img { transform: scale(1.03); }
.hn-item__img .nw-count { position: absolute; right: 8px; bottom: 8px; }
.hn-item__title { font-size: 18px; line-height: 1.5; margin: 6px 0; }
.hn-item__sum { font-size: 15px; line-height: 1.7; color: #4a5571; margin: 0 0 8px; }
@media (max-width: 479px) { .hn-item { grid-template-columns: 1fr; gap: 12px; } .hn-item__img { aspect-ratio: 16 / 10; } }
.hn__all { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--nw-navy); color: var(--nw-navy); font-size: 15px; text-decoration: none; transition: background-color .2s ease, color .2s ease; }
.hn__all:hover { background: var(--nw-navy); color: #fff; }

/* ---------- listing cards ---------- */
.nr-card__img { position: relative; }
.nr-card__img .nw-count { position: absolute; right: 10px; bottom: 10px; }

/* ---------- article ---------- */
.na-head { max-width: 46rem; }
.na-title { font-size: clamp(28px, 4vw, 42px); line-height: 1.35; margin: 8px 0 14px; scroll-margin-top: 140px; }
.na-cat { display: inline-block; font-size: 15px; color: var(--nw-blue); font-weight: 500; text-decoration: none; }
.na-cat:hover { text-decoration: underline; text-underline-offset: 4px; }
.na-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; color: var(--nw-muted); }
.na-meta a { color: var(--nw-blue); text-decoration: underline; text-underline-offset: 3px; }
.na-media { margin: 28px 0 36px; }
.na-media .nc { aspect-ratio: 16 / 10; }
.na-media__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font-size: 14px; color: var(--nw-muted); }
.na-body { max-width: 46rem; font-size: 17px; line-height: 1.95; color: #343d58; overflow-wrap: anywhere; }
@media (min-width: 768px) { .na-body { font-size: 18px; } }
.na-body p { margin: 0 0 1.25em; }
.na-body p:last-child { margin-bottom: 0; }
.na-body a { color: var(--nw-blue); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.na-body .na-tag { color: var(--nw-blue); }
.na-summary { max-width: 46rem; font-size: 19px; line-height: 1.8; color: var(--nw-navy); padding-left: 18px; border-left: 3px solid var(--nw-blue); margin: 0 0 28px; }
.na-section { margin-top: 56px; scroll-margin-top: 140px; }
.na-section__h { font-size: 22px; color: var(--nw-navy); font-weight: 500; margin: 0 0 16px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.na-section__h small { font-size: 15px; color: var(--nw-muted); font-weight: 400; }
.na-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .na-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } }
@media (min-width: 1024px) { .na-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.na-grid__btn { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0; border-radius: 8px; overflow: hidden; background: var(--nw-tint); cursor: zoom-in; }
.na-grid__btn img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.na-grid__btn:hover img { transform: scale(1.03); }
.na-grid__btn:focus-visible { outline: 3px solid rgba(51, 87, 163, .55); outline-offset: 2px; }
.na-grid__num { position: absolute; left: 8px; bottom: 8px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(23, 30, 52, .7); color: #fff; }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: rgba(12, 16, 28, .96); color: #fff; }
.lb[hidden] { display: none; }
.lb__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 18px; font-size: 15px; }
.lb__tools { display: flex; gap: 4px; }
.lb__btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.lb__btn:hover { background: rgba(255, 255, 255, .12); }
.lb__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb__btn svg { width: 22px; height: 22px; }
.lb__stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 56px; touch-action: pan-y; }
.lb__stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .1); }
.lb__nav--prev { left: 8px; }
.lb__nav--next { right: 8px; }
.lb__cap { min-height: 44px; padding: 10px 18px 16px; text-align: center; font-size: 14px; color: rgba(255, 255, 255, .8); }
@media (max-width: 640px) { .lb__stage { padding: 0 8px; } .lb__nav { top: auto; bottom: -50px; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .nc__tile img, .hn-item__img img, .na-grid__btn img { transition: none; }
    a.nc__tile:hover img, button.nc__tile:hover img, .hn-item__img:hover img, .na-grid__btn:hover img { transform: none; }
}
