:root {
    --color-bg: #f5f6f8;
    --color-surface: #ffffff;
    --color-primary: #1a73e8;
    --color-primary-dark: #1558b0;
    --color-text: #202124;
    --color-text-muted: #5f6368;
    --color-border: #e0e0e0;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Hiragino Sans", "Yu Gothic", "Segoe UI", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== ヘッダー ===== */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--color-surface);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 10;
}

.site-header h1 {
    margin: 0;
    font-size: 1.4rem;
}

.trip-count {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    background: var(--color-bg);
    padding: 6px 14px;
    border-radius: 999px;
}

/* ===== レイアウト ===== */
.main-layout {
    display: flex;
    height: calc(100vh - 64px);
}

#map {
    flex: 1;
    height: 100%;
}

#map-message {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1rem;
}

.trip-list {
    width: 340px;
    max-width: 40vw;
    overflow-y: auto;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    padding: 16px;
}

.trip-list h2 {
    font-size: 1rem;
    margin: 0 0 12px;
    color: var(--color-text-muted);
}

/* ===== 旅行カード ===== */
.trip-card {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.trip-card:hover {
    background: var(--color-bg);
    box-shadow: var(--shadow);
}

.trip-card img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #eee;
}

.trip-card .trip-card-info h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
}

.trip-card .trip-card-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ===== 情報ウィンドウ（InfoWindow） ===== */
.info-window {
    max-width: 260px;
    font-family: inherit;
}

.info-window img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    background: #eee;
}

.info-window .info-body {
    padding: 10px 4px 4px;
}

.info-window h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.info-window .info-date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin: 0 0 6px;
}

.info-window p.info-summary {
    font-size: 0.85rem;
    margin: 0 0 10px;
    line-height: 1.4;
}

.btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

/* ===== 詳細ページ ===== */
.detail-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 16px;
}

.hero-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #eee;
}

.detail-title {
    font-size: 2rem;
    margin: 20px 0 4px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.detail-summary {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.detail-description {
    line-height: 1.8;
    margin-bottom: 28px;
    white-space: pre-wrap;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.gallery img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow);
    background: #eee;
    transition: transform 0.15s ease;
}

.gallery img:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-hover);
}

.hero-image,
.gallery img {
    cursor: zoom-in;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    z-index: 1000;
    cursor: zoom-out;
}

.lightbox-overlay[hidden] {
    display: none;
}

.lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    font-size: 2rem;
    line-height: 1;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.tag {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.error-message {
    max-width: 480px;
    margin: 60px auto;
    text-align: center;
    padding: 32px;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.error-message h2 {
    margin-top: 0;
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        height: auto;
    }

    #map {
        height: 55vh;
    }

    .trip-list {
        width: 100%;
        max-width: 100%;
        border-left: none;
        border-top: 1px solid var(--color-border);
    }

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

    .hero-image {
        max-height: 240px;
    }
}
