/*!
Theme Name: Simplicity2 child
Template:   simplicity2
Version:    20161002
*/

/* Simplicity子テーマ用のスタイルを書く */

.anime-item {
  display: flex;
  margin-bottom: 15px;
  padding-bottom: 10px;
}

@media screen and (max-width: 768px) {
  #mobile-search {
    padding-bottom: 60px;
  }
  .mobile-header {
    background: #1f2b3a;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .header-icons span {
    margin-left: 10px;
    font-size: 20px;
  }
  .anime-list {
    padding: 10px;
  }
  .anime-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-right: 10px;
  }
  .anime-info h2 {
    margin: 0 0 5px;
    font-size: 16px;
  }
  #bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    background: #fff;
    border-top: 1px solid #ccc;
    z-index: 999;
  }
  #bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 12px;
    text-decoration: none;
    color: #333;
  }
}

/* スマホ用の設定 PCは見直した方がいいかも */
#h-top {
	min-height: 0;
}

@media screen and (max-width: 768px) {
	#body {
		margin-top: 0;
	}
}
.anime-single-page {
	font-size: 14px;
}

.anime-single-page h3 {
	font-size: 18px;
}

/* アニメ詳細情報のスタイル */
.anime-details-new {
  border-top: 1px dotted #ccc;
  margin: 20px 0;
}

.detail-row {
  display: flex;
  border-bottom: 1px dotted #ccc;
  padding: 10px 0;
  align-items: flex-start;
}

.detail-label {
  width: 30%;
  font-weight: bold;
	flex-shrink: 0;
}

.detail-value {
  width: 70%;
	word-break: break-word;
}

.anime-details-new ul {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}


/* PC用のスタイル */
@media screen and (min-width: 1111px) {
	#main {
		width: 870px;
	}
	#header-in, #navi-in, #body-in,
	#footer-in {
		width: 1200px;
	}
}



/* PC切り替えスタイル */
@media screen and (min-width: 1024px) {
  .anime-cover-summary-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 40px;
  }

  .anime-cover-wrapper {
    flex: 0 0 300px;
  }

  .anime-summary-wrapper {
    flex: 1;
  }

  .anime-cover-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 8px;
  }

  .anime-summary-wrapper h1 {
    margin-top: 0;
    font-size: 28px;
  }

  .anime-summary-wrapper p {
    font-size: 16px;
    line-height: 1.8;
  }
}

/* ボタンの設定 */
/* 共通ボタンスタイル */
.streaming-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 20px;
  margin-top: 20px;
  padding: 0 5px;
}

/* PCでは左寄せ */
@media screen and (min-width: 769px) {
  .streaming-buttons {
    justify-content: flex-start;
  }
}

/* スマホでは縦並び＆中央寄せ */
@media screen and (max-width: 768px) {
  .streaming-buttons {
    justify-content: center;
  }

  .streaming-buttons a {
    flex: 0 0 100%;
  }
}


/* CSS除去 */
.anime-single-page {
  padding: 5px;
}

.anime-details {
  margin-bottom: 40px;
}

.anime-details-new ul,
.detail-value ul {
  margin: 0;
}

#detail-hidden {
  display: none;
}

.toggle-container {
  text-align: center;
  margin-top: 20px;
}

#toggle-detail {
  color: #0073aa;
  text-decoration: none;
  font-size: 14px;
  display: inline-block;
}
.anime-casts-list {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 10px 0;
}

.cast-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cast-image-wrapper {
  position: relative;
  width: 100px;
  height: 140px;
  flex-shrink: 0;
}

.cast-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

.cast-name {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}


.cast-block {
  flex: 0 0 auto;
  text-align: center;
}

.cast-block img {
  border-radius: 8px;
}

/* 共通ボタンスタイル */
.streaming-button {
  display: inline-block;
  width: 100%;
  max-width: 250px;
  text-align: center;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  box-sizing: border-box;
}

/* 各サービスごとの色設定 */
.button-prime {
  background: #406cf7;
  color: white;
  border: 1px solid #406cf7;
}

.button-abema {
  background: #000000;
  color: white;
  border: 1px solid #000000;
}

.button-danime {
  background: #e05431;
  color: white;
  border: 1px solid #e05431;
}

.button-hulu {
  background: #59e427;
  color: white;
  border: 1px solid #59e427;
}

.button-netflix {
  background: #000000;
  color: #d90023;
  border: 1px solid #000000;
}

.button-fod {
  background: #000000;
  color: #d90023;
  border: 1px solid #000000;
}

.button-disney {
  background: #44b6c4;
  color: black;
  border: 1px solid #44b6c4;
}

.button-unext {
  background: white;
  color: black;
  border: 1px solid black;
}

.button-bandai {
  background: #2b64a7;
  color: white;
  border: 1px solid #2b64a7;
}

.button-lemino {
  background: #ea006d;
  color: white;
  border: 1px solid #ea006d;

  /*
  background-color: #fc466b;
  background: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
  color: white;
  border: 1px solid transparent;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  */
}

.button-dmm {
  background: white;
  color: black;
  border: 1px solid black;
}

.button-rakuten {
  background: white;
  color: #c60911;
  border: 1px solid #c60911;
}

.button-animehodai {
  background: white;
  color: #00aceb;
  border: 1px solid #00aceb;
}


.button-jcom {
  background: white;
  color: #e05431;
  border: 1px solid #e05431;
}

.button-terasa {
  background: white;
  color: #e05431;
  border: 1px solid black;
}

.button-milplus {
  background: #8dc63f;
  color: #f7931e;
  border: 1px solid #8dc63f;
  /*
  background-color: #f7931e;
  background: linear-gradient(to right, #f7931e 0%, #f7931e 50%, #8dc63f 50%, #8dc63f 100%);
  color: white;
  border: 1px solid #8dc63f;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  */
}

.anime-toggle { text-align: right; margin: 10px 0; }
.anime-toggle button { margin-left: 5px; cursor: pointer; }
.anime-toggle i {
	font-size: 20px;
}
.anime-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  justify-content: center;
  max-width: 960px;
  margin: 0 auto;
  text-align: left;
}
.anime-grid.active {
  display: grid;
}
.anime-grid .anime-item {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.anime-grid .anime-item img {
  width: 100%;
  height: 225px;
  object-fit: cover;
  border-radius: 8px;
}
.anime-grid .anime-item p {
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  border-bottom: none;
}
/* アニメリスト（リスト表示）の初期非表示とactive時の表示切替 */
.anime-list {
  display: none;
}
.anime-list.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.anime-list .anime-item {
  display: flex;
  gap: 15px;
  width: 100%;
  min-height: 160px;
  box-sizing: border-box;
  border-bottom: 1px solid #ccc;
}
.anime-list .anime-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.anime-list .anime-info h3 {
  margin: 0 0 4px 0;
}
.anime-list .anime-info p {
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.anime-list .anime-item img {
  border-radius: 8px;
  width: 120px;
  height: 180px;
  object-fit: cover;
}
@media screen and (max-width: 768px) {
  .anime-grid {
    display: none !important;
    grid-template-columns: repeat(auto-fill, minmax(45%, 1fr));
    gap: 8px;
    padding: 0 8px;
    justify-content: space-between;
  }

  .anime-grid.active {
    display: grid !important;
  }

  .anime-grid .anime-item {
    width: 100% !important;
    margin: 0;
    text-align: left;
  }

  .anime-grid .anime-item img {
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
  }

  .anime-grid .anime-item p {
    font-size: 14px;
    margin-top: 4px;
    padding: 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.section-title {
  font-size: 18px;
  font-weight: bold;
  margin: 10px 15px 5px;
}

.anime-scroll-wrapper {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
.anime-card {
  position: relative;
  flex: 0 0 auto;
  width: 180px;
  scroll-snap-align: start;
  text-align: center;
}
.rank-label {
  position: absolute;
  top: 5px;
  left: 5px;
  background-color: rgba(0,0,0,0.7);
  color: white;
  font-size: 30px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
}
.anime-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 8px;
}
.anime-card p {
  margin-top: 8px;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 比率を保ったアイコン表示とレスポンシブ列数調整 */
.anime-grid .anime-item img {
  aspect-ratio: 146 / 208.57;
  object-fit: cover;
  width: 100%;
  height: auto !important;
}

/* 追加スタイル */
/* 修正: .anime-grid .anime-item 比率指定削除、flex: 1 1 auto 追加 */
.anime-grid .anime-item {
  display: flex;
  flex-direction: column;
  text-align: center;
  overflow: hidden;
  flex: 1 1 auto;
}

/* 修正: .anime-grid .anime-item img 高さauto, aspect-ratio指定 */
.anime-grid .anime-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 146 / 208.57;
  object-fit: cover;
  border-radius: 8px;
}

/* 横スクロール防止 */
.anime-grid {
  overflow-x: hidden;
}

/* スマホ幅に応じたグリッド列数設定 */
@media screen and (max-width: 223px) {
  .anime-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}
@media screen and (min-width: 224px) and (max-width: 319px) {
  .anime-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media screen and (min-width: 320px) and (max-width: 415px) {
  .anime-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media screen and (min-width: 416px) and (max-width: 511px) {
  .anime-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media screen and (min-width: 512px) and (max-width: 768px) {
  .anime-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Added styles for kana filter */
.initial-filter-wrapper {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.custom-dropdown-wrapper {
  position: relative;
}

.initial-filter-button {
  height: 44px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0 40px 0 16px;
  min-width: 200px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  position: relative;
}

.initial-filter-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.initial-options-list {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 4px 0;
  margin: 4px 0 0;
  list-style: none;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.initial-option-item {
  padding: 6px 16px;
  cursor: pointer;
}

.initial-option-item.selected {
  background: #eee;
}
.initial-filter-form {
  margin: 0;
}
.toggle-view-switch {
  display: flex;
  gap: 8px;
}


.sidebar {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
}

/* New styles for sidebar ranking */
.sidebar-ranking {
  padding: 10px;
}
.sidebar-ranking .anime-card {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  border-bottom: 1px solid #ccc;
  padding-bottom: 10px;
  margin-bottom: 15px;
}
.sidebar-ranking .anime-card img {
  width: 120px;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
}
.sidebar-ranking .anime-card .anime-info {
  flex: 1;
}
.sidebar-ranking .anime-card .anime-info p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.sidebar-anime-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-anime-list-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.sidebar-anime-list-item img {
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.sidebar-anime-list-item-title {
  font-size: 14px;
  font-weight: bold;
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.sidebar-anime-list-item-description {
  font-size: 12px;
  line-height: 1.4;
  margin-top: 4px;
  color: #666;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(120px - 1.4em - 10px);
  -webkit-line-clamp: unset;
}

.anime-scroll-wrapper {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 10px;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: auto; /* Firefox */
}

.anime-scroll-wrapper::-webkit-scrollbar {
  height: 8px;
}

.anime-scroll-wrapper::-webkit-scrollbar-thumb {
  background-color: rgba(100, 100, 100, 0.6);
  border-radius: 4px;
}

.anime-scroll-wrapper::-webkit-scrollbar-track {
  background-color: transparent;
}
.anime-card {
  flex: 0 0 auto;
}
