/*
  Buffer v3 blog index, topic and author pages (/blog). A port of the index
  parts of the v1 buffer-blog.css with the v3 values from
  design/v3-handoff/Buffer Blog v3.dc.html and Blog Card v3.dc.html.
  As on v1, the design's container queries are viewport media queries at
  the same widths (cqw becomes vw). Breakpoints: >= 1024 · 768–1023 · < 768.

  Tokens, nav, footer, buttons, tactile press states, segmented controls and
  the glows come from v3-site.css.
*/

.v3-blog-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--teal-700);
}

/* ---------------------------------------------------------------- nav */

.v3-nav--blog { z-index: 30; }
.v3-nav--blog .v3-nav-bar { padding: 0 10px 0 clamp(16px, 2vw, 24px); }

.v3-nav--blog .v3-btn-nav {
  height: clamp(36px, 4vw, 40px);
  padding: 0 clamp(14px, 1.6vw, 18px);
  font-size: clamp(13px, 1.2vw, 14px);
}

.v3-blog-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 767px) {
  .v3-blog-menu-btn { display: flex; }
}

/* Mobile menu: a white card over a dimmed page (native <dialog>). */
.v3-blog-sheet {
  position: fixed;
  inset: 12px 12px auto;
  width: auto;
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: 0;
  padding: 10px 10px 12px;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  overflow: auto;
}

.v3-blog-sheet[open] { animation: v3-blog-sheet-in .25s ease-out; }
.v3-blog-sheet::backdrop {
  background: rgb(var(--navy-rgb) / .34);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: v3-blog-fade-in .25s ease-out;
}

@keyframes v3-blog-sheet-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes v3-blog-fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .v3-blog-sheet[open], .v3-blog-sheet::backdrop { animation: none; }
}

.v3-blog-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 36px;
  padding-left: 6px;
}

.v3-blog-sheet-head img { display: block; width: auto; height: 20px; }
.v3-blog-sheet-actions { display: flex; align-items: center; gap: 6px; }
.v3-blog-sheet-actions .v3-btn { height: 36px; padding: 0 14px; font-size: 13px; }

.v3-blog-sheet-close {
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--tray);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.v3-blog-sheet-links { display: flex; flex-direction: column; margin-top: 8px; }

.v3-blog-sheet-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 10px;
  border-radius: 14px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
}

.v3-blog-sheet-link .v3-i { color: var(--text-3); }
.v3-blog-sheet-link[aria-current] .v3-i { color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .v3-blog-sheet-link:hover { background: var(--tray); }
}

/* ----------------------------------------------------------- index hero */

.v3-blog-hero {
  position: relative;
  margin: clamp(8px, 1vw, 12px) clamp(8px, 1vw, 12px) 0;
  border-radius: clamp(24px, 3vw, 28px);
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, var(--sage-200) 0%, var(--sage-100) 55%, var(--white) 100%);
  padding: clamp(108px, 13vw, 152px) clamp(16px, 4vw, 48px) clamp(92px, 10vw, 112px);
}

.v3-blog-hero .v3-blog-glow-a { --t: 1.2; top: -200px; left: -120px; width: 720px; height: 720px; }
.v3-blog-hero .v3-blog-glow-b { --t: 1.2; top: -40px; right: -160px; width: 760px; height: 760px; }
.v3-blog-hero .v3-blog-glow-c { --t: 1.2; top: -80px; right: 260px; width: 520px; height: 520px; }

.v3-blog-hero-grid {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: clamp(16px, 3vw, 48px);
  align-items: end;
}

.v3-blog-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.v3-blog-hero-title {
  max-width: 640px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--ink);
  text-wrap: balance;
}

.v3-blog-hero-intro {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* The header's small text sits on the drifting teal glow, which takes teal
   and text-2 below 4.5:1 (3.8 and 2.6 at worst). Charcoal stays above 4.9
   throughout. The reference draws the kicker teal-700 and the intro text-2. */
.v3-blog-hero .v3-blog-eyebrow { color: var(--ink-2); }
.v3-blog-hero-copy .v3-blog-eyebrow a { color: inherit; text-decoration: none; }

/* Author pages put a portrait beside the name. */
.v3-blog-hero-person { display: flex; align-items: center; gap: 18px; }

.v3-blog-hero-avatar {
  flex: none;
  width: clamp(64px, 7vw, 88px);
  height: clamp(64px, 7vw, 88px);
  border-radius: 50%;
  object-fit: cover;
  background: var(--zone);
  box-shadow: var(--shadow-card);
}

.v3-blog-hero-role { font-size: 15px; line-height: 1.5; color: var(--ink-2); }

@media (max-width: 1023px) {
  .v3-blog-hero-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------- index toolbar */

.v3-blog-main {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: -56px auto 0;
  padding: 0 clamp(16px, 4vw, 48px);
}

/* Author pages have no filter card to overlap the hero. */
.v3-blog-main--plain { margin-top: 0; }
.v3-blog-main--plain .v3-blog-results { margin-top: 32px; }

.v3-blog-toolbar {
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: clamp(16px, 2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.v3-blog-toolbar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.v3-blog-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}

.v3-blog-search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-2);
  pointer-events: none;
}

.v3-blog-search-input {
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 48px 0 46px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--tray);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}

/* A field: the 2px ring plus the 3px tint. */
.v3-blog-search-input:focus-visible { outline-offset: 2px; box-shadow: var(--focus-ring); }
.v3-blog-search-input::placeholder { color: var(--text-2); opacity: 1; }
.v3-blog-search-input::-webkit-search-cancel-button,
.v3-blog-search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.v3-blog-search-clear {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-segment);
}

.v3-blog-search-submit {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  padding: 0;
}

.v3-blog-audience .v3-seg-opt { text-decoration: none; }

.v3-blog-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.v3-blog-chip {
  height: 36px;
  padding: 0 14px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid rgb(var(--navy-rgb) / .14);
  background: var(--surface);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.v3-blog-chip[aria-current] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-navy);
}

@media (hover: hover) and (pointer: fine) {
  .v3-blog-chip:not([aria-current]):hover { background: var(--tray); }
}

[data-press="chip"].is-pressed {
  transform: scale(calc(1 - .04 * var(--m))) !important;
  transition: transform .09s ease-out !important;
}

@media (max-width: 767px) {
  .v3-blog-toolbar-row { grid-template-columns: minmax(0, 1fr); }
  .v3-blog-audience { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .v3-blog-audience .v3-seg-opt { padding: 0; justify-content: center; }
}

.v3-blog-results {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.v3-blog-results-label { font-size: 14px; color: var(--text-2); }

.v3-blog-clear {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.v3-blog-featured { margin-top: 20px; }

.v3-blog-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .v3-blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .v3-blog-grid { grid-template-columns: minmax(0, 1fr); }
}

.v3-blog-more {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.v3-btn-secondary {
  height: 48px;
  padding: 0 24px;
  border: 1px solid rgb(var(--navy-rgb) / .12);
  background: var(--surface);
  color: var(--ink);
}

@media (hover: hover) and (pointer: fine) {
  [data-btn="secondary"]:hover {
    background: var(--tray);
    transform: translateY(calc(-1px * var(--m)));
  }
}

.v3-blog-more-label { font-size: 13px; color: var(--text-2); }

.v3-blog-empty {
  margin-top: 20px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: clamp(36px, 5vw, 64px) clamp(20px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.v3-blog-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--zone);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.v3-blog-empty h2 {
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
}

.v3-blog-empty p {
  max-width: 440px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
}

.v3-blog-empty .v3-btn { margin-top: 8px; }

/* ---------------------------------------------------------------- cards */

.v3-post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.v3-post-card-cover {
  position: relative;
  aspect-ratio: 16 / 10;
}

.v3-post-card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.v3-post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.v3-aud-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}

.v3-aud-badge--employers { background: var(--ink); color: var(--on-navy); }
.v3-aud-badge--employees { background: var(--zone); color: var(--ink-2); }

.v3-post-category {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--teal-700);
}

.v3-post-card-title {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
  text-wrap: pretty;
}

.v3-post-card-title a { color: inherit; text-decoration: none; }

/* The title link stretches over the whole card. */
.v3-post-card [data-stretch]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.v3-post-card:has([data-stretch]:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.v3-post-card [data-stretch]:focus-visible { outline: none; }

.v3-post-card-excerpt {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.v3-post-card-foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.v3-post-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.v3-post-card-arrow { display: inline-flex; color: var(--ink); }
.v3-post-card-arrow .v3-i, .v3-post-card-read .v3-i { transition: transform var(--dur-fast) var(--ease); }

@media (hover: hover) and (pointer: fine) {
  .v3-post-card:hover .v3-post-card-arrow .v3-i,
  .v3-post-card:hover .v3-post-card-read .v3-i { transform: translateX(calc(3px * var(--m))); }
}

/* Featured: cover beside the text. */
.v3-post-card--featured {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  border-radius: 28px;
}

.v3-post-card--featured .v3-post-card-cover { aspect-ratio: auto; min-height: 380px; }

.v3-post-card--featured .v3-post-card-body { padding: 40px; gap: 18px; }
.v3-post-card--featured .v3-post-meta { gap: 12px; }

.v3-post-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgb(var(--navy-rgb) / .25);
}

.v3-post-card--featured .v3-post-card-title {
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.v3-post-card--featured .v3-post-card-excerpt {
  font-size: 17px;
  line-height: 1.6;
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  text-wrap: pretty;
}

.v3-post-card--featured .v3-post-card-foot { padding-top: 10px; flex-wrap: wrap; gap: 16px; }
.v3-post-card--featured .v3-post-time { font-size: 14px; }

.v3-post-card-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

@media (min-width: 768px) and (max-width: 1023px) {
  .v3-post-card--featured .v3-post-card-body { padding: 28px; }
}

@media (max-width: 767px) {
  .v3-post-card--featured { grid-template-columns: minmax(0, 1fr); }
  .v3-post-card--featured .v3-post-card-cover { min-height: 0; aspect-ratio: 16 / 10; }
  .v3-post-card--featured .v3-post-card-body { padding: 24px; }
}

/* ---------------------------------------------------------------- covers */

/* Sage ground behind every cover (the design's audience tint is the same for
   both audiences); it shows on its own while an image loads. */
.v3-cover {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--sage-200) 0%, var(--sage-100) 100%);
}

.v3-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* A post with no image yet shows the ground with two soft glows. */
.v3-cover-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.v3-cover-art::before,
.v3-cover-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.v3-cover-art::before {
  width: 70%;
  aspect-ratio: 1;
  left: -12%;
  bottom: -38%;
  background: radial-gradient(circle closest-side, rgb(var(--teal-rgb) / .22), rgb(var(--teal-rgb) / 0));
}

.v3-cover-art::after {
  width: 60%;
  aspect-ratio: 1;
  right: -14%;
  top: -30%;
  background: radial-gradient(circle closest-side, rgb(var(--gold-rgb) / .4), rgb(var(--gold-rgb) / 0));
}

/* ------------------------------------------------------------ not found */

.v3-blog-404 {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(140px, 16vw, 200px) clamp(16px, 4vw, 48px) 0;
}

.v3-blog-404-card {
  max-width: 560px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.v3-blog-404-card h1 {
  margin: 0;
  font-family: var(--heading);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--ink);
}

.v3-blog-404-card p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.v3-blog-404-card .v3-btn { margin-top: 8px; }

@media (max-width: 767px) {
  .v3-blog-404-card { padding: 28px 24px; }
}

/* --------------------------------------------------- editor's banner */

/* Shown to signed-in editors while the blog is hidden, and on previews. */
.v3-blog-banner {
  position: relative;
  z-index: 31;
  margin: 0;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--on-navy);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.v3-blog-banner a { color: var(--on-navy); font-weight: 600; text-underline-offset: 3px; }
.v3-blog-banner a:focus-visible { outline: 2px solid var(--focus-on-dark); outline-offset: 2px; border-radius: 2px; }
.v3-blog-banner ~ .v3-nav { top: 56px; }

/* -------------------------------------------------------------- footer */

.v3-footer--blog { margin-top: clamp(80px, 9vw, 128px); }

@media print {
  .v3-nav, .v3-blog-sheet, .v3-footer, .v3-blog-banner { display: none !important; }
}
