/*
 * Styles for the Etappe & Schleife Detail Pages (Refined Classic Layout)
 */

/* --- Main Container --- */
.route-details-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 1.5rem;
    font-family: 'Roboto', sans-serif;
    /* Removed background/shadow to apply it to cards instead */
}

/* --- Header & Stats (with Icons) --- */
.route-header {
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.route-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.route-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: #4b5563;
    margin-top: 0;
    margin-bottom: 2rem;
}

.route-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem;
    min-width: 150px;
}

.stat-item i {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    color: #009540; /* Brand Green */
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

/* --- Waypoints Section (Refined Card Layout) --- */
.waypoints-container {
    display: flex;
    flex-direction: column;
    gap: 2rem; /* Space between waypoint cards */
}

.waypoint-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    padding: 2rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
}

.waypoint-image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    object-fit: cover;
}

.waypoint-description-wrapper {
    position: relative;
    padding-left: 3rem; /* Space for the number */
}

.waypoint-number {
    position: absolute;
    left: 0;
    top: -5px;
    font-size: 2.5rem;
    font-weight: 700;
    color: #009540; /* Brand Green */
    line-height: 1;
}

.waypoint-text p {
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
    margin: 0 0 1em 0;
}

.waypoint-text p:last-child {
    margin-bottom: 0;
}


/* Alternating layout for image on the right */
.waypoint-row.layout-image-right .waypoint-image-wrapper {
    grid-column: 2;
}

.waypoint-row.layout-image-right .waypoint-description-wrapper {
    grid-column: 1;
    grid-row: 1;
}


/* --- Map Section --- */
.route-map-container {
    margin: 3rem 0;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.route-map-container::before {
    content: 'Streckenkarte';
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* --- Route Navigation --- */
.route-navigation {
    display: flex;
    justify-content: space-between;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.nav-link a {
    display: block;
    padding: 1rem 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.nav-link a:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.nav-link span {
    display: block;
    font-size: 0.9rem;
    color: #6b7280;
}

.nav-link strong {
    display: block;
    font-size: 1.1rem;
    color: #1f2937;
    font-weight: 600;
}

.nav-link.next-link {
    text-align: right;
}

/* --- LAYOUT FIXES FOR MAP & PAGE BUILDER --- */
/* These are now specific to the route-details-container */

.route-details-container .e-con-inner {
    height: auto !important;
}

.route-details-container .gpxv-view {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0;
    float: none;
    border: none;
}


/* --- Responsive for Mobile --- */
@media (max-width: 767px) {
    .route-details-container {
        padding: 1rem;
    }

    .route-title {
        font-size: 2rem;
    }

    .waypoint-row,
    .waypoint-row.layout-image-right {
        grid-template-columns: 1fr; /* Stack columns on mobile */
        padding: 1.5rem;
    }

    /* On mobile, image always appears on top */
    .waypoint-row.layout-image-right .waypoint-image-wrapper,
    .waypoint-row.layout-image-right .waypoint-description-wrapper {
        grid-column: 1;
        grid-row: auto;
    }
    
    .route-navigation {
        flex-direction: column;
        gap: 1rem;
    }
}