/* トップページ・ヘッダー・フッター・サイドバー共通スタイル */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

body::before {
    display: none; 
}

/* 全体レイアウト：横並び */
.layout-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 初回アクセス時：スライドアニメーション */
#intro-overlay {
    position: fixed;
    inset: 0;
    background: #2c3e50;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    will-change: transform, opacity;
    transition: opacity 0.4s ease;
    animation: zoomOut 1.3s ease-out 2s forwards;
}

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    text-align: center;
    opacity: 0;
    animation: fadeInUp 1.2s ease-out forwards;
    animation-delay: 0.3s;
}

.intro-content img {
    max-width: 600px;
    width: 80%;
    height: auto;
    margin: 0 auto 1rem;
}

.intro-text {
    font-size: 32px;
    font-style: italic;
    text-align: center;
    color: #f7921d;
}

#intro-overlay.hide {
  display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomOut {
    to {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* 遷移時のスライドオーバーレイ */
.overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: #2c3e50;
    z-index: 9999;
    transition: left 0.6s ease;
    pointer-events: none;
}

/* スライドイン（ページ遷移前） */
.overlay.active {
    left: 0;
    pointer-events: auto;
}

/* スライドアウト（ページ読み込み後） */
.overlay.slide-out {
    left: 100%;
}

/* フェードイン用 */
body {
    opacity: 0;
    transition: opacity 0.4s ease;
    background-color: #2c3e50;
}

/* ハンバーガーアイコン */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 10000;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
}

.menu-toggle .bar {
    display: block;
    width: 24px;
    height: 3px;
    margin: 3px 0;
    background-color: #fff;
    border-radius: 2px;
    transition: 0.3s ease-in-out;
}

/* アクティブ時に X に変形 */
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* 左：サイドバー */
.sidebar {
    position: relative;
    left: -240px;
    top: 0;
    width: 220px;
    height: 100vh;
    background-color: rgba(47, 62, 77, 0.8); 
    box-shadow: 2px 0 8px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease;
    z-index: 9999;
    overflow: visible;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    align-items: center; 
    padding-top: 1rem;   
    padding-bottom: 2rem; 
}

.sidebar.active {
    left: 0;
}

.sidebar nav ul li {
    position: relative;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
}

.sidebar nav li {
    margin: 3rem 0;

}

.sidebar nav a {
    text-align: center;         
    width: 100%;                 
    font-size: 1.2rem;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s;
}

.sidebar nav a:hover {
    background: #f7921d;
}

/* ロゴセクション */
.sidebar-brand {
    text-align: center;
    padding: 1.5rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand img {
    width: 200px; 
    height: auto;
    margin-bottom: 0.5rem;
}

.company-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: #fff;
    margin: 0;
}

/* サブメニューを初期状態で非表示 */
.sidebar nav ul li .submenu {
    display: block;
    position: absolute;
    top: -10px;
    left: 100%;
    background-color: rgba(47, 62, 77, 0.9);
    backdrop-filter: blur(4px);
    padding: 0;
    margin: 0;
    list-style: none;
    min-width: 200px;
    z-index: 999;
    border-left: 2px solid #086DE2;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

/* サブメニューのリンク */
.sidebar nav ul li .submenu li a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.sidebar nav ul li .submenu li a:hover {
    background-color: #f7921d;
}

/* ホバー時に表示 */
.sidebar nav ul li.has-submenu:hover > .submenu {
    opacity: 1;
    visibility: visible;
}

.sidebar .has-submenu .submenu {
  display: none;
}

.sidebar .has-submenu:hover .submenu {
  display: block;
}

/* サイドバーのliをrelativeにして絶対位置指定が効くようにする */
.sidebar nav ul li {
    position: relative;
}

/* ヘッダー */
.page-header {
    background-color: #f7921d;
    color: white;
    text-align: center;
    padding: 3rem 1rem;
    position: relative;
    border-radius: 8px;
}

.page-header h1 {
    position: relative;
    z-index: 1;
    font-size: 50px;
    font-weight: bold;
    margin: 0;
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* メインコンテンツ */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.05);
    margin-left: 220px;
    padding: 2rem;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
}

.main-content h1, 
.main-content h2, 
.main-content h3 {
    font-family: "Roboto";
    font-weight: 900; 
}

.main-content p, 
.main-content dt, 
.main-content dd {
    font-family: "Noto Sans JP";
    font-weight: 400;
}

main {
    padding: 2rem;
}

.hero-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    max-height: 900px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    background: none; 
    border-radius: 8px
}


/* 背景スライド用 */

.bg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 120vw;
    height: 100%;
    background-size: cover;
    background-position: top;
    background-repeat: no-repeat;
    opacity: 0;
    transform: translateX(0);
    z-index: 0;
    transition: opacity 1s ease, transform 10s linear;
}

.bg-slide.active {
    opacity: 1;
    z-index: 1;
    transform: translateX(-20%);
}


.hero-text {
    position: relative;
    z-index: 3;
    padding: 2rem;
    background: rgba(247, 146, 29, 0.4);
    border-radius: 8px;
    color: white;
    max-width: 600px;
    width: 90%;
    box-sizing: border-box;
}

.hero-text h1 {
    font-size: 32px;
}

/* ドットオーバーレイ */
.dot-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; 
    background-image: radial-gradient(rgba(0,0,0,0.5) 0.5px, transparent 1.1px); 
    background-size: 2.5px 2.5px; /* ドット間隔  */
    z-index: 2;  
}

/* フェードインアニメーションの初期状態 */
.fade-in {
    opacity: 0;
    transform: translateY(20px); 
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

/* 表示状態になったとき */
.fade-in.show {
    opacity: 1;
    transform: translateY(0);
}

/* コンテンツ */

.aboutus {
    display: flex;
    align-items: stretch;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin: 2rem auto;
}

.aboutus_text {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: white;
    border-radius: 8px;
}

.aboutus_text h3, 
.products_text h3,
.contact_text h3, 
.sns_text h3 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.aboutus_text p, 
.products_text p, 
.contact_text p, 
.sns_text p {
    line-height: 1.6;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.aboutus_image {
    flex: 1;
    background-image: url('../image/about_us.jpg');
    background-size: cover;
    background-position: right;
    background-repeat: no-repeat;
    max-height: 500px;
    border-radius: 0 8px 8px 0;
    overflow: hidden;
    position: relative;
}

.products{
    display: flex;
    align-items: stretch;
    background-color: #ffffff;
    border-radius: 8px;
    margin: 2rem auto;
    overflow: hidden;
}

.products_text {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: white;
    border-radius: 8px 0 0 8px;
    box-sizing: border-box;
}

.products_image {
    flex: 1;
    background-image: url('../image/FAPS_image.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    max-height: 500px;
    border-radius: 0 8px 8px 0;
}


.contact{
    display: flex;
    align-items: stretch;
    background-color: #f3f3f3;
    border-radius: 8px;
    margin: 2rem auto;
    overflow: hidden;
}

.contact_text {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: white;
    border-radius: 8px 0 0 8px;
    box-sizing: border-box;
}

.contact_image {
    flex: 1;
    background-image: url('../image/contact.png'); 
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
    max-height: 500px;
    border-radius: 8px;
}

.sns {
    display: flex;
    align-items: stretch;
    background-color: #f3f3f3;
    border-radius: 8px;
    margin: 2rem auto;
    overflow: hidden;
}

.sns_text {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: white;
    border-radius: 8px 0 0 8px;
    box-sizing: border-box; 
}

.sns_image {
    flex: 1;
    background-image: url('../image/sns_image.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    max-height: 500px;
    border-radius: 8px;
    min-height: 300px;
}

.sns_icon {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.sns_icon a img {
    width: 75px;
    height: 75px;
    transition: transform 0.3s, opacity 0.3s;
}

.sns_icon a:hover img {
    transform: scale(1.1);
    opacity: 0.8;
}

/* ホバー時のズーム動作 */

.aboutus_image,
.products_image,
.contact_image, 
.sns_image {
    position: relative;
    overflow: hidden;
    border-radius: 0 8px 8px 0; 
}

/* 疑似要素に背景画像を配置 */
.aboutus_image::before,
.products_image::before,
.contact_image::before, 
.sns_image::before {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.6s ease;
    z-index: 0;
    border-radius: inherit;
}

/* 個別背景 */
.aboutus_image::before {
    background-image: url('../image/about_us.jpg');
    background-position: right;
}

.products_image::before {
    background-image: url('../image/FAPS_image.png');
}

.contact_image::before {
    background-image: url('../image/contact.png');
    background-size: contain; 
}

.sns_image::before {
    background-image: url('../image/sns_image.png');
    background-size: contain;
}

/* オーバーレイ（暗くするレイヤー） */
.aboutus_image::after,
.products_image::after,
.contact_image::after, 
.sns_image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.6s ease;
    z-index: 1;
    border-radius: inherit;
}

/* ホバー時：背景ズーム＋暗く */
.aboutus:hover .aboutus_image::before,
.products:hover .products_image::before,
.contact:hover .contact_image::before, 
.sns:hover .sns_image::before {
    transform: scale(1.05);
}

.aboutus:hover .aboutus_image::after,
.products:hover .products_image::after,
.contact:hover .contact_image::after, 
.sns:hover .sns_image::after {
    background: rgba(0,0,0,0.2);
}

/* 共通ボタンスタイル */

.btn {
    position: relative;
    overflow: hidden;
    background-color: #f7921d;  
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0;
    text-align: center;
    cursor: pointer;
    transition: color 0.4s ease;
    display: block;
    margin-top: 1rem;
    width: auto;
    box-sizing: border-box;
}

/* ボタン内リンク */
.btn a {
    position: relative;
    color: #ffffff;
    font-weight: bold;
    text-decoration: none;
    z-index: 2;
    display: inline-block;
    width: 100%;
    height: 100%;
    padding: 0.5rem 1rem;
    box-sizing: border-box;
}

/* ホバー時のスライドエフェクト */
.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: #086DE2; 
    transition: left 0.4s ease;
    z-index: 1;
}

.btn:hover::before {
    left: 0;
}

.btn:hover a {
    color: white;
}

/* フッター */
footer {
    color: white;
    text-align: center;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

/* レスポンシブ対応 */
@media (min-width: 901px) {
    .layout-container {
        flex-direction: row;
    }

    .menu-toggle {
        display: none !important;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 220px;
        height: 100vh;
        background-color: rgba(47, 62, 77, 1); 
        box-shadow: 2px 0 8px rgba(0,0,0,0.3);
        z-index: 1050;
    }

    .sidebar nav ul li .submenu {
        position: absolute;
        top: -10px;
        left: 100%;
        background-color: rgba(47, 62, 77, 0.9);
        backdrop-filter: blur(4px);
        min-width: 200px;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    .sidebar nav ul li.has-submenu:hover > .submenu {
        opacity: 1;
        visibility: visible;
    }

    .main-area {
        margin-left: 220px;
        transition: none;
        overflow-x: hidden;
    }

    .main-content {
    margin-left: 220px;
    }

    .title-image {
        max-width: 100%;
    }

    footer {
        position: static;
    }
}

@media screen and (max-width: 900px) {
    body {
        font-size: 15px;
    }

    h1 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    p {
        font-size: 0.95rem;
    }

    .btn a {
        font-size: 0.95rem;
    }

    .layout-container {
        flex-direction: column;
    }

    .menu-toggle {
        display: block; 
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1100;
        background: gray;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
        border-radius: 4px;
    }

    .sidebar {
        position: fixed;     
        left: -240px;        
        top: 0;
        width: 220px;
        height: 100vh;
        background: rgba(52, 73, 94, 0.95);
        box-shadow: 2px 0 8px rgba(0,0,0,0.3);
        transition: left 0.3s ease-in-out;
        z-index: 1050;
        overflow-y: auto;  
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.active {
        left: 0;
    }

    /* サブメニューを常時表示（absolute無効化） */
    .sidebar nav ul li .submenu {
        position: static;            
        display: block !important;   
        opacity: 1 !important;
        visibility: visible !important;
        background: none;            
        border: none;
        padding-left: 1rem;         
        margin: 0.5rem 0;
    }

    .sidebar nav ul li .submenu li a {
        font-size: 0.95rem;
        padding: 0.4rem 1rem;
        color: #ddd;
        display: block;
    }

    .sidebar nav ul li .submenu li a:hover {
        background: #f7921d;
        color: #fff;
    }

    .main-area {
        margin-left: 0;
        padding: 1rem;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .hero-container {
        height: 60vh;
        aspect-ratio: auto;
        padding: 2rem 1rem;
    }

    .bg-slide{
        width: 100vw;
    }

    .hero-text h1 {
        font-size: 24px;
    }

    .content,
    .bg-slide,
    .bg-slide.active,
    .dot-overlay,
    .aboutus,
    .products,
    .contact, 
    .sns {
        padding: 1rem;
        margin: 1rem auto;
    }

    .aboutus, .products, .contact, .sns {
        flex-direction: column;
        background: #fff; 
        border-radius: 12px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
        max-width: 95%;   
        overflow: hidden; 
    }

    .aboutus_image,
    .products_image,
    .contact_image, 
    .sns_image {
        flex: none;
        height: 500px; 
        width: 100%;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        border-radius: 0; 
    }

    .aboutus_image {
        background-position: right;
    }

    .contact_image {
        background-size: contain; 
        background-color: #fafafa;
    }

    .sns_image {
        max-height: 250px;
        height: auto;
        background-size: contain;
        background-position: center center;
    }

    .sns_icon a img {
    width: 50px;
    height: 50px;
    }

    .aboutus_text,
    .products_text,
    .contact_text, 
    .sns_text {
        order: 2;
        padding: 1rem;
    }


    .btn {
        display: inline-block;  
        width: auto;            
        padding: 0.5rem 1rem;  
        font-size: 14px;        
        border-radius: 8px;
    }

    .intro-content img {
        max-width: 250px;
    }

    .intro-text {
        font-size: 20px;
    }

    .page-header {
        padding: 2rem 1rem;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    footer {
        position: static;
    }
}