/*
  ONTOP single post visual polish
  Paste after the existing theme CSS or into Appearance > Customize > Additional CSS.
  The :has(.blog-detail__body) guard keeps these styles on single post pages only.
*/

body:has(.blog-detail__body) {
  background: #f4f7fb;
}

body:has(.blog-detail__body) .header {
  background: rgba(13, 31, 53, 0.82);
}

body:has(.blog-detail__body) .membership.section {
  min-height: auto;
  padding: 7.5em 1.5em 2em;
  background:
    linear-gradient(180deg, #f4f7fb 0%, #fff 48%, #f4f7fb 100%);
}

body:has(.blog-detail__body) .c-section_title {
  width: min(100%, 860px);
  margin: 0 auto 2em !important;
  text-align: center;
}

body:has(.blog-detail__body) .c-section_title--JP {
  display: block;
  color: #1a3a5c;
  font-size: clamp(1.55rem, 3.5vw, 2.25rem);
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: 0.04em;
}

body:has(.blog-detail__body) .c-section_title--EN {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.9em;
  padding: 0.45em 1.15em;
  border-radius: 999px;
  background: rgba(74, 192, 227, 0.13);
  color: #11799a;
  font-family: 'Roboto', 'Noto Sans JP', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

body:has(.blog-detail__body) .blog-detail__body {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 2.4em;
  border: 1px solid rgba(26, 58, 92, 0.1);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(13, 31, 53, 0.09);
}

body:has(.blog-detail__body) .blog-content {
  color: #344252;
  font-size: 1rem;
  line-height: 2;
}

body:has(.blog-detail__body) .blog-content > * + * {
  margin-top: 1.4em;
}

body:has(.blog-detail__body) .blog-content figure {
  margin: 1.2em 0;
}

body:has(.blog-detail__body) .blog-content img {
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(13, 31, 53, 0.12);
  cursor: zoom-in;
}

body:has(.blog-detail__body) .blog-content p {
  margin: 0;
}

body:has(.blog-detail__body) .blog-content .wp-block-paragraph {
  margin-bottom: 1em;
}

body:has(.blog-detail__body) .blog-content .wp-block-paragraph:empty {
  margin-bottom: 0;
}

body:has(.blog-detail__body) .blog-content p[style*="font-size"] {
  color: #1a3a5c;
  font-size: clamp(2.5rem, 8vw, 5rem) !important;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

body:has(.blog-detail__body) .membership__btns {
  justify-content: center;
  margin: 2em auto 4.5em;
  padding: 0 1.5em;
}

body:has(.blog-detail__body) .btn-blue {
  min-width: 10em;
  text-align: center;
  box-shadow: 0 8px 24px rgba(13, 31, 53, 0.16);
}

.news-image-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2em;
  background: rgba(4, 13, 24, 0.86);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.news-image-modal.is-open {
  display: flex;
  opacity: 1;
}

.news-image-modal__image {
  width: auto;
  max-width: min(100%, 1100px);
  max-height: 86vh;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  cursor: zoom-out;
}

.news-image-modal__close {
  position: absolute;
  top: 1.1em;
  right: 1.1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.news-image-modal__close:hover,
.news-image-modal__close:focus {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

@media (max-width: 768px) {
  body:has(.blog-detail__body) .header {
    padding: 0 1.25em;
  }

  body:has(.blog-detail__body) .header__logo {
    font-size: 0.88rem;
    letter-spacing: 0.08em;
  }

  body:has(.blog-detail__body) .membership.section {
    padding: 6em 1em 1.5em;
  }

  body:has(.blog-detail__body) .c-section_title {
    margin-bottom: 1.5em !important;
  }

  body:has(.blog-detail__body) .blog-detail__body {
    padding: 1.2em;
  }

  body:has(.blog-detail__body) .blog-content {
    font-size: 0.95rem;
    line-height: 1.9;
  }

  body:has(.blog-detail__body) .membership__btns {
    margin: 1.6em auto 3.5em;
  }

  body:has(.blog-detail__body) .btn-blue {
    width: min(100%, 18em);
  }

  .news-image-modal {
    padding: 1em;
  }

  .news-image-modal__close {
    top: 0.8em;
    right: 0.8em;
  }
}
