/* ============================================================
   SYNORB — Blog styles
   Corporate blog layouts for /blog and post pages.
   ============================================================ */

.blog-hero {
  padding: 2.15rem 0 1.05rem;
  border-bottom: 1px solid var(--line);
}

.blog-hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(17rem, 0.58fr);
  gap: 1.15rem 3rem;
  align-items: end;
  margin-bottom: 1rem;
}

.blog-hero-index .blog-hero-head {
  grid-template-columns: minmax(0, 1fr);
  max-width: 58rem;
}

.blog-hero-head > *,
.hero-feature-grid,
.hero-feature-stack,
.hero-feature,
.hero-note,
.blog-layout > *,
.post-row {
  min-width: 0;
}

.blog-kicker {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.85rem;
}

.blog-title {
  font-family: var(--font-display);
  font-size: 3.65rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.02;
  color: var(--text);
  max-width: 15ch;
}

body:not(.login-page) .blog-hero .blog-title {
  font-size: 3.65rem !important;
  letter-spacing: 0 !important;
}

.blog-subtitle,
.blog-hero-dek {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 36rem;
  overflow-wrap: break-word;
}

.blog-hero-dek {
  justify-self: end;
  margin-bottom: 0.2rem;
}

.blog-hero-index .blog-hero-dek {
  justify-self: start;
  max-width: 42rem;
  margin-bottom: 0;
}

.hero-feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 0.85fr);
  gap: 1rem;
  align-items: stretch;
}

.hero-feature-grid-single {
  grid-template-columns: minmax(0, 1.35fr) minmax(17rem, 0.65fr);
}

.hero-feature-stack {
  display: grid;
  gap: 1rem;
}

.hero-feature,
.hero-note {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 94%, var(--text) 2%);
}

[data-theme="dark"] .hero-feature,
[data-theme="dark"] .hero-note {
  background: color-mix(in srgb, var(--bg) 88%, var(--text) 4%);
}

.hero-feature {
  display: flex;
  flex-direction: column;
  min-height: 10.75rem;
  padding: 1rem;
  transition: border-color 0.18s var(--ease-out-gentle), transform 0.18s var(--ease-out-gentle), background 0.18s var(--ease-out-gentle);
}

.hero-feature-primary {
  min-height: 17rem;
  padding: 1.15rem;
  justify-content: flex-end;
}

.hero-feature::before,
.hero-note::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(100% - 7rem), var(--line) calc(100% - 7rem), transparent calc(100% - 6.95rem)),
    repeating-linear-gradient(0deg, transparent 0, transparent 1.2rem, var(--line) 1.2rem, var(--line) calc(1.2rem + 1px));
  mask-image: linear-gradient(90deg, transparent 0, #000 58%, #000 100%);
}

.hero-feature > *,
.hero-note > * {
  position: relative;
  z-index: 1;
}

.hero-feature:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--bg) 91%, var(--text) 4%);
  transform: translateY(-2px);
}

[data-theme="dark"] .hero-feature:hover {
  background: color-mix(in srgb, var(--bg) 84%, var(--text) 7%);
}

.hero-feature-title {
  margin-top: 0.8rem;
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.08;
  color: var(--text);
  max-width: 23ch;
  overflow-wrap: break-word;
}

.hero-feature-primary .hero-feature-title {
  font-size: 2.25rem;
  max-width: 18ch;
}

.hero-feature-excerpt {
  margin-top: 0.65rem;
  color: var(--text-secondary);
  max-width: 42rem;
  overflow-wrap: break-word;
}

.hero-feature-secondary .hero-feature-excerpt {
  font-size: var(--small-size);
  line-height: 1.55;
}

.hero-feature-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.hero-feature-footer span:last-child {
  transition: transform 0.18s var(--ease-out-gentle);
}

.hero-feature:hover .hero-feature-footer span:last-child {
  transform: translateX(3px);
}

.hero-note {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 10.75rem;
  padding: 1rem;
}

.hero-note-strong {
  min-height: 17rem;
  padding: 1.15rem;
}

.hero-note-label {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.hero-note p {
  margin-top: 0.7rem;
  color: var(--text-secondary);
  max-width: 34rem;
}

.hero-note-link {
  width: fit-content;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  transition: color 0.18s ease;
}

.hero-note-link:hover {
  color: var(--text);
}

.blog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.15rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
  margin-bottom: 2rem;
}

.blog-tab {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  transition: color 0.18s ease, transform 0.18s var(--ease-out-gentle);
  position: relative;
  padding: 0.25rem 0;
}

.blog-tab:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.blog-tab.active {
  color: var(--text);
}

.blog-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.85rem;
  height: 1px;
  background: var(--text);
  opacity: 0.45;
}

.archive-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.archive-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  color: var(--text);
}

.archive-count {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  gap: 2.5rem;
  padding: 0 0 clamp(3rem, 7vh, 5rem);
}

.featured-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem 1.25rem 1.35rem;
  background: rgba(255, 255, 255, 0.35);
  transition: border-color 0.18s var(--ease-out-gentle), transform 0.18s var(--ease-out-gentle), background 0.18s var(--ease-out-gentle);
}

[data-theme="dark"] .featured-card {
  background: rgba(255, 255, 255, 0.03);
}

.featured-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.featured-title {
  margin-top: 0.65rem;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  color: var(--text);
  max-width: 44ch;
}

.featured-excerpt {
  margin-top: 0.65rem;
  color: var(--text-secondary);
  max-width: 78ch;
}

.post-rows {
  border-top: 1px solid var(--line);
}

.post-row {
  display: block;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.18s ease, transform 0.18s var(--ease-out-gentle);
}

.post-row:hover {
  transform: translateX(2px);
}

.post-row:hover .post-row-title {
  color: var(--text);
}

.post-row-title {
  margin-top: 0.45rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: break-word;
}

.post-row-excerpt {
  margin-top: 0.5rem;
  font-size: var(--small-size);
  color: var(--text-secondary);
  max-width: 82ch;
}

.side-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.05rem 1.05rem 1.15rem;
  background: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .side-card {
  background: rgba(255, 255, 255, 0.03);
}

.side-card + .side-card {
  margin-top: 1rem;
}

.side-title {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.side-text {
  margin-top: 0.55rem;
  font-size: var(--small-size);
  color: var(--text-secondary);
  line-height: 1.65;
}

.side-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  color: var(--text-tertiary);
  transition: color 0.18s ease;
}

.side-link:hover {
  color: var(--text);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 0 0 clamp(2.5rem, 6vh, 4rem);
}

.blog-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem 1.1rem 1.2rem;
  background: rgba(255, 255, 255, 0.35);
  transition: border-color 0.18s var(--ease-out-gentle), transform 0.18s var(--ease-out-gentle), background 0.18s var(--ease-out-gentle);
  min-height: 9.5rem;
}

[data-theme="dark"] .blog-card {
  background: rgba(255, 255, 255, 0.03);
}

.blog-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.blog-card-title {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0;
  line-height: 1.2;
  margin-top: 0.5rem;
}

.blog-card-desc {
  margin-top: 0.55rem;
  font-size: var(--small-size);
  color: var(--text-secondary);
  max-width: 60ch;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-tertiary);
}

.pill.dark {
  color: var(--text-secondary);
  border-color: var(--line-strong);
}

.blog-section {
  padding: 0 0 clamp(3rem, 7vh, 5rem);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text);
}

.section-link {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  color: var(--text-tertiary);
  transition: color 0.18s ease;
}

.section-link:hover {
  color: var(--text);
}

.post-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.post-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem 1.15rem 1.15rem;
  background: rgba(255, 255, 255, 0.3);
  transition: border-color 0.18s var(--ease-out-gentle), transform 0.18s var(--ease-out-gentle), background 0.18s var(--ease-out-gentle);
}

[data-theme="dark"] .post-card {
  background: rgba(255, 255, 255, 0.03);
}

.post-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.post-title {
  margin-top: 0.7rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
  color: var(--text);
}

.post-excerpt {
  margin-top: 0.6rem;
  font-size: var(--small-size);
  color: var(--text-secondary);
  max-width: 72ch;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 1.25rem 1.2rem;
  color: var(--text-tertiary);
  font-size: var(--small-size);
}

.blog-hero-head > *,
.hero-feature,
.hero-note,
.blog-tabs,
.archive-head,
.post-row,
.side-card {
  opacity: 0;
  animation: blog-desk-in 0.55s var(--ease-out-gentle) forwards;
}

.blog-hero-head > :nth-child(1) { animation-delay: 0.02s; }
.blog-hero-head > :nth-child(2) { animation-delay: 0.08s; }
.hero-feature-primary,
.hero-note-strong { animation-delay: 0.14s; }
.hero-feature-stack > :nth-child(1),
.hero-note:not(.hero-note-strong) { animation-delay: 0.2s; }
.hero-feature-stack > :nth-child(2) { animation-delay: 0.26s; }
.blog-tabs { animation-delay: 0.32s; }
.archive-head { animation-delay: 0.36s; }
.post-row:nth-child(1) { animation-delay: 0.4s; }
.post-row:nth-child(2) { animation-delay: 0.44s; }
.post-row:nth-child(3) { animation-delay: 0.48s; }
.post-row:nth-child(4) { animation-delay: 0.52s; }
.post-row:nth-child(5) { animation-delay: 0.56s; }
.post-row:nth-child(6) { animation-delay: 0.6s; }
.post-row:nth-child(7) { animation-delay: 0.64s; }
.side-card:nth-child(1) { animation-delay: 0.42s; }
.side-card:nth-child(2) { animation-delay: 0.48s; }

@keyframes blog-desk-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Post page */
.blog-article {
  padding: clamp(2.25rem, 5vh, 3rem) 0 clamp(3rem, 7vh, 5rem);
}

.article-header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.article-title {
  margin-top: 0.85rem;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.12;
  color: var(--text);
  max-width: 28ch;
}

.article-subhead {
  margin-top: 0.9rem;
  color: var(--text-secondary);
  max-width: 78ch;
}

.article-body {
  margin-top: 1.4rem;
  max-width: 78ch;
  color: var(--text-secondary);
}

.article-body h2 {
  margin-top: 1.65rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
  color: var(--text);
}

.article-body h2 + p,
.article-body h2 + ul {
  margin-top: 0.8rem;
}

.article-body a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.25);
  text-underline-offset: 3px;
}

[data-theme="dark"] .article-body a {
  text-decoration-color: rgba(255, 255, 255, 0.25);
}

.article-body p + p,
.article-body p + ul,
.article-body ul + p {
  margin-top: 1rem;
}

.article-body ul {
  padding-left: 1.25rem;
}

.article-body li {
  margin: 0.3rem 0;
}

.quote-line {
  margin-top: 1.35rem;
  padding: 1rem 1.1rem;
  border-left: 2px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.25);
  color: var(--text);
  letter-spacing: 0;
}

[data-theme="dark"] .quote-line {
  background: rgba(255, 255, 255, 0.03);
}

.article-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.article-footer a {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  color: var(--text-tertiary);
  transition: color 0.18s ease;
}

.article-footer a:hover {
  color: var(--text);
}

@media (max-width: 1040px) {
  .blog-hero-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .blog-hero-dek {
    justify-self: start;
    max-width: 44rem;
  }

  body:not(.login-page) .blog-hero .blog-title {
    font-size: 2.95rem !important;
  }

  .hero-feature-grid,
  .hero-feature-grid-single {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-feature-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-feature-primary,
  .hero-note-strong {
    min-height: 15rem;
  }
}

@media (max-height: 780px) and (min-width: 861px) {
  .blog-hero {
    padding-top: 1.45rem;
    padding-bottom: 0.85rem;
  }

  .blog-kicker {
    margin-bottom: 0.55rem;
  }

  .blog-hero-head {
    margin-bottom: 0.85rem;
  }

  body:not(.login-page) .blog-hero .blog-title {
    font-size: 3.15rem !important;
    max-width: 17ch;
  }

  .blog-hero-dek {
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 31rem;
  }

  .hero-feature,
  .hero-note {
    min-height: 9.35rem;
    padding: 0.9rem;
  }

  .hero-feature-primary,
  .hero-note-strong {
    min-height: 14.75rem;
  }

  .hero-feature-title {
    font-size: 1.25rem;
    margin-top: 0.55rem;
  }

  .hero-feature-primary .hero-feature-title {
    font-size: 2rem;
  }

  .hero-feature-excerpt {
    margin-top: 0.45rem;
  }

  .hero-feature-footer {
    margin-top: 0.85rem;
  }

  .blog-tabs {
    padding: 0.65rem 0;
    margin-bottom: 1.25rem;
  }
}

@media (max-width: 860px) {
  .blog-grid { grid-template-columns: 1fr; }
  .post-list { grid-template-columns: 1fr; }
  .blog-layout { grid-template-columns: 1fr; gap: 1.75rem; }
  .blog-tab.active::after { display: none; }
}

@media (max-width: 640px) {
  .blog-hero {
    padding: 1.45rem 0 0.85rem;
  }

  body:not(.login-page) .blog-hero .blog-title {
    font-size: 2.12rem !important;
    line-height: 1.05 !important;
  }

  .blog-hero-head {
    margin-bottom: 1rem;
  }

  .blog-hero-dek,
  .hero-feature-excerpt,
  .hero-note p {
    max-width: 100%;
  }

  .hero-feature-stack {
    display: none;
  }

  .hero-note:not(.hero-note-strong) {
    display: none;
  }

  .hero-feature,
  .hero-feature-primary,
  .hero-note,
  .hero-note-strong {
    min-height: auto;
    padding: 1rem;
  }

  .hero-feature-primary {
    min-height: 14.75rem;
  }

  .hero-feature-primary .hero-feature-title {
    font-size: 1.75rem;
  }

  .hero-feature-title {
    font-size: 1.35rem;
  }

  .featured-title,
  .section-title,
  .post-title,
  .article-body h2 {
    font-size: 1.35rem;
  }

  .post-row-title {
    font-size: 1.22rem;
  }

  .article-title {
    font-size: 2.2rem;
  }

  .blog-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1rem;
    margin-left: calc(var(--page-pad) * -1);
    margin-right: calc(var(--page-pad) * -1);
    padding-left: var(--page-pad);
    padding-right: var(--page-pad);
    scrollbar-width: none;
  }

  .blog-tabs::-webkit-scrollbar {
    display: none;
  }

  .blog-tab {
    flex: 0 0 auto;
  }

  .archive-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-hero-head > *,
  .hero-feature,
  .hero-note,
  .blog-tabs,
  .archive-head,
  .post-row,
  .side-card {
    opacity: 1;
    animation: none;
  }

  .hero-feature,
  .post-row,
  .blog-tab,
  .hero-feature-footer span:last-child {
    transition: none;
  }
}
