/* ========================================
   RunRoute — Recent Routes Widget
   ========================================
   [runroute_recent]                     → vertical (sidebar)
   [runroute_recent layout="horizontal"] → horizontal (between articles)
   ======================================== */

/* --- Base --- */
.rrw {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #1d1d1f;
}

/* --- Header --- */
.rrw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.rrw-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #1d1d1f;
}

.rrw-title i {
    margin-right: 6px;
    color: #e63946;
}

.rrw-cta {
    font-size: 0.78rem;
    font-weight: 600;
    color: #007AFF;
    text-decoration: none;
    white-space: nowrap;
}

.rrw-cta:hover {
    text-decoration: underline;
}

/* --- Card base --- */
.rrw-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(60, 60, 67, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rrw-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* --- Mini-map thumbnail --- */
.rrw-map-thumb {
    width: 100%;
    background: #f2f2f7;
    position: relative;
}

/* Hide Leaflet attribution in mini-maps */
.rrw-map-thumb .leaflet-control-attribution {
    display: none !important;
}

/* --- Card info --- */
.rrw-info {
    padding: 12px 14px;
}

.rrw-route-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.rrw-route-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.75rem;
    color: #6e6e73;
    margin-bottom: 4px;
}

.rrw-route-meta i {
    margin-right: 3px;
    font-size: 0.7rem;
}

.rrw-route-author {
    font-size: 0.7rem;
    color: #aeaeb2;
}

/* --- Empty state --- */
.rrw-empty {
    text-align: center;
    padding: 24px 16px;
    color: #6e6e73;
    font-size: 0.88rem;
    background: #f2f2f7;
    border-radius: 12px;
}

/* ========================================
   VERTICAL LAYOUT (sidebar)
   ======================================== */
.rrw-vertical .rrw-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rrw-vertical .rrw-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.rrw-vertical .rrw-map-thumb {
    width: 100px;
    min-width: 100px;
    height: 80px;
    flex-shrink: 0;
}

.rrw-vertical .rrw-info {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rrw-vertical .rrw-route-name {
    font-size: 0.82rem;
}

.rrw-vertical .rrw-route-meta {
    gap: 8px;
    font-size: 0.72rem;
}

.rrw-vertical .rrw-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* ========================================
   HORIZONTAL LAYOUT (between articles)
   ======================================== */
.rrw-horizontal .rrw-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.rrw-horizontal .rrw-card {
    display: flex;
    flex-direction: column;
}

.rrw-horizontal .rrw-map-thumb {
    height: 140px;
}

.rrw-horizontal .rrw-info {
    padding: 12px 14px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
    .rrw-horizontal .rrw-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .rrw-horizontal .rrw-map-thumb {
        height: 100px;
    }

    .rrw-horizontal .rrw-info {
        padding: 10px;
    }

    .rrw-horizontal .rrw-route-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    .rrw-horizontal .rrw-cards {
        grid-template-columns: 1fr;
    }
}
