/* ==========================================================================
   News Page
   - Page Header (common)
   - Intro (common)
   - Meta / Sidebar / Pagination
   - List (.news-list)
   - Single (.news-single-page)
   - Responsive
================================================================ */

/* ==========================================================================
   Page Header（共通）
   ========================================================================== */
.page-header {
  position: relative;
  margin-bottom: 24px;
  padding: 220px 0 120px;
  text-align: center;
  background: url("../image/news/kv-news.jpg") center/cover no-repeat;
  color: var(--color-text-accent);
}
.page-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(237, 245, 255, .8);
}
.page-header__inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.page-header__eyebrow {
  margin: 0 0 .75em;
  font-size: var(--font-size-text-md);
  color: var(--color-text-main);
}
.page-header__title {
  margin: 0;
  font-weight: 700;
  font-size: var(--font-size-title-hero);
  line-height: 1.45;
}

/* ==========================================================================
   Intro（共通）
   ========================================================================== */
.news-archive-intro__inner {
  max-width: 960px;
  margin: 36px auto 60px;
  padding: 0 24px;
}
.news-archive-intro__text {
  margin: 0;
  text-align: center;
  color: var(--color-text-sub);
  font-size: var(--font-size-text-md);
  line-height: 1.9;
}

/* ==========================================================================
   共通：日付・カテゴリ・パンくず・ページネーション・サイドバー
   ========================================================================== */
/* メタ */
.news-meta {
  display: flex;
  align-items: center;
  gap: 1em;
  padding-top: 1.2em;
  margin-bottom: .25em;
}
.news__date { font-size: var(--font-size-text-lg); }
.news__category {
  display: inline-block;
  padding: 0.44445em 0.6em;
  border-radius: 4px;
  color: #fff;
  font-size: var(--font-size-text-lg);
  font-weight: 700;
}
.news__category--system    { background: #89B4E8; }
.news__category--product   { background: #6BC7B5; }
.news__category--feature   { background: #E6BF83; }
.news__category--solutions { background: #8999E8; }
.news__category--cases     { background: #DB83E6; }

/* サイドバー（共通） */
.news-sidebar {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 20px;
}
.news-sidebar__widget {
  padding: 2em 1.5em;
  background: var(--color-bg-card-white);
  border: 1px solid var(--color-bg-card-blue);
  border-radius: 10px;
}
.news-sidebar__title {
  margin: 0 0 1em;
  padding: 0 0 1em;
  border-bottom: 1px solid var(--color-bg-card-blue);
  font-size: var(--font-size-text-md);
  font-weight: 800;
}
.news-sidebar__cats {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.news-sidebar__link {
  position: relative;
  display: block;
  padding: 0.5em 0.8em;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.news-sidebar__link:hover {
  color: var(--color-text-link);
  background-color: var(--color-bg-card-sky);
}
.news-sidebar__link.is-current {
  color: var(--color-text-link);
  font-weight: 700;
}
.news-sidebar__link.is-current::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-text-link);
  transform: translateY(-50%);
}

/* 最近の投稿 */
.news-sidebar__recent {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.news-recent__link {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.news-recent__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}
.news-recent__title {
  margin: 0 0 4px;
  color: var(--color-text-main);
  font-size: var(--font-size-text-md);
  line-height: 1.45;
}
.news-recent__date {
  color: var(--color-text-sub);
  font-size: var(--font-size-text-sm);
}

/* ページネーション */
.pagination {
  margin-top: 80px;
  display: flex;
  justify-content: center;
}
.pagination__list {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  background: var(--color-bg-card-white);
  border: 1px solid var(--color-bg-card-blue);
  border-radius: 8px;
  color: var(--color-text-main);
  text-decoration: none;
  font-size: var(--font-size-text-md);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.page-numbers:hover,
.page-numbers:focus-visible { background: var(--color-bg-card-blue); }
.page-numbers.current {
  background: var(--color-bg-card-blue);
  color: var(--color-text-main);
  border-color: transparent;
}
.page-numbers.dots {
  pointer-events: none;
  background: transparent;
  border: none;
  color: var(--color-text-main);
}
.next.page-numbers { padding: 0 0.8em; }

/* ==========================================================================
   一覧ページ（news.html）— .news-list 名前空間
   ========================================================================== */
.news-list { padding: 0 0 100px; }
.news-list__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}
.news-list__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}

/* メインリスト */
.news-list__list {
  display: grid;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* カード */
.news-card {
  display: grid;
  grid-template-columns: 272px 1fr;
  gap: 40px;
  align-items: stretch;
  color: inherit;
  text-decoration: none;
  background: #f8f8f8;
  border-radius: 12px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.news-card:hover { transform: translateY(-3px); }
.news-card__thumb {
  overflow: hidden;
  border-radius: 8px 0 0 8px;
}
.news-card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-card__body {
  display: grid;
  grid-template-rows: 60px auto;
  gap: 8px;
  align-items: start;
  padding: 0 24px 24px 0;
  box-sizing: border-box;
}
.news-card__title {
  margin: 0;
  color: var(--color-text-main);
  font-size: var(--font-size-sub-title-s);
  font-weight: 700;
  line-height: 1.5;
}

/* ==========================================================================
   記事詳細ページ（news-archives.html）— .news-single-page 名前空間
   ========================================================================== */
.news-single-page { 
  margin-bottom: 100px;
  padding-top: 160px;
}
.news-single-page__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* 記事本体 */
.news-single {
  padding: 32px 40px 32px;
  background: var(--color-bg-card-light);
  border: 1px solid var(--color-bg-card-blue);
  border-radius: 12px;
}
.news-single__header .news-meta {
  padding-top: .75em;   /* 少し軽めに */
  margin: 0 0 8px;
}
.news-single-page .news__category { font-size: var(--font-size-text-md); }
.news-single-page .news__date     { font-size: var(--font-size-text-md); }
.news-single__title {
  margin: 0 0 .6667em;
  color: var(--color-text-main);
  font-size: var(--font-size-sub-title-m);
  font-weight: 800;
  line-height: 1.45;
}

/* ヒーロー画像 */
.news-single__hero {
  padding: 0 0 24px;
  overflow: hidden;
}
.news-single__hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* WYSIWYG */
.news-single__content {
  color: var(--color-text-main);
  font-size: var(--font-size-sub-title-s);
  line-height: 1.8;
}
.news-single__subtitle h2,
.news-single h2 {
  margin: 4em 0 1.5em;
  padding-bottom: .4em;
  color: var(--color-text-accent);
  font-size: var(--font-size-sub-title-s);
  font-weight: 700;
  line-height: 1.8;
  border-bottom: 2px dotted var(--color-bg-card-blue);
}
.news-single__content h3,
h3 {
  margin-bottom: 0.7em;
  color: var(--color-text-accent-dark);
  font-size: var(--font-size-text-md);
  font-weight: 700;
  line-height: 1.5;
}
.news-single__content ul,
.news-single__content ol {
  font-size: var(--font-size-text-lg);
}
.news-single__content li {
  position: relative;
  list-style: none;
  margin-bottom: 1em;
  padding-left: 1.2em;
}
.news-single__content li::before {
  content: "";
  position: absolute;
  top: 0.8em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-text-accent);
}
.news-single__content figure { margin: 1.2em 0; }
.news-single__content figure.aligncenter { text-align: center; }
.news-single__content figcaption {
  margin-top: .4em;
  color: var(--color-text-sub);
  font-size: var(--font-size-text-sm);
}
.news-single p  { margin-bottom: 2em; }
.news-single img { margin-bottom: 1em; }

/* CTA */
.news-single__cta {
  margin-top: 2.2em;
  padding: 1.6em 1.2em;
  background: var(--color-bg-card-sky);
  border-radius: 10px;
  text-align: center;
}
h2.news-single__cta-title {
  margin: 0 0 .5em;
  color: var(--color-text-accent-dark);
  font-size: var(--font-size-text-lg);
  font-weight: 800;
}
.news-single__cta-text { margin: 0 0 1em; }
.news-single__cta-actions .button { min-width: 220px; }

/* 前後ナビ */
.news-pager {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.news-pager a {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .6em .9em;
  border-radius: 8px;
  color: var(--color-text-main);
  text-decoration: none;
}
.news-pager a:hover { background: var(--color-bg-card-lightblue); }

/* 画像の共通挙動（WYSIWYG内） */
.news-single__content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .news-single-page { padding-top: 80px; }

  /* 一覧 */
  .news-list__grid { grid-template-columns: 1fr; }
  .news-card {
    grid-template-columns: 272px 1fr;
    gap: 24px;
  }

  /* 詳細 */
  .news-single-page__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  /* Page header */
  .page-header { padding: 140px 0 80px; }

  /* Intro */
  .news-archive-intro__inner {
    margin: 0 auto 40px;
    padding: 0 24px;
  }
  .news-archive-intro__text { text-align: left; }

  /* 一覧カード（1カラム） */
  .news-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .news-card__thumb { border-radius: 8px 8px 0 0; }
  .news-card__thumb img {
    display: block;
    width: 100%;
    max-height: 250px;
    object-fit: cover;
  }
  .news-card__body {
    grid-template-rows: 32px auto;
    padding: 0 1em 2em;
  }
  .news-meta {
    padding-top: initial;
    margin-bottom: .25em;
  }

  /* ページネーション */
  .pagination { margin-top: 40px; }
  .page-numbers {
    min-width: 32px;
    height: 32px;
  }

  /* 詳細 */
  .news-single { padding: 24px; }
  .news-single__title { font-size: var(--font-size-text-lg); }
  .news-single__hero { padding: 0 0 16px; }
  .news-single__cta-actions .button { min-width: initial; }
}

/* ======================
   PDF Embedder（エムアイディファースト通信：記事詳細用）
   ====================== */

/* ▼ 外側のコンテナ：幅に合わせて高さも変わるようにする */
.news-single-page .news-single__content .wp-block-pdf-embedder,
.news-single-page .news-single__content .pdfemb-viewer {
  position: relative;
  display: block;
  box-sizing: border-box;

  /* PC では最大 858px、狭い画面では 100% まで縮む */
  width: 100% !important;
  max-width: 858px;

  margin: 24px auto 40px;
  border-radius: 8px;
  overflow: hidden;

  /* ★ 縦横比を固定（858 x 1213 の比率）
     aspect-ratio は「width / height」なので 858 / 1213 にする */
  aspect-ratio: 858 / 1213;
}

/* ▼ プラグイン側が inline-style で width/height を書いていても上書きする */
.news-single-page .news-single__content .wp-block-pdf-embedder[style],
.news-single-page .news-single__content .pdfemb-viewer[style] {
  width: 100% !important;
  max-width: 858px !important;
  height: auto !important;      /* 高さはコンテナの aspect-ratio に任せる */
}

/* ▼ 中の iframe をコンテナにピッタリ合わせる */
.news-single-page .news-single__content .wp-block-pdf-embedder iframe,
.news-single-page .news-single__content .pdfemb-viewer iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  border: none;
}

/* スマホ側で「縦が長すぎる」と感じたら、ここで少し圧縮もできる（任意） */
@media (max-width: 768px) {
  .news-single-page .news-single__content .wp-block-pdf-embedder,
  .news-single-page .news-single__content .pdfemb-viewer {
    /* 例えば少し横長にして縦を短くするなら 858 / 1000 とかに変える */
    aspect-ratio: 858 / 1213;
  }
}

@media (max-width: 480px) {
  .news-single-page .news-single__content .wp-block-pdf-embedder,
  .news-single-page .news-single__content .pdfemb-viewer {
    /* さらにスマホでは縦をもっと削りたい場合は比率をいじってOK */
    aspect-ratio: 858 / 1213;
  }
}



