@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  --bg-color: #FAFAFA;
  --text-main: #111111;
  --surface: #FFFFFF;
  --border-color: #111111;
  --transition-speed: 0.3s;
}

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

body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: 100%;
  max-width: 400px;
  padding: 40px 20px;
  text-align: center;
  animation: fadeIn 0.8s ease-out;
}

/* Profile Header */
.profile {
  margin-bottom: 40px;
}

.icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 24px;
  transition: transform var(--transition-speed);
}

.icon:hover {
  transform: scale(1.05) rotate(-3deg);
}

.icon.spin {
  animation: spinAnimation 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes spinAnimation {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

.title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.05em;
}

/* --- News Ticker --- */
.news-container {
  width: 100%;
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
}

.news-box {
  display: flex;
  align-items: center;
  width: 100%;
  border: 2px solid var(--text-main);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

@media (hover: hover) {
  .news-box:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 var(--text-main);
  }
}

.news-label {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 12px 16px;
  background: var(--text-main);
  color: var(--bg-color);
  letter-spacing: 1px;
  flex-shrink: 0;
}

.news-content {
  flex-grow: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  padding: 0 16px;
}

.news-text {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  /* 右から左へ無限に流れるアニメーション */
  padding-left: 100%;
  animation: marquee 15s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* --- News List Page --- */
.news-page-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.news-page-list li {
  padding: 20px 0;
  border-bottom: 2px solid var(--text-main);
  font-weight: 500;
  line-height: 1.6;
}

.news-page-list li:first-child {
  border-top: 2px solid var(--text-main);
}

/* リンクエリアとボタン */
.links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn {
  display: block;
  width: 100%;
  padding: 16px;
  background-color: var(--surface);
  border: 2px solid var(--border-color);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px; /* Slightly rounded for modern minimalism */
  transition: all var(--transition-speed);
  position: relative;
  overflow: hidden;
}

/* Button Hover Effects */
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background-color: var(--text-main);
  transition: left var(--transition-speed) ease;
  z-index: 1;
}

@media (hover: hover) {
  .btn:hover::before {
    left: 0;
  }

  .btn:hover {
    color: var(--bg-color);
  }
}

.btn span {
  position: relative;
  z-index: 2;
}

.btn {
  /* To make the text appear above the hover background */
  z-index: 0;
}
.btn::after {
  content: attr(data-text); /* Fallback */
}

/* Let's simplify the button hover so the text naturally changes color */
.btn {
  background-color: transparent;
}
@media (hover: hover) {
  .btn:hover {
    background-color: var(--border-color);
    color: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer (Copyright) */
footer {
  margin-top: 60px;
  font-size: 0.75rem;
  color: #999;
  letter-spacing: 0.05em;
  text-align: center;
}

/* --- Added Layouts --- */

/* Page Container for sub-pages */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 5%;
  width: 100%;
}

.page-title {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2rem;
  letter-spacing: 0.1em;
}

/* Works Grid */
.works-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .works-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .works-gallery {
    grid-template-columns: 1fr;
  }
}

.work-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--surface);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform var(--transition-speed);
  cursor: pointer;
  aspect-ratio: 1; /* 正方形にする */
}

.work-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-card .info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
  opacity: 0;
  transition: opacity var(--transition-speed);
}

.work-card:hover .info {
  opacity: 1;
}

.work-card .title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0px;
}

/* Floating Back Button */
.floating-back {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--surface);
  border: 2px solid var(--text-main);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-speed);
  z-index: 100;
}

@media (hover: hover) {
  .floating-back:hover {
    background-color: var(--text-main);
    color: var(--surface);
    transform: translateY(-2px);
  }
}

/* Detail Page */
.work-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
}

.gallery-container {
  width: 100%;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.work-detail .main-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 16px;
  transition: opacity var(--transition-speed);
}

.thumbnail-container {
  display: flex;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.work-detail .thumbnail-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  opacity: 0.6;
  transition: transform var(--transition-speed), opacity var(--transition-speed);
  flex-shrink: 0;
}

.work-detail .thumbnail-image:hover,
.work-detail .thumbnail-image.active {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Work Detail Page Elements */
.work-detail .meta {
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 1rem;
  display: block;
}

.work-detail p {
  line-height: 1.8;
  color: #333;
}

.play-btn {
  display: inline-block;
  margin-top: 24px;
  padding: 16px 32px;
  background: var(--text-main);
  color: var(--bg-color);
  font-weight: bold;
  text-decoration: none;
  border-radius: var(--radius);
  transition: transform var(--transition-speed), opacity var(--transition-speed);
}

@media (hover: hover) {
  .play-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
  }
}

/* --- Diary List --- */
.diary-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
}

.diary-card {
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.diary-card:hover .diary-img-wrap img {
  transform: scale(1.05);
}

.diary-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 12px;
}

.diary-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed);
}

.diary-meta {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 4px;
}

.diary-title {
  font-size: 1.05rem;
  font-weight: 500;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-speed);
  padding: 60px 20px;
  overflow-y: auto; /* 縦方向のスクロールを許可 */
  -webkit-overflow-scrolling: touch;
}

/* 画像が画面より小さい時は縦に中央配置、大きい時はトップからスクロールさせるハック */
.lightbox::before, .lightbox::after {
  content: '';
  margin: auto;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 700px; /* 横幅のある程度の固定サイズ */
  width: 100%;
  height: auto; /* max-heightの制限を外して縦長にする */
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  border-radius: 4px;
  margin-bottom: 20px;
  display: block;
}

.lightbox-text {
  color: #fff;
  text-align: center;
  max-width: 700px;
  width: 100%;
}

.lightbox-date {
  font-size: 0.85rem;
  color: #bbb;
  margin-bottom: 4px;
  display: block;
}

.lightbox-title {
  font-size: 1.25rem;
  font-weight: 500;
}

/* Close Button Data Info */
.lightbox-close {
  position: fixed; /* absoluteだとスクロール時に上に消えてしまうためfixedに */
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 10px;
  user-select: none;
  z-index: 1010;
}

