/* ベースとタイポグラフィの改善 */
body {
    font-family: 'Yu Gothic', 'Meiryo', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    /* 固定ヘッダーの高さ分、コンテンツ全体を下にずらす */
    padding-top: 70px; 
}

/* 全体コンテナ - 余白を増やし、中央寄せ */
.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
    padding: 40px 0;
}

/* キーカラー */
:root {
    --primary-color: #004a99; /* 濃い青 */
    --accent-color: #d9534f; /* 赤 */
    --light-gray: #f9f9f9;
}

/* --- ヘッダー関連 --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    /* グレーで透明度80% */
    background-color: rgba(51, 51, 51, 0.8); 
    color: white;
    /* デスクトップ時のパディング */
    padding: 15px 5%; 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(5px);
    /* 修正: モバイルでナビゲーションが折り返せるように設定 */
    flex-wrap: wrap; 
}

header h1 {
    margin: 0;
    font-size: 1.6em;
    padding-left: 0;
    letter-spacing: 1px;
    /* 修正: 折り返し時に左に寄せる */
    flex-shrink: 0; 
}

nav {
    text-align: right;
    padding-right: 0;
    margin-top: 0;
    /* 修正: ロゴの隣に配置 */
    flex-grow: 1;
    text-align: right;
}

nav a {
    color: white;
    margin-left: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
    transition: color 0.3s;
    /* 修正: 折り返しを許可 */
    white-space: nowrap; 
}

nav a:hover {
    color: #ffcc00;
}
/* --- */


/* --- ヒーローセクション（トップ画像） --- */
.hero {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
    display: flex;
    /* 修正: 配置を垂直中央に戻す */
    align-items: center; 
    justify-content: center;
    text-align: center;
    color: white;
    margin-top: 0; 
    z-index: 10;
}

.hero img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    filter: brightness(0.7);
}

.hero-content {
    position: relative;
    z-index: 2;
    /* 修正: 上部のマージンを追加し、コンテンツを中央から下へずらす */
    margin-top: 120px; 
    padding: 20px; 
    max-width: 800px;
}

.hero-content p {
    font-size: 1.5em;
    font-weight: 300;
    margin-bottom: 10px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.hero-content h1 {
    font-size: 3em;
    margin: 0;
    letter-spacing: 2px;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.7);
}
/* --- */


/* --- 汎用セクションボタン --- */
.section-button-area {
    text-align: center;
    margin-top: 40px;
}

.button-link {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.button-link:hover {
    background-color: #c43f3b;
    transform: translateY(-2px);
}
/* --- */


/* セクションの見出し */
h2 {
    color: var(--primary-color);
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
    margin-top: 50px;
    margin-bottom: 30px;
    font-size: 2.2em;
    font-weight: 700;
    text-align: center;
}

h3 {
    color: var(--primary-color);
    margin-top: 20px;
    font-weight: 600;
}

/* --- Newsセクション --- */
.news {
    padding: 20px 0;
}

.news-list {
    margin-top: 20px;
}

.news-item {
    background-color: var(--light-gray);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: baseline;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.news-item .news-date {
    font-weight: bold;
    color: var(--primary-color);
    margin-right: 20px;
    flex-shrink: 0;
}

.news-item .news-title {
    margin: 0;
}
/* --- */


/* --- SERVICESセクション --- */
.services {
    padding-bottom: 40px; 
}

.service-items-grid { 
    /* 修正: グリッド全体の最大幅を制限して中央寄せにする */
    max-width: 960px; /* カード4枚の幅とギャップを考慮した値 */
    margin-left: auto;
    margin-right: auto;
    
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

/* サービスカード全体をリンクとして設定 */
.service-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card-link:hover .service-item {
    transform: translateY(-5px); 
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* サービスカードの基本設定 */
.service-item {
    position: relative; 
    background: white; 
    border: 1px solid #f0f0f0; 
    border-radius: 12px;
    padding: 0; 
    overflow: hidden; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    height: auto;
}

/* サービス画像コンテナ */
.service-image-container {
    width: 100%;
    height: 180px; /* 画像エリアの高さを固定 */
    overflow: hidden;
}

/* サービス画像 */
.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 1; 
}

.service-card-link:hover .service-image {
    transform: scale(1.03); 
}

/* サービスコンテンツ（カードの下部に配置） */
.service-content-overlay {
    position: static; 
    display: block;
    padding: 20px; 
    color: #333; 
    background: white; 
    text-align: left;
}

.service-content-overlay h3 {
    color: var(--accent-color); 
    margin: 0;
    font-size: 1.3em;
    text-shadow: none;
}

.service-content-overlay p {
    margin: 5px 0 0 0;
    font-size: 0.95em;
    font-weight: normal;
    text-shadow: none;
}

/* カード内のボタンの調整 */
.service-content-overlay .card-button {
    margin-top: 15px; 
    text-align: right;
}

.service-content-overlay .card-button .button-link {
    display: inline-block;
    padding: 8px 15px; 
    font-size: 0.9em;
    background-color: var(--primary-color); 
    color: white;
    border-radius: 4px;
    box-shadow: none;
    text-align: center;
    transition: background-color 0.3s;
}

.service-content-overlay .card-button .button-link:hover {
    background-color: #003366;
}
/* --- SERVICESセクション終了 --- */


/* --- ABOUT USセクション --- */
.about-us {
    padding-bottom: 40px;
}
.about-us table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.about-us th, .about-us td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.about-us th {
    background-color: var(--light-gray);
    width: 35%;
    font-weight: 500;
    color: var(--primary-color);
}
/* --- */


/* --- CONTACTセクション --- */
.contact {
    text-align: center;
    padding: 40px 0;
}

.contact a {
    /* 修正: ボタンの文字色(白)に合わせる */
    color: white; 
    text-decoration: none;
    font-weight: bold;
}

.contact a:hover {
    text-decoration: underline;
}

.contact-form-area {
    max-width: 500px;
    margin: 30px auto;
    padding: 30px;
    background: var(--light-gray);
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
    text-align: left;
}

.contact-form-area input[type="text"],
.contact-form-area input[type="email"],
.contact-form-area textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.3s;
}

.contact-form-area input[type="text"]:focus,
.contact-form-area input[type="email"]:focus,
.contact-form-area textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.contact-form-area textarea {
    resize: vertical;
}

.contact-form-area button[type="submit"] {
    background-color: var(--accent-color);
    color: white;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s;
    width: 100%;
}

.contact-form-area button[type="submit"]:hover {
    background-color: #c43f3b;
}

.contact-form-area p {
    margin: 0 0 15px 0;
}
/* --- */


/* フッター */
footer {
    background: #2c3e50;
    color: #ffffff;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9em;
}

/* --- レスポンシブ対応 --- */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    header {
        /* 修正: パディングを詰め、折り返しを許可 */
        padding: 10px 5px; 
        /* flex-direction: row; は flex-wrap: wrap; と併用 */
        align-items: flex-start; /* 縦に並んだときでもロゴを上部に寄せる */
    }
    
    body {
        /* ヘッダーの高さが折り返しで80pxを超える可能性を考慮し、微調整 */
        padding-top: 90px; 
    }

    header h1 {
        /* 修正: 文字サイズをさらに縮小 */
        font-size: 1.2em;
        width: 100%; /* ロゴが1行を占めるようにしてナビを下に押し込む */
        text-align: left;
    }

    nav {
        margin-top: 5px; /* ロゴとの隙間 */
        width: 100%; /* ナビが1行を占めるようにする */
        text-align: left;
    }

    nav a {
        /* 修正: マージンとフォントサイズを詰めて、見切れを防ぐ */
        margin-right: 8px; /* 右側のマージンに変更して左寄せで整列 */
        margin-left: 0;
        font-size: 0.75em;
    }

    .hero {
        height: 50vh;
    }
    
    /* モバイルでのhero-contentの位置調整（デスクトップよりマージンを減らす） */
    .hero-content {
        margin-top: 50px; 
    }
    
    /* サービスカードグリッドはモバイルでは最大幅の制限を解除し、幅いっぱいに広げる */
    .service-items-grid {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        /* モバイルでは1列表示 */
        grid-template-columns: 1fr;
    }
    
    .hero-content p {
        font-size: 1.2em;
    }

    .hero-content h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.8em;
    }

    .about-us th, .about-us td {
        display: block; 
        width: 100%;
    }

    .about-us th {
        background-color: transparent;
        border-bottom: none;
        padding-bottom: 0;
        font-weight: bold;
        color: #333;
    }

    .news-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-item .news-date {
        margin-bottom: 5px;
    }
}