
/* =========================================================
   基本設定
   ========================================================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f6f8;
    color: #222;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Helvetica Neue",
        "Hiragino Kaku Gothic ProN",
        "Yu Gothic",
        sans-serif;
    line-height: 1.6;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

header {
    background: #172a46;
    color: white;
    padding: 28px 0;
}

header h1 {
    margin: 0;
    font-size: 25px;
}

header p {
    margin: 6px 0 0;
    color: #cbd5e1;
    font-size: 14px;
}

main {
    padding-top: 32px;
    padding-bottom: 70px;
}

main h2 {
    margin-top: 0;
    font-size: 24px;
}

/* =========================================================
   地域一覧
   ========================================================= */

.area-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(240px, 1fr)
    );
    gap: 20px;
}

.area-card {
    display: block;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    color: #222;
    transition: 0.2s;
}

.area-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 16px #00000012;
    text-decoration: none;
}

.area-card h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

.area-card p {
    color: #64748b;
    margin: 0 0 14px;
}

.area-card span {
    color: #2563eb;
    font-weight: bold;
}

/* =========================================================
   パンくずリスト
   ========================================================= */

.breadcrumb {
    margin-bottom: 22px;
    font-size: 14px;
    color: #64748b;
}

/* =========================================================
   下位地域
   ========================================================= */

.subareas {
    margin-bottom: 30px;
}

.subareas h3 {
    font-size: 17px;
}

.subarea-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subarea-links a {
    background: white;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
}

/* =========================================================
   ランキングカード
   ========================================================= */

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ranking-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.rank {
    flex-shrink: 0;
    min-width: 58px;
    font-size: 22px;
    font-weight: bold;
    color: #2563eb;
}

.ranking-content {
    min-width: 0;
}

.ranking-content h3 {
    margin: 0 0 12px;
    font-size: 20px;
}

.rating-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.review-count {
    color: #d97706;
    font-weight: bold;
    font-size: 18px;
}

.review-count .review-label {
    color: #111827;
    font-size: 16px;
    font-weight: bold;
}

.rating {
    color: #111827;
    font-weight: bold;
}

.address {
    margin: 12px 0;
    color: #64748b;
    font-size: 14px;
}

.maps-link {
    font-size: 14px;
    font-weight: bold;
}

/* =========================================================
   検索セクション
   ========================================================= */

.search-section {
    margin-bottom: 48px;
}

.search-section + .search-section {
    padding-top: 36px;
    border-top: 1px solid #e2e8f0;
}

.section-description {
    margin-top: -8px;
    margin-bottom: 20px;
    color: #64748b;
}

/* =========================================================
   カテゴリー
   ========================================================= */

.category-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(220px, 1fr)
    );
    gap: 16px;
}

.category-card {
    display: block;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    color: #222;
    transition: 0.2s;
}

a.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 16px #00000012;
    text-decoration: none;
}

.category-card h3 {
    margin: 0 0 8px;
    font-size: 19px;
}

.category-card span {
    color: #2563eb;
    font-weight: bold;
}

.category-card p {
    margin: 12px 0 0;
    color: #94a3b8;
    font-size: 13px;
}

/* =========================================================
   絞り込み
   ========================================================= */

.filter-section {
    margin: 28px 0 32px;
}

.filter-section h3 {
    margin-bottom: 12px;
    font-size: 17px;
}

/* =========================================================
   ランキング概要
   ========================================================= */

.ranking-summary {
    margin-top: -12px;
    margin-bottom: 26px;
    color: #64748b;
    font-size: 14px;
}

/* =========================================================
   ランキング導線
   ========================================================= */

.ranking-button {
    display: inline-block;
    background: #2563eb;
    color: white;
    border-radius: 8px;
    padding: 12px 18px;
    font-weight: bold;
}

.ranking-button:hover {
    text-decoration: none;
    opacity: 0.9;
}

/* =========================================================
   ランキング用サイドバー
   ========================================================= */

.ranking-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.ranking-sidebar {
    min-width: 0;
}

.sidebar-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.sidebar-title {
    font-size: 17px;
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h4 {
    margin: 0 0 12px;
    font-size: 13px;
    color: #64748b;
    font-weight: bold;
}

/* =========================================================
   サイドバー階層ツリー
   ========================================================= */

.sidebar-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-tree-item {
    min-width: 0;
}

.sidebar-tree-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    list-style: none;
}

.sidebar-tree-summary::-webkit-details-marker {
    display: none;
}

.sidebar-tree-summary:hover {
    background: #f1f5f9;
}

.sidebar-chevron {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(-45deg);
    transition: transform 0.15s;
}

.sidebar-tree-group[open] > .sidebar-tree-summary
.sidebar-chevron {
    transform: rotate(45deg);
}

.sidebar-tree-children {
    margin-left: 12px;
    padding-left: 10px;
    border-left: 1px solid #e2e8f0;
}

.sidebar-tree-link {
    display: block;
    padding: 8px 10px;
    margin: 3px 0;
    border-radius: 7px;
    font-size: 14px;
    color: #475569;
    overflow-wrap: anywhere;
}

.sidebar-tree-link:hover {
    background: #f1f5f9;
    text-decoration: none;
}

.sidebar-tree-link.selected {
    background: #eff6ff;
    color: #2563eb;
    font-weight: bold;
}

/* =========================================================
   ランキングメイン
   ========================================================= */

.ranking-main {
    min-width: 0;
}

.ranking-main h2 {
    font-size: 23px;
    line-height: 1.5;
}

.ranking-main .ranking-card {
    padding: 20px;
}

.ranking-main .ranking-content {
    flex: 1;
    min-width: 0;
}

/* モバイル用サイドバーは通常非表示 */
.sidebar-mobile-toggle {
    display: none;
}

/* =========================================================
   アフィリエイトリンク
   ========================================================= */

.ranking-actions {
    min-height: 36px;
    margin-top: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ranking-actions .maps-link {
    margin: 0;
}

.affiliate-button {
    box-sizing: border-box;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 6px;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}

.affiliate-button:hover {
    background: #1d4ed8;
    color: #ffffff;
    text-decoration: none;
}

.affiliate-pr {
    color: #64748b;
    font-size: 11px;
}

/* =========================================================
   ランキングカード：施設画像
   ========================================================= */

.ranking-heading {
    display: flex;
    align-items: baseline;
    gap: 18px;
    margin-bottom: 0;
}

.ranking-heading .rank {
    min-width: 0;
    flex-shrink: 0;
}

.ranking-heading h3 {
    margin: 0;
    min-width: 0;
    font-size: 20px;
}

.ranking-body {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
}

.ranking-image {
    flex: 0 0 135px;
    width: 135px;
    height: 100px;
    overflow: hidden;
    border-radius: 8px;
    background: #f1f5f9;
}

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

.ranking-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 12px;
}

.ranking-body .ranking-content {
    flex: 1;
    min-width: 0;
}

/* =========================================================
   開閉式 Google Maps
   ========================================================= */

.ranking-map-toggle {
    margin: 0 0 24px;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    overflow: hidden;
}

.ranking-map-toggle > summary {
    padding: 16px 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #2563eb;
    background: #f8fafc;
}

.ranking-map-toggle > summary:hover {
    background: #eff6ff;
}

.ranking-map-toggle[open] > summary {
    border-bottom: 1px solid #e5e7eb;
}

.ranking-map-panel {
    padding: 16px;
}

#ranking-interactive-map {
    width: 100%;
    height: 480px;
    border-radius: 8px;
    overflow: hidden;
}

.ranking-map-note {
    margin: 12px 0 0;
    font-size: 13px;
    color: #64748b;
}

/* =========================================================
   Google Maps標準ピン + 施設名ラベル
   ========================================================= */

/*
   ピンの色・形状はGoogle MapsのPinElementに任せる。
   CSSでは施設名ラベルの表示位置のみ調整する。
*/

.ranking-google-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    cursor: pointer;
}

/* 施設名をピンの右横に常時表示 */
.ranking-google-marker-name {
    position: absolute;
    left: calc(100% + 6px);
    top: 4px;
    width: max-content;
    max-width: 180px;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
    color: #202124;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

/* =========================================================
   タブレット
   ========================================================= */

@media (max-width: 850px) {

    .ranking-layout {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .sidebar-desktop-content {
        display: none;
    }

    .sidebar-mobile-toggle {
        display: block;
        background: #ffffff;
        border: 1px solid #dbe3ee;
        border-radius: 10px;
        overflow: hidden;
    }

    .sidebar-mobile-toggle > summary {
        padding: 14px 18px;
        cursor: pointer;
        font-size: 15px;
        font-weight: bold;
        color: #2563eb;
    }

    .sidebar-mobile-toggle[open] > summary {
        border-bottom: 1px solid #e5e7eb;
    }

    .sidebar-mobile-content .sidebar-panel {
        border: none;
        border-radius: 0;
    }

    .ranking-main h2 {
        font-size: 21px;
    }

    #ranking-interactive-map {
        height: 380px;
    }
}

/* =========================================================
   スマートフォン
   ========================================================= */

@media (max-width: 600px) {

    header h1 {
        font-size: 20px;
    }

    main h2 {
        font-size: 20px;
    }

    .ranking-main h2 {
        font-size: 20px;
    }

    .ranking-card {
        gap: 12px;
        padding: 16px;
    }

    .ranking-main .ranking-card {
        padding: 16px;
    }

    .rank {
        min-width: 45px;
        font-size: 18px;
    }

    .ranking-content h3 {
        font-size: 17px;
    }

    .review-count {
        font-size: 16px;
    }

    .sidebar-panel {
        padding: 16px;
    }

    .ranking-actions {
        min-height: 36px;
        gap: 10px;
    }

    .affiliate-button {
        text-align: center;
        white-space: nowrap;
    }

    .ranking-heading {
        gap: 10px;
    }

    .ranking-heading h3 {
        font-size: 17px;
    }

    .ranking-body {
        gap: 12px;
    }

    .ranking-image {
        flex: 0 0 90px;
        width: 90px;
        height: 90px;
    }

    .ranking-map-toggle > summary {
        padding: 14px 16px;
    }

    .ranking-map-panel {
        padding: 10px;
    }

    #ranking-interactive-map {
        height: 340px;
    }
}

/* =========================================================
   ランキングカード：楽天宿泊料金・予約ボタン
   ========================================================= */

.ranking-card .ranking-body {
    align-items: center;
}

.ranking-card .hotel-booking {
    flex: 0 0 185px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.ranking-card .hotel-booking-label {
    font-size: 12px;
    color: #64748b;
}

.ranking-card .hotel-price {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
}

.ranking-card .hotel-booking-note {
    margin: 0;
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

.ranking-card .hotel-booking .affiliate-button {
    white-space: nowrap;
}

@media (max-width: 720px) {
    .ranking-card .ranking-body {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .ranking-card .hotel-booking {
        flex: 1 1 100%;
        padding-left: 0;
    }
}
