/* ============================================================
   Ambassador Group — Articles page archive (/articles)

   One efficient, beautiful page: a compact hero with the newsletter
   subscribe, a featured essay beside the start-here rail, and a dense,
   filterable, sortable library (essays + videos woven) whose controls —
   search, topic menu, format, sort — live in the archive filter bar.

   AG Design System: italic emphasis is never recolored (gold "pop"
   retired); the sort caret is a CSS-rotated border square, never a glyph;
   utility icons are inline Lucide-style SVG; Moss / Sand / Gold; self-
   hosted fonts.
   ============================================================ */

/* Italic emphasis: keep the italic, drop the recolor. */
.ar-hero h1 em, .ar-featured-body h2 em { font-style: italic; color: inherit; }

/* Compact hero ------------------------------------------------------------ */
.ar-hero { padding-block: clamp(26px, 3.2vw, 48px) clamp(26px, 3.2vw, 48px); }
.ar-hero h1 {
  font-size: clamp(38px, 4.6vw, 68px);
  line-height: 1.04;
  max-width: 16ch;
  margin: 12px 0 10px;
}
.ar-hero .hero-lead { max-width: 60ch; margin-bottom: 0; }
.ar-hero .news-strip { margin-top: 26px; }

/* Featured + start-here, side by side ------------------------------------- */
.ar-top { padding-block: clamp(32px, 4vw, 56px) clamp(20px, 2.5vw, 32px); }
.ar-top-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(20px, 2.6vw, 36px);
  align-items: stretch;
}
.ar-top-grid.is-solo { grid-template-columns: 1fr; }

.ar-featured {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(170, 143, 87, 0.3);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.ar-featured:hover { transform: translateY(-3px); box-shadow: 0 24px 48px rgba(27, 35, 29, 0.12); border-color: var(--color-gold-antique); }
.ar-featured-cover { position: relative; aspect-ratio: 16 / 9; background: var(--color-moss-dark); overflow: hidden; }
.ar-featured-body { padding: clamp(22px, 2.4vw, 36px); display: flex; flex-direction: column; flex: 1; }
.ar-featured-eyebrow { font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--color-moss-light); margin-bottom: 12px; }
.ar-featured-body h2 {
  font-family: var(--font-display); font-weight: 300; letter-spacing: -0.02em;
  font-size: clamp(24px, 2.6vw, 38px); line-height: 1.05; color: var(--color-ink); margin: 0 0 12px;
}
.ar-featured-body p { font-size: 16px; line-height: 1.6; color: var(--fg-2); margin: 0 0 18px; max-width: 56ch; }
.ar-featured-read { margin-top: auto; font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-moss-light); display: inline-flex; align-items: center; gap: 10px; }
.ar-featured-read::after { content: "→"; transition: transform 0.2s ease; }
.ar-featured:hover .ar-featured-read::after { transform: translateX(6px); }

/* Start-here rail (the column beside the featured essay) ------------------- */
.ar-startrail {
  border: 1px solid rgba(170, 143, 87, 0.3);
  background: #fff;
  padding: clamp(18px, 2vw, 26px) clamp(20px, 2.2vw, 28px) 8px;
  display: flex;
  flex-direction: column;
}
.ar-startrail .pillar-rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.ar-startrail .pillar-rail-note { font-size: 0.8rem; opacity: 0.7; }
.ar-startrail .pillar-rail-note a { color: var(--color-gold-antique); text-decoration: none; }
.ar-startrail .pillar-list { list-style: none; margin: 0; padding: 0; }
.ar-startrail .pillar-list li { border-top: 1px solid var(--rule-soft); }
.ar-startrail .pillar-list li:first-child { border-top: none; }
.ar-startrail .pillar-list a { display: flex; align-items: flex-start; gap: 14px; padding: 14px 2px; text-decoration: none; color: inherit; }
.ar-startrail .pillar-thumb { width: 84px; height: 56px; flex: none; position: relative; overflow: hidden; background: var(--color-moss-dark); }
.ar-startrail .pillar-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ar-startrail .pillar-main { min-width: 0; display: flex; flex-direction: column; }
.ar-startrail .pillar-topic { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 5px; }
.ar-startrail .pillar-ttl { font-family: var(--font-display); font-weight: 400; font-size: 16px; line-height: 1.18; letter-spacing: -0.01em; color: var(--color-ink); transition: color 0.15s ease; }
.ar-startrail .pillar-list a:hover .pillar-ttl { color: var(--color-gold-antique); }
.ar-startrail .pillar-exc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-family: var(--font-body); font-size: 12.5px; line-height: 1.45; color: var(--fg-muted); margin-top: 5px;
}

/* Archive ----------------------------------------------------------------- */
.ar-archive { padding-block: clamp(24px, 3vw, 40px) clamp(40px, 5vw, 72px); }
.ar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.ar-count { font-family: var(--font-body); font-size: 13px; color: var(--fg-muted); letter-spacing: 0.02em; margin: 0; }
.ar-filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Search (compact, in the filter bar) */
.ar-search { display: flex; align-items: center; gap: 9px; width: 210px; background: #fff; border: 1px solid rgba(170, 143, 87, 0.5); padding: 9px 13px; }
.ar-search svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--fg-muted); stroke-width: 1.5; stroke-linecap: round; }
.ar-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-family: var(--font-body); font-size: 14px; color: var(--color-ink); }
.ar-search input::placeholder { color: var(--fg-muted); font-style: italic; }

/* Topic dropdown menu */
.ar-menu { position: relative; }
.ar-menu-btn {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--rule-soft); background: transparent; padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-2);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.ar-menu-btn::-webkit-details-marker { display: none; }
.ar-menu-btn:hover { border-color: var(--color-gold-antique); color: var(--color-ink); }
.ar-menu[data-active] .ar-menu-btn { border-color: var(--color-gold-antique); color: var(--color-ink); }
.ar-menu-caret { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 0.15s ease; margin-top: -2px; }
.ar-menu[open] .ar-menu-caret { transform: rotate(-135deg); margin-top: 2px; }
.ar-menu-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 210px; max-height: 60vh; overflow: auto;
  background: #fff; border: 1px solid rgba(170, 143, 87, 0.4);
  box-shadow: 0 16px 32px rgba(27, 35, 29, 0.14);
  padding: 6px; display: flex; flex-direction: column;
}
.ar-menu-item {
  appearance: none; cursor: pointer; background: none; border: 0; text-align: left;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 9px 12px; font-family: var(--font-body); font-size: 14px; color: var(--fg-2);
  transition: background 0.12s ease, color 0.12s ease;
}
.ar-menu-item:hover { background: rgba(170, 143, 87, 0.08); color: var(--color-ink); }
.ar-menu-item.is-active { color: var(--color-gold-antique); font-weight: 600; }
.ar-menu-n { font-size: 11px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }

/* Format chips */
.ar-formats { display: inline-flex; gap: 6px; }
.ar-format {
  appearance: none; cursor: pointer; background: transparent;
  border: 1px solid var(--rule-soft); border-radius: var(--radius-pill); padding: 8px 14px;
  font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-2); display: inline-flex; align-items: center; gap: 7px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.ar-format:hover { border-color: var(--color-gold-antique); color: var(--color-ink); }
.ar-format.is-active { background: var(--color-gold-antique); border-color: var(--color-gold-antique); color: var(--color-moss-dark); }
.ar-format-n { font-size: 10px; opacity: 0.7; font-variant-numeric: tabular-nums; }

/* List substrate (flex column so JS can reorder via `order`) -------------- */
.ar-list { display: flex; flex-direction: column; border-top: 1px solid var(--rule-soft); }
.ar-headrow { order: -1; }
.ar-headrow,
.ar-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 168px 116px;
  align-items: center;
  gap: 18px;
}
.ar-headrow { border-bottom: 1px solid var(--rule-soft); padding: 0 4px; min-height: 42px; }
.ar-cell { display: block; }

.sort-head {
  appearance: none; background: none; border: 0; margin: 0; padding: 12px 0;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-muted); transition: color 0.12s ease; white-space: nowrap;
}
.sort-head:hover { color: var(--color-ink); }
.sort-head[aria-sort="ascending"], .sort-head[aria-sort="descending"] { color: var(--color-gold-antique); }
.sort-head:focus-visible { outline: 2px solid var(--color-gold-antique); outline-offset: 3px; }
.sort-head::after {
  content: ""; width: 6px; height: 6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  opacity: 0; transform: rotate(45deg); transition: transform 0.12s ease, opacity 0.12s ease;
}
.sort-head[aria-sort="descending"]::after { opacity: 1; transform: rotate(45deg); }
.sort-head[aria-sort="ascending"]::after { opacity: 1; transform: rotate(-135deg); }

.ar-row { padding: 14px 4px; border-bottom: 1px solid var(--rule-soft); text-decoration: none; color: inherit; transition: background 0.12s ease; }
.ar-row:hover { background: rgba(170, 143, 87, 0.06); }
.ar-row:hover .ar-title { color: var(--color-gold-antique); }
.ar-row.ar-hide { display: none; }

.ar-thumb { width: 104px; height: 70px; position: relative; overflow: hidden; background: var(--color-moss-dark); flex: none; }
.ar-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ar-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--color-gold-antique); background: rgba(41, 53, 46, 0.35); }

.ar-main { min-width: 0; }
.ar-title { display: block; font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; font-size: 17px; line-height: 1.2; color: var(--color-ink); transition: color 0.12s ease; }
.ar-excerpt {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-family: var(--font-body); font-size: 12.5px; line-height: 1.45; color: var(--fg-muted); margin-top: 4px;
}
.ar-sub-inline { display: none; font-family: var(--font-body); font-size: 12px; color: var(--fg-muted); margin-top: 3px; }
.ar-topic { font-family: var(--font-body); font-size: 13px; color: var(--fg-2); }
.ar-date { font-family: var(--font-body); font-size: 12px; color: var(--fg-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.ar-sentinel { height: 1px; }
.ar-empty { text-align: center; font-family: var(--font-body); font-size: 14px; color: var(--fg-muted); padding: 32px 0; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 860px) {
  .ar-top-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .ar-headrow { display: none; }
  .ar-row { grid-template-columns: 88px minmax(0, 1fr); }
  .ar-thumb { width: 88px; height: 60px; }
  .ar-col-topic, .ar-col-date { display: none; }
  .ar-excerpt { display: none; }
  .ar-sub-inline { display: block; }
  .ar-featured-cover { aspect-ratio: 16 / 9; }
  .ar-toolbar { align-items: flex-start; }
  .ar-search { width: 100%; }
  .ar-filterbar { width: 100%; }
}
