/**
 * Card carousel — DADS carousel control aesthetics + scroll-snap track
 * Inspired by https://github.com/digital-go-jp/design-system-example-components-html (carousel)
 */

.cl-carousel {
  --cl-carousel-visible: 5;
  --cl-carousel-gap: 0.85rem;
  position: relative;
  display: block;
  margin-top: 0.5rem;
  padding: 0.25rem 2.75rem 2.75rem;
}

.cl-carousel__btn {
  position: absolute;
  top: calc(50% - 2.1rem);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #fff;
  color: var(--cl-text-strong, #1a1a1a);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.12);
  cursor: pointer;
  padding: 0;
}

.cl-carousel__btn--prev {
  left: 0;
}

.cl-carousel__btn--next {
  right: 0;
}

.cl-carousel__btn:hover {
  background: var(--cl-brand-soft, #eaf6ef);
  border-color: var(--cl-brand, #2f8f5b);
}

.cl-carousel__btn:focus-visible {
  outline: 0.25rem solid #000;
  outline-offset: 0.125rem;
  box-shadow: 0 0 0 0.125rem var(--color-primitive-yellow-300, #ffd43d);
}

.cl-carousel__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cl-carousel__status {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--color-neutral-solid-gray-800, #333);
  min-width: 3.5rem;
  text-align: center;
}

.cl-carousel__viewport {
  /* カード枠線・フォーカスが欠けないよう余白を確保 */
  overflow: hidden;
  padding: 2px;
  margin: 0;
  box-sizing: border-box;
}

.cl-carousel__track {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0.5rem;
  display: flex;
  gap: var(--cl-carousel-gap, 0.85rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* 端が欠けて見えるネイティブバーは使わず、上下の操作UIに任せる */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cl-carousel__track::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.cl-carousel__track > li {
  /* width overridden by dads-grid.css for equal columns */
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-width: 0;
  display: flex;
  align-items: stretch;
  align-self: stretch;
  /* 枠線・アウトライン用 */
  padding: 1px;
  box-sizing: border-box;
}

.cl-carousel__track > li > .cl-dads-card {
  max-width: none;
  width: 100%;
  flex: 1 1 auto;
  min-height: 100%;
}

.cl-carousel__dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.cl-carousel__dot {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--color-neutral-solid-gray-800, #333);
  border-radius: 50%;
  background: #fff;
  color: var(--color-neutral-solid-gray-800, #333);
  font-weight: 700;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0;
}

.cl-carousel__dot[aria-current="true"] {
  background: var(--color-neutral-solid-gray-800, #333);
  color: #fff;
  box-shadow: 0 0 0 2px #fff;
  outline: 1px solid var(--color-neutral-solid-gray-800, #333);
  outline-offset: 2px;
}

.cl-carousel__play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #fff;
  color: #222;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
  cursor: pointer;
  padding: 0;
}

.cl-carousel__play:focus-visible,
.cl-carousel__btn:focus-visible {
  outline: 0.25rem solid #000;
  outline-offset: 0.125rem;
  box-shadow: 0 0 0 0.125rem #ffd43d;
}

.cl-carousel__playback {
  position: absolute;
  right: 2.75rem;
  bottom: 0;
  display: flex;
  gap: 0.35rem;
}

.cl-ev-slide,
.cl-ev-slide__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  color: #222;
  text-decoration: none;
}

.cl-ev-slide {
  padding: 0.55rem 0.55rem 0.7rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 3px 1px rgb(128 128 128 / 0.2);
}

.cl-ev-slide__media {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 8.25rem;
  border-radius: 8px;
  background: linear-gradient(160deg, #e7f3c4, #f6f8d1);
}

.cl-ev-slide__month {
  font-size: 0.8125rem;
  font-weight: 700;
}

.cl-ev-slide__day {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}

.cl-ev-slide__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.2rem 0.1rem;
}

.cl-ev-slide__title {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
}

.cl-ev-slide__meta {
  font-size: 0.75rem;
  line-height: 1.4;
}

.cl-carousel__track > li.is-current .cl-ev-slide {
  background: #f4f1a3;
}

@media (prefers-reduced-motion: reduce) {
  .cl-carousel__track {
    scroll-behavior: auto;
  }
}
