/*
Theme Name: Lucid
Theme URI: https://bylucid.com
Author: Lucid
Description: Lucid（斜め上の視点から）のオリジナルWordPressテーマ。政治経済メディア×資料販売サイト向けの、爽やかで軽量なテーマです。
Version: 1.0.19
Text Domain: lucid
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  --color-primary: #179CF0;
  --color-primary-dark: #0E7FD1;
  --color-primary-tint: #E7F4FE;
  --color-ink: #10263B;
  --color-text: #4B5768;
  --color-body-text: #1F2933; /* 記事本文(.entry-content の p/li)の文字色 */
  --color-muted: #7C8896;
  --color-border: #E2E8F0;
  --color-bg: #FAFBFD;
  --color-bg-alt: #F1F6FB;
  --color-surface: #FFFFFF;
  --color-footer-bg: #10263B;
  --color-footer-text: #C9D6E3;

  --font-base: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
  --font-hiragino-first: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;

  --container-width: 1120px;
  --header-height: 76px;
  --header-height-mobile: 60px;

  --radius-sm: 4px;
  --radius-md: 8px;

  --transition-fast: 0.18s ease;
  --transition-base: 0.25s ease;
}

/* ==========================================================================
   2. Reset / base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}
@media (max-width: 640px) {
  html { scroll-padding-top: calc(var(--header-height-mobile) + 16px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-bg);
  padding-top: var(--header-height);
}
@media (max-width: 640px) {
  body { padding-top: var(--header-height-mobile); }
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { color: var(--color-ink); font-weight: 700; line-height: 1.4; margin: 0; }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }

/* <em> keeps its semantic meaning (emphasis) but drops the browser's
   default italic styling in favor of the brand color + weight. */
em {
  font-style: normal;
  font-weight: 700;
  color: var(--color-primary);
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* Focus visibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   3. Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 400;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.02em;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(16, 38, 59, 0.15);
}
.btn:hover { box-shadow: 0 6px 16px rgba(16, 38, 59, 0.2); transform: translateY(-1px); }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-border);
}
.btn-outline:hover {
  border-color: var(--color-ink);
}

/* ==========================================================================
   4. Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: #FFFFFF;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(136, 136, 136, 0.25);
  transition: background-color var(--transition-base);
}
.site-header.is-scrolled {
  background-color: rgba(255, 255, 255, 0.93);
}

/* ログイン中はWP管理バーが上に固定表示されるため、
   同じく固定表示のヘッダー／モバイルメニューをその高さぶん押し下げる。 */
body.admin-bar .site-header {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
  body.admin-bar .mobile-nav {
    top: calc(var(--header-height-mobile) + 46px);
  }
}

@media (max-width: 640px) {
  .site-header { height: var(--header-height-mobile); }
}

.site-header__inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ヘッダーとフッターのロゴは同じ大きさ・同じ角丸に揃える（この1か所で管理） */
.site-branding img,
.site-branding svg,
.footer-brand img {
  height: 46px;
  width: auto;
  display: block;
  border-radius: 4px;
}
@media (max-width: 640px) {
  .site-branding img,
  .site-branding svg,
  .footer-brand img { height: 26px; }
}

.primary-nav { display: flex; }
.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: nowrap;
}
.primary-nav a {
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  color: #123152;
  position: relative;
  padding: 6px 0;
  transition: color var(--transition-fast);
}
.primary-nav a:hover { color: var(--color-primary); }
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 2px;
  background: var(--color-primary);
  transition: right var(--transition-base);
}
.primary-nav a:hover::after { right: 0; }

.header-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.header-cta .btn { padding: 10px 20px; font-size: 14px; white-space: nowrap; }
.header-cta__note { padding: 10px 16px; }
.header-cta__note img { display: block; height: 14px; width: auto; }
.header-cta__resource {
  background: #0D5BA8;
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(13, 91, 168, 0.4);
}
.header-cta__resource:hover {
  background: #0A4A8A;
  box-shadow: 0 8px 20px rgba(13, 91, 168, 0.5);
}

@media (max-width: 900px) {
  .primary-nav ul { gap: 14px; }
  .primary-nav a { font-size: 13px; }
  .header-cta { gap: 14px; }
  .header-cta .btn { padding: 9px 16px; font-size: 13px; }
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  padding: 0;
  position: relative;
}
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  left: 5px; right: 5px;
  height: 2px;
  background: var(--color-ink);
  transition: transform var(--transition-base), opacity var(--transition-base);
}
.menu-toggle span { top: 15px; }
.menu-toggle span::before { top: -7px; }
.menu-toggle span::after { top: 7px; }
.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
  .primary-nav { display: none; }
  .header-cta .btn-outline { display: none; }
  .header-cta__resource { display: none; }
  .menu-toggle { display: block; }
}

/* Mobile drawer */
.mobile-nav {
  position: fixed;
  top: var(--header-height-mobile);
  left: 0; right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--transition-base), opacity var(--transition-base), visibility var(--transition-base);
  z-index: 999;
}
.mobile-nav.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}
.mobile-nav ul { padding: 8px 24px 24px; }
.mobile-nav li { border-bottom: 1px solid var(--color-border); }
.mobile-nav li:last-child { border-bottom: none; }
.mobile-nav a {
  display: block;
  padding: 16px 0;
  font-size: 16px;
  font-weight: 400;
  color: #123152;
}
.mobile-nav .btn { margin-top: 16px; width: 100%; }
/* メニュー末尾のnoteアイコン行。他の行と高さが揃うよう、リンクの高さを固定寄りにしている */
.mobile-nav .mobile-nav__note a {
  display: flex;
  align-items: center;
  min-height: 61px;
  padding: 0;
}
.mobile-nav .mobile-nav__note img {
  display: block;
  height: 16px;
  width: auto;
}

/* ==========================================================================
   5. Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background: rgb(23, 156, 240);
  padding: 96px 0 72px;
  text-align: center;
}
/* 幾何学模様の装飾 — hero以外の主要ブロックでも共通で使う */
.section-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.section-decor svg {
  width: 100%;
  height: 100%;
  display: block;
}
.hero > .container,
.latest-articles > .container,
.section--brand > .container,
.section--tint > .container,
.misc-articles > .container {
  position: relative;
  z-index: 1;
}
.latest-articles,
.section--brand,
.section--tint,
.misc-articles {
  position: relative;
  overflow: hidden;
}
.hero__eyebrow {
  display: inline-block;
  font-size: 18px;
  font-weight: 400;
  color: #ffffff;
  margin-bottom: 12px;
}
.hero__title {
  text-wrap: balance;
  font-size: clamp(30px, 4.4vw, 48px);
  letter-spacing: 0.01em;
  color: #ffffff;
  margin-bottom: 20px;
}
.hero__lead {
  max-width: 560px;
  margin: 0 auto 36px;
  font-size: 16px;
  color: #ffffff;
  text-align: left;
}
.hero__actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.hero .btn-primary {
  background: #ffffff;
  color: var(--color-primary);
}
.hero .btn-primary:hover { background: rgba(255, 255, 255, 0.85); }
.hero .btn-outline {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
}
.hero .btn-outline:hover { border-color: #ffffff; }
@media (max-width: 640px) {
  .hero { padding: 56px 0 48px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
}

/* ==========================================================================
   6. Latest articles
   ========================================================================== */
.latest-articles {
  background: #0F5BA8;
  padding: 64px 0 80px;
}
.section-head {
  display: flex;
  flex-direction: column;
  margin-bottom: 32px;
}
.section-head h2 { font-size: 24px; }
.latest-articles .section-head h2 { color: #ffffff; font-size: 28px; }
.section-head__lead {
  margin-top: 10px;
  max-width: 660px;
  font-size: 16px;
}
.latest-articles .section-head__lead { color: rgba(255, 255, 255, 0.85); }

.latest-articles .btn-outline {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
}
.latest-articles .btn-outline:hover { border-color: #ffffff; }

/* Consistent rule for "view all" actions: always centered directly below
   the 4-item grid it belongs to — never floated next to the heading. */
.section-foot {
  text-align: center;
  margin-top: 32px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 640px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

.article-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(16, 38, 59, 0.06);
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
.article-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(16, 38, 59, 0.12);
}
.article-card__thumb {
  aspect-ratio: 4 / 3;
  background: var(--color-bg-alt);
  overflow: hidden;
}
.article-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-card__body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.article-card__cat {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.article-card__title {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: auto;
}
.article-card__date {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 14px;
}
@media (max-width: 640px) {
  .article-card__body { padding: 12px; }
  .article-card__title { font-size: 13.5px; }
}

/* ==========================================================================
   7. Generic content sections (about / product teaser)
   ========================================================================== */
.section {
  padding: 80px 0;
}
.section--tight { padding: 56px 0; }
.section__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.section__eyebrow {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.section__title {
  font-size: 26px;
  margin-bottom: 18px;
}
.section__text { max-width: 640px; }
.section__divider {
  max-width: 640px;
  margin-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.section__media {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.section__media img { width: 100%; height: 100%; object-fit: cover; }
.section__media--photo {
  position: relative;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 72% 22%;
}
.section__media--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(12, 33, 54, 0.95) 0%, rgba(12, 33, 54, 0.9) 36%, rgba(12, 33, 54, 0.875) 39.6%, rgba(12, 33, 54, 0.806) 43.2%, rgba(12, 33, 54, 0.706) 46.8%, rgba(12, 33, 54, 0.583) 50.4%, rgba(12, 33, 54, 0.45) 54%, rgba(12, 33, 54, 0.317) 57.6%, rgba(12, 33, 54, 0.194) 61.2%, rgba(12, 33, 54, 0.094) 64.8%, rgba(12, 33, 54, 0.025) 68.4%, rgba(12, 33, 54, 0) 72%);
}

@media (max-width: 640px) {
  .section { padding: 48px 0; }
  .section__grid { grid-template-columns: 1fr; gap: 28px; }
}

/* Section background variants — each block on the front page gets its own
   full-width color band, rather than a colored card floating on a neutral page. */
.section--dark {
  background: #0C2136;
}
.section--dark .section__eyebrow { color: var(--color-primary); }
.section--dark .section__title { color: #ffffff; }
.section--dark .section__text { color: var(--color-footer-text); }
.section--dark .section__media { background: rgba(255, 255, 255, 0.06); }

/* Full-bleed photo section (e.g. the "Lucidとは" block) — a dark gradient
   fades from solid on the text side to nearly transparent so the photo's
   subject stays visible while the copy stays readable. */
.section--photo {
  position: relative;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 72% 22%;
  overflow: hidden;
  padding-top: 80px;
  padding-bottom: 140px;
}
.section--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(12, 33, 54, 0.95) 0%, rgba(12, 33, 54, 0.9) 36%, rgba(12, 33, 54, 0.875) 39.6%, rgba(12, 33, 54, 0.806) 43.2%, rgba(12, 33, 54, 0.706) 46.8%, rgba(12, 33, 54, 0.583) 50.4%, rgba(12, 33, 54, 0.45) 54%, rgba(12, 33, 54, 0.317) 57.6%, rgba(12, 33, 54, 0.194) 61.2%, rgba(12, 33, 54, 0.094) 64.8%, rgba(12, 33, 54, 0.025) 68.4%, rgba(12, 33, 54, 0) 72%);
  z-index: 0;
}
.section--photo > .container {
  position: relative;
  z-index: 1;
}
.section--photo .section__text-col {
  max-width: 512px;
}
@media (max-width: 640px) {
  /* スマホ: 写真を上部に明るいまま見せ、文章は下の紺の帯に載せる。
     写真の金色の背景に合わせて、見出し上のラベルと区切り線を金色にする。 */
  .section--photo {
    padding: 180px 0 72px;
    background-size: auto 340px;
    background-position: 72% top;
  }
  .section--photo::before {
    background: linear-gradient(to bottom, rgba(12, 33, 54, 0) 0, rgba(12, 33, 54, 0) 120px, rgba(12, 33, 54, 0.98) 330px);
  }
  .section--photo .section__text-col {
    max-width: none;
  }
  .section--photo .section__eyebrow { color: #FAD07F; }
  .section--photo .section__text { color: #E6EDF4; }
  .section--photo .section__divider { border-top-color: rgba(250, 208, 127, 0.4); }
}

.section--brand {
  background: #179CF0;
}
.section--tint {
  background: #74B9FF;
}

/* 資料販売セクション用の背景写真（薄い水色のグラデーションでテキスト側を覆う） */
.section--tint-photo {
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  padding: 160px 0;
}
.section--tint-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(116, 185, 255, 1) 0%, rgba(116, 185, 255, 0.93) 40%, rgba(116, 185, 255, 0.72) 65%, rgba(116, 185, 255, 0.35) 100%);
  z-index: 0;
}
.section--tint-photo > .container {
  position: relative;
  z-index: 1;
}
@media (max-width: 640px) {
  .section--tint-photo {
    padding: 80px 0;
  }
  .section--tint-photo::before {
    background: rgba(116, 185, 255, 0.9);
  }
}

/* The default navy-tinted button shadow reads clearly on light/white
   backgrounds, but disappears on saturated or dark section backgrounds —
   use a deeper, near-black shadow there instead so buttons keep the same
   sense of elevation everywhere. */
.hero .btn,
.section--dark .btn,
.section--brand .btn,
.latest-articles .btn,
.section--tint .btn {
  box-shadow: 0 6px 18px rgba(4, 14, 24, 0.35);
}
.hero .btn:hover,
.section--dark .btn:hover,
.section--brand .btn:hover,
.latest-articles .btn:hover,
.section--tint .btn:hover {
  box-shadow: 0 10px 24px rgba(4, 14, 24, 0.42);
}

.section--tint .btn-primary {
  background: #ffffff;
  color: #179CF0;
}
.section--tint .btn-primary:hover {
  background: rgba(255, 255, 255, 0.85);
}

.novel-teaser__head {
  margin-bottom: 36px;
}
.novel-teaser--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.novel-teaser__eyebrow {
  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
  margin-bottom: 14px;
  display: block;
}
.novel-teaser__title {
  font-size: 28px;
  margin-bottom: 0;
  color: #ffffff;
}
.novel-teaser__lead {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.9);
}

.novel-teaser__features {
  margin-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.novel-teaser__feature {
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
.novel-teaser__feature:last-child {
  border-bottom: none;
}
.novel-teaser__feature h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #ffffff;
}
.novel-teaser__feature p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.section--brand .btn-primary {
  background: #ffffff;
  color: var(--color-primary);
}
.section--brand .btn-primary:hover { background: rgba(255, 255, 255, 0.85); }

.novel-teaser__empty {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.novel-teaser__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.novel-teaser__cta {
  margin-top: 16px;
  text-align: center;
}

.novel-list-card {
  display: flex;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(4, 14, 24, 0.18);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.novel-list-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(4, 14, 24, 0.25);
}
.novel-list-card__thumb {
  width: 42%;
  flex-shrink: 0;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-alt);
  background-image: repeating-linear-gradient(135deg, rgba(16, 38, 59, 0.05) 0 10px, transparent 10px 20px);
  color: var(--color-muted);
  font-size: 13px;
}
.novel-list-card__thumb img { width: 100%; height: 100%; object-fit: contain; }
.novel-list-card__body {
  flex: 1;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.novel-list-card__ep {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}
.novel-list-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-ink);
  margin: 0 0 8px;
}
.novel-list-card__meta {
  font-size: 12.5px;
  color: var(--color-muted);
}

@media (max-width: 640px) {
  .novel-teaser--split {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .novel-list-card__thumb {
    min-height: 110px;
  }
}

.product-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.product-teaser__title { color: #ffffff; font-size: 28px; margin-bottom: 12px; }
.product-teaser__text { color: #ffffff; max-width: 640px; margin-bottom: 0; }
@media (max-width: 640px) {
  .product-teaser { text-align: left; }
  .product-teaser .btn { width: 100%; }
}

/* ==========================================================================
   8. Page / single content
   ========================================================================== */
.breadcrumbs {
  padding: 16px 0;
  text-align: left;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-muted);
}
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs li + li::before {
  content: "\203A";
  margin: 0 8px;
  color: #4B5768;
}
.breadcrumbs a {
  color: var(--color-muted);
  transition: color var(--transition-fast);
}
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs li[aria-current="page"] {
  color: var(--color-text);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .breadcrumbs li[aria-current="page"] { max-width: 160px; }
}

.page-header {
  padding: 56px 0 32px;
  text-align: center;
}
.page-header h1 { font-size: 30px; }
/* スマホ: ページタイトル(h1)のサイズ、投稿・固定ページは左寄せ+左右12px */
@media (max-width: 640px) {
  .page-header h1 { font-size: 26px; }
  body.single .page-header,
  body.page .page-header {
    text-align: left;
    padding-left: 12px;
    padding-right: 12px;
  }
}

.entry-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.entry-content p,
.entry-content ul,
.entry-content ol { margin-bottom: 1.4em; }
.entry-content p,
.entry-content li {
  color: var(--color-body-text);
  font-size: 17px;
}
/* メインブロックの段落・本文リストの行間(全ページ共通)。クラス側で line-height を指定している要素はそちらが優先される */
main p,
.entry-content li { line-height: 2; }
.entry-content h2 { font-size: 22px; margin: 2em 0 0.8em; scroll-margin-top: calc(var(--header-height) + 16px); }
.entry-content h3 { font-size: 18px; margin: 1.8em 0 0.6em; scroll-margin-top: calc(var(--header-height) + 16px); }

/* 考察記事(view。子カテゴリーでも可)限定の見出し装飾 */
body.is-view-post .entry-content h2 {
  border-left: 4px solid #179CF0;
  padding-left: 14px;
}
body.is-view-post .entry-content h3 {
  border-left: 4px solid #aaa69d;
  padding-left: 14px;
}

/* 配信小説(novel)限定の見出し装飾 */
body.is-novel-post .entry-content h2 {
  border-left: 4px solid #f0932b;
  padding-left: 14px;
}
.entry-content h4 { scroll-margin-top: calc(var(--header-height) + 16px); }
.entry-content img { border-radius: var(--radius-md); margin: 1.6em 0; }

/* テーブルの見た目（アップロードされたリファレンスHTMLに合わせたスタイル） */
.entry-content .scroll {
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin: 1.6em 0;
}
.entry-content .wp-block-table {
  overflow-x: auto;
}
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 14px;
}
.entry-content .wp-block-table table {
  min-width: 0;
}
.entry-content thead th {
  background: var(--color-bg-alt);
  font-weight: 400;
  font-size: 12.5px;
  color: var(--color-muted);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.entry-content tbody th,
.entry-content tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  text-align: left;
  color: var(--color-text);
}
.entry-content tbody tr:last-child th,
.entry-content tbody tr:last-child td {
  border-bottom: 0;
}
.entry-content tbody th {
  font-weight: 700;
  white-space: nowrap;
  color: var(--color-ink);
}
.entry-content .rank {
  width: 3.4em;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}
.entry-content td.rank { font-weight: 400; }
.entry-content .num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 8em;
}
.entry-content .v { display: block; }
.entry-content .note {
  font-size: 13.5px;
  line-height: 1.6;
  min-width: 14em;
  white-space: normal;
  color: var(--color-text);
}
.entry-content .bar {
  display: block;
  height: 5px;
  background: var(--color-border);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.entry-content .bar i { display: block; height: 100%; border-radius: 3px; background: var(--color-primary); }
.entry-content .bar.down i { background: #0F766E; }
.entry-content .bar.up i { background: #B4460F; }
.entry-content .lede { margin: 0 0 14px; color: var(--color-muted); font-size: 14px; line-height: 1.7; }
.entry-content .notes {
  margin: 12px 0 0;
  padding-left: 1.2em;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.7;
}
.entry-content .notes li { margin-bottom: 3px; }
@media (max-width: 640px) {
  .entry-content thead th,
  .entry-content tbody th,
  .entry-content tbody td { padding: 10px 10px; }
}
.entry-content a {
  color: #179CF0;
  text-decoration: underline;
  text-decoration-color: #179CF0;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* 外部リンク（JSでhostnameを判定し is-external-link クラスを付与している）*/
.entry-content a.is-external-link::after,
.contact-form__privacy a.is-external-link::after {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 4px;
  vertical-align: middle;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23179CF0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* 記事内の中央配置ボタン（noteへの誘導など）。
   使い方：ブロックエディタで「カスタムHTML」ブロックを追加し、次を貼る。
   <p class="btn-wrap"><a class="btn btn-primary btn-lg" href="URL" target="_blank" rel="noopener noreferrer">狙うならハイエース [note]</a></p> */
.entry-content .btn-wrap {
  text-align: center;
  margin: 2.4em 0;
}
.entry-content a.btn,
.entry-content a.btn:hover {
  color: #fff;
  text-decoration: none;
}
.entry-content a.btn-primary { background: #4090DA; }
.entry-content a.btn-primary:hover { background: #2F7CC6; }
.entry-content a.btn-lg {
  font-size: 18px;
  line-height: 1.4;
  padding: 18px 44px;
  white-space: normal;
  text-align: center;
  max-width: 100%;
  box-shadow: 0 8px 22px rgba(64, 144, 218, 0.32);
}
.entry-content a.btn-lg:hover { box-shadow: 0 10px 26px rgba(64, 144, 218, 0.4); }
.entry-content a.btn.is-external-link::after { content: none; display: none; }
@media (max-width: 640px) {
  .entry-content a.btn-lg { font-size: 17px; padding: 16px 28px; }
}

/* 考察記事(view)限定の自動生成目次 */
.toc {
  background: #dfe5eb;
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin: 0 0 2.2em;
}
.toc summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-ink);
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::marker { content: ""; }
.toc__state { color: var(--color-primary); }
.toc[open] .toc__state-closed { display: none; }
.toc:not([open]) .toc__state-open { display: none; }
.toc:not([open]) summary {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}
.toc__list ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc__list > ol > li { margin: 12px 0; }
.toc__list ol ol {
  margin: 10px 0 10px 4px;
  padding-left: 16px;
  border-left: 1px solid var(--color-border);
}
.toc__list ol ol li { margin: 8px 0; }
.toc__list a {
  color: var(--color-ink);
  font-size: 17px;
  line-height: 1.8;
  text-decoration: none;
}
.toc__list a:hover { color: var(--color-primary); }

.archive-grid {
  padding: 0 24px 80px;
}
.archive-grid .article-grid {
  grid-template-columns: repeat(3, 1fr);
}

.articles-page {
  padding: 0 24px 80px;
}
.articles-page .section-head {
  margin-top: 96px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.articles-page .section-head:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
#etc {
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.articles-page .article-grid {
  margin-bottom: 8px;
}
/* /articles/ 各セクション末尾の一覧ボタン */
.articles-page .section-foot .btn,
.articles-page .section-foot .btn:hover {
  background: #0D5BA8;
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(13, 91, 168, 0.4);
}

/* 問い合わせフォーム */
.contact-page__intro {
  padding-bottom: 0;
  margin-bottom: 40px;
}
.contact-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.contact-form__row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 32px;
}
.contact-form__label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  font-weight: 700;
  font-size: 15px;
  color: var(--color-ink);
}
.contact-form__required {
  display: inline-block;
  border: 1px solid #E0453C;
  color: #E0453C;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--color-ink);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.contact-form input[type="text"]::placeholder,
.contact-form input[type="email"]::placeholder,
.contact-form textarea::placeholder {
  color: var(--color-muted);
}
.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-surface);
}
.contact-form textarea {
  resize: vertical;
  min-height: 220px;
}
.contact-form__privacy {
  margin: 8px 0 36px;
}
.contact-form__privacy label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--color-ink);
  cursor: pointer;
}
.contact-form__privacy input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}
.contact-form__privacy a {
  color: #179CF0;
  text-decoration: underline;
  text-decoration-color: #179CF0;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.contact-form__submit {
  text-align: center;
}
.contact-form__submit .btn {
  padding: 16px 48px;
}
.contact-form__errors,
.contact-form__success {
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 32px;
  font-size: 14px;
}
.contact-form__errors {
  background: #FDEDEE;
  color: #B3261E;
  border: 1px solid #F5C2C7;
}
.contact-form__errors ul {
  margin: 0;
  padding-left: 1.2em;
}
.contact-form__success {
  background: var(--color-primary-tint);
  color: var(--color-ink);
  border: 1px solid var(--color-primary);
}
@media (max-width: 640px) {
  .contact-form__row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .contact-form__label {
    padding-top: 0;
  }
}
@media (max-width: 640px) {
  .archive-grid .article-grid { grid-template-columns: repeat(2, 1fr); }
  /* スマホは左右の余白を詰めて、カードの幅を確保する */
  .archive-grid,
  .articles-page {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* 投稿ページ下部の「おすすめ記事」— 親カテゴリー横断・新着4件、PC4列/SP2列 */
.recommend-articles {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 64px 0 80px;
}
.misc-articles {
  background: #DFE6E9;
  border-top: 1px solid var(--color-border);
}

/* ==========================================================================
   9. Footer
   ========================================================================== */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 64px 0 32px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-brand img { margin-bottom: 14px; }
.footer-brand p { max-width: 320px; font-size: 14px; color: var(--color-footer-text); }
.footer-nav { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-nav h3,
.footer-nav__title {
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  margin-bottom: 16px;
}
.footer-nav li { margin-bottom: 10px; }
.footer-nav a {
  font-size: 14px;
  color: var(--color-footer-text);
  transition: color var(--transition-fast);
}
.footer-nav a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-size: 13px;
  color: var(--color-muted);
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 640px) {
  .site-footer { padding: 48px 0 24px; }
  .footer-top { flex-direction: column; }
  .footer-nav { gap: 32px; }
}

/* トップに戻るボタン — 全ページ共通、一定量スクロールしたら表示 */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid rgba(23, 156, 240, 0.55);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 6px 16px rgba(16, 38, 59, 0.15);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base), border-color var(--transition-fast), box-shadow var(--transition-fast);
  z-index: 900;
}
.back-to-top:hover {
  border-color: var(--color-primary);
  box-shadow: 0 8px 20px rgba(16, 38, 59, 0.2);
}
.back-to-top.is-visible {
  opacity: 0.5;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top.is-visible:hover,
.back-to-top.is-visible:focus-visible {
  opacity: 1;
}
@media (max-width: 640px) {
  .back-to-top { right: 16px; bottom: 16px; width: 46px; height: 46px; }
}

/* ==========================================================================
   トップページ スマホ: セクション見出し(h2)のサイズと余白
   ========================================================================== */
@media (max-width: 640px) {
  .section__title,
  .novel-teaser__title,
  .latest-articles .section-head h2,
  .product-teaser__title,
  .section-head h2 {
    font-size: 24px;
  }
  .latest-articles .section-head h2 { margin-bottom: 12px; }
  .product-teaser__text,
  .product-teaser__title { margin-top: 10px; }
}

/* 見出しの改行位置制御（lucid_phrase_wrap）: 「、」「。」の後ろでだけ折り返す */
.phrase { display: inline-block; max-width: 100%; }
/* 小さめのスマホ(幅360px以下)では、見出しの1行目が折り返されないよう少し小さくする */
@media (max-width: 360px) {
  .hero__title { font-size: 26px; }
}

/* 表のスクロール案内（スマホのみ）と、端の影（スクロールできるときだけ） */
.table-scroll {
  position: relative;
  margin: 1.6em 0;
}
.table-scroll .scroll,
.table-scroll .wp-block-table {
  margin: 0;
}
.entry-content .table-scroll__hint {
  display: none;
  margin: 1.6em 0 6px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-muted);
  text-align: center;
}
.table-scroll::before,
.table-scroll::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: var(--radius-md);
  z-index: 1;
}
.table-scroll::after {
  right: 0;
  background: linear-gradient(to left, rgba(16, 38, 59, 0.28), rgba(16, 38, 59, 0));
}
.table-scroll::before {
  left: 0;
  background: linear-gradient(to right, rgba(16, 38, 59, 0.28), rgba(16, 38, 59, 0));
}
.table-scroll.can-scroll-right::after,
.table-scroll.can-scroll-left::before {
  opacity: 1;
}
@media (max-width: 640px) {
  .entry-content .table-scroll__hint.is-on {
    display: block;
  }
  .entry-content .table-scroll__hint.is-on + .table-scroll {
    margin-top: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .table-scroll::before,
  .table-scroll::after {
    transition: none;
  }
}

/* スマホ: 本文エリア(投稿・固定ページ)と目次の文字サイズ・色。後ろに置いて基本スタイルを上書きする */
@media (max-width: 640px) {
  /* スマホ: 本文(.entry-content の p/li)は基本スタイルの17pxをそのまま使う */
  .entry-content h2 { font-size: 23px; }
  .entry-content h3 { font-size: 20px; }
  .entry-content { padding-left: 12px; padding-right: 12px; }
  /* スマホ: 目次(文字サイズは本文と同じ17px) */
  .toc { padding: 24px 18px; }
  .toc__state { color: #0590e0; }
  .toc summary { border-bottom-color: #b0b6be; }
  /* スマホ: トップ等の説明文(本文と同じ17px) */
  .hero__lead,
  .section__text,
  .novel-teaser__lead,
  .novel-teaser__feature p,
  .product-teaser__text { font-size: 17px; }
  /* スマホ: 問い合わせフォーム。入力欄は16px未満だとiPhoneでフォーカス時に自動拡大されるため17px */
  .contact-form input[type="text"],
  .contact-form input[type="email"],
  .contact-form textarea { font-size: 17px; }
  .contact-form__label,
  .contact-form__privacy label { font-size: 16px; }
  /* スマホ: 記事内の補足類(小さくなりすぎないよう下限を引き上げる) */
  .entry-content .lede { font-size: 15px; }
  .entry-content .notes,
  .entry-content .note { font-size: 14px; }
  .entry-content thead th { font-size: 13.5px; }
  /* スマホ: 記事カード(トップ・/articles/・一覧) */
  .article-card__cat { font-size: 14px; }
  .article-card__title { font-size: 17px; }
  .article-card__date { font-size: 14px; color: #4b6584; }
  /* スマホ: トップの配信小説ブロック */
  .novel-teaser__feature h3 { font-size: 20px; }
  /* スマホ: フッター。説明文の最大幅(320px)を外し、左右の余白を同じにする */
  .footer-brand p { font-size: 16px; max-width: none; }
  .footer-nav__title { font-size: 16px; }
  .footer-nav li,
  .footer-nav a { font-size: 15px; }
}


/* 確認用: URLに ?font=hiragino を付けるとヒラギノを最優先にする(比較用。確認後、この1行と main.js の該当ブロックは削除可) */
html.font-hiragino body { font-family: var(--font-hiragino-first); }
