/* Blog archive only; no shared styles or article styles are modified. */
main:has(.blog-library) { max-width: 1000px; }
.blog-library { color: var(--ink); overflow-wrap: anywhere; }
.blog-library [hidden] { display: none !important; }
.blog-library a { color: #8c1e50; text-underline-offset: 4px; }
.bl-intro { margin: 10px 0 24px; padding: 24px 28px; background: #fffdf9; border: 2px solid var(--ink); border-radius: 20px; box-shadow: 5px 5px 0 var(--brand-lavender, #dbd5ff); }
.bl-kicker { display: flex; gap: 8px 16px; flex-wrap: wrap; margin: 0 0 14px; font-size: .8rem; font-weight: 800; color: #8c1e50; letter-spacing: .06em; }
.bl-kicker span { color: var(--ink); letter-spacing: 0; }
.bl-intro h1 { margin: 0 0 12px; font-size: clamp(1.4rem, 3.4vw, 2rem); line-height: 1.6; }
.bl-intro > p:not(.bl-kicker) { margin: 0; font-size: .94rem; line-height: 1.9; }
.bl-guide { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; font-size: .85rem; font-weight: 700; }
.bl-guide a { display: inline-flex; align-items: center; min-height: 36px; }
.bl-search { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 18px; background: #fff5da; border: 2px solid var(--ink); border-radius: 16px; }
.bl-field { flex: 1 1 170px; min-width: 0; }
.bl-keyword { flex-grow: 2; }
.bl-field label { display: block; font-size: .83rem; font-weight: 800; margin-bottom: 6px; }
.bl-field input, .bl-field select { box-sizing: border-box; width: 100%; min-width: 0; height: auto; min-height: 46px; padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 1px solid var(--ink); border-radius: 8px; }
.bl-field input::placeholder { color: #66606b; opacity: 1; }
.bl-search button { min-height: 46px; padding: 10px 22px; border: 2px solid var(--ink); border-radius: 10px; background: var(--brand-pink, #ffb7d8); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.bl-search button:hover { background: #ffd9e9; }
.blog-library :focus-visible { outline: 3px solid #8c1e50; outline-offset: 4px; }
.bl-results-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin: 26px 0 14px; scroll-margin-top: 20px; }
.bl-results-heading h2 { font-size: 1.15rem; margin: 0; }
.bl-results-heading p { margin: 0; font-size: .85rem; }
.bl-results-heading span { margin-left: 12px; }
.bl-filter { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .9rem; }
.bl-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bl-card { min-width: 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 18px; background: #fffdf9; border: 2px solid var(--ink); border-radius: 16px; box-shadow: 3px 3px 0 var(--brand-lavender, #dbd5ff); }
.bl-picture { display: block; align-self: start; }
.bl-picture img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 675; object-fit: cover; border-radius: 8px; }
.bl-card-copy { min-width: 0; }
.bl-category { width: fit-content; margin: 0 0 8px; padding: 3px 8px; background: #ffe4ef; border-radius: 6px; font-size: .72rem; font-weight: 800; line-height: 1.7; }
.bl-card h3 { margin: 0; font-size: 1rem; line-height: 1.75; }
.bl-card h3 a { color: var(--ink); text-decoration: none; }
.bl-card h3 a:hover { text-decoration: underline; text-decoration-color: #8c1e50; }
.bl-summary { margin: 8px 0 0; font-size: .82rem; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bl-date { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin: 12px 0 0; font-size: .75rem; color: #59534f; }
.bl-date span { color: #8c1e50; font-weight: 800; }
.bl-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.bl-pagination a, .bl-pagination span[aria-current], .bl-pagination > span { display: inline-flex; min-width: 44px; min-height: 44px; padding: 6px 10px; align-items: center; justify-content: center; border: 1px solid var(--ink); border-radius: 8px; background: #fffdf9; font-weight: 700; font-size: .9rem; text-decoration: none; }
.bl-pagination [aria-current] { background: #ffb7d8 !important; color: var(--ink); border-width: 2px !important; }
.bl-pagination [aria-disabled] { color: #655e69; border-style: dashed; }
.bl-pagination a:hover { background: #ffe4ef; }
.bl-pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.bl-page-note { text-align: center; font-size: .78rem; margin: 12px 0 0; }
.bl-empty, .bl-note { grid-column: 1 / -1; padding: 22px; border: 1px solid var(--ink); border-radius: 12px; background: #fffdf9; line-height: 1.8; }
@media (max-width: 760px) { .bl-list { grid-template-columns: minmax(0, 1fr); } .bl-card { grid-template-columns: 120px minmax(0, 1fr); } }
@media (max-width: 480px) {
  .bl-intro { padding: 20px 18px; }
  .bl-wide { display: none; }
  .bl-search { padding: 14px; gap: 10px; }
  .bl-field { flex-basis: 140px; }
  .bl-keyword { flex-basis: 100%; }
  .bl-search button { flex: 1 1 100px; }
  .bl-card { grid-template-columns: 80px minmax(0, 1fr); padding: 14px; gap: 12px; }
  .bl-summary { display: none; }
  .bl-pages { order: -1; flex-basis: 100%; }
}

/* ブログ一覧：枠の寸法を変えず、既存余白と画像の上にキャラを重ねる */
.bl-intro,
.bl-picture,
.bl-card {
  position: relative;
}
.bl-intro {
  overflow: hidden;
}
.bl-intro::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 12px;
  width: 150px;
  height: 145px;
  background: url('/assets/characters/koyomi-guide-evening.webp') center bottom / contain no-repeat;
  filter: drop-shadow(0 8px 7px rgba(57, 36, 71, .14));
  pointer-events: none;
}
.bl-picture::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -9px;
  width: 52px;
  height: 52px;
  border: 2px solid var(--brand-ink);
  border-radius: 16px;
  background-color: var(--brand-yellow);
  background-repeat: no-repeat;
  background-position: center 6%;
  background-size: 104px auto;
  box-shadow: 2px 2px 0 var(--brand-lavender);
  pointer-events: none;
  transform: rotate(-4deg);
}
.bl-card:nth-child(4n + 1) .bl-picture::after {
  background-image: url('/assets/characters/koyomi-guide-welcome.webp');
}
.bl-card:nth-child(4n + 2) .bl-picture::after {
  background-image: url('/assets/characters/koyomi-guide-thinking.webp');
  background-color: var(--brand-mint);
  transform: rotate(4deg);
}
.bl-card:nth-child(4n + 3) .bl-picture::after {
  background-image: url('/assets/characters/koyomi-guide-discovery.webp');
  background-color: var(--brand-pink-pale);
}
.bl-card:nth-child(4n) .bl-picture::after {
  background-image: url('/assets/characters/koyomi-guide-evening.webp');
  background-color: var(--brand-cream-pale);
  transform: rotate(3deg);
}
@media (max-width: 760px) {
  .bl-intro::after {
    width: 92px;
    height: 90px;
    right: 12px;
    top: 8px;
    opacity: .9;
  }
}
@media (max-width: 520px) {
  .bl-intro::after {
    width: 62px;
    height: 60px;
    right: 8px;
    top: 7px;
  }
  .bl-picture::after {
    right: -6px;
    bottom: -6px;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background-size: 80px auto;
  }
}

/* 記事画像を隠さず、カードの既存の空き領域にスタンプを置く */
.bl-intro::after {
  right: 18%;
}
.bl-picture::after {
  left: 50%;
  right: auto;
  top: calc(100% + 9px);
  bottom: auto;
  width: 48px;
  height: 48px;
  transform: translateX(-50%) rotate(-4deg);
}
.bl-card:nth-child(4n + 2) .bl-picture::after {
  transform: translateX(-50%) rotate(4deg);
}
.bl-card:nth-child(4n + 3) .bl-picture::after {
  transform: translateX(-50%) rotate(-3deg);
}
.bl-card:nth-child(4n) .bl-picture::after {
  transform: translateX(-50%) rotate(3deg);
}
@media (max-width: 760px) {
  .bl-intro::after {
    right: 14%;
  }
}
@media (max-width: 520px) {
  .bl-intro::after {
    right: 11%;
  }
  .bl-picture::after {
    left: 50%;
    right: auto;
    top: calc(100% + 7px);
    bottom: auto;
    width: 40px;
    height: 40px;
  }
}

/* Blog hero: larger full-body guide without changing the intro box height. */
.bl-intro::after {
  top: 10px;
  right: 10%;
  width: 205px;
  height: 225px;
  background-image: url('/assets/characters/koyomi-guide-welcome.webp');
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
}

@media (max-width: 760px) {
  .bl-intro::after {
    top: 10px;
    right: 7%;
    width: 120px;
    height: 125px;
  }
}

@media (max-width: 520px) {
  .bl-intro::after {
    top: 8px;
    right: 5%;
    width: 76px;
    height: 82px;
  }
}

/* ブログ専用：トップと重ならない「机で暦を調べる」新規構図 */
.bl-intro::after {
  top: 8px;
  right: 6%;
  width: 255px;
  height: 225px;
  background-image: url('/assets/characters/koyomi-guide-blog-research.webp');
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
}
@media (max-width: 760px) {
  .bl-intro::after {
    top: 9px;
    right: 5%;
    width: 145px;
    height: 125px;
  }
}
@media (max-width: 520px) {
  .bl-intro::after {
    top: 7px;
    right: 3%;
    width: 88px;
    height: 78px;
  }
}

/* Blog cards: use the article-specific character artwork itself, without square stamps. */
.bl-card {
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: stretch;
}

.bl-picture {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 112px;
}

.bl-picture img {
  width: 160px;
  max-width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 0;
}

.bl-picture::after {
  content: none;
  display: none;
}

@media (max-width: 760px) {
  .bl-card {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .bl-picture img {
    width: 150px;
  }
}

@media (max-width: 480px) {
  .bl-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .bl-picture {
    min-height: 96px;
  }

  .bl-picture img {
    width: 112px;
  }
}
