/* ==========================================================================
   Archive / Category / Tag / Author listing page
   BEM prefix: arch-*
   Sidebar reuses: lsoc-*, lexpl-*, ocard, pcard__* (vars declared here)
   ========================================================================== */

/* ── CSS Variables ──────────────────────────────────────────────────────── */
:root {
  /* Section */
  --arch-bg:          #ffffff;
  --arch-sec-pad:     40px;
  --arch-gap:         28px;

  /* Breadcrumb */
  --arch-bread-link:  #374151;
  --arch-bread-cur:   #111827;
  --arch-bread-sep:   #9ca3af;

  /* Category header */
  --arch-hdr-title:   #111827;
  --arch-hdr-desc:    #6b7280;
  --arch-hdr-count:   #e71d36;
  --arch-hdr-lbl:     #6b7280;
  --arch-hdr-border:  rgba(0, 0, 0, 0.08);

  /* Post cards */
  --arch-card-bg:     #ffffff;
  --arch-card-border: rgba(0, 0, 0, 0.06);
  --arch-card-radius: 12px;
  --arch-card-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  --arch-card-gap:    20px;
  --arch-thumb-w:     280px;
  --arch-title-col:   #111827;
  --arch-expt-col:    #6b7280;

  /* Pagination */
  --arch-pag-bg:        #ffffff;
  --arch-pag-border:    #e5e7eb;
  --arch-pag-color:     #374151;
  --arch-pag-hover-bg:  #f3f4f6;
  --arch-pag-active-bg: #e71d36;
  --arch-pag-active-fg: #ffffff;
  --arch-pag-radius:    8px;

  /* Sidebar component vars (shared with home.css lnews) */
  --lsoc-box-radius: 10px;
  --lsoc-box-pad:    12px 14px;
  --lexpl-border:    rgba(0, 0, 0, 0.08);
  --lexpl-title-col: #111827;
  --lexpl-read-col:  #9ca3af;

  /* pcard meta (shared badge/meta component) */
  --pcard-title-color: #111827;
  --pcard-meta-color:  #6b7280;
  --pcard-meta-link:   #374151;

  /* ocard (overlay card used by explore feat) */
  --wng-radius:        10px;

  /* sec-hdr title color for lexpl-hdr */
  --sec-hdr-title-color: #111827;
}

body.dark-mode {
  --arch-bg:          #000000;
  --arch-bread-link:  rgba(255, 255, 255, 0.65);
  --arch-bread-cur:   rgba(255, 255, 255, 0.90);
  --arch-bread-sep:   rgba(255, 255, 255, 0.30);
  --arch-hdr-title:   rgba(255, 255, 255, 0.92);
  --arch-hdr-desc:    rgba(255, 255, 255, 0.55);
  --arch-hdr-count:   #ff4d6d;
  --arch-hdr-lbl:     rgba(255, 255, 255, 0.55);
  --arch-hdr-border:  rgba(255, 255, 255, 0.08);
  --arch-card-bg:     #111827;
  --arch-card-border: rgba(255, 255, 255, 0.06);
  --arch-card-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  --arch-title-col:   rgba(255, 255, 255, 0.92);
  --arch-expt-col:    rgba(255, 255, 255, 0.50);
  --arch-pag-bg:      #111827;
  --arch-pag-border:  rgba(255, 255, 255, 0.10);
  --arch-pag-color:   rgba(255, 255, 255, 0.75);
  --arch-pag-hover-bg: rgba(255, 255, 255, 0.06);
  --lexpl-border:     rgba(255, 255, 255, 0.08);
  --lexpl-title-col:  rgba(255, 255, 255, 0.90);
  --lexpl-read-col:   rgba(255, 255, 255, 0.42);
  --pcard-title-color: rgba(255, 255, 255, 0.92);
  --pcard-meta-color:  rgba(255, 255, 255, 0.50);
  --pcard-meta-link:   rgba(255, 255, 255, 0.72);
  --sec-hdr-title-color: rgba(255, 255, 255, 0.92);
}

/* ── Section wrapper ────────────────────────────────────────────────────── */
.arch-section {
  background: var(--arch-bg);
  padding: var(--arch-sec-pad) 0;
  transition: background-color 0.25s ease;
  min-height: 60vh;
}

/* ── Inner container ────────────────────────────────────────────────────── */
.arch-outer {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────── */
.arch-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.arch-breadcrumb__item {
  display: inline-flex;
  align-items: center;
}

.arch-breadcrumb__link {
  color: var(--arch-bread-link);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.arch-breadcrumb__link:hover {
  color: #e71d36;
}

body.dark-mode .arch-breadcrumb__link:hover {
  color: #ff4d6d;
}

.arch-breadcrumb__item--current {
  color: var(--arch-bread-cur);
  font-size: 13px;
  font-weight: 600;
}

.arch-breadcrumb__sep {
  font-size: 10px;
  color: var(--arch-bread-sep);
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* ── Category info header ───────────────────────────────────────────────── */
.arch-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--arch-hdr-border);
  margin-bottom: 28px;
}

.arch-header__left {
  flex: 1 1 auto;
  min-width: 0;
}

.arch-header__title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--arch-hdr-title);
}

.arch-header__desc {
  color: var(--arch-hdr-desc);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

.arch-header__desc p {
  margin: 0;
  color: inherit;
}

.arch-header__count {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.arch-header__count-num {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  color: var(--arch-hdr-count);
}

.arch-header__count-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--arch-hdr-lbl);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Main 2-column grid: content (2fr) + sidebar (1fr) ─────────────────── */
.arch-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--arch-gap);
  align-items: start;
}

/* ── Full-width grid when sidebar is disabled ───────────────────────────── */
.arch-grid--full {
  grid-template-columns: 1fr;
}

/* ── Posts list ─────────────────────────────────────────────────────────── */
.arch-posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--arch-card-gap);
}

.arch-posts__item {
  display: block;
}

.arch-no-posts {
  color: var(--arch-expt-col);
  font-size: 15px;
  padding: 40px 0;
  text-align: center;
}

/* ── Horizontal post card ───────────────────────────────────────────────── */
.arch-card {
  display: flex;
  align-items: stretch;
  background: var(--arch-card-bg);
  border-radius: var(--arch-card-radius);
  border: 1px solid var(--arch-card-border);
  box-shadow: var(--arch-card-shadow);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.arch-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

body.dark-mode .arch-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
}

/*
 * Thumbnail flush left, fills full card height.
 * img is position:absolute so it has no natural height in flow — the body
 * content alone determines card height via align-items:stretch.
 * Portrait images cannot inflate the card because they are out of flow.
 */
.arch-card__thumb-wrap {
  flex-shrink: 0;
  position: relative;
  width: var(--arch-thumb-w);
  overflow: hidden;
  text-decoration: none;
  background: #e5e7eb;
}

body.dark-mode .arch-card__thumb-wrap {
  background: rgba(255, 255, 255, 0.06);
}

.arch-card__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.arch-card:hover .arch-card__thumb {
  transform: scale(1.05);
}

/* ── Card body ──────────────────────────────────────────────────────────── */
.arch-card__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
}

/* Category badge — reuses .pcard__badge styles via dual class */
.arch-card__badge {
  /* Layout handled by .pcard__badge from shared vars */
}

/* ── Card title ─────────────────────────────────────────────────────────── */
.arch-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.42;
  color: var(--arch-title-col);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.arch-card__title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.arch-card__title-link:hover {
  color: #e71d36;
}

body.dark-mode .arch-card__title-link:hover {
  color: #ff4d6d;
}

/* ── Card excerpt ───────────────────────────────────────────────────────── */
.arch-card__excerpt {
  margin: 0;
  font-size: 13px;
  line-height: 1.60;
  color: var(--arch-expt-col);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Card meta — extends .pcard__meta ───────────────────────────────────── */
.arch-card__meta {
  margin-top: auto;
  padding-top: 4px;
}

/* ── Sticky sidebar ─────────────────────────────────────────────────────── */
.arch-sidebar {
  position: sticky;
  top: calc(var(--hdr-height, 65px) + 16px);
  align-self: start;
  min-width: 0;
  overflow-y: auto;
  max-height: calc(100vh - var(--hdr-height, 65px) - 32px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.arch-sidebar::-webkit-scrollbar {
  display: none;
}

/* ── Sidebar social boxes (lsoc-* from home.css duplicated for archive) ── */
.arch-soc-grid {
  margin-bottom: 24px;
}

.lsoc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lsoc-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--lsoc-box-pad);
  border-radius: var(--lsoc-box-radius);
  background: var(--lsoc-color, #1877f2);
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  min-width: 0;
}

.lsoc-box:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.lsoc-box__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: #ffffff;
  width: 20px;
  height: 20px;
}

.lsoc-box__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lsoc-box__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.lsoc-box__name {
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lsoc-box__count {
  color: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Explore more header ────────────────────────────────────────────────── */
.lexpl-hdr {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--sec-hdr-title-color);
  display: flex;
  align-items: center;
  gap: 4px;
}

.lexpl-hdr__chevron {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.45;
  display: inline-flex;
  align-items: center;
}

/* ── Featured overlay card ──────────────────────────────────────────────── */
.lexpl-feat {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 4px;
}

.lexpl-feat .ocard {
  position: absolute;
  inset: 0;
  border-radius: 0;
  height: 100%;
}

/* ── Overlay card (ocard) ───────────────────────────────────────────────── */
.ocard {
  position: relative;
  border-radius: var(--wng-radius);
  overflow: hidden;
  width: 100%;
  height: 100%;
  display: block;
}

.ocard__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ocard:hover .ocard__img {
  transform: scale(1.05);
}

.ocard__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.84) 0%,
    rgba(0, 0, 0, 0.32) 52%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 22px;
  pointer-events: none;
}

.ocard--small .ocard__overlay {
  padding: 14px 16px;
}

.ocard__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-decoration: none;
  margin-bottom: 8px;
  width: fit-content;
  pointer-events: auto;
  transition: background-color 0.2s ease;
}

.ocard__badge:hover {
  background: rgba(255, 255, 255, 0.28);
}

.ocard--small .ocard__badge {
  padding: 2px 8px 2px 6px;
  margin-bottom: 6px;
}

.ocard__badge-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: hsl(var(--badge-hue, 258), 70%, 60%);
}

.ocard__badge-text {
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.ocard__title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.40;
  color: #ffffff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ocard--small .ocard__title {
  font-size: 13px;
  margin-bottom: 8px;
}

.ocard__title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ocard__title-link:hover {
  color: #e71d36;
}

body.dark-mode .ocard__title-link:hover {
  color: #ff4d6d;
}

.ocard__title-link::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
}

.ocard__badge,
.ocard__meta {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.ocard__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.ocard__av-wrap {
  flex-shrink: 0;
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  text-decoration: none;
}

.ocard__avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ocard__author {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
  max-width: 90px;
  transition: color 0.2s ease;
}

.ocard__author:hover {
  color: #ffffff;
}

.ocard__sep {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.50);
  font-size: 11px;
}

.ocard__clock {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.55);
}

.ocard__readtime {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.70);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

/* ── pcard shared components (badge / meta) ─────────────────────────────── */
.pcard__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 7px;
  border-radius: 999px;
  background: hsla(var(--badge-hue, 258), 70%, 55%, 0.12);
  text-decoration: none;
  margin-bottom: 6px;
  width: fit-content;
  max-width: 100%;
  transition: background-color 0.2s ease;
}

.pcard__badge:hover {
  background: hsla(var(--badge-hue, 258), 70%, 55%, 0.22);
}

.pcard__badge-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: hsl(var(--badge-hue, 258), 70%, 50%);
}

.pcard__badge-text {
  color: hsl(var(--badge-hue, 258), 58%, 36%);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark-mode .pcard__badge-text {
  color: hsl(var(--badge-hue, 258), 70%, 72%);
}

.pcard__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.pcard__av-wrap {
  flex-shrink: 0;
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  text-decoration: none;
}

.pcard__avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

.pcard__author {
  flex-shrink: 0;
  color: var(--pcard-meta-link);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
  transition: color 0.2s ease;
}

.pcard__author:hover {
  color: #e71d36;
}

body.dark-mode .pcard__author:hover {
  color: #ff4d6d;
}

.pcard__sep {
  flex-shrink: 0;
  color: var(--pcard-meta-color);
  font-size: 11px;
  line-height: 1;
}

.pcard__clock {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  color: var(--pcard-meta-color);
}

.pcard__readtime {
  flex-shrink: 0;
  color: var(--pcard-meta-color);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.pcard__share {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--pcard-meta-color);
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pcard__share:hover {
  color: #e71d36;
}

body.dark-mode .pcard__share:hover {
  color: #ff4d6d;
}

/* ── Compact explore list ───────────────────────────────────────────────── */
.lexpl-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lexpl-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--lexpl-border);
}

.lexpl-item__thumb-wrap {
  flex-shrink: 0;
  display: block;
  width: 120px;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e7eb;
  text-decoration: none;
}

body.dark-mode .lexpl-item__thumb-wrap {
  background: rgba(255, 255, 255, 0.08);
}

.lexpl-item__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lexpl-item:hover .lexpl-item__thumb {
  transform: scale(1.06);
}

.lexpl-item__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lexpl-item__cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

.lexpl-item__cat-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(var(--badge-hue, 258), 70%, 50%);
}

.lexpl-item__cat-name {
  color: hsl(var(--badge-hue, 258), 58%, 42%);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

body.dark-mode .lexpl-item__cat-name {
  color: hsl(var(--badge-hue, 258), 70%, 68%);
}

.lexpl-item__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.40;
  color: var(--lexpl-title-col);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lexpl-item__title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.lexpl-item__title-link:hover {
  color: #e71d36;
}

body.dark-mode .lexpl-item__title-link:hover {
  color: #ff4d6d;
}

.lexpl-item__read {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--lexpl-read-col);
  font-size: 11px;
  line-height: 1;
}

/* ── Box-square pagination ──────────────────────────────────────────────── */
.arch-pagination {
  margin-top: 32px;
}

.arch-pagination__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.arch-pagination__item {
  display: block;
}

/* All paginate_links() produce <a> or <span class="current"/"dots"> */
.arch-pagination__item a,
.arch-pagination__item .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--arch-pag-radius);
  border: 1px solid var(--arch-pag-border);
  background: var(--arch-pag-bg);
  color: var(--arch-pag-color);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.arch-pagination__item a:hover,
.arch-pagination__item .page-numbers:not(.current):not(.dots):hover {
  background: var(--arch-pag-hover-bg);
  border-color: var(--arch-pag-border);
}

.arch-pagination__item .page-numbers.current {
  background: var(--arch-pag-active-bg);
  border-color: var(--arch-pag-active-bg);
  color: var(--arch-pag-active-fg);
  font-weight: 700;
  cursor: default;
}

.arch-pagination__item .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  cursor: default;
}

/* prev/next chevron buttons */
.arch-pagination__item .prev.page-numbers,
.arch-pagination__item .next.page-numbers {
  border-radius: var(--arch-pag-radius);
}

/* ── Responsive — Tablet (≤1024px) ─────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --arch-sec-pad: 36px;
    --arch-gap:     22px;
    --arch-thumb-w: 220px;
  }

  .arch-header__title {
    font-size: 24px;
  }

  .arch-header__count-num {
    font-size: 30px;
  }
}

/* ── Responsive — Tablet narrow (≤900px): stack sidebar below ───────────── */
@media (max-width: 900px) {
  /* Sidebar stacks below → main col is now full arch-outer width.
     Increase thumb proportionally so it stays ~4/6 of the wider card. */
  :root { --arch-thumb-w: 260px; }

  .arch-grid {
    grid-template-columns: 1fr;
  }

  .arch-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
  }

  .lsoc-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .lexpl-feat {
    aspect-ratio: 16 / 6;
  }
}

/* ── Responsive — Mobile (≤640px) ──────────────────────────────────────── */
@media (max-width: 640px) {
  :root {
    --arch-sec-pad: 28px;
    --arch-gap:     18px;
    --arch-thumb-w: 140px;
  }

  .arch-outer {
    padding: 0 14px;
  }

  .arch-card__body {
    padding: 12px 14px;
  }

  .arch-header {
    flex-wrap: wrap;
  }

  .arch-header__title {
    font-size: 22px;
  }

  .arch-card__excerpt {
    display: none;
  }

  .lsoc-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Responsive — Mobile small (≤420px) ────────────────────────────────── */
@media (max-width: 420px) {
  :root {
    --arch-thumb-w: 110px;
  }

  .arch-card__title {
    font-size: 14px;
  }
}

/* ==========================================================================
   Search Results Page  (srch-*)
   Full-width — no sidebar.
   Layout: arch-outer container + 3-col vertical card grid.
   Card reuses pcard__badge, pcard__meta (already declared above).
   ========================================================================== */

/* ── Section wrapper — inherits arch-bg, arch-sec-pad variables ─────────── */
.srch-section {
  background: var(--arch-bg);
  padding: var(--arch-sec-pad) 0;
  transition: background-color 0.25s ease;
  min-height: 60vh;
}

/* ── Container — matches arch-outer / header / footer width ─────────────── */
.srch-outer {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Scale up arch-header title in full-width search context ─────────────── */
.srch-section .arch-header__title {
  font-size: clamp(22px, 3.5vw, 34px);
}

/* ── Keyword highlight in the arch-header__title ────────────────────────── */
.srch-kw {
  display: inline;
  background: var(--color-primary, #2563eb);
  color: #ffffff;
  padding: 1px 8px;
  border-radius: 4px;
  font-style: normal;
}

/* ── 3-column card grid ─────────────────────────────────────────────────── */
.srch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 8px;
}

/* ── Search card (vertical) ─────────────────────────────────────────────── */
.srch-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--arch-card-bg);
  border-radius: var(--arch-card-radius);
  border: 1px solid var(--arch-card-border);
  box-shadow: var(--arch-card-shadow);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
}

.srch-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

body.dark-mode .srch-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
}

/* Thumbnail — full card width, aspect-ratio from inline CSS var */
.srch-card__thumb-wrap {
  display: block;
  position: relative;
  aspect-ratio: var(--srch-ratio, 3/2);
  overflow: hidden;
  background: #e5e7eb;
  text-decoration: none;
  flex-shrink: 0;
}

body.dark-mode .srch-card__thumb-wrap {
  background: rgba(255, 255, 255, 0.08);
}

.srch-card__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.srch-card:hover .srch-card__thumb {
  transform: scale(1.05);
}

/* Card body */
.srch-card__body {
  display: flex;
  flex-direction: column;
  padding: 12px 14px 14px;
  flex: 1 0 auto;
}

/* Title — 2-line clamp */
.srch-card__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.42;
  color: var(--arch-title-col);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/*
 * Explicit color — overrides global a { color: var(--color-primary) } from typography.css.
 * Uses double-class specificity (.srch-card .srch-card__title-link = 0,2,0) to stay
 * above any element+class combos that might appear in third-party CSS.
 * Hover: opacity reduction on the design-system color, no hue change.
 */
.srch-card .srch-card__title-link {
  color: var(--arch-title-col);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.srch-card .srch-card__title-link:hover {
  opacity: 0.68;
}

/* Excerpt — 2-line clamp */
.srch-card__excerpt {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.60;
  color: var(--arch-expt-col);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta row pushed to bottom of card */
.srch-card__meta { margin-top: auto; }

/* ── Search empty state ─────────────────────────────────────────────────── */
.srch-empty {
  text-align: center;
  padding: 64px 20px;
  max-width: 520px;
  margin: 0 auto;
}

.srch-empty__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--arch-hdr-lbl);
  opacity: 0.45;
}

.srch-empty__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--arch-hdr-title);
  margin: 0 0 10px;
  line-height: 1.3;
}

.srch-empty__kw {
  color: #e71d36;
  font-style: italic;
}

body.dark-mode .srch-empty__kw { color: #ff4d6d; }

.srch-empty__msg {
  font-size: 14px;
  color: var(--arch-hdr-desc);
  margin: 0 0 28px;
  line-height: 1.65;
}

/* WP search form inside empty state */
.srch-empty__form .search-form {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.srch-empty__form .search-field {
  padding: 10px 16px;
  border: 1px solid var(--arch-hdr-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--arch-card-bg);
  color: var(--arch-hdr-title);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 340px;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.srch-empty__form .search-field:focus {
  border-color: #e71d36;
  box-shadow: 0 0 0 3px rgba(231, 29, 54, 0.10);
}

body.dark-mode .srch-empty__form .search-field:focus {
  border-color: #ff4d6d;
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.12);
}

.srch-empty__form .search-submit {
  padding: 10px 24px;
  background: #e71d36;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s;
  flex-shrink: 0;
}

.srch-empty__form .search-submit:hover { background: #c41230; }

/* ── srch-* Responsive ──────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .srch-grid { gap: 20px; }
  .srch-card__title { font-size: 15px; }
}

@media (max-width: 900px) {
  .srch-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}

@media (max-width: 640px) {
  .srch-outer { padding: 0 14px; }
  .srch-grid  { gap: 14px; }
  .srch-card__excerpt { display: none; }
  .srch-empty { padding: 48px 0; }
  .srch-empty__title { font-size: 19px; }
  .srch-empty__form .search-field { min-width: 0; max-width: 100%; }
}

@media (max-width: 480px) {
  .srch-grid { grid-template-columns: 1fr; }
  .srch-card__excerpt { display: -webkit-box; }
  .srch-card__title { font-size: 14px; }
}

/* ==========================================================================
   Author Archive Page  (abox-*)
   Full-width — no sidebar.
   Reuses: srch-section, srch-outer, srch-grid, srch-card (search-card.php),
           arch-breadcrumb, arch-pagination.
   Only new CSS: abox-head block (avatar + info + count row).
   ========================================================================== */

/* ── Author header row: info (left) + count (right) ─────────────────────── */
.abox-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 15px;
  padding-bottom: 40px;
  margin-bottom: 28px;
  position: relative;
}

/* Dot separator at bottom — matches source jl_sep_dot pattern */
.abox-head::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10px;
  content: '';
  background-image: radial-gradient(rgba(0, 0, 0, 0.14) 1px, transparent 1px);
  background-size: 4px 4px;
  background-position: 1px 1px;
}

body.dark-mode .abox-head::after {
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
}

/* ── Left side: avatar + text column ────────────────────────────────────── */
.abox-info {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1 1 0;
  min-width: 0;
}

/* ── Avatar ─────────────────────────────────────────────────────────────── */
.abox-avatar {
  flex: 0 0 100px;
  width: 100px;
  height: 100px;
  border-radius: 9999px;
  overflow: hidden;
  display: block;
  position: relative;
  text-decoration: none;
  flex-shrink: 0;
  align-self: flex-start;
}

.abox-avatar__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
}

/* ── Author text content ─────────────────────────────────────────────────── */
.abox-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.abox-lbl {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--arch-expt-col);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.abox-name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0;
  font-size: 33px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--arch-hdr-title);
}

/* Explicit override — beats global a { color: var(--color-primary) } */
.abox-name .abox-name__link {
  color: var(--arch-hdr-title);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.abox-name .abox-name__link:hover {
  opacity: 0.72;
}

.abox-name__role {
  font-size: 50%;
  font-weight: 400;
  color: var(--arch-hdr-desc);
  opacity: 0.85;
  align-self: center;
}

/* Bio — line-clamp via CSS custom property set inline from Customizer */
.abox-bio {
  margin: 5px 0 0;
  font-size: 16px;
  line-height: 1.60;
  color: var(--arch-hdr-desc);
  max-width: 640px;
  display: -webkit-box;
  -webkit-line-clamp: var(--abox-bio-lines, 2);
  line-clamp: var(--abox-bio-lines, 2);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Social icons row */
.abox-social {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  list-style: none;
  margin: 15px 0 0;
  padding: 0;
}

.abox-social__item {
  display: flex;
  align-items: center;
}

.abox-social__link {
  font-size: 18px;
  display: flex;
  align-items: center;
  color: var(--arch-expt-col);
  text-decoration: none;
  transition: color 0.2s ease;
}

.abox-social__link:hover {
  color: var(--arch-hdr-title);
}

/* ── Right side: article count ───────────────────────────────────────────── */
.abox-count {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  align-self: flex-end;
}

.abox-count__num {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  color: var(--arch-hdr-count);
  margin: 0;
}

.abox-count__lbl {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--arch-hdr-lbl);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── abox-* Responsive ──────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .abox-name { font-size: 26px; }
  .abox-bio  { font-size: 15px; }
}

@media (max-width: 768px) {
  .abox-count { display: none; }
  .abox-info  { gap: 15px; }
  .abox-avatar {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
  }
  .abox-name { font-size: 22px; }
  .abox-bio  { font-size: 14px; max-width: 100%; }
  .abox-head { padding-bottom: 28px; margin-bottom: 20px; }
}

@media (max-width: 480px) {
  .abox-info    { flex-direction: column; align-items: flex-start; gap: 10px; }
  .abox-avatar  { flex: 0 0 64px; width: 64px; height: 64px; }
  .abox-name    { font-size: 20px; }
  .abox-social  { gap: 12px; margin-top: 12px; }
  .abox-head    { padding-bottom: 22px; }
}
