/* ヒーロー全体 */
:root {
    --header-height: 60px;
}

/* ==============================
   ヒーローセクション専用スタイル
   （文字固定・背景スライド版）
   ============================== */
.top-hero {
    position: relative;
    width: 100%;
    height: 50vh; /* 画面高の40% */
    min-height: 700px;
    overflow: hidden;
    /* background:
        linear-gradient(
            120deg,
            #000 0%,
            #111 30%,
            #300 60%,
            #ff0000 100%
        ); */
    background: linear-gradient(
            120deg,
            #000 0%,
            #111 30%,
            #300 60%,
            #ff0000 100%),
    url("../images/top-hero-01.png") center / cover no-repeat; /* 読み込み前の土台 */    
    padding: 0;
     /* margin-top: var(--header-height) !important; */
     padding: 0 !important;
}

/* =========================
   overlayは軽くする（任意）
   ========================= */
.top-hero::before {
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.3),
        rgba(0,0,0,0.6)
    );
    mix-blend-mode: normal;
}

/* .top-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;

    background:
        linear-gradient(
            120deg,
            rgba(0, 0, 0, 0.70) 0%,
            rgba(17, 17, 17, 0.45) 30%,
            rgba(80, 0, 0, 0.30) 60%,
            rgba(255, 0, 0, 0.28) 100%
        ),
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.20) 0%,
            rgba(0, 0, 0, 0.45) 100%
        );
} */

/* --- 背景スライダーの設定 --- */
.top-hero-slider {
    position: absolute; /* 背面に固定 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.top-hero-slide {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.top-hero-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.top-hero-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
    opacity: 0.45;
}

.top-hero-inner {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    position: relative;
}

/* --- 【重要】固定表示するコンテンツ部分 --- */
.top-hero-content {
    /* position: absolute; */ /* スライダーの上に重ねる */
    /* top: 0; */
    /* left: 0; */
    z-index: 5; /* スライダー(z-index:1)より前面に */
    width: 100% !important;
    /* max-width: 1100px; */
    height: 100%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* 下のスライダー操作（ドラッグ等）を邪魔しない */
    position: absolute; */ /* 画像の上に重ねる場合
    margin: 0 auto;
    /* top: 50%; */
    /* left: 50%; */
    /* transform: translate(-50%, -50%); */ /* これで真ん中になります */
}

/* コンテンツ内部はクリック可能にする */
.top-hero-content .container {
    pointer-events: auto;
}

/* --- タイポグラフィ --- */
.top-hero-label {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.2em;
    color: red; /* 建設業らしい緑、または既存の赤(#d32f2f) */
    margin-bottom: 15px;
}

.top-hero-title {
       font-size: clamp(14px, 5vw, 24px);
    line-height: 2;
    margin-bottom: 25px;
    font-weight: 400;
    text-align: center !important;
    color: #fff;
}

.top-hero-title__main,
.top-hero-title__sub {
    display: block;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); /* 視認性向上のため影を強化 */
    background: linear-gradient(#fff, #aaa 120%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    color: #fff;
}

.top-hero-title__main {
    font-size: 0.7em;
    font-weight: 500;
}

.top-hero-title__sub {
    font-size: 1em;
}

.top-hero-title__main span,
.top-hero-title__sub span {
  /* background: linear-gradient(#fff,#aaa  99%);
  -webkit-background-clip: text;
  background-clip: text; */
  color: transparent;
  color: #fff;
  display: inline-block;
  /* position: absolute; */
  /* right: 0; */
  /* bottom: 0px; */
  z-index: 11;
  /* -webkit-text-stroke: 0.5px rgba(0,0,0,0.05); */
}

/* Swiperページネーション（ドット）の位置調整 */
.top-hero .swiper-pagination {
    z-index: 3; /* コンテンツよりさらに前面 */
    bottom: 20px !important;
}

.top-hero .swiper-pagination-bullet-active {
    background: red !important; /* アクティブカラー */
}

/* --- 背景スライダーの設定 --- */
.top-hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.top-hero-slide {
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* ↓追加：フェード時に重なりを制御するために必須 */
    opacity: 0 !important;
    transition: opacity 2s ease;
}

/* ↓追加：アクティブなスライドだけを表示させる */
.top-hero-slide.swiper-slide-active {
    opacity: 1 !important;
}

.top-hero-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    /* 背景画像が確実に表示されるように */
    display: block;
}

.top-hero-image--02 {
    filter: grayscale(100%);
}

.top-news-flip {
  padding: 60px 20px;
}

.top-news-flip__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.top-news-flip__title {
  margin: 0;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.2;
}

.top-news-flip__archive {
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.top-news-flip__stage {
  position: relative;
  overflow: hidden;
  /* min-height: 96px; */
  /* border-top: 1px solid #d9d9d9; */
  /* border-bottom: 1px solid #d9d9d9; */
}

.top-news-flip__list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 45px;
  perspective: 1200px;
}

.top-news-flip__item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: center center;
  transform: rotateX(-90deg);
  transition: transform 3s cubic-bezier(.22, 1, .36, 1),
    opacity 0.8s ease,
    visibility 0s linear 1s;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.top-news-flip__item.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: rotateX(0deg);
  transition:
    transform 1s cubic-bezier(.22, 1, .36, 1),
    opacity 0.8s ease,
    visibility 0s linear 0s;
  z-index: 2;
}

.top-news-flip__item.is-leaving {
  opacity: 0;
  visibility: visible;
  transform: rotateX(90deg);
  z-index: 1;
}

.top-news-flip__link {
  display: flex;
  align-items: center;
  gap: 32px;
  width: 100%;
  padding: 15px 0;
  color: inherit;
  text-decoration: none;
}

.top-news-flip__date {
  flex: 0 0 0px;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.top-news-flip__text {
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.top-news-flip__empty {
  margin: 0;
  padding: 24px 0;
}

@media (max-width: 767px) {
  .top-news-flip__stage,
  .top-news-flip__list {
    /* min-height: 60px; */
  }

  .top-news-flip__link {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0;
  }

  .top-news-flip__date {
    flex: none;
  }

  .top-news-flip__text {
    font-size: 1rem;
    line-height: 1.6;
    display: block;
    margin: 0;
  }

  .top-hero-title__main {
    display:block;
}
}

@media (prefers-reduced-motion: reduce) {
  .top-news-flip__item {
    transition: opacity 0.3s ease;
    transform: none;
  }

  .top-news-flip__item.is-active {
    transform: none;
  }

  .top-news-flip__item.is-leaving {
    transform: none;
  }
}

/* --- スマホ対応（レスポンシブ） --- */
@media (max-width: 768px) {
    .top-hero {
        height: 60vh; /* スマホで見やすい高さに調整 */
        min-height: 450px;
    }
    
    .top-hero-content {
        /* background: rgba(0,0,0,0.4); */ /* 全体を薄暗くして文字を浮かせる */
        text-align: center;
        width: 90% !important;
        margin: 0 auto !important;
        position: absolute;
        left: 5%;
    }

    .top-hero-title {
        font-size: clamp(18px,3vw,20px);
        text-align: left !important;
    }
    
    .top-hero-title__main,
    .top-hero-title__sub {
        display: inline; /* スマホでは一行に収める場合はinline、改行するならblock */
    }
}