/*
 * brand-message.css - BRAND MESSAGE セクション
 *
 * 構造:
 *   .section-brand-wrapper (relative) ← タイトルのabsolute基準
 *     ├── .section-brand__title (absolute, z:2) ← clip-pathの外
 *     └── .section-brand (clip-path) ← 斜めカットはここだけ
 */

/* ============================================================
   ラッパー: タイトルとsectionの共通座標系
   ============================================================ */
.section-brand-wrapper {
  --diagonal-height: clamp(80px, 12vw, 200px);
  --diagonal-angle: -6.8deg;
  position: relative;
  /* Why: sectionのmargin-topで上に食い込む分、wrapperも同じだけ食い込む */
  margin-top: calc(-1 * var(--diagonal-height));
  z-index: 1;
}

/* ============================================================
   タイトル: clip-pathの外に配置
   Why: sectionにclip-pathがかかっても、タイトルはwrapper直下なので
        切り取られない。斜めラインの中点にピン留め + 同角度で回転。
   ============================================================ */
.section-brand__title {
  position: absolute;
  /* Why: 斜めラインの中点 = (50%, diagonal-height/2)。
            translateで自身の中心をその点に合わせ、rotateで傾ける。
            これだけで「画鋲ピン留め」が完成する。 */
  top: calc(var(--diagonal-height) / 2);
  left: 50%;
  transform: translate(-50%, -50%) rotate(var(--diagonal-angle));
  z-index: 2;
  font-family: var(--font-en-heading);
  font-size: clamp(36px, 4.6vw, 56px);
  font-weight: 600;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-magenta);
  line-height: 1;
  margin: 0;
  white-space: nowrap;
  pointer-events: none;
}

/* ============================================================
   セクション本体: clip-pathで斜めカット
   ============================================================ */
.section-brand {
  background: var(--color-black);
  color: var(--color-white);
  overflow: hidden;
  clip-path: polygon(0 var(--diagonal-height), 100% 0, 100% 100%, 0 100%);
}

/* ============================================================
   領域1: 上部（テキスト + 画像）
   ============================================================ */
.section-brand__upper {
  position: relative;
  /* Why: diagonal-height分のスペース + 余白でコンテンツがclipされないように */
  padding-top: calc(
    var(--diagonal-height) + clamp(var(--space-md), 2vw, var(--space-lg))
  );
  padding-bottom: clamp(var(--space-2xl), 5vw, var(--space-3xl));
}

.section-brand__upper .section-inner {
  padding-right: 0;
}

.section-brand__columns {
  display: grid;
  grid-template-columns: 1.6fr 3.4fr;
  gap: clamp(var(--space-md), 2vw, var(--space-xl));
  align-items: start;
}

/* テキスト領域 */
.section-brand__text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding-right: var(--space-md);
}

.section-brand__body {
  font-size: clamp(0.8125rem, 0.95vw, 0.9375rem);
  line-height: 2;
  letter-spacing: 0.05em;
}

.section-brand__body p {
  margin-bottom: 1.5em;
}

.section-brand__body p:last-child {
  margin-bottom: 0;
}

.section-brand__tagline {
  margin-top: var(--space-xl);
  font-size: clamp(var(--fs-sm), 0.9vw, var(--fs-base));
}

.section-brand__logo-text {
  font-family: var(--font-en-heading);
  font-size: 48px;
  font-weight: 600;
  /* margin-top: var(--space-xl); */
  line-height: 1;
}

/* 画像領域
   Why: upper基準absolute。セクションclip-pathで画像左上が斜めに切られる。
        画像自身のclip-pathで下辺を斜めカット + 右下角丸を実現。

   下辺の斜め方向: セクション上辺と同じ（左が低く右が高い）。
        左下(0, 100%) → 右下(100%-R, 100%-slope) へ斜めに上がる。
        右下コーナーに角丸。

   --img-slope: 下辺の右側の持ち上がり量（%）。 */
.section-brand__image {
  --img-slope: 10%;
  --img-radius: 60px;
  position: absolute;
  top: 0;
  right: 5vw;
  bottom: 0;
  left: calc(5vw + 32% + clamp(var(--space-md), 2vw, var(--space-xl)));
  overflow: hidden;
  clip-path: polygon(
    /* 上辺 */ 0 0,
    100% 0,
    /* 右辺（角丸開始点まで） */ 100%
      calc(100% - var(--img-slope) - var(--img-radius)),
    /* 右下角丸（円弧近似: 6ポイント）
           始点: (100%, 100%-slope-R) → 終点: (100%-R, 100%-slope)
           90°の円弧を6分割して滑らかに */
    calc(100% - var(--img-radius) * 0.02)
      calc(100% - var(--img-slope) - var(--img-radius) * 0.8),
    calc(100% - var(--img-radius) * 0.07)
      calc(100% - var(--img-slope) - var(--img-radius) * 0.6),
    calc(100% - var(--img-radius) * 0.18)
      calc(100% - var(--img-slope) - var(--img-radius) * 0.38),
    calc(100% - var(--img-radius) * 0.38)
      calc(100% - var(--img-slope) - var(--img-radius) * 0.18),
    calc(100% - var(--img-radius) * 0.6)
      calc(100% - var(--img-slope) - var(--img-radius) * 0.07),
    calc(100% - var(--img-radius) * 0.8)
      calc(100% - var(--img-slope) - var(--img-radius) * 0.02),
    calc(100% - var(--img-radius)) calc(100% - var(--img-slope)),
    /* 下辺（斜め: 右が高く左が低い = セクション上辺と同方向） */ 0 100%
  );
}

.section-brand__image-el {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.section-brand__image-credit {
  position: absolute;
  left: calc(5vw + 32% + clamp(var(--space-md), 2vw, var(--space-xl)));
  right: 5vw;
  bottom: clamp(6px, 1vw, 12px);
  margin: 0;
  font-family: var(--font-en-ui);
  font-size: clamp(0.6875rem, 0.8vw, 0.75rem);
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.72);
  text-align: right;
  z-index: 2;
}

/* ============================================================
   領域2: 下部（動画 + キャプション）
   ============================================================ */
.section-brand__lower {
  padding-top: 100px;
  padding-bottom: clamp(var(--space-3xl), 8vw, 160px);
}

.section-brand__video {
  width: 100%;
}

.section-brand__video-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
  cursor: pointer;
}

.section-brand__video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.section-brand__video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-brand__play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.2s ease;
}

.section-brand__play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.section-brand__video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.section-brand__video-caption {
  margin-top: var(--space-lg);
  font-size: clamp(var(--fs-xs), 0.85vw, var(--fs-sm));
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
}

/* ============================================================
   レスポンシブ: モバイル
   ============================================================ */
@media (max-width: 767px) {
  .section-brand-wrapper {
    /* SPでも斜線角度を一致させるため、幅連動の高さにする */
    --diagonal-height: clamp(46px, 14vw, 78px);
    --diagonal-angle: -6.8deg;
    --sp-image-lift: clamp(16px, 5vw, 30px);
  }

  .section-brand__title {
    letter-spacing: 0.02em;
  }

  .section-brand__upper {
    padding-top: 0;
    padding-bottom: clamp(28px, 7vw, 44px);
  }

  .section-brand__upper .section-inner {
    padding-right: 5vw;
    padding-left: 5vw;
  }

  .section-brand__columns {
    grid-template-columns: 1fr;
    gap: clamp(14px, 4vw, 22px);
  }

  .section-brand__image {
    /* section-hashtag__card-media のように、SPは先頭に通常フロー配置 */
    --img-slope: 8%;
    --img-radius: 30px;
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    height: clamp(310px, 115vw, 500px);
    margin-top: calc(-1 * var(--sp-image-lift));
    order: -1;
    display: block;
    overflow: hidden;
  }

  .section-brand__image-el {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 0;
  }

  .section-brand__image-credit {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    order: -1;
    margin: 8px 0 4px;
    font-size: 0.6875rem;
    text-align: right;
  }

  .section-brand__text {
    padding-right: 0;
    align-items: center;
  }

  .section-brand__body {
    font-size: clamp(0.96rem, 3.8vw, 1.08rem);
    line-height: 2;
    max-width: min(92vw, 22em);
    text-align: center;
    letter-spacing: 0;
  }

  .section-brand__body p {
    margin-bottom: 1.15em;
  }

  .section-brand__tagline {
    margin-top: clamp(18px, 5vw, 26px);
  }

  .section-brand__logo-text {
    /* margin-top: clamp(14px, 3vw, 22px); */
    font-size: 48px;
  }

  .section-brand__lower {
    padding-top: clamp(20px, 6vw, 34px);
    padding-bottom: clamp(48px, 10vw, 86px);
  }

  .section-brand__video-caption {
    font-size: var(--fs-xs);
    line-height: 2;
    max-width: 34em;
    margin-left: auto;
    margin-right: auto;
  }
}
