/*
Theme Name: Ride & Link Theme
Author: Gemini
Description: RIDE & LINK株式会社 コーポレートサイトテーマ
Version: 1.0.1
*/

:root {
    --primary-color: #DC143C; /* Crimson */
    --primary-dark: #b01030;
    --text-main: #333333;
    --text-sub: #666666;
    --bg-light: #f8f8f8;
    --font-base: 'Inter', 'Noto Sans JP', sans-serif;
    --max-width: 1200px;
}

/* -----------------------------------------------------------------
 * リセット & 基本設定
 * ----------------------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-base);
    line-height: 1.8;
    color: var(--text-main);
    overflow-x: hidden;
    width: 100%; /* スマホでの横揺れ防止 */
}

a { text-decoration: none; color: inherit; transition: all 0.3s; }
img { max-width: 100%; height: auto; }
ul { list-style: none; }

/* -----------------------------------------------------------------
 * 共通レイアウト & コンポーネント
 * ----------------------------------------------------------------- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px; /* SPでの余白確保 */
    width: 100%; /* コンテナ幅を画面幅に合わせる */
}

section {
    padding: 60px 40px;
    position: relative;
}

/* セクションタイトル */
.section-title {
    font-size: 36px;
    margin-bottom: 50px;
    color: var(--text-main);
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    border-radius: 2px;
}

/* 共通ボタン */
.btn {
    display: inline-block;
    padding: 18px 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(220,20,60,0.3);
    transition: all 0.3s;
    max-width: 100%; /* スマホではみ出し防止 */
}
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(220,20,60,0.4);
    color: white;
}
.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}
.btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

/* ロゴエリア全体のレイアウト調整 */
.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ① リングロゴの回転アニメーション設定 */
.logo-icon-svg {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-area:hover .logo-icon-svg {
    transform: rotate(360deg);
}

/* ② 社名ロゴのサイズ調整 */
.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-name-svg {
    height: 28px; /* 既存のh1(24px)に合わせたサイズ調整 */
    width: auto;
    display: block;
}

/* スマホ表示の調整 */
@media (max-width: 768px) {
    .header-content {
        padding: 10px 15px;
    }
    .logo-icon-svg {
        width: 40px;
        height: 40px;
    }
    .logo-name-svg {
        height: 20px;
    }
}

/* ローダー内のロゴが黒くて見えない場合の対策（必要に応じて） */
.loader-logo img {
    /* もし背景が赤でロゴが黒い場合、ロゴを白く反転させます */
    filter: brightness(0) invert(1);
}

/* ページヘッダー (下層ページ用) */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 100px 40px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-header h1 { font-size: 48px; margin-bottom: 20px; position: relative; z-index: 1; }
.page-header p { font-size: 20px; opacity: 0.95; position: relative; z-index: 1; }

/* -----------------------------------------------------------------
 * アニメーション定義
 * ----------------------------------------------------------------- */
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

.slide-in-left { opacity: 0; transform: translateX(-50px); transition: opacity 0.8s ease, transform 0.8s ease; }
.slide-in-left.visible { opacity: 1; transform: translateX(0); }

.slide-in-right { opacity: 0; transform: translateX(50px); transition: opacity 0.8s ease, transform 0.8s ease; }
.slide-in-right.visible { opacity: 1; transform: translateX(0); }

.scale-in { opacity: 0; transform: scale(0.95); transition: opacity 0.6s ease, transform 0.6s ease; }
.scale-in.visible { opacity: 1; transform: scale(1); }

/* -----------------------------------------------------------------
 * ヘッダー (Header)
 * ----------------------------------------------------------------- */
header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    width: 100%;
}
header.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,0.15); }

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area { display: flex; align-items: center; gap: 20px; max-width: 80%; /* ロゴがはみ出さないように */ }
.logo-area svg { flex-shrink: 0; /* ロゴアイコンが潰れないように */ }
.logo-area:hover svg { transform: rotate(360deg); transition: transform 0.6s ease; }

nav ul { display: flex; gap: 40px; }
nav a { font-weight: 500; font-size: 16px; position: relative; padding: 5px 0; }
nav a::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--primary-color); transition: width 0.3s ease;
}
nav a:hover { color: var(--primary-color); }
nav a:hover::after { width: 100%; }

/* ハンバーガーメニュー */
.menu-toggle { display: none; flex-direction: column; cursor: pointer; padding: 5px; }
.menu-toggle span {
    width: 25px; height: 3px; background: var(--text-main); margin: 3px 0;
    transition: all 0.3s ease; border-radius: 3px;
}
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(8px, 8px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

/* -----------------------------------------------------------------
 * フッター (Footer)
 * ----------------------------------------------------------------- */
footer {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    color: white;
    padding: 80px 40px 30px;
}
.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    margin-bottom: 50px;
}
.footer-section h4 { margin-bottom: 25px; font-size: 20px; color: var(--primary-color); }
.footer-section li { margin-bottom: 12px; }
.footer-section a { color: #ccc; }
.footer-section a:hover { color: white; transform: translateX(5px); display: inline-block; }
.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid #444;
    color: #999;
}

/* トップへ戻るボタン */
.scroll-to-top {
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 999;
}
.scroll-to-top.visible { opacity: 1; visibility: visible; }

/* -----------------------------------------------------------------
 * ローディング画面 (Loading Screen)
 * ----------------------------------------------------------------- */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

/* 隠すためのクラス（!importantで強制） */
.page-loader.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.loader-content {
    text-align: center;
    color: white;
    width: 100%;
    padding: 0 20px; /* スマホではみ出し防止 */
}

.loader-logo {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 30px;
    letter-spacing: 2px;
    animation: fadeInUp 0.8s ease-out forwards;
}

.loader-bar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    width: 100%;
}

.loader-bar {
    width: 260px;
    max-width: 80%; /* スマホではみ出し防止 */
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.loader-progress {
    height: 100%;
    background: white;
    width: 0%;
    animation: loading 2s ease-in-out forwards;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.loader-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.loader-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loader-dot:nth-child(1) { animation-delay: 0s; }
.loader-dot:nth-child(2) { animation-delay: 0.2s; }
.loader-dot:nth-child(3) { animation-delay: 0.4s; }

/* キーフレーム定義 */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes dotPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* -----------------------------------------------------------------
 * レスポンシブ (SP) - 修正版
 * ----------------------------------------------------------------- */
@media (max-width: 768px) {
    /* メニュー */
    .menu-toggle { display: flex; }
    nav ul {
        position: fixed; top: 80px; left: -100%; width: 100%;
        flex-direction: column; background: white; padding: 40px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1); transition: left 0.3s ease; gap: 20px;
    }
    nav ul.active { left: 0; }

    /* レイアウト調整 */
    .footer-content { 
        grid-template-columns: 1fr; /* フッターを1列に */
        gap: 40px;
    }
    
    /* ヘッダー調整 */
    .header-content { padding: 15px 20px; }
    .logo-area svg { width: 40px; height: 40px; } /* ロゴサイズ縮小 */
    .logo-area h1 { font-size: 18px !important; } /* 社名サイズ縮小 */
    .logo-area p { font-size: 10px !important; }

    /* セクション余白調整 */
    section { padding: 60px 20px; }
    .page-header h1 { font-size: 32px; }
    .section-title { font-size: 28px; }
    
    /* テーブルのスクロール対応（はみ出し防止） */
    table { display: block; width: 100%; overflow-x: auto; }
}

    .recruit-content p {
        margin-bottom: 40px; /* テキストの下に40pxの余白を作ってボタンを押し下げる */
    }

/* スマホ表示での調整 */
    @media (max-width: 768px) {
        .recruit-content p {
            margin-bottom: 30px; /* スマホでは少し余白を狭くする */
        }
}
