/* タイトルまわりの余白と重なり順を調整 */
.page-header {
    position: relative;
    z-index: 1;
    padding: clamp(2rem, 6vw, 3.8rem) clamp(1.5rem, 6vw, 3.8rem) 0;
}

/* メインタイトルの大きさや光の演出 */
.page-title {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.1;
    color: #f7f9ff;
    text-shadow: 0 20px 38px rgba(6, 12, 34, 0.55);
}

/* タイトルの各行をブロック化して改行を制御 */
.page-title__line {
    display: block;
}

/* 2行目以降にだけ縦の余白を入れる */
.page-title__line + .page-title__line {
    margin-top: 0.25em;
}

/* タイトル下の説明文の色と読みやすさを整える */
.page-subtitle {
    margin: 0;
    color: rgba(232, 239, 255, 0.88);
    font-size: clamp(1.05rem, 2.6vw, 1.4rem);
    line-height: 1.6;
    max-width: 48ch;
}

/* ヒーロー画像の枠や影を設定し、比率を固定 */
.page-hero {
    margin: 0 auto;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    min-height: clamp(220px, 32vw, 420px);
    aspect-ratio: 21 / 9;
    /* 横21:縦9の比率を固定し、ヒーロー画像がつぶれないようにする */
    max-width: min(1300px, 100%);
    /* 1300pxを上限としつつ画面いっぱいにも広がれるようにする */
    box-shadow: 0 32px 64px rgba(37, 99, 235, 0.22);
}

/* 画像を枠いっぱいに表示しつつ比率を保つ */
.page-hero__slides {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

/* トップ画像 */
.page-hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transform: scale(1.02);
    animation: pageHeroSlideshow 25s ease-in-out infinite;
    animation-fill-mode: both;
}

/* トップ画像のスライドショー */
.page-hero__image:first-child {
    opacity: 1;
}

.page-hero__image:nth-child(2) {
    animation-delay: 5s;
}

.page-hero__image:nth-child(3) {
    animation-delay: 10s;
}

.page-hero__image:nth-child(4) {
    animation-delay: 15s;
}

.page-hero__image:nth-child(5) {
    animation-delay: 20s;
}

@media (prefers-reduced-motion: reduce) {
    .page-hero__image {
        animation: none;
        opacity: 0;
    }

    .page-hero__image:first-child {
        opacity: 1;
    }

    .page-hero__image:nth-child(n+2) {
        display: none;
    }
}

/* 画像上にグラデーションフィルターを重ねてコントラスト調整 */
.page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(7, 18, 54, 0.15) 0%, rgba(7, 18, 54, 0.55) 55%, rgba(5, 12, 40, 0.78) 100%);
}

/* ヒーロー画像上にテキストを重ねるためのレイアウト */
.page-hero__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: clamp(0.6rem, 2vw, 1.1rem);
    padding: clamp(2.2rem, 6vw, 3.4rem);
    color: #f7f9ff;
    z-index: 1;
}

/* オーバーレイ内の各要素の横幅を制限して読みやすく */
.page-hero__overlay > * {
    margin: 0;
    max-width: min(48ch, 70%);
}

/* メインコンテンツ全体の幅と余白を管理 */
.page-main {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
}

.page-footer {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 4vw, 3rem) clamp(1.75rem, 4vw, 2.5rem);
}

.page-footer__note {
    margin: 0;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(127, 146, 177, 0.18);
    color: rgba(15, 29, 64, 0.82);
    font-size: 0.82rem;
    line-height: 1.7;
    text-align: right;
}

/* 検索バー周辺のカードのようなコンテナを作成 */
.page-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 1.2rem clamp(1rem, 3vw, 1.6rem);
    margin-bottom: clamp(1.5rem, 4vw, 2.6rem);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.2));
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    /* 背景をぼかしてガラスのような質感をつくる（Safari向け） */
    box-shadow: 0 20px 36px rgba(37, 99, 235, 0.1);
    transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.4s ease, opacity 0.6s ease;
    will-change: transform, opacity, box-shadow;
    /* これから動かすプロパティを宣言し描画の最適化を促す */
}

/* JSでアニメーション表示するため初期状態は非表示寄り */
.js-enabled .page-controls {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
}

/* 条件を満たしたら通常の位置と透明度に戻す */
.js-enabled .page-controls--visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* ホバーやフォーカス時は少し浮かせて反応を伝える */
.page-controls:hover,
.page-controls:focus-within {
    transform: translate3d(0, 0, 0) scale(1.01);
    box-shadow: 0 26px 48px rgba(37, 99, 235, 0.16);
}

/* フィルターラベルの文字スタイル */
.search-label {
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* 入力欄の見た目とフォーカス時のアニメーション */
.search-input {
    width: 100%;
    padding: 0.95rem 1.15rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(240, 244, 255, 0.75);
    font-size: 1rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* アクティブな入力欄を青く光らせる */
.search-input:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

/* 検索結果の件数など補足テキストを配置 */
.search-status {
    grid-column: 2 / -1;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* スマホ幅では検索周りのレイアウトを縦並びに調整 */
@media (max-width: 600px) {
    /* 1列に積み重ねるのでギャップと余白を調整 */
    .page-controls {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: clamp(1rem, 5vw, 1.4rem);
    }

    /* 小さな画面では文字間隔を少し詰める */
    .search-label {
        letter-spacing: 0.08em;
    }

    .page-footer__note {
        text-align: left;
    }
}

/* タブレット以下ではヒーローや余白を調整 */
@media (max-width: 720px) {
    /* 小さな画面でも見出しが詰まりすぎないよう調整 */
    .page-header {
        padding: clamp(1.5rem, 7vw, 2.4rem) clamp(1rem, 6vw, 2rem) 0;
    }

    /* ヒーロー画像を低めにして視認性を確保 */
    .page-hero {
        min-height: clamp(110px, 50vw, 200px);
        border-radius: 14px;
    }

    /* オーバーレイの余白とギャップを縮小 */
    .page-hero__overlay {
        padding: clamp(2.2rem, 12vw, 3.6rem) clamp(1.4rem, 7vw, 2.6rem) clamp(1.4rem, 8vw, 2.2rem);
        gap: clamp(0.9rem, 4vw, 1.35rem);
    }

    /* オーバーレイ内の余白とギャップを最調整 */
    .page-hero__overlay > * {
        max-width: 100%;
    }

    /* 文字サイズと字間を再調整して奥行きを確保 */
    .page-title {
        font-size: clamp(1.45rem, 6vw, 2.2rem);
        letter-spacing: 0.025em;
        line-height: 1.16;
        text-shadow: 0 12px 28px rgba(5, 12, 32, 0.42);
    }

    .page-title__line:first-child {
        font-size: clamp(1.08rem, 5vw, 1.5rem);
        letter-spacing: 0.1em;
    }

    .page-title__line:nth-child(2) {
        font-size: clamp(1.7rem, 8vw, 2.35rem);
    }

    /* 行間も少しだけ小さくする */
    .page-title__line + .page-title__line {
        margin-top: 0.26em;
    }

    /* サブタイトルの文字サイズも控えめに */
    .page-subtitle {
        font-size: clamp(0.96rem, 3.2vw, 1.12rem);
        line-height: 1.78;
        max-width: 32ch;
        letter-spacing: 0.02em;
    }
}

/* 青系の光をゆっくり循環させる動き */
@keyframes pageHeroSlideshow {
    0% { opacity: 0; }
    4% { opacity: 1; }
    20% { opacity: 1; }
    24% { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes gridAuroraA {
    0% { transform: translate3d(-6%, -10%, 0) scale(0.9) rotate(0deg); }
    50% { transform: translate3d(6%, -2%, 0) scale(1.08) rotate(160deg); }
    100% { transform: translate3d(-6%, -10%, 0) scale(0.9) rotate(360deg); }
}

/* 別色の光も逆方向に回転させて動きをつける */
@keyframes gridAuroraB {
    0% { transform: translate3d(10%, -16%, 0) scale(0.9) rotate(0deg); }
    50% { transform: translate3d(-7%, 6%, 0) scale(1.05) rotate(190deg); }
    100% { transform: translate3d(10%, -16%, 0) scale(0.9) rotate(360deg); }
}

@media (max-width: 480px) {
    .page-hero__overlay {
        padding: clamp(2.8rem, 18vw, 4.2rem) clamp(1.1rem, 7vw, 2.2rem) clamp(1.2rem, 10vw, 1.8rem);
        gap: clamp(0.85rem, 5vw, 1.4rem);
    }

    .page-title {
        font-size: clamp(1.3rem, 7vw, 1.9rem);
        line-height: 1.18;
        letter-spacing: 0.02em;
    }

    .page-title__line:first-child {
        font-size: clamp(0.95rem, 5.5vw, 1.3rem);
        letter-spacing: 0.11em;
    }

    .page-title__line:nth-child(2) {
        font-size: clamp(1.5rem, 9vw, 2.05rem);
    }

    .page-title__line + .page-title__line {
        margin-top: 0.28em;
    }

    .page-subtitle {
        font-size: clamp(0.92rem, 3.8vw, 1.05rem);
        line-height: 1.74;
        max-width: 30ch;
        letter-spacing: 0.018em;
    }
}

/* 日付セルは「日付 + New !!」を1行に保つ（折り返すと New と !! が分かれて不格好）。
   PC・スマホ共通。日付だけのセルは元々折り返さないので影響なし。 */
.news-table tr > td:first-child {
    white-space: nowrap;
}

/* 新着情報テーブル: スマホ幅では日付と記事を横並びにすると記事側が窮屈なので、
   日付の下に記事を回り込ませて縦積みにする（PC幅は従来どおり2カラム）。 */
@media only screen and (max-width: 768px) {
    .news-table,
    .news-table tbody,
    .news-table tr,
    .news-table td {
        display: block;
        width: 100%;
    }

    /* 日付セル: 直下の記事との間隔を詰めて、1件のまとまり感を出す */
    .news-table tr > td:first-child {
        padding-left: 0;
        padding-bottom: 2px;
    }

    /* 記事セル: 全幅で表示。pb-4 の下余白が次の記事との区切りになる */
    .news-table tr > td:last-child {
        padding-left: 0;
    }
}

/* =================================================================
   ファーストビュー（リニューアル版ヒーロー）
   ※ もとは index.html の <head> 内 <style> に直書きされていた指定を移設。
   ================================================================= */
#slider.lp-renewal-hero {
    height: 100vh;
    min-height: 100vh;
}

#slider.lp-renewal-hero .titleWord {
    width: 96%;
    margin: 0;
    font-size: clamp(2rem, 4.4vw, 4.5rem);
}

#slider.lp-renewal-hero .titleWord > div {
    white-space: nowrap;
}

/* スマホ専用の改行は、PC幅では無効化して1行に保つ */
#slider.lp-renewal-hero .hero-sp-br {
    display: none;
}

@media only screen and (max-width: 768px) {
    #slider.lp-renewal-hero {
        height: 100vh;
        min-height: 100vh;
    }

    #slider.lp-renewal-hero .titleWord {
        font-size: clamp(1.35rem, 6vw, 2.4rem);
    }

    /* スマホ幅では1行に収まらず右が見切れるため、折り返して全文を表示する */
    #slider.lp-renewal-hero .titleWord > div {
        white-space: normal;
        overflow-wrap: break-word;
    }

    /* スマホ幅では「万博出展企業との」の後で意図的に改行する */
    #slider.lp-renewal-hero .hero-sp-br {
        display: inline;
    }
}

/* 印刷時に非表示にする要素（もと index.html の <style media="print">） */
@media print {
    .no-print {
        display: none;
    }
}
