/* ==========================================================================
   TomoAid — Blog styles (list + post template)
   Append-only: assumes tomoaid.css is already loaded.
   ========================================================================== */

/* ---------- Blog list hero ---------- */
.blog-hero {
  max-width: 1220px;
  margin: 0 auto;
  padding: 200px 40px 40px;
  text-align: center;
}
.blog-hero .bar { margin: 32px auto 0; }

/* ---------- Featured article (big) ---------- */
.blog-featured {
  max-width: 1220px;
  margin: 24px auto 0;
  padding: 0 40px;
}
.blog-featured__card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  background: #fff;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  position: relative;
}
.blog-featured__cover {
  position: relative;
  min-height: 440px;
  overflow: hidden;
}
.blog-featured__cover .cover-inner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.blog-featured__body {
  padding: 56px 48px;
  display: flex; flex-direction: column; justify-content: center;
}
.blog-featured__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--grad-cta);
  color: #fff;
  font-family: var(--font-nav);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  align-self: flex-start;
  margin-bottom: 18px;
}
.blog-featured__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 40px;
  line-height: 1.15;
  color: var(--ink-900);
  margin: 0 0 20px;
}
.blog-featured__excerpt {
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink-500);
  font-weight: 300;
  margin: 0 0 28px;
}
.blog-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-400);
  font-size: 14px;
  font-family: var(--font-nav);
}
.blog-meta .dot {
  width: 3px; height: 3px; border-radius: 999px; background: var(--ink-300);
}
.blog-meta .author {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink-700);
}
.avatar {
  width: 36px; height: 36px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 900;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}
.avatar--mina { background: linear-gradient(135deg,#FFBB34,#F76D63); }
.avatar--kai  { background: linear-gradient(135deg,#7F31E9,#17557F); }
.avatar--yuki { background: linear-gradient(135deg,#0BC8C2,#0E9392); }
.avatar--eric { background: #f5f5f5 url('../assets/avatar-eric.png') center/cover no-repeat; color: transparent; }
.avatar--ten  { background: #f5f5f5 url('../assets/avatar-ten.png')  center/cover no-repeat; color: transparent; }

/* ---------- Toolbar: category + search ---------- */
.blog-toolbar {
  max-width: 1220px;
  margin: 64px auto 28px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.blog-cats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.cat-chip {
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-nav);
  font-size: 14px;
  color: var(--ink-500);
  background: transparent;
  border: 1.5px solid transparent;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.cat-chip:hover { color: var(--ink-900); background: var(--ink-75); }
.cat-chip.is-active {
  color: var(--ink-900);
  border-color: var(--ink-900);
  background: #fff;
}
.cat-chip .count {
  display: inline-block;
  margin-left: 6px;
  color: var(--ink-300);
  font-size: 12px;
}
.cat-chip.is-active .count { color: var(--ink-500); }

.blog-search {
  position: relative;
  flex: 0 0 300px;
}
.blog-search input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--ink-100);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-700);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.blog-search input:focus {
  outline: none;
  border-color: var(--tomo-coral);
  box-shadow: 0 0 0 4px rgba(247,109,99,.10);
}
.blog-search svg {
  position: absolute;
  left: 16px; top: 50%;
  width: 16px; height: 16px;
  transform: translateY(-50%);
  color: var(--ink-400);
}

/* ---------- Card grid ---------- */
.blog-grid-wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 40px 40px;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.post-card {
  background: #fff;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
  display: flex; flex-direction: column;
  color: inherit;
  position: relative;
}
.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0,0,0,.09);
}
.post-card__cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.post-card__cover .cover-inner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.post-card:hover .cover-inner { transform: scale(1.04); }
.post-card__cat {
  position: absolute;
  top: 14px; left: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  color: var(--ink-900);
  font-family: var(--font-nav);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.post-card__body {
  padding: 26px 24px 24px;
  display: flex; flex-direction: column;
  gap: 14px;
  flex: 1;
}
.post-card__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink-900);
  margin: 0;
}
.post-card__excerpt {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-500);
  font-weight: 300;
  margin: 0;
  flex: 1;
}
.post-card .blog-meta { font-size: 12px; }
.post-card .avatar { width: 28px; height: 28px; font-size: 11px; }

/* ---------- Empty state + load more ---------- */
.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-400);
}
.blog-empty strong {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink-700);
  margin-bottom: 6px;
}
.blog-load-more {
  display: flex;
  justify-content: center;
  padding: 20px 40px 80px;
}

/* ---------- Subscribe CTA (end of list + end of post) ---------- */
.blog-cta-strip {
  max-width: 1220px;
  margin: 40px auto 80px;
  padding: 56px 48px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(1200px 400px at 90% -20%, rgba(247,109,99,.18), transparent 60%),
    radial-gradient(900px 400px at -10% 120%, rgba(127,49,233,.14), transparent 60%),
    #fff;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  box-shadow: var(--shadow-card);
}
.blog-cta-strip h3 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  line-height: 1.2;
  color: var(--ink-900);
  margin: 0 0 14px;
}
.blog-cta-strip p {
  margin: 0;
  color: var(--ink-500);
  font-size: 15px;
  line-height: 1.8;
}
.blog-cta-strip form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

/* ==========================================================================
   Blog POST page
   ========================================================================== */

/* --- Hero of the post --- */
.post-hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 200px 40px 40px;
  text-align: center;
}
.post-hero .cat {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ink-900);
  color: #fff;
  font-family: var(--font-nav);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.post-hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 52px;
  line-height: 1.12;
  color: var(--ink-900);
  margin: 0 0 22px;
  text-wrap: balance;
}
.post-hero .post-lead {
  font-size: 20px;
  line-height: 1.8;
  color: var(--ink-500);
  font-weight: 300;
  margin: 0 0 28px;
  text-wrap: pretty;
}
.post-hero .blog-meta { justify-content: center; }

/* --- Cover image / hero block --- */
.post-cover {
  max-width: 1120px;
  margin: 40px auto 0;
  padding: 0 40px;
}
.post-cover__inner {
  aspect-ratio: 21 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-card);
}
.post-cover__inner .cover-inner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}

/* --- Layout: article + sticky TOC --- */
.post-layout {
  max-width: 1120px;
  margin: 40px auto 0;
  padding: 40px 40px 60px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 80px;
  align-items: start;
}
.post-article {
  max-width: 720px;
  width: 100%;
  justify-self: center;
}
.post-toc {
  position: sticky;
  top: 140px;
  font-family: var(--font-nav);
  font-size: 13px;
  padding: 4px 0;
  border-left: 1.5px solid var(--ink-100);
}
.post-toc__label {
  padding-left: 16px;
  font-size: 11px;
  letter-spacing: .24em;
  color: var(--ink-400);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.post-toc a {
  display: block;
  padding: 8px 16px;
  color: var(--ink-400);
  border-left: 2px solid transparent;
  margin-left: -1.5px;
  transition: color .2s ease, border-color .2s ease;
  line-height: 1.5;
}
.post-toc a:hover { color: var(--ink-700); }
.post-toc a.is-active {
  color: var(--ink-900);
  border-color: var(--tomo-coral);
}

/* --- Article typography --- */
.post-article h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  line-height: 1.25;
  color: var(--ink-900);
  margin: 48px 0 18px;
  scroll-margin-top: 120px;
}
.post-article h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink-900);
  margin: 32px 0 12px;
}
.post-article p {
  font-size: 17px;
  line-height: 2;
  color: var(--ink-700);
  font-weight: 300;
  margin: 0 0 20px;
  text-wrap: pretty;
}
.post-article p > em,
.post-article p > strong { color: var(--ink-900); }
.post-article a {
  color: var(--tomo-coral-deep);
  border-bottom: 1px dashed var(--tomo-coral);
  transition: color .2s ease, border-color .2s ease;
}
.post-article a:hover { color: var(--ink-900); border-color: var(--ink-900); }

.post-article ul, .post-article ol {
  padding-left: 24px;
  margin: 0 0 24px;
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink-700);
  font-weight: 300;
}
.post-article li { margin-bottom: 8px; }

/* Drop cap on the first paragraph of the intro */
.post-article .lede::first-letter {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 82px;
  line-height: .9;
  float: left;
  padding: 8px 14px 0 0;
  color: var(--tomo-coral);
  background: linear-gradient(180deg, var(--tomo-yellow-soft), var(--tomo-coral));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Embedded iframe frame */
.embed-frame {
  margin: 40px 0;
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.embed-frame__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--ink-75);
  border-bottom: 1px solid var(--ink-100);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-500);
}
.embed-frame__link {
  font-size: 12px;
  color: var(--tomo-purple);
  text-decoration: none;
  border: none;
}
.embed-frame__link:hover { text-decoration: underline; }
.embed-frame__img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity .2s;
}
.embed-frame a:hover .embed-frame__img { opacity: .88; }

/* Pull quote */
.pull-quote {
  margin: 40px -20px;
  padding: 28px 28px 28px 32px;
  border-left: 4px solid transparent;
  border-image: var(--grad-cta) 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.5;
  color: var(--ink-900);
  font-style: italic;
  position: relative;
}
.pull-quote::before {
  content: '“';
  position: absolute;
  top: -14px; left: 14px;
  font-family: Georgia, serif;
  font-size: 72px;
  color: var(--tomo-coral);
  line-height: 1;
  font-style: normal;
}
.pull-quote cite {
  display: block;
  margin-top: 14px;
  font-family: var(--font-nav);
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  color: var(--ink-400);
}

/* Callout / key-point box */
.callout {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  align-items: start;
  padding: 22px 26px;
  border-radius: var(--r-md);
  background: #FFF8E6;
  border: 1px solid #FDE8A8;
  margin: 32px 0;
}
.callout__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--grad-cta);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 900;
  flex-shrink: 0;
}
.callout__body strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--ink-900);
  margin-bottom: 4px;
  font-size: 16px;
}
.callout__body p {
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-700);
  font-weight: 300;
}

/* Inline figure + caption */
.post-figure {
  margin: 32px -20px;
}
.post-figure__img {
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
  box-shadow: var(--shadow-card);
}
.post-figure__img .cover-inner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.post-figure figcaption {
  margin-top: 12px;
  font-family: var(--font-nav);
  font-size: 13px;
  color: var(--ink-400);
  text-align: center;
}

/* Share row + tags */
.post-share {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--ink-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.tag-list {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.tag-list a {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ink-75);
  color: var(--ink-500);
  font-family: var(--font-nav);
  font-size: 12px;
  letter-spacing: .08em;
  transition: background .2s ease, color .2s ease;
  border-bottom: 0;
}
.tag-list a:hover { background: var(--ink-100); color: var(--ink-900); border-bottom: 0; }
.share-row { display: flex; gap: 8px; }
.share-btn {
  width: 40px; height: 40px;
  border-radius: 999px;
  background: var(--ink-75);
  color: var(--ink-500);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.share-btn:hover {
  background: var(--grad-cta);
  color: #fff;
  transform: translateY(-2px);
}
.share-btn svg { width: 16px; height: 16px; }

/* FAQ section */
.post-faq {
  margin-top: 48px;
  padding: 32px;
  background: var(--ink-50, #f8f7f5);
  border-radius: var(--r-lg);
  border-left: 4px solid var(--yellow, #FFBB34);
}
.post-faq h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  color: var(--ink-900);
  margin: 0 0 24px;
}
.faq-item { margin-bottom: 20px; }
.faq-item:last-child { margin-bottom: 0; }
.faq-q {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-900);
  margin-bottom: 6px;
}
.faq-a {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-500);
  font-weight: 300;
}

/* Author card */
.author-card {
  margin-top: 40px;
  padding: 32px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 22px;
  align-items: center;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.author-card .avatar { width: 72px; height: 72px; font-size: 24px; }
.author-card strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  color: var(--ink-900);
}
.author-card .role {
  font-family: var(--font-nav);
  font-size: 13px;
  color: var(--ink-400);
  margin-bottom: 8px;
}
.author-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-500);
  font-weight: 300;
}

/* Related posts */
.related-wrap {
  max-width: 1220px;
  margin: 60px auto 0;
  padding: 60px 40px 20px;
  border-top: 1px solid var(--ink-100);
}
.related-wrap .section-head { text-align: left; margin-bottom: 36px; }
.related-wrap .section-head .bar { margin: 0 0 22px; }
.related-wrap .section-head h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 36px;
  color: var(--ink-900);
  margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .post-layout { grid-template-columns: 1fr; gap: 40px; }
  .post-toc { position: static; border-left: 0; padding: 0; }
  .post-toc__label { padding-left: 0; }
  .post-toc a { padding: 6px 0; margin-left: 0; border-left: 0; }
  .post-toc a.is-active { color: var(--ink-900); border-left: 0; }
}
@media (max-width: 900px) {
  .blog-hero { padding: 150px 24px 24px; }
  .blog-featured { padding: 0 24px; }
  .blog-featured__card { grid-template-columns: 1fr; }
  .blog-featured__cover { min-height: 240px; }
  .blog-featured__body { padding: 32px 28px; }
  .blog-featured__title { font-size: 28px; }

  .blog-toolbar { padding: 0 24px; gap: 14px; margin-top: 40px; }
  .blog-search { flex: 1 1 100%; }
  .blog-grid-wrap { padding: 16px 24px 40px; }
  .blog-grid { grid-template-columns: 1fr; gap: 24px; }

  .blog-cta-strip { grid-template-columns: 1fr; padding: 36px 28px; margin: 30px 24px 60px; }
  .blog-cta-strip h3 { font-size: 24px; }

  .post-hero { padding: 150px 24px 24px; }
  .post-hero h1 { font-size: 32px; }
  .post-hero .post-lead { font-size: 17px; }
  .post-cover { padding: 0 24px; }
  .post-cover__inner { aspect-ratio: 16 / 10; }
  .post-layout { padding: 32px 24px 48px; gap: 32px; }
  .post-article h2 { font-size: 22px; }
  .post-article p, .post-article ul, .post-article ol { font-size: 15px; }
  .pull-quote { margin: 28px 0; font-size: 18px; padding: 22px 20px 22px 26px; }
  .post-figure { margin: 24px 0; }
  .related-wrap { padding: 40px 24px 20px; }
  .related-wrap .section-head h2 { font-size: 26px; }
  .author-card { grid-template-columns: 56px 1fr; padding: 22px; }
  .author-card .avatar { width: 56px; height: 56px; font-size: 20px; }
}
