/* ============================================================
   プロゼミONLINE / グローバルCSS（PHP版）
   app/src/styles/global.css + components/*.css を統合し、
   実フォーム・FAQアコーディオン(details)・フィルタピル用の
   スタイルを追加したもの。
   ============================================================ */

:root {
  --max-width: 1200px;
  --pad-x: 24px;            /* mobile */
  --pad-x-md: 40px;         /* tablet 768px+ */
  --pad-x-lg: 56px;         /* desktop 1024px+ */

  /* 配色: 信頼の濃紺(Navy) × ゴールド(Gold) × クリーム(Cream)
     ※ 変数名 blue/yellow は歴史的経緯で残置。実値は navy/gold。 */
  --color-bg: #faf7f0;
  --color-surface: #ffffff;
  --color-blue: #0b2a4a;
  --color-blue-deep: #061a30;
  --color-blue-soft: #e7ecf2;
  --color-blue-tint: #eef1f5;
  --color-yellow: #b78942;
  --color-yellow-soft: #efe6d2;
  --color-gold-ink: #7d5a1c;
  --color-ink: #181d27;
  --color-ink2: #4a5159;
  --color-ink3: #8a8f98;
  --color-line: #e5e0d5;

  --font-display: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "Noto Sans JP", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--pad-x-md); }
}

@media (min-width: 1024px) {
  .container { padding-inline: var(--pad-x-lg); }
}

/* --- セクション縦パディング --- */
.section { padding-block: 40px; }
@media (min-width: 768px) {
  .section { padding-block: 56px; }
}
@media (min-width: 1024px) {
  .section { padding-block: 72px; }
}
.section-tight { padding-block: 28px; }
@media (min-width: 768px) {
  .section-tight { padding-block: 40px; }
}

/* --- グリッド --- */
.grid { display: grid; gap: 20px; }
@media (min-width: 768px) {
  .grid { gap: 24px; }
}

.grid-cols-1 { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- 表示切替 --- */
.hide-on-mobile { display: none !important; }
.show-on-mobile { display: initial; }

@media (min-width: 1024px) {
  .hide-on-mobile { display: initial !important; }
  .show-on-mobile { display: none !important; }
  .hide-on-desktop { display: none !important; }
}

/* --- 見出し --- */
h1.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.42;
  letter-spacing: 0.02em;
  margin: 0;
}
@media (min-width: 768px) {
  h1.hero-title { font-size: 38px; }
}
@media (min-width: 1024px) {
  h1.hero-title { font-size: 46px; }
}

h2.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  margin: 0;
}
@media (min-width: 768px) {
  h2.section-title { font-size: 25px; }
}
@media (min-width: 1024px) {
  h2.section-title { font-size: 30px; }
}

/* --- フォーカス --- */
:focus-visible {
  outline: 2px solid var(--color-yellow);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- 2カラムレイアウト --- */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .two-col {
    gap: 32px;
    align-items: flex-start;
  }
  .two-col.ratio-detail  { grid-template-columns: 1.5fr 1fr; }
  .two-col.ratio-submit  { grid-template-columns: 1.7fr 1fr; }
  .two-col.ratio-contact { grid-template-columns: 1.3fr 1fr; }
  .two-col.ratio-hero    { grid-template-columns: 1.2fr 1fr; }
  .two-col.ratio-even    { grid-template-columns: 1fr 1fr; }
}

/* --- フォームグリッド --- */
.d2-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 20px;
}

@media (min-width: 768px) {
  .d2-form-grid { grid-template-columns: 1fr 1fr; }
  .d2-form-grid .d2-field-full { grid-column: span 2; }
}

/* --- 実フォーム部品（Field.jsx のダミー描画を実装化） --- */
.d2-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.d2-field-label .label-text {
  font-size: 13px;
  font-weight: 600;
}

.d2-required {
  font-size: 10px;
  font-weight: 700;
  color: #a07314;
  background: var(--color-yellow-soft);
  padding: 1px 8px;
  border-radius: 2px;
}

.d2-input,
.d2-select,
.d2-textarea {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--color-line);
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-ink);
}

.d2-input,
.d2-select {
  height: 44px;
  padding: 0 18px;
}

.d2-select { appearance: auto; }

.d2-textarea {
  min-height: 120px;
  padding: 12px 16px;
  resize: vertical;
  line-height: 1.7;
}

.d2-input::placeholder,
.d2-textarea::placeholder {
  color: var(--color-ink3);
  font-size: 13px;
}

.d2-input:focus,
.d2-select:focus,
.d2-textarea:focus {
  border-color: var(--color-blue);
  outline: none;
}

.d2-field-error .d2-input,
.d2-field-error .d2-select,
.d2-field-error .d2-textarea {
  border-color: #b4453a;
}

.d2-error-text {
  color: #b4453a;
  font-size: 12px;
  margin-top: 4px;
}

/* チェックボックス（プライバシーポリシー同意） */
.d2-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-ink2);
  cursor: pointer;
}

.d2-check input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--color-blue);
  flex: 0 0 auto;
  margin: 0;
}

/* 送信ボタン */
.d2-btn {
  display: inline-block;
  background: var(--color-blue);
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  padding: 14px 36px;
  border-radius: 2px;
  border: 0;
  box-shadow: 0 4px 0 var(--color-blue-deep);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.d2-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--color-blue-deep); }

.d2-btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* フラッシュメッセージ */
.d2-alert {
  border-radius: 2px;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 20px;
}

.d2-alert-success {
  background: #eef4ec;
  border: 1px solid #b9cfb2;
  color: #2c5228;
}

.d2-alert-error {
  background: #f9ecea;
  border: 1px solid #dfb4ae;
  color: #8a2f26;
}

/* --- フィルタピル（一覧・FAQカテゴリ） --- */
.d2-pill {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 2px;
  background: #fff;
  color: var(--color-ink2);
  border: 1.5px solid var(--color-line);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.d2-pill.is-active {
  background: var(--color-blue);
  color: #fff;
  border-color: var(--color-blue);
  font-weight: 700;
}

/* --- 新着情報の行（スマホ対応） ---
   モバイル: 日付＋カテゴリを1行目、タイトルを2行目にフル幅で表示（潰れ防止）
   タブレット768px+: 日付 / カテゴリ / タイトル / 矢印 を横1行 */
.d2-news-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 15px 18px;
  border-bottom: 1px dashed var(--color-line);
  text-decoration: none;
  color: inherit;
}

.d2-news-row:last-child { border-bottom: none; }
a.d2-news-row:hover { background: #f7fbff; }

.d2-news-date {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-ink2);
  font-weight: 600;
  white-space: nowrap;
}

.d2-news-cat { flex: 0 0 auto; }

.d2-news-title {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-ink);
  line-height: 1.65;
  width: 100%;            /* モバイルはタイトルを次の行にフル幅で */
}

.d2-news-arrow { display: none; }

@media (min-width: 768px) {
  .d2-news-row { flex-wrap: nowrap; gap: 16px; }
  .d2-news-title { width: auto; flex: 1; font-size: 15px; }
  .d2-news-arrow {
    display: inline;
    color: var(--color-blue);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    flex: 0 0 auto;
  }
}

/* --- FAQ アコーディオン（details/summary版・JS不要） --- */
.d2-faq {
  background: #fff;
  border-radius: 2px;
  padding: 18px 22px;
  border: 1px solid var(--color-line);
  transition: box-shadow .2s;
}

.d2-faq[open] {
  box-shadow: 0 8px 20px rgba(31,79,135,0.08);
}

.d2-faq summary {
  list-style: none;
  cursor: pointer;
}

.d2-faq summary::-webkit-details-marker { display: none; }

.d2-faq-q {
  display: flex;
  align-items: center;
  gap: 14px;
}

.d2-faq-qmark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--color-blue-soft);
  color: var(--color-blue-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.d2-faq-qtext {
  flex: 1;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
}

.d2-faq-toggle-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink2);
  font-size: 14px;
  flex: 0 0 auto;
}

.d2-faq-toggle-icon::before { content: '+'; }
.d2-faq[open] .d2-faq-toggle-icon::before { content: '−'; }

.d2-faq-a {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-line);
}

.d2-faq-amark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--color-yellow-soft);
  color: #a07314;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.d2-faq-atext {
  font-size: 13px;
  color: var(--color-ink2);
  line-height: 1.9;
}

/* --- 印刷 --- */
@media print {
  .no-print { display: none !important; }
}

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

.d2-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.d2-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 14px;
}

@media (min-width: 1024px) {
  .d2-header-inner {
    padding-block: 18px;
    gap: 40px;
  }
}

.d2-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.d2-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
}

@media (min-width: 1024px) {
  .d2-logo-img {
    width: 50px;
    height: 50px;
  }
}

.d2-logo-text { line-height: 1.2; }

.d2-logo-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-ink);
}

@media (min-width: 1024px) {
  .d2-logo-title { font-size: 18px; }
}

.d2-logo-sub {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--color-ink3);
}

.d2-nav-desktop { display: none; }

@media (min-width: 1024px) {
  .d2-nav-desktop {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 28px;
  }
}

.d2-nav-link {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink2);
  position: relative;
  text-decoration: none;
}

.d2-nav-link.is-active {
  color: var(--color-blue);
  font-weight: 700;
}

.d2-nav-dot {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-yellow);
}

.d2-nav-cta {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  background: var(--color-blue);
  color: #fff;
  border-radius: 2px;
  padding: 10px 20px;
  margin-left: 6px;
  box-shadow: 0 3px 0 var(--color-blue-deep);
  text-decoration: none;
}

.d2-burger {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-line);
  border-radius: 2px;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}

@media (min-width: 1024px) {
  .d2-burger { display: none; }
}

.d2-burger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-ink);
  border-radius: 2px;
  transition: transform .18s ease, opacity .18s ease;
}

.d2-burger.is-open .d2-burger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.d2-burger.is-open .d2-burger-bar:nth-child(2) { opacity: 0; }
.d2-burger.is-open .d2-burger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.d2-mobile-menu {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-line);
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease;
}

.d2-mobile-menu.is-open {
  max-height: 480px;
}

@media (min-width: 1024px) {
  .d2-mobile-menu { display: none !important; }
}

.d2-mobile-nav {
  display: flex;
  flex-direction: column;
  padding-block: 8px 18px;
  gap: 2px;
}

.d2-mobile-link {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-ink2);
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px dashed var(--color-line);
}

.d2-mobile-link.is-active {
  color: var(--color-blue);
  font-weight: 700;
}

.d2-mobile-cta {
  margin-top: 14px;
  text-align: center;
  background: var(--color-blue);
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 2px;
  box-shadow: 0 4px 0 var(--color-blue-deep);
  text-decoration: none;
}

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

.d2-footer {
  background: var(--color-ink);
  color: #bcc4d0;
  padding-block: 40px 24px;
  margin-top: 40px;
}

.d2-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid #3a4555;
}

@media (min-width: 768px) {
  .d2-footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

@media (min-width: 1024px) {
  .d2-footer-grid {
    grid-template-columns: 1.8fr 1fr 1fr;
    gap: 40px;
  }
}

.d2-footer-brand { grid-column: 1 / -1; }

@media (min-width: 1024px) {
  .d2-footer-brand { grid-column: auto; }
}

.d2-footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  text-decoration: none;
  color: inherit;
}

.d2-footer-mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.d2-footer-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.d2-footer-addr {
  margin: 0;
  font-size: 12px;
  line-height: 1.9;
}

.d2-footer-coltitle {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--color-yellow);
  margin-bottom: 12px;
  font-weight: 700;
}

.d2-footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 2.1;
}

.d2-footer-list a {
  color: inherit;
  text-decoration: none;
}

.d2-footer-list a:hover { text-decoration: underline; }

.d2-footer-bottom {
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #7d8896;
}

.d2-footer-bottom a {
  color: inherit;
  text-decoration: none;
}

.d2-footer-bottom a:hover { text-decoration: underline; }

@media (min-width: 768px) {
  .d2-footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ============================================================
   ListRow — 横長セミナー行（一覧ページ）
   ============================================================ */

.d2-row {
  background: var(--color-surface);
  border-radius: 2px;
  border: 1px solid var(--color-line);
  box-shadow: 0 2px 0 rgba(31, 79, 135, 0.04), 0 8px 18px rgba(31, 79, 135, 0.05);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .d2-row {
    grid-template-columns: 120px 156px 1fr auto;
    align-items: stretch;
  }
}

.d2-row-date {
  background: var(--color-blue-soft);
  padding: 14px 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  border-bottom: 1px dashed var(--color-line);
}

@media (min-width: 1024px) {
  .d2-row-date {
    flex-direction: column;
    gap: 0;
    padding: 18px 12px;
    border-bottom: none;
    border-right: 1px dashed var(--color-line);
  }
}

.d2-row-date-ym {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--color-blue-deep);
  font-weight: 600;
}

.d2-row-date-day {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--color-blue-deep);
  line-height: 1;
}

@media (min-width: 1024px) {
  .d2-row-date-day { font-size: 46px; }
}

.d2-row-date-dow {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-blue-deep);
}

.d2-row-date-time {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--color-ink2);
}

.d2-row-instructor {
  padding: 16px 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  background: var(--color-bg);
  border-bottom: 1px dashed var(--color-line);
}

@media (min-width: 1024px) {
  .d2-row-instructor {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-bottom: none;
    border-right: 1px dashed var(--color-line);
  }
}

.d2-row-instructor-text { line-height: 1.3; }

@media (min-width: 1024px) {
  .d2-row-instructor-text { text-align: center; }
}

.d2-row-instructor-label {
  font-size: 10px;
  color: var(--color-ink3);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.d2-row-instructor-name {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ink);
}

.d2-row-instructor-org {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--color-ink3);
  margin-top: 2px;
}

.d2-row-content {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 1024px) {
  .d2-row-content { padding: 18px 22px; }
}

.d2-row-tags {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.d2-row-soon {
  font-family: var(--font-body);
  font-size: 11px;
  color: #a07314;
  background: var(--color-yellow-soft);
  padding: 3px 10px;
  border-radius: 2px;
  font-weight: 700;
  margin-left: 4px;
}

.d2-row-closed {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--color-ink3);
  background: #eceae1;
  padding: 3px 10px;
  border-radius: 2px;
  font-weight: 700;
  margin-left: 4px;
}

.d2-row-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.4;
}

@media (min-width: 768px) {
  .d2-row-title { font-size: 21px; }
}

.d2-row-summary {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-ink2);
  line-height: 1.7;
}

.d2-row-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-ink3);
  flex-wrap: wrap;
}

.d2-row-action {
  padding: 14px 18px 18px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

@media (min-width: 1024px) {
  .d2-row-action { padding: 18px 22px; }
}

.d2-row-cta {
  background: var(--color-blue);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 2px;
  white-space: nowrap;
  box-shadow: 0 3px 0 var(--color-blue-deep);
  text-decoration: none;
}

/* ============================================================
   特定商取引法ページ・静的コンテンツ用
   ============================================================ */

.d2-legal-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 2px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.9;
}

.d2-legal-table th,
.d2-legal-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
}

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

.d2-legal-table th {
  width: 220px;
  background: var(--color-blue-soft);
  color: var(--color-blue-deep);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .d2-legal-table th,
  .d2-legal-table td {
    display: block;
    width: 100%;
  }
  .d2-legal-table th { border-bottom: none; }
}
