/* ==========================================================================
   1. 基本設定 (Reset & Base)
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    background: #f4f4f4; 
    color: #333; 
    font-family: 'Noto Sans JP', sans-serif; 
    line-height: 1.7; 
    -webkit-font-smoothing: antialiased; 
}
a { text-decoration: none; transition: 0.2s ease-in-out; }
ul { list-style: none; }

/* ==========================================================================
   2. ナビゲーション (Header & Menu)
   ========================================================================== */
.navbar {
    width: 100%;
    height: 90px;
    background: #fff;
    border-bottom: 3px solid #c00;
    position: sticky;
    top: 0;
    z-index: 2000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1140px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

/* ロゴ修正：スマホではみ出さない設定 */
.logo { max-width: 250px; width: 100%; }
.logo img { display: block; max-width: 100%; height: auto; max-height: 50px; width: auto; }

/* ハンバーガーボタン */
.menu-toggle { display: none; cursor: pointer; flex-direction: column; gap: 6px; z-index: 2100; }
.bar { width: 30px; height: 3px; background-color: #333; transition: 0.3s; }

/* メニューリスト */
.nav-list { display: flex; height: 90px; }
.nav-list li { position: relative; height: 100%; display: flex; align-items: center; }
.nav-list li > a {
    color: #333;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
}

/* PC用ドロップダウン制御 */
.dropdown {
    position: absolute;
    top: 90px;
    left: 0;
    width: 220px;
    background: #fff;
    border-top: 2px solid #c00;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    display: none;
    padding: 10px 0;
}
.dropdown li { height: auto; display: block; }
.dropdown li a {
    display: block;
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #333 !important;
    border-bottom: 1px solid #eee;
    height: auto !important;
    background: none !important;
}
.dropdown li:last-child a { border-bottom: none; }
.dropdown li a:hover { background: #fff4f4 !important; color: #c00 !important; padding-left: 25px; }

/* PCホバーアクション */
@media (min-width: 993px) {
    .has-child:hover .dropdown { display: block; }
    .nav-list li:hover > a { background: #f9f9f9; color: #c00; }
}

.btn-nav {
    background: #c00 !important;
    color: #fff !important;
    padding: 10px 25px !important;
    border-radius: 4px;
    height: auto !important;
    font-weight: 700;
    margin-left: 10px;
}
.btn-nav:hover { background: #a00 !important; opacity: 0.9; }

/* ==========================================================================
   3. ヒーローエリア & スライダー (Hero & Slider)
   ========================================================================== */
.top-hero {
    width: 100%;
    height: 250px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #ddd;
}
.hero-inner { text-align: center; }
.hero-text { font-size: 3rem; font-weight: 900; color: #333; letter-spacing: 0.05em; margin-bottom: 5px; }
.hero-inner p { color: #888; font-size: 1rem; font-weight: 500; }

/* スライダー比率：1:5 (横長に変更) */
.news-slider {
    max-width: 1140px;
    aspect-ratio: 5 / 1;
    margin: 30px auto -10px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ddd;
    background: #fff;
    height: auto; /* aspect-ratio優先のため */
}
.news-slider .swiper-slide a { display: block; width: 100%; height: 100%; }
.news-slider img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.news-slider .swiper-slide a:hover img { transform: scale(1.03); }

/* ==========================================================================
   4. セクション共通 & タブ (Section & Tabs)
   ========================================================================== */
.wrapper { width: 100%; padding-bottom: 60px; }
.section {
    max-width: 1140px;
    margin: 40px auto;
    padding: 50px 40px;
    background: #fff;
    border: 1px solid #ddd;
}
.section-header { border-bottom: 2px solid #333; margin-bottom: 30px; padding-bottom: 10px; }
.section-header h2 { font-size: 1.4rem; font-weight: 900; display: flex; align-items: center; }
.section-header h2::before { content: ""; width: 15px; height: 15px; background: #c00; margin-right: 12px; }

.tab-group { display: flex; gap: 5px; margin-bottom: 25px; flex-wrap: wrap; }
.tab-btn {
    padding: 12px 25px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    cursor: pointer;
    font-weight: 700;
    color: #666;
    font-size: 0.9rem;
}
.tab-btn.active { background: #333; color: #fff; border-color: #333; }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* ==========================================================================
   5. ニュースリスト装飾 (Common News Item)
   ========================================================================== */
.news-item { border-bottom: 1px dotted #ccc; }
.news-item:last-child { border-bottom: none; }
.news-item a { display: flex; align-items: center; padding: 10px 10px; gap: 20px; color: #333; }
.news-item:hover { background: #fff9f9; }

.news-date { font-weight: 700; color: #333; min-width: 110px; font-size: 0.75rem; }
.news-tag {
    background: #c00;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    width: 65px;
    padding: 1px 0;
    text-align: center;
    border-radius: 2px;
    margin-right: 5px; /* 右に8pxの隙間をあける */
    display: inline-block; /* 余白を確実に効かせるため追加 */
}

.news-title { flex: 1; font-size: 1rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   6. List.php 固有スタイル (Search, Tags, Pagination)
   ========================================================================== */
.list-controls { margin-bottom: 40px; background: #f9f9f9; padding: 25px; border-radius: 4px; border: 1px solid #eee; }

/* 検索ボックス */
.search-box { position: relative; max-width: 500px; margin-bottom: 25px; }
.search-box input {
    width: 100%;
    padding: 12px 15px;
    padding-right: 50px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}
.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 3px;
    cursor: pointer;
}

/* タブ・タグボタン一覧 */
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tag-label { font-weight: 700; font-size: 0.9rem; margin-right: 10px;color: #666; }
.tag-link {
    display: inline-block;
    padding: 6px 18px;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}
.tag-link:hover, .tag-link.active { background: #c00; color: #fff; border-color: #c00; }

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 50px;
}
.pagination a, .pagination span {
    display: inline-block;
    width: 45px;
    height: 45px;
    line-height: 45px;
    text-align: center;
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    font-weight: 700;
    border-radius: 4px;
}
.pagination .current { background: #c00; color: #fff; border-color: #c00; }
.pagination a:hover { background: #333; color: #fff; border-color: #333; }

/* ==========================================================================
   7. ポータルグリッド & お問い合わせフォーム (Grid & Forms)
   ========================================================================== */
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.portal-card { 
    position: relative;
    padding: 40px 20px; 
    border: 1px solid #ddd; 
    background: #fff; 
    text-align: center; 
    transition: 0.3s;
    overflow: hidden;
}
/* 左側アクセントライン */
.portal-card::before {
    content: ""; position: absolute; top: 0; left: 0; width: 5px; height: 100%;
    background: #c00; opacity: 0; transition: 0.3s;
}
.portal-card:hover { border-color: #c00; box-shadow: 0 8px 20px rgba(0,0,0,0.1); transform: translateY(-5px); }
.portal-card:hover::before { opacity: 1; }

.card-icon { font-size: 2.5rem; margin-bottom: 20px; display: block; }
.portal-card h3 { font-size: 1.2rem; font-weight: 900; margin-bottom: 10px; }
.portal-card p { font-size: 0.85rem; color: #666; line-height: 1.6; }
.highlight { background: #fffcfc; border-color: #ffcccc; }

/* お問い合わせフォーム用スタイル追加 */
.form-item { margin-bottom: 25px; text-align: left; }
.form-item label { display: block; font-weight: 700; margin-bottom: 8px; }
.form-item input, .form-item select, .form-item textarea {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem;
}
.submit-btn {
    background: #333; color: #fff; padding: 18px 60px; border: none; 
    border-radius: 4px; cursor: pointer; font-weight: 700; width: 100%; transition: 0.3s;
}
.submit-btn:hover { background: #c00; }

.center-link { margin-top: 30px; text-align: right; }
.view-all-btn { color: #c00; font-weight: 700; font-size: 0.95rem; }
.view-all-btn::after { content: " ＞"; }

.footer { padding: 60px 0; background: #333; color: #fff; text-align: center; font-size: 0.9rem; }
.no-data { padding: 40px; text-align: center; color: #999; font-weight: 700; }

/* ==========================================================================
   8. スマホ対応 (Responsive Upgrade)
   ========================================================================== */
@media (max-width: 992px) {
    .nav-container { padding: 0 20px; }
    .menu-toggle { display: flex; }
   

    /* スライダー：スマホでも1:5を絶対維持し、余白を入れない設定 */
    .news-slider {
        aspect-ratio: 5 / 1 !important; /* 5/2になっていたのを5/1に強制 */
        margin: 20px auto; /* 左右中央寄せ */
        width: calc(100% - 20px); /* 画面端に少し余白を作る場合 */
    }

    .news-slider img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* 枠いっぱいに収める */
        object-position: center; /* 中央を基準にする */
    }

    /* モバイルメニュー展開 */
    .nav-links {
        position: fixed;
        top: 90px;
        right: -100%;
        width: 85%;
        height: calc(100vh - 90px);
        background: #fff;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        z-index: 1999;
        overflow-y: auto;
        padding-bottom: 50px;
    }
    .nav-links.active { right: 0; }

    .nav-list { flex-direction: column; height: auto; padding: 10px 0; }
    .nav-list li { width: 100%; height: auto; flex-direction: column; align-items: flex-start; }
    .nav-list li > a { 
        width: 100%; 
        padding: 18px 25px; 
        font-size: 1.1rem; 
        border-bottom: 1px solid #eee;
        height: auto;
    }

    /* モバイルドロップダウン：階層を見せる */
    .dropdown {
        position: static;
        display: block;
        width: 100%;
        box-shadow: none;
        border: none;
        background: #fcfcfc;
        padding: 0;
    }
    .dropdown li a { padding-left: 45px !important; border-bottom: 1px solid #eee; background: none !important; }

    .nav-btn-wrapper { padding: 25px; width: 100%; }
    .btn-nav { width: 100%; text-align: center; margin-left: 0; padding: 15px !important; font-size: 1.1rem; }

    /* ハンバーガーアニメーション */
    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    /* 各種コンテンツ調整 */
    .logo { max-width: 180px; } /* ロゴサイズ調整 */
    .top-hero { height: 180px; }
    .hero-text { font-size: 2.2rem; }
    .news-slider { aspect-ratio: 5 / 2; margin: 20px 10px; } /* スマホ用比率調整 */
    .section { padding: 30px 20px; margin: 20px 10px; }
    .news-item a { flex-direction: column; align-items: flex-start; gap: 3px; padding: 5px 10px; }
    .news-date { min-width: auto; }
    .news-title { white-space: normal; width: 100%; }
    
    .list-controls { padding: 15px; }
    .tab-btn { flex: 1; padding: 10px; font-size: 0.8rem; text-align: center; }
    
    /* お問い合わせフォーム全体のコンテナ */
    #contact-wrapper {
        padding: 15px !important;
        margin-top: 10px !important;
    }

    /* フォーム本体の枠 */
    #contact-wrapper form, 
    #contact-wrapper div[style*="text-align: center"] {
        padding: 20px !important; /* 内側の余白をスマホ用に調整 */
        box-shadow: none !important;
        border: 1px solid #eee !important;
    }

    /* LINE・メール選択ボタンのサイズ調整 */
    #contact-wrapper a[style*="display: block"] {
        padding: 15px !important; /* 高さを少し抑える */
        font-size: 16px !important; /* 文字サイズをスマホに最適化 */
        margin-bottom: 15px !important;
    }

    /* 入力欄とテキストエリア */
    #contact-wrapper input,
    #contact-wrapper textarea {
        font-size: 16px !important; /* iPhoneでフォーカス時にズームされないサイズ */
        padding: 10px !important;
    }

    /* 送信ボタン */
    #contact-wrapper button[type="submit"] {
        padding: 15px !important;
        font-size: 16px !important;
    }

    /* 連携中の表示 */
    div[style*="background:#eaffea"] {
        font-size: 14px !important;
        padding: 10px !important;
    }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
