/* Blog Home Section - Same Frame as section-cube_1 */
.section-blog-home .corner-wrapper {
  position: relative;
  background: #F9EFE7;
  padding: 24px 0 36px;

  @media (max-width: 767px) {
    padding: 24px 6px 36px;
  }
}

/* Gold Decorative Frame */
.section-blog-home .corner-wrapper::before {
  content: '';
  position: absolute;
  display: block;
  width: auto;
  z-index: 2;
  pointer-events: none;
  will-change: transform;
  transform: translateZ(0);
  top: -5px;
  left: -5px;
  bottom: -5px;
  right: -5px;
  height: calc(100% + 10px);
  background:
    linear-gradient(
        135deg,
        transparent calc(45% - 1px),
        #d6b845 45%,
        transparent calc(45% + 1px)
      )
      no-repeat left top / 50px 50px,
    linear-gradient(
        225deg,
        transparent calc(45% - 1px),
        #d6b845 45%,
        transparent calc(45% + 1px)
      )
      no-repeat right top / 50px 50px,
    linear-gradient(
        45deg,
        transparent calc(45% - 1px),
        #d6b845 45%,
        transparent calc(45% + 1px)
      )
      no-repeat left bottom / 50px 50px,
    linear-gradient(
        315deg,
        transparent calc(45% - 1px),
        #d6b845 45%,
        transparent calc(45% + 1px)
      )
      no-repeat right bottom / 50px 50px,
    linear-gradient(to right, #d6b845 1px, transparent 2px) no-repeat 0 44px /
      1px calc(100% - 88px),
    linear-gradient(to right, #d6b845 1px, transparent 2px) no-repeat right
      44px / 1px calc(100% - 88px),
    linear-gradient(to bottom, #d6b845 1px, transparent 2px) no-repeat 44px 0 /
      calc(100% - 88px) 1px,
    linear-gradient(to bottom, #d6b845 1px, transparent 2px) no-repeat 44px
      bottom / calc(100% - 88px) 1px;

  outline: 4px solid #d6b845;
  outline-offset: -9px;
}

.section-blog-home .title {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  font-family: 'Zen Antique', serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.448;
  color: #0c0c3f;
  text-align: center;
  margin-bottom: 24px;

  @media (min-width: 768px) {
    font-size: 28px;
  }
}

.section-blog-home .section-tabs {
  display: flex;
  justify-content: center;

  @media (min-width: 768px) {
    justify-content: flex-start;
  }
}

.section-blog-home .tab {
  padding: 6px 14px;
  border-radius: 10px 10px 0 0;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: default;

  &.tab-active {
    background-color: #333388;
  }
}

/* Swiper Container */
.blog-swiper-container {
  position: relative;
}

.blog-swiper {
  overflow: hidden;
  padding: 0;

  @media (min-width: 768px) {
    padding: 0;
    margin: 0;
  }
}

.blog-swiper-wrapper {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Blog Card */
.blog-card {
  position: relative;
  width: 256px;
  min-width: 256px;
  max-width: 256px;
  margin: 0 8px !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: auto;
  padding-top: 32px;

  @media (min-width: 768px) {
    width: 315px;
    min-width: 315px;
    max-width: 315px;
    margin: 0 12px !important;
  }
}

.blog-card-tab {
  position: absolute;
  top: 0;
  left: 0;
  height: 32px;
  padding: 6px 14px;
  background-color: #fda624;
  border-radius: 10px 10px 0 0;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: default;
}

.blog-card-tab-type-5 {
  background-color: #333388;
}

.blog-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 0;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s ease;
  &:hover {
    opacity: 0.9;
    border-color: #333388;
  }
}

.blog-card-image {
  position: relative;
  width: 100%;
  height: 217px;
  overflow: hidden;
  background-color: #f5f5f5;

  @media (min-width: 768px) {
    height: 220px;
  }

  .image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .new-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #ff9900;
    color: #fff;
    font-size: 8px;
    font-weight: 400;
    padding: 2px 6px;
    border-radius: 2px;
    line-height: 1.5;
    font-family: 'Meiryo', sans-serif;

    @media (min-width: 768px) {
      font-size: 10px;
      padding: 3px 8px;
    }
  }
}

.blog-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background-color: #fff;
}

.blog-card-header {
  margin-bottom: 12px;
}

.blog-card-date {
  font-size: 12px;
  font-weight: 400;
  color: #000;
  line-height: 1.5;
  font-family: 'Meiryo', sans-serif;
  display: block;
}

.blog-card-title {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  color: #333;
  margin: 0 0 12px 0;
  font-family: 'Meiryo', sans-serif;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  min-height: 51px;

  @media (min-width: 768px) {
    font-size: 18px;
    min-height: 54px;
  }
}

.blog-card-description {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: #333;
  margin-bottom: 12px;
  font-family: 'Meiryo', sans-serif;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  flex: 1;
}

.blog-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #e6e6e6;
}

.blog-card-more {
  display: flex;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: #333;
  font-family: 'Meiryo', sans-serif;
  justify-self: flex-end;
  align-self: flex-end;
}

/* Swiper Navigation */
.blog-swiper-navigation {
  display: none;

  @media (min-width: 768px) {
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 10;
  }
}

.blog-swiper-button-prev,
.blog-swiper-button-next {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.3s ease;
  color: #333;

  &:hover {
    background-color: #f5f5f5;
    border-color: #333;
  }

  &:disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }

  svg {
    width: 16px;
    height: 16px;
  }
}

.blog-swiper-button-prev {
  left: 0;
}

.blog-swiper-button-next {
  right: 0;
}

/* Swiper Pagination */
.blog-swiper-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;

  @media (min-width: 768px) {
    margin-top: 30px;
  }

  .swiper-pagination-bullet {
    width: 5px;
    height: 5px;
    background-color: #dddddd;
    opacity: 1;
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;

    &.swiper-pagination-bullet-active {
      background-color: #333;
      width: 8px;
      height: 8px;
    }
  }
}

/* More Button */
.section-blog-home .more-btn {
  text-align: center;
  margin-top: 30px;

  @media (min-width: 768px) {
    margin-top: 40px;
  }
}

.section-blog-home .more-link-custom {
  display: inline-block;
  padding: 10px 30px;
  background-color: #333388;
  color: #f8c360;
  border: 2px solid #f8c360;
  border-radius: 25px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.485;
  font-family: 'Gen Jyuu Gothic', sans-serif;
  transition: all 0.3s ease;

  &:hover {
    background-color: #f8c360;
    color: #333388;
    border-color: #333388;
  }
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .blog-card-title {
    font-size: 16px;
    min-height: 48px;
  }

  .blog-card-description {
    font-size: 12px;
  }
}

/* Blog Category Section */
.blog-category-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  gap: 100px;
  margin-top: 40px;
  padding-left: 44px;
  padding-right: 44px;
  box-sizing: border-box;
  @media (max-width: 1170px) {
    gap: 100px;
  }
  @media (max-width: 1140px) {
    gap: 40px;
  }
  @media (max-width: 1080px) {
    gap: 20px;
  }


  @media (max-width: 990px) {
    flex-direction: column;
    margin-top: 20px;
    gap: 16px;
    padding-left: 0;
    padding-right: 0;
  }
}

.blog-category-heading {
  display: flex;
  align-items: center;
  font-family: 'Zen Antique', serif;
  font-size: 20px;
  font-weight: 400;
  color: #0C0C3F;

  @media (max-width: 767px) {
    justify-content: center;
    width: auto;
  }
}

.blog-category-heading::before {
  content: "";
  width: 159px;
  flex-shrink: 0;
  height: 1px;
  background: #0C0C3F;
  @media (max-width: 1080px) {
    width: 60px;
  }
  @media (max-width: 990px) {
    display: none;
  }
}

.blog-category-heading-text {
  position: relative;
  padding: 0 20px;
  white-space: nowrap;

  @media (max-width: 990px) {
    padding: 0;
  }
}

.blog-category-heading-text::before {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: -30px;
  width: 45px;
  height: 7px;
  background:
    radial-gradient(circle at 3.5px 50%, #0C0C3F 3px, transparent 4px),
    radial-gradient(circle at 18px 50%, #0C0C3F 3px, transparent 4px),
    radial-gradient(circle at 33px 50%, #0C0C3F 3px, transparent 4px);
  background-repeat: no-repeat;

  @media (max-width: 990px) {
    display: none;
  }
}

.blog-category-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  flex-shrink: 0;
  gap: 20px;

  @media (max-width: 767px) {
    gap: 10px;
  }
}

.blog-category-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 200px;
  height: 43px;
  padding: 3px 20px;
  border-radius: 38px;
  border: 1.5px solid #338;
  background: #FFFFFF;
  color: #161B60;
  font-family: 'Gen Jyuu Gothic', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.485;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  box-sizing: border-box;

  @media (max-width: 767px) {
    width: 146px;
    height: 35px;
    font-size: 15px;
    border-radius: 25px;
  }
}

.blog-category-btn:hover {
  background: #333388;
  color: #FFFFFF;
}

.section-blog-home {
  position: relative;
}
.section-blog-home::before {
  content: '';
  position: absolute;
  top: 200px;
  right: 0;
  width: 421px;
  height: 160px;
  background: rgba(248, 195, 96, 0.5);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="421" height="160" viewBox="0 0 421 160"><path d="M159.67 0H129.19C120.39 0 113.28 7.17 113.28 16C113.28 24.83 120.39 32 129.19 32H212.74C221.52 32 228.65 39.17 228.65 48C228.65 56.83 221.52 64 212.74 64H15.91C7.12994 64 0 71.17 0 80C0 88.83 7.12994 96 15.91 96H308.03C316.81 96 323.94 103.17 323.94 112C323.94 120.83 316.81 128 308.03 128H279.01C270.23 128 263.1 135.17 263.1 144C263.1 152.83 270.23 160 279.01 160H604.08C612.86 160 619.99 152.83 619.99 144C619.99 135.17 612.86 128 604.08 128H367.36C358.58 128 351.45 120.83 351.45 112C351.45 103.17 358.58 96 367.36 96H376.94C385.72 96 392.85 88.83 392.85 80C392.85 71.17 385.72 64 376.94 64H272.06C263.28 64 256.15 56.83 256.15 48C256.15 39.17 263.28 32 272.06 32H383.73C392.53 32 399.64 24.83 399.64 16C399.64 7.17 392.53 0 383.73 0H159.66H159.67Z"/></svg>')
    no-repeat center center/contain;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="421" height="160" viewBox="0 0 421 160"><path d="M159.67 0H129.19C120.39 0 113.28 7.17 113.28 16C113.28 24.83 120.39 32 129.19 32H212.74C221.52 32 228.65 39.17 228.65 48C228.65 56.83 221.52 64 212.74 64H15.91C7.12994 64 0 71.17 0 80C0 88.83 7.12994 96 15.91 96H308.03C316.81 96 323.94 103.17 323.94 112C323.94 120.83 316.81 128 308.03 128H279.01C270.23 128 263.1 135.17 263.1 144C263.1 152.83 270.23 160 279.01 160H604.08C612.86 160 619.99 152.83 619.99 144C619.99 135.17 612.86 128 604.08 128H367.36C358.58 128 351.45 120.83 351.45 112C351.45 103.17 358.58 96 367.36 96H376.94C385.72 96 392.85 88.83 392.85 80C392.85 71.17 385.72 64 376.94 64H272.06C263.28 64 256.15 56.83 256.15 48C256.15 39.17 263.28 32 272.06 32H383.73C392.53 32 399.64 24.83 399.64 16C399.64 7.17 392.53 0 383.73 0H159.66H159.67Z"/></svg>')
    no-repeat center center/contain;
  z-index: -1;
}
