* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans JP", Helvetica, Arial, sans-serif;
  font-weight: 300;
  height: 100%;
  overflow: hidden; /* 全体スクロールなし */
}

header {
  background: #fff;
  padding: 10px 20px;
  border-bottom: none;
  flex-shrink: 0;
}

.site-title {
  margin: 0;
  font-size: 32px;
  font-weight: 200;
  cursor: pointer;
  position: relative;
  top: -4px;
  color: #08593c;
}

.main-menu {
  display: flex;
  gap: 20px;
  padding: 10px 0;
  list-style: none;
  margin: 0;
  border-bottom: 1px solid #ccc;
}

.main-menu li a {
  text-decoration: none;
  color: #08593c;
  font-size: 18px;
}

.container {
  display: flex;
  height: calc(100% - 100px);
}

aside {
  width: 200px;
  border-right: 1px solid #ccc;
  padding: 20px;
  overflow-y: auto;
  font-size: 18px;
  color: #08593c;
}

#year-menu {
  font-family: "Noto Sans JP", Helvetica, Arial, sans-serif;
  font-weight: 300;
}

#year-menu ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

#year-menu li > ul {
  margin-top: 5px;
  padding-left: 15px;
}

#year-menu h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
}

#year-menu a {
  text-decoration: none;
  color: #08593c;
  display: block;
  margin: 5px 0;
  cursor: pointer;
  font-size: 18px;
  font-weight: 400;
  transition: color 0.3s ease;
}

#year-menu a:hover {
  color: #000;
}

#year-menu a.active {
  font-weight: 500;
  color: #000;
}

#work-display {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-left: 1px solid #ccc;
}

#display-title,
#fixed-title {
  font-size: 18px;
  font-weight: bold;
  background: #fff;
  padding: 10px 20px;
  border-bottom: 1px solid #ccc;
  height: 48px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  color: #08593c;
}

/* ✅ worksページの画像ギャラリー */
.gallery {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px;
  padding-bottom: 200px;
  max-height: 100%;
  align-content: flex-start;
}

.gallery img {
  width: calc(33% - 20px);
  max-width: 300px;
  height: 200px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: default;
  flex-shrink: 0;
}

.gallery img.dimmed {
  filter: grayscale(100%) brightness(0.6);
  cursor: default;
}

.gallery::after {
  content: "";
  display: block;
  height: 600px; /* ← ここを増やすと一番下の画像も上までスクロール可能に */
}

.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  cursor: pointer;
}

.image-modal img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ✅ aboutのh2だけ太字を解除 */
#company h2,
#profile h2 {
  font-weight: 400; /* または 300 / normal でもOK */
  color: #08593c;
}

/* ✅ aboutページ専用スタイル */
.about-gallery {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 20px;
  overflow-y: auto;
  height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 48px;
  max-height: 100%;
  color: #08593c;
}

.about-gallery section {
  scroll-margin-top: 48px;
}

.about-gallery::after {
  content: "";
  display: block;
  height: 800px; /* ← 必要に応じて調整（スクロール位置確保） */
}

/* ✅ スクロール用スペーサー（works用） */
.scroll-spacer {
  height: 400px;
}

/* ✅ スマホ対応 */
@media (max-width: 768px) {
  .gallery img {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .container {
    flex-direction: column;
  }

  aside {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ccc;
  }

  #work-display {
    border-left: none;
  }
}

.contact-main {
  gap: 40px;
  padding: 20px; /* ← about と同程度の左余白 */
  color: #08593c;
}

@media (max-width: 768px) {
  /* 全体レイアウト：スマホでも横並び維持 */
  .container {
    flex-direction: row;
    flex-wrap: nowrap;
    height: 100vh;
  }

  /* 左側のサブメニュー */
  aside {
    width: 100px;
    border-right: 1px solid #ccc;
    border-bottom: none;
    font-size: 12px; /* ← さらに小さく */
    padding: 8px;
    overflow-y: auto;
  }

  #year-menu h2 {
    font-size: 12px;
    margin-bottom: 8px;
  }

  #year-menu a {
    font-size: 11px; /* ← 小さく調整 */
    line-height: 1.4;
  }

  /* worksの右側 */
  #work-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: none;
  }

  .gallery {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    gap: 10px;
  }

  .gallery img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: cover;
  }

  /* ヘッダー・メニュー */
  .site-title {
    font-size: 18px; /* ← 小さめ */
  }

  .main-menu {
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
  }

  .main-menu li a {
    font-size: 13px;
  }

  #fixed-title {
    font-size: 15px;
    height: 40px;
    padding: 5px 10px;
  }

  /* aboutページ */
  .about-gallery {
    padding: 10px;
    gap: 20px;
    font-size: 12px; /* ← 少し小さく */
  }

  .about-gallery section h2 {
    font-size: 13px; /* ← タイトルも小さめに */
  }

  .about-gallery p {
    font-size: 12px;
    line-height: 1.5;
  }

  .contact-main {
    padding: 10px;
    font-size: 12px; /* ← さらに小さく */
    line-height: 1.6;
  }

  /* 事務所名称のpタグで文字が折れないように */
  .about-gallery p {
    word-break: keep-all;
    overflow-wrap: break-word;
  }
}

.modal-caption {
  margin-top: 10px;
  font-size: 14px;
  color: #333;
  text-align: center;
  font-weight: 300;
}
