/* ========================================
   TOP：院長からのご挨拶
   css/sections/top-greeting.css
======================================== */

.nobo-greeting {
  /* 配色 */
  --greeting-maincolor: #0272d4;
  --greeting-navy: #142f53;
  --greeting-text: #485563;
  --greeting-gold: #96743b;
  --greeting-line: #d8c39f;

  /* 既存変数との互換性 */
  --greeting-blue: var(--greeting-navy);

  /* 背景画像 */
  --greeting-background-image: url("../../img/top/greeting-bg.webp");
  --greeting-background-position: center center;
  --greeting-background-size: cover;

  /*
    白レイヤーの不透明度
    数値を上げるほど白く、下げるほど画像が濃く見える
  */
  --greeting-overlay-opacity: 0.86;

  /* 文字 */
  --greeting-small-size: 19px;
  --greeting-serif:
    "Zen Old Mincho",
    "Yu Mincho",
    "Hiragino Mincho ProN",
    serif;

  /* フェードイン */
  --nobo-reveal-duration: 1100ms;
  --nobo-reveal-distance: 22px;
  --nobo-reveal-easing: cubic-bezier(0.22, 1, 0.36, 1);

  position: relative;
  isolation: isolate;
  width: 100%;
  padding: 112px 0 64px;
  overflow: hidden;

  color: var(--greeting-text);
  background: #f8fafc;
  font-family: var(--greeting-serif);
  font-size: var(--greeting-small-size);

  scroll-margin-top: var(--header-total-height, 142px);
}

.nobo-greeting,
.nobo-greeting::before,
.nobo-greeting::after,
.nobo-greeting *,
.nobo-greeting *::before,
.nobo-greeting *::after {
  box-sizing: border-box;
}

.nobo-greeting :where(h2, p, figure) {
  margin: 0;
}

/* ========================================
   背景
   0：背景画像
   1：白の半透明レイヤー
   2：背景英字
   3：本文・院長写真
======================================== */

/* セクション全面の背景画像 */
.nobo-greeting::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;

  background-image: var(--greeting-background-image);
  background-repeat: no-repeat;
  background-position: var(--greeting-background-position);
  background-size: var(--greeting-background-size);

  pointer-events: none;
}

/* 白の半透明レイヤー */
.nobo-greeting::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;

  background: rgb(255 255 255 / var(--greeting-overlay-opacity));

  pointer-events: none;
}

/* 背景英字 */
.nobo-greeting__background-word {
  position: absolute;
  z-index: 2;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);

  color: rgb(20 47 83 / 6%);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(100px, 13vw, 180px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.025em;
  white-space: nowrap;

  pointer-events: none;
  user-select: none;
}

/* ========================================
   全体レイアウト
======================================== */

.nobo-greeting__inner {
  position: relative;
  z-index: 3;

  display: grid;
  grid-template-columns:
    minmax(0, 0.85fr)
    minmax(0, 1.15fr);
  align-items: start;
  gap: clamp(36px, 4.4vw, 56px);

  width: min(100%, 1280px);
  margin-inline: auto;
  padding-inline: 32px;
}

/* ========================================
   左側：院長写真
======================================== */

.nobo-greeting__profile {
  position: relative;
  min-width: 0;
  padding-bottom: 24px;
}

.nobo-greeting__portrait {
  position: relative;
  padding: 7px;

  border: 1px solid var(--greeting-line);
  background: rgb(255 255 255 / 90%);
  box-shadow: 0 8px 24px rgb(20 47 83 / 5%);
}

.nobo-greeting__portrait img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1.08;

  object-fit: cover;
  object-position: center 35%;
}

/* 写真に重なる名前プレート */
.nobo-greeting__nameplate {
  position: relative;
  z-index: 2;

  width: 90%;
  margin: -48px auto 0;
  padding: 24px 20px 22px;

  border: 1px solid var(--greeting-line);
  border-radius: 48px 48px 0 0;

  background: rgb(255 255 255 / 97%);
  box-shadow: 0 5px 16px rgb(20 47 83 / 4%);

  text-align: center;
}

.nobo-greeting__clinic {
  color: var(--greeting-text);
  font-size: var(--greeting-small-size);
  line-height: 1.8;
  letter-spacing: 0.015em;
  overflow-wrap: anywhere;
}

.nobo-greeting__name {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  column-gap: 17px;
  row-gap: 6px;

  margin-top: 14px;
}

.nobo-greeting__position {
  color: var(--greeting-navy);
  font-size: var(--greeting-small-size);
  line-height: 1.6;
  letter-spacing: 0.04em;
}

.nobo-greeting__fullname {
  color: var(--greeting-navy);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.12em;
  overflow-wrap: anywhere;
}

.nobo-greeting__name-en {
  margin-top: 8px;

  color: var(--greeting-gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--greeting-small-size);
  line-height: 1.7;
  letter-spacing: 0.12em;
  overflow-wrap: anywhere;
}

/* ========================================
   右側：ご挨拶
======================================== */

.nobo-greeting__content {
  position: relative;
  min-width: 0;
}

.nobo-greeting__label {
  display: inline-block;
  max-width: 100%;
  padding: 8px 20px;

  color: #fff;
  background: var(--greeting-maincolor);
  font-size: var(--greeting-small-size);
  line-height: 1.6;
  letter-spacing: 0.05em;

  overflow-wrap: anywhere;
  clip-path: polygon(0 0, 100% 0, 98% 100%, 0 100%);
}

.nobo-greeting__title {
  margin-top: 30px;

  color: var(--greeting-navy);
  font-size: clamp(27px, 2.6vw, 35px);
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: 0.05em;

  overflow-wrap: anywhere;
}

.nobo-greeting__title span {
  display: block;
}

.nobo-greeting__title::after {
  content: "";
  display: block;
  width: 64px;
  height: 1px;
  margin-top: 22px;
  background: var(--greeting-gold);
}

.nobo-greeting__message {
  margin-top: 28px;
  color: var(--greeting-text);
}

.nobo-greeting__message p {
  font-size: var(--greeting-small-size);
  line-height: 2;
  letter-spacing: 0.025em;
  overflow-wrap: anywhere;
}

.nobo-greeting__message p + p {
  margin-top: 24px;
}

.nobo-greeting__message a {
  color: var(--greeting-navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.nobo-greeting__message a:focus-visible {
  outline: 2px solid var(--greeting-navy);
  outline-offset: 4px;
}

.nobo-greeting__signature {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: wrap;
  column-gap: 18px;
  row-gap: 6px;

  margin-top: 28px;
  padding-right: 0;

  color: var(--greeting-navy);
  font-size: var(--greeting-small-size);
  line-height: 1.8;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
}

.nobo-greeting__signature > * {
  min-width: 0;
}

/* ========================================
   スクロール時のフェードイン
   共通JSが準備した要素だけに適用
======================================== */

.nobo-greeting :where(
  .nobo-greeting__profile,
  .nobo-greeting__content
)[data-nobo-reveal].is-nobo-reveal-ready {
  opacity: 0;
  transform: translateY(var(--nobo-reveal-distance));

  transition-property: opacity, transform;
  transition-duration: var(--nobo-reveal-duration);
  transition-timing-function: var(--nobo-reveal-easing);
  transition-delay: var(--nobo-reveal-delay, 0ms);
}

.nobo-greeting :where(
  .nobo-greeting__profile,
  .nobo-greeting__content
)[data-nobo-reveal].is-nobo-reveal-ready.is-nobo-reveal-visible {
  opacity: 1;
  transform: none;
}

/* キーボード操作時は即時表示 */
.nobo-greeting :where(
  .nobo-greeting__profile,
  .nobo-greeting__content
)[data-nobo-reveal].is-nobo-reveal-ready:focus-within {
  opacity: 1;
  transform: none;
  transition: none;
}

/* ========================================
   タブレット
======================================== */

@media screen and (min-width: 768px) and (max-width: 1100px) {
  .nobo-greeting {
    padding: 94px 0 52px;
  }

  .nobo-greeting__inner {
    grid-template-columns:
      minmax(0, 0.85fr)
      minmax(0, 1.15fr);
    gap: 32px;
    padding-inline: 28px;
  }

  .nobo-greeting__profile {
    padding-bottom: 0;
  }

  .nobo-greeting__portrait img {
    aspect-ratio: 0.95;
  }

  .nobo-greeting__nameplate {
    width: 94%;
    margin-top: -32px;
    padding: 22px 14px 20px;
    border-radius: 36px 36px 0 0;
  }

  .nobo-greeting__clinic {
    letter-spacing: 0;
  }

  .nobo-greeting__name {
    column-gap: 12px;
  }

  .nobo-greeting__fullname {
    font-size: 28px;
    letter-spacing: 0.08em;
  }

  .nobo-greeting__name-en {
    letter-spacing: 0.06em;
  }

  .nobo-greeting__title {
    margin-top: 26px;
    font-size: 28px;
    letter-spacing: 0.025em;
  }

  .nobo-greeting__title::after {
    width: 52px;
    margin-top: 18px;
  }

  .nobo-greeting__message {
    margin-top: 24px;
  }

  .nobo-greeting__message p {
    letter-spacing: 0.015em;
  }

  .nobo-greeting__message br {
    display: none;
  }

  .nobo-greeting__signature {
    margin-top: 24px;
  }
}

/* ========================================
   スマートフォン
======================================== */

@media screen and (max-width: 767px) {
  .nobo-greeting {
    --nobo-reveal-distance: 16px;

    /* SPも同じ背景画像を使用 */
    --greeting-background-position: center top;
    --greeting-overlay-opacity: 0.9;

    padding: 76px 0 48px;
    scroll-margin-top: var(--header-total-height, 112px);
  }

  .nobo-greeting__background-word {
    top: 8px;
    font-size: clamp(65px, 15vw, 105px);
    letter-spacing: 0;
  }

  .nobo-greeting__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding-inline: 24px;
  }

  .nobo-greeting__profile {
    width: min(100%, 420px);
    margin-inline: auto;
    padding-bottom: 0;
  }

  .nobo-greeting__portrait {
    padding: 5px;
  }

  .nobo-greeting__portrait img {
    aspect-ratio: 1.08;
    object-position: center 35%;
  }

  .nobo-greeting__nameplate {
    width: 94%;
    margin-top: -32px;
    padding: 22px 16px 20px;
    border-radius: 36px 36px 0 0;
  }

  .nobo-greeting__clinic {
    line-height: 1.8;
    letter-spacing: 0;
  }

  .nobo-greeting__name {
    column-gap: 14px;
    margin-top: 12px;
  }

  .nobo-greeting__position {
    letter-spacing: 0.025em;
  }

  .nobo-greeting__fullname {
    font-size: 29px;
    letter-spacing: 0.1em;
  }

  .nobo-greeting__name-en {
    margin-top: 8px;
    letter-spacing: 0.08em;
  }

  .nobo-greeting__label {
    padding: 8px 18px;
    letter-spacing: 0.025em;
  }

  .nobo-greeting__title {
    margin-top: 24px;
    font-size: clamp(26px, 6.5vw, 30px);
    line-height: 1.75;
    letter-spacing: 0.025em;
  }

  .nobo-greeting__title::after {
    width: 48px;
    margin-top: 18px;
  }

  .nobo-greeting__message {
    margin-top: 24px;
  }

  .nobo-greeting__message p {
    line-height: 2;
    letter-spacing: 0.015em;
  }

  .nobo-greeting__message br {
    display: none;
  }

  .nobo-greeting__message p + p {
    margin-top: 22px;
  }

  .nobo-greeting__signature {
    column-gap: 15px;
    margin-top: 24px;
    letter-spacing: 0.025em;
  }
}

/* ========================================
   小さなスマートフォン
======================================== */

@media screen and (max-width: 359px) {
  .nobo-greeting__inner {
    padding-inline: 18px;
  }

  .nobo-greeting__nameplate {
    width: 96%;
    padding-inline: 12px;
  }

  .nobo-greeting__fullname {
    font-size: 28px;
    letter-spacing: 0.06em;
  }

  .nobo-greeting__name-en {
    letter-spacing: 0.04em;
  }

  .nobo-greeting__title {
    font-size: 25px;
    letter-spacing: 0.015em;
  }

  .nobo-greeting__signature {
    column-gap: 12px;
    letter-spacing: 0;
  }
}

/* ========================================
   動きを抑える設定
======================================== */

@media (prefers-reduced-motion: reduce) {
  .nobo-greeting :where(
    .nobo-greeting__profile,
    .nobo-greeting__content
  )[data-nobo-reveal].is-nobo-reveal-ready {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* ==================================================
   院長挨拶：ドクターズファイル掲載情報
================================================== */

.nobo-greeting__media {
  position: relative;
  z-index: 2;
  isolation: isolate;

  width: calc(100% - 64px);
  max-width: 1200px;
  min-width: 0;
  margin: 56px auto 0;
  padding: 32px 0 0;

  border: 0;
  border-top: 1px solid rgb(150 116 59 / 25%);

  color: #142f53;
  background: transparent;
  opacity: 1;
}

.nobo-greeting__media,
.nobo-greeting__media *,
.nobo-greeting__media *::before,
.nobo-greeting__media *::after {
  box-sizing: border-box;
}

/* メディア領域自体には背景レイヤーを重ねない */
.nobo-greeting__media::before,
.nobo-greeting__media::after {
  content: none;
}

/* ==================================================
   見出し
================================================== */

.nobo-greeting__media-header {
  margin: 0 0 26px;
  padding: 0;

  text-align: center;
}

.nobo-greeting__media-title {
  margin: 0;
  padding: 0;

  color: #142f53;
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.06em;
}

.nobo-greeting__media-description {
  margin: 10px 0 0;
  padding: 0;

  color: #485563;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.025em;

  overflow-wrap: anywhere;
}

/* ==================================================
   バナー一覧：PCは3列
================================================== */

.nobo-greeting .nobo-greeting__media-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 24px;

  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;

  list-style: none;
}

.nobo-greeting__media-item {
  min-width: 0;
  margin: 0;
  padding: 0;
}

/* ==================================================
   バナーリンク
================================================== */

.nobo-greeting__media-link {
  display: block;

  width: 100%;
  margin: 0;
  padding: 0;

  border: 0;
  border-radius: 0;

  background: #fff;
  box-shadow: none;
  opacity: 1;

  text-decoration: none;
  -webkit-tap-highlight-color: transparent;

  transition: box-shadow 200ms ease;
}

.nobo-greeting__media-link::before,
.nobo-greeting__media-link::after {
  content: none;
}

.nobo-greeting__media-link[href] {
  cursor: pointer;
}

.nobo-greeting__media-link:not([href]) {
  cursor: default;
}

.nobo-greeting__media-link:focus-visible {
  outline: 2px solid #0272d4;
  outline-offset: 4px;
}

/* ==================================================
   バナー画像
   比率を保ち、文字や写真を切り取らない
================================================== */

.nobo-greeting__media-image {
  display: block;

  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;

  border: 0;
  border-radius: 0;

  box-shadow: none;
  opacity: 1;
  filter: none;
}

/* ==================================================
   ホバー
   画像を薄くせず、影で反応を示す
================================================== */

@media (hover: hover) and (pointer: fine) {
  .nobo-greeting__media-link[href]:hover {
    opacity: 1;
    box-shadow: 0 5px 16px rgb(20 47 83 / 14%);
  }
}

/* ==================================================
   タブレット・スマートフォン
   バナー内の文字が小さくなりすぎないよう1列へ
================================================== */

@media (max-width: 1023px) {
  .nobo-greeting__media {
    width: calc(100% - 48px);
    margin-top: 44px;
    padding-top: 28px;
  }

  .nobo-greeting .nobo-greeting__media-list {
    grid-template-columns: minmax(0, 1fr);
    max-width: 440px;
    margin-inline: auto;
    gap: 20px;
  }
}

@media (max-width: 767px) {
  .nobo-greeting__media {
    margin-top: 36px;
    padding-top: 24px;
  }

  .nobo-greeting__media-header {
    margin-bottom: 22px;
  }

  .nobo-greeting__media-title {
    font-size: 20px;
  }

  .nobo-greeting__media-description {
    font-size: 15px;
    line-height: 1.85;
  }

  .nobo-greeting .nobo-greeting__media-list {
    gap: 18px;
  }
}

@media (max-width: 359px) {
  .nobo-greeting__media {
    width: calc(100% - 36px);
  }
}

/* ==================================================
   動きを抑える設定
================================================== */

@media (prefers-reduced-motion: reduce) {
  .nobo-greeting__media-link {
    transition: none;
  }
}