/* David-Horodok Records — Wiki Stylesheet */

:root {
    --bg: #fafaf8;
    --text: #2c2c2c;
    --muted: #666;
    --border: #ddd;
    --accent: #4a6fa5;
    --accent-light: #e8f0fe;
    --birth: #2e7d32;
    --marriage: #6a1b9a;
    --death: #c62828;
    --divorce: #e65100;
    --unknown: #666;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

.container { max-width: 960px; margin: 0 auto; padding: 20px; }

/* Nav */
.site-nav {
    background: #2c3e50;
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.nav-brand { color: white; text-decoration: none; font-weight: 700; font-size: 1.1em; }
.nav-links { display: flex; gap: 16px; flex-wrap: wrap; }
.nav-links a { color: #ccc; text-decoration: none; font-size: 0.95em; }
.nav-links a:hover { color: white; }

/* Footer */
.site-footer { text-align: center; padding: 30px 20px; color: var(--muted); font-size: 0.85em; border-top: 1px solid var(--border); margin-top: 40px; }

/* Typography */
h1 { font-size: 1.6em; margin-bottom: 12px; }
h2 { font-size: 1.3em; margin: 24px 0 12px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
h3 { font-size: 1.1em; margin: 16px 0 8px; }
a { color: var(--accent); }
.subtitle { color: var(--muted); margin-bottom: 24px; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.8em; font-weight: 600; color: white; }
.badge-birth { background: var(--birth); }
.badge-marriage { background: var(--marriage); }
.badge-death { background: var(--death); }
.badge-divorce { background: var(--divorce); }
.badge-unknown { background: var(--unknown); }
.badge-year { background: var(--accent); }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin: 24px 0; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 16px; text-align: center; }
.stat-number { font-size: 2em; font-weight: 700; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 0.9em; }

/* Browse cards */
.browse-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 16px 0; }
.browse-card { display: block; background: white; border: 1px solid var(--border); border-radius: 8px; padding: 20px; text-decoration: none; transition: box-shadow 0.2s; }
.browse-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.browse-card h3 { color: var(--accent); margin: 0 0 8px; }
.browse-card p { color: var(--muted); font-size: 0.9em; margin: 0; }

/* Record page */
.record-page { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 24px; }
.record-meta { margin-bottom: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fs-link { display: inline-block; padding: 4px 12px; background: var(--accent); color: white; text-decoration: none; border-radius: 4px; font-size: 0.9em; }
.fs-link:hover { background: #3a5a8a; color: white; }
.fs-link-small { font-size: 0.8em; color: var(--accent); }

.record-section { margin-bottom: 24px; }
.record-fields { width: 100%; border-collapse: collapse; }
.record-fields th { text-align: left; padding: 8px 12px; background: #f5f5f5; width: 160px; vertical-align: top; border: 1px solid var(--border); font-size: 0.9em; }
.record-fields td { padding: 8px 12px; border: 1px solid var(--border); }

.record-text { white-space: pre-wrap; font-size: 0.95em; line-height: 1.7; }
.raw-text { background: #f8f8f6; padding: 16px; border-radius: 4px; font-size: 0.85em; max-height: 400px; overflow-y: auto; }

.record-nav { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.nav-prev, .nav-next { color: var(--accent); text-decoration: none; }

/* Tables */
.records-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.records-table th { text-align: left; padding: 8px; background: #f5f5f5; border-bottom: 2px solid var(--border); font-size: 0.85em; }
.records-table td { padding: 6px 8px; border-bottom: 1px solid #eee; font-size: 0.9em; }
.records-table tr:hover { background: var(--accent-light); }

/* Surname index */
.alpha-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; padding: 12px; background: white; border: 1px solid var(--border); border-radius: 6px; }
.alpha-nav a { padding: 4px 8px; text-decoration: none; font-weight: 600; }
.surname-entry { margin-bottom: 8px; }
.surname { font-weight: 600; }
.count { color: var(--muted); font-size: 0.85em; }
.surname-records { margin-left: 16px; }
.surname-records a { display: block; font-size: 0.9em; color: var(--accent); text-decoration: none; padding: 2px 0; }
.surname-records a:hover { text-decoration: underline; }

/* Image list */
.image-records { list-style: none; padding: 0; }
.image-records li { padding: 4px 0; }

/* Responsive */
@media (max-width: 600px) {
    .site-nav { flex-direction: column; align-items: flex-start; }
    .record-fields th { width: 100px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
