/* Scoped to #main .mc-articles-page : body also gets mc-articles-page
   from the template slug; bare selectors would leak tokens into footer. */
#main .mc-articles-page {
  --mc-cream-2: #f2ede6;
  --mc-lime: #dce8b5;
  --mc-stone: #e8e2d9;
  --mc-muted: #6b675f;
  --mc-font: "Manrope", system-ui, sans-serif;
  --mc-container: 1180px;
  --mc-gutter: clamp(18px, 4vw, 36px);
  --mc-radius: 16px;
  --mc-shadow: 0 8px 24px rgba(26, 26, 24, 0.06);
  --mc-transition: 180ms ease;

  max-width: none !important;
  background: var(--mc-cream);
  color: var(--mc-ink);
  font-family: var(--mc-font);
}

.page-template-page-articles #main {
  padding-inline: 0;
}

#main .mc-articles-page a {
  color: inherit;
  text-decoration: none;
}

#main .mc-articles-page img {
  display: block;
  max-width: 100%;
  height: auto;
}

#main .mc-articles-page a:focus-visible,
#main .mc-articles-page button:focus-visible,
#main .mc-articles-page input:focus-visible {
  outline: 3px solid rgba(122, 138, 110, 0.55);
  outline-offset: 3px;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Beat rebrand-shell archive grid/olive title overrides for photo heroes. */

#main .mc-articles-page .mc-articles-hero,
#main .mc-articles-hero {
  display: block;
  position: relative;
  max-width: none;
  width: var(--mc-shell-w, min(1248px, calc(100% - 2rem)));
  margin: 1rem auto 0;
  padding: 0;
  isolation: isolate;
}

#main .mc-articles-hero--photo {
  display: block;
  grid-template-columns: none;
  gap: 0;
}

#main .mc-articles-hero__frame {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: var(--mc-cream-2, #F2EDE6);
}

#main .mc-articles-hero__media {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
  width: 100%;
  /* aspect-ratio + max-height capped the width at ~900px; a fixed height keeps
     the banner full-width. */
  height: clamp(220px, 28vw, 340px);
  background: var(--mc-cream-2, #F2EDE6);
}

#main .mc-articles-hero__media picture,
#main .mc-articles-hero__media img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  object-fit: cover;
  border-radius: 0;
}

#main .mc-articles-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(26, 26, 24, 0.28) 0%,
    rgba(26, 26, 24, 0.68) 100%
  );
  pointer-events: none;
}

#main .mc-articles-hero__copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

#main .mc-articles-hero--photo .mc-articles-hero__copy {
  position: absolute;
  inset: 0;
  justify-content: center;
  padding: clamp(16px, 3vw, 28px) clamp(16px, 4vw, 40px);
  max-width: 100%;
  box-sizing: border-box;
}

#main .mc-articles-hero--band {
  display: block;
  padding-block: clamp(36px, 5vw, 56px);
  background: var(--mc-cream-2, #F2EDE6);
  border-radius: 28px;
}

#main .mc-articles-hero h1 {
  margin: 0;
  max-width: 100%;
  color: var(--mc-ink, #1A1A18);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: clamp(42px, 6vw, 64px) !important;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  text-wrap: balance;
}

#main .mc-articles-hero--photo h1 {
  color: #fff !important;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

#main .mc-articles-breadcrumb-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  max-width: 100%;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--mc-lemon, #FFF1A6);
  color: var(--mc-ink, #1A1A18);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#main .mc-articles-breadcrumb-pill a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin-block: -10px;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

#main .mc-articles-breadcrumb-pill a:hover {
  text-decoration: underline;
}

#main .mc-articles-hero__lede {
  max-width: min(34rem, 100%);
  margin: 0;
  color: var(--mc-muted, #6B675F);
  font-size: 15px;
  line-height: 1.5;
}

#main .mc-articles-hero--photo .mc-articles-hero__lede {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

/* ---------- Layout ---------- */

.mc-articles-layout {
  max-width: var(--mc-container);
  margin: clamp(28px, 4vw, 48px) auto 0;
  padding: 0 var(--mc-gutter) clamp(48px, 6vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(28px, 4vw, 40px);
  align-items: start;
}

.mc-articles-main {
  min-width: 0;
}

/* ---------- Pagination ---------- */

.mc-articles-pager {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: clamp(32px, 4vw, 48px);
}

/* ---------- Sidebar ---------- */

.mc-articles-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 96px;
}

.mc-sidebar-widget {
  padding: 22px;
  border: 1px solid var(--mc-stone);
  border-radius: var(--mc-radius);
  background: var(--mc-surface);
  box-shadow: 0 1px 2px rgba(26, 26, 24, 0.03);
}

.mc-sidebar-widget--search {
  padding: 14px;
}

.mc-sidebar-widget__title {
  margin: 0 0 16px;
  color: var(--mc-ink);
  font-family: var(--mc-font);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.mc-sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--mc-stone);
  border-radius: var(--mc-radius-pill);
  background: var(--mc-cream);
}

.mc-sidebar-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--mc-ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.mc-sidebar-search button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mc-olive);
  cursor: pointer;
  flex: none;
}

.mc-sidebar-cats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.mc-sidebar-cats li + li {
  border-top: 1px solid var(--mc-stone);
}

.mc-sidebar-cats a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--mc-ink);
}

.mc-sidebar-cats a:hover,
.mc-sidebar-cats a.is-active {
  color: var(--mc-olive);
}

.mc-sidebar-cats__count {
  color: var(--mc-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.mc-sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mc-sidebar-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--mc-stone);
  border-radius: 10px;
  color: var(--mc-ink);
  font-size: 12px;
  font-weight: 600;
}

.mc-sidebar-tags a:hover {
  background: var(--mc-lemon);
  border-color: transparent;
}

.mc-sidebar-widget--author {
  text-align: center;
}

.mc-sidebar-author__photo {
  width: 112px;
  height: 112px;
  margin: 0 auto 14px;
  border-radius: 50%;
  object-fit: cover;
}

.mc-sidebar-author__role {
  margin: 0 0 4px;
  color: var(--mc-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mc-sidebar-author__name {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 800;
}

.mc-sidebar-author__bio {
  margin: 0;
  color: var(--mc-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Scope: count + mobile category strip ---------- */

#main .mc-articles-scope {
  display: grid;
  gap: 12px;
  margin-bottom: clamp(18px, 3vw, 28px);
}

#main .mc-articles-count {
  margin: 0;
  color: var(--mc-muted, #6B675F);
  font-size: 13px;
  font-weight: 600;
}

#main .mc-articles-cats {
  display: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .mc-articles-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .mc-articles-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .mc-sidebar-widget--search{
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .mc-mag-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  #main .mc-articles-hero__media {
    height: 200px;
  }

  #main .mc-articles-hero h1 {
    font-size: clamp(36px, 12vw, 48px) !important;
  }

  /* Keep the promise visible: short lede instead of nothing. */
  #main .mc-articles-hero__lede {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
  }

  /* Category strip above the grid, search first via flex order. */
  #main .mc-articles-cats {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0 0 4px;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  #main .mc-articles-cats li {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  #main .mc-articles-cats a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--mc-stone);
    border-radius: 999px;
    background: var(--mc-surface);
    color: var(--mc-ink);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
  }

  #main .mc-articles-cats a.is-active {
    background: var(--mc-ink);
    border-color: var(--mc-ink);
    color: var(--mc-cream);
  }

  #main .mc-articles-layout {
    display: flex;
    flex-direction: column;
  }

  #main .mc-articles-sidebar {
    display: contents;
  }

  #main .mc-sidebar-widget--search {
    order: -1;
  }

  .mc-articles-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #main .mc-articles-page *,
  #main .mc-articles-page *::before,
  #main .mc-articles-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
