.blog-hero,
.article-hero {
  --muted: #30485f;
  --orange-dark: #a63d00;
  background: var(--public-hero-background);
  border-bottom: 1px solid #efdbc9;
}

.blog-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(30px, 6vw, 100px);
  padding-block: clamp(48px, 5.4vw, 88px);
}

.blog-intro h1 {
  font-size: clamp(2.55rem, 4.3vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.055em;
}

.blog-intro h1 span {
  color: var(--orange-dark);
}

.blog-intro p {
  margin-top: 22px;
  max-width: 45ch;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.6;
}

.blog-search {
  width: 100%;
  max-width: 452px;
  justify-self: end;
  padding: clamp(18px, 2.6vw, 32px);
  background: #fffaf5;
  border: 1px solid #ecceba;
  border-radius: var(--radius);
  box-shadow: 0 16px 32px #622d1510;
}

.blog-search label {
  display: block;
  margin-bottom: 10px;
  font-size: .9375rem;
  font-weight: 650;
}

.blog-search-field {
  display: flex;
  align-items: center;
  min-height: 52px;
  gap: 4px;
  padding: 3px;
  background: white;
  border: 1px solid #becbd7;
  border-radius: 8px;
}

.blog-search-field:focus-within {
  border-color: var(--orange-dark);
  outline: 2px solid #bd490033;
  outline-offset: 1px;
}

.blog-search input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 4px 0 11px;
  border: 0;
  background: transparent;
  font-size: 1rem;
  color: var(--ink);
}

.blog-search input::placeholder {
  color: var(--muted);
}

.blog-search input:focus-visible {
  outline: none;
}

.blog-search button {
  border: 0;
  border-radius: 6px;
  background: var(--navy);
  color: white;
}

.blog-search button:hover {
  background: #234762;
}

.blog-library {
  padding-block: clamp(40px, 5vw, 66px) clamp(52px, 7vw, 88px);
}

.library-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 24px;
}

.library-heading h2,
.blog-help h2 {
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  letter-spacing: -.04em;
}

.library-heading p {
  flex-shrink: 0;
  font-size: .875rem;
}

.blog-library .blog-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.blog-library .post-image {
  aspect-ratio: 1.95;
  border-radius: 0;
}

.blog-library .post-image:focus-visible {
  outline-offset: -4px;
}

.blog-library .post-card {
  padding-bottom: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.blog-library .post-content {
  min-width: 0;
  padding: clamp(20px, 3vw, 32px);
}

.blog-library .post-content h2 {
  overflow-wrap: anywhere;
  font-size: clamp(1.375rem, 2vw, 1.625rem);
}

.blog-library .post-excerpt {
  max-width: 58ch;
  font-size: .9375rem;
}

.blog-library .post-meta {
  font-size: .8125rem;
}

.blog-library .read-more {
  min-height: 44px;
  margin-top: 10px;
  font-size: .875rem;
}

.blog-library .read-more:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-library .post-card:first-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: center;
  background: #fffaf6;
  border-color: #efdbc9;
}

.blog-library .post-card:first-child h2 {
  font-size: clamp(1.625rem, 2.7vw, 2.25rem);
  letter-spacing: -.035em;
}

.blog-help {
  background: var(--cream);
  border-top: 1px solid #efdbc9;
}

.blog-help > .k-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-block: clamp(35px, 5.4vw, 68px);
}

.blog-help p {
  margin-top: 12px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}

.pagination a {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
}

.pagination a:hover {
  border-color: var(--navy);
}

.pagination a.current {
  background: var(--navy);
  color: white;
}

.no-posts {
  grid-column: 1 / -1;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.no-posts a {
  color: var(--orange-dark);
}

.reading-progress {
  position: fixed;
  inset: var(--public-header-height) 0 auto;
  z-index: 19;
  height: 3px;
  background: #f0e1d4;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--orange);
}

.article-header {
  max-width: calc(970px + clamp(25px, 4.5vw, 65px));
  padding-block: clamp(30px, 5vw, 68px);
}

.k-blog .back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .875rem;
  font-weight: 600;
}

.k-blog .back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-hero {
  max-width: 850px;
  margin-top: 10px;
}

.post-hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

.post-hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  margin-top: 20px;
  color: var(--muted);
  font-size: .875rem;
}

.reading-time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .875rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(170px, 210px) minmax(0, 760px);
  justify-content: center;
  align-items: start;
  gap: clamp(25px, 4.5vw, 65px);
  padding-block: clamp(28px, 4.5vw, 56px) 75px;
}

.article-aside {
  position: sticky;
  top: calc(var(--public-header-height) + 25px);
  max-height: calc(100vh - var(--public-header-height) - 50px);
  overflow: auto;
  scrollbar-width: thin;
  border-radius: 12px;
}

.article-aside details {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.article-aside summary {
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
}

.article-aside nav {
  display: grid;
  gap: 12px;
  margin-top: 15px;
}

.article-aside nav a {
  padding-left: 10px;
  border-left: 1px solid #ced7e0;
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.55;
  text-decoration: none;
}

.article-aside nav a:hover,
.article-aside nav a.active {
  border-color: var(--orange-dark);
  color: var(--orange-dark);
}

.article-aside > .back-link {
  margin-top: 12px;
}

.featured-image {
  display: block;
  width: 100%;
  margin-bottom: clamp(28px, 4vw, 44px);
  border-radius: 12px;
}

.post-body .content {
  color: #253d55;
  font-size: clamp(1rem, 1.4vw, 1.0625rem);
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.post-body .content p {
  margin: 0 0 24px;
  color: inherit;
  font-size: inherit;
}

.post-body .content h1,
.post-body .content h2 {
  margin: 44px 0 20px;
  color: var(--ink);
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  line-height: 1.35;
  letter-spacing: -.025em;
}

.post-body .content h3,
.post-body .content h4 {
  margin: 32px 0 16px;
  font-size: 1.3125rem;
  line-height: 1.4;
}

.post-body .content > :first-child {
  margin-top: 0;
}

.post-body .content ul,
.post-body .content ol {
  margin-bottom: 26px;
  padding-left: 24px;
}

.post-body .content li {
  margin-bottom: 12px;
  padding-left: 5px;
}

.post-body .content li::marker {
  color: var(--orange-dark);
}

.post-body .content blockquote {
  margin: 30px 0;
  padding: 24px 28px;
  background: var(--cream);
  border-radius: 10px;
}

.post-body .content table {
  display: block;
  max-width: 100%;
  overflow: auto;
  border-collapse: collapse;
  font-size: .875rem;
}

.post-body .content td,
.post-body .content th {
  padding: 12px;
  border: 1px solid var(--line);
}

.post-body .content img {
  height: auto;
  border-radius: 8px;
}

.post-body .content a,
.share-buttons a {
  color: var(--orange-dark);
}

.post-body .content pre {
  overflow: auto;
  padding: 20px;
  background: var(--surface);
  font-size: .8125rem;
}

.share-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
  font-size: .875rem;
}

.share-buttons strong {
  width: 100%;
  font-size: .9375rem;
}

.share-buttons a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-underline-offset: 3px;
}

.share-buttons button {
  min-height: 44px;
  padding: 9px 15px;
}

.author-box {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  padding: 24px;
  background: var(--surface);
  border-radius: 12px;
}

.author-avatar {
  display: grid;
  flex: 0 0 45px;
  place-items: center;
  height: 45px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  font-size: 1.1875rem;
  font-weight: 600;
}

.author-info .author-name {
  margin: 0;
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 600;
}

.author-info p {
  margin-top: 3px;
  font-size: .8125rem;
}

.article-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
}

.article-end h2 {
  font-size: 1.5rem;
}

@media (max-width: 800px) {
  .blog-intro {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 42px;
  }

  .blog-search {
    justify-self: start;
  }

  .blog-library .blog-grid,
  .blog-library .post-card:first-child {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-aside {
    position: static;
    max-height: none;
  }

  .article-aside > .back-link {
    display: none;
  }
}

@media (max-width: 480px) {
  .blog-intro h1 {
    font-size: clamp(2.125rem, 9.6vw, 2.75rem);
  }

  .library-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .blog-help > .k-wrap {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-library .post-image img {
    transition: none;
  }

  .blog-library .post-image:hover img {
    transform: none;
  }
}
