/* style.css (トップページ用 アニメーション削除) */

body {
    font-family: 'M PLUS Rounded 1c', sans-serif; /* Google Fontsの指定を優先 */
    margin: 0;
    background-color: #f0f0f0; /* 全体の背景を明るいグレーに */
    color: #333;
    line-height: 1.6; /* 行間を少し広げる */
    overflow-x: hidden;
}

/* ticker.css */
.ticker-section {
  margin: 30px 0;
  font-family: "M PLUS Rounded 1c", sans-serif;
}

.ticker-section h2 {
  font-size: 20px;
  color: #333;
  margin-bottom: 10px;
}

.ticker-wrap {
  width: 100%;
  overflow: hidden;
  background-color: #111;
  color: #0f0;
  border-top: 2px solid #0f0;
  border-bottom: 2px solid #0f0;
  padding: 8px 0;
  box-sizing: border-box;
  position: relative;
}

/* スクロールエリア */
.ticker {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite; /* ← 速度：数値を小さくすれば速く、大きくすれば遅く */
}

/* 各項目 */
.ticker-item {
  display: inline-block;
  margin-right: 80px;
  font-size: 16px;
  letter-spacing: 0.5px;
}

/* アニメーション */
@keyframes ticker-scroll {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* ===== スマホ対応 ===== */
@media screen and (max-width: 600px) {
  .ticker-section h2 {
    font-size: 16px;
    margin-bottom: 5px;
  }

  .ticker-wrap {
    padding: 6px 0;
  }

  .ticker-item {
    font-size: 14px;
    margin-right: 40px;
  }

  .ticker {
    animation-duration: 60s; /* スマホではゆっくりに */
  }
}


/* 全体的なコンテナ（必要であれば追加） */
.container {
    max-width: 1200px; /* サイト全体の最大幅を設定 */
    margin: 0 auto; /* 中央寄せ */
    padding: 20px;
}

h1, h2, h3 {
    color: #2196f3; /* 青系のアクセントカラー */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05); /* 影を薄く */
    margin-bottom: 0.8em;
    font-weight: 700; /* 太字 */
}

h1 {
    font-size: 3.2em; /* 少し大きく */
    text-align: center;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

h2 {
    font-size: 2.4em; /* 少し大きく */
    margin-top: 2.5em;
    border-bottom: 4px solid #2196f3; /* 下線を強調 */
    padding-bottom: 0.6em;
    text-align: center; /* 中央寄せ */
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    display: block; /* imgをブロック要素にして、中央寄せやマージン調整を容易にする */
    margin: 0 auto; /* 中央寄せ */
}

img:hover {
    transform: scale(1.03); /* ホバー時の拡大率を微調整 */
    opacity: 0.9;
}

p {
    margin-bottom: 1em; /* 段落下の余白を調整 */
    color: #555;
    font-size: 1em; /* デフォルトサイズに戻すか、少し調整 */
    justify-self: center;
}

a {
    color: #2196f3;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0b7dda;
    text-decoration: underline;
}

/* ul の一般的なスタイル（最近のアニメリストにも適用される） */
ul {
    list-style: none;
    padding: 0;
    margin: 0; /* デフォルトマージンをリセット */
}

/* 検索セクション */
#search-section {
    background-color: #fff;
    padding: 40px;
    text-align: center;
    border-radius: 10px;
    margin: 30px auto;
    max-width: 800px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); /* 影を強調 */
}

#search-section label {
    font-size: 1.2em;
    margin-bottom: 15px;
}

#search-section input[type="text"] {
    width: 70%; /* 幅を調整 */
    padding: 12px;
    border: 1px solid #bbb; /* ボーダーの色を調整 */
    border-radius: 8px;
    font-size: 1.1em;
    margin-bottom: 20px;
}

#search-section button[type="submit"] {
    background-color: #2196f3;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

#search-section button[type="submit"]:hover {
    background-color: #0b7dda;
}

/* 最近登録されたアニメ */
#recent-animes {
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

#recent-animes h2 {
    margin-bottom: 30px;
}

#recent-animes .recent-anime-list { /* 新しいクラス名を使用 */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* カードの最小幅を調整 */
    gap: 30px; /* カード間の余白を調整 */
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#recent-animes .recent-anime-list li {
    background-color: #fdfdfd; /* アイテムの背景色をより白に */
    padding: 25px; /* 要素内の余白を調整 */
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* 影を調整 */
    display: flex;
    flex-direction: column; /* 要素を縦に並べる */
    align-items: center; /* 水平方向の中央寄せ */
    text-align: center; /* テキストを中央寄せ */
    transition: transform 0.2s ease-in-out;
}

#recent-animes .recent-anime-list li:hover {
    transform: translateY(-8px); /* ホバー時の浮き上がりを強調 */
}

#recent-animes .recent-anime-list li img {
    /* 以前の指定 */
    /* max-width: 100%; */
    /* height: 180px; */
    /* object-fit: cover; */ /* これを contain に変更 */
    /* width: 200px; */ /* これは画像の幅を固定する場合に有効 */

    /* ★ 修正後の推奨設定 ★ */
    max-width: 200px; /* 画像の最大幅。この幅を超えないようにする */
    max-height: 180px; /* 画像の最大高さ。この高さを超えないようにする */
    width: auto; /* 幅を自動調整 */
    height: auto; /* 高さを自動調整 */
    object-fit: contain; /* トリミングせずにアスペクト比を維持して収める */
    display: block; /* imgをブロック要素にして、中央寄せを有効にする */
    margin: 0 auto 15px auto; /* 中央寄せと下の余白 */

    /* その他のスタイルは維持 */
    border-radius: 8px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

#recent-animes .recent-anime-list li h3 {
    font-size: 1.5em; /* タイトルを大きく */
    margin-bottom: 10px;
    min-height: 2em; /* タイトルが1行または2行でも高さが揃うように */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 2行に制限 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

#recent-animes .recent-anime-list li p {
    font-size: 0.95em; /* テキストサイズ調整 */
    color: #666;
    margin-bottom: 15px;
}

.synopsis-preview {
    font-size: 0.9em; /* あらすじの文字を小さく */
    line-height: 1.4;
    height: 3.6em; /* 3行分の高さ (0.9em * 1.4 * 3行 = 3.78em くらい) */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* あらすじを3行に制限 */
    -webkit-box-orient: vertical;
    margin-bottom: 15px;
}


#recent-animes .recent-anime-list li a {
    display: inline-block; /* ボタンのように見せる */
    background-color: #2196f3;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    margin-top: auto; /* ボタンを要素の最下部に配置 */
}

#recent-animes .recent-anime-list li a:hover {
    background-color: #0b7dda;
    text-decoration: none;
}

.adbr {
  text-align: center;
  margin: 1rem auto;
  max-width: 100%;
  padding: 0;
  pointer-events: none; /* デフォルトでは選択不可 */
}

.adbr a {
  display: inline-block;
  pointer-events: auto; /* 画像のリンクのみ選択・クリック可能 */
}

.adbr img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}

/* 小さい画面対応 */
@media screen and (max-width: 768px) {
  .adbr {
    margin: 0.5rem auto;
  }
}


/* フッターのスタイル */
footer {
    text-align: center;
    padding: 30px;
    background-color: #333;
    color: #fff;
    margin-top: 40px;
    font-size: 0.95em;
}

footer ul {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 25px;
}

footer a {
    color: #eee;
}

footer a:hover {
    color: #fff;
}

/* テキスト選択の禁止 */
body {
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none;   /* Safari */
    -khtml-user-select: none;    /* Konqueror HTML */
    -moz-user-select: none;      /* Old versions of Firefox */
    -ms-user-select: none;       /* Internet Explorer/Edge */
    user-select: none;           /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
}

@media screen and (max-width: 768px) {

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 2em;
        margin-top: 2em;
        padding-bottom: 0em;
    }

    header p {
        font-size: 0.8em;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    footer ul {
        font-size: x-small;
        gap: 8px;
    }
}
