/* =========================================================
  Miyashita BLOG LIST UI
  Version: 1.0.0
  CHANGELOG:
    - 1.0.0: BLOG LIST（カテゴリ＋featured＋カード＋ページネーション）初版
  Rollback:
    - 旧CSSへ戻す場合は blog.css を差し替え、index.html の ?ver を戻す
========================================================= */

:root {
  /* Color（低彩度＋差し色1色） */
  --c-bg: #eef3f6;
  --c-surface: #ffffff;
  --c-text: #1a2328;
  --c-muted: #5b6a72;
  --c-line: #d7e2e8;

  /* Accent（差し色：緑寄りティール） */
  --c-accent: #2a8c7a;
  --c-accent-weak: #e3f2ef;

  /* Badge tones（同系色の濃淡で運用） */
  --c-genba: #2a8c7a;
  --c-shagai: #2f7c98;
  --c-recruit: #2f6e8f;
  --c-news: #4a5f6b;

  /* Radius / Shadow */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;

  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 26px rgba(0, 0, 0, 0.10);

  /* Layout */
  --container: 1180px;
  /* 既存サイトの実寸に合わせて調整OK */
  --gutter: 16px;

  /* Typography */
  --fz-12: 0.75rem;
  --fz-14: 0.875rem;
  --fz-16: 1rem;
  --fz-18: 1.125rem;
  --fz-22: 1.375rem;
  --fz-30: 1.875rem;
  --lh: 1.7;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", Arial, sans-serif;
  line-height: var(--lh);
  color: var(--c-text);
  background: var(--c-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(42, 140, 122, 0.35);
  outline-offset: 3px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 10px;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
  z-index: 50;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Utilities / Layout */
.l-container {
  width: min(var(--container), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

.l-section {
  padding-block: 28px;
}

/* =========================================================
  Header（簡易：既存と入れ替え可）
========================================================= */
.site-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 12px;
  gap: 14px;
}

.site-header__logo {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.site-header__logo-mark {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: var(--fz-14);
  color: var(--c-muted);
}

.site-header__logo-text {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.site-header__menu {
  list-style: none;
  display: none;
  /* モバイルは隠す（既存サイトのメニューに置換推奨） */
  margin: 0;
  padding: 0;
  gap: 18px;
  align-items: center;
}

.site-header__cta {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--c-accent);
  color: #fff;
  font-weight: 700;
}

/* =========================================================
  Hero
========================================================= */
.blog-hero {
  position: relative;
  min-height: 240px;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #111;
}

.blog-hero__media {
  position: absolute;
  inset: 0;
}

.blog-hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(0.95);
  transform: scale(1.02);
}

.blog-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.30), rgba(0, 0, 0, 0.55));
}

.blog-hero__inner {
  position: relative;
  padding-block: 34px;
  color: #fff;
}

.blog-hero__kicker {
  margin: 0 0 6px;
  font-size: var(--fz-14);
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.blog-hero__title {
  margin: 0;
  font-size: var(--fz-30);
  letter-spacing: 0.04em;
}

.blog-hero__lead {
  margin: 8px 0 0;
  font-size: var(--fz-14);
  opacity: 0.92;
  max-width: 48ch;
}

/* =========================================================
  Section title
========================================================= */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: var(--fz-18);
  letter-spacing: 0.02em;
}

.section-title__bar {
  width: 6px;
  height: 22px;
  border-radius: 999px;
  background: var(--c-accent);
}

/* =========================================================
  Filter
========================================================= */
.blog-filter__inner {
  display: grid;
  gap: 16px;
}

.blog-filter__chips {
  list-style: none;
  display: flex;
  gap: 10px;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.blog-filter__chips::-webkit-scrollbar {
  height: 8px;
}

.blog-filter__chips::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--c-line);
  background: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  font-size: var(--fz-14);
  color: var(--c-text);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(42, 140, 122, 0.45);
}

.chip--active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
  font-weight: 700;
}

.blog-filter__search {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  padding: 14px;
}

.blog-filter__label {
  display: block;
  font-size: var(--fz-12);
  color: var(--c-muted);
  margin-bottom: 8px;
}

.blog-filter__search-row {
  display: flex;
  gap: 10px;
}

.blog-filter__input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: var(--fz-16);
  background: #fff;
}

.blog-filter__button {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  background: var(--c-accent);
  color: #fff;
  cursor: pointer;
}

/* =========================================================
  Featured
========================================================= */
.featured-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.featured-card__link {
  display: grid;
  gap: 0;
}

.featured-card__media {
  position: relative;
  background: #e8eef1;
}

.featured-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.featured-card__body {
  padding: 16px;
}

.featured-card__title {
  margin: 0 0 8px;
  font-size: var(--fz-18);
  letter-spacing: 0.02em;
}

.featured-card__excerpt {
  margin: 0 0 12px;
  color: var(--c-muted);
  font-size: var(--fz-14);
}

.featured-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-weight: 800;
  color: var(--c-accent);
}

.meta {
  margin: 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.meta__item {
  display: grid;
  gap: 2px;
}

.meta__label {
  font-size: var(--fz-12);
  color: var(--c-muted);
}

.meta__value {
  margin: 0;
  font-size: var(--fz-14);
  font-weight: 700;
}

/* =========================================================
  Badge
========================================================= */
.badge {
  position: absolute;
  left: 12px;
  top: 12px;
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: var(--fz-12);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
}

.badge--genba {
  background: var(--c-genba);
}

.badge--shagai {
  background: var(--c-shagai);
}

.badge--recruit {
  background: var(--c-recruit);
}

.badge--news {
  background: var(--c-news);
}

/* =========================================================
  Grid / Cards
========================================================= */
.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.post-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.post-card__link {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
}

.post-card__media {
  position: relative;
  background: #e8eef1;
}

.post-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.25s ease;
}

.post-card:hover .post-card__image {
  transform: scale(1.03);
}

.post-card__body {
  padding: 14px 14px 16px;
  display: grid;
  gap: 8px;
}

.post-card__title {
  margin: 0;
  font-size: var(--fz-16);
  letter-spacing: 0.01em;

  /* 2行で省略 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__excerpt {
  margin: 0;
  color: var(--c-muted);
  font-size: var(--fz-14);

  /* 3行で省略 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__date {
  margin: 0;
  font-size: var(--fz-12);
  color: var(--c-muted);
}

/* =========================================================
  Pagination
========================================================= */
.pagination {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  justify-items: center;
}

.pagination__prev,
.pagination__next {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--c-line);
  background: rgba(255, 255, 255, 0.65);
  font-weight: 700;
}

.pagination__list {
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pagination__link {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--c-line);
  background: rgba(255, 255, 255, 0.65);
  font-weight: 800;
}

.pagination__link.is-current {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}

/* =========================================================
  CTA
========================================================= */
.cta__box {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.cta__title {
  margin: 0 0 8px;
  font-size: var(--fz-18);
}

.cta__text {
  margin: 0 0 14px;
  color: var(--c-muted);
  font-size: var(--fz-14);
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.c-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid transparent;
}

.c-button--primary {
  background: var(--c-accent);
  color: #fff;
}

.c-button--ghost {
  background: transparent;
  border-color: rgba(42, 140, 122, 0.35);
  color: var(--c-accent);
}

/* figcaption：未入力時は非表示 */
.post__caption:empty {
  display: none;
}

/* ナビゲーション全体をセンター寄せにし、下に余白を作る */
.post-nav {
  padding-bottom: 80px;
  /* 下に80pxの余白 */
}

.post-nav__inner {
  display: flex;
  justify-content: center;
  /* 横方向の中央揃え */
  gap: 20px;
  /* ボタン同士の間隔 */
  flex-wrap: wrap;
  /* スマホで折り返せるように */
}

/* ナビゲーション全体のコンテナ */
.post-nav {
  width: 100%;
  /* margin-top: 60px; */
  padding-bottom: 80px;
  /* ご希望の余白 */
  border-top: 1px solid #eee;
  padding-top: 80px;
}

/* ボタンを並べる中枠（ここをセンター寄せに強制） */
.post-nav__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 各ボタンの共通スタイル */
.post-nav__item {
  flex: 1;
  text-align: center;
  padding: 12px 5px;
  border: 1px solid #ddd;
  border-radius: 30px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  white-space: nowrap;
  transition: 0.3s;
}

/* 「一覧へ戻る」ボタンだけ黒背景にする */
.post-nav__item--back {
  background: #333;
  color: #fff;
  border: none;
  font-weight: bold;
}

/* ホバー時の演出（お好みで） */
.post-nav__item:hover {
  opacity: 0.7;
}

/* 前後の記事がない時の空スペース */
.post-nav__empty {
  flex: 1;
}

/* =========================================================
  Footer（簡易）
========================================================= */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
  padding-block: 18px;
}

.site-footer__copy {
  margin: 0;
  color: var(--c-muted);
  font-size: var(--fz-12);
}

/* =========================================================
  Breakpoints（モバイルファースト）
========================================================= */
@media (min-width: 768px) {
  .blog-hero {
    min-height: 320px;
  }

  .blog-hero__title {
    font-size: 2.25rem;
  }


  .featured-card__image {
    aspect-ratio: 4 / 3;
  }

  .post-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .pagination {
    grid-template-columns: auto 1fr auto;
    justify-items: stretch;
  }

  .pagination__list {
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  .l-section {
    padding-block: 34px;
  }

  /* PC時だけ簡易メニュー表示（既存サイトに合わせるなら削除OK） */
  .site-header__menu {
    display: flex;
  }

  .blog-filter__inner {
    grid-template-columns: 1fr 360px;
    align-items: start;
    gap: 18px;
  }

  .post-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

/* =========================
  BLOG DETAIL
  Mobile-first / BEM
========================= */

.blog-hero--detail .blog-hero__title {
  letter-spacing: 0.06em;
}

/* Breadcrumb */
.breadcrumb {
  padding-top: 18px;
  padding-bottom: 0;
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
}

.breadcrumb__item::after {
  content: ">";
  margin-left: 8px;
  color: rgba(0, 0, 0, 0.35);
}

.breadcrumb__item:last-child::after {
  content: "";
}

.breadcrumb__link {
  color: inherit;
  text-decoration: none;
}

.breadcrumb__link:hover {
  text-decoration: underline;
}

/* Article */
.post__head {
  margin-top: 6px;
}

.post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.post__date,
.post__read {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.65);
}

.post__title {
  margin: 0;
  font-size: clamp(22px, 4.4vw, 34px);
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.post__lead {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.9;
  color: rgba(0, 0, 0, 0.78);
}

.post__figure {
  margin: 18px 0 0;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
}

.post__image {
  width: 100%;
  height: auto;
  display: block;
}

.post__caption {
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
  background: rgba(255, 255, 255, 0.7);
}

.post__body {
  margin-top: 18px;
  font-size: 14px;
  line-height: 2.0;
  color: rgba(0, 0, 0, 0.8);
}

.post__h {
  margin: 22px 0 10px;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.post__list {
  margin: 0;
  padding-left: 1.2em;
}

.post__gallery {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.post__thumb {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
}

.post__thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

/* Prev/Next */
.post-nav {
  /* margin-top: 26px; */
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.post-nav__prev,
.post-nav__next,
.post-nav__back {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  border: 1px solid rgba(0, 0, 0, 0.25);
  color: rgba(0, 0, 0, 0.75);
  background: rgba(255, 255, 255, 0.6);
}

.post-nav__prev:hover,
.post-nav__next:hover,
.post-nav__back:hover {
  background: rgba(255, 255, 255, 0.9);
}


/* もしスマホではボタンをセンターにしたい場合は以下も追加 */
@media (max-width: 768px) {
    .news__footer {
        text-align: center;
    }
}

@media (min-width: 768px) {
  .post__gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .post-nav {
    /* grid-template-columns: 1fr auto 1fr; */
    align-items: center;
  }

  .post-nav__prev {
    justify-self: start;
  }

  .post-nav__back {
    justify-self: center;
  }

  .post-nav__next {
    justify-self: end;
  }
}