/* ==============================
   全体共通
============================== */
body {
  background: #888;
  color: #111;
  font-family: 'Noto Serif JP', serif;
  font-size: 12px;
  line-height: 1.8;
  margin: 0;
  display: flex;
  flex-direction: column;
}

main {
  margin: 10px;
  flex: 1;
  padding: 10px;
  box-sizing: border-box;
}

.card {
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border-radius: 6px;
  padding: 20px;
  margin: 20px auto; /* 上下に余白 */
  max-width: 800px;
}
.card h3 {
  position: relative;      /* 擬似要素を配置するため */
  padding-left: 12px;     /* 左にスペース確保 */
}

.card h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;             /* 線の太さ */
  height: 100%;           /* 高さをh3の高さに合わせる */
  background-color: #111; /* 線の色 */
}

/* セクション共通 */
section {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 50px;
}

header {
  display: flex;
  flex-direction: column;  /* 縦に積む */
  align-items: center;     /* 中央揃え */
  text-align: center;      /* テキストも中央 */
  gap: 5px;                /* 各行の間隔 */
  padding: 20px 0;
}
/* ==============================
   main-page 用（main.html）
============================== */
body.main-page .thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* 6列 */
  gap: 6px;
}

body.main-page .thumb {
  width: 100%;        /* 親の列幅いっぱい */
  aspect-ratio: 1;    /* 正方形を維持 */
  object-fit: cover;  /* 画像ははみ出しても切り取る */
  object-position: center;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #ccc;
  transition: transform 0.3s, box-shadow 0.3s;
}

body.main-page .thumb:hover {
  transform: scale(1.4);
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

/* ライトボックス */
body.main-page .lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

body.main-page .lightbox-img {
  max-width: 90%;
  max-height: 90%;
}

body.main-page .close {
  position: absolute;
  top: 20px; right: 30px;
  font-size: 36px;
  color: #fff;
  cursor: pointer;
}

body.main-page .prev,
body.main-page .next {
  position: absolute;
  top: 50%;
  font-size: 28px;
  background-color: rgba(0,0,0,0.5);
  padding: 8px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  user-select: none;
  transform: translateY(-50%);
}

body.main-page .prev { left: 20px; }
body.main-page .next { right: 20px; }

/* ==============================
   drawing-page 用（drawing.html）
============================== */
body.drawing-page .drawing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  justify-items: center;
}

/* サムネイル画像 */
body.drawing-page .drawing-grid img {
  width: 100%;
  aspect-ratio: 1;      /* 正方形を維持 */
  object-fit: cover;
  cursor: pointer;
  border-radius: 0px;
  border: 1px solid #000;
  transition: transform 0.3s, box-shadow 0.3s;
}

body.drawing-page .drawing-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* ===== スマホ（幅480px以下） ===== */
@media (max-width: 480px) {
  body.drawing-page .drawing-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  body.drawing-page .drawing-grid img {
    width: 100px;
    height: 100px;
  }
}

/* ===== タブレット（幅481px〜1024px） ===== */
@media (min-width: 481px) and (max-width: 1024px) {
  body.drawing-page .drawing-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  body.drawing-page .drawing-grid img {
    width: 120px;
    height: 120px;
  }
}

/* ===== PC（幅1025px以上） ===== */
@media (min-width: 1025px) {
  body.drawing-page .drawing-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
  }
  body.drawing-page .drawing-grid img {
    width: 140px;
    height: 140px;
  }
}

/* ライトボックスはそのまま */
body.drawing-page .lightbox {
  display: none;
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
}

body.drawing-page .lightbox-img {
  max-width: 90%;
  max-height: 80%;
}

body.drawing-page .caption {
  color: #fff;
  margin-top: 10px;
  font-size: 1rem;
}

body.drawing-page .close,
body.drawing-page .prev,
body.drawing-page .next {
  position: absolute;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  user-select: none;
}

body.drawing-page .close { top: 20px; right: 30px; }
body.drawing-page .prev { top: 50%; left: 30px; transform: translateY(-50%); }
body.drawing-page .next { top: 50%; right: 30px; transform: translateY(-50%); }



body.drawing-page .lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
}

body.drawing-page .lightbox-img {
  max-width: 90%;
  max-height: 80%;
}

body.drawing-page .caption {
  color: #fff;
  margin-top: 10px;
  font-size: 1rem;
}

body.drawing-page .close,
body.drawing-page .prev,
body.drawing-page .next {
  position: absolute;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  user-select: none;
}

body.drawing-page .close { top: 20px; right: 30px; }
body.drawing-page .prev { top: 50%; left: 30px; transform: translateY(-50%); }
body.drawing-page .next { top: 50%; right: 30px; transform: translateY(-50%); }

/* ==============================
   フッター・ボタン
============================== */
footer {
  text-align: center;
  padding: 0 0 70px 0;
}

.footer-buttons {
  display: flex;
  justify-content: space-between;
  max-width: 600px;
  margin: 20px auto 0 auto;
}

.footer-buttons a {
  padding: 10px 16px;
  background-color: #111;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s, transform 0.2s;
}

.footer-buttons a:hover {
  background-color: #444;
  transform: translateY(-2px);
}

/* ==============================
   見出しデザイン
============================== */
.gallery h3 {
  position: relative;
  padding-left: 12px;
  margin-top: 40px;
  margin-bottom: 20px;
  font-weight: bold;
}

.gallery h3::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 3px;
  height: 100%;
  background-color: #111;
}

/* ==============================
   スマホ対応
============================== */
/* main.html用サムネイルのレスポンシブ */
@media (max-width: 768px) {
  @media (max-width: 768px) {
  body.main-page .thumbs {
    grid-template-columns: repeat(6, 50px); /* タブレット向け */
    gap: 6px;
  }
}
@media (max-width: 480px) {
  body.main-page .thumbs {
    grid-template-columns: repeat(4, 1fr); /* 例：4列 */
    gap: 4px; /* 間隔はお好みで調整 */
  }

  body.main-page .thumb {
    width: 100%;  /* 各列にフィット */
    aspect-ratio: 1; /* 正方形を維持 */
  }
}
/* main-page用 サムネイルギャラリーのレスポンシブ 
@media (max-width: 480px) {
  body.main-page .thumbs {
    grid-template-columns: repeat(5, 50px);
    gap: 6px;
  }
} */

/* ==============================
   back-top ボタン
============================== */
.back-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #000;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: background-color 0.3s, transform 0.2s;
  z-index: 1000;
}

.back-top:hover {
  background-color: #444;
  transform: translateY(-2px);
}

/* ==============================
   スマホ用固定メニュー
============================== */
.mobile-footer-menu {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #000;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 9999;
}

.mobile-footer-menu a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

@media (max-width: 480px) {
  .mobile-footer-menu {
    display: flex;
  }
}

/* スマホ用（幅480px以下） */
@media (max-width: 480px) {
  body.drawing-page .drawing-grid img {
    width: 100px;   /* 小さくする */
    height: 100px;  /* 正方形のまま */
  }
}

/* PC用は今まで通り */
.header-logo {
  max-width: 400px; /* 最大幅 */
  height: auto;
}

/* スマホ用（幅480px以下） */
@media (max-width: 480px) {
  .header-logo {
    max-width: 90%;  /* 画面幅の90%まで広がる */
    height: auto;    /* 縦横比維持 */
  }
}

.tegalog-box {
  margin: 2rem auto;
  padding: 0;
  max-width: 600px;
  text-align: center;
}

.tegalog-frame {
  display: inline-block;
  width: 100%;
  height: 600px; /* ← 後で調整 */
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
}