/*
Theme Name: はるの山の村 テーマ
Theme URI: https://harunoyama.org/
Author: Gemini
Description: 3カテゴリバナー・ドロップダウン・2カラムニュース統合版（Flexバグ修正 & 実務最適化済）
Version: 1.9
License: GNU General Public License v2 or later
Text Domain: harunoyama
*/

@charset "UTF-8";

/* --- 1. 基本設定 --- */
body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    background-color: #fff;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
}
* { box-sizing: border-box; }

.container {
    max-width: 1050px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- 2. ヘッダー --- */
header {
    border-top: 5px solid #4b6113;
    border-bottom: 1px solid #eee;
    background: #fff;
}
.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}
.logo a {
    text-decoration: none;
    color: #4b6113;
    font-size: 24px;
    font-weight: bold;
}
.header-btns a {
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    margin-left: 10px;
    display: inline-block;
}
.btn-contact { background: #f4f4f2; color: #333; }
.btn-access { background: #4b6113; color: #fff; }

/* --- 3. グローバルナビ（ドロップダウン） --- */
.global-nav {
    background: #fff;
    border-bottom: 1px solid #eee;
}
.global-nav ul {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
}
.global-nav li {
    flex: 1;
    border-right: 1px solid #eee;
    text-align: center;
    position: relative;
}
.global-nav a {
    display: block;
    padding: 15px 0;
    text-decoration: none;
    color: #4b6113;
    font-weight: bold;
}
.global-nav li:hover > a { background: #f9faf5; }

.global-nav ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 220px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    flex-direction: column;
}
.global-nav ul ul li {
    border: none;
    border-bottom: 1px solid #eee;
    text-align: left;
}
.global-nav li.open > ul {
    display: flex;
}

/* --- 4. 施設バナーセクション (3カテゴリ対応) --- */
.category-title {
    font-size: 20px;
    color: #4b6113;
    border-left: 5px solid #4b6113;
    padding-left: 15px;
    margin: 50px 0 20px;
    font-weight: bold;
    clear: both;
}

.facility-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}
.facility-item {
    display: flex;
    align-items: center;
    border: 1px solid #dcdcdc;
    text-decoration: none;
    padding: 8px;
    background: #fff;
    color: #4b6113;
    transition: all 0.3s;
}
.facility-item:hover {
    background: #f9faf5;
    border-color: #4b6113;
}

.fac-img {
    flex: 0 0 90px;
    aspect-ratio: 3 / 2;
    background: #7a8a4d;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fac-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.no-photo {
    color: #fff;
    font-size: 10px;
    font-weight: bold;
}

.fac-body {
    padding-left: 12px;
    flex: 1;
    min-width: 0;
}
.fac-main {
    margin: 0;
    font-weight: bold;
    font-size: 14px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fac-sub {
    margin: 2px 0 0;
    font-size: 10px;
    color: #888;
}
.fac-arrow {
    width: 18px; height: 18px;
    background: #5b6d2a;
    border-radius: 50%;
    position: relative;
    margin-left: 5px;
    flex: 0 0 18px;
}
.fac-arrow::after {
    content: "";
    position: absolute;
    top: 50%; left: 40%;
    width: 5px; height: 5px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* --- 5. INFORMATION (実務最適化版) --- */
.site-title-area-info {
    border-left: 5px solid #c00;
    padding-left: 15px;
    margin: 70px 0 30px;
}
.info-title {
    font-size: 28px;
    color: #c00;
    margin: 0;
    font-weight: bold;
}

.news-list-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 30px;
    margin-bottom: 50px;
}

.news-card {
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 15px;
    min-width: 0; /* グリッドセル内で縮む */
    width: 100%;
    box-sizing: border-box;
}

.news-thumb {
    flex: 0 0 100px;
    width: 100px;
    height: 67px; /* 3:2 アスペクト比 */
    margin-right: 12px;
    overflow: hidden;
    background: #eee;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-photo-news {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #aaa;
    background: #ddd;
}

.news-body {
    flex: 1 1 0%;
    min-width: 0; /* Flexはみ出し防止の必須設定 */
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
}

.news-body * {
    max-width: 100%;
}

.news-date {
    font-size: 11px;
    color: #999;
    display: block;
}

.news-title {
    font-size: 14px;
    color: #0033cc;
    margin: 4px 0;
    font-weight: bold;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.news-excerpt {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* --- 6. フッター --- */
footer {
    background: #4b6113;
    color: #fff;
    padding: 40px 0;
    text-align: center;
    margin-top: 60px;
}

/* --- 7. レスポンシブ --- */
@media (max-width: 900px) {
    .facility-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .news-list-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .facility-grid { grid-template-columns: 1fr; }
    .header-main { flex-direction: column; text-align: center; }
    .header-btns { margin-top: 15px; }
}
/* 画像の暴走防止 */
.news-body img {
    max-width: 100%;
    height: auto;
    display: block;
}