/* ============================================================
   BrijCode — Blog Page (scoped under .blog-page)
   Also loaded by blog-details.php (pills, meta, cards, light header).
   ============================================================ */

.blog-page {
  --blog-navy: #071a33;
  --blog-navy-deep: #0b1f3a;
  --blog-marigold: #f2a11b;
  --blog-marigold-deep: #e09212;
  --blog-white: #ffffff;
  --blog-bg: #ffffff;
  --blog-bg-soft: #f4f7fb;
  --blog-line: #e4eaf2;
  --blog-muted: rgba(7, 26, 51, 0.68);
  --blog-faint: rgba(7, 26, 51, 0.5);
  --blog-shadow: 0 8px 28px rgba(7, 26, 51, 0.06);
  --blog-radius-lg: 18px;
  --blog-radius-md: 12px;
  --blog-gradient: linear-gradient(120deg, #f2a11b 0%, #e5701d 100%);

  background: var(--blog-bg);
  color: var(--blog-navy);
  overflow-x: clip;
}

.blog-page .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Light header (white page, so dark logo + dark links) ---------- */
.blog-page .site-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(7, 26, 51, 0.08);
  box-shadow: 0 4px 18px rgba(7, 26, 51, 0.04);
}

.blog-page .site-header .nav-links li a {
  color: var(--blog-navy);
}

.blog-page .site-header .nav-links li a:hover {
  color: var(--blog-marigold);
}

.blog-page .site-header:not(.is-nav-open) .navbar-toggler span {
  background: var(--blog-navy);
}

.blog-page .site-header .brand-logo--light {
  display: none;
}

.blog-page .site-header .brand-logo--dark {
  display: block;
  mix-blend-mode: multiply;
}

/* ---------- Page ---------- */
.blog-main {
  display: block;
  padding: clamp(100px, 11vw, 120px) 0 clamp(48px, 6vw, 72px);
}

/* Soft grid background (blog page + blog details page) */
.blog-main,
.blog-details-main {
  position: relative;
  isolation: isolate;
}

.blog-main::before,
.blog-details-main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(7, 26, 51, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 26, 51, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
}

.blog-intro {
  margin-bottom: clamp(22px, 3vw, 32px);
}

.blog-intro__title {
  margin: 0 0 6px;
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--blog-navy);
}

.blog-intro__title span {
  background: var(--blog-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blog-intro__lede {
  margin: 0;
  max-width: 62ch;
  font-size: clamp(0.92rem, 1.2vw, 1rem);
  line-height: 1.55;
  color: var(--blog-muted);
}

/* ---------- Pills (category + tags) ---------- */
.blog-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.blog-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(242, 161, 27, 0.45);
  background: var(--blog-white);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--blog-navy);
  text-decoration: none;
}

.blog-pill--category {
  border-color: transparent;
  background: var(--blog-gradient);
  color: #ffffff;
}

a.blog-pill--category:hover {
  color: #ffffff;
  filter: brightness(1.05);
}

/* ---------- Author / date line ---------- */
.blog-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  font-size: 0.84rem;
  color: var(--blog-faint);
}

.blog-meta__author {
  font-style: italic;
  font-weight: 600;
  color: var(--blog-navy);
}

.blog-meta__info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.blog-meta__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Featured (image left, text right) ---------- */
.blog-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(22px, 3.5vw, 40px);
}

.blog-featured__media {
  display: block;
  border-radius: var(--blog-radius-lg);
  overflow: hidden;
  background: var(--blog-bg-soft);
}

.blog-featured__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-featured__media:hover .blog-featured__image {
  transform: scale(1.03);
}

.blog-featured__title {
  margin: 0 0 12px;
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.blog-featured__title a,
.blog-card__title a {
  color: var(--blog-navy);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-featured__title a:hover,
.blog-card__title a:hover {
  color: #c47d0a;
}

.blog-featured__desc {
  margin: 0 0 18px;
  font-size: clamp(0.92rem, 1.1vw, 1rem);
  line-height: 1.6;
  color: var(--blog-muted);
}

/* ---------- "Our Latest Blog" divider ---------- */
.blog-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: clamp(30px, 4vw, 44px) 0 clamp(18px, 2.5vw, 24px);
  font-size: 0.9rem;
  font-weight: 600;
  color: #c47d0a;
  white-space: nowrap;
}

.blog-divider::before,
.blog-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(242, 161, 27, 0.35);
}

/* ---------- Category filters + search ---------- */
.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: clamp(22px, 3vw, 30px);
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-filters__pill {
  padding: 8px 16px;
  border: 1px solid var(--blog-line);
  border-radius: 999px;
  background: var(--blog-white);
  color: var(--blog-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.blog-filters__pill:hover {
  border-color: rgba(242, 161, 27, 0.45);
  color: var(--blog-navy);
}

.blog-filters__pill.is-active {
  border-color: transparent;
  background: var(--blog-gradient);
  color: #ffffff;
}

.blog-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 360px);
  padding: 5px 5px 5px 14px;
  border: 1px solid var(--blog-line);
  border-radius: 999px;
  background: var(--blog-white);
}

.blog-search:focus-within {
  border-color: rgba(242, 161, 27, 0.55);
  box-shadow: 0 0 0 3px rgba(242, 161, 27, 0.15);
}

.blog-search__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--blog-faint);
}

.blog-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--blog-navy);
  outline: none;
}

.blog-search__button {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: var(--blog-navy);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.blog-search__button:hover {
  background: var(--blog-navy-deep);
}

.blog-empty {
  margin: 12px 0 0;
  color: var(--blog-muted);
}

/* ---------- Card grid ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 36px) clamp(18px, 2.2vw, 26px);
}

.blog-card {
  display: flex;
  flex-direction: column;
}

.blog-card__media {
  display: block;
  margin-bottom: 14px;
  border-radius: var(--blog-radius-md);
  overflow: hidden;
  background: var(--blog-bg-soft);
}

.blog-card__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-card__media:hover .blog-card__image {
  transform: scale(1.04);
}

.blog-card__title {
  margin: 0 0 12px;
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* ---------- Pagination ---------- */
.blog-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: clamp(36px, 5vw, 48px);
}

.blog-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--blog-line);
  border-radius: 10px;
  background: var(--blog-white);
  color: var(--blog-navy);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.blog-pagination__link:hover {
  border-color: rgba(242, 161, 27, 0.55);
  color: #c47d0a;
}

.blog-pagination__link.is-active {
  border-color: transparent;
  background: var(--blog-gradient);
  color: #ffffff;
}

/* Retail Execution CTA (same as retail-execution page) */
.blog-page .loyalty-cta__arrow {
  max-width: 800px;
}

.blog-page .loyalty-cta__visual {
  position: absolute;
  left: 49%;
  bottom: -13%;
  z-index: 999;
  width: 100%;
  pointer-events: none;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .blog-featured__image,
  .blog-card__image,
  .blog-filters__pill,
  .blog-pagination__link {
    transition: none;
  }

  .blog-featured__media:hover .blog-featured__image,
  .blog-card__media:hover .blog-card__image {
    transform: none;
  }
}
