/* =================================
   Common Styles
   ================================= */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f9f9f9;
  color: #333;
}

main {
  /* メインコンテンツの上下左右に余白を確保 */
  padding: 60px 20px;
}

/* =================================
   Header
   ================================= */
header {
  background-color: #fff;
  padding: 20px 40px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 2em;
  font-weight: 600;
}

.site-title {
  text-decoration: none;
  color: inherit;
}

.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 30px;
}

.main-nav a {
  text-decoration: none;
  color: #555;
  font-weight: 500;
  font-size: 1.1em;
  transition: color 0.3s ease;
}

.main-nav a:hover {
  color: #3498db;
}

/* =================================
   Footer
   ================================= */
footer {
  background-color: #333;
  color: #eee;
  text-align: center;
  padding: 30px 20px;
  font-size: 0.9em;
}

/* =================================
   Site Introduction (index.html)
   ================================= */
.site-introduction {
  max-width: 800px;
  margin: 0 auto 80px;
  /* 中央寄せと、下のworksセクションとの間に余白 */
  padding: 30px 40px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.site-introduction h2 {
  font-size: 1.8em;
  margin-top: 0;
  margin-bottom: 20px;
}

.site-introduction p {
  line-height: 2;
}

/* =================================
   Site Notice (index.html)
   ================================= */
.site-notice {
  max-width: 800px;
  margin: 0 auto 80px;
  /* 上下左右の余白を設定 */
  padding: 25px 40px;
  background-color: #fffaf0;
  /* お知らせ用の背景色（薄いオレンジ系） */
  border-left: 5px solid #ffc107;
  /* 左側にアクセントボーダー */
  border-radius: 4px;
}

.site-notice h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.4em;
}

.site-notice p {
  margin-bottom: 0.5em;
  line-height: 1.8;
  color: #444;
}

/* =================================
   Section Title
   ================================= */
.section-title {
  text-align: center;
  font-size: 1.6em;
  font-weight: 500;
  /* 少し細めのフォント */
  color: #555;
  margin-top: 0;
  margin-bottom: 50px;
  /* タイトルと作品リストの間の余白 */
}


/* =================================
   Works Page (index.html)
   ================================= */
.works-grid-container {
  /* グリッドレイアウトを有効にする */
  display: grid;

  /* PC用レイアウト：列を1つに設定（各作品が1行を占める） */
  grid-template-columns: 1fr;

  gap: 80px;
  /* 作品間の縦の余白を少し広げる */

  /* 中央寄せ */
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  /* 親要素のmainにpaddingがあるので不要 */
}

.work-item {
  /* 作品1つをグリッドの親要素にする */
  display: grid;

  /* 列を2つに設定：左（画像）と右（コンテンツ） */
  grid-template-columns: 1fr 1fr;

  /* レイアウトエリアに名前を付ける（デフォルト：画像が左） */
  grid-template-areas: "image content";

  gap: 40px;
  /* 画像と抜粋文の間の余白 */
  align-items: center;
  /* 垂直方向の中央揃え */
}

/* 偶数番目の作品でレイアウトを反転させる（画像が右） */
.work-item:nth-child(even) {
  grid-template-areas: "content image";
}

.work-image-wrapper {
  grid-area: image;
}

.work-content-wrapper {
  grid-area: content;
  /* Flexboxを使って、縦書きテキストとボタンの配置を調整 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
  /* テキストとボタンの間の余白 */
}

.work-image {
  width: 100%;
  /* 画像を親要素に合わせる */
  height: auto;
  display: block;
  /* 余白をなくす */
}

.work-excerpt {
  line-height: 1.8;
  font-size: 1.1em;

  /* テキストを縦書きにする（右から左へ） */
  writing-mode: vertical-rl;

  /* 縦書きにした際の高さを制限します。この値は画像の高さに応じて調整してください */
  max-height: 350px;

  /* 日本語を明朝体で表示するためのフォント設定 */
  font-family: "游明朝", YuMincho, "Hiragino Mincho ProN", "MS PMincho", serif;

  /* はみ出したテキストを非表示にする */
  overflow: hidden;
}

.amazon-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #3498db;
  /* ボタンの色 */
  color: white;
  text-decoration: none;
  border-radius: 5px;
  /* margin-top: 20px; */
  /* flexのgapで余白を管理するため不要に */
  transition: background-color 0.3s ease;
}

.amazon-button:hover {
  background-color: #2980b9;
  /* ホバー時の色 */
}

/* =================================
   About Page (about.html)
   ================================= */
.about-container {
  max-width: 800px;
  margin: 0 auto;
  background-color: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.profile-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
}

.about-container h2 {
  font-size: 2.5em;
  margin-top: 0;
  margin-bottom: 10px;
}

.about-container p {
  font-size: 1.1em;
  line-height: 1.8;
  text-align: left;
}

/* =================================
   Bluesky Feed (about.html)
   ================================= */
#bluesky-feed {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
  /* 上の要素との間に余白を追加 */
}

/* =================================
   Story Page (story.html)
   ================================= */
.story-container {
  max-width: 800px;
  margin: 0 auto;
  background-color: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.story-container h2 {
  font-size: 2.2em;
  margin-top: 0;
  text-align: center;
}

.story-description {
  text-align: center;
  line-height: 1.8;
  margin-bottom: 40px;
  color: #555;
}

.story-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid #eee;
}

.story-list li {
  border-bottom: 1px solid #eee;
}

.story-list a.item-title {
  display: block;
  padding: 20px 15px;
  text-decoration: none;
  color: #333;
  font-size: 1.2em;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-weight: 500;
}

.story-list a.item-title:hover,
.story-list a.item-title.active {
  background-color: #f9f9f9;
  color: #3498db;
}

.story-accordion-content {
  /* gridを使って高さをアニメーションさせる */
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 0.5s ease-out;
  background-color: #fdfdfd;
}

/* コンテンツをdivでラップしてpaddingを適用 */
.story-accordion-content>div {
  min-height: 0;
  padding: 0 30px;
}

.story-accordion-content.open {
  grid-template-rows: 1fr;
}

.story-accordion-content .publish-date {
  margin-top: -10px;
}

.loading-text {
  color: #888;
  text-align: center;
}

/* 記事内の「閉じる」ボタンのスタイル */
.close-link-wrapper {
  text-align: center;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #eee;
}

.close-accordion {
  text-decoration: none;
  color: #888;
  transition: color 0.3s ease;
}

.close-accordion:hover {
  color: #3498db;
}

/* =================================
   Story Content Page (sampleX.html)
   ================================= */
.story-content {
  max-width: 720px;
  /* 少し狭めて読みやすく */
  margin: 0 auto;
  background-color: #fff;
  padding: 50px 60px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);

  /* 日本語を明朝体で表示するためのフォント設定 */
  font-family: "游明朝", YuMincho, "Hiragino Mincho ProN", "MS PMincho", serif;
}

.story-content h1 {
  margin-top: 0;
}

.publish-date {
  color: #888;
  font-size: 0.9em;
}

/* =================================
   Responsive (for Smartphone)
   ================================= */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }

  .work-item {
    /* スマートフォンでは上下2段に配置 */
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    /* エリア名をリセットして、HTMLのソース順に表示させる */
    grid-template-areas:
      "image"
      "content";
  }
}

/* =================================
   Author Page Link Section (index.html)
   ================================= */
.author-page-link-section {
  text-align: center;
  padding: 50px 20px;
  background-color: #f0f2f5;
  /* 少し落ち着いた背景色 */
}

.author-page-link-section p {
  margin-top: 0;
  margin-bottom: 25px;
  font-size: 1.1em;
  color: #333;
}

.author-page-button {
  display: inline-block;
  padding: 15px 30px;
  background-color: #ff9900;
  /* Amazonのブランドカラー */
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.2em;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.author-page-button:hover {
  background-color: #e68a00;
  /* ホバー時の少し暗い色 */
}