/* =========================================================
   MoroHeritage — Journal index & category archives
   Loaded only on is_home() || is_category()
   ========================================================= */

.moroheritage-journal-page {
  --mh-journal-container: 1180px;
  --mh-journal-gutter: 24px;
  background: var(--mh-cream, #fbf8f2);
}

.moroheritage-journal-page .mh-journal {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 0 96px;
  font-family: var(--mh-font-sans);
  color: var(--mh-text, #241a15);
}

.moroheritage-journal-page .mh-journal > * {
  width: min(calc(100% - (var(--mh-journal-gutter) * 2)), var(--mh-journal-container));
  margin-inline: auto;
}

/* -------------------------------------------------- Breadcrumb */

.mh-journal-crumbs {
  padding: 28px 0 0;
  font-size: 0.8125rem;
  color: var(--mh-muted, #6f6459);
}

.mh-journal-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mh-journal-crumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--mh-gold, #c99a55);
}

.mh-journal-crumbs a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.mh-journal-crumbs a:hover,
.mh-journal-crumbs a:focus-visible {
  color: var(--mh-green, #17372f);
  border-bottom-color: var(--mh-gold, #c99a55);
}

/* -------------------------------------------------- Hero */

.mh-journal-hero {
  position: relative;
  padding: clamp(44px, 6vw, 84px) 0 clamp(28px, 3vw, 44px);
  overflow: hidden;
}

.mh-journal-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.mh-journal-hero__eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  padding: 7px 15px;
  border: 1px solid var(--mh-gold, #c99a55);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mh-brown, #825137);
  background: rgba(255, 255, 255, 0.6);
}

.mh-journal-hero__title {
  margin: 0;
  font-family: var(--mh-font-serif);
  font-weight: 500;
  font-size: clamp(2.15rem, 1.3rem + 3.4vw, 3.75rem);
  line-height: 1.06;
  letter-spacing: -0.024em;
  color: var(--mh-green-deep, #0f2620);
  text-wrap: balance;
}

.mh-journal-hero__intro,
.mh-journal-hero__desc {
  margin: 20px 0 0;
  max-width: 62ch;
  font-size: clamp(1.0125rem, 0.97rem + 0.28vw, 1.1875rem);
  line-height: 1.72;
  color: #55483d;
}

.mh-journal-hero__desc p { margin: 0 0 0.9em; }
.mh-journal-hero__desc p:last-child { margin-bottom: 0; }

.mh-journal-hero__desc a {
  color: var(--mh-brown-deep, #5d3826);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--mh-gold, #c99a55);
}

.mh-journal-hero__count {
  margin: 16px 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mh-muted, #6f6459);
}

.mh-journal-hero__rule {
  display: block;
  width: 72px;
  height: 2px;
  margin-top: 30px;
  background: linear-gradient(90deg, var(--mh-gold, #c99a55), rgba(201, 154, 85, 0));
}

/* Discreet decoration built from the palette — no image, no request. */
.mh-journal-hero__motif {
  position: absolute;
  top: -110px;
  right: -90px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(201, 154, 85, 0.20) 0 38%, transparent 39%),
    radial-gradient(circle at 50% 50%, rgba(23, 55, 47, 0.10) 0 62%, transparent 63%),
    conic-gradient(from 45deg, rgba(130, 81, 55, 0.10) 0 25%, transparent 0 50%, rgba(130, 81, 55, 0.10) 0 75%, transparent 0);
}

.mh-journal-hero--category {
  padding-top: clamp(28px, 3.4vw, 48px);
}

/* -------------------------------------------------- Category navigation */

.moroheritage-journal-page .mh-cat-nav,
.moroheritage-journal-page .mh-journal-categories {
  padding: 6px 0 0;
  border-top: 1px solid var(--mh-border, #e7ddd0);
  border-bottom: 1px solid var(--mh-border, #e7ddd0);
}

.mh-cat-nav__list {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.mh-cat-nav__list::-webkit-scrollbar { height: 4px; }
.mh-cat-nav__list::-webkit-scrollbar-thumb {
  background: var(--mh-border, #e7ddd0);
  border-radius: 999px;
}

.mh-cat-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  white-space: nowrap;
  scroll-snap-align: start;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: #55483d;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mh-cat-nav__link:hover {
  background: var(--mh-cream-warm, #f5efe4);
  color: var(--mh-green, #17372f);
}

.mh-cat-nav__link.is-active {
  background: var(--mh-green, #17372f);
  color: var(--mh-cream, #fbf8f2);
}

.mh-cat-nav__link:focus-visible {
  outline: 2px solid var(--mh-brown, #825137);
  outline-offset: 2px;
}

/* -------------------------------------------------- Feed */

/* -------------------------------------------------- Blog layout */

/*
 * The gap after the category bar belongs to the LAYOUT, not to the left column.
 * It used to be .mh-journal-feed's padding-top, which only pushed .mh-blog-main
 * down and left the sidebar starting one clamp() higher — the misalignment in
 * the screenshot. One shared offset now moves both columns together.
 */
.mh-blog-layout {
  --mh-blog-content-offset: 60px;

  width: min(calc(100% - (var(--mh-journal-gutter) * 2)), var(--mh-journal-container));
  margin-top: var(--mh-blog-content-offset);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 48px;
  align-items: start;
}

/* No widget configured: the grid takes the whole editorial width. */
.mh-blog-layout.no-sidebar {
  display: block;
}

.mh-blog-main,
.mh-blog-layout .mh-journal-sidebar {
  margin-top: 0;
  width: 100%;
  min-width: 0;
}

/* The container rule above already sizes .mh-blog-layout. */
.moroheritage-journal-page .mh-blog-layout > * { width: auto; margin-inline: 0; }

/* Both columns now start at the same vertical position. */
.mh-blog-layout .mh-journal-feed {
  padding-top: 0;
}

.mh-journal-feed {
  padding-top: clamp(36px, 4.5vw, 64px);
}

.mh-journal-lead {
  padding-bottom: clamp(36px, 4.5vw, 60px);
  margin-bottom: clamp(36px, 4.5vw, 60px);
  border-bottom: 1px solid var(--mh-border, #e7ddd0);
}

.mh-journal-highlight {
  padding-bottom: clamp(28px, 3.6vw, 48px);
  margin-bottom: clamp(28px, 3.6vw, 48px);
  border-bottom: 1px solid var(--mh-border, #e7ddd0);
}

.mh-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 2.6vw, 40px) clamp(20px, 2.2vw, 32px);
  align-items: start;
}

/* With the sidebar there is no room for three readable cards. */
.mh-blog-layout.has-sidebar .mh-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* The lead story stacks next to the sidebar instead of splitting 57/43. */
.mh-blog-layout.has-sidebar .mh-card--featured {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.mh-blog-layout.has-sidebar .mh-card--featured .mh-card__body { padding-top: 18px; }

.mh-blog-layout.has-sidebar .mh-card--featured .mh-card__media img,
.mh-blog-layout.has-sidebar .mh-card--featured .mh-card__placeholder {
  aspect-ratio: 16 / 10;
}

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

.moroheritage-journal-page .navigation.pagination,
.moroheritage-journal-page .navigation.mh-pagination {
  width: 100%;
  margin-top: clamp(44px, 5vw, 72px);
  padding-top: 32px;
  border-top: 1px solid var(--mh-border, #e7ddd0);
}

.moroheritage-journal-page .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.moroheritage-journal-page .nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--mh-border, #e7ddd0);
  border-radius: 10px;
  background: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--mh-green, #17372f);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.moroheritage-journal-page .nav-links .page-numbers:hover {
  border-color: var(--mh-gold, #c99a55);
  color: var(--mh-brown, #825137);
}

.moroheritage-journal-page .nav-links .page-numbers.current {
  background: var(--mh-green, #17372f);
  border-color: var(--mh-green, #17372f);
  color: var(--mh-cream, #fbf8f2);
}

.moroheritage-journal-page .nav-links .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  min-width: 26px;
  padding: 0;
}

.moroheritage-journal-page .nav-links .page-numbers:focus-visible {
  outline: 2px solid var(--mh-brown, #825137);
  outline-offset: 2px;
}

/* -------------------------------------------------- Empty state */

.mh-empty {
  padding: clamp(56px, 7vw, 96px) 24px;
  margin-top: clamp(28px, 3vw, 44px);
  border: 1px solid var(--mh-border, #e7ddd0);
  border-radius: var(--mh-radius-lg, 20px);
  background: var(--mh-cream-warm, #f5efe4);
  text-align: center;
}

.mh-empty__title {
  margin: 0;
  font-family: var(--mh-font-serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.9rem);
  color: var(--mh-green-deep, #0f2620);
}

.mh-empty__text {
  margin: 12px 0 26px;
  font-size: 0.9375rem;
  color: #55483d;
}

/* -------------------------------------------------- Button */

.moroheritage-journal-page .mh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 28px;
  border: 1px solid var(--mh-green, #17372f);
  border-radius: 10px;
  background: var(--mh-green, #17372f);
  color: var(--mh-cream, #fbf8f2);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.moroheritage-journal-page .mh-button:hover {
  background: transparent;
  color: var(--mh-green, #17372f);
}

.moroheritage-journal-page .mh-button:focus-visible {
  outline: 2px solid var(--mh-brown, #825137);
  outline-offset: 3px;
}

/* -------------------------------------------------- Closing CTA */

.mh-journal-cta {
  margin-top: clamp(64px, 7vw, 104px);
}

.mh-journal-cta__inner {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 5vw, 72px) clamp(24px, 4vw, 64px);
  border-radius: var(--mh-radius-lg, 20px);
  background: var(--mh-green, #17372f);
  color: var(--mh-cream, #fbf8f2);
  text-align: center;
}

.mh-journal-cta__inner::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(201, 154, 85, 0.35);
  border-radius: calc(var(--mh-radius-lg, 20px) - 8px);
  pointer-events: none;
}

.mh-journal-cta__title {
  position: relative;
  margin: 0;
  font-family: var(--mh-font-serif);
  font-weight: 500;
  font-size: clamp(1.55rem, 1.25rem + 1.4vw, 2.35rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.mh-journal-cta__text {
  position: relative;
  max-width: 56ch;
  margin: 16px auto 28px;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(251, 248, 242, 0.82);
}

.moroheritage-journal-page .mh-journal-cta .mh-button {
  position: relative;
  border-color: var(--mh-gold, #c99a55);
  background: var(--mh-gold, #c99a55);
  color: var(--mh-green-deep, #0f2620);
}

.moroheritage-journal-page .mh-journal-cta .mh-button:hover {
  background: transparent;
  color: var(--mh-gold, #c99a55);
}

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

@media (max-width: 1200px) {
  .mh-blog-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 36px; }
}

@media (max-width: 1024px) {
  .mh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mh-journal-hero__motif { width: 300px; height: 300px; top: -90px; right: -80px; }
}

@media (max-width: 900px) {
  .mh-journal-hero__inner { max-width: none; }

  .mh-blog-layout,
  .mh-blog-layout.has-sidebar {
    --mh-blog-content-offset: 40px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 44px;
  }
}

@media (max-width: 640px) {
  .moroheritage-journal-page { --mh-journal-gutter: 18px; }

  .moroheritage-journal-page .mh-journal { padding-bottom: 64px; }

  .mh-grid,
  .mh-blog-layout.has-sidebar .mh-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }

  .mh-journal-hero__motif { display: none; }

  .moroheritage-journal-page .mh-cat-nav__list {
    /* Let the strip bleed to the screen edges so it reads as scrollable. */
    margin-inline: calc(var(--mh-journal-gutter) * -1);
    padding-inline: var(--mh-journal-gutter);
  }

  .moroheritage-journal-page .nav-links .page-numbers {
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
  }

  .moroheritage-journal-page .mh-button {
    width: 100%;
    padding: 0 18px;
  }
}

@media (max-width: 380px) {
  .mh-journal-hero__title { font-size: 1.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  .moroheritage-journal-page *,
  .moroheritage-journal-page *::before,
  .moroheritage-journal-page *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}


/* -------------------------------------------------- Search */

.mh-journal-hero__search { margin-top: 22px; max-width: 460px; }
.mh-empty__search { margin: 0 auto 22px; max-width: 420px; }

.moroheritage-journal-page .mh-search-form { margin: 0; }

.moroheritage-journal-page .mh-search-form__label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mh-muted, #6f6459);
}

.moroheritage-journal-page .mh-search-form__controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.moroheritage-journal-page .mh-search-form__field {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--mh-border, #e7ddd0);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 1rem;
  color: #443a31;
}

.moroheritage-journal-page .mh-search-form__field::placeholder { color: #7d6f64; opacity: 1; }

.moroheritage-journal-page .mh-search-form__field:focus-visible {
  outline: 2px solid var(--mh-brown, #825137);
  outline-offset: 1px;
  border-color: var(--mh-gold, #c99a55);
}

.moroheritage-journal-page .mh-search-form__submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  min-height: 50px;
  padding: 0;
  border: 1px solid var(--mh-green, #17372f);
  border-radius: 10px;
  background: var(--mh-green, #17372f);
  color: var(--mh-cream, #fbf8f2);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.moroheritage-journal-page .mh-search-form__submit:hover {
  background: var(--mh-gold, #c99a55);
  border-color: var(--mh-gold, #c99a55);
  color: var(--mh-green-deep, #0f2620);
}

.moroheritage-journal-page .mh-search-form__submit:focus-visible {
  outline: 2px solid var(--mh-brown, #825137);
  outline-offset: 3px;
}
