/* === CNX2UZ2CNX — Silk Road Expedition Theme ===
 * Warm earth tones inspired by the Silk Road
 * Terracotta, sand, saffron, sage, and cerulean
 */

:root {
    --bg: #f5efe6;
    --surface: #faf3eb;
    --card-bg: #fff8f0;
    --border: #e0d5c8;
    --text: #3d2c1f;
    --text-muted: #8b7560;
    --accent: #c1694f;
    --accent-dim: #a85d45;
    --accent-light: #d4816b;
    --accent-gold: #c6923d;
    --saffron: #d4a24e;
    --sage: #8a9a7a;
    --sage-light: #a8b898;
    --cerulean: #7a9bb5;
    --heading: #3d2c1f;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-light);
}

/* === Hero / Header === */
.hero {
    text-align: center;
    padding: 4rem 1rem 2rem;
    background: linear-gradient(135deg, #f5efe6 0%, #e8d5c4 50%, #f5efe6 100%);
    border-bottom: 2px solid var(--border);
    position: relative;
}

.hero.has-bg {
    background: none;
    border-bottom: none;
    padding-bottom: 3rem;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
}

.hero-bg .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(245,239,230,0.92) 0%,
        rgba(193,105,79,0.45) 40%,
        rgba(61,44,31,0.55) 70%,
        rgba(61,44,31,0.85) 100%
    );
}

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

.hero.has-bg .hero-content h1 {
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.hero.has-bg .hero-content .subtitle {
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

.hero.has-bg .hero-content .date {
    color: rgba(255,255,255,0.75);
}

.hero.has-bg .hero-content .badge {
    background: rgba(255,255,255,0.15);
    color: #fff;
    backdrop-filter: blur(4px);
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--heading);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero .subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0.5rem auto 1rem;
    line-height: 1.6;
}

.hero .sub {
    color: var(--accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* === Stats Grid === */
.stats-grid {
    max-width: 900px;
    margin: -0.8rem auto 1.5rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.stats-section {
    margin-bottom: 0.5rem;
}

.stat-box {
    background: var(--card-bg);
    padding: 1.2rem;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === Main Content === */
main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* === Cards === */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 700px) {
    .content-grid { grid-template-columns: 1fr; }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(61,44,31,0.06);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--heading);
}

.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

.btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.2rem;
    background: var(--accent);
    color: #fff8f0 !important;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--accent-dim);
    color: #fff8f0 !important;
}

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

/* === Blog / Roadbook Styles === */
article.post {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(61,44,31,0.06);
}

article.post h2 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    color: var(--heading);
}

article.post .meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

article.post p {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* === Roadbook Specific === */
.roadbook-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.roadbook-meta dt { color: var(--accent); font-weight: 600; }
.roadbook-meta dd { color: var(--text); }
.roadbook-meta dd, .roadbook-meta dt { display: inline; }
.roadbook-meta dt::after { content: ': '; }
.roadbook-meta dd::after { content: ' • '; }

/* === Roadbook Map === */
.roadbook-map {
    width: 100%;
    height: 420px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 1.5rem 0;
    overflow: hidden;
}

.map-placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem;
}

/* === Roadbook Post === */
article.post h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
    line-height: 1.3;
}

article.post .story-section h2 {
    font-size: 1.15rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-dim);
}

article.post .story-section p {
    margin-bottom: 0.8rem;
    line-height: 1.8;
}

/* === Fact Box === */
.fact-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    margin: 1.5rem 0;
}

.fact-box .fact {
    text-align: center;
    padding: 0.5rem;
}

.fact-box .fact-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.fact-box .fact-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--heading);
}

.fact-box .fact-value.gold { color: var(--accent-gold); }

/* === Nav Links === */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1.5rem 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.nav-link:hover {
    border-color: var(--accent);
    background: var(--surface);
    color: var(--accent);
}

/* === Timeline === */
.timeline {
    border-left: 2px solid var(--accent-gold);
    margin: 1.5rem 0;
    padding-left: 1rem;
}

.timeline-item {
    margin-bottom: 1rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.35rem;
    top: 0.4rem;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg);
}

.timeline-time {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
}

.timeline-activity {
    font-size: 0.9rem;
    color: var(--text);
    margin-top: 0.1rem;
}

.tomorrow-preview {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-gold);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.tomorrow-preview strong {
    color: var(--accent);
}

/* === Weather Box === */
.weather-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

.weather-col {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
    text-align: center;
}

.weather-col .time-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.weather-col .loc-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 0.15rem;
}

.weather-col .condition {
    display: block;
    font-size: 0.8rem;
    color: var(--text);
}

.weather-col .temp {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 0.1rem;
}

.weather-col .wind {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

@media (max-width: 500px) {
    .weather-box { grid-template-columns: 1fr; }
}

/* === Badge === */
.badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    background: var(--sage-light);
    color: #3d2c1f;
    border-radius: 4px;
    margin: 0.1rem;
}

/* === Day Separator === */
.day-separator {
    text-align: center;
    margin: 2.5rem 0 1.5rem;
    position: relative;
}

.day-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.day-separator span {
    position: relative;
    background: var(--bg);
    padding: 0 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

/* === Day Summary (Evening Post) === */
.day-summary-container {
    background: linear-gradient(135deg, var(--surface) 0%, var(--card-bg) 100%);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-gold);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.day-summary-container .summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.day-summary-container .summary-emoji {
    font-size: 1.5rem;
}

.day-summary-container .summary-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading);
}

.day-summary-container .summary-text {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* === OwnTracks Route Map (evening) === */
.actual-route-map {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 1.5rem 0;
    overflow: hidden;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 0.5rem 0 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.map-legend span::before {
    content: '● ';
    font-size: 0.7rem;
}

.map-legend .planned::before { color: var(--accent-gold); }
.map-legend .actual::before { color: var(--accent); }
.map-legend .stops::before { color: var(--sage); }
.map-legend .photos::before { color: var(--cerulean); }