/* ======================================================================
 * 行政書士やまと法務事務所 サイト全体スタイル
 *   - 参照画像（光山行政書士事務所）に近い青系カラー + ヒーロー曲線
 *   - レスポンシブ: 1024px / 768px / 480px でレイアウト切替
 * ====================================================================== */

:root {
  --color-primary:        #1e3a8a;   /* ディープブルー（ヘッダー文字 / 見出し） */
  --color-primary-dark:   #0f1e54;
  --color-primary-light:  #2563eb;
  --color-hero-bg:        #1e40af;   /* ヒーロー背景 */
  --color-accent:         #3b82f6;
  --color-cta-bg:         #4b5e9d;   /* Work With Us ボタン */
  --color-bg:             #ffffff;
  --color-bg-alt:         #f5f7fb;
  --color-text:           #0f172a;
  --color-text-muted:     #475569;
  --color-border:         #e5e7eb;
  --color-on-primary:     #ffffff;

  --header-height: 84px;
  --container-max: 1240px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-soft: 0 8px 24px rgba(15, 30, 84, 0.08);
  --shadow-card: 0 2px 12px rgba(15, 30, 84, 0.06);
}

/* ---------- Reset / Base ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, -apple-system, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* 子要素のはみ出しでページ全体に横スクロールが出ると Android Chrome で
     sticky header が横にずれて見える。clip は hidden と違い新しい scroll
     container を作らないので、sticky を壊さずに横あふれだけ抑制できる。 */
  overflow-x: clip;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-primary-light); }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }

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

/* ---------- Header ------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.15rem;
}
.brand-mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 40px; height: 40px;
  color: var(--color-primary);
}
.nav-toggle svg { width: 28px; height: 28px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.main-nav a {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}
.main-nav a:hover,
.main-nav a.active {
  border-bottom-color: var(--color-primary-light);
}
.main-nav .has-submenu {
  position: relative;
}
.main-nav .submenu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 12px 0;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.main-nav .has-submenu:hover .submenu,
.main-nav .has-submenu:focus-within .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.main-nav .submenu a {
  display: block;
  padding: 8px 20px;
  border-bottom: 0;
}
.main-nav .submenu a:hover {
  background: var(--color-bg-alt);
}

.cta-button {
  background: var(--color-cta-bg);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  /* ボタン内テキストの折り返し禁止（Android で「ご相談はこちら」等が
     ボタン内で改行されてしまうのを防ぐ） */
  white-space: nowrap;
  transition: background-color 0.15s, transform 0.15s;
}
.cta-button:hover {
  background: var(--color-primary-dark);
  color: #fff;
}
.cta-button.outline {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}
.cta-button.outline:hover {
  background: var(--color-primary);
  color: #fff;
}
.cta-button.light {
  background: #fff;
  color: var(--color-primary);
}
.cta-button.light:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
}

/* ---------- Hero -------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--color-hero-bg);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.hero::after {
  /* 右下の白い曲線 */
  content: "";
  position: absolute;
  inset: auto -10% -45% -10%;
  height: 70%;
  background: #fff;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  z-index: 0;
}
.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
  padding-top: 80px;
  padding-bottom: 200px;
}
.hero h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin-bottom: 36px;
}
.hero p.lead {
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 36px;
  max-width: 36em;
  color: rgba(255, 255, 255, 0.92);
}
.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.hero-image-circle {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #93c5fd, #60a5fa);
  border-radius: 50%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.hero-image-circle svg {
  width: 90%;
  height: auto;
  margin-bottom: -2%;
}

/* ---------- Service Grid (Home) ----------------------------------------- */
.service-grid {
  margin-top: -120px;
  position: relative;
  z-index: 2;
  padding-bottom: 80px;
}
.service-grid .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.service-card {
  /* background: #fff; */
  text-align: center;
  padding: 24px 20px;
}
.service-card-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 16px;
  background: #dbeafe;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-light);
}
.service-card-icon svg { width: 52px; height: 52px; }
.service-card h3 {
  color: var(--color-primary);
  font-size: 1.25rem;
  font-weight: 700;
}

/* ---------- Generic Section --------------------------------------------- */
.section {
  padding: 80px 0;
}
.section.alt {
  background: var(--color-bg-alt);
}
.section h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  color: var(--color-primary);
  font-weight: 800;
  margin-bottom: 12px;
  text-align: center;
}
.section .subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 48px;
}

/* ---------- Page Hero (sub pages) --------------------------------------- */
.page-hero {
  background: var(--color-hero-bg);
  color: #fff;
  padding: 64px 0 80px;
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 8px;
}
.page-hero p {
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Office Info (about) ----------------------------------------- */
.office-info-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: start;
}
.office-info-grid h3 {
  color: var(--color-primary);
  font-size: 1.4rem;
  margin-bottom: 16px;
  font-weight: 700;
}
.office-detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.office-detail-list li {
  display: grid;
  grid-template-columns: 8em 1fr;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}
.office-detail-list .label {
  color: var(--color-text-muted);
  font-weight: 600;
}
.greeting-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.greeting-card p {
  margin-bottom: 1em;
}
.greeting-card .signature {
  text-align: right;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 1em;
}

/* ---------- Services list ----------------------------------------------- */
.services-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.services-list .service-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.services-list .service-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.services-list .service-item .icon {
  width: 64px; height: 64px;
  background: #dbeafe;
  color: var(--color-primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.services-list .service-item .icon svg { width: 34px; height: 34px; }
.services-list .service-item h3 {
  color: var(--color-primary);
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.services-list .service-item p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ---------- Pricing table ----------------------------------------------- */
/* テーブルが横にあふれる場合はラッパー内だけで横スクロールさせ、
   ページ全体（= sticky header の親）が横にあふれないようにする */
.pricing-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.pricing-table thead {
  background: var(--color-primary);
  color: #fff;
}
.pricing-table th,
.pricing-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.pricing-table th { font-weight: 700; }
.pricing-table tbody tr:last-child td { border-bottom: 0; }
.pricing-table tbody tr:nth-child(even) { background: var(--color-bg-alt); }
.pricing-table td.amount {
  text-align: right;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}
.pricing-note {
  margin-top: 16px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* ---------- News list --------------------------------------------------- */
.news-list {
  max-width: 880px;
  margin: 0 auto;
}
.news-item {
  display: grid;
  grid-template-columns: 9em 7em 1fr;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
  align-items: baseline;
}
.news-item .date {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.news-item .category {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  background: #dbeafe;
  color: var(--color-primary);
}
.news-item .category.subsidy { background: #fef3c7; color: #92400e; }
.news-item .category.immigration { background: #dcfce7; color: #166534; }

/* ---------- Blog -------------------------------------------------------- */
/* カテゴリフィルタ (一覧画面) */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}
.blog-filter {
  background: #fff;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.blog-filter:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
}
.blog-filter.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* 一覧グリッド */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  color: inherit;
}
.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--color-primary-light);
  color: inherit;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.blog-card-date {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.blog-card-category {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #dbeafe;
  color: var(--color-primary);
}
.blog-card-category.subsidy      { background: #fef3c7; color: #92400e; }
.blog-card-category.immigration  { background: #dcfce7; color: #166534; }
.blog-card-category.construction { background: #fee2e2; color: #991b1b; }
.blog-card-category.inheritance  { background: #ede9fe; color: #5b21b6; }
.blog-card-category.law          { background: #cffafe; color: #155e75; }
.blog-card-category.incorporation { background: #e0e7ff; color: #3730a3; }
.blog-card-title {
  color: var(--color-primary);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 12px;
}
.blog-card-excerpt {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.75;
  flex: 1;
  margin-bottom: 16px;
}
.blog-card-more {
  color: var(--color-primary-light);
  font-size: 0.9rem;
  font-weight: 700;
  align-self: flex-start;
}

/* 詳細画面 */
.blog-post-section {
  background: var(--color-bg-alt);
}
.blog-post-container {
  max-width: 780px;
}
.blog-back {
  display: inline-block;
  color: var(--color-primary-light);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 24px;
}
.blog-post {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
}
.blog-post-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 24px;
  margin-bottom: 32px;
}
.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.blog-post-author {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.blog-post-title {
  color: var(--color-primary);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  line-height: 1.4;
}
.blog-post-content {
  color: var(--color-text);
  line-height: 1.95;
  font-size: 1rem;
}
.blog-post-content h2 {
  color: var(--color-primary);
  font-size: 1.3rem;
  font-weight: 800;
  margin: 2em 0 0.8em;
  padding-bottom: 0.4em;
  border-bottom: 2px solid var(--color-primary-light);
}
.blog-post-content h3 {
  color: var(--color-primary);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.6em 0 0.6em;
}
.blog-post-content p {
  margin: 0 0 1em;
}
.blog-post-content ul,
.blog-post-content ol {
  padding-left: 1.4em;
  margin: 0 0 1.2em;
}
.blog-post-content li {
  margin-bottom: 0.4em;
}
.blog-post-content strong {
  color: var(--color-primary);
  font-weight: 700;
}
.blog-post-content a {
  color: var(--color-primary-light);
  text-decoration: underline;
}
.blog-post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

/* ---------- Contact form ----------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.contact-info dl {
  margin: 0;
}
.contact-info dt {
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 16px;
}
.contact-info dd {
  margin: 4px 0 0;
  color: var(--color-text-muted);
}
.contact-form {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--color-border);
}
.form-row {
  margin-bottom: 18px;
}
.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--color-text);
}
.form-row label .req { color: #dc2626; margin-left: 4px; }
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-row textarea { min-height: 140px; resize: vertical; }
.form-submit {
  margin-top: 8px;
}
.form-message {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  display: none;
}
.form-message.success {
  background: #dcfce7;
  color: #166534;
  display: block;
}
.form-message.error {
  background: #fee2e2;
  color: #991b1b;
  display: block;
}

/* ---------- Footer ------------------------------------------------------ */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 56px 0 32px;
}
.site-footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}
.site-footer h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 16px;
  font-weight: 700;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer ul li {
  margin: 6px 0;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.92rem;
}
.site-footer a:hover { color: #fff; }
.site-footer .copyright {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Responsive -------------------------------------------------- */
@media (max-width: 1024px) {
  .service-grid .container { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .services-list { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --header-height: 64px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .main-nav {
    position: absolute;
    top: var(--header-height);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s;
  }
  .main-nav.open { max-height: 80vh; }
  .main-nav > a, .main-nav > .has-submenu > a {
    padding: 12px 24px;
    width: 100%;
  }
  .main-nav .submenu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: 0;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
    padding-left: 16px;
  }
  .site-header .cta-button { display: none; }

  .hero .container {
    grid-template-columns: 1fr;
    padding-top: 48px;
    padding-bottom: 140px;
    text-align: left;
  }
  .hero-image { display: none; }
  /* モバイルでは 2 つの CTA ボタンを必ず 1 行に収める（縦スタックさせない） */
  .hero-buttons {
    flex-wrap: nowrap;
    gap: 12px;
    position: relative;
    z-index: 2;
  }
  .hero-buttons .cta-button {
    flex: 1 1 0;
    padding: 10px 12px;
    font-size: 0.95rem;
    justify-content: center;
  }
  /* モバイルでの hero 下部の白いカーブ:
     - 左右の -10% 延長を無くして viewport から食み出さないように
     - 高さを小さくして、ボタンと重ならないようにする */
  .hero::after {
    inset: auto 0 -35% 0;
    height: 45%;
  }

  .service-grid { margin-top: -40px; }

  .office-info-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .site-footer .container { grid-template-columns: 1fr; gap: 28px; }

  /* ブログ詳細のパディング縮小 */
  .blog-post { padding: 24px 20px; }
  .blog-post-footer { flex-direction: column; align-items: stretch; }
  .blog-post-footer .cta-button { justify-content: center; }
}

@media (max-width: 480px) {
  .service-grid .container { grid-template-columns: 1fr; }
  .news-item { grid-template-columns: 1fr; gap: 4px; }
  .pricing-table th, .pricing-table td { padding: 10px 12px; font-size: 0.92rem; }
}
