/* ==========================================================================
   Mokuren Seisakusho CSS
   ========================================================================== */

/* Google Fonts からのフォントインポート（和風・ナチュラルなテイストに合うフォント） */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Zen+Maru+Gothic:wght@400;500;700&family=Yuji+Syuku&display=swap');

:root {
  --bg-color: #f1f0ea;       /* 画像の背景に合わせた温かみのある淡いグレーベージュ */
  --text-main: #332d29;      /* 深みのあるダークブラウン */
  --accent-color: #8b5a2b;   /* 木の温もりを感じるブラウン */
  --debug-border: rgba(239, 68, 68, 0.8);
  --debug-bg: rgba(239, 68, 68, 0.15);
  --font-base: 'Noto Sans JP', sans-serif;
  --font-title: 'Zen Maru Gothic', sans-serif;
}

/* リセット & ベーススタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-base);
  color: var(--text-main);
  background-color: var(--bg-color);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 視覚的隠しクラス（スクリーンリーダー用） */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   TOPページ全画面レイアウト (index.html)
   ========================================================================== */

.app-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-color);
  overflow: hidden;
}

/* 画像のアスペクト比(16:9)を厳密に維持するステージ */
.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

/* 画面のアスペクト比に応じた伸縮制御 */
@media (min-aspect-ratio: 16/9) {
  .stage {
    height: 100vh;
    width: auto;
  }
}

@media (max-aspect-ratio: 16/9) {
  .stage {
    width: 100vw;
    height: auto;
  }
}

.bg-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none; /* ユーザーの右クリック・ドラッグによるズレを防ぐ */
  user-select: none;
}

/* 絶対配置のリンクエリアベース */
.link-area {
  position: absolute;
  display: block;
  z-index: 10;
  border-radius: 12px;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

/* ホバー時のプレミアムなインタラクション */
.link-area:hover {
  background-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(139, 90, 43, 0.08);
  transform: scale(1.02);
}

/* アクティブ（クリック時） */
.link-area:active {
  transform: scale(0.98);
}

/* 各メニューの仮の％座標（画像サイズ 1920x1080 に基づく） */
.area-company {
  left: 45.5%;
  top: 30.5%;
  width: 15%;
  height: 12%;
}

.area-works {
  left: 51.5%;
  top: 52%;
  width: 14%;
  height: 12%;
}

.area-contact {
  left: 50.5%;
  top: 73.5%;
  width: 14%;
  height: 13%;
}

.area-about {
  left: 76%;
  top: 41.5%;
  width: 15.5%;
  height: 13%;
}

.area-blog {
  left: 74.5%;
  top: 61%;
  width: 12%;
  height: 16.5%;
}

.area-voice {
  left: 76.5%;
  top: 83%;
  width: 12%;
  height: 13%;
}

/* ==========================================================================
   デバッグモード (開発時リンク調整用)
   ========================================================================== */

.debug-mode .link-area {
  border: 2px dashed var(--debug-border) !important;
  background-color: var(--debug-bg) !important;
}

/* デバッグ表示の時だけ、リンクの上にラベルをうっすら表示 */
.debug-mode .link-area::after {
  content: attr(title);
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
}

.debug-control {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 16px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  z-index: 100;
  transition: opacity 0.3s ease;
}

.debug-control:hover {
  background: rgba(255, 255, 255, 0.95);
}

.debug-label {
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.debug-label input {
  cursor: pointer;
}

/* ==========================================================================
   下層ページ共通スタイル
   ========================================================================== */

.sub-page {
  padding: 40px 20px 80px;
  max-width: 1000px;
  margin: 0 auto;
}

.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(139, 90, 43, 0.15);
  margin-bottom: 40px;
}

.logo-text {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 20px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.nav-link:hover {
  color: var(--accent-color);
}

.page-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  margin-bottom: 24px;
  color: var(--accent-color);
  position: relative;
  padding-bottom: 10px;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 2px;
}

.content-box {
  background: #ffffff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(139, 90, 43, 0.05);
  line-height: 1.8;
}

.content-box h2 {
  font-size: 1.4rem;
  margin: 30px 0 15px;
  color: var(--accent-color);
}

.content-box h2:first-of-type {
  margin-top: 0;
}

.content-box p {
  margin-bottom: 20px;
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  text-decoration: none;
  color: var(--accent-color);
  font-weight: 500;
  transition: transform 0.2s;
}

.back-home:hover {
  transform: translateX(-4px);
}

/* 下層ページ専用の背景パターン設定 */
.sub-page-body {
  background-image: url('images/sub_bg.png');
  background-repeat: repeat;
  background-size: 320px auto; /* パターンの大きさを程よいサイズに調整 */
  background-attachment: fixed; /* スクロール時に背景を固定してプレミアム感を演出 */
  font-family: 'Yuji Syuku', serif; /* 下層ページ全体のベースフォントを毛筆体に統一 */
  font-size: 1.05rem; /* 毛筆体の細身な線の可読性を上げるため、全体的に少しサイズアップ */
  line-height: 1.8;
}

/* 毛筆風・手書き風フォント（タイトルや見出し用） */
.font-brush {
  font-family: 'Yuji Syuku', serif;
  font-weight: 400;
  letter-spacing: 0.05em;
}

/* 施工例詳細ページ用の追加スタイル */
.works-detail-info {
  margin: 30px 0;
  border-collapse: collapse;
  width: 100%;
  max-width: 700px; /* PCでは幅を700pxに広げてゆとりを持たせる */
  font-family: 'Yuji Syuku', serif; /* テーブル内も毛筆風フォントを適用 */
}

.works-detail-info td {
  padding: 8px 12px;
  font-size: 1rem; /* 毛筆風フォントに合わせて少し大きめに調整 */
  vertical-align: top; /* 上揃えにしてバランスを整える */
}

.works-detail-info td.label {
  font-weight: 700;
  color: var(--accent-color);
  width: 250px; /* スラッシュ改行を防ぐため幅を250pxに拡張 */
  white-space: nowrap; /* テキストの折り返しを禁止 */
}

.works-desc-text {
  font-family: 'Yuji Syuku', serif; /* 説明文にも毛筆風フォントを適用 */
  font-size: 1.15rem; /* 読みやすさを考慮して文字サイズを少しアップ */
  line-height: 2.2; /* 行間にゆとりを持たせる */
  margin-bottom: 40px;
  color: var(--text-main);
  white-space: pre-line; /* 改行を反映 */
}

.works-gallery-section {
  margin-top: 50px;
}

.works-gallery-title {
  font-size: 1.8rem;
  margin-bottom: 24px;
  color: var(--text-main);
  border-bottom: 1px solid rgba(139, 90, 43, 0.15);
  padding-bottom: 8px;
}

/* 完成後：横2カラムグリッド（上部）と縦長3カラムグリッド（下部） */
.gallery-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.gallery-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

/* 工事前・工事中：横3カラムグリッド */
.gallery-grid-3col-standard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 30px;
}

.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(139, 90, 43, 0.08);
  background: #fcfcf9;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item.aspect-3-2 {
  aspect-ratio: 3 / 2;
}

.gallery-item.aspect-2-3 {
  aspect-ratio: 2 / 3;
}

@media (max-width: 768px) {
  .gallery-grid-2col, 
  .gallery-grid-3col, 
  .gallery-grid-3col-standard {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .gallery-item.aspect-2-3 {
    aspect-ratio: 3 / 2; /* モバイルでは縦長も横長にして見やすくする */
  }

  /* テーブルのスマホ表示調整 (縦並び化) */
  .works-detail-info tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    border-bottom: 1px dashed rgba(139, 90, 43, 0.15);
    padding-bottom: 8px;
  }
  .works-detail-info tr:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .works-detail-info td {
    padding: 2px 4px;
  }
  .works-detail-info td.label {
    width: 100%;
    white-space: normal; /* スマホでは改行を許可 */
    padding-bottom: 2px;
  }
}

