/* ============================================================
   news.css — news list & article pages (builds on base/components/pages)
   ============================================================ */

/* ---------- Generated cover graphic (placeholder for real 16:9 photos) ---------- */
.news-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0F2748;
  background-image: linear-gradient(120deg, #0B1F3D 0%, #16355F 60%, #3A2668 100%);
  display: grid;
  place-items: center;
  border-radius: var(--radius-card);
}
.news-cover::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 20px 20px;
}
.news-cover::after {
  content: "";
  position: absolute; right: -4%; bottom: -12%;
  width: 62%; aspect-ratio: 300 / 140;
  background-repeat: no-repeat; background-size: contain; background-position: bottom right;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 140'%3E%3Cpath d='M14 118 C 96 26, 214 26, 288 74' fill='none' stroke='%23F5820D' stroke-width='2.5' stroke-linecap='round' stroke-dasharray='9 9'/%3E%3C/svg%3E");
}
.news-cover .ms {
  position: relative; z-index: 1;
  font-size: clamp(46px, 7vw, 76px);
  color: #9CC4F0;
  opacity: .96;
}
.news-cover[data-cat="lane"] .ms { color: #9CC4F0; }
.news-cover[data-cat="warehouse"] .ms { color: #C9DBF2; }
.news-cover[data-cat="regulation"] .ms { color: #FF9E9E; }
.news-cover[data-cat="guide"] .ms { color: #FFC178; }
.news-cover[data-cat="market"] .ms { color: #C4A7E0; }

/* ---------- Category chip ---------- */
.cat-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  white-space: nowrap;
}
.cat-chip[data-cat="lane"]       { background: rgba(46, 107, 184, .12); color: var(--blue); }
.cat-chip[data-cat="warehouse"]  { background: rgba(27, 58, 107, .10);  color: var(--navy); }
.cat-chip[data-cat="regulation"] { background: rgba(200, 30, 30, .10);  color: var(--red); }
.cat-chip[data-cat="guide"]      { background: rgba(245, 130, 13, .12); color: #C56A00; }
.cat-chip[data-cat="market"]     { background: rgba(91, 42, 134, .10);  color: var(--purple); }

/* ---------- Meta row (date · read time) ---------- */
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 12.5px; color: #8595AD; }
.post-meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: #C3CEDE; }
.post-meta .read-min { display: inline-flex; align-items: center; gap: 5px; }
.post-meta .read-min .ms { font-size: 15px; }

/* ---------- Featured article ---------- */
.post-featured {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(20px, 3vw, 40px);
  align-items: center; margin-top: clamp(22px, 3vw, 36px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: clamp(16px, 2vw, 22px);
}
.post-featured .news-cover { aspect-ratio: 16 / 10; }
.post-featured-body { min-width: 0; }
.post-featured .badge-featured {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--orange);
}
.post-featured .badge-featured .ms { font-size: 16px; }
.post-featured h2 {
  font-size: clamp(22px, 2.6vw, 34px); line-height: 1.18; margin: 12px 0 10px;
}
.post-featured p { font-size: 15px; line-height: 1.7; color: var(--muted); margin: 0 0 18px; }
@media (max-width: 760px) { .post-featured { grid-template-columns: 1fr; } }

/* ---------- Toolbar (sticky filters + search) ---------- */
.news-toolbar {
  position: sticky; top: 66px; z-index: 40;
  background: rgba(255, 255, 255, .95); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.news-toolbar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.filter-chips { display: flex; gap: 8px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.filter-chip {
  flex: 0 0 auto; padding: 9px 15px; border-radius: 999px; border: 1px solid #E0E7F2;
  background: var(--surface); color: var(--muted);
  font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.filter-chip:hover { border-color: #C9D8EC; color: var(--navy); }
.filter-chip.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.search-box { position: relative; flex: 0 0 auto; width: min(280px, 100%); }
.search-box .ms { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 19px; color: #8595AD; pointer-events: none; }
.search-box input {
  width: 100%; padding: 11px 14px 11px 40px; border: 1px solid #D5DFEE; border-radius: 999px;
  font-family: var(--font-body); font-size: 14px; color: var(--ink); background: #fff;
}
.search-box input:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.result-count { flex: 0 0 auto; font-size: 13px; font-weight: 600; color: var(--muted); }
@media (max-width: 620px) { .search-box { width: 100%; } .result-count { order: 3; } }

/* ---------- Post grid + cards ---------- */
.post-grid { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(24px, 3vw, 36px); }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-card); overflow: hidden; color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: #C9D8EC; color: inherit; }
.post-card .news-cover { border-radius: 0; }
.post-card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.post-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-card h3 {
  font-weight: 700; font-size: 17px; line-height: 1.36; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card .excerpt {
  font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card .card-link { margin-top: auto; padding-top: 4px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: clamp(28px, 3.4vw, 44px); }
.page-btn {
  min-width: 42px; height: 42px; padding: 0 12px; display: grid; place-items: center;
  border: 1px solid #D5DFEE; border-radius: 10px; background: #fff; color: var(--navy);
  font-family: var(--font-head); font-weight: 700; font-size: 14px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.page-btn:hover:not(:disabled) { border-color: #C9D8EC; background: var(--surface); }
.page-btn.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-btn .ms { font-size: 20px; }

/* ---------- Empty state ---------- */
.news-empty { text-align: center; max-width: 30em; margin: clamp(30px, 4vw, 56px) auto; }
.news-empty .ms { font-size: 46px; color: #B9C6DA; }
.news-empty h3 { font-weight: 700; font-size: 19px; margin: 14px 0 8px; }
.news-empty p { font-size: 14.5px; color: var(--muted); margin: 0 0 18px; }

.news-noscript { margin-top: 20px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 14px; }

/* ============================================================
   ARTICLE (detail) page
   ============================================================ */

/* Reading progress bar (top position set by JS to sit under the header) */
.read-progress {
  position: fixed; left: 0; height: 3px; width: 0; max-width: 100%;
  background: linear-gradient(90deg, var(--red), var(--orange)); z-index: 55;
}

.article-head { max-width: 780px; margin: 0 auto; }
.article-head .breadcrumb { color: #6B7C94; }
.article-head .breadcrumb a { color: var(--blue); }
.article-head .breadcrumb a:hover { color: var(--navy); }
.article-head .breadcrumb .current { color: #6B7C94; }
.article-head .cat-chip { margin: 18px 0 0; }
.article-head h1 { font-size: clamp(28px, 4vw, 46px); line-height: 1.12; margin: 14px 0 0; }
.article-sapo { font-size: clamp(16px, 1.7vw, 19px); font-weight: 600; line-height: 1.6; color: var(--muted); margin: 16px 0 0; }
.article-byline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 18px 0 0; font-size: 13.5px; color: #6B7C94; }
.article-byline .author { color: var(--navy); font-weight: 600; }
.article-byline .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: #C3CEDE; }

.article-cover { margin: clamp(24px, 3vw, 40px) 0 0; }
.article-cover .news-cover { border-radius: 16px; aspect-ratio: 16 / 7; }
.article-cover .news-cover .ms { font-size: clamp(56px, 9vw, 108px); }

.article-body-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(28px, 3.4vw, 56px);
  align-items: start; margin-top: clamp(28px, 3.4vw, 48px);
}
.article-content { max-width: 760px; min-width: 0; font-size: 17px; line-height: 1.8; color: var(--ink); }
.article-content > h2 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; margin: 34px 0 12px; }
.article-content > h3 { font-size: clamp(18px, 2vw, 22px); line-height: 1.3; margin: 26px 0 10px; }
.article-content p { margin: 0 0 18px; }
.article-content ul, .article-content ol { margin: 0 0 18px; padding-left: 22px; }
.article-content li { margin-bottom: 8px; padding-left: 4px; }
.article-content li::marker { color: var(--orange); }
.article-content a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.article-content a:hover { color: var(--navy); }
.article-content strong { color: var(--navy); }
.article-content [id] { scroll-margin-top: 120px; }

/* Data table (scrolls horizontally on mobile inside its own frame) */
.table-wrap { margin: 0 0 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.article-content table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 14.5px; }
.article-content thead th { background: var(--surface); color: var(--navy); font-family: var(--font-head); font-weight: 700; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.article-content tbody td { padding: 12px 16px; border-bottom: 1px solid #F2F5FA; }
.article-content tbody tr:last-child td { border-bottom: 0; }
.article-content tbody tr:nth-child(even) { background: #FBFCFE; }

/* Callout */
.callout { display: flex; gap: 12px; background: #FFF6EC; border: 1px solid #FBE1C2; border-left: 3px solid var(--orange); border-radius: 12px; padding: 16px 18px; margin: 0 0 20px; }
.callout .ms { color: var(--orange); font-size: 22px; flex: 0 0 auto; }
.callout p { margin: 0; font-size: 14.5px; line-height: 1.65; color: #6A4B22; }
.callout strong { color: #7A3E00; }

/* Tags */
.article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.article-tags .label { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.article-tags a { font-size: 12.5px; font-weight: 600; color: var(--blue); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.article-tags a:hover { background: #EDF3FB; border-color: #C9D8EC; }

/* Sidebar */
.article-aside { position: sticky; top: 96px; align-self: start; display: flex; flex-direction: column; gap: 20px; }
.toc { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 18px 20px; background: #fff; }
.toc h4 { font-family: var(--font-head); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); margin: 0 0 12px; }
.toc nav { display: flex; flex-direction: column; }
.toc a { font-size: 13.5px; line-height: 1.45; color: var(--muted); padding: 7px 0 7px 12px; border-left: 2px solid var(--line); transition: color .15s ease, border-color .15s ease; }
.toc a:hover { color: var(--navy); }
.toc a.is-active { color: var(--navy); font-weight: 600; border-left-color: var(--orange); }

.share h4, .aside-contact h4 { font-family: var(--font-head); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); margin: 0 0 12px; }
.share { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 18px 20px; background: #fff; }
.share-btns { display: flex; gap: 10px; }
.share-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--navy); cursor: pointer; transition: all .15s ease; }
.share-btn:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.share-btn .ms { font-size: 20px; }

.aside-contact { border: 0; border-radius: var(--radius-card); padding: 20px; background: var(--navy); background-image: linear-gradient(140deg, #1B3A6B, #22467E); color: #fff; }
.aside-contact h4 { color: #BFD4EE; }
.aside-contact .name { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.aside-contact .phone { display: inline-flex; align-items: center; gap: 7px; margin: 8px 0 16px; color: var(--orange); font-weight: 700; font-size: 17px; }
.aside-contact .phone .ms { font-size: 18px; }

/* Mobile collapsible TOC (shown < 1060px) */
.toc-collapse { display: none; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: 0 0 24px; }
.toc-collapse summary { list-style: none; cursor: pointer; padding: 14px 18px; font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); display: flex; align-items: center; justify-content: space-between; }
.toc-collapse summary::-webkit-details-marker { display: none; }
.toc-collapse summary .ms { transition: transform .2s ease; }
.toc-collapse[open] summary .ms { transform: rotate(180deg); }
.toc-collapse nav { display: flex; flex-direction: column; padding: 0 18px 14px; }
.toc-collapse a { font-size: 14px; color: var(--muted); padding: 8px 0 8px 12px; border-left: 2px solid var(--line); }
.toc-collapse a.is-active { color: var(--navy); font-weight: 600; border-left-color: var(--orange); }

@media (max-width: 1060px) {
  .article-body-grid { grid-template-columns: minmax(0, 1fr); }
  .article-aside { position: static; }
  .article-aside .toc { display: none; }
  .toc-collapse { display: block; }
}

/* Prev / next navigation */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(30px, 3.4vw, 48px); }
.post-nav a { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-card); background: #fff; color: inherit; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.post-nav a:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); border-color: #C9D8EC; color: inherit; }
.post-nav .dir { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.post-nav .dir .ms { font-size: 17px; }
.post-nav a.next { text-align: right; align-items: flex-end; }
.post-nav .t { font-family: var(--font-head); font-weight: 700; font-size: 15px; line-height: 1.35; color: var(--navy); }
.post-nav .placeholder { visibility: hidden; }
@media (max-width: 620px) { .post-nav { grid-template-columns: 1fr; } .post-nav a.next { text-align: left; align-items: flex-start; } }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(14, 31, 61, .3); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 80; display: inline-flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ms { font-size: 18px; color: #8CE0AE; }
