@import url("../index/styles.css");

.blog-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.blog-hero::after {
  position: absolute;
  right: 7%;
  bottom: -150px;
  width: 430px;
  height: 430px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 34px color-mix(in srgb, var(--accent) 5%, transparent), 0 0 0 68px color-mix(in srgb, var(--accent) 4%, transparent);
  pointer-events: none;
}

.blog-hero-inner {
  position: relative;
  display: flex;
  min-height: 410px;
  align-items: end;
  justify-content: space-between;
  gap: 50px;
  padding-top: 72px;
  padding-bottom: 72px;
}

.blog-hero h1 { max-width: 710px; margin-bottom: 20px; font-size: clamp(3.2rem, 6.2vw, 5.4rem); }
.blog-hero .hero-description { max-width: 500px; margin-bottom: 0; }
.blog-hero-side { position: relative; z-index: 1; display: grid; align-content: space-between; width: 170px; min-height: 126px; padding: 15px 0 0 17px; border-left: 1px solid var(--accent); }
.hero-index { color: var(--accent-strong); font-family: ui-monospace, monospace; font-size: .58rem; letter-spacing: .14em; }
.blog-hero-side p { margin: 0; color: var(--text-soft); font-size: .78rem; line-height: 1.75; }

.blog-content { border-bottom: 0; padding-top: 60px; }
.blog-toolbar { display: grid; grid-template-columns: 1fr 205px; gap: 12px; margin-bottom: 14px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box input, .category-select-wrap select { width: 100%; height: 50px; border: 1px solid var(--line-strong); border-radius: 10px; outline: none; background: var(--surface); color: var(--text); font: inherit; font-size: .78rem; transition: border-color 180ms ease, box-shadow 180ms ease; }
.search-box input { padding: 0 16px 0 43px; }
.search-box input::placeholder { color: var(--text-faint); }
.search-box input:focus, .category-select-wrap select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
.search-icon { position: absolute; left: 16px; z-index: 1; color: var(--accent); font-family: Georgia, serif; font-size: 1.35rem; line-height: 1; transform: translateY(-2px) rotate(-18deg); }
.category-select-wrap select { padding: 0 36px 0 16px; cursor: pointer; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 7px; min-height: 34px; margin-bottom: 53px; }
.tag-filter button { padding: 5px 10px; border: 1px solid var(--line); border-radius: 20px; background: transparent; color: var(--text-soft); cursor: pointer; font-size: .64rem; transition: border-color 180ms ease, background 180ms ease, color 180ms ease; }
.tag-filter button:hover, .tag-filter button.active { border-color: var(--accent); background: var(--surface-tint); color: var(--accent-strong); }

.featured-heading, .posts-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.featured-heading { margin-bottom: 12px; }
.featured-heading .section-kicker, .posts-heading .section-kicker { margin-bottom: 0; }
.result-count, .sort-label { color: var(--text-faint); font-family: ui-monospace, monospace; font-size: .6rem; letter-spacing: .11em; }
.featured-slot { margin-bottom: 72px; }
.featured-card { position: relative; display: grid; min-height: 300px; grid-template-columns: 1.08fr .92fr; overflow: hidden; border: 1px solid var(--accent-soft); border-radius: var(--radius-md); background: linear-gradient(120deg, var(--surface-tint), var(--surface)); transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.featured-card:hover { border-color: var(--accent); box-shadow: var(--shadow-soft); transform: translateY(-3px); }
.featured-copy { display: flex; flex-direction: column; padding: 31px 34px; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 14px; color: var(--text-faint); font-family: ui-monospace, monospace; font-size: .6rem; letter-spacing: .05em; }
.post-meta .category { color: var(--accent-strong); font-weight: 750; }
.meta-bullet { color: var(--line-strong); }
.featured-copy h3 { max-width: 560px; margin: 34px 0 11px; font-size: clamp(1.7rem, 3.2vw, 2.7rem); letter-spacing: -.06em; }
.featured-copy p { max-width: 500px; margin-bottom: auto; color: var(--text-soft); font-size: .86rem; line-height: 1.85; }
.read-link { display: inline-flex; align-items: center; gap: 10px; width: fit-content; margin-top: 25px; color: var(--accent-strong); font-size: .75rem; font-weight: 750; transition: gap 180ms ease; }
.read-link:hover { gap: 15px; }
.featured-art { position: relative; display: grid; min-height: 300px; place-items: center; overflow: hidden; border-left: 1px solid var(--accent-soft); background: color-mix(in srgb, var(--surface) 43%, transparent); }
.featured-art::before, .featured-art::after { position: absolute; border: 1px solid color-mix(in srgb, var(--accent) 31%, transparent); border-radius: 50%; content: ""; }
.featured-art::before { width: 255px; height: 255px; transform: rotate(-27deg) skewX(17deg); }
.featured-art::after { width: 180px; height: 180px; transform: rotate(35deg) skewX(17deg); opacity: .56; }
.art-index { position: relative; z-index: 1; color: var(--accent); font-family: ui-monospace, monospace; font-size: 4.7rem; font-weight: 300; letter-spacing: -.13em; }
.art-lines { position: absolute; display: flex; align-items: center; gap: 9px; transform: rotate(-20deg); }
.art-lines span { display: block; width: 2px; height: 80px; background: var(--accent); opacity: .45; }
.art-lines span:nth-child(2) { height: 145px; opacity: .95; }
.art-lines span:nth-child(3) { height: 54px; opacity: .6; }
.art-lines span:nth-child(4) { height: 101px; opacity: .75; }

.posts-heading { align-items: end; margin-bottom: 21px; }
.posts-heading h2 { margin-top: 9px; font-size: 2.45rem; }
.post-list { border-top: 1px solid var(--line-strong); }
.post-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 145px 28px; align-items: center; gap: 20px; min-height: 118px; border-bottom: 1px solid var(--line-strong); transition: padding 180ms ease, background 180ms ease; }
.post-row:hover { padding-inline: 15px; background: var(--surface-soft); }
.post-row .post-date { align-self: start; padding-top: 28px; color: var(--text-faint); font-family: ui-monospace, monospace; font-size: .62rem; letter-spacing: .03em; }
.post-row-copy h3 { margin: 0 0 7px; font-size: 1.08rem; letter-spacing: -.035em; }
.post-row-copy p { max-width: 620px; margin: 0; color: var(--text-soft); font-size: .75rem; line-height: 1.72; }
.post-row .post-side { display: grid; gap: 7px; justify-items: start; }
.post-row .post-side .category { color: var(--accent-strong); font-size: .56rem; font-weight: 750; letter-spacing: .1em; }
.post-row .post-side .reading-time { color: var(--text-faint); font-family: ui-monospace, monospace; font-size: .56rem; }
.post-row .post-arrow { color: var(--accent); font-size: 1.05rem; text-align: right; }
.post-row[hidden] { display: none; }
.empty-state { padding: 75px 20px; border: 1px dashed var(--line-strong); color: var(--text-soft); text-align: center; }
.empty-state > span { color: var(--accent); font-size: 1.5rem; }
.empty-state h3 { margin: 10px 0 3px; font-size: 1.2rem; }
.empty-state p { margin: 0; font-size: .8rem; }

.blog-topics { padding: 100px 0; background: var(--accent); color: var(--ink-inverse); }
.topics-strip { display: grid; grid-template-columns: .9fr 1.1fr; align-items: end; gap: 70px; }
.blog-topics .section-kicker { color: color-mix(in srgb, var(--ink-inverse) 70%, transparent); }
.blog-topics h2 { font-size: clamp(2rem, 3.2vw, 3rem); }
.blog-topics h2 em { color: var(--ink-inverse); opacity: .76; }
.topic-pills { display: flex; flex-wrap: wrap; justify-content: end; gap: 10px; }
.topic-pills a { padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--ink-inverse) 32%, transparent); border-radius: 30px; color: color-mix(in srgb, var(--ink-inverse) 85%, transparent); font-size: .72rem; transition: background 180ms ease, color 180ms ease; }
.topic-pills a:hover { background: var(--ink-inverse); color: var(--accent-strong); }

@media (max-width: 800px) {
  .blog-hero-inner { min-height: auto; align-items: start; flex-direction: column; padding-top: 57px; padding-bottom: 62px; }
  .blog-hero-side { width: 100%; min-height: auto; padding: 13px 0 0; border-top: 1px solid var(--accent); border-left: 0; }
  .blog-hero-side p { margin-top: 22px; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-art { min-height: 210px; border-top: 1px solid var(--accent-soft); border-left: 0; }
  .featured-copy { padding: 26px; }
  .featured-copy h3 { margin-top: 25px; }
  .post-row { grid-template-columns: 90px minmax(0, 1fr) 25px; gap: 15px; padding: 18px 0; }
  .post-row .post-date { align-self: start; padding-top: 3px; }
  .post-row-copy p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .post-row .post-side { display: none; }
  .topics-strip { grid-template-columns: 1fr; gap: 33px; }
  .topic-pills { justify-content: start; }
}

@media (max-width: 580px) {
  .blog-toolbar { grid-template-columns: 1fr; }
  .tag-filter { margin-bottom: 40px; }
  .featured-slot { margin-bottom: 58px; }
  .posts-heading { align-items: start; flex-direction: column; gap: 13px; }
  .post-row { grid-template-columns: 1fr 25px; gap: 6px 15px; }
  .post-row .post-date { grid-column: 1; grid-row: 1; }
  .post-row-copy { grid-column: 1; grid-row: 2; }
  .post-row .post-arrow { grid-column: 2; grid-row: 1 / span 2; }
  .post-row-copy h3 { font-size: .98rem; }
  .blog-topics { padding: 75px 0; }
}


/* Article reading layout */
.reading-progress { position: fixed; top: 0; left: 0; z-index: 50; width: 100%; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.article-shell { width: min(calc(100% - 64px), 1060px); margin-inline: auto; padding: 88px 0 110px; }
.article-header { max-width: 820px; padding-bottom: 54px; border-bottom: 1px solid var(--line-strong); }
.article-header h1 { max-width: 800px; margin: 22px 0 18px; font-size: clamp(2.7rem, 5.5vw, 5rem); }
.article-header > p { max-width: 670px; margin-bottom: 22px; color: var(--text-soft); font-size: 1rem; line-height: 1.9; }
.article-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.article-tags a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--accent-strong); font-size: .62rem; transition: background 180ms ease, border-color 180ms ease; }
.article-tags a:hover { border-color: var(--accent); background: var(--surface-tint); }
.article-layout { display: grid; grid-template-columns: 170px minmax(0, 700px); gap: 74px; align-items: start; padding-top: 53px; }
.article-aside { position: sticky; top: 110px; }
.back-link { display: inline-flex; color: var(--text-soft); font-size: .72rem; font-weight: 700; transition: color 180ms ease; }
.back-link:hover { color: var(--accent-strong); }
.article-aside-rule { width: 32px; height: 1px; margin: 29px 0 23px; background: var(--accent); }
.aside-label { color: var(--text-faint); font-family: ui-monospace, monospace; font-size: .54rem; letter-spacing: .13em; }
.article-toc { display: grid; gap: 10px; margin-top: 15px; }
.article-toc a, .article-toc span { color: var(--text-faint); font-size: .66rem; line-height: 1.45; transition: color 180ms ease; }
.article-toc a:hover { color: var(--accent-strong); }
.article-toc .toc-level-3 { padding-left: 10px; font-size: .61rem; }
.article-body { min-width: 0; color: var(--text); font-size: 1rem; line-height: 2; }
.article-body > :first-child { margin-top: 0; }
.article-body h1 { margin: 0 0 27px; font-size: clamp(2rem, 4vw, 3.3rem); }
.article-body h2 { margin: 58px 0 15px; font-size: clamp(1.55rem, 3vw, 2.25rem); }
.article-body h3 { margin: 39px 0 11px; font-size: 1.35rem; }
.article-body p { margin: 0 0 24px; color: var(--text-soft); }
.article-body strong { color: var(--text); font-weight: 750; }
.article-body em { color: var(--accent-strong); }
.article-body a { color: var(--accent-strong); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 3px; }
.article-body a:hover { text-decoration-color: var(--accent); }
.article-body blockquote { margin: 34px 0; padding: 7px 0 7px 22px; border-left: 3px solid var(--accent); color: var(--text); font-family: var(--font-display); font-size: 1.15rem; font-weight: 650; line-height: 1.7; }
.article-body ul, .article-body ol { margin: 0 0 27px; padding-left: 24px; color: var(--text-soft); }
.article-body li { padding-left: 5px; margin-bottom: 6px; }
.article-body li::marker { color: var(--accent); }
.article-body code { padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); color: var(--accent-strong); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82em; }
.article-body pre { overflow-x: auto; margin: 30px 0; padding: 19px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--text); color: var(--bg); line-height: 1.65; }
.article-body pre code { padding: 0; border: 0; background: transparent; color: inherit; font-size: .79rem; }
.article-body hr { width: 100%; height: 1px; margin: 46px 0; border: 0; background: var(--line-strong); }
.article-body img { display: block; max-width: 100%; height: auto; margin: 30px 0; border: 1px solid var(--line); border-radius: 13px; }
.loading-state, .article-error { padding: 32px 0; color: var(--text-soft); }
.article-error { padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); }
.article-error strong { display: block; margin-bottom: 7px; color: var(--text); }
.article-error p { margin-bottom: 19px; font-size: .85rem; }
.article-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 80px 0 0 244px; padding-top: 23px; border-top: 1px solid var(--line-strong); }
.pagination-card { position: relative; display: grid; min-height: 102px; align-content: center; gap: 7px; padding: 13px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color 180ms ease, background 180ms ease, transform 180ms ease; }
.pagination-card:hover { border-color: var(--accent); background: var(--surface-soft); transform: translateY(-2px); }
.pagination-card span { color: var(--text-faint); font-family: ui-monospace, monospace; font-size: .56rem; letter-spacing: .1em; }
.pagination-card strong { max-width: 270px; font-size: .78rem; line-height: 1.45; }
.pagination-card b { position: absolute; top: 50%; color: var(--accent); font-size: 1rem; transform: translateY(-50%); }
.pagination-older b { right: 17px; }
.pagination-newer { text-align: right; }
.pagination-newer b { left: 17px; }

@media (max-width: 800px) {
  .article-shell { width: min(calc(100% - 36px), 1060px); padding-top: 60px; }
  .article-layout { grid-template-columns: 1fr; gap: 27px; padding-top: 34px; }
  .article-aside { position: static; }
  .article-aside-rule { display: none; }
  .article-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .article-toc a, .article-toc span { padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; }
  .article-toc .toc-level-3 { padding-left: 8px; }
  .article-pagination { margin-left: 0; }
}

@media (max-width: 580px) {
  .article-header h1 { font-size: 2.75rem; }
  .article-header > p { font-size: .91rem; }
  .article-body { font-size: .94rem; line-height: 1.9; }
  .article-body h2 { margin-top: 46px; }
  .article-pagination { grid-template-columns: 1fr; }
}
