html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

body {
    font-family: 'Noto Serif JP', serif;
    margin: 0;
    padding: 0;
    background-color: #f4f2f8;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

body::-webkit-scrollbar, html::-webkit-scrollbar {
    display: none;
}

.site-banner {
  background: linear-gradient(135deg, #dcd6f7, #e7e9f9, #f0f1f6);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  color: #111;
  font-size: 1rem;
  height: 6%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;      
  justify-content: center; 
  align-items: center;
  text-align: center; 
}
.info-banner {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #f4f2f8;
  padding: 0.5em 1em;
  text-align: center;
  font-size: 0.95rem;
  width: 50%;
  margin: 0 auto; 
  text-align: center;
}
header {
    background-color: transparent;
    color: black;
    height: 23%;
    display: flex;
    flex-direction: column; 
    justify-content: flex-start; 
    align-items: flex-start;  
    width:80%;
    margin: 0 auto; 
    box-sizing: border-box;
    padding-top: 6%;
}

header h1 {
    font-size: 2rem;
    font-weight: 500;
    margin: 0; 
    text-align: left; 
}


nav {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    gap: 20px; 
}

nav ul li {
    flex: none; 
}

nav ul li a,
nav ul li button {
    display: inline-block;
    vertical-align: middle;  
    line-height: 1.2;      
    color: #444;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 4px 8px;  
    transition: color 0.3s ease;
    font-family: inherit;
}

nav ul li a::after,
nav ul li button::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 1px;
    background: #7d6bc5;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

nav ul li a:hover,
nav ul li button:hover {
    color: #7d6bc5;
}

nav ul li a:hover::after,
nav ul li button:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}


main {
    flex-grow: 1;
    padding: 2rem 5%;
    width: 80%;
    max-width: none;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    flex-direction: column; 
}


.hidden {
    display: none;
}

/* ポップアップ */
#popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4);
    display: none; /* デフォルトで非表示 */
}

#popup:not(.hidden) {
    display: flex; /* hiddenクラスが外れると表示される */
}

.popup-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px 28px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  font-family: 'Noto Serif JP', serif;
  animation: fadeIn 0.25s ease;
}

/* 日付 */
#popupDate {
  font-size: 0.9rem;
  color: #666;
  display: block;
}

/* タイトル */
#popupTitle {
  font-size: 1.6rem;     /* 少し小さめに */
  font-weight: bold;
  color: #222;
  text-decoration: none;
  display: inline-block;
  margin: 0;    /* 上下の余白をぎゅっと詰める */
  line-height: 1.2;
}

/* ハッシュタグ */
#popupHashtag {
  display: block;
  font-size: 1.0rem;
  color: #777;
  text-decoration: none;
}

#popupTitle::before { content: "『"; }
#popupTitle::after  { content: "』"; }

/* 区切り線 */
.popup-content hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 12px 0;
}

/* ボタンを横並び */
.button-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 14px 0;
}

/* 中抜きボタン */
#popupCharacter,
#popupURL {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  background: transparent;
  color: #34495e;            /* 明るめネイビー */
  border: 1px solid #34495e; /* 枠線もネイビー */
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 1.0rem;
}

#popupCharacter:hover,
#popupURL:hover {
  background: #34495e; /* ホバーで塗りつぶし */
  color: #fff;
}


/* アニメーション */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* サムネイルコンテナ */
#thumbnails-container {
    margin-top: 20px; /* 上部に余白を追加 */
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4列 */
    gap: 20px;
    width: 100%;
    max-width: 2000px;
    margin: 0 auto;
    padding: 0;
    justify-items: center;
    align-items: center;
}

/* サムネイルセル */
.thumbnail-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    background-color: #fff;
    overflow: hidden;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    transition: opacity 1s ease-in-out;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    background-color: #f0f0f0;
    line-height: 0; /* 画像の下の余白を消す */
}

/* サムネイル画像 */
.thumbnail-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 90%; /* ヘッダーの幅に合わせる */
    max-width: 1400px; /* コンテンツの最大幅 */
    margin: 0 auto; /* 中央寄せ */
    padding: 10px; /* サムネイル周りに内側の余白 */
    border-radius: 8px; /* 角を丸くする */
    background-color: #fff;
}


#button-container {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 20px;
}

#button-container button {
    background: transparent;
    border: 1.5px solid #7d6bc5;
    border-radius: 4px;           
    color: #7d6bc5;
    padding: 6px 64px; /* 上下を少なめ、左右を広めに */
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Noto Serif JP', serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

#button-container button:hover {
    background: #7d6bc5;
    color: #fff;
}

#button-container button.active {
    background: #7d6bc5;
    color: #fff;
}


.content {
    padding: 20px;
    min-height: 150px;
    background: #fff;
    color: #333;
    border-radius: 12px;
box-shadow: 0 -2px 6px rgba(0,0,0,0.03), /* 上側 */
            0 2px 6px rgba(0,0,0,0.05),  /* 下側 */
            0 1px 2px rgba(0,0,0,0.03);  /* 軽い下側影 */
    transition: opacity 0.3s ease;
}

.content.active {
    display: block;
}

/* フェードインアニメーション */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}


@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}


/* KP と PL のコンテンツを切り替える */
.content.hidden {
    display: none;
}

footer {
  background: #f9f9f9; 
  color: #444;
  font-size: 0.8rem;
  font-family: 'Noto Serif JP', serif;
  font-weight: 300; 
  height: 5%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: none;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.08); /* 影で自然に区切る */
}

footer .footer-inner {
  opacity: 0.8;
}

a {
    color: inherit; 
    text-decoration: none;  
}
@media (max-width: 1024px) {
  .site-banner {
    position: fixed;    
    top: 0;
    left: 0;
    right: 0;
    height: auto;  
    white-space: normal;   
    padding: 0.8rem 1rem;  
    font-size: 0.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 1000;
    flex-wrap: wrap;    
  }

  header {
    flex-direction: column;   /* h1 と nav を縦並び */
    align-items: center;      /* 中央揃え */
    margin-top: 60px;
    gap: 12px;                /* h1 と nav の間を少し広く */
  }

  nav {
    justify-content: center;
    width: auto;
  }

  nav ul {
    flex-direction: row;      /* 横並び維持 */
    gap: 20px;                /* PCより狭く、スマホより広く */
    justify-content: center;
    width: auto;
  }

  nav ul li a,
  nav ul li button {
    font-size: 1.1rem;        /* スマホより少し大きく */
  }

  main {
    width: 90%;
    padding: 1.5rem 0;
    gap: 20px;
  }

  .thumbnail-grid {
    grid-template-columns: repeat(3, 1fr); /* 3列に拡張（iPad横向き想定） */
    gap: 16px;
    width: 100%;
    margin: 0 auto;
    justify-items: center;
    align-items: start;
  }

  .popup-content {
    width: 70%;               /* 少し広く */
    margin: 0 auto;
  }

  #button-container {
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;  /* 中央寄せ追加 */
  }

  #button-container button {
    padding: 8px 36px;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .site-banner {
    font-size: 0.6rem;
    padding: 0.1rem 0.5rem;
    height: 50px;
    box-sizing: border-box; 
  }

  header {
    flex-direction: column;  /* h1 と nav を縦に並べる */
    align-items: center;     /* 中央揃え */
    margin-top: 70px; 
    gap: 10px;               /* h1 と nav の間 */
  }

  /* nav 内のリンクは横並びのまま */

  nav {
    justify-content: center; /* 中央寄せ */
    width: auto;             /* 幅は自動 */
  }

  nav ul {
    flex-direction: row;     /* 横並び維持 */
    gap: 12px;               /* リンク間の隙間 */
    justify-content: center; /* 中央寄せ */
    width: auto;             /* 幅は自動 */
  }

  nav ul li a,
  nav ul li button {
    font-size: 1rem; /* 小さくする */
  }

  /* メインコンテンツ縦方向の調整 */
  main {
    width: 90%;
    padding: 1rem 0;
    gap: 16px;
  }

  /* サムネイルを2列に変更 */
  .thumbnail-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    padding: 0;          /* パディングを消す */
    margin: 0 auto;   /* 中央寄せ */
    justify-items: center;
    align-items: start;
  }

  /* ポップアップカードの横幅調整 */
  .popup-content {
    width: 80%;
    margin: 0 15%;
  }

  /* ボタン切り替えの間隔調整 */
  #button-container {
    flex-wrap: wrap;     
    gap: 16px;
  }

  #button-container button {
    padding: 6px 32px;
    font-size: 0.95rem;
  }
}
