/* ==========================================
   RESET & BASE
========================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root{
  --container: 840px;
  --container-wide: 1200px;

  /* ★追加 */
  --header-height: 160px;
}

html, body {
  font-family: Helvetica, '游ゴシック', 'Yu Gothic', YuGothic, HiraKakuProN-W3, 'メイリオ', Meiryo, sans-serif;
  font-size: 14px;
  color: #333;
  line-height: 1.9;
  background: #fff;
  -webkit-text-size-adjust: 100%;
}

/* ==========================================
   CONTAINER
========================================== */

.container {
  width: 90%;
  max-width: var(--container);
  margin: auto;
}

/* ==========================================
   HEADER
========================================== */

.header {
  width: 100%;
  background: #fff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: block;
}

.header-main-row {
  display: flex;
  align-items: center;
  height: 120px;
  width: 100%;
}

/* 2段目：時代ナビ（存在する場合のみ表示） */
.era-nav {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding-bottom: 12px; /* 下側の余白 */
  /* ここで高さを確保。文字がなければ高さは0になります */
}

.era-nav a {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  color: #3b3b3b;
  text-decoration: none;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.logo img {
  height: 48px;
  width: auto;
}

/* nav */
.gnav {
  margin-left: auto;
}

.gnav ul {
  display: flex;
  list-style: none;
}

.gnav li {
  margin-left: 24px;
}

.gnav a {
  text-decoration: none;
  color: #3b3b3b;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 6px;
  display: inline-block;
}

.gnav a.active,
.footer a.active {
  color: #d0d0d0;
  pointer-events: none;
}

.gnav a:hover {
  opacity: 0.6;
}

/* language */
.lang-switch {
  margin-left: 36px;
  font-size: 13px;
}

.lang-switch .lang {
  color: #000 !important;
  padding: 2px 4px;
}

.lang-switch .active {
  font-weight: 700;
  border-bottom: 1px solid #000;
}

.lang-sep {
  margin: 0 2px;
}

/* ==========================================
   HERO
/*========================================== */

.hero {
	width: 100vw;
	height: 40vh;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	margin-top: 0px;
	min-height: 320px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
	width: 100%;
	position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(0,0,0,0.2),
      rgba(0,0,0,0.55)
    ),
    url("../images/honden.jpg") center/cover no-repeat;
}

.hero-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
}

.hero-title {
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.hero-sub {
  font-size: 1.2rem;
  margin-top: 12px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

/* ==========================================
   COMMON SECTIONS
========================================== */

.section {
  padding: 80px 0;
  text-align: center;
}

.section-title {
  font-family: 'Lato', sans-serif;
  font-size: 40px;
  font-weight: 250;
}

/* Origin */
.engi-text {
  max-width:780px;
  margin: 0 auto;
  text-align:left;
  line-height:1.8;
  color:#3b3b3b;
  white-space:pre-line;
}

/* Enshrined Deities */
.service-grid {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:32px;
}

.service-card { text-align:center; }
.service-img { width:100%; height:200px; object-fit:contain; }
.service-card h3 { margin:12px 0 4px; font-size:1.2rem; }

/* MAP セクション全体 */

.section {
	padding: 50px 20px;
  text-align: center;
}

.map-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: center;
  align-items: flex-start;
  max-width: 1000px;
  margin: 0 auto;
}

/* マップ */
.map-wrapper {
  flex: 1 1 550px;
  position: relative;
}

.map-image {
  width: 100%;
  border-radius: 8px;
}


/* 右リストを2列に */
.map-list-2cols {
  flex: 1 1 380px;
  display: grid;
grid-template-columns: 1fr 1fr; /* 2列 */
  gap: 8px 15px; /* 行・列の間隔 */
}

.map-item {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: background .2s;
}

.map-item:hover { background: rgba(0,0,0,0.05); }

.map-number {
  display: inline-block;
  width: 20px; height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  background: #eee;
  margin-right: 6px;
  font-weight: 300;
  font-size: 0.7rem; /* 大きさ統一 */
}

.map-text {
  font-weight: 300;
  font-size: 0.75rem; /* 大きさ統一 */
  color: #333;
}

/* モーダル表示時 */
.modal.show {
  opacity: 1;
  pointer-events: auto;
}

/* モーダル画像 */
.modal {
  display: flex; /* 常にフレックスにしておく */
  opacity: 0;    /* 非表示 */
  pointer-events: none; /* クリック不可 */
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  justify-content: center;
  align-items: center;
  z-index: 200;
  overflow: auto;          /* 内容が大きい場合はスクロール */
  padding: 20px;           /* 端に余白を作る */
  transition: opacity 0.25s ease;
}

.modal-content {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 90vw;         /* 画面幅の90％まで */
  max-height: 90vh;        /* 画面高さの90％まで */
  width: auto;              /* 画像幅に合わせる */
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  
  /* 透明度とスケールの初期状態 */
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* モーダルが表示され、かつ画像にsrcが入っている時 */
.modal.show img{ 
  opacity: 1;
  transform: scale(1);
}

#modal-text {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
  margin-top: 8px;
  max-width: 100%;          /* 画像幅に合わせる */
  white-space: normal;
  word-break: break-word;
}

/* ==========================================
   BLOG
========================================== */

.blog-item {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid #ddd;
  padding: 12px 0;
  font-size: 0.9rem;
}

.blog-head {
  display:flex;
  align-items:center;
}

/* 日付 */
.blog-date {
  flex: 0 0 100px;
  color: #777;
  font-size: 0.8rem;
}

/* タイトル */
.blog-title {
  flex: 0 0 220px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 本文 */
.blog-excerpt {
  flex: 1;
  color: #444;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.blog-thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.blog-more {
  flex: 0 0 auto;
  margin-left: 10px;
  font-size: 0.8rem;
}

/* Footer */
.footer {
background:#fafafa;
border-top:1px solid #eaeaea;
padding:24px 0 16px;
color:#444;
}

.footer-inner {
  display:flex; flex-wrap:wrap;
  justify-content:center; gap:40px;
}

.footer-col a { display:block; font-size:0.85rem; color:#555; text-decoration:none; margin-bottom:6px; }
.footer-copy { text-align:center; margin-top:20px; color:#888; font-size:0.8rem; }

/* 全てのリンクに同じ色を指定 */
a {
  color: #777777; /* 好きな色に変更 */
  text-decoration: none; /* 下線を消す場合 */
}

/* マウスオーバーでも色を変えたくない場合 */
a:hover,
a:visited,
a:active,
a:focus {
  color: #777777; /* 上と同じ色に固定 */
  text-decoration: none; /* 必要に応じて */
}

.map-wrapper img {
  width: 100%;
  height: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}


h2.ttl {
	margin-bottom: 40px;
	text-align: left;
	line-height: 1.0;
	font-family: 'Lato', sans-serif;
	font-weight: 100;
	font-size: 40px;
	letter-spacing: 0.05em;
}

h2.ttl.large {
	margin: 0 0 70px 0;
	font-size: 46px;
	text-align: left;
}

h3.ttl {
	margin-bottom: 12px;
	line-height: 1.0;
	font-family: 'Lato', sans-serif;
	font-weight: 300;
	font-size: 18px;
}

#saijin h3.ttl {
	margin-bottom: 12px;
	text-align: center;
	line-height: 1.0;
	font-size: 18px;
	color: #505050;
}

#saijin p.ttl {
	margin-bottom: 20px;
	text-align: center;
	line-height: 1.0;
	font-family: 'Lato', sans-serif;
	font-weight: 400;
	font-size: 11px;
	letter-spacing: 0.1em;
	color: #a5a5a5;
}

/* ページ全体のベース */
.sub-page-content {
  padding: calc(var(--header-height) + 20px) 20px 80px;
}

.sub-page-title {
    display: flex;
    align-items: baseline; /* 文字の下端（ベースライン）で揃える */
    gap: 20px;             /* メインとサブの間隔 */
    text-align: left;
}

/* サブテキスト（— What the...）のスタイル */
.title-sub-text {
    font-size: 18px;     /* メインより一回り小さく */
    font-weight: 300;      /* 少し太くして読みやすく */
	font-family: 'Lato', sans-serif;
	color: #3b3b3b;           /* 控えめなグレー */
    letter-spacing: 0.05em;
}


/* 本文ブロック */
.sub-text-block.en {
    max-width: 700px;
    margin: 0 auto 120px;
    text-align: left;
}

.sub-text-block.en p {
    font-size: 0.95rem;
    line-height: 1.5; /* 行間を広く */
    color: #333;
    margin-bottom: 2rem;
    letter-spacing: 0.03em;
}

/* ウィンドウ幅いっぱいに広げる設定 */
.full-bleed {
    width: 100vw;              /* ウィンドウの横幅いっぱいにする */
    margin-left: calc(50% - 50vw); /* 親要素の中央から画面の左端まで引き戻す */
    margin-right: calc(50% - 50vw);
    
    margin-top: 0px;          /* 上下の余白（お好みで調整） */
    margin-bottom: 60px;
}

.full-bleed img {
    width: 100%;               /* 100vwになった親要素に対して100% */
    height: auto;
    display: block;
}

/* --- 追加：スマホ・タブレット用の調整 --- */
@media (max-width: 768px) {
  /* ヒーローエリアの文字サイズ調整 */
  .hero-title { font-size: 2rem; }
  .hero-sub { font-size: 1rem; }
}
/* --- スマホでも2列を維持する設定 --- */
@media (max-width: 500px) {
  .map-container {
    gap: 20px; /* マップとリストの間隔を狭める */
  }

  .map-list-2cols {
    display: grid;
    /* 1列にせず、強制的に50%ずつの2列にする */
    grid-template-columns: 1fr 1fr; 
    grid-template-rows: auto;
    gap: 4px 10px; /* 行間と列間をギュッと詰める */
    width: 100%;
  }

  .map-item {
    padding: 2px 0; /* 項目内の余白を最小限に */
    align-items: center; /* 数字とテキストの高さを揃える */
  }

  .map-number {
    flex-shrink: 0; /* 数字が潰れないように固定 */
    width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 0.65rem;
    margin-right: 4px;
  }

  .map-text {
    font-size: 0.7rem; /* 文字をかなり小さくして2列に収める */
    line-height: 1.2;
    white-space: nowrap; /* テキストを改行させず、はみ出しを防ぐ */
    overflow: hidden;
    text-overflow: ellipsis; /* 文字が長すぎる場合は「...」にする */
  }
}
/* モーダル画像がスマホの画面からはみ出さないようにガード */
.modal-content {
  width: 95vw;
}
.modal-content img {
  max-height: 70vh; /* スマホでは少し高さを抑える */
	}
	
/* --- iPhone・スマホ用：ヘッダーの強制修正 --- */
@media (max-width: 500px) {
  /* ヘッダー全体の高さを少し下げ、左右の余白を確保 */
  .header-main-row {
    height: 70px !important; /* 高さを抑える */
    padding: 0 10px !important;
    display: flex;
    justify-content: space-between; /* 要素を等間隔に配置 */
    width: 100%;
  }

  /* ロゴを小さくしてスペースを確保 */
  .logo img {
    height: 28px !important;
  }

  /* ナビゲーションの余白を大幅に削る */
  .gnav {
    margin-left: auto !important;
    gap: 8px !important; /* リンク間の隙間を最小限に */
  }

  .gnav a {
    margin-left: 0 !important;
    font-size: 0.75rem !important; /* 文字を小さく */
    letter-spacing: 0;
  }

  /* 言語スイッチが右端からはみ出さないように固定 */
  .lang-switch {
    margin-left: 8px !important;
    font-size: 11px !important;
    flex-shrink: 0; /* 押し出されないようにする */
  }
}
	
main {
  padding-top: 0px;
}

@media (max-width: 500px) {
:root {
  --header-height: 70px;
}

  main {
    padding-top: 70px;
  }
}