@charset "utf-8";

/* ==================================
   基本設定
================================== */
body {
    font-family: "Noto Serif JP", serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    margin: 0;
    /* 背景にグラデーションアニメーションを設定 */
    background: linear-gradient(45deg, #dce9ad,#eff9fe,#a2daf7,#7fc8b8);
    background-size: 200% 200%;
    animation: GradientBackground 15s ease infinite;
}

/* 背景グラデーションのアニメーション */
@keyframes GradientBackground {
    0% { background-position: 0% 100%; }
    50% { background-position: 100% 0%; }
    100% { background-position: 0% 100%; }
}

/* ==================================
   ローディング画面
================================== */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #54bbff, #ffffff, #fff6c6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 1s; /* 1秒かけてフェードアウト */
}

#loading img {
    width: 150px;
    animation: blink 2s infinite ease-in-out; /* ロゴの点滅アニメーション */
}

/* ロゴの点滅アニメーション */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 読み込み完了後にローディング画面を非表示にする */
#loading.loaded {
    opacity: 0;
    pointer-events: none; /* クリックイベントを無効化 */
}


/* ==================================
   ヘッダー
================================== */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 30px;
    height: 80px;
}

.head-img img {
    max-width: 250px;
    min-width: 150px;
    height: auto;
}

/* --- Navigation Styles --- */
.head-nav ul {
    position: relative;
    /* Base for the sliding element */
    display: flex;
    align-items: center;
    /* Vertically align items */
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Sliding ellipse background */
.head-nav ul::before {
    content: '';
    position: absolute;
    top: 50%;
    /* Position and size are set by JavaScript via CSS variables */
    left: var(--slider-left, 0);
    width: var(--slider-width, 0);
    height: var(--slider-height, 0);
    background-color: rgba(135, 167, 204, 0.4);
    border-radius: 9999px;
    /* To make it an ellipse */
    transform: translateY(-50%);
    transition: left 0.3s ease-out, width 0.3s ease-out;
    z-index: 0;
}

.head-nav li {
    position: relative;
    /* To ensure text is above the background */
    z-index: 1;
}

.head-nav a {
    display: block;
    padding: 10px 20px;
    /* Adjust padding for ellipse size */
    color: #154360;
    font-size: 16px;
    text-decoration: none;
    transition: color 0.3s;
    white-space: nowrap;
    /* Prevent text wrapping */
}

/* Text color for current and hovered items (excluding contact link) */
.head-nav li.current a,
.head-nav ul:hover li:not(.contact-link):hover a {
    color: rgb(50, 50, 63);
    ;
}

/* --- Contact Link Styles --- */
.head-nav li.contact-link a {
    background-color: rgb(255, 136, 0);
    /* Teal color for emphasis */
    color: #fff;
    border: 2px;
    border-radius: 5px;
    margin-left: 15px;
    /* Add some space */
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.head-nav li.contact-link a:hover {
    background-color: rgb(223, 130, 23);
    /* Darker teal on hover */
    transform: translateY(-2px);
    /* Slight lift effect */
    color: #fff;
    /* Ensure color stays white on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* --- ハンバーガーメニュー --- */
.nav-button {
    display: none;
    /* PCでは非表示 */
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.nav-button-bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    margin: 8px 0;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-wrapper {
    display: block;
}

/* ==================================
   ファーストビュー (スライドショー)
================================== */
.hero {
    position: relative;
    height: 100svh; /* ビューポートの高さに合わせる */
    overflow: hidden;
}

.hero .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: slideshow 20s infinite;
    transform: scale(1.1); /* 少し拡大した状態から開始 */
    /* 画像下部をグラデーションで透過させる */
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%); /* Safari対応 */
}

/* スライド画像の設定 */
.hero .slide:nth-child(1) {
    background-image: url("img/top_image1.jpg");
    animation-delay: 0s;
}

.hero .slide:nth-child(2) {
    background-image: url("img/top_image2.jpg");
    animation-delay: 10s; /* 10秒遅れて開始 */
}

/* スライドショーのキーフレームアニメーション */
@keyframes slideshow {
    0% {
        opacity: 0;
        transform: scale(1.1);
    }
    15% {
        opacity: 1; /* フェードイン */
    }
    50% {
        opacity: 1;
        transform: scale(1); /* ズームアウト */
    }
    70% {
        opacity: 0; /* フェードアウト */
        transform: scale(1);
    }
    100% {
        opacity: 0;
    }
}

.hero .container {
    position: relative;
    z-index: 2; /* スライドより手前に表示 */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
}

/* ▼▼▼ 既存のh1スタイルを削除し、新しいタイトルスタイルに変更 ▼▼▼ */
.hero .hero-title {
    color: #154360;
    text-shadow:8px 8px 5px rgba(205, 217, 250, 0.8);
    /* すりガラス効果 */
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(3px);
    border-radius: 3px;
    padding: 10px 20px;
    width: fit-content;
    margin-left: 15vw;
}

.hero-title .line {
    display: flex;
    align-items: center; /* 上下のセンタリング */
    margin-bottom: 0.8em;
}

/* 最後のlineにはマージン不要 */
.hero-title .line:last-of-type {
    margin-bottom: 0;
}

.hero-title .large-char {
    font-size: 6rem; /* 「人」の文字サイズ */
    font-weight: 600;
    margin-right: 0.2em;
    line-height: 1; /* 行の高さを調整 */
}

.hero-title .small-text {
    display: flex;
    flex-direction: column;
    font-size: 2rem;
    line-height: 1.5;
    font-weight: 500;
}

.hero-title .bottom-line {
    font-size: 2.2rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-top: 0.8em;
    padding-bottom: 10px;
}
/* ▲▲▲ 新しいタイトルスタイル ▲▲▲ */


/* ==================================
   メインコンテンツ
================================== */

/* 各コンテンツセクションの共通スタイル */
.con1, .con2, .con3, .con4 {
    width: 70%;
    margin: 40px auto;
    background-color: rgba(255, 255, 255, 1);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-align: center;
    padding: 20px 0;
}

.con1 h2, .con2 h2, .con3 h2, .con4 h2 {
    font-size: 28px;
    padding-bottom: 20px;
    margin: 10px 0 10px;
}

/* --- h2の共通スタイル --- */
/* h2の左右に線を追加 */
.con1 h2, .con2 h2, .con3 h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: #555;
    font-weight: 600;
}

.con1 h2::before,
.con1 h2::after,
.con2 h2::before,
.con2 h2::after,
.con3 h2::before,
.con3 h2::after {
    content: '';
    display: block;
    width: 200px;
    height: 1px;
    background-color: #154360;
}

.business-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px 20px; /* 縦横の隙間 */
    padding: 30px 0;
    text-align: center;
}

.business-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

.business-item:hover .business-name {
    color: #41B6E6; /* ホバー時のテキストの色 */
    font-weight: 800; /* ホバー時にテキストを太字にする */
}

/* ▼▼▼ アイコンのスタイルを画像用に変更 ▼▼▼ */
.business-icon {
    position: relative; /* 子要素の絶対配置の基準 */
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
    transition: transform 0.3s ease; /* スムーズな拡大のためのtransitionを追加 */
}

/* ホバー時にアイコンを拡大するスタイルを追加 */
.business-item:hover .business-icon {
    transform: scale(1.3);
}


.business-icon img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* 画像の比率を維持 */
    transition: opacity 0.3s ease-in-out;
}

.business-icon .icon-hover {
    opacity: 0;
}

.business-item:hover .business-icon .icon-default {
    opacity: 0;
}

.business-item:hover .business-icon .icon-hover {
    opacity: 1;
}
/* ▲▲▲ アイコンのスタイルを画像用に変更 ▲▲▲ */

.business-name {
    font-size: 1rem;
    font-weight: 500;
    color: #555;
    margin: 0;
    transition: color 0.3s ease, font-weight 0.3s ease; /* font-weightの変化もアニメーション対象に */
}


.con1,.con2,.con3,.con4 {
    width: 80%;
    max-width: 1000px;
    height: fit-content;
}

/* --- 会社案内 (con2), 採用情報 (con3), お問い合わせ(con4) --- */
.con2 .con-object,
.con3 .con-object,
.con4 .con-object {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.con2 .con-text,
.con3 .con-text,
.con4 .con-text {
    flex: 1;
    padding: 0 15px;
}

/* PC表示ではテキストの自動折り返しを無効化 */
.con2 p,
.con3 p {
    text-align: left;
    line-height: 1.8;
    white-space: wrap;
}

/* お問い合わせ欄のテキストは常に折り返しを許可 */
.con4 p {
    text-align: left;
    line-height: 1.8;
    white-space: normal;
}

.con4 .con-text {
    margin-bottom: 20px;
}

.con2 .con-img,
.con3 .con-img {
    flex: 1;
}

.con2 .con-img img,
.con3 .con-img img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 画像の比率を維持 */
    border-radius: 5px;
}

/* con2セクションのレイアウト比率を調整 (テキスト3:画像2) */
.con2 .con-text { flex: 5; }
.con2 .con-img { flex: 4; }

/* con3セクションのレイアウト比率を調整 (テキスト3:画像2) */
.con3 .con-text { flex: 5; }
.con3 .con-img { flex: 4; }

/* con4セクションの固有スタイル */
.con4 .con-text h3 {
    text-align: left;
    margin-bottom: 20px;
}

.con4 ul {
    flex: 1;
    list-style-type: disc;
    padding-left: 35px;
}

.con4 ul li {
    text-align: left;
    line-height: 1.8;
}

.contact-arrow {
    margin: 0 20px;
}


/* ==================================
   汎用コンポーネント
================================== */
.read-button {
    display: inline-block;
    background-color: #154360;
    color: #fff;
    padding: 10px 30px;
    margin: 40px 0 20px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 1em;
    outline: 0.5px solid #10354d;
    outline-offset: 0px;
    transition: outline-offset 0.3s, outline-color 0.3s;
}

.read-button:hover {
    animation: light .8s infinite;
}

/* ボタンホバー時のアウトラインアニメーション */
@keyframes light {
    100% {
        outline-color: transparent;
        outline-offset: 10px;
    }
}

/* ==================================
   フッター
================================== */
footer {
    color: #666666;
    background: #fff;
    padding: 40px 0;
}

footer .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 30px;
}

.footA {
    margin-bottom: 30px;
}

.foot-img img {
    width: 250px;
    height: auto;
}

.footB p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.footC h3 {
    margin: 0 0 10px;
    border-bottom: solid 1px currentColor;
    font-size: 14px;
}

.footC ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footC a {
    display: block;
    padding: 5px;
    color: inherit;
    font-size: 12px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.footC a:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.copyright {
    font-size: 12px;
    text-align: center;
}


/* ==================================
   レスポンシブ設定
================================== */

/* 画面幅が1200px以下でテキストの折り返しを許可 */
@media (max-width: 1200px) {
    .con2 p,
    .con3 p {
        white-space: normal;
    }
}


/* PC・タブレット向け (768px以上) */
@media (min-width: 768px) {
        .nav-button {
        display: none;
    }
    /* --- フッターレイアウト --- */
    .footer-main {
        display: flex;
        align-items: stretch;
    }
    .footB {
        flex: 1;
        display: flex;
        align-items: center;
    }
    .footC {
        flex: 2;
        display: flex;
    }
    .footC > div {
        flex: 1;
    }
    .footC > div:not(:first-child) {
        margin-left: 40px;
    }
    .copyright {
        margin-top: 30px;
    }
}

/* タブレット向け中間サイズ (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {

    .head-img img,
    .foot-img img {
        width: 250px;
    }

    .head-nav a {
        padding: 15px 10px;
        font-size: 15px;
    }
}

/* スマホ・タブレット向け (767px以下) */
@media (max-width: 767px) {
    /* Header */
    header .container {
        height: 70px;
        padding: 0 15px;
    }

    .nav-button {
        display: block;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 101;
    }

    .nav-button-bar {
        display: block;
        width: 100%;
        height: 3px;
        background-color: #333;
        margin: 8px 0;
        transition: transform 0.3s, opacity 0.3s;
    }

    body.nav-open .nav-button-bar:nth-child(1) {
        transform: translateY(11px) rotate(45deg);
    }

    body.nav-open .nav-button-bar:nth-child(2) {
        opacity: 0;
    }

    body.nav-open .nav-button-bar:nth-child(3) {
        transform: translateY(-11px) rotate(-45deg);
    }

    .nav-wrapper {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.98);
        z-index: 100;
        padding-top: 80px;
    }

    body.nav-open .nav-wrapper {
        display: block;
    }

    .head-nav {
        width: 100%;
        text-align: center;
    }

    .head-nav ul {
        flex-direction: column;
        align-items: center;
    }

    .head-nav li {
        margin-bottom: 10px;
    }

    .head-nav a {
        padding: 20px;
        font-size: 18px;
        color: #154360 !important;
        /* Reset color */
    }

    .head-nav ul::before {
        display: none;
        /* Hide slider on mobile */
    }

    .head-nav li.contact-link a {
        margin-left: 0;
        padding: 10px 30px;
    }


    /* nav-openクラスがbodyに付与された時のスタイル */
    .nav-open .nav-wrapper {
        display: block;
    }

    /* ハンバーガーアイコンのアニメーション */
    .nav-open .nav-button-bar:nth-child(1) {
        transform: translateY(11px) rotate(45deg);
    }

    .nav-open .nav-button-bar:nth-child(2) {
        opacity: 0;
    }

    .nav-open .nav-open .nav-button-bar:nth-child(3) {
        transform: translateY(-11px) rotate(-45deg);
    }


    /* --- ファーストビュー --- */
    /* ▼▼▼ スマホ表示用にタイトルスタイルを変更 ▼▼▼ */
    .hero .hero-title {
        margin: 0 10vw;
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* 中央揃えから左揃えに変更 */
        text-align: left; /* 中央揃えから左揃えに変更 */
    }

    .hero-title .line {
        justify-content: flex-start; /* 中央揃えから左揃えに変更 */
        margin-bottom: 0.5em;
    }

    .hero-title .large-char {
        font-size: 4rem;
        margin-right: 0.3em;
    }

    .hero-title .small-text {
        font-size: 1.2rem;
        text-align: left;
    }

    .hero-title .bottom-line {
        font-size: 1.3rem;
        margin-top: 1em;
    }
    /* ▲▲▲ スマホ表示用にタイトルスタイルを変更 ▲▲▲ */


    /* --- コンテンツ --- */
    .con1, .con2, .con3, .con4 { width: 90%; }

    /* 事業内容(con1)の新しいレスポンシブスタイル */
    .con1 h2, .con2 h2, .con3 h2 {
        font-size: 1.5rem;
    }

    .con1 h2::before,
    .con1 h2::after,
    .con2 h2::before,
    .con2 h2::after,
    .con3 h2::before,
    .con3 h2::after {
        width: 20%;
    }

    .business-grid {
        grid-template-columns: repeat(2, 1fr); /* スマホでは2列に */
        gap: 30px 15px;
        padding: 2rem 0;
    }

    .business-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }

    .business-name {
        font-size: 0.9rem;
    }

    .con2 .con-object,
    .con3 .con-object,
    .con4 .con-object {
        flex-direction: column;
    }
    
    .con2 h2,
    .con3 h2,
    .con4 h2 {
    padding-bottom: 20px;
    }

    .con2 .con-img img,
    .con3 .con-img img {
        height: auto;
        max-width: 100%;
    }

    .con2 .con-text,
    .con3 .con-text {
    padding-bottom: 30px;
}

    .contact-arrow { display: none; } /* 矢印を非表示 */

    /* --- フッター --- */
    footer .container, .footC {
        flex-direction: column;
        text-align: center;
    }
    .footB { margin-bottom: 30px; }
    .footC > div { margin-bottom: 20px; }
    .footC > div:not(:first-child) { margin-left: 0; }
}

/* 特に幅の狭いスマホ向け (375px以下) */
@media (max-width: 375px) {
    .head-nav a {
        padding: 15px;
        font-size: 16px;
    }
    .head-img img,
    .foot-img img {
        width: 150px;
    }
}

/* ==================================
   トップに戻るボタン
================================== */
#to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #154360;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    text-decoration: none;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    /* 最初は非表示 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

#to-top-btn.show {
    /* 表示時のスタイル */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#to-top-btn:hover {
    background-color: #21618C; /* ホバー時の色 */
}
