/* ========================================
   家族写真集・ギャラリー用CSS
   優しい色合いベース
   デザイナー編集用
   ======================================== */

/* --- ベース --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
  background: #faf8f5;
  color: #4a4a4a;
  line-height: 1.6;
}

/* --- レイアウト --- */
header {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 40px;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px 60px;
}

footer {
  text-align: center;
  padding: 40px;
  color: #aaa;
  font-size: 12px;
  border-top: 1px solid #eee8e0;
}

/* --- ナビ --- */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 18px;
  font-weight: 500;
  color: #5a4a42;
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-links a {
  margin-left: 32px;
  color: #999;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 1px;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #5a4a42;
}

/* --- ギャラリー・グリッド --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  display: block;
  text-decoration: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.photo-item:hover img {
  transform: scale(1.05);
  opacity: 0.9;
}

.photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 20px 20px;
  background: linear-gradient(transparent, rgba(90, 74, 66, 0.6));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-item:hover .photo-overlay {
  opacity: 1;
}

.photo-overlay h3 {
  font-size: 15px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 4px;
}

.photo-overlay time {
  font-size: 12px;
  color: #eee;
}

.no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0ebe5;
  color: #bbb;
  font-size: 14px;
  border-radius: 8px;
}

/* --- ページネーション --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid #eee8e0;
}

.pagination a {
  color: #888;
  text-decoration: none;
  font-size: 13px;
  padding: 8px 20px;
  border: 1px solid #ddd5cc;
  border-radius: 4px;
  transition: all 0.3s;
}

.pagination a:hover {
  color: #5a4a42;
  border-color: #c4b8ae;
  background: #fff;
}

.pagination span {
  color: #bbb;
  font-size: 13px;
}

/* --- 写真詳細ページ --- */
.photo-page {
  max-width: 1200px;
  margin: 0 auto;
}

.photo-frame {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.photo-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.photo-info {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 0 20px;
}

.photo-info h1 {
  font-size: 24px;
  font-weight: 400;
  color: #5a4a42;
  margin-bottom: 8px;
}

.photo-info time {
  display: block;
  color: #aaa;
  font-size: 13px;
  margin-bottom: 20px;
}

.photo-caption {
  color: #777;
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 24px;
}

.tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: #f0ebe5;
  color: #999;
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 100px;
  border: 1px solid #e5ddd4;
}

/* --- 前後ナビ --- */
.photo-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #eee8e0;
}

.photo-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #888;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.3s;
}

.photo-nav a:hover {
  color: #5a4a42;
}

.photo-nav img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  opacity: 0.7;
  transition: opacity 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.photo-nav a:hover img {
  opacity: 1;
}

.back-to-gallery {
  border: 1px solid #ddd5cc;
  padding: 10px 24px;
  border-radius: 4px;
  background: #fff;
}

.back-to-gallery:hover {
  border-color: #c4b8ae;
  background: #faf8f5;
}

/* --- レスポンシブ --- */
@media (max-width: 768px) {
  header, main {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
  }
  
  .site-nav {
    flex-direction: column;
    gap: 12px;
  }
  
  .nav-links a {
    margin: 0 12px;
  }
  
  .photo-nav img {
    display: none;
  }
}
