/* ヒーローセクション共通スタイル */
.hero-section {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.hero-image-container {
  position: relative;
  width: 100%;
  min-height: 500px;
}

.hero-image {
  width: 100%;
  height: auto;
  min-height: 500px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-image-mobile {
  display: none;
}

.hero-content {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 40px;
}

.hero-text-wrapper {
  max-width: 600px;
}

.hero-text {
  font-size: 24px;
  font-family: var(--custom-font-family);
  white-space: pre-line;
}

/* スタイル2用の縦積みスタック */
.hero-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-subheading-xl {
  font-family: var(--custom-font-family);
  font-weight: 700;
  font-size: 24px;
  margin-bottom: 1rem;
  line-height: 160%;
  letter-spacing: 0.06em;
  white-space: pre-line;
}

.hero-subheading-md {
  font-family: var(--custom-font-family);
  font-weight: 700;
  font-size: 16px;
  line-height: 160%;
  letter-spacing: 0.06em;
  white-space: pre-line;
}

/* テキスト色設定 */
.hero-section.text-white .hero-text,
.hero-section.text-white .hero-subheading-xl,
.hero-section.text-white .hero-subheading-md {
  color: var(--custom-text-secondary); /* #ffffff */
}

.hero-section.text-black .hero-text,
.hero-section.text-black .hero-subheading-xl,
.hero-section.text-black .hero-subheading-md {
  color: var(--custom-text-primary); /* #0b1932 */
}

/* PC用スタイル（768px以上） */
@media screen and (min-width: 768px) {
  .hero-image-container {
    min-height: 600px;
  }

  .hero-image {
    min-height: 600px;
  }

  .hero-image-desktop {
    display: block;
  }

  .hero-image-mobile {
    display: none;
  }

  .hero-content {
    padding: 0 80px;
    justify-content: flex-start;
  }

  .hero-text {
    font-weight: 700;
    font-size: 48px;
    line-height: 160%;
    letter-spacing: 0.06em;
    vertical-align: middle;
    text-align: left;
  }

  /* スタイル2のPC用スタイル */
  .hero-subheading-xl {
    font-weight: 700;
    font-size: 40px;
    line-height: 160%;
    letter-spacing: 0.06em;
    vertical-align: middle;
    text-align: left;
  }

  .hero-subheading-md {
    font-weight: 700;
    font-size: 24px;
    line-height: 160%;
    letter-spacing: 0.06em;
    vertical-align: middle;
    text-align: left;
  }
}

/* タブレット用スタイル（512px-767px） */
@media screen and (min-width: 512px) and (max-width: 767px) {
  .hero-image-container {
    min-height: 450px;
  }

  .hero-image {
    min-height: 450px;
  }

  .hero-image-desktop {
    display: block;
  }

  .hero-image-mobile {
    display: none;
  }

  .hero-content {
    padding: 0 60px;
    justify-content: center; /* タブレットでは中央配置 */
  }

  .hero-text-wrapper {
    text-align: center; /* タブレットでは中央配置 */
  }

  .hero-text {
    font-weight: 700;
    font-size: 32px;
    line-height: 160%;
    letter-spacing: 0.06em;
    vertical-align: middle;
    text-align: center; /* タブレットでは中央配置 */
  }

  /* スタイル2のタブレット用スタイル */
  .hero-subheading-xl {
    font-weight: 700;
    font-size: 32px;
    line-height: 160%;
    letter-spacing: 0.06em;
    vertical-align: middle;
    text-align: center; /* タブレットでは中央配置 */
  }

  .hero-subheading-md {
    font-weight: 700;
    font-size: 18px;
    line-height: 160%;
    letter-spacing: 0.06em;
    vertical-align: middle;
    text-align: center; /* タブレットでは中央配置 */
  }
}

@media screen and (max-width: 511px) {
  .hero-text {
    font-size: 24px;
  }
}

/* モバイル共通スタイル（767px以下） */
@media screen and (max-width: 767px) {
  .hero-image-container {
    min-height: 300px;
  }

  .hero-image {
    min-height: 300px;
  }

  .hero-image-desktop {
    display: none;
  }

  .hero-image-mobile {
    display: block;
  }

  .hero-content {
    padding: 0 20px;
    justify-content: center;
    text-align: center;
  }

  .hero-text-wrapper {
    width: 100%;
    text-align: center;
  }

  .hero-text {
    font-family: "Noto Sans JP", var(--custom-font-family);
    font-weight: 700;
    line-height: 160%;
    letter-spacing: 0.06em;
    text-align: center;
    vertical-align: middle;
    width: 100%;
  }

  /* スタイル2のモバイル用スタイル */
  .hero-subheading-xl {
    font-family: "Noto Sans JP", var(--custom-font-family);
    font-weight: 700;
    line-height: 160%;
    letter-spacing: 0.06em;
    text-align: center;
    vertical-align: middle;
    width: 100%;
  }

  .hero-subheading-md {
    font-family: "Noto Sans JP", var(--custom-font-family);
    font-weight: 700;
    line-height: 160%;
    letter-spacing: 0.06em;
    text-align: center;
    vertical-align: middle;
    width: 100%;
  }
}

/* エディター用スタイル */
.hero-section-editor {
  margin: 20px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.hero-section-preview {
  border-radius: 4px;
}

.hero-section-editor .hero-text {
  font-family: var(--custom-font-family);
  font-weight: 700;
  line-height: 160%;
  letter-spacing: 0.02em;
  min-height: 1.6em;
}

.hero-section-editor .hero-text:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

/* エディター内でのプレースホルダー */
.hero-section-editor .hero-text:empty:before {
  content: attr(placeholder);
  color: #999;
  font-style: italic;
}

/* エディター用スタイル2 */
.hero-section-editor .hero-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-section-editor .hero-subheading-xl {
  font-family: var(--custom-font-family);
  font-weight: 700;
  font-size: 32px;
  line-height: 160%;
  letter-spacing: 0.02em;
  min-height: 1.6em;
}

.hero-section-editor .hero-subheading-md {
  font-family: var(--custom-font-family);
  font-weight: 700;
  font-size: 20px;
  line-height: 160%;
  letter-spacing: 0.02em;
  min-height: 1.6em;
}

.hero-section-editor .hero-subheading-xl:focus,
.hero-section-editor .hero-subheading-md:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}
