/* ── Rich Post Carousel v1.2.0 ── */

/* wrapper — no side padding, arrows overlap cards */
.rpc-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 32px auto;
  padding: 0;
  box-sizing: border-box;
}

/* viewport */
.rpc-viewport {
  overflow: hidden;
}

.rpc-track {
  display: flex;
  gap: 18px;
  transition: transform .55s cubic-bezier(.25, .8, .25, 1);
}

/* card — wider with no wrapper padding */
.rpc-card {
  flex: 0 0 calc((100% - 54px) / 4);
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  opacity: 0;
  transform: translateY(24px);
  transition: transform .3s;
}

.rpc-card:hover {
  transform: translateY(-4px);
}

.rpc-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* thumbnail - 16:9 */
.rpc-card__thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  overflow: hidden;
  background: #e8e8e8;
}

.rpc-card__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}

.rpc-card:hover .rpc-card__img {
  transform: scale(1.05);
}

.rpc-card__noimg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #aaa;
  background: #f0f0f0;
}

/* body */
.rpc-card__body {
  padding: 12px 12px 10px;
  background: #fff;
  border-radius: 0 0 12px 12px;
}

.rpc-card__title {
  margin: 0 0 6px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #222;
  border: none;
  background: none;
  text-decoration: none;
}

.rpc-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rpc-card__date {
  font-size: 11px;
  color: #888;
  letter-spacing: .02em;
}

/* ── arrows — white, shadow, overlapping cards ── */
.rpc-arrow {
  position: absolute;
  top: 50%;
  z-index: 10;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15), 0 4px 24px rgba(0, 0, 0, .08);
  opacity: 0;
  transition: transform .3s cubic-bezier(.25, .8, .25, 1), box-shadow .3s, opacity .3s;
}

.rpc-arrow svg {
  stroke: #333;
  stroke-width: 2.5;
}

.rpc-arrow:hover {
  transform: translateY(-50%) scale(1.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .22), 0 8px 32px rgba(0, 0, 0, .10);
}

.rpc-arrow:active {
  transform: translateY(-50%) scale(.92);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
}

.rpc-arrow--prev {
  left: 12px;
}

.rpc-arrow--next {
  right: 12px;
}

.rpc-arrow[disabled] {
  opacity: 0 !important;
  cursor: default;
  pointer-events: none;
  animation: none !important;
}

/* ── arrow entrance: bounce-pop ── */
@keyframes rpc-arrow-pop {
  0% {
    opacity: 0;
    transform: translateY(-50%) scale(.3);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.18);
  }
  72% {
    transform: translateY(-50%) scale(.94);
  }
  100% {
    opacity: .95;
    transform: translateY(-50%) scale(1);
  }
}

.rpc-wrapper.rpc-ready .rpc-arrow:not([disabled]) {
  animation: rpc-arrow-pop .6s cubic-bezier(.25, .8, .25, 1) .35s both;
}

/* ── card entrance animation ── */
.rpc-wrapper.rpc-ready .rpc-card {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .5s ease, transform .5s ease;
}

.rpc-wrapper.rpc-ready .rpc-card:nth-child(1) { transition-delay: .05s; }
.rpc-wrapper.rpc-ready .rpc-card:nth-child(2) { transition-delay: .12s; }
.rpc-wrapper.rpc-ready .rpc-card:nth-child(3) { transition-delay: .19s; }
.rpc-wrapper.rpc-ready .rpc-card:nth-child(4) { transition-delay: .26s; }
.rpc-wrapper.rpc-ready .rpc-card:nth-child(5) { transition-delay: .33s; }
.rpc-wrapper.rpc-ready .rpc-card:nth-child(6) { transition-delay: .40s; }

/* ── タブレット（3列） ── */
@media (max-width: 960px) {
  .rpc-card {
    flex: 0 0 calc((100% - 36px) / 3);
  }
  .rpc-track {
    gap: 18px;
  }
}

/* ── モバイル（2列） ── */
@media (max-width: 680px) {
  .rpc-wrapper {
    margin: 20px auto;
  }
  .rpc-card {
    flex: 0 0 calc((100% - 12px) / 2);
  }
  .rpc-track {
    gap: 12px;
  }
  .rpc-card__title {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }
  .rpc-card__body {
    padding: 10px 10px 8px;
  }
  .rpc-arrow {
    width: 38px;
    height: 38px;
  }
  .rpc-arrow svg {
    width: 16px;
    height: 16px;
  }
  .rpc-arrow--prev {
    left: 8px;
  }
  .rpc-arrow--next {
    right: 8px;
  }
}

/* ── 小型モバイル ── */
@media (max-width: 400px) {
  .rpc-card {
    flex: 0 0 calc((100% - 10px) / 2);
  }
  .rpc-track {
    gap: 10px;
  }
  .rpc-arrow--prev {
    left: 6px;
  }
  .rpc-arrow--next {
    right: 6px;
  }
}
