/* WordPress-specific overrides */

/* プロポーショナルメトリクス（日本語カーニング改善）+ 最低限のレタースペーシング */
* {
  font-feature-settings: "palt";
  letter-spacing: 0.08em;
}

/* WP admin bar fix */
body.admin-bar #site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar #site-header {
    top: 46px;
  }
}

/* WP block editor alignment */
.aligncenter { display: block; margin: 0 auto; }
.alignleft { float: left; margin-right: 1.5rem; margin-bottom: 1rem; }
.alignright { float: right; margin-left: 1.5rem; margin-bottom: 1rem; }

.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.85rem; color: #666; text-align: center; margin-top: 0.5rem; }

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

/* Pagination styles */
.nav-links {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.nav-links a,
.nav-links span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-links a {
  background: #fff;
  color: #1A3A5C;
  border: 1px solid #e0dcd4;
}

.nav-links a:hover {
  background: #1A3A5C;
  color: #fff;
  border-color: #1A3A5C;
}

.nav-links .current {
  background: #1A3A5C;
  color: #fff;
}

/* Container override - match original site's custom container (1280px at lg+) */
@media (min-width: 1024px) {
  .container {
    max-width: 1280px !important;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Dropdown animation */
#practice-dropdown-menu {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: block !important;
}

#practice-dropdown-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#dropdown-chevron {
  transition: transform 0.25s ease;
}

/* Fix for WordPress default styles */
a { text-decoration: none; }

/* Blog article list spacing */
.blog-article-list > article {
  padding-top: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e5e7eb;
}

.blog-article-list > article:first-child {
  padding-top: 0;
}

.blog-article-list > article:last-child {
  border-bottom: none;
}

/* ============================================
   記事本文コンテンツ (.entry-content)
   ============================================ */
.entry-content {
  color: #4a4a4a;
  font-size: 1rem;
  line-height: 1.9;
}

/* --- 見出し共通 --- */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  color: #1A3A5C;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  line-height: 1.4;
}

/* h1 */
.entry-content h1 {
  font-size: 1.75rem;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #A0780A;
}

/* h2 */
.entry-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.625rem;
  padding-left: 0.75rem;
  border-bottom: 2px solid #A0780A;
  border-left: 4px solid #A0780A;
}

/* h3 */
.entry-content h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
  border-left: 4px solid #A0780A;
}

/* h4 */
.entry-content h4 {
  font-size: 1.125rem;
  margin-top: 1.75rem;
  margin-bottom: 0.625rem;
  padding-left: 0.75rem;
  border-left: 3px solid #c4c4c4;
}

/* h5 */
.entry-content h5 {
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #2d4a6f;
}

/* h6 */
.entry-content h6 {
  font-size: 0.9rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #5a6a7a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- 本文テキスト --- */
.entry-content p {
  margin-bottom: 1.5rem;
  line-height: 1.9;
}

.entry-content p:last-child {
  margin-bottom: 0;
}

/* --- 箇条書きリスト --- */
.entry-content ul {
  margin: 1.25rem 0;
  padding-left: 0;
  list-style: none;
}

.entry-content ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.625rem;
  line-height: 1.8;
}

.entry-content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #A0780A;
}

/* ネストされたリスト */
.entry-content ul ul {
  margin: 0.5rem 0;
}

.entry-content ul ul li::before {
  background: transparent;
  border: 2px solid #A0780A;
  width: 6px;
  height: 6px;
}

/* --- 番号付きリスト --- */
.entry-content ol {
  margin: 1.25rem 0;
  padding-left: 0;
  list-style: none;
  counter-reset: ol-counter;
}

.entry-content ol li {
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: 0.625rem;
  line-height: 1.8;
  counter-increment: ol-counter;
}

.entry-content ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #1A3A5C;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
}

.entry-content ol ol {
  margin: 0.5rem 0;
  counter-reset: ol-sub-counter;
}

.entry-content ol ol li {
  counter-increment: ol-sub-counter;
}

.entry-content ol ol li::before {
  content: counter(ol-sub-counter);
  background: transparent;
  border: 2px solid #1A3A5C;
  color: #1A3A5C;
}

/* --- リンクテキスト --- */
.entry-content a {
  color: #A0780A;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(160, 120, 10, 0.3);
  transition: color 0.3s, text-decoration-color 0.3s;
}

.entry-content a:hover {
  color: #8A6808;
  text-decoration-color: #8A6808;
}

/* --- 引用 --- */
.entry-content blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: #F5F3F0;
  border-left: 4px solid #A0780A;
  color: #555;
  font-style: normal;
}

.entry-content blockquote p:last-child {
  margin-bottom: 0;
}

/* --- 画像 --- */
.entry-content img {
  margin: 1.5rem 0;
  max-width: 100%;
  height: auto;
}

/* --- テーブル --- */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.entry-content th {
  background: #F5F3F0;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #1A3A5C;
  border: 1px solid #e0dcd4;
}

.entry-content td {
  padding: 0.75rem;
  border: 1px solid #e0dcd4;
}

/* --- 水平線 --- */
.entry-content hr {
  margin: 2.5rem 0;
  border: none;
  border-top: 1px solid #e0dcd4;
}

/* --- コード --- */
.entry-content code {
  background: #F5F3F0;
  padding: 0.2rem 0.4rem;
  font-size: 0.875rem;
  color: #1A3A5C;
  border-radius: 3px;
}

.entry-content pre {
  background: #1A3A5C;
  color: #e0e8f0;
  padding: 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  border-radius: 4px;
}

.entry-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* ============================================
   ページ遷移プログレスバー
   ============================================ */

#page-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: #A0780A;
  z-index: 99999;
  transition: width 0.1s ease;
  pointer-events: none;
}

#page-progress.is-loading {
  animation: page-progress-run 1.2s ease-in-out forwards;
}

@keyframes page-progress-run {
  0%   { width: 0%; opacity: 1; }
  60%  { width: 85%; }
  100% { width: 95%; }
}

/* ============================================
   全画面モバイルドロワー
   ============================================ */

#mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #1A3A5C;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
}

#mobile-nav.is-open {
  transform: translateX(0);
  visibility: visible;
}

/* ============================================
   全体的な余白の改善
   ============================================ */

/* セクション上下余白を拡大（モバイル） */
.section-padding {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

/* セクション上下余白を拡大（デスクトップ） */
@media (min-width: 1024px) {
  .section-padding {
    padding-top: 7rem;
    padding-bottom: 7rem;
  }
}

/* 取扱業務詳細：セクション余白（コンパクト） */
.page-template-page-practice-area-detail .section-padding {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
@media (min-width: 1024px) {
  .page-template-page-practice-area-detail .section-padding {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

/* 取扱業務詳細：セクション間の視覚的区切り */
.page-template-page-practice-area-detail section.bg-white {
  border-top: none;
}
.page-template-page-practice-area-detail section.bg-\[#F5F3F0\] {
  border-top: none;
}

/* 取扱業務詳細：リスト項目の行間 */
.page-template-page-practice-area-detail ul li,
.page-template-page-practice-area-detail ol li {
  margin-bottom: 0.875rem;
  line-height: 1.9;
}

/* 取扱業務詳細：サブセクション間の余白 */
.page-template-page-practice-area-detail .space-y-8 > div + div {
  margin-top: 3rem;
}

/* 取扱業務詳細：h2見出し下余白 */
.page-template-page-practice-area-detail h2 {
  margin-bottom: 2rem;
}

/* 取扱業務詳細：h3見出し上下余白 */
.page-template-page-practice-area-detail h3 {
  margin-bottom: 1.25rem;
}

/* 取扱業務一覧：カードグリッドのギャップ拡大 */
.page-template-page-practice-areas .grid {
  gap: 1.75rem;
}

/* フロントページ・各ページ：グリッドカードのギャップ */
.front-page .grid,
.page .grid {
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .front-page .grid,
  .page .grid {
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .front-page .grid,
  .page .grid {
    gap: 1.5rem;
  }
}

/* フッター上部との余白 */
footer {
  margin-top: 0;
}

/* テーブル内セルの余白拡大 */
.page-template-page-practice-area-detail table td,
.page-template-page-practice-area-detail table th {
  padding: 1rem 1.25rem;
}

/* お悩みセクションのグリッドアイテム余白 */
.page-template-page-practice-area-detail .grid.gap-4 {
  gap: 1.25rem;
}

/* ブログ・ニュース記事一覧の余白 */
.blog-article-list > article {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

/* ============================
   固定ヘッダーの高さオフセット
   ============================ */
#main-content {
  /* モバイル: トップバーなし、ナビのみ約64px */
  padding-top: 64px;
}
@media (min-width: 1024px) {
  #main-content {
    /* デスクトップ: トップバー(40px) + ナビ(80px) = 120px */
    padding-top: 120px;
  }
}

/* ============================
   ページヘッダー（紺色MV）
   ヘッダーoffset分の余白を吸収して
   ナビとMVの間のすき間をなくす
   ============================ */
.page-hero-header {
  /* モバイル: offset(64px) + 上部余白(4rem) */
  margin-top: -64px;
  padding-top: calc(64px + 4rem);
  padding-bottom: 4rem;
}
@media (min-width: 1024px) {
  .page-hero-header {
    /* PC: offset(120px) + 上部余白(5rem) */
    margin-top: -120px;
    padding-top: calc(120px + 5rem);
    padding-bottom: 5rem;
  }
}

/* ============================
   強みセクション: アイコンボックス
   ============================ */
/* ============================
   顧問契約プランカード: モバイル余白
   ============================ */
/* PC: margin-bottomを打ち消す */
@media (min-width: 768px) {
  .plan-grid > div {
    margin-bottom: 0 !important;
  }
}

/* ============================
   強みセクション: アイコンボックス
   ============================ */
/* モバイル: 横幅いっぱい、アイコンセンタリング */
.strength-icon-wrap {
  width: 100%;
  padding: 1.5rem 0;
}
/* PC: 正方形の小ボックスに戻す */
@media (min-width: 768px) {
  .strength-icon-wrap {
    width: 3rem;
    height: 3rem;
    padding: 0;
    margin-bottom: 1rem;
  }
}

/* ============================
   顧問契約プラングリッド: レスポンシブ
   ============================ */
/* モバイル: 1列 */
.plan-row-3,
.plan-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
/* PC: 3列 / 2列 */
@media (min-width: 768px) {
  .plan-row-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .plan-row-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   Contact Form 7 カスタムスタイル
   ============================================ */

.wpcf7 form .cf7-field-group {
  margin-bottom: 1.5rem;
}

/* ラベル */
.wpcf7 form label,
.wpcf7 form .cf7-field-group > label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1A3A5C;
  margin-bottom: 0.4rem;
}

/* 必須マーク */
.wpcf7 form .required {
  color: #ef4444;
  margin-left: 0.25rem;
}

/* テキスト・メール・電話入力 */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 select,
.wpcf7 textarea {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  font-size: 0.875rem;
  color: #111827;
  background: #fff;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
  border-color: #A0780A;
  box-shadow: 0 0 0 2px rgba(160,120,10,0.1);
}

/* セレクトボックス用矢印 */
.wpcf7 select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231A3A5C' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* テキストエリア */
.wpcf7 textarea {
  min-height: 9rem;
  resize: vertical;
}

/* 同意チェックボックス */
.wpcf7 .cf7-checkbox-group .wpcf7-acceptance {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #4b5563;
  cursor: pointer;
}
.wpcf7 .cf7-checkbox-group .wpcf7-acceptance input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: #A0780A;
}
.wpcf7 .cf7-checkbox-group a {
  color: #A0780A;
  text-decoration: underline;
}

/* 送信ボタン */
.wpcf7 input[type="submit"] {
  display: block;
  width: 100%;
  padding: 1rem 2rem;
  background: #A0780A;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 0;
  margin-top: 0.5rem;
  letter-spacing: 0.1em;
}
.wpcf7 input[type="submit"]:hover {
  background: #8A6808;
}

/* バリデーションエラーメッセージ */
.wpcf7 .wpcf7-not-valid-tip {
  display: block;
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 0.25rem;
}
.wpcf7 input.wpcf7-not-valid,
.wpcf7 select.wpcf7-not-valid,
.wpcf7 textarea.wpcf7-not-valid {
  border-color: #ef4444;
}

/* レスポンスメッセージ */
.wpcf7 .wpcf7-response-output {
  margin-top: 1.25rem;
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  border: none !important;
  border-radius: 0;
}
.wpcf7 .wpcf7-mail-sent-ok {
  background: #f0fdf4;
  color: #166534;
}
.wpcf7 .wpcf7-validation-errors,
.wpcf7 .wpcf7-spam-blocked {
  background: #fef2f2;
  color: #991b1b;
}
