/* Google Fontsの読み込み */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Noto+Serif+JP:wght@400;700&family=Montserrat:wght@400;500;600;700&display=swap');

/* リセットとベース設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.8;
  color: #333;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "palt";
}

/* カラー変数 */
:root {
  --primary-color: #4A3728; /* ダークブラウン（コーヒー） */
  --primary-light: #6B5440; /* 明るいダークブラウン */
  --secondary-color: #8B6F4B; /* ミディアムブラウン */
  --accent-color: #C8B6A6; /* ライトブラウン */
  --text-light: #ffffff;
  --text-dark: #333333;
  --text-muted: #777777;
  --bg-light: #f9f9f9;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* コンテナ */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* タイポグラフィ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', 'Noto Serif JP', serif;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5em;
  letter-spacing: 0.02em;
  color: var(--primary-color);
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-color);
}

/* ヘッダー */
header {
  background-color: var(--primary-color);
  color: var(--text-light);
  padding: 40px 0;
  text-align: center;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 10;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--text-light);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--accent-color);
  letter-spacing: 0.03em;
  line-height: 1.5;
  max-width: 800px;
  margin: 0 auto;
}

/* メインコンテンツ */
main {
  flex: 1 0 auto;
  padding-bottom: 50px;
}

/* アルバムリスト */
.album-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.album-card {
  background-color: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  top: 0;
}

.album-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.album-thumbnail {
  position: relative;
  overflow: hidden;
}

.album-thumbnail img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.album-card:hover .album-thumbnail img {
  transform: scale(1.08);
}

.album-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}

.album-info {
  padding: 22px;
}

.album-title {
  color: var(--primary-color);
  font-size: 1.4rem;
  margin-bottom: 12px;
  font-weight: 600;
  transition: var(--transition);
}

.album-card:hover .album-title {
  color: var(--secondary-color);
}

.album-details {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.album-date, .album-location {
  display: flex;
  align-items: center;
}

.album-date i, .album-location i {
  margin-right: 6px;
  color: var(--secondary-color);
}

.album-description {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

/* アルバムページ */
.album-header {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.back-button {
  margin-right: 20px;
  color: var(--primary-color);
  font-size: 1.8rem;
  cursor: pointer;
  transition: var(--transition);
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(200, 182, 166, 0.1);
}

.back-button:hover {
  background-color: rgba(200, 182, 166, 0.3);
  transform: translateX(-3px);
}

.album-header-info h2 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 1.8rem;
}

.album-meta {
  color: var(--text-muted);
  display: flex;
  gap: 25px;
  font-size: 0.95rem;
}

.album-meta i {
  color: var(--secondary-color);
  margin-right: 6px;
}

/* 写真グリッド */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}

.photo-item {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  height: 0;
  padding-bottom: 75%; /* 4:3アスペクト比 */
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.photo-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow);
}

.photo-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.photo-item:hover img {
  transform: scale(1.08);
}

/* モーダルウィンドウ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-image {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  border: 3px solid white;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  top: -45px;
  right: 0;
  color: white;
  font-size: 34px;
  cursor: pointer;
  transition: transform 0.2s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  transform: rotate(90deg);
}

.modal-caption {
  color: white;
  background-color: rgba(0, 0, 0, 0.75);
  padding: 16px 20px;
  text-align: center;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 1rem;
  line-height: 1.7;
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0.02em;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  backdrop-filter: blur(5px);
}

.modal-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
}

.modal-prev, .modal-next {
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 18px;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  pointer-events: auto;
  width: 55px;
  height: 55px;
}

.modal-prev {
  margin-left: 25px;
}

.modal-next {
  margin-right: 25px;
}

.modal-prev:hover, .modal-next:hover {
  background-color: rgba(74, 55, 40, 0.8);
  transform: scale(1.1);
}

/* フッター */
footer {
  flex-shrink: 0;
  background-color: var(--primary-color);
  color: var(--text-light);
  text-align: center;
  padding: 25px 0;
  font-size: 0.95rem;
  width: 100%;
  letter-spacing: 0.02em;
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.1);
}

footer p {
  margin-bottom: 0;
}

/* アニメーション */
@keyframes fadeUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.album-card {
  animation: fadeUp 0.5s ease both;
  animation-delay: calc(var(--i, 0) * 0.1s);
}

/* レスポンシブ対応 */
@media (max-width: 992px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 30px 0;
  }

  header h1 {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }

  .album-details {
    flex-direction: column;
    gap: 8px;
  }
  
  .album-meta {
    flex-direction: column;
    gap: 10px;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .modal-prev, .modal-next {
    font-size: 1.5rem;
    padding: 12px;
    width: 45px;
    height: 45px;
  }
  
  .modal-prev {
    margin-left: 15px;
  }
  
  .modal-next {
    margin-right: 15px;
  }
}

@media (max-width: 480px) {
  .album-list {
    grid-template-columns: 1fr;
  }

  header h1 {
    font-size: 1.8rem;
  }
  
  body {
    font-size: 0.95rem;
  }
  
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  
  .album-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .back-button {
    margin-bottom: 15px;
  }
  
  .modal-caption {
    font-size: 0.9rem;
    padding: 12px 15px;
  }
  
  .modal-prev, .modal-next {
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
  }
}