/*
Theme Name: AI Daily JP
Theme URI: https://ai-daily.jp
Author: AI Daily JP
Description: AI Daily JP用のクラシックPHPテーマ。design_handoff_ai_news_blog/README.md の仕様(一覧+詳細の2ビュー、ダークモード、ソースフィルタ)を、Next.js版フロントエンド(frontend/)から1:1移植したもの。
Version: 1.0.59
Requires PHP: 8.3
Text Domain: ai-daily-jp
*/

/* ==========================================================================
   デザイントークン(frontend/app/globals.cssから移植)
   ========================================================================== */

:root {
  --bg: #faf9f6;
  --panel: #ffffff;
  --ink: #17171a;
  --dim: #6b6b70;
  --line: #e2e0da;
  --wash: #f1efe9;
  --accent: oklch(0.52 0.14 255);

  --brand-openai-bg: #0d0d0d;
  --brand-openai-fg: #ffffff;
  --brand-anthropic-bg: #c2410c;
  --brand-anthropic-fg: #ffffff;
  --brand-google-bg: #1a73e8;
  --brand-google-fg: #ffffff;
  --brand-azure-bg: #0e7490;
  --brand-azure-fg: #ffffff;
  --brand-aws-bg: #b45309;
  --brand-aws-fg: #ffffff;
  --brand-meta-bg: #7c3aed;
  --brand-meta-fg: #ffffff;
  --brand-mistral-bg: #e04403;
  --brand-mistral-fg: #ffffff;
  --brand-nvidia-bg: #76b900;
  --brand-nvidia-fg: #0d1400;
  --brand-xai-bg: #3f3f46;
  --brand-xai-fg: #ffffff;

  --font-heading: "Schibsted Grotesk", "IBM Plex Sans JP", sans-serif;
  --font-sans: "IBM Plex Sans JP", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

:root[data-theme="dark"] {
  --bg: #131418;
  --panel: #191b20;
  --ink: #ecebe6;
  --dim: #95959c;
  --line: #2b2d33;
  --wash: #1e2026;
  --accent: oklch(0.74 0.12 255);
  color-scheme: dark;

  --brand-openai-bg: #ededed;
  --brand-openai-fg: #0d0d0d;
  --brand-anthropic-bg: #e8875c;
  --brand-anthropic-fg: #1a1206;
  --brand-google-bg: #7cadf5;
  --brand-google-fg: #08132a;
  --brand-azure-bg: #5ec8d8;
  --brand-azure-fg: #04222a;
  --brand-aws-bg: #f0a13c;
  --brand-aws-fg: #201402;
  --brand-meta-bg: #b79dff;
  --brand-meta-fg: #1a0b3d;
  --brand-mistral-bg: #ff8a4d;
  --brand-mistral-fg: #220d02;
  --brand-nvidia-bg: #9ddc3f;
  --brand-nvidia-fg: #0f1a00;
  --brand-xai-bg: #d4d4d8;
  --brand-xai-fg: #18181b;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131418;
    --panel: #191b20;
    --ink: #ecebe6;
    --dim: #95959c;
    --line: #2b2d33;
    --wash: #1e2026;
    --accent: oklch(0.74 0.12 255);
    color-scheme: dark;

    --brand-openai-bg: #ededed;
    --brand-openai-fg: #0d0d0d;
    --brand-anthropic-bg: #e8875c;
    --brand-anthropic-fg: #1a1206;
    --brand-google-bg: #7cadf5;
    --brand-google-fg: #08132a;
    --brand-azure-bg: #5ec8d8;
    --brand-azure-fg: #04222a;
    --brand-aws-bg: #f0a13c;
    --brand-aws-fg: #201402;
    --brand-meta-bg: #b79dff;
    --brand-meta-fg: #1a0b3d;
    --brand-mistral-bg: #ff8a4d;
    --brand-mistral-fg: #220d02;
    --brand-nvidia-bg: #9ddc3f;
    --brand-nvidia-fg: #0f1a00;
    --brand-xai-bg: #d4d4d8;
    --brand-xai-fg: #18181b;
  }
}

/* ==========================================================================
   リセット・基本スタイル
   ========================================================================== */

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html {
  height: 100%;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 180ms linear, color 180ms linear;
}

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

a:hover {
  color: oklch(0.52 0.14 255);
}

ul,
ol {
  list-style: none;
}

.mono {
  font-family: var(--font-mono);
}

.heading {
  font-family: var(--font-heading);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 640px) {
  .container {
    padding: 0 20px;
  }
}

/* 「原文タイトル」表示切り替え。デフォルトで表示(Next.js版のuseState(true)相当) */
.title-en {
  display: none;
}

body.show-original .title-en {
  display: block;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.site-header__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}

@media (max-width: 640px) {
  .site-header__inner {
    padding: 14px 20px;
  }
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  flex-shrink: 0;
}

.logo-accent {
  color: var(--accent);
}

.status {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toggles {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.toggle,
.theme-toggle {
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: transparent;
  color: var(--dim);
}

.theme-toggle {
  color: var(--ink);
}

.toggle--active {
  background: var(--wash);
  color: var(--ink);
}

/* スマホ(幅640px以下)のヘッダー。上の .status などの元の指定より後に書く(あとの指定が勝つため) */
@media (max-width: 640px) {
  /* 1行に並べると、ステータス(.status)の幅だけが縮んで先頭の1文字しか見えなくなる。
     1段目=ロゴとトグル、2段目=ステータス(全文。長いときは折り返す) */
  .site-header__inner {
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 12px 20px;
  }

  .logo {
    order: 1;
  }

  .site-search {
    order: 2;
    margin-left: auto;   /* 検索窓(2026-11-02)。1段目=ロゴ・検索窓・トグル */
  }

  .toggles {
    order: 3;
  }

  .status {
    order: 4;
    flex: 0 0 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.5;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 44px 0 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.hero__title {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.hero__lead {
  max-width: 480px;
  padding-right: 12px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--dim);
}

.hero__back {
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .hero__title {
    font-size: 28px;
  }
}

/* ==========================================================================
   Source filter
   ========================================================================== */

.source-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 16px 0 4px;
}

.source-filter__label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-right: 6px;
}

.chip {
  font-size: 12px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
}

.chip--active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ==========================================================================
   Article grid
   ========================================================================== */

.article-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 32px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: start;
}

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

@media (max-width: 640px) {
  .article-grid {
    padding: 20px 20px 56px;
  }
}

.article-grid__empty {
  padding: 64px 0;
  text-align: center;
  color: var(--dim);
  font-size: 14px;
}

.load-more-wrap {
  padding: 32px 0;
  text-align: center;
}

.load-more {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

.load-more:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ==========================================================================
   Lead card
   ========================================================================== */

.lead-card {
  display: block;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.lead-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.lead-card__time {
  font-size: 11px;
  color: var(--dim);
}

.lead-card__kind {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.lead-card__image {
  aspect-ratio: 16 / 7;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 18px;
}

.lead-card__image svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lead-card__title {
  font-size: 33px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

@media (max-width: 640px) {
  .lead-card__title {
    font-size: 24px;
  }
}

.lead-card__title-en {
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
  margin-top: 8px;
}

.lead-card__summary {
  font-size: 15px;
  line-height: 1.85;
  opacity: 0.86;
  margin-top: 14px;
}

.lead-card__tags,
.list-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

/* body要素にもWordPressがtag用のクラス(tag/tag-6等)を付けるため、要素を限定してバッジ用の見た目を当てる */
span.tag,
a.tag {
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
}

/* カード全体をクリック可能にしつつ、タグは別リンクとして押せるようにする(リンクの入れ子を避けるための構造)。
   タイトルのリンクをカード全体に広げ、タグだけその上に重ねる。 */
.lead-card,
.list-item {
  position: relative;
}

.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.tag--link {
  position: relative;
  z-index: 1;
}

.tag--link:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ==========================================================================
   List item
   ========================================================================== */

.list-item {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.list-item:hover {
  background: var(--wash);
}

@media (max-width: 640px) {
  .list-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.list-item__meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.list-item__time {
  font-size: 11px;
  color: var(--dim);
}

.list-item__title {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
}

.list-item__title-en {
  font-size: 11px;
  color: var(--dim);
  margin-top: 4px;
}

.list-item__summary {
  font-size: 13.5px;
  line-height: 1.8;
  opacity: 0.78;
  max-width: 66ch;
  margin-top: 8px;
}

.list-item__tags {
  margin-top: 8px;
}

/* 週次まとめの一覧: 要約を、66文字で折り返さず、広めの幅(768px。個別ページの本文の幅960pxの8割)まで使う */
.weekly-list .list-item__summary {
  max-width: 768px;
}

/* 月ごとのアーカイブの『さらに読み込む』: JSが隠した項目(hidden)を、.list-item の display より優先して隠す */
.archive-list--2col > [hidden] {
  display: none !important;
}

/* 月ごとのアーカイブ(/articles/2026/10/)の一覧: PC幅では2カラム。1件ごとに、日時・出典を上、題・要約・タグを下に重ねる(列が狭いため)。
   スマホ・タブレットの縦持ちは、1カラムのまま */
@media (min-width: 900px) {
  .weekly-list.archive-list--2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 48px;
  }

  .archive-list--2col .list-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-content: start;
  }

  .archive-list--2col .list-item__meta {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .archive-list--2col .list-item__title {
    font-size: 18px;
  }

  .archive-list--2col .list-item__summary {
    max-width: none;
  }
}

/* ==========================================================================
   Side rail
   ========================================================================== */

.side-rail {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.side-rail__section {
  display: flex;
  flex-direction: column;
}

.side-rail__section-title {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.log-row {
  display: flex;
  gap: 10px;
  padding: 6px 0;
}

.log-time {
  width: 42px;
  font-size: 11px;
  color: var(--dim);
  flex-shrink: 0;
}

.log-text {
  color: var(--ink);
  opacity: 0.8;
  font-size: 13px;
}

@media (max-width: 1024px) {
  .side-rail {
    position: static;
  }
}

/* ==========================================================================
   Article detail
   ========================================================================== */

.article-detail {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 32px 96px;
}

@media (max-width: 640px) {
  .article-detail {
    padding: 24px 20px 64px;
  }
}

.article-detail__back {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  padding-bottom: 28px;
}

.article-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 64px;
  align-items: start;
}

@media (max-width: 1024px) {
  .article-detail__grid {
    grid-template-columns: 1fr;
  }
}

.article-detail__column {
  max-width: 68ch;
}

/* 週次まとめの個別ページ: 右のカラム(関連ニュースなど)がないので、本文を960pxまで広げる */
.article-detail__grid--weekly {
  grid-template-columns: minmax(0, 960px);
}

.article-detail__grid--weekly .article-detail__column {
  max-width: 960px;
}

.article-detail__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 16px;
}

.article-detail__title {
  font-size: 42px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.01em;
}

@media (max-width: 640px) {
  .article-detail__title {
    font-size: 28px;
  }
}

/* 週次まとめ: タイトルのすぐあとに本文(概要)が続くので、間をあける(通常の記事は間に原題が入る) */
.article-detail__title + .article-body {
  margin-top: 26px;
}

.article-detail__title-en {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 26px;
  margin-top: 8px;
  display: block;
}

.points-block {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--wash);
  padding: 20px;
  margin-bottom: 30px;
}

.points-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
}

.points-audience {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
  line-height: 1.75;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.points-audience__label {
  flex: none;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.points-list {
  padding-left: 18px;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.points-list li {
  font-size: 14px;
  line-height: 1.75;
}

.article-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 16px;
  line-height: 1.95;
  text-wrap: pretty;
}

.source-box {
  margin-top: 34px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--wash);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.source-note {
  font-size: 13px;
}

.source-url {
  font-size: 11px;
  color: var(--dim);
  margin-top: 4px;
  word-break: break-all;
}

.source-link {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 2px;
  white-space: nowrap;
}

.article-detail__sidebar {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.related-item {
  display: block;
  padding: 10px 0;
}

.related-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  margin-top: 4px;
}

.background-note {
  border: 1px solid var(--line);
  padding: 18px;
  font-size: 12.5px;
  line-height: 1.8;
  opacity: 0.8;
}

/* ==========================================================================
   Sources page
   ========================================================================== */

.sources-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 32px 96px;
}

@media (max-width: 640px) {
  .sources-page {
    padding: 24px 20px 64px;
  }
}

.sources-page__title {
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 20px;
  margin-bottom: 16px;
}

.sources-page__lead {
  max-width: 60ch;
  font-size: 14px;
  line-height: 1.85;
  color: var(--dim);
  margin-bottom: 32px;
}

.sources-page__list {
  max-width: 480px;
  display: flex;
  flex-direction: column;
}

.sources-page__item {
  border-bottom: 1px solid var(--line);
}

.sources-page__item a {
  display: block;
  padding: 16px 0;
  font-size: 14px;
}

.sources-page__item a:hover {
  color: var(--accent);
}

.about-page__body {
  max-width: 68ch;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about-page__section p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--dim);
}

.about-page__section a {
  color: var(--ink);
  text-decoration: underline;
}

/* 「記事ができるまで」の番号つきリスト。段落(p)と同じ文字サイズ・色・行間にそろえ、番号を出す(リセットで消えていた) */
.about-page__section ol {
  margin: 12px 0 0;
  padding-left: 1.6em;
  list-style: decimal;
}

.about-page__section li {
  font-size: 14px;
  line-height: 1.85;
  color: var(--dim);
  margin-bottom: 6px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}

.site-footer__brand {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-footer__note {
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 4px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;   /* 狭い画面で右端が切れる・「上に戻る」ボタンに隠れるのを防ぐ(2026-10-17) */
  gap: 8px 20px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ==========================================================================
   404
   ========================================================================== */

.not-found {
  max-width: 1180px;
  margin: 0 auto;
  padding: 120px 32px;
  text-align: center;
  color: var(--dim);
}

.not-found a {
  color: var(--accent);
  text-decoration: underline;
}

/* ==========================================================================
   週次まとめ(/weekly/)
   ========================================================================== */
.weekly-lead {
  font-size: 14px;
  line-height: 1.85;
  color: var(--dim);
  margin: 0 0 24px;
}

/* 週次まとめの個別ページ: 本文の間に入る説明は、本文と同じ大きさ・色にする(一覧・用語集・アーカイブの先頭の説明は、控えめなまま) */
.article-detail .weekly-lead {
  font-size: 16px;
  line-height: 1.95;
  color: inherit;
}

.weekly-list {
  display: flex;
  flex-direction: column;
}

.weekly-section {
  margin-top: 36px;
}

.weekly-section__title {
  font-size: 20px;
  line-height: 1.5;
  margin: 0 0 14px;
}

.weekly-vendor {
  margin-top: 18px;
}

.weekly-vendor__items {
  margin: 8px 0 0;
  padding-left: 1.2em;
  font-size: 14px;
  line-height: 1.85;
  color: var(--dim);
}

.weekly-vendor__items a {
  color: var(--ink);
  text-decoration: underline;
}

/* ベンダー別: 説明(dt)のすぐ下の行に、取り上げた記事へのリンク(dd) */
.weekly-vendor__list {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.85;
}

.weekly-vendor__list dt {
  color: var(--dim);
  margin-top: 10px;
}

.weekly-vendor__list dd {
  margin: 0;
}

/* 説明のない項目(記事のタイトルだけ)の上の余白 */
.weekly-vendor__list dd:not(dt + dd) {
  margin-top: 10px;
}

.weekly-vendor__list dd a {
  color: var(--ink);
  text-decoration: underline;
}

/* ==========================================================================
   月別・年別アーカイブ(/articles/2026/10/ ・ /articles/2026/。inc/archive.php、page-archive.php)
   ========================================================================== */
.archive-link {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
  color: var(--ink);
  opacity: 0.8;
  text-decoration: none;
}

.archive-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.archive-link__count {
  font-size: 11px;
  color: var(--dim);
}

.archive-link--year {
  margin-top: 6px;
  color: var(--dim);
}

.archive-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 20px;
  font-size: 12px;
}

.archive-nav a {
  color: var(--dim);
  text-decoration: none;
}

.archive-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.archive-months {
  display: flex;
  flex-direction: column;
}

/* 年ごとのアーカイブ(/articles/2026/)の月の一覧: PC幅(900px以上)は3カラム、タブレット(600〜899px)は2カラム、スマホは1カラム(2026-10-20) */
@media (min-width: 600px) {
  .archive-months {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
  }
}

@media (min-width: 900px) {
  .archive-months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.archive-month {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.archive-month:hover .archive-month__label {
  text-decoration: underline;
}

.archive-month__label {
  font-size: 18px;
}

.archive-month__count {
  font-size: 12px;
  color: var(--dim);
}

/* ==========================================================================
   用語集(/glossary/)と、本文のツールチップ(inc/glossary.php、page-glossary.php)
   ========================================================================== */
.gloss {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--dim);
  cursor: help;
}

.gloss:focus {
  outline: none;
  border-bottom-style: solid;
}

/* 説明の吹き出し。script が <body> の直下に作り、位置(left・top)を指定する(本文の中には置かない) */
.gloss__tip {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 30;
  width: 280px;
  max-width: 80vw;
  padding: 10px 12px;
  background: var(--bg, #fff);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  line-height: 1.7;
  font-weight: 400;
  text-align: left;
}

.gloss__term {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}

.gloss__short {
  display: block;
}

.gloss__more {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--dim);
  text-decoration: underline;
}

.glossary-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 28px;
  font-size: 12px;
}

.glossary-index a {
  color: var(--dim);
  text-decoration: none;
}

.glossary-index a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.glossary-group {
  margin-top: 32px;
}

.glossary-group__title {
  font-size: 20px;
  margin: 0 0 12px;
}

.glossary-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));   /* 画面の幅に合わせて、3列・2列・1列(スマホ) */
  gap: 14px 28px;
}

/* 分類のリンク(#cat-N)は、ゆっくり滑らかにスクロールする。動きを減らす設定の人にはしない */
@media (prefers-reduced-motion: no-preference) {
  html:has(.glossary-index) { scroll-behavior: smooth; }
}
/* ヘッダーはスクロールで画面の外へ出るので、見出しは画面の上から16pxの位置に止める(JSなしのアンカーリンク用) */
.glossary-group { scroll-margin-top: 16px; }

.glossary-item {
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 90px;
  min-width: 0;
}

.glossary-item:target {
  background: var(--chip-bg, rgba(127, 127, 127, 0.08));
  outline: 6px solid var(--chip-bg, rgba(127, 127, 127, 0.08));
}

.glossary-item__term {
  font-size: 16px;
  margin: 0 0 4px;
}

.glossary-item__short {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink);
  opacity: 0.85;
}

/* ==========================================================================
   「上に戻る」ボタン(inc/back-to-top.php)。一定スクロールしたら右下に出る
   ========================================================================== */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-to-top[hidden] {
  display: none;
}

.back-to-top.is-visible {
  opacity: 0.92;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  opacity: 1;
}

.back-to-top:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }
}

@media (max-width: 640px) {
  .back-to-top {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

/* 編集部の見立て: ニュース本文・出典の枠とは別の、記事の末尾の枠(左に太い線、地色を変える) */
.editor-note {
  margin-top: 28px;
  padding: 18px 20px 16px;
  border: 1px dashed var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 2px;
  background: var(--wash);
}

.editor-note__label {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 6px;
}

.editor-note__lead {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--dim);
}

.editor-note__list {
  margin: 0;
  padding-left: 1.2em;
  font-size: 14px;
  line-height: 1.8;
}

.editor-note__list li + li {
  margin-top: 6px;
}

/* 料金・プランの比較ページ(/pricing/ と /pricing/<ベンダー>/。2026-10-31) */
.pricing .pricing-h2 { font-size: 20px; margin: 38px 0 10px; }
.pricing .pricing-h3 { font-size: 15px; margin: 22px 0 8px; color: var(--dim); }
.pricing-lead { font-size: 13px; color: var(--dim); line-height: 1.8; margin: 0 0 12px; }
.pricing-vendors { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; margin: 18px 0 4px; font-size: 14px; }
.pricing-vendors__label { font-size: 10px; letter-spacing: 0.1em; color: var(--dim); }
.pricing-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 2px; }
.pricing-table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 13px; line-height: 1.65; }
.pricing-table th, .pricing-table td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.pricing-table thead th { background: var(--wash); font-size: 12px; white-space: nowrap; }
.pricing-table tbody th { background: var(--wash); white-space: nowrap; font-weight: 600; }
.pricing-table tbody tr:last-child th, .pricing-table tbody tr:last-child td { border-bottom: 0; }
.pricing-table--plans { min-width: 640px; }
.pricing-plan-cell + .pricing-plan-cell { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.pricing-none { color: var(--dim); }
.pricing-sub { font-size: 12px; color: var(--dim); line-height: 1.7; }
.pricing-src { font-size: 11px; color: var(--dim); white-space: nowrap; }
.pricing-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pricing-plan { border: 1px solid var(--line); border-radius: 2px; background: var(--wash); padding: 16px 18px; }
.pricing-plan__name { font-size: 16px; margin: 0 0 4px; }
.pricing-plan__price { font-size: 15px; margin-bottom: 6px; }
.pricing-plan__features { padding-left: 18px; list-style: disc; font-size: 13px; line-height: 1.7; display: flex; flex-direction: column; gap: 3px; margin: 8px 0; }
.pricing-notice { margin-top: 34px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 2px; font-size: 12px; color: var(--dim); line-height: 1.8; }
.pricing-notice p { margin: 0 0 6px; }
.pricing-empty { font-size: 13px; color: var(--dim); }
.pricing-related { padding-left: 18px; list-style: disc; font-size: 14px; line-height: 1.9; }

/* 料金ページ 第2版(2026-10-31): プランごとの『できること・できないこと』の表・円換算 */
.pricing-fx { font-size: 13px; color: var(--dim); margin: 0 0 6px; }
.pricing-tax { font-size: 14px; line-height: 1.8; margin: 8px 0 12px; padding: 10px 14px; border-left: 3px solid var(--accent, #c0392b); background: var(--bg-soft, rgba(0,0,0,.04)); }
.pricing-legend { font-size: 13px; line-height: 1.8; margin: 0 0 6px; }
.pricing-price { font-weight: 600; }
.pricing-orig { font-size: 11px; color: var(--dim); font-weight: 400; }
.pricing-svc { font-size: 10px; letter-spacing: 0.08em; color: var(--dim); }
.pricing-table--matrix { min-width: 640px; }
.pricing-table--matrix thead th { vertical-align: bottom; min-width: 112px; }
.pricing-table--matrix thead th:first-child, .pricing-table--matrix tbody th[scope="row"] { position: sticky; left: 0; z-index: 1; min-width: 150px; max-width: 220px; white-space: normal; background: var(--wash); }
.pricing-table--matrix tbody th[scope="row"] { font-weight: 500; }
.pricing-group th { background: var(--bg, var(--wash)); font-size: 12px; letter-spacing: 0.06em; color: var(--dim); padding-top: 16px; }
.pricing-mark { text-align: center; white-space: normal; }
.pricing-mark__sym { font-weight: 700; font-size: 15px; }
.pricing-cond { display: block; font-size: 11px; line-height: 1.5; color: var(--dim); font-weight: 400; }
.pricing-mark--yes .pricing-mark__sym, span.pricing-mark--yes { color: #1a7f4b; }
.pricing-mark--no .pricing-mark__sym, span.pricing-mark--no { color: #c0392b; }
.pricing-mark--none .pricing-mark__sym, span.pricing-mark--none { color: var(--dim); font-weight: 400; }
:root[data-theme="dark"] .pricing-mark--yes .pricing-mark__sym, :root[data-theme="dark"] span.pricing-mark--yes { color: #52c88a; }
:root[data-theme="dark"] .pricing-mark--no .pricing-mark__sym, :root[data-theme="dark"] span.pricing-mark--no { color: #ef7b6d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pricing-mark--yes .pricing-mark__sym, :root:not([data-theme="light"]) span.pricing-mark--yes { color: #52c88a; }
  :root:not([data-theme="light"]) .pricing-mark--no .pricing-mark__sym, :root:not([data-theme="light"]) span.pricing-mark--no { color: #ef7b6d; }
}

/* 料金ページ: どのベンダーの列かを、はっきり(2026-10-31) */
.pricing-th { border-top: 4px solid var(--line); text-align: left; vertical-align: bottom; }
.pricing-th--openai { border-top-color: #10a37f; }
.pricing-th--anthropic { border-top-color: #d97757; }
.pricing-th--google { border-top-color: #4285f4; }
.pricing-th--mistral { border-top-color: #fa520f; }
.pricing-th--xai { border-top-color: #777; }
.pricing-th--meta { border-top-color: #0668e1; }
.pricing-vendor { display: block; font-size: 15px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.3; }
.pricing-company { display: block; font-size: 10px; letter-spacing: 0.08em; color: var(--dim); text-transform: uppercase; margin-bottom: 4px; }
.pricing-plan-name { display: block; font-size: 13px; margin-bottom: 2px; }
.pricing-table--matrix thead th.pricing-th { min-width: 128px; }

/* 機能の表(比較ページ・ベンダー別): 横スクロールを出さない(2026-10-31 ユーザー指示)。列の幅を均等にし、見出しは折り返して(高さは出てよい)、見出しと○×ーは中央にそろえる。幅が狭い画面(スマホ)だけ、横スクロールを残す */
.pricing-table--matrix { min-width: 0; table-layout: fixed; }
.pricing-table--matrix thead th, .pricing-table--matrix thead th.pricing-th { min-width: 0; white-space: normal; text-align: center; overflow-wrap: anywhere; padding: 10px 6px; }
.pricing-table--matrix thead th:first-child { width: 20%; text-align: left; }
.pricing-table--matrix tbody th[scope="row"] { min-width: 0; max-width: none; padding: 10px 8px; overflow-wrap: anywhere; }
.pricing-table--matrix td { padding: 10px 6px; overflow-wrap: anywhere; }
.pricing-table td.pricing-mark { text-align: center; }
.pricing-table--matrix .pricing-orig { display: inline-block; }
@media (max-width: 860px) {
  .pricing-table--matrix { table-layout: auto; min-width: 680px; }
  .pricing-table--matrix thead th, .pricing-table--matrix thead th.pricing-th { min-width: 104px; }
}

/* 比較ページの『ベンダー別』のリンクを、ボタンの見た目に(2026-11-01 ユーザー指示。リンクだと分かりにくい)。会社の色の線は、表の見出しと同じ */
.pricing-vendors { gap: 10px 12px; align-items: center; }
.pricing-vendors__label { flex-basis: 100%; }
.pricing-vendors a.pricing-vendors__link { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; font-size: 14px; font-weight: 700; line-height: 1.2; color: var(--ink); text-decoration: none; background: var(--wash); border: 1px solid var(--line); border-bottom: 3px solid var(--line); border-radius: 4px; transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.pricing-vendors a.pricing-vendors__link::after { content: "\203A"; font-size: 16px; line-height: 1; color: var(--dim); }
.pricing-vendors a.pricing-vendors__link:hover, .pricing-vendors a.pricing-vendors__link:focus-visible { background: var(--bg); border-color: var(--ink); transform: translateY(-1px); }
.pricing-vendors a.pricing-vendors__link--openai { border-bottom-color: #10a37f; }
.pricing-vendors a.pricing-vendors__link--anthropic { border-bottom-color: #d97757; }
.pricing-vendors a.pricing-vendors__link--google { border-bottom-color: #4285f4; }
.pricing-vendors a.pricing-vendors__link--mistral { border-bottom-color: #fa520f; }
.pricing-vendors a.pricing-vendors__link--xai { border-bottom-color: #777; }
.pricing-vendors a.pricing-vendors__link--meta { border-bottom-color: #0668e1; }

/* 記事の小見出し(h2。2026-11-01。表示専用。inc/headings.php が点検したものだけ出る) */
.article-body .article-h2 { margin: 22px 0 -6px; padding-left: 12px; border-left: 4px solid var(--ink); font-size: 20px; line-height: 1.5; font-weight: 700; letter-spacing: 0.01em; }
.article-body .article-h2:first-child { margin-top: 0; }
@media (max-width: 640px) { .article-body .article-h2 { font-size: 18px; margin-top: 18px; } }

/* ==========================================================================
   検索(2026-11-02。ヘッダーの検索窓と、検索結果ページ。inc/search.php・search.php)
   ========================================================================== */

.site-search {
  flex-shrink: 0;
}

.site-search__input {
  width: 150px;
  font: inherit;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.site-search__input:focus,
.search-form__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.search-form {
  display: flex;
  gap: 8px;
  padding: 24px 0 8px;
}

.search-form__input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.search-form__button {
  flex-shrink: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--wash);
  color: var(--ink);
  cursor: pointer;
}

.search-note,
.search-pricing {
  font-size: 12px;
  line-height: 1.7;
  color: var(--dim);
  padding: 4px 0 8px;
}

.search-pricing a {
  color: var(--accent);
  text-decoration: underline;
}

.search-results {
  padding-top: 8px;
}

.search-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 32px 0 16px;
  font-size: 12px;
  color: var(--dim);
}

.search-pager a {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .site-search__input {
    width: 88px;
  }
}

/* ==========================================================================
   記事の表(2026-11-02。inc/tables.php。元記事の表の転載。スマホは表の枠の中だけ横にスクロール)
   ========================================================================== */

.article-table {
  margin: 28px 0;
  padding: 0;
}

.article-table__caption {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--dim);
  padding-bottom: 8px;
}

.article-table__scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.article-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.6;
}

.article-table th,
.article-table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.article-table thead th {
  background: var(--wash);
  font-weight: 600;
  color: var(--ink);
}

.article-table tbody th {
  font-weight: 500;
  color: var(--ink);
}

.article-table td {
  color: var(--ink);
}

.article-table tbody tr:last-child th,
.article-table tbody tr:last-child td {
  border-bottom: none;
}

.article-table__note {
  font-size: 11px;
  line-height: 1.6;
  color: var(--dim);
  padding-top: 8px;
}

.article-table__note a {
  color: var(--accent);
  text-decoration: underline;
}

.article-table__orig {
  font-weight: 400;
  font-size: 0.92em;
  color: var(--dim);
}
