/* =========================================================
   ARTICLES
   記事一覧・記事詳細 共通
   通常配色をデフォルト、ダーク時のみ上書き
   ========================================================= */

.articles-page {
  --ar-bg: #ddd2cc;
  --ar-bg-2: #cdbeb8;
  --ar-panel: #f8f1ed;
  --ar-panel-2: #efe5df;
  --ar-ink: #211619;
  --ar-muted: #715e63;
  --ar-line: rgba(92, 45, 48, .16);
  --ar-line-strong: rgba(128, 48, 55, .24);
  --ar-red: #a80d31;
  --ar-red-bright: #dc244c;
  --ar-red-dark: #65091f;
  --ar-shadow: 0 12px 30px rgba(54, 17, 27, .10);
  --ar-noise: rgba(49, 15, 23, .06);

  position: relative;
  isolation: isolate;
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 70px;
  background: transparent;
  color: var(--ar-ink);
}

html[data-theme="black"] .articles-page,
html[data-theme="aqua"] .articles-page {
  --ar-bg: #070607;
  --ar-bg-2: #0f0b0d;
  --ar-panel: #171013;
  --ar-panel-2: #211419;
  --ar-ink: #f7edef;
  --ar-muted: #b7a4a8;
  --ar-line: rgba(255, 105, 135, .16);
  --ar-line-strong: rgba(227, 33, 73, .28);
  --ar-red: #e32149;
  --ar-red-bright: #ff4f70;
  --ar-red-dark: #7e0c28;
  --ar-shadow: 0 14px 34px rgba(0, 0, 0, .30);
  --ar-noise: rgba(255, 255, 255, .045);
}

.articles-page,
.articles-page * {
  box-sizing: border-box;
}

/* 記事ページだけで背景を完結 */
.articles-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 10%, color-mix(in srgb, var(--ar-red) 12%, transparent), transparent 28rem),
    radial-gradient(circle at 88% 38%, color-mix(in srgb, var(--ar-red-dark) 7%, transparent), transparent 30rem),
    linear-gradient(155deg, var(--ar-bg), var(--ar-bg-2));
}

.articles-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .28;
  background-image:
    repeating-linear-gradient(103deg, transparent 0 38px, var(--ar-noise) 39px 40px),
    radial-gradient(var(--ar-noise) .7px, transparent .7px);
  background-size: auto, 5px 5px;
  mix-blend-mode: soft-light;
}

.articles-eyebrow {
  margin: 0 0 8px;
  color: var(--ar-red);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .22em;
  line-height: 1.4;
}

.articles-title {
  margin: 0 0 22px;
  color: var(--ar-ink);
  font-family: "Noto Serif JP","Yu Mincho",serif;
  font-size: clamp(1.8rem,4vw,3rem);
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: 1.3;
}

/* =========================================================
   ARTICLE GRIDS
   ========================================================= */

.articles-grid,
.articles-grid-list,
.articles-grid--top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 0 0 30px;
}

@media (min-width: 768px) {
  .articles-grid,
  .articles-grid-list {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 18px;
  }
}

@media (min-width: 1024px) {
  .articles-grid--top {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 18px;
  }
}

@media (min-width: 1100px) {
  .articles-grid-list {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

.top-title {
  margin: 3px 0 0;
  font-size: 1.05em;
  font-weight: 800;
}

/* =========================================================
   ARTICLE CARD
   一覧では1記事 = 1カード。余白を持たせた柔らかいカード
   ========================================================= */

.articles-grid-list {
  align-items: stretch;
}

.articles-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  margin: 0;
  padding: 12px !important;
  border: 0;
  border-radius: 10px !important;
  background: var(--ar-panel) !important;
  box-shadow: var(--ar-shadow);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.articles-card:hover {
  transform: translateY(-3px);
  border-color: var(--ar-red);
  background: var(--ar-panel-2) !important;
}

.articles-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.articles-thumb-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  background: var(--ar-panel-2);
}

.articles-thumb-wrap::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 14%;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(18, 6, 10, .06));
}

.articles-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  filter: brightness(.98) saturate(.96);
  transition: transform .35s ease, filter .25s ease;
}

.articles-card:hover .articles-thumb-wrap img {
  transform: scale(1.02);
  filter: brightness(1) saturate(1);
}

.articles-info {
  position: relative;
  flex: 1;
  min-height: 128px;
  padding: 17px 6px 6px;
  background: transparent;
}

/* 旧 FILE 表示は削除 */
.articles-info::before {
  display: none !important;
  content: none !important;
}

.articles-info .date,
.articles-date {
  color: var(--ar-muted);
  font-size: .68rem;
  font-weight: 800;
}

.articles-info .date {
  margin-bottom: 8px;
}

.articles-info .title {
  margin: 0;
  color: var(--ar-ink);
  font-family: "Noto Serif JP","Yu Mincho",serif;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.55;
}

.articles-info .excerpt {
  margin-top: 10px;
  color: var(--ar-muted);
  font-size: .78rem;
  line-height: 1.7;
}

/* =========================================================
   ARTICLE VIEW
   ========================================================= */

.articles-view {
  margin-bottom: 26px;
}

.articles-view .articles-title {
  margin: 0 0 10px;
  font-size: clamp(1.75rem,4.5vw,3rem);
}

.articles-date {
  margin-bottom: 14px;
}

.articles-thumb {
  display: block;
  width: 100%;
  margin: 18px 0 28px;
  border: 1px solid var(--ar-line);
  border-radius: 0;
}

.article-content {
  max-width: 900px;
  margin: 0 auto 32px;
}

.article-body,
.articles-body {
  color: var(--ar-ink);
  font-size: .98rem;
  line-height: 2;
}

.articles-view h2,
.article-body h2,
.articles-body h2 {
  margin: 34px 0 14px;
  padding: 12px 14px 11px;
  border-left: 4px solid var(--ar-red);
  background: var(--ar-panel-2);
  color: var(--ar-ink);
  font-family: "Noto Serif JP","Yu Mincho",serif;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.5;
}

.articles-view h3,
.article-body h3,
.articles-body h3 {
  margin: 26px 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--ar-line);
  color: var(--ar-ink);
  font-size: 1.08rem;
  font-weight: 900;
}

.articles-view ul,
.article-body ul,
.articles-body ul {
  margin: 8px 0 18px;
  padding-left: 1.4em;
}

.articles-view li,
.article-body li,
.articles-body li {
  margin: 5px 0;
}

.articles-view hr {
  height: 1px;
  margin: 34px 0;
  border: 0;
  background: var(--ar-line);
}

.articles-body img,
.article-body img,
.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  border-radius: 0;
}

@media (min-width: 1024px) {
  .article-content img {
    max-height: 520px;
    width: 100%;
    object-fit: contain;
  }
}

/* =========================================================
   PREV / NEXT
   ========================================================= */

.articles-nav-wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.articles-nav-card {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--ar-line);
  border-radius: 0 !important;
  background: var(--ar-panel);
  color: var(--ar-ink) !important;
  text-decoration: none;
  box-shadow: var(--ar-shadow);
  transition: border-color .18s ease, transform .18s ease;
}

.articles-nav-card:hover {
  transform: translateY(-2px);
  border-color: var(--ar-red);
  opacity: 1;
}

.articles-nav-card.empty {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.nav-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ar-red);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.nav-label.right {
  text-align: right;
}

.nav-thumb img {
  display: block;
  width: 100%;
  border-radius: 0;
}

.nav-title {
  margin: 8px 0 0;
  padding-bottom: 24px;
  color: var(--ar-ink);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.5;
}

.nav-date {
  position: absolute;
  right: 13px;
  bottom: 11px;
  color: var(--ar-muted);
  font-size: .65rem;
}

/* =========================================================
   RELATED / RECOMMEND
   ========================================================= */

.related-title {
  margin: 34px 0 10px;
  color: var(--ar-ink);
  font-family: "Noto Serif JP","Yu Mincho",serif;
  font-size: 1.25rem;
  font-weight: 900;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-item {
  position: relative;
  display: flex;
  gap: 13px;
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--ar-line);
  background: var(--ar-panel);
}

.related-thumb-small {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0;
  background: var(--ar-panel-2);
}

.related-thumb-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-text-box {
  flex: 1;
  min-width: 0;
  padding-bottom: 22px;
}

.related-item-title {
  margin: 0;
  color: var(--ar-ink);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.5;
}

.related-item-date {
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: var(--ar-muted);
  font-size: .64rem;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
}

@media (max-width: 767px) {
  .recommend-grid {
    grid-template-columns: 1fr;
  }

  .recommend-grid .articles-card:nth-child(n+2) {
    display: none;
  }
}

/* =========================================================
   TAGS
   ========================================================= */

.tag-articles-title {
  margin-bottom: 8px;
}

.tag-btn {
  display: inline-block;
  margin: 3px 4px 8px 0;
  padding: 7px 12px;
  border: 1px solid var(--ar-line);
  border-radius: 0;
  background: var(--ar-panel);
  box-shadow: none;
  color: var(--ar-ink) !important;
  font-size: .72rem;
  font-weight: 800;
  text-decoration: none;
  transition: border-color .18s ease, color .18s ease;
}

.tag-btn:hover,
.tag-btn.active {
  transform: none;
  border-color: var(--ar-red);
  color: var(--ar-red) !important;
  opacity: 1;
}

.tag-title {
  margin: 0 0 18px;
  color: var(--ar-ink);
  font-family: "Noto Serif JP","Yu Mincho",serif;
  font-size: 1.5rem;
  font-weight: 900;
  text-align: left;
}

.tags-search-box {
  margin: 16px 0 24px;
}

.tags-search-box a {
  display: inline-block;
  padding: 10px 15px;
  border: 1px solid var(--ar-red);
  border-radius: 0;
  background: transparent;
  color: var(--ar-red) !important;
  font-size: .75rem;
  font-weight: 900;
  text-decoration: none;
}

.tags-search-box a:hover {
  background: var(--ar-red);
  color: #fff !important;
}

/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
  margin: 26px 0 40px;
  color: var(--ar-muted);
  font-size: .85rem;
  text-align: center;
}

.pagination a,
.pagination .page-number-link,
.pagination .page-number-current {
  display: inline-flex;
  min-width: 38px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin: 3px;
  padding: 7px 11px;
  border: 1px solid var(--ar-line);
  border-radius: 0;
  font-weight: 900;
  text-decoration: none;
}

.pagination a,
.pagination .page-number-link {
  background: var(--ar-panel);
  color: var(--ar-ink) !important;
}

.pagination a:hover,
.pagination .page-number-link:hover,
.pagination .page-number-current {
  border-color: var(--ar-red);
  background: var(--ar-red);
  color: #fff !important;
}

.pagination .page-btn {
  font-size: .78rem;
}

.pagination .page-number-sep {
  margin: 0 2px;
  opacity: .45;
}

/* =========================================================
   BBS CTA
   ========================================================= */

.bbs-cta-container {
  position: relative;
  overflow: hidden;
  margin: 24px auto;
  padding: 22px 20px;
  border: 1px solid var(--ar-line);
  border-left: 4px solid var(--ar-red);
  border-radius: 0;
  background: var(--ar-panel);
  text-align: center;
}

.bbs-cta-container::after {
  content: "BOARD";
  position: absolute;
  right: -8px;
  bottom: -23px;
  color: color-mix(in srgb,var(--ar-red) 6%,transparent);
  font-size: 5.2rem;
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
}

.bbs-cta-text {
  position: relative;
  z-index: 1;
  margin: 0 0 13px;
  color: var(--ar-ink);
  font-size: .8rem;
  font-weight: 900;
  line-height: 1.7;
}

.bbs-cta-button {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin: 0;
  padding: 13px 24px;
  border-radius: 0;
  background: linear-gradient(135deg,var(--ar-red-dark),var(--ar-red),var(--ar-red-bright));
  box-shadow: 0 10px 26px color-mix(in srgb,var(--ar-red) 22%,transparent);
  color: #fff !important;
  font-size: .82rem;
  font-weight: 900;
  text-decoration: none;
  transition: filter .18s ease, transform .18s ease;
}

.bbs-cta-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg,var(--ar-red-dark),var(--ar-red),var(--ar-red-bright));
  box-shadow: 0 13px 30px color-mix(in srgb,var(--ar-red) 27%,transparent);
  filter: brightness(1.06);
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 620px) {
  .articles-page {
    width: 100%;
    padding: 16px 10px 70px;
  }

  .articles-title {
    font-size: 1.75rem;
  }

  .articles-grid,
  .articles-grid-list,
  .articles-grid--top {
    gap: 18px;
  }

  .articles-card {
    padding: 10px !important;
    border-radius: 10px !important;
    border-color: var(--ar-line-strong);
    box-shadow: var(--ar-shadow);
  }

  .articles-thumb-wrap {
    border-radius: 7px;
  }

  .articles-info {
    min-height: 0;
    padding: 15px 5px 5px;
  }

  .articles-info .title {
    font-size: .98rem;
    line-height: 1.55;
  }

  .articles-nav-wrap {
    gap: 8px;
  }

  .articles-nav-card {
    padding: 9px;
  }

  .nav-title {
    font-size: .73rem;
  }

  .bbs-cta-container {
    padding: 18px 15px;
  }
}

/* =========================================================
   POPULAR ARTICLES
   style.cssの旧紫テーマを記事ページ内だけ現行色へ統一
   ========================================================= */

.articles-page .popular-title {
  margin: 28px 0 14px;
  color: var(--ar-ink);
  font-family: "Noto Serif JP","Yu Mincho",serif;
  font-size: 1.15rem;
  font-weight: 900;
}

.articles-page .popular-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.articles-page .popular-item {
  position: relative;
  overflow: hidden;
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 13px;
  border: 1px solid var(--ar-line);
  border-radius: 0;
  background: var(--ar-panel);
  color: var(--ar-ink);
  box-shadow: var(--ar-shadow);
}

.articles-page .popular-item:hover {
  border-color: var(--ar-red);
  background: var(--ar-panel-2);
  transform: translateX(3px);
}

.articles-page .popular-thumb {
  margin: 0;
}

.articles-page .popular-thumb img {
  width: 62px;
  height: 62px;
  border: 1px solid var(--ar-line);
  border-radius: 0;
  background: var(--ar-panel-2);
  object-fit: cover;
}

.articles-page .popular-text {
  position: relative;
  z-index: 2;
}

.articles-page .popular-item-title {
  margin: 0 0 4px;
  color: var(--ar-ink);
  font-size: .82rem;
  font-weight: 900;
}

.articles-page .popular-item-date {
  color: var(--ar-muted);
  font-size: .65rem;
}

.articles-page .popular-rank {
  min-width: 25px;
  width: 25px;
  height: 25px;
  border-radius: 0;
  background: var(--ar-red);
  color: #fff;
  font-size: .68rem;
  font-weight: 900;
}

.articles-page .popular-rank-overlay {
  right: 7px;
  bottom: -14px;
  color: var(--ar-red);
  font-size: 70px;
  opacity: .07;
}

.articles-page .rank-crown {
  display: none;
}

/* 記事見出しSVGも旧紫色ではなく現行の深紅へ */
html[data-theme="white"] .articles-page .icon-related img,
html[data-theme="pink"] .articles-page .icon-related img {
  filter: brightness(0) saturate(100%) invert(14%) sepia(61%) saturate(3719%) hue-rotate(332deg) brightness(87%) contrast(103%);
}

html[data-theme="black"] .articles-page .icon-related img,
html[data-theme="aqua"] .articles-page .icon-related img {
  filter: brightness(0) saturate(100%) invert(31%) sepia(95%) saturate(3895%) hue-rotate(334deg) brightness(100%) contrast(101%);
}