/* 京都大学風デザイン - 福岡県がん・生殖医療ネットワーク */

/* ========== 基本設定 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', 'メイリオ', 'Meiryo', sans-serif;
    line-height: 1.8;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* アンカーリンクの固定ヘッダー対策 */
section[id],
div[id] {
    scroll-margin-top: 180px;
}

/* ========== ヘッダー ========== */
header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 4px solid transparent;
    border-image: linear-gradient(90deg, #4a90a4 0%, #28a745 50%, #ffc107 100%) 1;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
}

.header-top {
    background: linear-gradient(135deg, #ffffff 0%, #f8fdff 100%);
    height: 110px;
    max-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 5px 0;
}

.header-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.header-action {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.referral-download-group {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.download-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.referral-label {
    font-size: 0.85rem;
    color: #2c5282;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.download-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.download-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.download-card:hover {
    transform: scale(1.1);
}

.file-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.excel-card .file-icon {
    width: 58px;
    height: 50px;
}

.download-card:hover .file-icon {
    filter: brightness(1.1);
}

.logo-link {
    display: inline-block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.header-logo-img-only {
    width: auto;
    max-width: 600px;
    height: 100px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 2px 8px rgba(74, 144, 164, 0.25));
    transition: all 0.3s ease;
    display: block;
    margin-left: 0;
}

.logo-link:hover .header-logo-img-only {
    filter: drop-shadow(0 5px 15px rgba(74, 144, 164, 0.35));
    transform: scale(1.02);
}

.site-logo {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.site-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2c5282;
    line-height: 1.3;
    background: linear-gradient(135deg, #2c5282 0%, #4a90a4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-subtitle {
    font-size: 0.9rem;
    color: #666;
    font-weight: 400;
}

.site-name-en {
    font-size: 1rem;
    color: #4a90a4;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.9;
}

/* ========== ナビゲーション ========== */
nav {
    background: linear-gradient(135deg, #4a90a4 0%, #3d7a8e 100%);
    box-shadow: 0 2px 8px rgba(74, 144, 164, 0.2);
    position: fixed;
    top: 110px;
    left: 0;
    right: 0;
    z-index: 999;
    width: 100%;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

nav ul li {
    flex: 1;
    position: relative;
}

nav ul li::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}

nav ul li:last-child::after {
    display: none;
}

nav ul li a {
    display: block;
    padding: 16px 20px;
    color: #fff;
    text-decoration: none;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

nav ul li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffc107 0%, #28a745 100%);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

nav ul li a:hover::before,
nav ul li a.active::before {
    width: 80%;
}

nav ul li a:hover,
nav ul li a.active {
    background-color: rgba(61, 122, 142, 0.5);
    transform: translateY(-2px);
}

/* ========== ヒーローセクション ========== */
.hero-section {
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

.hero-image-container {
    position: relative;
    width: 100%;
    /* 16:9のアスペクト比を維持 */
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 100%;
    /* cover: 画像がコンテナを完全に埋める */
    object-fit: cover;
    object-position: center center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.hero-text {
    color: #ffffff;
    font-size: 3.6rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5),
                 0 0 20px rgba(0, 0, 0, 0.3);
    padding: 20px 40px;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

.hero-caption {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 10;
    pointer-events: none;
}

/* ========== メインコンテンツ ========== */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    margin-top: 170px;
}

/* ページタイトル */
.page-title-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 15px;
    border-bottom: 3px solid #4a90a4;
}

.page-title {
    font-size: 2rem;
    color: #2c5282;
    margin: 0;
    padding: 0;
    border: none;
}

.page-title-pdf-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #fff;
    border: 2px solid #4a90a4;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s;
}

.page-title-pdf-link:hover {
    background-color: #4a90a4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 144, 164, 0.3);
}

.page-title-pdf-icon {
    width: 28px;
    height: 28px;
}

.page-title-pdf-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c5282;
    transition: color 0.3s;
}

.page-title-pdf-link:hover .page-title-pdf-text {
    color: #fff;
}

.page-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 30px;
}

/* セクション */
section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 1.6rem;
    color: #2c5282;
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 5px solid #4a90a4;
}

.section-content {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 5px;
    line-height: 1.9;
}

/* イントロセクション（ロゴ背景付き） */
.intro-content {
    background-color: #f8f9fa;
    padding: 40px;
    border-radius: 8px;
    line-height: 1.9;
    position: relative;
    overflow: hidden;
}

/* 背景ロゴ削除 - ロゴは別セクションに配置 */

/* ロゴセクション（ヒーロー画像と説明文の間） */
.logo-section {
    text-align: center;
    padding: 80px 20px 5px 20px;
    background-color: #fff;
}

.logo-section img {
    max-width: 833px;
    width: 100%;
    height: auto;
    display: inline-block;
}

.intro-content p {
    position: relative;
    z-index: 1;
    margin-bottom: 15px;
}

.intro-content p:last-child {
    margin-bottom: 0;
}

/* ========== カード ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.info-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 25px;
    transition: box-shadow 0.3s;
}

.info-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1.3rem;
    color: #2c5282;
    margin-bottom: 15px;
    font-weight: 600;
}

.card-content {
    color: #555;
    line-height: 1.8;
}

/* ========== ボタン ========== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #4a90a4;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #3d7a8e;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* ========== テーブル ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border: 1px solid #ddd;
}

.data-table th {
    background-color: #4a90a4;
    color: #fff;
    font-weight: 600;
}

.data-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.data-table tr:hover {
    background-color: #e9ecef;
}

/* ========== リスト ========== */
.content-list {
    list-style: none;
    padding-left: 0;
}

.content-list li {
    padding: 12px 0;
    padding-left: 25px;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.content-list li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #4a90a4;
    font-weight: bold;
}

/* ========== アラート・注意書き ========== */
.alert {
    padding: 20px;
    margin: 25px 0;
    border-radius: 5px;
}

.alert-info {
    background-color: #e7f3f8;
    color: #2c5282;
}

.alert-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

/* ========== 施設カード ========== */
.facility-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 25px;
    margin-bottom: 20px;
}

.facility-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.facility-name {
    font-size: 1.3rem;
    color: #2c5282;
    font-weight: 600;
}

.facility-badges {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-primary {
    background-color: #4a90a4;
    color: #fff;
}

.badge-success {
    background-color: #5cb85c;
    color: #fff;
}

.badge-info {
    background-color: #5bc0de;
    color: #fff;
}

.facility-info {
    color: #555;
    line-height: 1.9;
}

.facility-info p {
    margin: 8px 0;
}

.facility-link {
    color: #4a90a4;
    text-decoration: none;
    font-weight: 500;
}

.facility-link:hover {
    text-decoration: underline;
}

/* ========== 書類ダウンロードセクション ========== */
.document-section {
    margin-bottom: 40px;
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.document-section-title {
    font-size: 1.4rem;
    color: #2c5282;
    margin-bottom: 10px;
    font-weight: 600;
}

.document-section-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.8;
}

/* 紹介状テンプレート用ダウンロードボタン */
.download-buttons-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.download-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 30px;
    background-color: #fff;
    border: 2px solid #4a90a4;
    border-radius: 8px;
    text-decoration: none;
    color: #2c5282;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.download-button:hover {
    background-color: #4a90a4;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.download-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.excel-icon-large {
    width: 38px;
    height: 32px;
}

/* パンフレット用バナーボタン */
.download-button-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 35px;
    background-color: #fff;
    border: 2px solid #4a90a4;
    border-radius: 8px;
    text-decoration: none;
    color: #2c5282;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 280px;
}

.download-button-banner:hover {
    background-color: #4a90a4;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.download-button-banner .download-icon {
    width: 40px;
    height: 40px;
}

.banner-text {
    flex: 1;
    text-align: left;
}

/* パンフレットグリッド */
.pamphlet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.pamphlet-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.pamphlet-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.pamphlet-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.pamphlet-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.pamphlet-header h5 {
    font-size: 1.2rem;
    color: #2c5282;
    margin: 0;
    font-weight: 600;
}

.pamphlet-description {
    color: #666;
    line-height: 1.7;
    margin-bottom: 20px;
    flex-grow: 1;
    font-size: 0.95rem;
}

.pamphlet-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #4a90a4;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
}

.pamphlet-download-btn:hover {
    background-color: #3d7a8e;
    transform: translateX(3px);
}

.pamphlet-download-btn svg {
    width: 16px;
    height: 16px;
}

/* ========== フッター ========== */
footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 40px 20px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 30px;
    justify-items: center;
    text-align: left;
}

.footer-section {
    width: 100%;
    max-width: 350px;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #4a90a4;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #bbb;
    font-size: 0.9rem;
}

.footer-bottom p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-logo-icon {
    height: 32px;
    width: auto;
    /* グレースケール化してシルエット風に */
    filter: grayscale(100%) brightness(0.7) contrast(1.2);
    opacity: 0.8;
}

/* ========== レスポンシブ ========== */
@media (max-width: 768px) {
    header {
        /* モバイルでもpadding/marginなし */
        padding: 0;
        margin: 0;
    }

    .header-top {
        height: auto;
        padding: 15px 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        position: relative;
        margin: 0;
    }

    /* スクロールバーのスタイル（Webkit系ブラウザ） */
    .header-top::-webkit-scrollbar {
        height: 8px;
    }

    .header-top::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
        margin: 0 10px;
    }

    .header-top::-webkit-scrollbar-thumb {
        background: linear-gradient(90deg, #4a90a4 0%, #28a745 50%, #ffc107 100%);
        border-radius: 4px;
    }

    .header-top::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(90deg, #3d7a8e 0%, #218838 50%, #e0a800 100%);
    }

    /* スクロール可能を示すヒント（右端のグラデーション） */
    .header-top::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 40px;
        height: 100%;
        background: linear-gradient(to left, rgba(255, 255, 255, 0.95), transparent);
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 1;
    }

    .header-top.scrolled-end::after {
        opacity: 0;
    }

    .header-container {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 0 10px;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }

    .logo-area {
        order: 1;
        flex-shrink: 0;
        margin: 0;
        padding: 0;
        width: auto;
        min-width: 120px;
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }

    .header-action {
        order: 2;
        margin-right: 0;
        flex-shrink: 0;
        padding-right: 10px;
    }

    .referral-download-group {
        flex-direction: row;
        gap: 15px;
    }

    .logo-link {
        display: block;
        width: 100%;
        text-align: left;
    }

    .header-logo-img-only {
        width: auto;
        max-width: 140px;
        height: 50px;
        display: block;
        margin: 0;
        object-position: left center;
        object-fit: contain;
    }

    .referral-label {
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .download-buttons {
        gap: 10px;
    }

    .file-icon {
        width: 48px;
        height: 48px;
    }

    .excel-card .file-icon {
        width: 56px;
        height: 48px;
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li::after {
        display: none;
    }

    nav ul li a {
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav ul li a::before {
        height: 2px;
    }

    /* ヒーローセクション */
    .hero-image-container {
        /* モバイルでも16:9のアスペクト比を維持 */
        aspect-ratio: 16 / 9;
    }

    .hero-image {
        /* モバイルでも画像を画面いっぱいに表示 */
        object-fit: cover;
    }

    .hero-text {
        font-size: 1.3rem;
        padding: 12px 15px;
        white-space: nowrap;
        letter-spacing: 0.02em;
    }

    .hero-caption {
        font-size: 0.65rem;
        bottom: 6px;
        right: 8px;
    }

    main {
        padding: 30px 20px;
        max-width: 100%;
        overflow-x: hidden;
        margin-top: 0;
        padding-top: 30px;
    }
    
    /* モバイル用：ヘッダーとナビゲーションの高さ調整 */
    body {
        padding-top: 0;
    }
    
    nav {
        position: relative;
        top: 0;
    }
    
    header {
        position: relative;
    }

    /* モバイルではアンカーリンクのスクロールマージン調整不要 */
    section[id],
    div[id] {
        scroll-margin-top: 20px;
    }

    /* イントロコンテンツ */
    .intro-content {
        padding: 25px 20px;
    }

    /* 背景ロゴは削除済み */
    
    .logo-section {
        padding: 40px 15px 8px 15px;
    }
    
    .logo-section img {
        max-width: 595px;
    }

    .page-title-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-title-pdf-link {
        width: 100%;
        justify-content: center;
    }

    .section-title {
        font-size: 1.3rem;
    }
    
    /* コンテンツボックスのパディング調整 */
    .content-box {
        padding: 20px 18px;
    }
    
    .section-content {
        padding: 20px 18px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    /* 書類ダウンロードセクション - モバイル */
    .document-section {
        padding: 20px;
    }

    .download-buttons-row {
        flex-direction: column;
        gap: 15px;
    }

    .download-button {
        width: 100%;
        justify-content: center;
    }

    .download-button-banner {
        width: 100%;
        min-width: auto;
        justify-content: flex-start;
    }

    .download-button-banner .download-icon {
        width: 36px;
        height: 36px;
    }

    .banner-text {
        font-size: 1rem;
    }

    .pamphlet-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pamphlet-card {
        padding: 20px;
    }

    /* マップコンテナの調整 */
    .openstreetmap-container {
        width: 100%;
        overflow-x: hidden;
    }

    #facility-map {
        width: 100% !important;
        max-width: 100%;
    }

    .map-container {
        width: 100%;
        overflow-x: hidden;
    }

    /* エリア別施設リスト */
    .region-map {
        width: 100%;
        overflow-x: hidden;
    }

    .region-row {
        grid-template-columns: 1fr;
    }

    .region-row.fukuoka-area .region-facilities {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .region-section {
        width: 100%;
        max-width: 100%;
    }

    /* フッター */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-section {
        max-width: 100%;
    }
    
    .footer-bottom p {
        flex-direction: column;
        gap: 8px;
    }

    .footer-logo-icon {
        height: 28px;
    }
}

/* 小型スマートフォン用 */
@media (max-width: 480px) {
    .hero-text {
        font-size: 1.1rem;
        padding: 10px 12px;
        letter-spacing: 0.01em;
    }
}

/* 極小画面用 */
@media (max-width: 360px) {
    .hero-text {
        font-size: 0.95rem;
        padding: 8px 10px;
    }
}

/* ========== ユーティリティ ========== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

/* ========== ページトップへ戻るボタン ========== */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #4a90a4 0%, #28a745 100%);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background: linear-gradient(135deg, #3d7a8e 0%, #218838 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

#back-to-top:active {
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    #back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 1.3rem;
    }
}

/* ========== 地図エリア ========== */
.map-container {
    margin: 30px 0;
    text-align: center;
}

.map-container img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* ========== 治療内容テーブル ========== */
.treatment-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: #fff;
    font-size: 0.9rem;
}

.treatment-table th,
.treatment-table td {
    padding: 12px 10px;
    text-align: center;
    border: 1px solid #ddd;
}

.treatment-table th {
    background-color: #f8f9fa;
    color: #2c5282;
    font-weight: 600;
    font-size: 0.85rem;
}

.treatment-table td.facility-name-cell {
    text-align: left;
    font-weight: 500;
    color: #2c5282;
}

.treatment-table .available {
    color: #4a90a4;
    font-weight: bold;
    font-size: 1.1rem;
}

.treatment-table tr:hover {
    background-color: #f8f9fa;
}

@media (max-width: 768px) {
    .treatment-table {
        font-size: 0.75rem;
    }
    
    .treatment-table th,
    .treatment-table td {
        padding: 8px 5px;
    }
}

/* ========== 医療機関マップ ========== */
.openstreetmap-container {
    margin-bottom: 40px;
}

#facility-map {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-legend-inline {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.region-map {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.region-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.region-row.fukuoka-area {
    grid-template-columns: 1fr;
}

.region-row.fukuoka-area .region-facilities {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.region-section {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
}

.region-title {
    color: #2c5282;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4a90a4;
}

.region-facilities {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-facility {
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.map-facility:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.map-facility.both {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.map-facility.cancer {
    background-color: #e7f3f8;
    border-left: 4px solid #4a90a4;
    color: #2c5282;
}

.map-facility.repro {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-box {
    width: 30px;
    height: 20px;
    border-radius: 3px;
}

.legend-box.both {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
}

.legend-box.cancer {
    background-color: #e7f3f8;
    border-left: 4px solid #4a90a4;
}

.legend-box.repro {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.legend-text {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

/* フッターリンクスタイル */
.footer-link {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #fff;
}

/* 本文中のリンクの下線を非表示 */
.facility-info a,
.section-content a,
p a {
    text-decoration: none;
}

.facility-info a:hover,
.section-content a:hover,
p a:hover {
    text-decoration: underline;
}

/* Leafletコントロールのz-index調整（地図の上に表示されるが、ヘッダーより下に） */
.leaflet-control-container,
.leaflet-control,
.leaflet-top,
.leaflet-bottom,
.leaflet-control-zoom,
.leaflet-control-attribution {
    z-index: 400 !important;
}

/* 地図コンテナのz-index */
#facility-map,
#fullscreen-map {
    position: relative;
    z-index: 1;
}

/* 全画面表示ボタン */
.fullscreen-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 200;
}

.fullscreen-btn:hover {
    background: #f0f0f0;
    border-color: #4a90a4;
}

.fullscreen-btn svg {
    color: #4a90a4;
}

/* 全画面オーバーレイ */
.fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    padding: 20px;
}

.fullscreen-overlay.active {
    display: block;
}

.fullscreen-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#fullscreen-map {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.close-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 32px;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s ease;
}

.close-fullscreen-btn:hover {
    background: #f44336;
    color: white;
    transform: scale(1.1);
}

/* 全画面時の凡例 */
.fullscreen-legend {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    z-index: 10001;
    max-width: calc(100% - 40px);
}

.fullscreen-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

/* スマホで全画面表示したときの凡例 */
@media (max-width: 768px) {
    .fullscreen-overlay {
        padding: 8px;
    }

    #fullscreen-map {
        border-radius: 6px;
    }

    .close-fullscreen-btn {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        font-size: 28px;
    }

    .fullscreen-legend {
        left: 10px;
        right: 10px;
        bottom: 12px;
        transform: none;
        max-width: none;
        width: auto;
        padding: 8px 8px;
        border-radius: 14px;
        gap: 6px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .fullscreen-legend::-webkit-scrollbar {
        display: none;
    }

    .fullscreen-legend .legend-item {
        flex: 0 0 auto;
        font-size: 0.78rem;
        padding: 5px 8px;
        border-radius: 999px;
        background: rgba(245, 247, 250, 0.95);
    }

    .fullscreen-legend .legend-item span:first-child {
        width: 11px !important;
        height: 11px !important;
        margin-right: 3px !important;
    }
}

/* かなり小さいスマホ用 */
@media (max-width: 480px) {
    .fullscreen-legend {
        bottom: 10px;
        padding: 7px 7px;
    }

    .fullscreen-legend .legend-item {
        font-size: 0.72rem;
        padding: 4px 7px;
    }
}

@media (max-width: 768px) {
    .region-map {
        grid-template-columns: 1fr;
    }
    
    .map-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    #facility-map {
        height: 400px;
    }
    
    .map-legend-inline p {
        font-size: 0.8rem;
    }
    
    /* テーブルのレスポンシブ対応 */
    .data-table,
    .treatment-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.9rem;
        word-break: break-word;
    }
    
    .treatment-table th,
    .treatment-table td {
        padding: 8px 5px;
        font-size: 0.8rem;
    }
    
    /* 長いテキストの折り返し */
    .section-content,
    .content-box,
    .facility-info {
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
    }
    
    /* 長いURLの折り返し */
    .section-content a,
    .content-box a,
    .facility-info a {
        word-break: break-all;
    }
}
