/* ═══════════════════════════════════════════════════════════
   ARTICLE / บทความ ARCHIVE PAGE — page-specific styles only.
   Header, footer, buttons, colors, .section, .wrap, .reveal, .eyebrow,
   .section-header/.section-title all come from the shared
   ../css/styles.css (same file the homepage and the other pages use),
   so layout / margins / buttons stay identical to the homepage.

   Layout/content structure mirrors the JMAC column category page
   (jmac.co.jp/column/category/production): page hero + category
   filter + grid of article cards (thumbnail, date, category tag,
   title, author).  Card visual language is lifted straight from the
   homepage's .news-card / .know-item so it feels native.

   Images/copy are placeholder — swap in the real brief once confirmed.
   ═══════════════════════════════════════════════════════════ */

/* Keep the current nav item ("ความรู้") visibly active while on this page */
.nav-item.current > .nav-link { color: var(--navy); }
.nav-item.current > .nav-link::after { transform: scaleX(1); }

/* ── PAGE HERO — same pattern as the Insight / Service pages ── */
.page-hero {
  position: relative;
  height: 380px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.page-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg,
    rgba(34,149,196,.92) 0%,
    rgba(34,149,196,.62) 32%,
    rgba(34,149,196,.18) 62%,
    rgba(34,149,196,0) 85%);
}
.page-hero-content {
  position: relative;
  z-index: 1;
  padding: 0 64px 48px;
  width: 100%;
}
.page-hero-crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans-en);
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  margin-bottom: 14px;
  letter-spacing: .2px;
}
.page-hero-crumb a { color: rgba(255,255,255,.85); text-decoration: none; }
.page-hero-crumb a:hover { color: #fff; text-decoration: underline; }
.page-hero-crumb span[aria-current] { color: #fff; }
.page-hero-title {
  font-family: var(--display);
  font-size: 52px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin: 0;
  letter-spacing: .3px;
}
.page-hero-sub {
  color: rgba(255,255,255,.92);
  font-size: clamp(16px, 1.25vw,18px);
  line-height: 1.6;
  margin: 14px 0 0;
  white-space: nowrap;   /* keep it on a single line on desktop */
}
/* Below the width where the one-liner would overflow, let it wrap again */
@media (max-width: 1200px) {
  .page-hero-sub { white-space: normal; max-width: 640px; }
}
@media (max-width: 960px) {
  .page-hero { height: 340px; }
  .page-hero-content { padding: 0 32px 32px; }
}
@media (max-width: 600px) {
  .page-hero { height: 300px; }
  .page-hero-content { padding: 0 24px 24px; }
}

/* ── CATEGORY FILTER CHIPS — mirrors the reference page's category
   sidebar, rendered as a horizontal filter bar.  Shape + colours reuse
   the site's brand language (cyan fill, cut corner like the buttons). ── */
.article-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 44px;
}
.art-chip {
  font-family: var(--sans-en);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--navy);
  /* Solid fill (no border) so the diagonal cut corner stays crisp —
     a bordered element clipped by clip-path loses its border on the cut,
     which read as "broken". Same fill approach as the homepage buttons. */
  background: var(--navy-soft);
  border: 0;
  height: 40px;
  padding: 0 20px;
  cursor: pointer;
  white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.art-chip:hover {
  background: var(--cyan-soft);
  color: var(--cyan-deep);
}
.art-chip.active {
  background: var(--cyan);
  color: #fff;
}

/* ── ARTICLE GRID — 3-up cards.  Card styling adapted from the
   homepage .news-card so the look is identical to the main site. ── */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
}
.article-card {
  display: flex;
  flex-direction: column;
  transition: transform .35s var(--ease), opacity .35s var(--ease);
}
.article-card.is-hidden { display: none; }
.article-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.article-card:hover { transform: translateY(-4px); }

.article-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: var(--navy);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  transition: filter .35s var(--ease);
  /* Cut-corner bottom-right — matches JMAC brand shape language */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}
.article-card:hover .article-thumb { filter: saturate(1.1); }

.article-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.article-date {
  font-family: var(--sans-en);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: #000;
}
.article-tag {
  display: inline-block;
  color: var(--cyan-deep);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .5px;
  font-family: var(--sans-en);
  position: relative;
  padding-left: 13px;
}
.article-tag::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cyan);
}
.article-card h3 {
  position: relative;
  display: inline-block;      /* underline hugs the text block */
  align-self: flex-start;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 18px;
  color: var(--navy);
  letter-spacing: -.005em;
  transition: color .25s;
}
/* Animated underline that sweeps in from the left on hover — same
   mechanism as the homepage Knowledge · Insights cards (scaleX 0→1,
   origin left, transform .4s var(--ease)). */
.article-card h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.article-card:hover h3 { color: var(--cyan); }
.article-card:hover h3::after { transform: scaleX(1); }

.article-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(20,46,88,.12);
}
/* Match the homepage Knowledge · Insights avatar: cyan-gradient square, white icon */
.article-avatar {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2D85C2 0%, #1697C2 45%, #4FB3D4 100%);
  color: #fff;
  font-size: 18px;
}
.article-author-text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}
.article-author-text b {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}
.article-author-text span {
  font-size: 16px;
  color: rgba(20,46,88,.6);
}

/* ── LOAD MORE ── */
.article-more {
  display: flex;
  justify-content: center;
  margin-top: 56px;
}

/* ── RESPONSIVE ── */
@media (max-width: 1040px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .article-grid { grid-template-columns: 1fr; gap: 32px; }
  .article-filters { gap: 10px; }
  .art-chip { height: 38px; padding: 0 16px; font-size: 16px; }
}
