Files
hesu-JT/css/news.css
T
2026-08-27 11:54:26 +08:00

260 lines
7.7 KiB
CSS

/* ============================================================
news.css — News & Insights listing page
Loaded AFTER style.css. Prefix: .nw-* | hooks: body.is-news, main.nw
Sections: page base · hero · category tabs · news list (left-text / right-image rows) ·
pagination · scroll reveal · responsive
============================================================ */
/* ---------- page base (light theme for this page) ---------- */
body.is-news { background: #ffffff; color: var(--text-dark); font-family: var(--font-body); }
.is-news .nw { background: #ffffff; }
/* ---------- scroll reveal (driven by news.js) ---------- */
[data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
/* ============================================================
HERO BANNER — full-bleed cargo photo + left-aligned "NEWS"
============================================================ */
.nw-hero {
position: relative;
min-height: 78vh;
display: flex;
align-items: flex-start; /* top-aligned… */
padding-top: 15vh; /* …copy offset from the banner top — single knob */
overflow: hidden;
}
.nw-hero__scene { position: absolute; inset: 0; z-index: 0; background: #060a12; overflow: hidden; }
.nw-hero__bg {
position: absolute; inset: 0;
width: 100%; height: 100%;
object-fit: cover;
object-position: center 40%;
transform: scale(1.04);
animation: nw-hero-zoom 16s var(--ease) forwards;
}
@keyframes nw-hero-zoom { from { transform: scale(1.14); } to { transform: scale(1.04); } }
/* readability veil */
.nw-hero__veil {
position: absolute; inset: 0; z-index: 2;
}
.nw-hero__copy {
position: relative; z-index: 3;
display: flex; flex-direction: column; align-items: flex-start;
}
.nw-hero__title {
font-family: var(--font-display);
font-weight: 900;
font-size: clamp(3.5rem, 11vw, 9rem);
line-height: 0.92;
letter-spacing: 0.14em;
color: #101010;
}
/* ============================================================
LISTING — category tabs
============================================================ */
.nw-listing { padding: 72px 0 110px; background: var(--surface-light); }
.nw-tabs {
display: flex;
flex-wrap: wrap;
gap: 4px;
margin-bottom: 48px;
border-bottom: 1px solid var(--line);
}
.nw-tab {
position: relative;
font-family: var(--font-display);
font-weight: 600;
font-size: 1rem;
letter-spacing: 0.02em;
color: var(--text-mid);
background: none;
border: none;
padding: 16px 26px;
cursor: pointer;
transition: color .2s var(--ease);
}
.nw-tab:hover { color: var(--text-dark); }
.nw-tab.is-active { color: var(--orange-700); }
.nw-tab.is-active::after {
content: "";
position: absolute;
left: 26px; right: 26px; bottom: -1px;
height: 3px;
background: var(--orange-700);
border-radius: 3px 3px 0 0;
}
/* ============================================================
NEWS LIST — one row per item, text left + image right
============================================================ */
.nw-list {
display: flex;
flex-direction: column;
gap: 26px;
}
.nw-row {
display: grid;
grid-template-columns: 1.1fr 1fr;
align-items: stretch;
overflow: hidden;
height: 300px;
/* scroll reveal */
opacity: 0;
transform: translateY(26px);
transition: opacity .6s var(--ease), transform .6s var(--ease), box-shadow .4s var(--ease), border-color .4s;
}
.nw-row.in { opacity: 1; transform: none; }
.nw-row:hover {
border-color: rgba(255,138,30,.45);
box-shadow: 0 20px 44px rgba(20,40,80,.1);
}
.nw-row__body {
padding: 34px 42px;
display: flex;
flex-direction: column;
overflow: hidden;
min-width: 0;
}
.nw-row__title {
font-family: var(--font-display);
font-weight: 700;
font-size: clamp(1.25rem, 1.8vw, 1.55rem);
line-height: 1.3;
color: var(--text-dark);
transition: color .2s;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.nw-row:hover .nw-row__title { color: var(--orange-700); }
.nw-row__excerpt {
margin-top: 12px;
font-size: 0.95rem;
line-height: 1.75;
color: var(--text-mid);
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
.nw-row__more {
margin-top: auto;
align-self: flex-start;
font-family: var(--font-display);
font-weight: 700;
font-size: 0.78rem;
letter-spacing: 0.12em;
color: #fff;
background: var(--grad-orange);
padding: 11px 24px;
border-radius: var(--radius);
box-shadow: 0 6px 18px rgba(255,106,0,.28);
display: inline-flex; align-items: center; gap: 8px;
transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.nw-row__more .arrow { transition: transform .25s var(--ease); }
.nw-row__more:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255,106,0,.38); }
.nw-row__more:hover .arrow { transform: translateX(4px); }
.nw-row__media {
display: block;
position: relative;
overflow: hidden;
background: var(--ink-700);
}
.nw-row__media img {
width: 100%;
height: 100%;
min-height: 250px;
object-fit: cover;
transition: transform .6s var(--ease);
}
.nw-row:hover .nw-row__media img { transform: scale(1.05); }
/* ============================================================
PAGINATION — numbered buttons + prev/next arrows
============================================================ */
.nw-pagination {
display: flex; justify-content: center; align-items: center;
gap: 10px;
margin-top: 60px;
}
.nw-page {
min-width: 44px; height: 44px;
padding: 0 12px;
display: inline-flex; align-items: center; justify-content: center;
font-family: var(--font-display);
font-weight: 700;
font-size: 0.95rem;
color: var(--text-dark);
background: #ffffff;
border: 1px solid var(--line);
border-radius: 10px;
cursor: pointer;
transition: color .2s, background .2s, border-color .2s, transform .2s;
}
.nw-page:hover:not(:disabled):not(.is-active) {
color: var(--orange-700);
border-color: rgba(255,138,30,.5);
transform: translateY(-2px);
}
.nw-page.is-active {
color: #fff;
background: var(--grad-orange);
border-color: transparent;
box-shadow: 0 8px 18px rgba(255,106,0,.32);
cursor: default;
}
.nw-page:disabled { opacity: .4; cursor: not-allowed; }
.nw-page .arrow { display: inline-block; font-size: 1rem; line-height: 1; }
.nw-page--nav { font-size: 1.05rem; }
/* ============================================================
RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
.nw-row { grid-template-columns: 1fr 1fr; height: 280px; }
.nw-row__body { padding: 28px 30px; }
.nw-hero { min-height: 70vh; }
}
@media (max-width: 760px) {
.nw-listing { padding: 56px 0 90px; }
.nw-tabs { margin-bottom: 36px; gap: 0; }
.nw-tab { padding: 14px 16px; font-size: 0.92rem; }
.nw-list { gap: 22px; }
.nw-row { grid-template-columns: 1fr; height: auto; min-height: 0; }
.nw-row__media { order: -1; }
.nw-row__media img { min-height: 0; aspect-ratio: 16 / 9; }
.nw-row__body { padding: 24px 22px 28px; }
.nw-hero { min-height: 64vh; }
}
@media (max-width: 480px) {
.nw-tab { padding: 13px 12px; font-size: 0.86rem; }
.nw-page { min-width: 40px; height: 40px; }
.nw-pagination { gap: 8px; margin-top: 48px; }
}
/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
[data-reveal], .nw-row { opacity: 1 !important; transform: none !important; }
.nw-hero__bg { transform: none !important; animation: none !important; }
}
/* empty-category state (categories with no articles yet) */
.nw-empty {
padding: 90px 20px;
text-align: center;
color: #9aa4b0;
font-family: var(--font-display);
font-size: 1rem;
letter-spacing: 0.04em;
}