/* ==========================================================
   Tanyag blog: /blogs/ list and post pages
   Builds on base.css + site.css (same colors, fonts, buttons).
   ========================================================== */
.blog-page main { padding-top: var(--ribbon-h); }

/* ---------- Blog hero ---------- */
.blog-hero { position: relative; overflow: hidden; background: radial-gradient(70% 90% at 80% 0%, var(--bg-2) 0%, var(--bg) 70%); }
.blog-hero__stripes {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(90deg, transparent 0 26px, color-mix(in srgb, var(--leaf) 14%, transparent) 26px 28px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%);
          mask-image: linear-gradient(90deg, transparent, #000 70%);
  animation: drift 26s linear infinite;
}
:root[data-theme="dark"] .blog-hero__stripes { background: repeating-linear-gradient(90deg, transparent 0 26px, rgba(232, 132, 90, .08) 26px 28px); }
.blog-hero__inner { position: relative; display: grid; gap: 22px; padding-block: clamp(70px, 12vh, 140px) clamp(40px, 6vh, 70px); }
.blog-hero .t-lead { max-width: 46ch; }

/* ---------- Topic filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.filter {
  --tag: var(--fg);
  height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: .92rem;
  border: 1.5px solid var(--line); background: color-mix(in srgb, var(--bg) 80%, transparent);
  display: inline-flex; align-items: center; gap: 9px; transition: background-color .3s, color .3s, border-color .3s;
}
.filter[data-filter]:not([data-filter="all"])::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tag); }
.filter:hover { border-color: var(--fg); }
.filter.is-on { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ---------- Tag chip + meta ---------- */
.tag {
  --tag: var(--rust);
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--tag); background: color-mix(in srgb, var(--tag) 12%, transparent);
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
:root[data-theme="dark"] .tag { color: color-mix(in srgb, var(--tag) 55%, #fff); background: color-mix(in srgb, var(--tag) 22%, transparent); }
.post-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--fg-2); font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.post-meta > span:last-child { display: inline-flex; align-items: center; gap: 6px; }
.post-meta svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- Covers: a photo, or a branded pattern ---------- */
.cover { --tag: var(--rust); position: relative; overflow: hidden; background: var(--bg-2); }
.cover > img:not(.cover__mark) { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.cover--art { background: linear-gradient(150deg, color-mix(in srgb, var(--tag) 78%, #fff 22%), var(--tag) 55%, color-mix(in srgb, var(--tag) 70%, #000 30%)); display: grid; place-items: center; }
.cover__stripes { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 22px, rgba(255, 255, 255, .09) 22px 24px); }
.cover__mark { position: relative; width: clamp(56px, 18%, 120px); filter: brightness(0) invert(1); opacity: .95; transition: transform 1s var(--ease-out); }
.cover__word {
  position: absolute; left: 18px; bottom: 14px; color: rgba(255, 255, 255, .9);
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 3vw, 2.6rem); letter-spacing: -.04em; line-height: 1;
}

/* ---------- Post cards ---------- */
.blog-list { padding-block: clamp(30px, 5vh, 60px) clamp(90px, 14vh, 160px); }
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.pgrid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pcard {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  border-radius: var(--radius); overflow: hidden; background: var(--bg-2);
  border: 1px solid var(--line); transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out);
}
.pcard[hidden] { display: none; }
.pcard:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -36px rgba(26, 18, 13, .55); }
.pcard:hover .cover > img:not(.cover__mark) { transform: scale(1.05); }
.pcard:hover .cover__mark { transform: rotate(-10deg) scale(1.08); }
.pcard__link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.pcard__link:focus-visible { outline-offset: -4px; }
.pcard__cover { aspect-ratio: 16 / 10; }
.pcard__body { display: grid; gap: 12px; padding: clamp(20px, 2vw, 28px); flex: 1; align-content: start; }
.pcard__top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.pcard__title { font-size: clamp(1.35rem, 1.1rem + .8vw, 1.9rem); line-height: 1.1; letter-spacing: -.025em; text-wrap: balance; }
.pcard__sum { margin: 0; color: var(--fg-2); }
.pcard__more { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--accent); margin-top: 4px; }
.pcard__more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--ease-out); }
.pcard:hover .pcard__more svg { transform: translateX(5px); }

/* The newest post runs wide */
.pgrid:not(.pgrid--two) .pcard--lead { grid-column: 1 / -1; display: grid; grid-template-columns: 1.25fr 1fr; }
.pgrid:not(.pgrid--two) .pcard--lead .pcard__cover { aspect-ratio: auto; min-height: 340px; }
.pgrid:not(.pgrid--two) .pcard--lead .pcard__body { align-content: center; padding: clamp(24px, 4vw, 56px); }
.pgrid:not(.pgrid--two) .pcard--lead .pcard__title { font-size: clamp(1.8rem, 1.2rem + 2vw, 3.2rem); }

.blog-empty { text-align: center; color: var(--fg-2); padding: 60px 0; }
.blog-empty button { color: var(--accent); }

@media (max-width: 1000px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pgrid:not(.pgrid--two) .pcard--lead { grid-template-columns: 1fr; }
  .pgrid:not(.pgrid--two) .pcard--lead .pcard__cover { aspect-ratio: 16 / 9; min-height: 0; }
}
@media (max-width: 640px) {
  .pgrid, .pgrid--two { grid-template-columns: 1fr; }
}

/* ---------- Post page ---------- */
.post__head { display: grid; gap: 20px; max-width: 980px; padding-block: clamp(44px, 8vh, 90px) clamp(28px, 4vh, 44px); }
.post__back { display: inline-flex; align-items: center; gap: 8px; width: fit-content; color: var(--fg-2); font-size: .95rem; }
.post__back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.post__back:hover { color: var(--fg); }
.post__top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.post__title { font-size: clamp(2.3rem, 1.4rem + 4vw, 5rem); line-height: .98; letter-spacing: -.045em; text-wrap: balance; }
.post__lead { max-width: 52ch; }
.post__cover { border-radius: var(--radius); aspect-ratio: 21 / 9; max-width: 1400px; }
.post__cover.cover--art .cover__mark { width: clamp(60px, 9vw, 130px); }

.post__grid { display: grid; grid-template-columns: 200px minmax(0, 720px); gap: clamp(24px, 5vw, 90px); justify-content: center; padding-block: clamp(40px, 7vh, 80px) clamp(70px, 10vh, 120px); }

/* Share rail: sticky on computers, a row on phones */
.share { position: sticky; top: calc(var(--ribbon-h) + 28px); align-self: start; display: grid; gap: 10px; }
.share__label { margin: 0 0 4px; font-size: .75rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-2); }
.share__btn {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line); font-weight: 700; font-size: .92rem; transition: background-color .3s, color .3s, border-color .3s;
}
.share__btn[hidden] { display: none; }
.share__btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.share__btn:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.share__btn:first-of-type:hover { background: #1877F2; border-color: #1877F2; color: #fff; }

/* Reading text */
.prose { font-size: clamp(1.06rem, 1rem + .3vw, 1.2rem); line-height: 1.75; min-width: 0; }
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.3rem); line-height: 1.1; letter-spacing: -.03em; margin-top: 2em; text-wrap: balance; }
.prose h3 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.55rem); line-height: 1.2; letter-spacing: -.02em; margin-top: 1.8em; }
.prose h4, .prose h5, .prose h6 { font-size: 1.1rem; letter-spacing: -.01em; margin-top: 1.6em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .6em; }
.prose a { color: var(--accent); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2.5px; }
.prose strong { font-weight: 800; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 0; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--accent); font-weight: 800; }
.prose blockquote {
  margin-inline: 0; padding: 22px 26px; border-radius: 18px;
  background: color-mix(in srgb, var(--accent) 9%, var(--bg)); border-left: 4px solid var(--accent);
  font-family: var(--font-display); font-weight: 600; font-size: 1.15em; line-height: 1.45; letter-spacing: -.01em;
}
.prose blockquote > * + * { margin-top: .6em; }
.prose figure { margin: 2em 0; }
.prose img { border-radius: 16px; width: 100%; height: auto; }
.prose figure img + * { margin-top: .5em; }
/* Two or more photos in a row sit side by side */
.prose .gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 16px); margin: 2em 0; }
.prose .gallery--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prose .gallery figure { margin: 0; }
.prose .gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.prose figure.video video { display: block; width: 100%; max-width: 560px; margin-inline: auto; border-radius: 16px; background: var(--bg-2); }
.prose figure.video figcaption { text-align: center; }
.prose figcaption { font-size: .82rem; line-height: 1.4; color: var(--fg-2); }
.prose .gallery--3 img { aspect-ratio: 3 / 4; }
@media (max-width: 560px) {
  .prose .gallery--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prose .gallery--3 img { aspect-ratio: 1 / 1; }
}
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.prose code { font-size: .9em; padding: .12em .4em; border-radius: 6px; background: var(--bg-2); }
.prose pre { overflow-x: auto; padding: 18px; border-radius: 14px; background: var(--bg-2); font-size: .9rem; }
.prose pre code { padding: 0; background: none; }

/* More posts */
.more { padding-bottom: clamp(80px, 12vh, 140px); }
.more__head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); }
.pgrid--two .pcard__cover { aspect-ratio: 16 / 9; }

/* CTA on blog pages: same rust band as the home page, a little shorter */
.blog-cta { padding: clamp(80px, 12vh, 140px) 0; }
.blog-cta .t-h1 { max-width: 14ch; }
.foot__link { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
  .post__grid { grid-template-columns: minmax(0, 1fr); }
  .share { position: static; order: 2; display: flex; flex-wrap: wrap; align-items: center; padding-top: 28px; border-top: 1px solid var(--line); }
  .share__label { width: 100%; }
  .post__cover { aspect-ratio: 16 / 10; }
}

@media (prefers-reduced-motion: reduce) {
  .pcard, .pcard:hover { transform: none; }
}
