/* iOS Safari: アドレスバー伸縮時もビューポート高を確保 */
@supports (-webkit-touch-callout: none) {
  html {
    height: -webkit-fill-available;
  }

  body {
    min-height: -webkit-fill-available;
  }
}

/* ヒーローを画面上端から開始 */
.hero-section {
  margin-top: 0;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

@supports (-webkit-touch-callout: none) {
  .hero-section {
    min-height: -webkit-fill-available;
  }
}

@media (min-width: 768px) {
  .hero-section {
    min-height: 819px;
  }
}

/* 背景：img+transform ではなく background-size:cover（iOS で全画面が安定） */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  z-index: 0;
  overflow: hidden;
  background-color: #2e2b2b;
  background-image: url("../images/hero.JPG");
  background-repeat: no-repeat;
  background-position: center 40%;
  background-size: cover;
}

/* 彩度を落とし、元より少し暗く（filter / backdrop-filter 非依存のベース） */
.hero-bg__tone {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: rgba(48, 46, 46, 0.3);
  pointer-events: none;
}

@supports (
  (backdrop-filter: grayscale(1)) or (-webkit-backdrop-filter: grayscale(1))
) {
  .hero-bg__tone {
    background-color: rgba(45, 42, 42, 0.14);
    backdrop-filter: grayscale(45%) brightness(0.86) saturate(0.9);
    -webkit-backdrop-filter: grayscale(45%) brightness(0.86) saturate(0.9);
  }
}

.hero-bg__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(27, 28, 28, 0.28) 0%,
    rgba(27, 28, 28, 0.44) 55%,
    rgba(27, 28, 28, 0.56) 100%
  );
  pointer-events: none;
}

/* テキスト背面の読みやすさ用スクリーン */
.hero-bg__scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(
    ellipse 95% 75% at 50% 50%,
    rgba(0, 0, 0, 0.42) 0%,
    rgba(0, 0, 0, 0.18) 50%,
    transparent 72%
  );
  pointer-events: none;
}

/* 見出しを画面中央に：上下を 1:1 で分割し h1 を境目に配置 */
.hero-section__layout {
  position: relative;
  z-index: 10;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  padding-bottom: 4.5rem;
}

.hero-section__upper,
.hero-section__lower {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 0;
}

.hero-section__upper {
  justify-content: flex-end;
  padding-bottom: 0.75rem;
}

.hero-section__lower {
  justify-content: flex-start;
  padding-top: 0.75rem;
}

.hero-section__headline,
.hero-section__content {
  width: 100%;
}

.hero-section__headline h1 {
  color: #ffffff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.75),
    0 4px 20px rgba(0, 0, 0, 0.55);
}

.hero-section .hero-highlight {
  color: #ffdad6;
  text-decoration-color: #ffb3ac;
}

.hero-section__content > p {
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}

.hero-section__note {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.hero-section__tags {
  position: absolute;
  bottom: 1.25rem;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 0 1.25rem;
}

@media (min-width: 768px) {
  .hero-section__upper {
    padding-bottom: 1rem;
  }

  .hero-section__lower {
    padding-top: 1rem;
  }

  .hero-section__layout {
    padding-bottom: 5.5rem;
  }

  .hero-section__tags {
    bottom: 2rem;
    padding: 0 4rem;
  }
}

/* スマホ：トーンをやや強め、背景をわずかに拡大 */
@media (max-width: 767px) {
  .hero-bg {
    background-size: cover;
    background-position: center 38%;
  }

  .hero-bg__tone {
    background-color: rgba(42, 40, 40, 0.36);
  }

  @supports (
    (backdrop-filter: grayscale(1)) or (-webkit-backdrop-filter: grayscale(1))
  ) {
    .hero-bg__tone {
      background-color: rgba(40, 38, 38, 0.2);
    }
  }

  .hero-bg__overlay {
    background: linear-gradient(
      180deg,
      rgba(27, 28, 28, 0.36) 0%,
      rgba(27, 28, 28, 0.52) 55%,
      rgba(27, 28, 28, 0.64) 100%
    );
  }

  .hero-bg__scrim {
    background: radial-gradient(
      ellipse 100% 80% at 50% 48%,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(0, 0, 0, 0.22) 48%,
      transparent 75%
    );
  }
}

/* 画像枠を余白なく埋める */
.img-fill {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

/* 全身評価図の接続線 */
.diagram-connectors {
  z-index: -1;
}

.hero-highlight {
  display: inline;
  line-height: 1;
  text-decoration-line: underline;
  text-decoration-color: #af101a;
  text-decoration-thickness: 4px;
  text-underline-offset: 0.1em;
  text-decoration-skip-ink: none;
}

/* 症状カードアイコン */
.condition-card__icon {
  font-size: 28px;
  color: #af101a;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.group:hover .condition-card__icon {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

/* 院長紹介 */
.director-section__underline {
  width: 4rem;
  height: 3px;
  margin: 1rem auto 0;
  background-color: #af101a;
  border-radius: 2px;
}

.director-profile__figure {
  margin: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 0.125rem;
  overflow: hidden;
}

.director-profile__image {
  display: block;
  width: 100%;
  min-height: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
}

.director-quote {
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  background-color: #fff5f3;
  border-left: 4px solid #af101a;
  border-radius: 0 0.125rem 0.125rem 0;
}

.director-quote__text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.75;
  font-weight: 700;
  color: #af101a;
}

.director-achievements {
  padding: 1.5rem;
  background-color: #f4f4f4;
  border-radius: 0.5rem;
}

.director-achievements__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.director-achievements__item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #1b1c1c;
}

.director-achievements__icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  color: #af101a;
  font-variation-settings: "FILL" 1, "wght" 600, "GRAD" 0, "opsz" 24;
}

@media (max-width: 767px) {
  body {
    overflow-x: hidden;
  }

  .diagram-label {
    position: static;
    display: inline-block;
    margin-top: 0.25rem;
    margin-left: 0.25rem;
  }

  .diagram-symptom-label {
    left: -0.5rem;
    font-size: 11px;
    line-height: 1.3;
  }
}

/* iPhone標準幅（375px）: タイポグラフィを1段階縮小 */
@media (max-width: 375px) {
  body .text-headline-lg-mobile {
    font-size: 24px;
    line-height: 32px;
  }

  body .text-headline-md {
    font-size: 20px;
    line-height: 28px;
  }

  body .text-body-lg {
    font-size: 16px;
    line-height: 24px;
  }

  body .text-body-md {
    font-size: 15px;
    line-height: 22px;
  }

  body .text-label-bold {
    font-size: 13px;
    line-height: 18px;
  }

  body .text-label-sm {
    font-size: 11px;
    line-height: 15px;
  }

  body .text-\[40px\] {
    font-size: 32px;
    line-height: 1;
  }

  body .text-\[22px\] {
    font-size: 20px;
    line-height: 28px;
  }

  body .text-\[20px\] {
    font-size: 18px;
    line-height: 26px;
  }

  body .text-lg {
    font-size: 16px;
    line-height: 24px;
  }

  body .text-sm {
    font-size: 13px;
    line-height: 18px;
  }

  body .text-\[20px\].material-symbols-outlined {
    font-size: 18px;
  }

  /* ヒーロー見出しの下線付き強調 */
  body h1 .hero-highlight {
    padding-bottom: 0;
  }

  /* カード・原因ブロックの余白を少し詰める */
  body .bg-surface.border.border-outline-variant.p-8 {
    padding: 1.5rem;
  }

  body .bg-surface-container-lowest.p-6 {
    padding: 1.25rem;
  }

  .director-quote__text {
    font-size: 15px;
    line-height: 1.65;
  }

  .director-achievements {
    padding: 1.25rem;
  }

  .director-achievements__item {
    font-size: 15px;
  }

  .director-profile__name {
    font-size: 24px;
  }
}