@charset "UTF-8";

/* テスト北比良商事・デザイン整理 第1回 + Heroレイヤー化 + Hero・余白の微調整
 * このファイルだけでHeroと本文の共通ルールを調整します。
 * 元の圧縮CSSは保持。新しいクラスは旧Heroのスタイルと分離しています。
 * 本文font-familyは元CSSを継承。ShiftWithのロゴ原色は変更しません。
 */

/* 1. Hero調整値 — PCの形状を維持。モバイルの高さ・傾斜は末尾のメディアクエリ。
 * PCのSVGは正方形。モバイルは図形と線を共に縦縮小し、浅い斜辺にする。
 * 右三角形はright/bottom:0。文字の安全余白も同じright-sizeから計算する。
 * 2行×line-height:1.6、幅6.4文字の矩形と三角形の3辺の距離を揃える。
 * (辺長 − 文字矩形の幅 − 高さ) / (2 + √2) = 右・下・斜辺からの余白。
 * コピーや行数を将来変える場合はmessage-width/height-emも見直す。
 */
:root {
  --hero-height: clamp(468px, 44vw, 680px);
  --hero-left-size: clamp(340px, 44vw, 680px);
  --hero-left-inset: clamp(-48px, -3vw, -12px);
  --hero-right-size: clamp(236px, 34vw, 530px);
  --hero-light-color: 255 255 255;
  --hero-light-opacity: .55;
  --hero-dark-color: 7 95 124;
  --hero-dark-opacity: .9;
  --hero-line-color: 255 255 255;
  --hero-line-opacity: .8;
  --hero-line-width: 3;
  --hero-message-size: clamp(19px, 2.5vw, 40px);
  --hero-message-width-em: 6.4;
  --hero-message-height-em: 3.2;
  --hero-message-clearance: calc((var(--hero-right-size) - var(--hero-message-size) * (var(--hero-message-width-em) + var(--hero-message-height-em))) / 3.4142135624);
  --section-space: 75px;
  --intro-leading-space: 72px;
  --section-rail-width: 16%;
  --section-marker-content-gap: 16px;
  --section-number-size: 48px;
  --section-label-size: 10px;
  --section-label-tracking: .2em;
  --section-title-size: clamp(30px, 3vw, 44px);
  --section-heading-gap: 16px;
  --section-content-gap: 22px;
  --body-size: 15px;
  --body-leading: 2;
  --card-title-size: 22px;
  --card-gap: 24px;
  --card-image-ratio: 8 / 5;
}

/* 2. Hero — ヘッダー直下、全幅1カラム。3層を同じHero枠に重ねる。
 * 装飾のはみ出しはHeroでクリップ。本文の横はみ出しを隠す指定ではない。
 */
.feature-hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: var(--hero-height);
  margin: 0;
  overflow: hidden;
  background: var(--pale);
}

.feature-hero__media,
.feature-hero__overlay,
.feature-hero__text {
  position: absolute;
  inset: 0;
}

/* 2-A. メディア層 — img/videoのどちらも中央を固定してcoverでトリミング。 */
.feature-hero__media {
  z-index: 0;
  overflow: hidden;
}

.feature-hero__media > :is(img, video) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* 2-B. オーバーレイ層 — 既存の図形・線・色はそのまま、左右別の寸法で管理。
 * SVGは1000×1000固定座標。モバイルのscaleYは今回指定の角度変更専用。
 * PCでは左右を離し、狭い画面では相対的に中央へ寄せる。
 */
.feature-hero__overlay {
  z-index: 1;
  pointer-events: none;
}

.feature-hero__geometry {
  position: absolute;
  display: block;
  height: auto;
  aspect-ratio: 1;
}

.feature-hero__geometry--left {
  width: var(--hero-left-size);
  top: 0;
  left: var(--hero-left-inset);
}

.feature-hero__geometry--right {
  width: var(--hero-right-size);
  bottom: 0;
  right: 0;
}

.feature-hero__facet--light {
  fill: rgb(var(--hero-light-color) / var(--hero-light-opacity));
}

.feature-hero__facet--dark {
  fill: rgb(var(--hero-dark-color) / var(--hero-dark-opacity));
}

.feature-hero__line {
  fill: none;
  stroke: rgb(var(--hero-line-color) / var(--hero-line-opacity));
  stroke-width: var(--hero-line-width);
}

/* 2-C. テキスト層 — 三角形内部の3辺からの余白で光学的な中心を定める。
 * 外接正方形の中央ではなく、横長の文字領域が図形内に収まる位置。
 */
.feature-hero__text { z-index: 2; }

.feature-hero__message {
  position: absolute;
  right: var(--hero-message-clearance);
  bottom: var(--hero-message-clearance);
  width: calc(var(--hero-message-size) * var(--hero-message-width-em));
  margin: 0;
  color: #fff;
  font-size: var(--hero-message-size);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: .02em;
  text-align: center;
  text-shadow: none;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 3. 01〜04の共通骨格 — 元の01の細い大番号と縦並びラベルを継承。 */
.page-section {
  padding-block: var(--section-space);
}

/* Hero直後の上余白だけを詰め、セクション間の区切りは維持する。 */
.feature-hero + .page-section {
  padding-top: var(--intro-leading-space);
}

.page-section--brand { background: #f5f9fa; }
.page-section--research { background: #f7f9fa; }
.page-section--contact { background: #edf6f7; }

.section-layout {
  display: grid;
  grid-template-columns: var(--section-rail-width) minmax(0, 1fr);
  align-items: start;
}

.section-marker {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-right: 24px;
}

.section-marker__number {
  color: var(--lake);
  font-size: var(--section-number-size);
  font-weight: 300;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.section-marker__label {
  color: #8093a0;
  font-size: var(--section-label-size);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: var(--section-label-tracking);
}

.section-content {
  display: grid;
  gap: var(--section-content-gap);
  min-width: 0;
}

.section-heading {
  display: grid;
  gap: var(--section-heading-gap);
}

.section-heading__title {
  margin: 0;
  font-size: var(--section-title-size);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -.05em;
  white-space: nowrap;
  overflow-wrap: normal;
}

.section-text {
  max-width: 70ch;
  margin: 0;
  color: var(--muted);
  font-size: var(--body-size);
  line-height: var(--body-leading);
  overflow-wrap: anywhere;
}

/* 4. ブランド紹介 — 既存の白いロゴ枠とロゴ原色を維持。 */
.brand-panel {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  border: 1px solid #e0ebed;
  background: #fff;
}

.brand-panel__logo {
  display: grid;
  place-items: center;
  padding: 32px;
  border-right: 1px solid #e6edef;
}

.brand-panel__logo img {
  display: block;
  width: min(307px, 100%);
  height: auto;
}

.brand-panel__copy,
.profile-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: var(--card-gap);
  min-width: 0;
}

.brand-panel__copy { padding: 32px; }

/* 5. 技術・研究カード — h3 / 本文 / 間隔を共用。
 * 技術カードのCSSイラストは既存のcap-art系を再利用します。
 */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--card-gap);
}

.service-card,
.research-card {
  min-width: 0;
}

.service-card .cap-art {
  height: auto;
  aspect-ratio: var(--card-image-ratio);
  margin: 0 0 var(--card-gap);
}
.service-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-card-title {
  margin: 0 0 12px;
  font-size: var(--card-title-size);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}

.research-list {
  border-top: 1px solid var(--line);
}

.research-card {
  padding-block: var(--card-gap);
  border-bottom: 1px solid var(--line);
}

/* 6. 会社・問い合わせ — 本文サイズと導線の間隔を共通化。 */
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--section-content-gap);
}

.profile-visual {
  padding: 24px;
  background: linear-gradient(135deg, #f0f7f8, #e1f0f2 70%, #c4e1e7);
}

.profile-visual .portrait-frame {
  width: 100%;
  max-width: none;
  height: 320px;
}

.profile-visual .portrait-frame svg {
  width: min(180px, 100%);
}

.section-content .circle-link {
  font-size: 14px;
}

.section-contact-link {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 100%;
  padding: 20px 26px;
  background: var(--lake);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.section-contact-link:hover { background: var(--deep); }
.section-contact-link span { font-size: 18px; }

/* ナビゲーションのShiftWith文字ロゴ。原本の色と縦横比を維持する。
 * 北比良商事ロゴの幅は既存editorial.cssの230 / 200 / 175pxを継承する。
 */
.nav-brand-link {
  display: inline-flex;
  align-items: center;
}

.nav-brand-logo {
  display: block;
  width: 104px;
  height: auto;
}

/* 7. 中間幅 — マーカーは左列のまま、狭いカードを避ける。 */
@media (min-width: 781px) and (max-width: 1150px) {
  .service-grid { grid-template-columns: 1fr; }
  .service-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--card-gap);
    align-content: start;
  }
  .service-card .cap-art { grid-row: span 2; margin: 0; }
  .service-card .content-card-title { align-self: end; }
}

/* 8. スマートフォン — 以前の高さの75%。左右の図形だけを縦縮小し斜辺を浅くする。
 * 傾斜 k=高さ/幅、文字矩形の3辺からの距離を一般化して計算する。
 * 01の旧モバイルと同じく番号＋ラベルを横並びにします。
 */
@media (max-width: 780px) {
  :root {
    --hero-height: clamp(307.5px, 45vw, 351px);
    --hero-mobile-slope: .3639702343; /* tan(20deg)。写真・文字は変形しない。 */
    --hero-right-size: clamp(294px, 42vw, 328px); /* 浅い三角形内に文字を確保。旧面積以下。 */
    --hero-message-size: 16px;
    --hero-message-clearance: calc((var(--hero-right-size) * var(--hero-mobile-slope) - var(--hero-message-size) * (var(--hero-message-width-em) * var(--hero-mobile-slope) + var(--hero-message-height-em))) / (1 + var(--hero-mobile-slope) + sqrt(1 + var(--hero-mobile-slope) * var(--hero-mobile-slope))));
    --hero-left-size: clamp(220px, 34vw, 280px);
    --hero-left-inset: 0px;
    --section-space: 72px;
    --intro-leading-space: 48px;
    --section-number-size: 30px;
    --section-label-size: 9px;
    --section-title-size: clamp(22px, 6.7vw, 34px);
    --section-heading-gap: 14px;
    --section-content-gap: 18px;
    --card-title-size: 20px;
  }

.feature-hero__geometry { transform: scaleY(var(--hero-mobile-slope)); }
  .feature-hero__geometry--left { transform-origin: top left; }
  .feature-hero__geometry--right { transform-origin: bottom right; }

  /* TOP主要4セクションの外側だけ48px。会社概要/カード内部には波及しない。 */
  .home { --section-space: 48px; }

  .nav-brand-logo { width: 96px; }
  .section-layout { grid-template-columns: minmax(0, 1fr); gap: var(--section-marker-content-gap); }
  .section-marker { flex-direction: row; align-items: center; gap: 16px; padding: 0; }
  .service-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .brand-panel,
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .brand-panel__logo { padding: 28px; border-right: 0; border-bottom: 1px solid #e6edef; }
  .brand-panel__logo img { max-width: 245px; }
  .brand-panel__copy { padding: 28px; }
  .profile-visual .portrait-frame { height: 310px; }
}

/* ヘッダーだけ文字ロゴを縮小。フッターは従来の104px / 96pxを継承。 */
.site-header .nav-brand-logo { width: 88px; }
@media (max-width: 780px) {
  .site-header .nav-brand-logo { width: 78px; }
}

/* 円の寸法・線・色と既存の矢印文字を維持し、文字の行ボックスを中央に置く。 */
.circle-link > span { line-height: 1; flex-shrink: 0; }
/* 現行フォントの矢印の描画中心は行ボックスより約2px下。円枠を動かさず補正する。 */
.circle-link__glyph {
  display: block;
  font-style: normal;
  line-height: 1;
  transform: translateY(-2px);
}

/* 会社概要専用。TOPと同じ文字・色・余白の変数を共有する。 */
.company-main { padding-block: var(--section-space); }
.company-detail-section { margin-block: 48px; }
.company-facts { margin: 0; border-top: 1px solid var(--line); }
.company-facts > div {
  display: grid;
  grid-template-columns: minmax(120px, 24%) minmax(0, 1fr);
  gap: var(--card-gap);
  padding-block: 20px;
  border-bottom: 1px solid var(--line);
  font-size: var(--body-size);
  line-height: var(--body-leading);
}
.company-facts dt { font-weight: 700; }
.company-facts dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.company-photo-note { margin-top: 12px; }
@media (max-width: 780px) {
  .company-facts > div { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

/* Shared corporate header logo: 80% of the approved 230/175px sizes. */
.kitahira-corporate .site-header .logo img { width:184px; height:auto; }
@media(max-width:900px){.kitahira-corporate .site-header .logo img {width:140px;}}
