/* ===== BASE.CSS - 体系的なレスポンシブデザインの基盤 ===== */

/* ===== 1. リセットとベーススタイル ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* カラーシステム - より体系的に */
    --primary-color: #FFFFFF;
    --secondary-color: #E8EDE7;
    --text-color: #000000;
    --text-color-light: #555555;
    --accent-color: #000000;
    --muted-color: rgba(0, 0, 0, 0.34);
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    /* アクセシビリティ対応色 */
    --focus-color: #4D90FE;
    --error-color: #D32F2F;
    --success-color: #388E3C;
    --warning-color: #F57C00;
    --info-color: #0288D1;
    
    /* サイズ・余白の変数 */
    --header-height: 84px;
    --section-padding-y: clamp(30px, 5vw, 60px);
    --container-width: 1400px;
    --card-border-radius: clamp(20px, 3vw, 30px);
    
    /* フォントサイズ - レスポンシブ対応 */
    --h1-size: clamp(22px, 4vw, 30px);
    --h2-size: clamp(20px, 3.5vw, 28px);
    --h3-size: clamp(18px, 3vw, 22px);
    --body-size: clamp(13px, 1vw, 14px);
    --small-size: clamp(12px, 0.9vw, 13px);
    
    /* フォントウェイト */
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;
    
    /* 間隔 */
    --spacing-xs: clamp(4px, 0.5vw, 5px);
    --spacing-sm: clamp(8px, 1vw, 10px);
    --spacing-md: clamp(16px, 2vw, 20px);
    --spacing-lg: clamp(30px, 4vw, 40px);
    --spacing-xl: clamp(40px, 6vw, 60px);
    
    /* アニメーション */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* ブレイクポイント */
    --breakpoint-sm: 480px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Alike Angular', 'Noto Sans JP', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    width: 100%;
    margin: 0 auto;
    position: relative;
    padding: 0;
    font-size: var(--body-size);
    font-weight: var(--font-weight-regular);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, svg, video {
    display: block;
    max-width: 100%;
    height: auto;
}

/* フォーカス状態のスタイル - アクセシビリティ向上 */
:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
}

/* ===== 2. レイアウトコンテナ ===== */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    box-sizing: border-box;
}

.section {
    padding: var(--section-padding-y) 0;
    width: 100%;
}

/* ===== 3. タイポグラフィ ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-regular);
    line-height: 1.3;
    margin-top: 0;
}

h1 {
    font-size: var(--h1-size);
    margin-bottom: var(--spacing-md);
}

h2 {
    font-size: var(--h2-size);
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: var(--h3-size);
    margin-bottom: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-md);
}

.text-center {
    text-align: center;
}

.text-justify-ja {
    text-align: justify;
    text-align-last: justify;
    text-justify: inter-character;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.section-subtitle {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    font-size: var(--body-size);
    color: var(--text-color-light);
}

/* ===== 4. グリッドシステム - モダン化 ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    padding: 0 15px;
    flex: 1;
}

/* Flexboxベースのグリッド */
.col-1 { flex: 0 0 8.333%; max-width: 8.333%; }
.col-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-5 { flex: 0 0 41.666%; max-width: 41.666%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.col-11 { flex: 0 0 91.666%; max-width: 91.666%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* CSSグリッドレイアウト - 追加 */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* ===== 5. 共通コンポーネント ===== */

/* ボタン */
.btn {
    display: inline-block;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--text-color);
    font-size: var(--body-size);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    color: var(--text-color);
    text-align: center;
}

.btn:hover {
    background-color: var(--text-color);
    color: white;
}

.btn:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
}

.btn-center {
    display: block;
    margin: 0 auto;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    opacity: 0.9;
}

/* カード */
.card {
    background: white;
    border-radius: var(--card-border-radius);
    padding: var(--spacing-lg);
    box-shadow: 0 5px 10px var(--shadow-color);
    transition: transform var(--transition-normal);
}

.card:hover {
    transform: translateY(-5px);
}

/* フォーム要素 */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
}

.form-control {
    width: 100%;
    height: 45px;
    border: 1px solid var(--text-color);
    padding: 8px 10px;
    font-family: 'Alike Angular', 'Noto Sans JP', sans-serif;
    font-size: var(--body-size);
    transition: border-color var(--transition-fast);
}

.form-control:focus {
    border-color: var(--focus-color);
    outline: none;
}

textarea.form-control {
    height: auto;
    min-height: 150px;
    resize: vertical;
}

/* フォームバリデーション */
.form-control.is-invalid {
    border-color: var(--error-color);
}

.invalid-feedback {
    color: var(--error-color);
    font-size: var(--small-size);
    margin-top: var(--spacing-xs);
}

/* ===== 6. ヘッダー ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--primary-color);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px var(--shadow-color);
    box-sizing: border-box;
    transition: all var(--transition-normal);
}

.header-spacer {
    height: calc(var(--header-height) + 20px);
    width: 100%;
}

.logo {
    font-weight: var(--font-weight-regular);
    font-size: 25px;
    line-height: 1.2;
    margin-left: 20px;
}

.logo a {
    text-decoration: none;
    color: var(--text-color);
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0 15px;
    display: flex;
    align-items: center;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.3;
    font-weight: var(--font-weight-regular);
    padding: 10px 0;
    transition: color var(--transition-fast);
    position: relative;
}

nav ul li a:hover {
    color: var(--text-color-light);
}

/* アンダーラインエフェクト追加 */
nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width var(--transition-normal);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

.language-selector {
    display: inline-block;
    padding: 6px 15px;
    background-color: #F5F5F5;
    color: var(--muted-color);
    font-weight: var(--font-weight-regular);
    border-radius: 4px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1010;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-color);
    border-radius: 3px;
    transition: all var(--transition-fast);
}

/* ===== 7. ヒーローセクション ===== */
.hero {
    position: relative;
    margin: 0 auto;
    margin-top: 60px;
    padding: 2rem;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 85vh;
    width: 100%;
    max-width: var(--container-width);
}

.hero-content {
    position: relative;
    padding: 2rem;
    z-index: 1;
    width: 100%;
    text-align: center;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: var(--h1-size);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}
        
.hero-description {
    font-size: var(--body-size);
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}
        
.hero-image {
    width: 80%; 
    max-width: 1200px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

.hero .contact-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: var(--body-size);
    border: 1px solid var(--text-color);
    border-radius: 5px;
    text-decoration: none;
    color: var(--text-color);
    background: transparent;
    transition: all var(--transition-normal);
}

.hero .contact-button:hover {
    background: var(--text-color);
    color: var(--primary-color);
}

/* ===== 8. サービスセクション ===== */
.services-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    max-width: var(--container-width);
    margin: 60px auto 0;
    padding: 0 20px;
}

.service-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    width: 100%;
    max-width: 350px;
    height: auto;
    min-height: 300px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    text-align: left;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-icon {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.service-icon img {
    width: 35px;
    height: 35px;
}

.service-card h3 {
    font-size: 22px;
    font-weight: var(--font-weight-regular);
    line-height: 1.3;
    margin-bottom: 20px;
}

.service-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* ===== 9. ポートフォリオセクション ===== */
.portfolio {
    min-height: auto;
    text-align: center;
    background-color: var(--secondary-color);
    padding: var(--section-padding-y) 0;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.portfolio h2 {
    font-size: var(--h2-size);
    font-weight: var(--font-weight-regular);
    line-height: 1.3;
    margin-bottom: 40px;
}

.portfolio-slider {
    position: relative;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 50px;
}

/* 3つのアイテムを同時表示するポートフォリオコンテナ */
.portfolio-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 0 auto;
    position: relative;
    flex-wrap: nowrap;
    overflow: hidden;
}

/* 個別のスライドスタイル - 3つ並べて表示 */
.portfolio-slide {
    flex: 0 0 30%;
    margin: 0 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform var(--transition-normal);
    height: 350px;
}

.portfolio-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 矢印ボタンのスタイル */
.slider-arrow {
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 2;
    transition: transform var(--transition-normal);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-arrow {
    left: 0;
}

.next-arrow {
    right: 0;
}

.slider-arrow:hover {
    transform: translateY(-50%) scale(1.1);
}

.slider-arrow img {
    width: 30px;
    height: 30px;
}

/* スライダーのドットナビゲーション */
.slider-dots {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #D8D8D8;
    margin: 0 6px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.dot.active {
    background-color: var(--text-color);
}

/* ===== 10. フッター ===== */
footer {
    background-color: var(--secondary-color);
    padding: 60px 0;
    text-align: center;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    box-sizing: border-box;
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.footer-services, .footer-menu {
    display: flex;
    justify-content: center;
    gap: 64px;
}

.footer-services {
    margin-bottom: 28px;
}

.footer-services a, .footer-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 15px;
    line-height: 24px;
    transition: color var(--transition-fast);
}

.footer-services a:hover, .footer-menu a:hover {
    color: var(--text-color-light);
}

.social-links {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-icon img {
    width: 21px;
    height: 21px;
}

.social-links a {
    color: var(--text-color);
    transition: color var(--transition-fast);
}

.social-links a:hover {
    color: var(--text-color-light);
}

.copyright {
    font-size: 14px;
    line-height: 21px;
    text-align: center;
}

/* ===== 11. ユーティリティクラス ===== */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }

.py-1 { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-2 { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-3 { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }
.py-4 { padding-top: var(--spacing-xl); padding-bottom: var(--spacing-xl); }

.px-1 { padding-left: var(--spacing-sm); padding-right: var(--spacing-sm); }
.px-2 { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
.px-3 { padding-left: var(--spacing-lg); padding-right: var(--spacing-lg); }

.d-none { display: none; }
.d-block { display: block; }

/* 表示・非表示ユーティリティ */
.hide-on-mobile { display: block; }
.show-on-mobile { display: none; }

/* カスタムスクロールバー */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-color);
}

::-webkit-scrollbar-thumb {
    background: var(--muted-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-color-light);
}

/* アニメーション */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* ===== 12. レスポンシブデザイン ===== */
/* デスクトップ: 1200px以下、992px超 */
@media (min-width: 993px) and (max-width: 1200px) {
    .hero {
        padding: 1rem;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero-image {
        width: 90%;
    }
}

/* タブレット: 992px以下 */
@media (max-width: 992px) {
    .logo {
        font-size: 22px;
    }
    
    nav ul li {
        margin: 0 10px;
    }
    
    nav ul li a {
        font-size: 14px;
    }

    .hero-content {
        width: 50%;
    }
    
    .hero-image {
        width: 95%;
    }

    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }

    /* ポートフォリオスライダーのタブレット対応 */
    .portfolio-slide {
        height: 300px;
    }

    .services-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .service-card {
        flex: 0 0 calc(50% - 20px);
        margin-bottom: 30px;
        max-width: calc(50% - 20px);
    }
    
    /* グリッドレイアウトの調整 */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* タブレット～スマートフォン: 768px以下 */
@media (max-width: 768px) {
    header {
        padding: 15px;
    }

    .header-spacer {
        height: calc(var(--header-height) + 15px);
    }
    
    .menu-toggle {
        display: flex;
    }
    
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--primary-color);
        height: 0;
        overflow: hidden;
        transition: height var(--transition-normal);
        box-shadow: 0 5px 5px var(--shadow-color);
    }
    
    nav.active {
        height: auto;
    }
    
    nav ul {
        flex-direction: column;
        padding: 20px 0;
        width: 100%;
        align-items: center;
        margin: 0;
    }
    
    nav ul li {
        margin: 10px 0;
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    nav ul li a {
        display: inline-block;
        width: auto;
        padding: 10px 0;
        text-align: center;
    }
    
    /* 言語切り替えボタンの位置調整 */
    nav ul li .language-selector {
        margin: 0 auto;
        display: inline-block;
    }
    
    .hero {
        padding: 3rem 1rem;
        min-height: auto;
        margin-top: 60px;
    }
    
    .hero-content {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-image {
        width: 100%;
    }
    
    .hero .contact-button {
        margin: 0 auto;
    }
    
    .hero-description br {
        display: none;
    }
    
    /* サービスカード */
    .services-container {
        flex-direction: column;
        align-items: center;
    }
    
    .service-card {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 30px;
    }
    
    .contact-form {
        width: 90%;
        margin: 0 auto;
    }
    
    .footer-services, .footer-menu {
        flex-direction: column;
        gap: 15px;
    }
    
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }

    /* ポートフォリオスライダー */
    .portfolio-container {
        flex-wrap: wrap;
    }
    
    .portfolio-slide {
        flex: 0 0 100%;
        height: 350px;
    }
    
    .portfolio-slide:not(:first-child) {
        display: none;
    }
    
    /* グリッドレイアウトの調整 */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* 表示・非表示切り替え */
    .hide-on-mobile { display: none; }
    .show-on-mobile { display: block; }

    @media (max-width: 480px) {
    .hero-description {
        font-size: calc(var(--body-size) - 1px);
        line-height: 1.6;
        text-align: left;
    }

    @media (max-width: 480px) {
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero-content {
        .hero {
        padding: 2rem 1rem;
    }
    
    .hero-content {
        padding: 0;
    }
}