/* CMS-5 介護・福祉体験談 */

.kaigo-fukushi-taiken {
  background-image: linear-gradient(#ffffff 0%, #f5fbfe 35%, #e4f5fe 100%);
}

.kaigo-fukushi-taiken .main-header {
  background-color: transparent;
}

.kaigo-group-box {
  padding: 20px;
}

.kaigo-tab-hero {
  background: radial-gradient(circle at center, #f5fbfe 0%, #e4f5fe 100%);
  border-radius: 12px;
  padding: 40px 20px 20px 20px;
}

.kaigo-category-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 16px;
  justify-content: center;
  align-items: stretch;
  margin-bottom: 85px;
}

.kaigo-category-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 320px;
  min-height: 61px;
  padding: 8px 12px 8px 10px;
  border-radius: 7px;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kaigo-category-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}

.kaigo-category-btn__icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.kaigo-category-btn__text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.kaigo-category-btn__arrow {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.kaigo-hero-body {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  position: relative;
}

.kaigo-hero-copy {
  flex: 1;
  min-width: 0;
  padding-bottom: 12px;
}

.kaigo-hero-title {
  font-family: "Zen Old Mincho", "Noto Serif JP", "Yu Mincho", serif;
  font-size: 24px;
  color: #0d319d;
  line-height: 1.45;
  font-weight: 400;
  margin: 0 0 8px;
  padding-left: 50px;
  margin-bottom: -11px;
  text-align: left;
}

.kaigo-hero-title span {
  display: block;
}

.kaigo-hero-underline {
  display: block;
  width: min(346px, 100%);
  height: auto;
  margin: 0 0 18px;
}

.kaigo-hero-desc {
  font-size: 15px;
  color: #5a5956;
  line-height: 1.7;
  margin: 0 0 24px;
  padding-left: 50px;
  margin-top: 28px;
  text-align: left;
}

.kaigo-hero-leaves {
  display: block;
  width: 170px;
  max-width: 45%;
  height: auto;
  transform: rotate(8deg);
}

.kaigo-hero-visual {
  flex: 0 0 42%;
  max-width: 320px;
}

.kaigo-hero-visual img {
  width: 100%;
  height: auto;
  display: block;
}

.kaigo-empty {
  padding: 40px 10px;
  text-align: center;
  color: #777;
  font-size: 15px;
}

.kaigo-category-page .list-mitori {
  margin-top: 8px;
  padding: 0 35px;
  margin-top: 16px;
}

.kaigo-tab-hero .kaigo-hero-desc {
  font-size: 14px;
}

.kaigo-tab-hero .kaigo-hero-visual {
  flex: 0 0 38%;
  max-width: 240px;
}

.kaigo-category-page .arrow-right-cicle {
  display: none;
}

/* SP layout only below phone width; 767 keeps PC layout */
@media (max-width: 575px) {
  .kaigo-tab-hero {
    display: flex;
    flex-direction: column;
    padding: 30px 20px 20px 20px;
  }

  .kaigo-hero-body,
  .kaigo-hero-copy {
    display: contents;
  }

  .kaigo-hero-title {
    order: 1;
    font-size: 20px;
    padding-left: 0;
    margin-bottom: 0;
  }

  .kaigo-hero-title span {
    display: inline;
  }

  .kaigo-hero-underline {
    order: 2;
    margin-left: auto;
    margin-right: auto;
  }

  .kaigo-category-buttons {
    order: 3;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
    padding: 0 25px;
  }

  .kaigo-category-btn {
    max-width: 100%;
    width: 100%;
    padding: 4px 2px;
    gap: 5px;
  }

  .kaigo-category-btn__text {
    font-size: 13px;
  }

  .kaigo-hero-desc {
    order: 4;
    font-size: 14px;
    padding-left: 0;
    margin-bottom: 0;
  }

  .kaigo-hero-visual {
    order: 5;
    flex: none;
    max-width: 280px;
    width: 70%;
    align-self: flex-end;
    margin-right: -18px;
  }

  .kaigo-hero-leaves {
    order: 6;
    align-self: flex-start;
    margin-left: -18px;
  }

  .cms1-detail-content .kaigo-group-box {
    padding: 15px 8px;
  }

  .kaigo-category-page .list-mitori {
    padding: 0 10px;
  }
}

.kaigo-category-page .category-tag-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.kaigo-category-page .kaigo-tag-filter {
  margin-left: auto;
}

.kaigo-category-page .kaigo-tag-filter .tag-item.is-active,
.kaigo-category-page .kaigo-tag-filter .mitori-filter-item.is-active .mitori-title span {
  font-weight: bold;
  color: #0a2682;
}

.kaigo-category-page .kaigo-tag-filter .filter-wrap {
  z-index: 20;
}

.kaigo-fukushi-taiken .mitori-detail-main-item .m-item-title .icon,
.kaigo-fukushi-taiken .mitori-detail-item .m-item-title .icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kaigo-fukushi-taiken .mitori-detail-main-item .m-item-title .icon img,
.kaigo-fukushi-taiken .mitori-detail-item .m-item-title .icon img {
  max-width: 70%;
  max-height: 70%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.kaigo-fukushi-taiken .m-item-title.active .icon {
  width: 46px;
  height: 46px;
  left: -30px;
  top: calc(50% - 23px);
}

/* Keep collapsed preview at ~1.5 lines + fade (ck-content margins would break it) */
.kaigo-fukushi-taiken .mitori-detail-item:not(.mitori-back-item):not(.item-active) .acc-body.ck-content {
  --acc-line-height: 24px;
  --acc-preview-height: calc(var(--acc-line-height) * 1.5);
  max-height: calc(22px + var(--acc-preview-height));
  overflow: hidden;
}

.kaigo-fukushi-taiken .mitori-detail-item:not(.mitori-back-item):not(.item-active) .acc-body.ck-content :where(p, h1, h2, h3, h4, h5, h6, ul, ol, li, blockquote) {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.kaigo-fukushi-taiken .mitori-detail-item:not(.mitori-back-item):not(.item-active) .acc-body::after {
  display: block;
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--acc-line-height, 24px) * 0.6);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
  pointer-events: none;
  z-index: 2;
}

.kaigo-fukushi-taiken .mitori-detail-item:not(.mitori-back-item).item-active {
  border-bottom-color: transparent;
  padding-bottom: 35px;
}

.kaigo-fukushi-taiken .mitori-detail-item:not(.mitori-back-item).item-active .m-item-title {
  position: relative;
  z-index: 2;
}

.kaigo-fukushi-taiken .mitori-detail-item:not(.mitori-back-item).item-active .acc-body {
  background-color: #fff7f7;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
  border-radius: 10px;
  margin-top: -10px;
  margin-left: -20px;
  margin-right: -15px;
  padding: 28px 15px 20px 20px;
  color: #333333;
  font-size: 17px;
  letter-spacing: 0.425px;
  line-height: 1.6470588235;
  max-height: none;
  position: relative;
  z-index: 1;
}

.kaigo-fukushi-taiken .mitori-detail-item:not(.mitori-back-item).item-active .acc-body p,
.kaigo-fukushi-taiken .mitori-detail-item:not(.mitori-back-item).item-active .acc-body span {
  line-height: 1.7 !important;
}

@media (max-width: 767px) {
  .kaigo-fukushi-taiken .mitori-detail-item .m-item-title.active {
    display: flex;
    width: 100%;
    margin-left: 14px;
    margin-right: 14px;
    right: 0;
    left: auto;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding-left: 52px;
    padding-right: 14px;
  }

  .kaigo-fukushi-taiken .mitori-detail-item .m-item-title.active .icon {
    left: -23px;
    top: calc(50% - 23px);
  }

  .kaigo-fukushi-taiken .mitori-detail-item:not(.mitori-back-item).item-active .acc-body {
    margin-left: 0;
    margin-right: 0;
    padding-left: 14px;
    padding-right: 14px;
    max-width: 100%;
    box-sizing: border-box;
  }
}

.kaigo-fukushi-taiken .mitori-detail-item:not(.mitori-back-item).item-active .acc-body::after {
  display: none;
}

.kaigo-fukushi-taiken .mitori-detail-item:not(.mitori-back-item).item-active .acc-body img {
  max-width: 100%;
  height: auto;
}

/* Category list tag popup */
.kaigo-category-page .mitori-item .tag {
  cursor: pointer;
}

.kaigo-category-page .mitori-item .tag.is-empty {
  cursor: default;
  pointer-events: none;
}

.kaigo-tag-posts-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.kaigo-tag-posts-popup.is-open {
  display: flex;
}

.kaigo-tag-posts-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.kaigo-tag-posts-popup__panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  height: min(80vh, 720px);
  max-height: min(80vh, 720px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kaigo-tag-posts-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #ececec;
  flex-shrink: 0;
}

.kaigo-tag-posts-popup__title {
  font-size: 16px;
  font-weight: bold;
  color: #112375;
  line-height: 1.4;
  word-break: break-word;
  letter-spacing: .3px;
}

.kaigo-tag-posts-popup__close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 0 4px;
}

.kaigo-tag-posts-popup__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 12px 12px;
  overflow-y: auto;
}

.kaigo-tag-posts-popup__body.is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.kaigo-tag-posts-popup__footer {
  flex-shrink: 0;
  border-top: 1px solid #ececec;
  background: #fff;
}

.kaigo-tag-posts-popup__footer.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.kaigo-tag-posts-popup__list {
  margin-top: 0;
}

.kaigo-tag-posts-popup__list .mitori-item .tag {
  cursor: default;
  pointer-events: none;
}

.kaigo-tag-posts-popup__empty,
.kaigo-tag-posts-popup__loading {
  padding: 28px 18px;
  text-align: center;
  color: #777;
  font-size: 14px;
}

.kaigo-tag-posts-popup__pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 8px;
  flex-wrap: wrap;
}

.kaigo-tag-posts-popup__pages {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.kaigo-tag-posts-popup__page,
.kaigo-tag-posts-popup__nav {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  color: #333;
  font-size: 13px;
  cursor: pointer;
}

.kaigo-tag-posts-popup__page.is-active {
  background: #ffd8e0;
  border-color: #ffd8e0;
  font-weight: bold;
  cursor: default;
}

.kaigo-tag-posts-popup__nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 767px) {
  .kaigo-tag-posts-popup {
    padding: 12px;
  }

  .kaigo-tag-posts-popup__panel {
    width: 100%;
    height: 85vh;
    max-height: 85vh;
  }

  .kaigo-tag-posts-popup__body {
    padding: 0 8px 8px;
  }
}


