/* ==========================================
   実家片付け・解約ガイド: Site-wide Design System
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --accent: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.75;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   Header
   ========================================== */
.site-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 1rem 1rem;
    text-align: center;
}

.site-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.site-header .subtitle {
    font-size: 1.1rem;
    color: #cbd5e1;
    font-weight: 300;
}

.site-header--article {
    padding: 2rem 1rem;
    text-align: left;
}

.site-header--article .header-inner {
    max-width: 820px;
    margin: 0 auto;
}

.site-header--article h1 {
    font-size: 1.75rem;
    line-height: 1.35;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* ==========================================
   Breadcrumb
   ========================================== */
.breadcrumb {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.breadcrumb-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

/* ==========================================
   Layout Containers
   ========================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1rem;
}

.article-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 1rem 1rem;
}

/* ==========================================
   Top Page: Category Cards Grid
   ========================================== */
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0f172a;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.category-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.category-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
}

.category-card .card-footer {
    margin-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 700;
}

.card-tag--phase1 { background: #dbeafe; color: #1e40af; }
.card-tag--phase2 { background: #fef3c7; color: #92400e; }
.card-tag--phase3 { background: #dcfce7; color: #166534; }
.card-tag--tool { background: #f3e8ff; color: #6b21a8; }

.card-arrow {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Featured Article Card */
.featured-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
    color: white;
    border: none;
}

.featured-card p { color: #cbd5e1; }
.featured-card .card-arrow { color: #60a5fa; }

/* ==========================================
   Article List on Top Page
   ========================================== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.article-list-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.article-list-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.article-list-item h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
    padding: 0;
    border: none;
}

.article-list-item .meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.article-list-item .unit-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
}

.article-list-item .unit-price small {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* ==========================================
   Article Body Content
   ========================================== */
.article-body h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 1rem 0 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    color: #0f172a;
}

.article-body h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: #1e293b;
    padding-left: 0.75rem;
    border-left: 3px solid var(--primary);
}

.article-body h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 1.5rem 0 0.75rem;
    color: #334155;
}

.article-body p {
    margin-bottom: 1.25rem;
    font-size: 1rem;
    line-height: 1.85;
}

/* Lists */
.article-body ul,
.article-body ol {
    margin: 0 0 1.5rem 1.5rem;
}

.article-body ul li,
.article-body ol li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.article-body ul li::marker { color: var(--primary); }

/* Callout / Info Box */
.callout {
    background: #f8fafc;
    border-left: 4px solid var(--primary);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.callout--warning {
    background: #fffbeb;
    border-left-color: var(--warning);
}

.callout--danger {
    background: #fef2f2;
    border-left-color: var(--danger);
}

.callout strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

/* Tables */
.data-table-wrap {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: #1e293b;
    color: white;
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .highlight-cell {
    font-weight: 800;
    color: var(--accent);
}

.data-table .danger-cell {
    font-weight: 800;
    color: var(--danger);
}

/* Comparison Grid (2-col) */
.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.compare-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.compare-box h4 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.compare-box--good { border-color: var(--accent); }
.compare-box--bad { border-color: var(--danger); }

.compare-box--good h4 { color: var(--accent); }
.compare-box--bad h4 { color: var(--danger); }

.compare-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.compare-box ul li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.compare-box--good ul li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: bold; }
.compare-box--bad ul li::before { content: '✗'; position: absolute; left: 0; color: var(--danger); font-weight: bold; }

/* Metric Cards in Article */
.metric-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.metric-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.metric-card .metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}

.metric-card .metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.25rem;
}

/* CTA / Affiliate Box */
.cta-box {
    background: white;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin: 2.5rem 0;
}

.cta-box h4 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.cta-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.cta-btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.875rem 2.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s;
}

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

/* CTA Container */
.cta-container {
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}


/* Image & Figure Style */
.article-figure {
    margin: 1rem 0;
    text-align: center;
}

.article-figure img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: block;
    margin: 0 auto;
}

.article-figure figcaption {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
}

/* Image placeholder support (kept for backward compatibility, but figures preferred) */
.image-placeholder {
    background: #f1f5f9;
    background-image: url('../../assets/images/no_image.png');
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(30, 41, 59, 0.5); /* Semi-transparent text-main */
    font-size: 0.85rem;
    margin: 1.0rem 0;
    padding: 1rem;
    text-align: center;
}

/* Table of Contents */
.toc {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    margin: 0 0 2.5rem;
}

.toc-title {
    font-size: 1rem !important;
    margin: 0 0 0.75rem !important;
    padding: 0 !important;
    border: none !important;
}

.toc ol {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.toc ol li {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.toc a {
    color: var(--primary);
    text-decoration: none;
}

.toc a:hover {
    text-decoration: underline;
}

/* Author */
.article-author {
    font-style: normal;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

/* Related Articles Section */
.related-articles {
    padding: 1rem;
    margin-top: 1rem;
}

.related-articles h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.related-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: block;
}

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

.related-card .category-tag {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: block;
}

.related-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    border: none !important;
    padding: 0 !important;
}

/* ==========================================
   Footer & Disclaimer
   ========================================== */
.disclaimer {
    max-width: 800px;
    margin: 1rem auto;
    padding: 1.25rem 1.5rem;
    background: #fffbeb;
    border-left: 4px solid var(--warning);
    font-size: 0.85rem;
    color: #92400e;
    border-radius: 0 8px 8px 0;
}

.site-footer {
    text-align: center;
    padding: 1rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    background: white;
}

.footer-links {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Error & Policy Specific */
.centric-content {
    max-width: 600px;
    margin: 4rem auto;
    text-align: center;
    padding: 2rem;
}

.centric-content h1 {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.centric-content p {
    margin-bottom: 2rem;
}

/* Screen-reader only (accessible hidden) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================
   Utility & Layout Helpers
   ========================================== */
.section-intro {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.hub-section {
    margin-top: 1rem;
}

.hub-footer-section {
    margin-top: 1rem;
    padding-top: 1rem;
}

.metric-strip--top {
    margin-top: 0 !important;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
    .site-header h1 { font-size: 1.5rem; }
    .category-grid { grid-template-columns: 1fr; }
    .compare-grid { grid-template-columns: 1fr; }
    .metric-strip { grid-template-columns: 1fr; }
    .article-meta { flex-direction: column; gap: 0.25rem; }
}
