/* web/themes/techprosolutions/css/components/blog-listing.css */
/**
 * Blog archive (/blog) + category pillar pages — editorial redesign
 * (Workstream B). Consumes design-tokens.css (LOCKED brand + 4px grid +
 * Manrope). All dimensions are 4px multiples; scoped under .et-archive.
 */

@font-face {
  font-family: 'Manrope';
  src: url('../../fonts/Manrope-VariableFont_wght.woff2?v=2') format('woff2-variations');
  font-family: 'Inter';
  src: url('../../fonts/Inter-VariableFont_wght.woff2?v=2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

.et-archive {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1a1f36;
  background: var(--et-surface);
  padding-bottom: var(--et-space-16);
}
.et-archive * { box-sizing: border-box; }
/* Reclaim heading casing from new.css `h1,h2{capitalize!important}`. */
.et-archive :is(h1, h2, h3, h4) {
  text-transform: none !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.et-archive__container {
  width: 100%;
  max-width: 76rem; /* 1216px */
  margin-inline: auto;
  padding-inline: var(--et-space-6);
}

/* Category pillar breadcrumb */
.et-archive__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--et-space-2);
  font-size: 0.875rem;
  color: var(--et-muted);
  margin-bottom: var(--et-space-4);
}
.et-archive__crumbs a { color: var(--et-muted); text-decoration: none; }
.et-archive__crumbs a:hover { color: var(--et-navy); text-decoration: underline; }
.et-archive__crumbs [aria-current="page"] { color: #1C3557; font-weight: 600; }

/* ---------------- Hero ---------------- */
.et-archive__hero {
  background: linear-gradient(180deg, var(--et-wash) 0%, var(--et-surface) 100%);
  padding-block: var(--et-space-16) var(--et-space-10);
  text-align: center;
}
.et-archive__eyebrow {
  font-size: var(--et-overline-size);
  font-weight: 700;
  letter-spacing: var(--et-overline-track);
  text-transform: uppercase;
  color: var(--et-green-600);
  margin: 0 0 var(--et-space-3);
}
.et-archive__title {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--et-ink);
  margin: 0 auto var(--et-space-4);
  max-width: 20ch;
  text-wrap: balance;
}
.et-archive__lead {
  font-size: var(--et-lead-size);
  line-height: 1.6;
  color: var(--et-muted);
  margin: 0 auto var(--et-space-8);
  max-width: 60ch;
}

/* Exposed search form → pill search box. Views renders a <form> with a text
   input (name="search") + submit. */
.et-archive__search { max-width: 34rem; margin-inline: auto; }
.et-archive__search .views-exposed-form {
  display: flex;
  gap: var(--et-space-2);
  align-items: stretch;
}
.et-archive__search .form--inline,
.et-archive__search .views-exposed-form__item,
.et-archive__search .form-item {
  flex: 1;
  margin: 0;
}
.et-archive__search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.et-archive__search input[type="text"] {
  width: 100%;
  height: 48px;
  padding: 0 var(--et-space-5);
  border: 1px solid var(--et-line);
  border-radius: var(--et-radius-pill);
  background: var(--et-surface);
  font-size: 1rem;
  color: var(--et-ink);
}
.et-archive__search input[type="text"]:focus,
.et-archive__search input[type="text"]:focus-visible {
  outline: none;
  border-color: var(--et-navy);
}
.et-archive__search input[type="submit"],
.et-archive__search button[type="submit"] {
  flex: 0 0 auto;
  height: 48px;
  padding: 0 var(--et-space-6);
  border: 0;
  border-radius: var(--et-radius-pill);
  background: var(--et-navy);
  color: #fff;
  font-weight: 700;
  letter-spacing: var(--et-btn-track);
  cursor: pointer;
  transition: background var(--et-dur-hover) var(--et-ease-out);
}
.et-archive__search input[type="submit"]:hover { background: var(--et-navy-700); }

/* ---------------- Category chips ---------------- */
.et-archive__chips {
  border-bottom: 1px solid var(--et-line);
  margin-bottom: var(--et-space-10);
}
.et-archive__chips .et-archive__container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--et-space-2);
  padding-block: var(--et-space-5);
}
.et-chip--nav {
  display: inline-flex;
  align-items: center;
  padding: var(--et-space-2) var(--et-space-4);
  border-radius: var(--et-radius-pill);
  background: var(--et-surface-2);
  border: 1px solid var(--et-line);
  color: var(--et-navy);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  transition: background var(--et-dur-hover) var(--et-ease-out),
              border-color var(--et-dur-hover) var(--et-ease-out);
}
.et-chip--nav:hover { background: var(--et-wash); border-color: var(--et-green); }
.et-chip--nav.is-active { background: var(--et-navy); border-color: var(--et-navy); color: #fff; }

/* ---------------- Featured card ---------------- */
.et-featured {
  margin-bottom: var(--et-space-12);
  border: 1px solid var(--et-line);
  border-radius: var(--et-radius-lg);
  overflow: hidden;
  background: var(--et-surface);
  transition: box-shadow var(--et-dur-hover) var(--et-ease-out);
}
.et-featured:hover { box-shadow: var(--et-shadow-lift); }
.et-featured__link {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  text-decoration: none;
  color: inherit;
}
.et-featured__media { position: relative; min-height: 20rem; background: var(--et-surface-2); }
.et-featured__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.et-featured__body {
  padding: var(--et-space-10);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--et-space-3);
  justify-content: center;
}
.et-featured__eyebrow {
  font-size: var(--et-overline-size);
  font-weight: 700;
  letter-spacing: var(--et-overline-track);
  text-transform: uppercase;
  color: var(--et-green-600);
}
.et-featured__badge { position: static; }
.et-featured__title {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--et-ink);
  margin: 0;
}
.et-featured__excerpt { color: var(--et-body-color); line-height: 1.6; margin: 0; }
.et-featured__cta { color: var(--et-green-600); font-weight: 700; margin-top: var(--et-space-2); }

/* ---------------- Grid + rich card ---------------- */
.et-archive__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: var(--et-space-8);
}
.et-rcard {
  border: 1px solid var(--et-line);
  border-radius: var(--et-radius-lg);
  overflow: hidden;
  background: var(--et-surface);
  transition: transform var(--et-dur-hover) var(--et-ease-out),
              box-shadow var(--et-dur-hover) var(--et-ease-out);
}
.et-rcard:hover { transform: translateY(-4px); box-shadow: var(--et-shadow-lift); }
.et-rcard__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.et-rcard__media { position: relative; aspect-ratio: 16 / 10; background: var(--et-surface-2); }
.et-rcard__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.et-rcard__media-fallback { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--et-wash), var(--et-surface-2)); }
.et-rcard__badge {
  position: absolute; top: var(--et-space-3); left: var(--et-space-3);
  padding: var(--et-space-1) var(--et-space-3); border-radius: var(--et-radius-pill);
  background: rgba(28, 53, 87, 0.92); color: #fff; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
}
.et-rcard__body { padding: var(--et-space-5); display: flex; flex-direction: column; gap: var(--et-space-2); flex: 1; }
.et-rcard__title {
  font-size: 1.125rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; color: var(--et-ink); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.et-rcard__excerpt {
  font-size: 0.9375rem; line-height: 1.55; color: var(--et-muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.et-rcard__meta {
  margin-top: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--et-space-2);
  font-size: 0.8125rem; color: var(--et-muted);
}
.et-rcard__dot { color: var(--et-line); }

.et-archive__empty { text-align: center; color: var(--et-muted); padding: var(--et-space-16) 0; }

/* ---------------- Pager ---------------- */
.et-archive__pager { margin-top: var(--et-space-12); }
.et-archive__pager .pager__items {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--et-space-2);
  list-style: none; margin: 0; padding: 0;
}
.et-archive__pager .pager__item a,
.et-archive__pager .pager__item.is-active a,
.et-archive__pager .pager__item span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 var(--et-space-3);
  border: 1px solid var(--et-line); border-radius: var(--et-radius-sm);
  color: var(--et-navy); text-decoration: none; font-weight: 600;
  transition: background var(--et-dur-hover) var(--et-ease-out);
}
.et-archive__pager .pager__item a:hover { background: var(--et-wash); border-color: var(--et-green); }
.et-archive__pager .pager__item.is-active a,
.et-archive__pager .pager__item.is-active span { background: var(--et-navy); color: #fff; border-color: var(--et-navy); }

.et-archive a:focus-visible,
.et-archive button:focus-visible {
  outline: 2px solid var(--et-navy);
  outline-offset: 2px;
  border-radius: 4px;
}
.et-archive input:focus,
.et-archive input:focus-visible {
  outline: none;
  border-color: var(--et-navy);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .et-featured__link { grid-template-columns: 1fr; }
  .et-featured__media { min-height: 14rem; position: relative; }
  .et-featured__media img { position: absolute; }
  .et-featured__body { padding: var(--et-space-6); }
}
@media (max-width: 768px) {
  .et-archive__hero { padding-block: var(--et-space-10) var(--et-space-8); }
  .et-archive__container { padding-inline: var(--et-space-4); }
  .et-archive__search .views-exposed-form { flex-direction: column; }
  .et-archive__grid { grid-template-columns: 1fr; gap: var(--et-space-6); }
}
@media (prefers-reduced-motion: reduce) {
  .et-rcard:hover, .et-featured:hover { transform: none; }
  .et-archive * { transition: none !important; }
}
