/*
Theme Name: DB Site
Description: Minimal theme for database directory sites
Version: 2.0.0
Text Domain: dbsite
*/

/* ========================================
   Design Tokens
   ======================================== */
:root {
    /* Colors */
    --c-pink: #ec4899;
    --c-pink-light: #fbcfe8;
    --c-pink-bg: #fdf2f8;
    --c-cyan: #06b6d4;
    --c-cyan-light: #cffafe;
    --c-yellow: #f59e0b;
    --c-yellow-light: #fef3c7;
    --c-green: #10b981;
    --c-green-light: #d1fae5;
    --c-purple: #8b5cf6;
    --c-purple-light: #ede9fe;
    --c-orange: #f97316;

    --c-text: #1e1e2e;
    --c-text-secondary: #64748b;
    --c-text-muted: #94a3b8;
    --c-bg: #fefcfd;
    --c-bg-warm: #fff7f9;
    --c-card: #ffffff;
    --c-border: #f1e8ec;
    --c-border-hover: #ec489940;

    /* Typography */
    --font-display: "M PLUS Rounded 1c", "Hiragino Sans", sans-serif;
    --font-body: "Noto Sans JP", "Hiragino Sans", sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(236, 72, 153, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(236, 72, 153, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 24px rgba(236, 72, 153, 0.1), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 12px 32px rgba(236, 72, 153, 0.14), 0 4px 8px rgba(0, 0, 0, 0.04);

    /* Layout */
    --content-width: 960px;
    --content-wide: 1120px;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    color: var(--c-text);
    line-height: 1.8;
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--c-pink);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #db2777;
    text-decoration: none;
}

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

/* ========================================
   Header
   ======================================== */
.site-header {
    background: var(--c-card);
    border-bottom: 2px solid var(--c-pink-light);
    padding: 0.875rem var(--space-xl);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

.site-header-inner {
    max-width: var(--content-wide);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.site-header .site-logo {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.site-header .site-logo a {
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.site-header .site-logo a:hover {
    color: var(--c-pink);
}

/* ========================================
   Main Content
   ======================================== */
.site-main {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
}

/* ========================================
   Hero Section (Front Page)
   ======================================== */
.hero {
    background: linear-gradient(135deg, #ec4899 0%, #f472b6 30%, #c084fc 60%, #818cf8 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    color: #fff;
    margin-bottom: var(--space-2xl);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(251, 191, 36, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.25) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    margin-bottom: var(--space-sm);
    letter-spacing: 0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hero .hero-sub {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    opacity: 0.92;
    font-weight: 500;
}

.hero .hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-top: var(--space-lg);
    flex-wrap: wrap;
}

.hero .hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero .hero-stat .stat-num {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
}

.hero .hero-stat .stat-label {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* ========================================
   Section
   ======================================== */
.section {
    margin-bottom: var(--space-2xl);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding-left: var(--space-md);
    position: relative;
}

.section-header::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.15em;
    bottom: 0.15em;
    width: 4px;
    border-radius: 2px;
    background: var(--c-pink);
}

.section-header--cyan::before { background: var(--c-cyan); }
.section-header--yellow::before { background: var(--c-yellow); }
.section-header--green::before { background: var(--c-green); }
.section-header--purple::before { background: var(--c-purple); }

.section-header h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--c-text);
}

/* ========================================
   Tag List (Areas, Chains, etc.)
   ======================================== */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    list-style: none;
}

.tag-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    background: var(--c-card);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--c-text);
    transition: all 0.2s;
    white-space: nowrap;
}

.tag-list a:hover {
    border-color: var(--c-pink);
    background: var(--c-pink-bg);
    color: var(--c-pink);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.tag-list .tag-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--c-text-muted);
    background: #f1f5f9;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
    min-width: 1.6rem;
    text-align: center;
    transition: all 0.2s;
}

.tag-list a:hover .tag-count {
    background: var(--c-pink);
    color: #fff;
}

/* Highlighted tags (has data) */
.tag-list a.has-data {
    border-color: var(--c-pink-light);
    background: var(--c-pink-bg);
}

.tag-list a.has-data .tag-count {
    background: var(--c-pink);
    color: #fff;
}

/* ========================================
   Breadcrumb
   ======================================== */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--c-text-muted);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.breadcrumb a {
    color: var(--c-text-secondary);
    padding: 0.15rem 0.3rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.breadcrumb a:hover {
    color: var(--c-pink);
    background: var(--c-pink-bg);
}

.breadcrumb .sep {
    color: var(--c-text-muted);
    font-size: 0.7rem;
}

.breadcrumb .current {
    color: var(--c-text);
    font-weight: 500;
}

/* ========================================
   Area Page Title
   ======================================== */
.page-title-area {
    margin-bottom: var(--space-xl);
}

.page-title-area h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--c-text);
}

.page-title-area .result-count {
    font-size: 0.9rem;
    color: var(--c-text-secondary);
    margin-top: 0.25rem;
}

/* ========================================
   Listing Card
   ======================================== */
.listing-card {
    background: var(--c-card);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    transition: all 0.25s;
}

.listing-card:hover {
    border-color: var(--c-border-hover);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.listing-card h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

.listing-card h3 a {
    color: var(--c-text);
    transition: color 0.2s;
}

.listing-card h3 a:hover {
    color: var(--c-pink);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.card-tags .tag {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--c-cyan-light);
    color: #0891b2;
}

.card-tags .tag:nth-child(2n) {
    background: var(--c-purple-light);
    color: #7c3aed;
}

.card-tags .tag:nth-child(3n) {
    background: var(--c-yellow-light);
    color: #d97706;
}

.card-comment {
    font-size: 0.9rem;
    color: var(--c-text-secondary);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--c-text-muted);
}

/* ========================================
   Single Listing Detail
   ======================================== */
.listing-detail {
    background: var(--c-card);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
}

.listing-detail h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-md);
    color: var(--c-text);
    line-height: 1.5;
}

.listing-comment {
    font-size: 0.95rem;
    color: var(--c-text-secondary);
    line-height: 1.8;
    padding: var(--space-md);
    background: var(--c-bg-warm);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    border-left: 3px solid var(--c-pink-light);
}

.listing-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.listing-tags .tag-group {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
}

.listing-tags .tag-group strong {
    color: var(--c-text-secondary);
    font-weight: 600;
}

.listing-tags .tag-group a {
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-full);
    background: var(--c-pink-bg);
    color: var(--c-pink);
    font-weight: 500;
    transition: all 0.2s;
}

.listing-tags .tag-group a:hover {
    background: var(--c-pink);
    color: #fff;
}

.listing-detail dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
    margin: var(--space-lg) 0;
    border-top: 1px solid var(--c-border);
}

.listing-detail dt {
    font-weight: 600;
    color: var(--c-text-secondary);
    font-size: 0.88rem;
    padding: 0.75rem var(--space-md) 0.75rem 0;
    border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
}

.listing-detail dd {
    margin: 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--c-border);
    font-size: 0.95rem;
}

.listing-detail dd a {
    word-break: break-all;
}

/* Map */
.listing-map {
    margin-top: var(--space-lg);
}

.listing-map iframe {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--c-border);
}

/* Notice */
.listing-notice {
    margin-top: var(--space-lg);
    font-size: 0.8rem;
    color: var(--c-text-muted);
    padding: var(--space-md);
    background: #f8fafc;
    border-radius: var(--radius-md);
    line-height: 1.7;
}

/* ========================================
   Pagination
   ======================================== */
.nav-links {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
}

.nav-links a,
.nav-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-links a {
    background: var(--c-card);
    border: 1.5px solid var(--c-border);
    color: var(--c-text);
}

.nav-links a:hover {
    border-color: var(--c-pink);
    background: var(--c-pink-bg);
    color: var(--c-pink);
}

.nav-links .current {
    background: var(--c-pink);
    color: #fff;
    border: 1.5px solid var(--c-pink);
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: var(--c-text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--c-border);
    margin-top: var(--space-2xl);
}

/* ========================================
   Compare Table (City Page)
   ======================================== */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--space-xl);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    white-space: nowrap;
}

.compare-table th {
    background: var(--c-pink-bg);
    color: var(--c-text);
    font-weight: 600;
    font-size: 0.8rem;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--c-pink-light);
    position: sticky;
    top: 0;
}

.compare-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text);
    vertical-align: middle;
}

.compare-table tbody tr:hover {
    background: var(--c-bg-warm);
}

.compare-table td a {
    font-weight: 500;
}

.compare-table .num-cell {
    text-align: center;
    font-weight: 600;
    font-family: var(--font-display);
}

/* ========================================
   Related Links
   ======================================== */
.related-links {
    margin-bottom: var(--space-xl);
}

.related-links .related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.related-links .related-list a {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: var(--c-card);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--c-text);
    transition: all 0.2s;
}

.related-links .related-list a:hover {
    border-color: var(--c-pink);
    background: var(--c-pink-bg);
    color: var(--c-pink);
}

.related-links .related-list .current-city a {
    border-color: var(--c-pink);
    background: var(--c-pink);
    color: #fff;
    pointer-events: none;
}

/* ========================================
   Card Badges & DL Meta
   ======================================== */
.card-badges {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.card-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--c-cyan-light);
    color: #0891b2;
}

.card-badge--count {
    background: var(--c-pink-bg);
    color: var(--c-pink);
}

.card-dl {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
    font-size: 0.8rem;
    color: var(--c-text-muted);
    margin-top: 0.4rem;
}

.card-dl dt {
    font-weight: 600;
    color: var(--c-text-secondary);
}

.card-dl dd {
    margin: 0;
}

.card-dl .dl-pair {
    display: flex;
    gap: 0.3rem;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    color: var(--c-text-muted);
    font-size: 0.95rem;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 640px) {
    .site-header {
        padding: 0.75rem var(--space-md);
    }

    .site-main {
        padding: var(--space-lg) var(--space-md);
    }

    .hero {
        padding: var(--space-xl) var(--space-md);
        border-radius: var(--radius-lg);
    }

    .hero h2 {
        font-size: 1.4rem;
    }

    .hero .hero-stats {
        gap: var(--space-sm);
    }

    .hero .hero-stat {
        padding: var(--space-sm) var(--space-md);
    }

    .hero .hero-stat .stat-num {
        font-size: 1.3rem;
    }

    .listing-card {
        padding: var(--space-md);
    }

    .listing-detail {
        padding: var(--space-md);
    }

    .listing-detail dl {
        grid-template-columns: 1fr;
    }

    .listing-detail dt {
        padding-bottom: 0.25rem;
        border-bottom: none;
    }

    .listing-detail dd {
        padding-top: 0;
        padding-bottom: 0.75rem;
    }

    .tag-list a {
        padding: 0.35rem 0.75rem;
        font-size: 0.82rem;
    }

    .compare-table {
        font-size: 0.8rem;
    }

    .compare-table th,
    .compare-table td {
        padding: 0.5rem 0.6rem;
    }
}
