/* ========================================
   RunRoute — Single Route Page (Public)
   ========================================
   Rendered by single-rute.php within the
   Astra theme's get_header / get_footer.
   ======================================== */

/* --- Theme resets (prevent Astra interference) --- */
.runroute-single,
.runroute-single *,
.runroute-single *::before,
.runroute-single *::after {
    box-sizing: border-box;
}

.runroute-single a {
    text-decoration: none;
    color: inherit;
}

/* --- Container --- */
.runroute-single {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 16px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #1d1d1f;
}

/* --- Map hero --- */
.rr-map-hero {
    margin: 0 -16px 0;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.rr-map {
    width: 100%;
    height: 400px;
}

/* Map markers */
.rr-marker-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.rr-marker-dot.start {
    background: #34C759;
}

.rr-marker-dot.end {
    background: #e63946;
}

/* --- Header --- */
.rr-header {
    padding: 28px 0 0;
}

.rr-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 8px;
    line-height: 1.25;
}

.rr-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: #6e6e73;
}

.rr-meta i {
    margin-right: 4px;
    color: #aeaeb2;
}

/* --- Stats --- */
.rr-stats {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.rr-stat {
    background: #f2f2f7;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid rgba(60, 60, 67, 0.08);
}

.rr-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 0.85rem;
    color: #fff;
}

.rr-stat-icon.dist { background: #007AFF; }
.rr-stat-icon.gain { background: #34C759; }
.rr-stat-icon.loss { background: #FF6B35; }

.rr-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 2px;
}

.rr-stat-label {
    font-size: 0.75rem;
    color: #6e6e73;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* --- Elevation chart --- */
.rr-elevation {
    margin: 28px 0;
    background: #f2f2f7;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(60, 60, 67, 0.08);
}

.rr-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 14px;
}

.rr-section-title i {
    margin-right: 6px;
    color: #6e6e73;
}

.rr-elevation canvas {
    width: 100%;
    border-radius: 8px;
}

/* --- Actions --- */
.rr-actions {
    display: flex;
    gap: 12px;
    margin: 24px 0;
}

.rr-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.rr-btn i {
    font-size: 0.85rem;
}

.rr-btn-primary {
    background: #e63946;
    color: #fff;
}

.rr-btn-primary:hover {
    background: #d32f3f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.rr-btn-secondary {
    background: #f2f2f7;
    color: #1d1d1f;
    border: 1px solid rgba(60, 60, 67, 0.12);
}

.rr-btn-secondary:hover {
    background: #e5e5ea;
}

/* --- Share panel --- */
.rr-share-panel {
    background: #f2f2f7;
    border-radius: 12px;
    padding: 20px;
    margin: 0 0 24px;
    border: 1px solid rgba(60, 60, 67, 0.08);
}

.rr-share-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.rr-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s ease;
}

.rr-share-btn.facebook {
    background: #1877F2;
    color: #fff;
}

.rr-share-btn.facebook:hover {
    background: #0d65d9;
}

.rr-share-btn.copy {
    background: #fff;
    color: #1d1d1f;
    border: 1px solid rgba(60, 60, 67, 0.12);
}

.rr-share-btn.copy:hover {
    background: #e5e5ea;
}

.rr-share-url {
    position: relative;
}

.rr-share-url input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(60, 60, 67, 0.12);
    border-radius: 8px;
    background: #fff;
    color: #6e6e73;
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
}

.rr-share-url input:focus {
    border-color: #007AFF;
}

/* --- Back link --- */
.rr-back {
    padding: 20px 0;
    border-top: 1px solid rgba(60, 60, 67, 0.08);
    margin-top: 8px;
}

.rr-back a {
    color: #007AFF;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
}

.rr-back a:hover {
    text-decoration: underline;
}

.rr-back a i {
    margin-right: 4px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
    .rr-map {
        height: 280px;
    }

    .rr-title {
        font-size: 1.35rem;
    }

    .rr-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .rr-stat {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
        padding: 12px 16px;
    }

    .rr-stat-icon {
        margin: 0;
        flex-shrink: 0;
    }

    .rr-stat-value {
        font-size: 1rem;
        margin-bottom: 0;
    }

    .rr-stat-label {
        font-size: 0.7rem;
    }

    .rr-actions {
        flex-direction: column;
    }

    .rr-btn {
        justify-content: center;
        width: 100%;
    }

    .rr-share-buttons {
        flex-direction: column;
    }

    .rr-share-btn {
        justify-content: center;
    }
}
