/* =========================
   Topics Slider
========================= */

.rm-topics {
  padding: 50px 0 50px 20px;
 background: rgba(245,243,238,0.8);
  overflow: hidden;
}

.rm-topics__inner {
  max-width: 1360px;
  margin: 0 auto;
}

.rm-topics__head {
  padding-right: 20px;
  margin-bottom: 44px;
  text-align: center;
}

.rm-topics__lead {
  margin: 0 0 12px;
  color: #8c5c1e;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.rm-topics__title {
  margin: 0;
  color: #8c5c1e;
  font-size: clamp(23px, 3.6vw, 30px);
  line-height: 1.25;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.rm-topics__slider {
  position: relative;
  padding-right: 20px;
}

.rm-topics__viewport {
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
}

.rm-topics__viewport.is-dragging {
  cursor: grabbing;
}

.rm-topics__track {
  display: flex;
  gap: 28px;
  will-change: transform;
}

.rm-topic-card {
  flex: 0 0 calc((100% - 28px * 2) / 3.2);
  min-width: 0;
}

.rm-topic-card a {
  display: block;
  height: 100%;
  background: #fff;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  border: 1px solid rgba(140, 92, 30, 0.08);
  border-radius: 20px;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.rm-topic-card a:hover,
.rm-topic-card a:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(80, 62, 34, 0.08);
}

.rm-topic-card a:focus-visible {
  outline: none;
}

.rm-topic-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #ebe7de;
  border-radius: 20px 20px 0 0;
}

.rm-topic-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s ease;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.rm-topic-card a:hover .rm-topic-card__thumb img,
.rm-topic-card a:focus-visible .rm-topic-card__thumb img {
  transform: scale(1.04);
}

.rm-topic-card__body {
  padding: 24px 22px 24px;
}

.rm-topic-card__meta {
  margin: 0 0 12px;
  color: #9f8661;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.rm-topic-card__title {
  margin: 0 0 12px;
  color: #6f7d45;
  font-size: 22px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.rm-topic-card__text {
  margin: 0;
  color: #735a39;
  font-size: 15px;
  line-height: 1.95;
  letter-spacing: 0.03em;
  font-weight: 400;
}

/* arrows */

.rm-topics__arrow {
  position: absolute;
  top: calc(50% - 18px);
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(80, 62, 34, 0.12);
  cursor: pointer;
  z-index: 3;
  transition: transform 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
}

.rm-topics__arrow:hover {
  transform: translateY(-50%) scale(1.04);
  box-shadow: 0 12px 32px rgba(80, 62, 34, 0.18);
}

.rm-topics__arrow span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-top: 2px solid #8c5c1e;
  border-right: 2px solid #8c5c1e;
}

.rm-topics__arrow--prev {
  left: -6px;
}

.rm-topics__arrow--prev span {
  transform: translate(-35%, -50%) rotate(-135deg);
}

.rm-topics__arrow--next {
  right: 2px;
}

.rm-topics__arrow--next span {
  transform: translate(-65%, -50%) rotate(45deg);
}

/* dots */

.rm-topics__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  padding-right: 20px;
}

.rm-topics__dot {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: rgba(140, 92, 30, 0.22);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, opacity 0.25s ease;
}

.rm-topics__dot:hover {
  transform: scale(1.1);
}

.rm-topics__dot.is-active {
  background: #8c5c1e;
  transform: scale(1.15);
}

.rm-topics__arrow.is-disabled {
  opacity: 0.25;
  cursor: default;
}

.rm-topics__arrow.is-hidden,
.rm-topics__dots.is-hidden {
  display: none;
}

/* =========================
   Topics Category Label
========================= */

.rm-topic-card__cat {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* 無料体験 */
.rm-topic-card__cat--free-trial {
  background: #f8dbe6;
  color: #9a5870;
}

/* 訪問看護サービス */
.rm-topic-card__cat--nursing-service {
  background: #dff1df;
  color: #587a58;
}

/* ソーシャルラウンジ */
.rm-topic-card__cat--social-lounge {
  background: #dbeaf8;
  color: #58739a;
}

/* 自費サービス */
.rm-topic-card__cat--private-service {
  background: #f8e7d6;
  color: #9a6e47;
}

/* 予備 */
.rm-topic-card__cat--trial {
  background: #f8dbe6;
  color: #9a5870;
}

.rm-topic-card__cat--service {
  background: #dff1df;
  color: #587a58;
}

/* tablet: 2.2枚 */

@media (max-width: 1024px) {
  .rm-topics {
    padding: 100px 0 100px 20px;
  }

  .rm-topics__track {
    gap: 24px;
  }

  .rm-topic-card {
    flex: 0 0 calc((100% - 24px) / 2.2);
  }

  .rm-topic-card__title {
    font-size: 20px;
  }
}

/* sp: 1.2枚 */

@media (max-width: 767px) {
  .rm-topics {
    padding: 72px 0 72px 16px;
  }

  .rm-topics__head {
    padding-right: 16px;
    margin-bottom: 28px;
  }

  .rm-topics__lead {
    margin-bottom: 8px;
    font-size: 14px;
  }

  .rm-topics__title {
    font-size: 28px;
  }

  .rm-topics__slider {
    padding-right: 16px;
  }

  .rm-topics__track {
    gap: 18px;
  }

  .rm-topic-card {
    flex: 0 0 calc((100% - 18px) / 1.2);
  }

  .rm-topic-card a {
    box-shadow: 0 6px 16px rgba(80, 62, 34, 0.06);
  }

  .rm-topic-card__body {
    padding: 18px 16px 20px;
  }

  .rm-topic-card__title {
    font-size: 18px;
  }

  .rm-topic-card__text {
    font-size: 14px;
    line-height: 1.8;
  }

  .rm-topic-card__cat {
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    font-size: 10px;
  }

  .rm-topics__arrow {
    width: 42px;
    height: 42px;
    top: calc(50% - 8px);
  }

  .rm-topics__arrow--prev {
    left: 2px;
  }

  .rm-topics__arrow--next {
    right: 6px;
  }

  .rm-topics__arrow span {
    width: 10px;
    height: 10px;
  }

  .rm-topics__dots {
    gap: 10px;
    margin-top: 24px;
    padding-right: 16px;
  }

  .rm-topics__dot {
    width: 9px;
    height: 9px;
  }
}

/* =========================
   Topics Category Label 強制表示版
========================= */

.rm-topic-card__cat{
  position: absolute !important;
  top: 14px !important;
  left: 14px !important;
  z-index: 10 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 6px 12px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  letter-spacing: .06em !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  box-shadow: 0 4px 10px rgba(0,0,0,.08) !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;

  /* スラッグ色が当たらなくても最低限見える保険 */
  background: #f3eadf !important;
  color: #7a6045 !important;
}

/* hoverしても消えない */
.rm-topic-card:hover .rm-topic-card__cat,
.rm-topics-card:hover .rm-topic-card__cat,
.rm-topic-card a:hover .rm-topic-card__cat,
.rm-topics-card a:hover .rm-topic-card__cat,
.rm-topic-card a:focus-visible .rm-topic-card__cat,
.rm-topics-card a:focus-visible .rm-topic-card__cat{
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* 無料体験 系 */
.rm-topic-card__cat--free-trial,
.rm-topic-card__cat--trial{
  background: #f8dbe6 !important;
  color: #9a5870 !important;
}

/* 訪問看護サービス 系 */
.rm-topic-card__cat--nursing-service,
.rm-topic-card__cat--service,
.rm-topic-card__cat--service-related{
  background: #dff1df !important;
  color: #587a58 !important;
}

/* ソーシャルラウンジ */
.rm-topic-card__cat--social-lounge{
  background: #dbeaf8 !important;
  color: #58739a !important;
}

/* 自費サービス 系 */
.rm-topic-card__cat--private-service,
.rm-topic-card__cat--private{
  background: #f8e7d6 !important;
  color: #9a6e47 !important;
}

@media (max-width: 767px){
  .rm-topic-card__cat{
    top: 10px !important;
    left: 10px !important;
    padding: 5px 10px !important;
    font-size: 10px !important;
  }
}

/* =========================
   Topics Archive Card
========================= */

.rm-topics-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:40px 28px;
}

.rm-topics-card{
  display:block;
  color:inherit;
  text-decoration:none;
}

.rm-topics-card__thumb{
  position:relative;
  overflow:hidden;
  border-radius:20px;
  background:#ebe7de;
}

.rm-topics-card__thumb img{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:16 / 10;
  object-fit:cover;
}

.rm-topics-card__body{
  padding:12px 4px 0;
}

.rm-topics-card__date{
  margin:0 0 8px;
  color:#9f8661;
  font-size:13px;
  line-height:1.4;
  letter-spacing:.08em;
  font-weight:500;
}

.rm-topics-card__title{
  margin:0;
  color:#8c5c1e;
  font-size:18px;
  line-height:1.5;
  letter-spacing:.04em;
  font-weight:700;
}

@media (max-width: 1024px){
  .rm-topics-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:32px 24px;
  }
}

@media (max-width: 767px){
  .rm-topics-grid{
    grid-template-columns:1fr;
    gap:24px;
  }

  .rm-topics-card__title{
    font-size:16px;
  }

  .rm-topics-card__date{
    font-size:12px;
  }
}