/* Front page styles extracted from front-page-custom.php. */
/* ===== Global Styles ===== */
body {
  background-color: var(--ts-color-bg);
  color: var(--ts-color-ink);
}
.total-post-counter {
  text-align: center;
  font-size: 1.8rem;
  font-weight: bold;
  margin: 30px 0 20px;
  color: var(--ts-color-ink);
  font-family: 'Helvetica Neue', Arial, sans-serif;
}
.total-post-counter #count-number {
  font-size: 2.2rem;
  color: var(--ts-color-red);
  transition: all 0.3s ease;
}
.total-post-counter p { margin: 0; }

.genre-map-entry {
  width: min(92%, 720px);
  margin: 0 auto 26px;
}
.genre-map-entry a {
  display: grid;
  gap: 6px;
  padding: 18px 22px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(247, 219, 171, .9), rgba(255, 255, 255, .94) 52%, rgba(230, 237, 244, .9)),
    var(--ts-color-surface);
  border: 1px solid rgba(2, 35, 80, .12);
  color: var(--ts-color-ink);
  text-align: center;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(2, 35, 80, .08);
  transition: transform .18s ease, box-shadow .18s ease;
}
.genre-map-entry a:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(2, 35, 80, .12);
}
.genre-map-entry__eyebrow {
  color: var(--ts-color-gold);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.genre-map-entry strong {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  line-height: 1.35;
}
.genre-map-entry span:last-child {
  color: var(--ts-color-muted);
  font-size: .9rem;
  line-height: 1.65;
}

/* ===== Popular Posts Carousel ===== */
.popular-posts-carousel .carousel-link,
.popular-posts-carousel .carousel-link h3,
.popular-posts-carousel .carousel-link p {
  text-decoration: none;
}
.popular-posts-carousel {
  max-width: 400px;
  margin: 0 auto 20px auto;
  padding: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  visibility: hidden;
}
.popular-posts-carousel.initialized {
  visibility: visible;
}
.popular-posts-carousel .swiper-slide {
  padding: 10px 0;
  position: relative;
  overflow: hidden;
  background: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  height: 100%;
  min-height: 320px; /* Ensure uniform height */
}
.popular-posts-carousel .swiper-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1;
}
.popular-posts-carousel .carousel-link {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  height: 100%;
  padding-top: 10px;
  box-sizing: border-box;
  max-height: 100%;
  overflow: hidden;
  width: 100%;
}
.popular-posts-carousel .carousel-link img {
  width: 100%;
  max-width: 200px;
  height: 200px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto;
  flex-shrink: 0;
}
.popular-posts-carousel .carousel-title {
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
  line-height: 1.3;
  color: var(--ts-color-ink);
  max-height: 2.6em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: 8px;
}
.popular-posts-carousel .carousel-subtitle {
  font-size: 0.9rem;
  color: #555;
  margin-top: 4px;
  text-align: center;
  line-height: 1.3;
  max-height: 2.6em;
  min-height: 2.6em; /* Reserve two lines’ height */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.swiper-button-prev,
.swiper-button-next {
  color: #666 !important;
  top: 50%;
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  font-size: 18px;
}
.swiper-button-prev:hover,
.swiper-button-next:hover {
  color: #333 !important;
}

/* ===== Category Badge (cat-label) ===== */
.cat-label {
  position: relative;
  z-index: 2;
  margin-top: 0;
  margin-bottom: 8px;
  display: inline-block;
  color: var(--ts-color-surface) !important;
  padding: 2px 10px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 9999px;
  max-width: 90%;
  text-decoration: none;
  white-space: normal;
  word-break: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* カテゴリIDごとの色分け (ヴィンテージ調) */
.cat-label-2  { background: var(--ts-color-gold) !important; } /* 楽曲レビュー */
.cat-label-91 { background: var(--ts-color-album) !important; } /* アルバムレビュー */
.cat-label-81 { background: var(--ts-color-artist) !important; } /* アーティスト解説 */
.cat-label-1002 { background: var(--ts-color-genre) !important; } /* ジャンル解説 */
.cat-label-default { background: var(--ts-color-neutral) !important; } /* その他 */

/* ===== Card Grid ===== */
#post-cards {
  display: block;
  width: min(96%, 1080px);
  margin: 0 auto 2.6rem;
}
.card-thumbnail img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0;
  transition: transform .24s ease;
}
.card-thumbnail {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background: #edf1f5;
}
.tab-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 22px;
  padding: 0;
  border: 0;
  background: transparent;
}
.tab-status {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--ts-color-surface);
  border-radius: 8px;
  color: #4d6178;
  text-align: center;
}
.card {
  background-color: var(--ts-color-surface);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  padding: 14px;
  border: 1px solid rgba(2, 35, 80, .1);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(2, 35, 80, .06);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(216, 91, 91, .22);
  box-shadow: 0 16px 34px rgba(2, 35, 80, .1);
}
.card:hover .card-thumbnail img {
  transform: scale(1.025);
}
.card-link-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
}
/* Keep card internals layered while the transparent overlay handles full-card clicks. */
.card * {
  position: relative;
  z-index: 2;
}
.card .card-link-overlay {
  z-index: 5;
}
.card > .cat-label {
  align-self: flex-start;
  margin: 12px 0 0;
  max-width: 100%;
}
.card-artist,
.card-title {
  margin: 10px 0 0;
  color: var(--ts-color-ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a {
  color: inherit;
  text-decoration: none;
}
.card-subtitle {
  min-height: 2.9em;
  margin: 6px 0 0;
  color: var(--ts-color-muted);
  font-size: .86rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-date {
  margin: auto 0 0;
  padding-top: 12px;
  color: #8a97a6;
  font-size: .72rem;
  line-height: 1.3;
}

/* ===== Filter Tabs (Inverted Colors) ===== */
.filter-tabs ul {
  background-color: var(--ts-color-surface);
  padding: .2em .8em;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.filter-tabs li {
  background: var(--ts-color-surface); /* non-active white background */
  color: var(--ts-color-ink);   /* non-active navy text */
  font-weight: bold;
  padding: 6px 16px;
  font-size: 0.95rem;
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}
.filter-tabs li.active {
  background: var(--ts-color-ink); /* active navy background */
  color: var(--ts-color-surface);         /* active white text */
}

/* ===== Load More Button ===== */
.load-more-button {
  display: block;
  margin: 2em auto;
  padding: 8px 24px;
  background-color: transparent;
  color: #112536;
  border: none;
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: bold;
  text-align: center;
  text-transform: lowercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

.load-more-button:hover {
  text-decoration: underline;
}

/* ===== Responsive & Mobile Adjustments ===== */
@media screen and (max-width: 768px) {
  .popular-posts-carousel .carousel-title,
  .popular-posts-carousel .carousel-subtitle,
  .popular-posts-carousel .cat-label {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    width: 90%;
    text-align: center;
    line-height: 1.4;
    font-size: 0.85rem;
    margin: 4px 0;
  }
  .popular-posts-carousel .swiper-slide {
    /* Reduce min-height and bottom spacing for mobile */
    padding: 10px 10px 4px 10px;
    min-height: 280px !important; /* 固定高さを指定 */
    max-height: 280px !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  .popular-posts-carousel .carousel-title {
    margin-top: 4px;
    margin-bottom: 4px;
  }
  .popular-posts-carousel .carousel-subtitle {
    margin-top: 2px;
    margin-bottom: 4px;
  }
  .popular-posts-carousel .carousel-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
  }
  .popular-posts-carousel .carousel-link img {
    width: 85%;
    max-width: 150px;
    height: 150px;
    object-fit: cover;
    margin: 0 auto 4px auto;
  }
  .tab-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 10px;
  }
  .cat-label {
    font-size: .66rem;
    max-width: 90%;
  }
  .card {
    padding: 10px;
  }
  .card > .cat-label {
    margin-top: 9px;
  }
  .card-artist,
  .card-title {
    margin-top: 8px;
    font-size: .84rem;
    line-height: 1.42;
  }
  .card-subtitle {
    min-height: 2.8em;
    margin-top: 4px;
    font-size: .74rem;
    line-height: 1.4;
  }
  .card-date {
    padding-top: 9px;
    font-size: .66rem;
  }
  .filter-tabs ul {
    padding: .2em .6em;
  }
  .filter-tabs li {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 16px;
  }
}
@media screen and (min-width: 769px) {
  .popular-posts-carousel {
    max-width: 100%;
    width: 100%;
    padding: 20px 0;
    margin: 0 0 20px 0;
    border-radius: 0;
  }
  .popular-posts-carousel .swiper-wrapper {
    margin-left: 20px;
    margin-right: 20px;
  }
  .popular-posts-carousel .swiper-slide {
    min-height: 320px;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
  }
  .popular-posts-carousel .carousel-link img {
    width: 100%;
    max-width: 200px;
    height: 200px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 auto;
    flex-shrink: 0;
  }
}
