/**
 * Crew Changelog V1.0.0
 * changelog.rlmotorhome.com
 * Aesthetic: Editorial Logbook — ship's log meets modern changelog
 */

:root {
    --font-display: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 10px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg: #FAF8F5;
    --bg-card: #FFFFFF;
    --bg-subtle: #F3F0EB;
    --bg-hover: #EDE9E3;
    --border: #E5DFD6;
    --border-light: #F0EBE3;
    --text: #2C2418;
    --text-secondary: #6B5E4F;
    --text-muted: #9B8E7E;
    --accent: #E67E22;
    --accent-soft: rgba(230, 126, 34, 0.08);
    --accent-glow: rgba(230, 126, 34, 0.15);
    --timeline-line: #E5DFD6;
    --timeline-dot: #E67E22;
}

[data-theme="dark"] {
    --bg: #141210;
    --bg-card: #1C1A17;
    --bg-subtle: #242019;
    --bg-hover: #2C2820;
    --border: #3A352C;
    --border-light: #2E2A23;
    --text: #F0EAE0;
    --text-secondary: #B0A698;
    --text-muted: #7A7068;
    --accent: #F0963C;
    --accent-soft: rgba(240, 150, 60, 0.1);
    --accent-glow: rgba(240, 150, 60, 0.15);
    --timeline-line: #3A352C;
    --timeline-dot: #F0963C;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.7; min-height: 100vh; -webkit-font-smoothing: antialiased; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== Header ===== */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.site-brand-icon {
    font-size: 2rem;
}

.site-brand h1 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
}

.site-brand span {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: -2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    font-size: 14px;
}

.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

.crew-link {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all var(--transition);
}

.crew-link:hover { color: var(--accent); background: var(--accent-soft); }

/* ===== Hero ===== */
.hero {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 24px 32px;
    text-align: center;
}

.hero h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.hero p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 500px;
    margin: 0 auto 24px;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-num {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== Filters ===== */
.filters {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px 24px;
}

.filters-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 32px 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237A7068' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color var(--transition);
    flex: 1;
    min-width: 0;
    max-width: 260px;
}

.filter-select:focus { outline: none; border-color: var(--accent); }

.filter-clear {
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.filter-clear:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Timeline ===== */
.timeline-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--timeline-line);
}

/* Date separator */
.timeline-date {
    position: relative;
    margin: 32px 0 16px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.timeline-date::before {
    content: '';
    position: absolute;
    left: -33px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--timeline-dot);
    box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--timeline-line);
}

.timeline-date:first-child { margin-top: 0; }

/* Entry card */
.entry-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    transition: all var(--transition);
    animation: entryIn 0.4s ease-out both;
}

.entry-card::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 24px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    box-shadow: 0 0 0 3px var(--bg);
    transition: background var(--transition);
}

.entry-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.entry-card:hover::before {
    background: var(--accent);
}

@keyframes entryIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.entry-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.entry-project-row {
    margin-bottom: 10px;
}

.entry-crew {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.entry-crew-emoji { font-size: 1.1rem; }

.entry-project {
    font-size: 0.72rem;
    padding: 2px 10px;
    border-radius: 4px;
    border: 1px solid;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.entry-time {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.entry-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.4;
}

.entry-content {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-line;
}

/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .emoji { font-size: 3rem; margin-bottom: 16px; display: block; }
.empty-state p { font-size: 0.95rem; }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.page-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-body);
}

.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ===== Loading ===== */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.spinner { width: 24px; height: 24px; border: 2px solid transparent; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .hero h2 { font-size: 1.5rem; }
    .stats-row { gap: 20px; }
    .stat-num { font-size: 1.4rem; }
    .timeline { padding-left: 30px; }
    .timeline::before { left: 10px; }
    .timeline-date::before { left: -28px; }
    .entry-card::before { left: -24px; }
    .entry-card { padding: 16px; }
    .entry-time { margin-left: 0; width: 100%; }
    .header-inner { padding: 12px 16px; }
    .hero { padding: 32px 16px 24px; }
    .filters { padding: 0 16px 16px; }
    .filters-row { flex-direction: column; }
    .filter-select { max-width: none; }
    .timeline-container { padding: 0 16px 40px; }
}
