* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

.top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  min-height: 58px !important;
  padding: 0 max(18px, calc((100vw - 1120px) / 2 + 20px)) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
}

.top .brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 58px !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
}

.top .actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  min-width: 0 !important;
}

.top .chip,
.navMenu summary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  padding: 8px 12px !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  cursor: pointer;
}

.navMenu {
  position: relative;
}

.navMenu summary {
  list-style: none;
}

.navMenu summary::-webkit-details-marker {
  display: none;
}

.navMenu summary::after {
  content: "▾";
  font-size: 10px;
  margin-left: 7px;
  opacity: .7;
}

.navMenu[open] summary::after {
  content: "▴";
}

.navPanel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  border: 1px solid var(--fd-line);
  border-radius: 12px;
  background: rgba(15, 16, 11, .98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
  padding: 6px;
  display: none;
}

.navMenu[open] .navPanel {
  display: grid;
  gap: 3px;
}

.navPanel a {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--fd-muted);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  line-height: 1.15;
}

.navPanel a:hover,
.navPanel a:focus-visible {
  background: rgba(216, 190, 122, .10);
  color: var(--fd-text);
  outline: 0;
}

.blogMain,
.articleMain,
.page {
  width: 100%;
  margin-inline: auto !important;
}

.blogMain {
  max-width: 1120px !important;
  padding-top: 28px !important;
}

.articleMain {
  /* D7a: cap article reading measure (~42rem ≈ 65-70ch) for long-form prose. */
  max-width: 42rem !important;
}

/* D7a: lift article body ink from muted to readable long-form contrast.
   Scoped above the per-page `.articleCard p` rules; the take box keeps its
   brighter --fd-text emphasis. */
.articleMain .articleCard p,
.articleMain .articleCard li {
  color: #e7e1d2;
}

.articleMain .articleCard .takeBox p {
  color: var(--fd-text);
}

.page {
  max-width: 960px !important;
}

.draftNotice {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 24px !important;
  font-size: 12px !important;
}

.blogHero {
  align-items: center !important;
  grid-template-columns: minmax(0, 1fr) 300px !important;
  gap: 28px !important;
  margin-bottom: 22px !important;
}

.blogHero > div {
  min-width: 0;
}

.blogHero h1,
.articleMain h1,
.page h1 {
  text-wrap: balance;
}

.blogHero h1 {
  max-width: 760px;
  font-size: clamp(42px, 4.1vw, 52px) !important;
  line-height: .98 !important;
}

.blogHero p {
  max-width: 760px !important;
  font-size: 17px !important;
}

.blogCard {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 176px;
  padding: 16px !important;
}

.postGrid {
  align-items: stretch;
  gap: 14px !important;
}

.postCard {
  height: 100%;
  gap: 0;
  min-height: 220px !important;
  padding: 16px !important;
}

.postCard h2 {
  min-height: 48px;
  margin-top: 10px !important;
  margin-bottom: 8px !important;
  font-size: 23px !important;
}

.postCard p {
  max-width: 38rem;
  font-size: 13px !important;
}

.blogFooter,
.articleFooter,
.links {
  align-items: center;
}

.articleCard,
.templateCard,
.bio,
.item,
.postCard,
.blogCard {
  overflow: hidden;
}

.byline span {
  display: inline-flex;
  align-items: center;
}

.byline a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}

/* D7a: reduced-motion guard local to the blog stylesheet (mirrors the global
   guard in fd-redesign.css so blog pages stay covered on their own). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .top {
    backdrop-filter: none !important;
  }
}

@media (max-width: 900px) {
  .top {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 8px !important;
    min-height: auto !important;
    padding: 10px 14px !important;
  }

  .top .brand {
    min-height: 44px !important;
  }

  .top .actions {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
  }

  .top .chip,
  .navMenu {
    flex: 0 0 auto !important;
  }

  .navPanel {
    left: 0;
    right: auto;
  }

  .blogMain,
  .articleMain,
  .page {
    padding: 24px 14px 56px !important;
  }

  .draftNotice {
    align-items: flex-start;
    margin-bottom: 22px !important;
  }

  .blogHero {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .blogHero h1,
  .articleMain h1,
  .page h1 {
    font-size: 36px !important;
    line-height: 1.02 !important;
  }

  .blogHero p,
  .dek,
  .page p {
    font-size: 15px !important;
  }

  .blogCard {
    min-height: 0;
  }

  .postCard {
    min-height: 0 !important;
  }

  .postCard h2 {
    min-height: 0;
  }
}
