/* ========================================
   MAP SECTION STYLING (Phase 1.2/1.3)
   ======================================== */

/* Distance markers */
.tepetl-distance-marker {
    background: #fff;
    border: none;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    text-align: center;
    line-height: 16px;
    height: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    padding: 0 3px;
}

.tepetl-distance-marker span { display: block; }

.tepetl-distance-marker .marker-pin {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 4px solid #fff;
}

/* Direction arrows */
.tepetl-direction-arrow {
    background: none !important;
    border: none !important;
    color: #444;
    font-weight: 900;
    text-shadow: 0 0 3px #fff, 0 0 3px #fff;
    line-height: 1;
}

/* Crosshair lines */
.tepetl-crosshair-v, .tepetl-crosshair-h {
    stroke: var(--tepetl-text-dark, #1a1a1a) !important;
    stroke-width: 1 !important;
    stroke-dasharray: none !important;
}

/* Map header — left group + right group */
.tepetl-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.tepetl-map-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--tepetl-text-dark);
    margin-right: 8px;
}

.tepetl-map-stats {
    display: inline-flex;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--tepetl-text-muted);
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-right: auto;
}

.tepetl-map-stats span {
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

/* Unit toggle */
.tepetl-unit-toggle {
    display: flex;
    gap: 2px;
}

.tepetl-unit-btn {
    padding: 3px 8px;
    font-size: 0.75rem;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.15s;
    color: #333;
}

.tepetl-unit-btn:hover {
    background: #555 !important;
    color: #fff !important;
}

.tepetl-unit-btn.active {
    background: #f54f4f !important;
    color: #fff !important;
    border-color: #f54f4f !important;
}

/* Fullscreen button */
.tepetl-fullscreen-btn {
    font-family: var(--font-body);
    padding: 5px 10px;
    font-size: 12px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
}

.tepetl-fullscreen-btn:hover {
    background: #555 !important;
    color: #fff !important;
}

/* Map download button */
.tepetl-map-download {
    background: #f5f5f5 !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
    color: #333 !important;
    text-decoration: none !important;
}

.tepetl-map-download:hover {
    background: #555 !important;
    color: #fff !important;
}

/* Layer select */
.tepetl-layer-select {
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
}

/* Selection close hover */
.tepetl-selection-close:hover {
    color: #666 !important;
    background: rgba(0,0,0,0.1) !important;
}

/* Map links */
.tepetl-map-section a { color: #f54f4f !important; }

/* Profile hint — moved down */
.tepetl-profile-hint {
    margin-top: 6px;
    font-size: 0.7rem;
}

/* Distance tooltip */
.tepetl-dist-tooltip {
    font-size: 11px !important;
    padding: 2px 6px !important;
    font-family: var(--font-mono) !important;
}

/* Selection boundary lines on elevation profile */
.selection-line-left,
.selection-line-right {
    stroke: #a77ce7 !important;
    stroke-width: 3 !important;
}

/* Leaflet popup for selection */
.tepetl-selection-leaflet-popup .leaflet-popup-content-wrapper {
    border-radius: 6px;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.tepetl-selection-leaflet-popup .leaflet-popup-content {
    margin: 0;
    min-width: 280px;
}

.tepetl-selection-leaflet-popup .leaflet-popup-tip {
    background: #fff;
}

/* Direction arrows */
.tepetl-direction-arrow {
    background: none !important;
    border: none !important;
    line-height: 0;
}

/* Related section card titles: uppercase */
.tepetl-card-title {
    text-transform: uppercase;
}

/* Related Routes cards — image fills, white title, GPX overlay */
.tepetl-card-route {
    position: relative;
    overflow: hidden;
}

.tepetl-card-route .tepetl-card-image {
    position: relative;
    transition: background 0.2s;
}

.tepetl-card-route .tepetl-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
}

.tepetl-card-route .tepetl-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent;
    padding: 8px 12px;
}

.tepetl-card-route .tepetl-card-title a {
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    transition: color 0.2s;
}

/* Hover: white overlay on entire card image area */
.tepetl-card-route:hover .tepetl-card-image::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.69);
    pointer-events: none;
}

.tepetl-card-route:hover .tepetl-card-title a {
    color: #333 !important;
    text-shadow: none;
}

.tepetl-card-route:hover svg path {
    stroke: #333;
}

/* Related Segments cards */
.tepetl-card-segment .tepetl-card-content {
    transition: background 0.2s;
}

.tepetl-card-segment:hover .tepetl-card-content {
    background: #333;
}

.tepetl-card-segment:hover .tepetl-card-title a {
    color: #fff !important;
}

/* Stories, Events, Tours hover — dark background, white text */
.tepetl-related-group .tepetl-card:not(.tepetl-card-route):not(.tepetl-card-segment) .tepetl-card-content {
    transition: background 0.2s;
}

.tepetl-related-group .tepetl-card:not(.tepetl-card-route):not(.tepetl-card-segment):hover .tepetl-card-content {
    background: #333;
}

.tepetl-related-group .tepetl-card:not(.tepetl-card-route):not(.tepetl-card-segment):hover .tepetl-card-title a {
    color: #fff !important;
}

/* Marker toggle inherits tepetl-unit-btn styles via class */

/* Fullscreen mode — targets tepetl-map-section__inner */
.tepetl-map-section__inner:fullscreen {
    background: #1a1a1a !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
}

.tepetl-map-section__inner:fullscreen .tepetl-map-header {
    flex-shrink: 0;
    background: var(--tepetl-bg-content, #faf9f7);
}

.tepetl-map-section__inner:fullscreen .tepetl-map-container {
    flex: 1;
    width: 100% !important;
    max-width: none !important;
}

.tepetl-map-section__inner:fullscreen #tepetl-leaflet-map {
    width: 100% !important;
    height: 100% !important;
}

.tepetl-map-section__inner:fullscreen .tepetl-elevation-profile-container {
    height: 200px;
    flex-shrink: 0;
    width: 100% !important;
    background: var(--tepetl-bg-content, #faf9f7);
}

.tepetl-editorial-box-content h5 { font-size: 0.9rem; }

