/*
  UMC・Hエレクトロニクス Webサイト共通CSS
  01 基本 / 02 ヘッダー / 03 ナビ / 04 ヒーロー / 05 共通
  06 ABOUT / 07 NEWS / 08 STRENGTH / 09 CTA / 10 フッター
  11 表示アニメーション / 12 レスポンシブ / 13 動きを減らす設定
*/

/* =========================================================
01. 基本設定
サイト全体で使う色、幅、影、文字を設定します。
========================================================= */
:root {
  --red: #c7001e;
  --red-dark: #8f0015;
  --red-deep: #4b000b;
  --red-light: #fff1f3;
  --bg: #f7f7f7;
  --border: #e7e0e1;
  --black: #171717;
  --gray: #666666;
  --max-width: 1120px;
  --shadow: 0 22px 55px rgba(143, 0, 21, 0.14);
}

/* 幅の計算へpaddingとborderを含めます。 */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--black);
  background: #ffffff;
  font-family: "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.8;
}

img,
video {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 共通のコンテンツ幅です。 */
.container,
.header-inner,
.hero-inner {
  width: min(100% - 40px, var(--max-width));
  margin-right: auto;
  margin-left: auto;
}

/* キーボード操作時だけ表示する「本文へスキップ」です。 */
.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  top: 16px;
  left: 16px;
  z-index: 999;
  padding: 10px 14px;
  color: var(--black);
  background: #ffffff;
}

/* =========================================================
02. ヘッダー
画面上部に固定し、スクロール時に影を付けます。
========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 900;
}

.logo span {
  color: var(--red);
}

/* =========================================================
03. グローバルナビゲーション
========================================================= */
.global-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  font-weight: 500;
}

.global-nav > a {
  position: relative;
  padding: 18px 0;
}

.global-nav > a:not(.nav-contact):hover::after,
.global-nav > a:not(.nav-contact):focus-visible::after {
  width: 100%;
}

.nav-contact {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 18px !important;
  color: #ffffff;
  font-weight: 800;
  background: var(--red);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(199, 0, 30, 0.34);
}

.menu-button {
  display: none;
  padding: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.menu-button span {
  width: 26px;
  height: 2px;
  display: block;
  margin: 6px 0;
  background: var(--red);
}

/* ナビゲーションのクリック可能な項目は、マウスオン時に手のカーソルを表示します。 */
.global-nav a,
.global-nav button {
  cursor: pointer;
}

/* =========================================================
04. メインビジュアル
========================================================= */
/* 2520×1080のhero.mp4と同じ7:3の比率を保ち、縦方向の見切れを防ぎます。 */
.hero {
  position: relative;
  min-height: 620px;
  aspect-ratio: 7 / 3;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #ffffff;
  background: #111111;
}

.hero-video,
.hero-fallback,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-video {
  z-index: 1;
  object-fit: cover;
  object-position: center center;
}

.hero-fallback {
  z-index: 0;
  background: #111111 url("../image/hero-poster.jpg") center / cover no-repeat;
}

.hero-overlay {
  z-index: 2;
  background: linear-gradient(
    90deg,
    rgba(10, 42, 76, 0.64),
    rgba(36, 118, 178, 0.22)
  );
}

.hero-inner {
  position: relative;
  z-index: 3;
}

.hero-content {
  filter: drop-shadow(0 3px 14px rgba(0, 0, 0, 0.55));
}

.eyebrow {
  display: inline-block;
  padding: 8px 16px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.65);
}

.hero-main-copy {
  margin: 20px 0 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.15;
}

.hero-text {
  max-width: 900px;
  margin: 24px 0 0;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

.btn {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  font-weight: 700;
  border-radius: 999px;
  transition: transform 0.25s;
}

.btn:hover {
  transform: translateY(-3px);
}
.btn:focus-visible,
.menu-button:focus-visible,
.submenu-toggle:focus-visible {
  outline: 3px solid #0067b8;
  outline-offset: 3px;
}

.btn-primary {
  color: #ffffff;
  background: var(--red);
  box-shadow: 0 14px 32px rgba(199, 0, 30, 0.35);
}

.btn-secondary {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.btn-white {
  color: var(--red);
  background: #ffffff;
}

/* =========================================================
05. 共通セクションと見出し
========================================================= */
.section {
  padding: 92px 0;
}

.gray {
  background: var(--bg);
}

.section-heading {
  max-width: 900px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-heading h2 {
  margin: 8px 0 16px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.35;
}

.label,
.section-label {
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.text-link {
  color: var(--red);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================================
06. UMC・Hエレクトロニクスについて
NEWSと同じ見出し体裁にし、本文は左揃えにします。
========================================================= */
.intro-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

.intro-content .lead {
  margin-top: 0;
  font-size: 18px;
  font-weight: 500;
}

.intro-content p {
  margin-bottom: 24px;
}

/* =========================================================
07. ニュース
日付とタイトルを横並びにし、NEWはタイトル文末へ表示します。
========================================================= */
.news-list {
  display: grid;
  border-top: 1px solid var(--border);
}

.news-list > a {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, padding-left 0.2s, background 0.2s;
}

.news-list > a:hover {
  padding-left: 8px;
  color: var(--red);
  background: linear-gradient(90deg, rgba(199, 0, 30, 0.05), transparent);
}

.news-list time {
  color: var(--red);
  font-weight: 900;
}

.news-title {
  display: inline;
  min-width: 0;
}

/* JavaScriptが全角スペース1文字の後にNEWを自動追加します。 */
.new-badge {
  display: none;
  margin: 0;
  padding: 1px 5px;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.4;
  letter-spacing: 0.04em;
  white-space: nowrap;
  vertical-align: 0.08em;
  background: var(--red);
  border-radius: 0;
  animation: newBlink 1s step-start infinite;
}

.news-list .is-new .new-badge {
  display: inline-block;
}

@keyframes newBlink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0.2;
  }
}

.news-more {
  margin: 22px 0 0;
}

/* トップページのニュースタイトルを少し太くします。 */

/* リンク型と非リンク型のニュースタイトルに共通して適用します。 */
.news-title,
.news-release-title {
  font-weight: 500;
}
/* =========================================================
08. 3つの強み
========================================================= */
.strength-list {
  display: grid;
  gap: 22px;
}

.strength-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 34px;
  background: #ffffff;
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.strength-item:hover {
  border-color: rgba(199, 0, 30, 0.22);
  box-shadow: var(--shadow);
  transform: translateY(-9px);
}

.strength-icon {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 900;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 12px 25px rgba(199, 0, 30, 0.25);
}

.strength-item h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.strength-item p {
  margin: 0 0 12px;
  color: var(--black);
}

/* =========================================================
09. お問い合わせCTA
========================================================= */
.cta {
  padding: 86px 0 74px;
  color: #ffffff;
  text-align: center;
  background: linear-gradient(
    115deg,
    var(--red-deep) 0%,
    var(--red-dark) 48%,
    var(--red) 100%
  );
}

.cta .label {
  margin-bottom: 28px;
  color: #ffffff;
  letter-spacing: 0.22em;
}

.cta h2 {
  max-width: 900px;
  margin: 0 auto 24px;
  font-size: clamp(32px, 4.4vw, 46px);
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.cta p {
  max-width: 760px;
  margin: 0 auto 30px;
  font-size: 14px;
  font-weight: 700;
}

.cta .btn-white {
  min-width: 265px;
  min-height: 50px;
  font-weight: 900;
}

/* =========================================================
10. フッター
内部ページと親会社Webサイトへのリンクを表示します。
========================================================= */
.site-footer {
  padding: 34px 0;
  color: #ffffff;
  background: #1b1b1b;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.footer-company {
  flex: 0 0 auto;
}

.footer-company-name {
  margin: 0 0 6px;
  font-weight: 700;
}

.footer-company small {
  color: #cccccc;
}

.footer-nav {
  max-width: 720px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 20px;
}

.footer-nav a {
  color: #ffffff;
  font-size: 13px;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-nav a:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

/* =========================================================
11. 表示アニメーション
========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s, transform 0.7s;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.is-fading {
  animation: fadeText 0.35s ease;
}

@keyframes fadeText {
  from {
    opacity: 0.25;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
12. タブレット・スマートフォン対応
========================================================= */
@media (max-width: 1080px) {
  .global-nav {
    gap: 13px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .header-inner {
    min-height: 64px;
  }

  .logo {
    font-size: 16px;
  }

  .menu-button {
    z-index: 102;
    display: block;
  }

  .global-nav {
    position: fixed;
    top: 72px;
    right: 16px;
    left: 16px;
    display: grid;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }

  .global-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .global-nav > a {
    display: block;
    padding: 13px;
    color: var(--black);
  }

  .nav-contact {
    width: auto;
    justify-self: start;
    color: #ffffff !important;
  }

  /* スマートフォンでは文章量を確保するため、固定の最小高さへ戻します。 */
  .hero {
    min-height: 720px;
    aspect-ratio: auto;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero-text {
    font-size: 16px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .section {
    padding: 72px 0;
  }

  /* スマートフォンでは日付を上段、タイトルを下段にします。 */
  .news-list > a {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  /* NEWはタイトルの中にあるため、文末の位置を維持します。 */
  .news-title {
    grid-column: auto;
  }

  .strength-item {
    grid-template-columns: 1fr;
  }

  .cta {
    padding: 72px 0;
  }

  .cta h2 {
    font-size: 30px;
  }

  .cta .btn-white {
    width: auto;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-nav {
    justify-content: flex-start;
    gap: 12px 18px;
  }
}

@media (max-width: 480px) {
  .container,
  .header-inner,
  .hero-inner {
    width: min(100% - 28px, var(--max-width));
  }

  .hero h1 {
    font-size: 34px;
  }

  .strength-item {
    padding: 26px;
  }
}

/* =========================================================
13. 動きを減らす設定
端末側でアニメーション削減が指定されている場合に対応します。
========================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal.is-visible,
  .new-badge,
  .is-fading {
    opacity: 1;
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* =========================================================
14. 上部ドロップダウンメニュー
この範囲は上部メニューだけに適用されます。
========================================================= */

/* ページ内リンクで移動した見出しが固定ヘッダーに隠れないようにします。 */
section[id],
article[id],
div[id] {
  scroll-margin-top: 90px;
}

.global-nav .nav-item {
  position: relative;
}

.global-nav .nav-parent-row {
  display: flex;
  align-items: center;
}

.global-nav .nav-parent-link {
  position: relative;
  display: block;
  padding: 18px 0;
}

/* 現在表示中の主要メニューと、マウス・キーボード操作中の主要メニューに赤い下線を表示します。 */
.global-nav .nav-parent-link::after,
.global-nav > a:not(.nav-contact)::after {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 0;
  height: 2px;
  content: "";
  background: var(--red);
  transition: width 0.25s;
}

.global-nav .nav-item:hover .nav-parent-link::after,
.global-nav .nav-item:focus-within .nav-parent-link::after,
.global-nav .nav-item.is-current .nav-parent-link::after,
.global-nav > a.is-current:not(.nav-contact)::after {
  width: 100%;
}

/* PCでは矢印ボタンを隠し、マウスまたはTabキーで下層メニューを表示します。 */
.global-nav .submenu-toggle {
  display: none;
}

.global-nav .submenu {
  position: absolute;
  top: calc(100% - 2px);
  left: 50%;
  z-index: 120;
  min-width: 240px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 8px 0;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.global-nav .submenu-wide {
  min-width: 340px;
}

/* 右側にあるサステナビリティメニューが画面外へ出にくい位置にします。 */
.global-nav .nav-item[data-nav-section="csr"] .submenu {
  right: 0;
  left: auto;
  transform: translate(0, -8px);
}

.global-nav .nav-item:hover .submenu,
.global-nav .nav-item:focus-within .submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.global-nav .nav-item[data-nav-section="csr"]:hover .submenu,
.global-nav .nav-item[data-nav-section="csr"]:focus-within .submenu {
  transform: translate(0, 0);
}

.global-nav .submenu a {
  display: block;
  padding: 10px 16px;
  color: var(--black);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  white-space: normal;
}

.global-nav .submenu a:hover,
.global-nav .submenu a:focus-visible {
  color: var(--red);
  background: var(--red-light);
  outline: none;
}

/* お問い合わせページを表示中の場合も、ボタンの見た目を維持します。 */
.global-nav .nav-contact.is-current {
  box-shadow: 0 0 0 3px rgba(199, 0, 30, 0.2), 0 8px 18px rgba(199, 0, 30, 0.34);
}

@media (max-width: 768px) {
  .global-nav {
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }

  .global-nav .nav-item {
    width: 100%;
  }

  .global-nav .nav-parent-row {
    width: 100%;
    justify-content: space-between;
  }

  .global-nav .nav-parent-link {
    flex: 1;
    padding: 13px;
    color: var(--black);
  }

  .global-nav .nav-parent-link::after {
    display: none;
  }

  /* スマートフォンでは矢印ボタンを表示します。 */
  .global-nav .submenu-toggle {
    width: 44px;
    height: 44px;
    display: inline-grid;
    flex: 0 0 44px;
    place-items: center;
    color: var(--red);
    background: transparent;
    border: 0;
    cursor: pointer;
  }

  .global-nav .submenu-toggle span {
    display: block;
    font-size: 20px;
    transition: transform 0.2s;
  }

  .global-nav .submenu-toggle[aria-expanded="true"] span {
    transform: rotate(180deg);
  }

  /* スマートフォンの下層メニューは、初期状態では閉じます。 */
  .global-nav .submenu,
  .global-nav .submenu-wide {
    position: static;
    min-width: 0;
    max-width: none;
    display: none;
    padding: 4px 0 8px 14px;
    background: #fafafa;
    border: 0;
    border-left: 3px solid var(--red-light);
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .global-nav .nav-item[data-nav-section="csr"] .submenu,
  .global-nav .nav-item[data-nav-section="csr"]:hover .submenu,
  .global-nav .nav-item[data-nav-section="csr"]:focus-within .submenu {
    transform: none;
  }

  .global-nav .nav-item.is-submenu-open .submenu {
    display: block;
  }

  .global-nav .submenu a {
    padding: 10px 12px;
  }
}

/* =========================================================
15. トップページの2種類のPDFを掲載するニュース項目
========================================================= */
.news-release-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.news-release-item time {
  color: var(--red);
  font-weight: 900;
}
.news-release-title,
.news-pdf-links {
  margin: 0;
}
.news-pdf-links {
  margin-top: 5px;
  font-size: 14px;
}
.news-pdf-links a {
  color: var(--red);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.news-pdf-links a:hover,
.news-pdf-links a:focus-visible {
  color: var(--red-dark);
}
@media (max-width: 768px) {
  .news-release-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .news-pdf-links > span[aria-hidden="true"] {
    display: none;
  }
  .news-pdf-links a {
    display: block;
    margin-top: 5px;
  }
}
/* トップページの非リンクニュースと読み上げ支援 */
.news-static-item {
  cursor: default;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
  border: 0;
}
@media (max-width: 768px) {
  .news-static-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none;
  }
}
