/* Blog archive — premium editorial layout */

.apm-blog-archive {
  background: #f8fafc;
}

.apm-blog-archive .apm-header {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

.apm-blog-archive .apm-nav .current-menu-item > a,
.apm-blog-archive .apm-nav .current_page_parent > a {
  color: #0d5bdb;
}

.apm-blog-archive .apm-nav .current-menu-item > a::after,
.apm-blog-archive .apm-nav .current_page_parent > a::after {
  transform: scaleX(1);
}

/* ─── Hero ─── */
.apm-blog-hero {
  position: relative;
  min-height: 360px;
  max-height: 420px;
  padding: 40px 0 72px;
  background: linear-gradient(135deg, #f4f8ff 0%, #eef4ff 50%, #f8fafc 100%);
  overflow: visible;
}

.apm-blog-hero__glow {
  position: absolute;
  top: -20%;
  left: 10%;
  width: 50%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(13, 91, 219, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.apm-blog-hero__pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(13, 91, 219, 0.07) 1px, transparent 0),
    linear-gradient(135deg, transparent 60%, rgba(25, 168, 91, 0.04) 100%);
  background-size: 24px 24px, 100% 100%;
  pointer-events: none;
}

.apm-blog-hero__pattern::after {
  content: "";
  position: absolute;
  right: 8%;
  top: 15%;
  width: 120px;
  height: 120px;
  border: 2px solid rgba(13, 91, 219, 0.08);
  border-radius: 24px;
  transform: rotate(12deg);
}

.apm-blog-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  min-height: 300px;
}

.apm-breadcrumb--blog {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 16px;
}

.apm-breadcrumb--blog a {
  color: #64748b;
  text-decoration: none;
  transition: color 300ms;
}

.apm-breadcrumb--blog a:hover {
  color: #0d5bdb;
}

.apm-breadcrumb--blog span[aria-hidden] {
  margin: 0 8px;
  color: #94a3b8;
}

.apm-blog-hero__label {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #0d5bdb;
}

.apm-blog-hero__title {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #0f172a;
  max-width: 16ch;
}

.apm-blog-hero__desc {
  margin: 0 0 22px;
  font-size: 1rem;
  line-height: 1.7;
  color: #64748b;
  max-width: 520px;
}

.apm-blog-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.apm-blog-archive .apm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 300ms, box-shadow 300ms, background 300ms, color 300ms;
}

.apm-blog-archive .apm-btn--primary {
  background: #0d5bdb;
  color: #fff;
  box-shadow: 0 8px 24px rgba(13, 91, 219, 0.28);
}

.apm-blog-archive .apm-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(13, 91, 219, 0.35);
  color: #fff;
}

.apm-blog-archive .apm-btn--outline {
  background: #fff;
  color: #0d5bdb;
  border-color: rgba(13, 91, 219, 0.25);
}

.apm-blog-archive .apm-btn--outline:hover {
  background: #f4f8ff;
  transform: translateY(-2px);
}

.apm-blog-archive .apm-btn--white {
  background: #fff;
  color: #0d5bdb;
}

.apm-blog-archive .apm-btn--white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.apm-blog-archive .apm-btn--sm {
  padding: 10px 18px;
  font-size: 0.875rem;
}

.apm-blog-hero__visual {
  position: relative;
  margin-bottom: -48px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
}

.apm-blog-hero__visual img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 300px;
  object-fit: cover;
}

/* ─── Filter bar ─── */
.apm-blog-filter-wrap {
  position: sticky;
  top: 72px;
  z-index: 40;
  padding: 0 0 8px;
  margin-top: -24px;
}

.apm-blog-filter-wrap.is-stuck {
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(248, 250, 252, 0.92) 100%);
  backdrop-filter: blur(8px);
}

.apm-blog-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 12px 0 18px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
}

.apm-blog-filter__search {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.apm-blog-filter__search svg {
  flex-shrink: 0;
  color: #94a3b8;
}

.apm-blog-filter__search input {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 0.9375rem;
  color: #0f172a;
  outline: none;
}

.apm-blog-filter__search input::placeholder {
  color: #94a3b8;
}

.apm-blog-filter__select select {
  height: 40px;
  padding: 0 32px 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  font-size: 0.875rem;
  color: #334155;
  cursor: pointer;
  appearance: none;
}

.apm-blog-filter__btn {
  flex-shrink: 0;
  height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

/* ─── Main layout ─── */
.apm-blog-main {
  padding: 40px 0 64px;
}

.apm-blog-main__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.apm-blog-section-title {
  margin: 0 0 24px;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.apm-blog-empty {
  padding: 48px 24px;
  text-align: center;
  color: #64748b;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
}

/* ─── Featured article ─── */
.apm-blog-featured {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
  margin-bottom: 40px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
  transition: transform 300ms, box-shadow 300ms;
}

.apm-blog-featured:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12);
}

.apm-blog-featured__media {
  display: block;
  overflow: hidden;
  min-height: 280px;
}

.apm-blog-featured__media img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  transition: transform 500ms ease;
}

.apm-blog-featured:hover .apm-blog-featured__media img {
  transform: scale(1.04);
}

.apm-blog-featured__body {
  display: flex;
  flex-direction: column;
  padding: 28px 32px;
}

.apm-blog-featured__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.8125rem;
  color: #64748b;
}

.apm-blog-badge {
  display: inline-flex;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0d5bdb;
  background: #eef4ff;
  border-radius: 999px;
}

.apm-blog-badge--overlay {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 1;
}

.apm-blog-read::before {
  content: "·";
  margin-right: 10px;
  color: #cbd5e1;
}

.apm-blog-featured__title {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.apm-blog-featured__title a {
  color: #0f172a;
  text-decoration: none;
  background-image: linear-gradient(#0d5bdb, #0d5bdb);
  background-size: 0 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 300ms;
}

.apm-blog-featured__title a:hover {
  background-size: 100% 2px;
}

.apm-blog-featured__excerpt {
  margin: 0 0 20px;
  font-size: 1rem;
  line-height: 1.65;
  color: #64748b;
  flex: 1;
}

.apm-blog-featured__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
}

.apm-blog-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.apm-blog-author__avatar {
  border-radius: 50%;
  flex-shrink: 0;
}

.apm-blog-author strong {
  display: block;
  font-size: 0.875rem;
  color: #0f172a;
}

.apm-blog-author span {
  font-size: 0.75rem;
  color: #94a3b8;
}

.apm-blog-author--sm strong {
  font-size: 0.8125rem;
  font-weight: 600;
}

.apm-blog-featured__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0d5bdb;
  text-decoration: none;
  white-space: nowrap;
  transition: gap 300ms;
}

.apm-blog-featured__link:hover {
  gap: 10px;
}

/* ─── Grid cards ─── */
.apm-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.apm-blog-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
  transition: transform 300ms, box-shadow 300ms;
}

.apm-blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12);
}

.apm-blog-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.apm-blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.apm-blog-card:hover .apm-blog-card__media img {
  transform: scale(1.06);
}

.apm-blog-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 22px 22px;
}

.apm-blog-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.apm-blog-card__title {
  margin: 0 0 8px;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.apm-blog-card__title a {
  color: #0f172a;
  text-decoration: none;
}

.apm-blog-card__title a:hover {
  color: #0d5bdb;
}

.apm-blog-card__excerpt {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #64748b;
  flex: 1;
}

.apm-blog-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.apm-blog-card__link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0d5bdb;
  text-decoration: none;
}

.apm-blog-card__link:hover {
  text-decoration: underline;
}

/* ─── Pagination ─── */
.apm-blog-pagination {
  margin-top: 40px;
}

.apm-blog-pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.apm-blog-pagination__item a,
.apm-blog-pagination__item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  transition: transform 300ms, background 300ms, color 300ms, box-shadow 300ms;
}

.apm-blog-pagination__item a:hover {
  transform: translateY(-2px);
  color: #0d5bdb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.apm-blog-pagination__item.is-active span,
.apm-blog-pagination__item .current {
  background: #0d5bdb;
  color: #fff;
  box-shadow: 0 8px 24px rgba(13, 91, 219, 0.3);
}

/* ─── Sidebar ─── */
.apm-blog-sidebar {
  position: sticky;
  top: 148px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.apm-blog-widget {
  padding: 22px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
}

.apm-blog-widget__title {
  margin: 0 0 16px;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0f172a;
}

.apm-blog-popular {
  margin: 0;
  padding: 0;
  list-style: none;
}

.apm-blog-popular__item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  transition: opacity 300ms;
}

.apm-blog-popular__item:last-child {
  border-bottom: 0;
}

.apm-blog-popular__item:hover {
  opacity: 0.85;
}

.apm-blog-popular__item img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.apm-blog-popular__item span {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  color: #0f172a;
}

.apm-blog-cats {
  margin: 0;
  padding: 0;
  list-style: none;
}

.apm-blog-cats a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.875rem;
  color: #334155;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  transition: color 300ms;
}

.apm-blog-cats a:hover {
  color: #0d5bdb;
}

.apm-blog-cats span {
  color: #94a3b8;
}

.apm-blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.apm-blog-tag {
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #0d5bdb;
  background: #eef4ff;
  border-radius: 999px;
  text-decoration: none;
  transition: background 300ms, transform 300ms;
}

.apm-blog-tag:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

.apm-blog-latest {
  margin: 0;
  padding: 0;
  list-style: none;
}

.apm-blog-latest a {
  display: block;
  padding: 8px 0;
  font-size: 0.875rem;
  color: #334155;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  transition: color 300ms;
}

.apm-blog-latest a:hover {
  color: #0d5bdb;
}

.apm-blog-guide {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.apm-blog-guide__cover {
  flex-shrink: 0;
  width: 72px;
  height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0d5bdb, #19a85b);
  border-radius: 8px;
  color: #fff;
  font-size: 0.625rem;
  text-align: center;
  box-shadow: 0 8px 20px rgba(13, 91, 219, 0.25);
}

.apm-blog-guide__cover strong {
  font-size: 1.125rem;
  line-height: 1;
}

.apm-blog-widget--guide p,
.apm-blog-widget--newsletter p {
  margin: 0 0 14px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #64748b;
}

.apm-blog-sidebar-form {
  display: flex;
  gap: 8px;
}

.apm-blog-sidebar-form input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.875rem;
}

.apm-blog-sidebar-form button {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #0d5bdb;
  color: #fff;
  cursor: pointer;
  transition: transform 300ms;
}

.apm-blog-sidebar-form button:hover {
  transform: scale(1.05);
}

/* ─── Newsletter CTA ─── */
.apm-blog-newsletter {
  padding: 56px 0;
  background: linear-gradient(135deg, #0d5bdb 0%, #1280e8 45%, #19a85b 100%);
}

.apm-blog-newsletter__grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
}

.apm-blog-newsletter__art {
  opacity: 0.95;
}

.apm-blog-newsletter__title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  color: #fff;
}

.apm-blog-newsletter__content p {
  margin: 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.apm-blog-newsletter__form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.apm-blog-newsletter__form input {
  min-width: 240px;
  height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font-size: 0.9375rem;
}

.apm-blog-newsletter__form .apm-btn {
  height: 52px;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

/* ─── Reveal ─── */
.apm-blog-archive .apm-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.apm-blog-archive .apm-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .apm-blog-main__grid {
    grid-template-columns: 1fr;
  }

  .apm-blog-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .apm-blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .apm-blog-hero__grid {
    grid-template-columns: 1fr;
  }

  .apm-blog-hero__visual {
    margin-bottom: 0;
    max-width: 480px;
  }

  .apm-blog-hero {
    max-height: none;
    padding-bottom: 32px;
  }

  .apm-blog-featured {
    grid-template-columns: 1fr;
  }

  .apm-blog-filter {
    flex-wrap: wrap;
    height: auto;
    padding: 14px;
  }

  .apm-blog-filter__search {
    flex: 1 1 100%;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
  }

  .apm-blog-filter__select {
    flex: 1;
  }

  .apm-blog-filter__btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .apm-blog-newsletter__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .apm-blog-newsletter__art {
    display: none;
  }

  .apm-blog-newsletter__form {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .apm-blog-grid {
    grid-template-columns: 1fr;
  }

  .apm-blog-sidebar {
    grid-template-columns: 1fr;
  }

  .apm-blog-filter-wrap {
    top: 64px;
  }

  .apm-blog-card__title {
    font-size: 1.125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .apm-blog-archive .apm-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
