/* ========================================
   GOOGLE FONTS IMPORT - MUST BE FIRST LINE!
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;500;600;700;800&family=Boldonse&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Jost:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&family=Staatliches&display=swap');

/**
 * TEPETL DESIGN SYSTEM v3.4
 * 
 * Width System:
 * - 100% dark background (#121212) - INFINITE
 * - 1500px light content container
 * - 1000px main content alignment
 * - 800px body text
 */

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
:root {
    /* Width System */
    --tepetl-content-max: 1500px;
    --tepetl-content-main: 1000px;
    --tepetl-body-text: 800px;
    --tepetl-map-width: 1300px;
    
    /* Colors - Dark Theme (INFINITE BACKGROUND) */
    --tepetl-bg-infinite: #121212;
    --tepetl-bg-darker: #0a0a0a;
    --tepetl-bg-gallery: #1a1a1a;
    
    /* Colors - Light Theme (Content) */
    --tepetl-bg-content: #faf9f7;
    --tepetl-bg-paper: #ffffff;
    --tepetl-bg-stats-header: #f0efed;
    --tepetl-bg-tabs: #f0efed;
    --tepetl-bg-map: #e8e4de;
    --tepetl-bg-tabs-content: #E3E3E3;
    
    /* Colors - Accent */
    --tepetl-primary: #d97706;
    --tepetl-primary-hover: #b45309;
    --tepetl-secondary: #3f6212;
    --tepetl-coral: #e85d4c;
    --tepetl-coral-light: #f08070;
    --tepetl-gold-faded: rgba(217, 119, 6, 0.4);
    
    /* Difficulty Rating Colors */
    --difficulty-1-2: #90EE90;   /* Very Light Green */
    --difficulty-3: #32CD32;     /* Medium Green */
    --difficulty-4-5: #4169E1;   /* Medium Blue */
    --difficulty-6: #FFD700;     /* Yellow */
    --difficulty-7: #FFA500;     /* Orange */
    --difficulty-8: #FF4500;     /* Red */
    --difficulty-9: #8B0000;     /* Dark Red */
    --difficulty-10: #000000;    /* Black */
    
    /* Colors - Text */
    --tepetl-text-dark: #1a1a1a;
    --tepetl-text-body: #374151;
    --tepetl-text-muted: #6b7280;
    --tepetl-text-light: #e5e7eb;
    
    /* Typography */
    --font-display: 'Barlow Condensed', sans-serif;
    --font-display-hero: 'Boldonse', cursive;
    --font-stat-value: 'Boldonse', cursive;
    --font-stat-label: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    
    /* Z-Index */
    --z-sticky: 100;
    --z-nav: 200;
    --z-modal: 300;
    --z-tooltip: 400;
    --z-lightbox: 500;
}

/* ========================================
   BASE STYLES
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--tepetl-bg-infinite);
}

/* CRITICAL: Infinite dark background on body */
body,
body.tepetl-route,
body.tepetl-segment,
body.tepetl-event,
body.tepetl-story,
body.tepetl-contributor,
body.tepetl-tour,
body.tepetl-profile {
    background-color: var(--tepetl-bg-infinite) !important;
    font-family: var(--font-body);
    color: var(--tepetl-text-body);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Single page wrapper */
.tepetl-single,
.tepetl-single-route,
.tepetl-single-segment,
.tepetl-single-event {
    background-color: transparent;
    font-family: var(--font-body);
    width: 100%;
}

/* ========================================
   SECTIONS WITH LIGHT BACKGROUND (1500px max)
   All content sections get light bg and center
   ======================================== */
.tepetl-hero-section,
.tepetl-stats-section,
.tepetl-visual-profile-section,
.tepetl-quote-section,
.tepetl-editorial,
.tepetl-editorial-boxes,
.tepetl-safety-section,
.tepetl-tabs-section,
.tepetl-map-section,
.tepetl-contributors-section,
.tepetl-related-section {
    max-width: var(--tepetl-content-max);
    margin-left: auto;
    margin-right: auto;
    background-color: var(--tepetl-bg-content);
}

/* Dark sections stay dark */
.tepetl-breadcrumb-bar,
.tepetl-gallery-section,
.tepetl-location-section {
    background-color: var(--tepetl-bg-darker);
}

/* ========================================
   HERO SECTION
   ======================================== */
.tepetl-hero-section {
    position: relative;
    overflow: hidden;
}

.tepetl-hero-container {
    position: relative;
}

.tepetl-hero-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 500px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    background-color: var(--tepetl-bg-darker);
}

/* Parallax ONLY on hero image */
.tepetl-hero-image img {
    width: 100%;
    height: 120%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}

/* Hero title: white text, aligned to 1000px */
/* Desktop version - overlays image */
.tepetl-hero-title-desktop {
    position: absolute;
    bottom: var(--space-2xl);
    left: 0;
    right: 0;
    padding: 0 var(--space-lg);
}

.tepetl-hero-title-desktop .tepetl-hero-title-inner {
    max-width: var(--tepetl-content-main);
    margin: 0 auto;
}

.tepetl-hero-title {
    font-family: var(--font-display-hero);
    font-weight: 400;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: white;
    margin: 0;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Mobile version - below image, separate block */
.tepetl-hero-title-mobile {
    display: none;
    background: var(--tepetl-bg-darker);
    padding: var(--space-lg);
}

.tepetl-hero-title-mobile .tepetl-hero-title {
    color: white;
    text-shadow: none;
    font-size: clamp(1.25rem, 5vw, 1.5rem);
}

/* Mobile: Show mobile title, hide desktop title */
@media (max-width: 768px) {
    .tepetl-hero-title-desktop {
        display: none;
    }
    .tepetl-hero-title-mobile {
        display: block;
    }
}

/* ========================================
   BREADCRUMB BAR - NO PARALLAX, NO TRANSFORM
   Only class toggle for hide/show
   ======================================== */
.tepetl-breadcrumb-bar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--tepetl-bg-darker);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-sm) var(--space-lg);
    /* Slide animation - translate Y for slide in/out */
    transform: translateY(0);
    transition: transform 0.3s ease-out;
}

/* Hidden state - slides UP out of view */
.tepetl-breadcrumb-bar.breadcrumb-hidden {
    transform: translateY(-100%);
    pointer-events: none;
}

.tepetl-breadcrumb-inner {
    max-width: var(--tepetl-content-main);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-xl);
    align-items: center;
}

.tepetl-breadcrumb-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.tepetl-breadcrumb-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
}

.tepetl-breadcrumb-row a {
    color: var(--tepetl-text-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.tepetl-breadcrumb-row a:hover {
    color: var(--tepetl-primary);
}

.tepetl-breadcrumb-sep {
    color: var(--tepetl-text-light);
    opacity: 0.5;
}

.tepetl-breadcrumb-land {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

@media (max-width: 768px) {
    .tepetl-breadcrumb-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }
}

/* ========================================
   STATS SECTION - OLD RULES (overridden by Phase 3.4)
   Note: See line ~493 for active styles
   ======================================== */

/* Stat Item - HORIZONTAL (icon left, content right) */
.tepetl-stat {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

/* Icon 32px */
.tepetl-stat .tepetl-stat-icon,
.tepetl-stat .tepetl-stat-icon-svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: var(--tepetl-text-muted);
    opacity: 0.7;
    font-size: 1.5rem;
    line-height: 1;
}

.tepetl-stat .tepetl-stat-icon-svg svg {
    width: 100%;
    height: 100%;
}

.tepetl-stat .tepetl-stat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Stat content stacked */
.tepetl-stat-content {
    display: flex;
    flex-direction: column;
}

.tepetl-stat-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.75rem; /* Slightly bigger */
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tepetl-text-muted);
    margin-bottom: var(--space-xs);
}

.tepetl-stat-value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.5rem; /* BIGGER */
    color: var(--tepetl-text-dark);
    text-transform: uppercase;
    line-height: 1.2;
}

.tepetl-stat-secondary {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.85rem; /* Slightly bigger */
    color: var(--tepetl-text-muted);
    margin-top: 2px;
}

/* Stats responsive */
@media (max-width: 1024px) {
    .tepetl-stats-inner {
        flex-direction: column;
    }
    .tepetl-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 100%;
    }
}

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

/* ========================================
   CONTRIBUTOR BADGE - LARGER
   ======================================== */
.tepetl-contributor-badge {
    width: 220px; /* Larger */
    flex-shrink: 0;
    text-align: center;
}

.tepetl-contributor-photo {
    width: 90px; /* Larger */
    height: 90px;
    margin: 0 auto var(--space-md);
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--tepetl-bg-content);
    background: var(--tepetl-bg-content);
}

.tepetl-contributor-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tepetl-contributor-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: var(--tepetl-bg-content);
}

.tepetl-contributor-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.tepetl-contributor-name {
    font-family: var(--font-display);
    font-size: 1.1rem; /* Larger */
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tepetl-text-dark);
}

.tepetl-contributor-type {
    font-size: 0.8rem; /* Larger */
    color: var(--tepetl-text-muted);
}

.tepetl-contributor-link {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tepetl-primary);
    text-decoration: none;
}

.tepetl-contributor-link:hover {
    text-decoration: underline;
}

/* Contributor badge responsive */
@media (max-width: 1024px) {
    .tepetl-contributor-badge {
        width: 100%;
        display: flex;
        align-items: center;
        gap: var(--space-lg);
        text-align: left;
        order: -1;
        margin-bottom: var(--space-lg);
    }
    .tepetl-contributor-photo {
        margin: 0;
        width: 72px;
        height: 72px;
        flex-shrink: 0;
    }
    .tepetl-contributor-info {
        flex: 1;
    }
}

/* ========================================
   STATS SECTION (Section 3) - Fixed Height Design
   Header: 300px | Inner: 250px max | Grid: 200px
   ======================================== */
.tepetl-stats-section {
    position: relative;
    overflow: visible;
    background: var(--tepetl-bg-stats-header);
    padding-bottom: 0;
    margin-top: 0;
}

.tepetl-stats-header {
    position: relative;
    max-width: var(--tepetl-content-max);
    margin: 0 auto;
    height: 300px;
    max-height: 300px;
    padding: var(--space-md) var(--space-lg) 0;
    overflow: visible;
}

.tepetl-stats-inner {
    position: relative;
    max-width: var(--tepetl-content-main);
    margin: 0 auto;
    display: flex;
    gap: var(--space-lg);
    align-items: center; /* CENTER vertically */
    justify-content: space-between;
    height: 250px;
    max-height: 250px;
}

/* Stats Grid - Fixed 200px height, centered in inner */
.tepetl-stats-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl) var(--space-lg); /* Increased vertical gap between rows */
    height: auto;
    align-content: center;
}

/* Individual Stat Item with Icon */
.tepetl-stat {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-sm);
}

/* ICONS - Restored! */
.tepetl-stat-icon,
.tepetl-stat-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-top: 4px;
}

.tepetl-stat-icon img,
.tepetl-stat-icon-svg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tepetl-stat-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Label: Outfit font, 10px, SemiBold 600 */
.tepetl-stat-label {
    font-family: var(--font-stat-label);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tepetl-text-muted);
    order: -1;
    line-height: 1.3;
}

/* Value: Boldonse font, 44px */
.tepetl-stat-value {
    font-family: var(--font-stat-value);
    font-size: 44px;
    font-weight: 400;
    color: var(--tepetl-text-dark);
    line-height: 1;
    white-space: nowrap;
}

.tepetl-stat-primary {
    white-space: nowrap;
}

.tepetl-stat-secondary {
    font-family: var(--font-stat-label);
    font-size: 10px;
    font-weight: 400;
    color: var(--tepetl-text-muted);
    margin-top: 2px;
}

/* ----------------------------------------
   DIFFICULTY STAT - Hover Popup (CSS-only)
   Shows breakdown on hover/tap
   ---------------------------------------- */
.tepetl-stat-difficulty {
    position: relative;
    cursor: pointer;
}

.tepetl-stat-difficulty .tepetl-stat-value {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.tepetl-stat-difficulty .tepetl-difficulty-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background: var(--tepetl-text-muted);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
    border: none;
    padding: 0;
}

.tepetl-stat-difficulty:hover .tepetl-difficulty-trigger,
.tepetl-stat-difficulty:focus-within .tepetl-difficulty-trigger {
    background: var(--tepetl-primary);
}

/* Difficulty Breakdown Popup - BELOW stats grid, same width */
.tepetl-difficulty-breakdown {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: 100%;
    max-width: var(--tepetl-content-main);
    background: var(--tepetl-bg-paper);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-top: var(--space-sm);
}

/* Show on hover or focus (tap on mobile) */
.tepetl-stat-difficulty:hover .tepetl-difficulty-breakdown,
.tepetl-stat-difficulty:focus-within .tepetl-difficulty-breakdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Mobile: tap to toggle via :focus-within */
@media (hover: none) {
    .tepetl-stat-difficulty {
        -webkit-tap-highlight-color: transparent;
    }
    .tepetl-stat-difficulty .tepetl-difficulty-trigger {
        outline: none;
    }
}

/* Breakdown Grid - Bikepacking style: horizontal with number on left */
.tepetl-difficulty-grid {
    display: flex;
    justify-content: space-between;
    gap: var(--space-lg);
    width: 100%;
}

.tepetl-difficulty-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
}

/* Colored number circle */
.tepetl-difficulty-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    font-family: var(--font-stat-value);
    font-size: 1.25rem;
    font-weight: 400;
    color: white;
    background: var(--tepetl-primary);
    border-radius: 50%;
}

/* Dynamic colors based on number value */
.tepetl-difficulty-number[data-value="1"],
.tepetl-difficulty-number[data-value="2"] { background: var(--difficulty-1-2); color: #1a1a1a; }
.tepetl-difficulty-number[data-value="3"] { background: var(--difficulty-3); color: white; }
.tepetl-difficulty-number[data-value="4"],
.tepetl-difficulty-number[data-value="5"] { background: var(--difficulty-4-5); color: white; }
.tepetl-difficulty-number[data-value="6"] { background: var(--difficulty-6); color: #1a1a1a; }
.tepetl-difficulty-number[data-value="7"] { background: var(--difficulty-7); color: white; }
.tepetl-difficulty-number[data-value="8"] { background: var(--difficulty-8); color: white; }
.tepetl-difficulty-number[data-value="9"] { background: var(--difficulty-9); color: white; }
.tepetl-difficulty-number[data-value="10"] { background: var(--difficulty-10); color: white; }

.tepetl-difficulty-item-text {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tepetl-difficulty-item-label {
    font-family: var(--font-stat-label);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--tepetl-text-muted);
    line-height: 1.2;
}

/* Value text color matches number circle */
.tepetl-difficulty-item-value {
    font-family: var(--font-stat-label);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tepetl-primary);
    margin-top: 1px;
}

.tepetl-difficulty-item[data-value="1"] .tepetl-difficulty-item-value,
.tepetl-difficulty-item[data-value="2"] .tepetl-difficulty-item-value { color: #228B22; }
.tepetl-difficulty-item[data-value="3"] .tepetl-difficulty-item-value { color: var(--difficulty-3); }
.tepetl-difficulty-item[data-value="4"] .tepetl-difficulty-item-value,
.tepetl-difficulty-item[data-value="5"] .tepetl-difficulty-item-value { color: var(--difficulty-4-5); }
.tepetl-difficulty-item[data-value="6"] .tepetl-difficulty-item-value { color: #B8860B; }
.tepetl-difficulty-item[data-value="7"] .tepetl-difficulty-item-value { color: var(--difficulty-7); }
.tepetl-difficulty-item[data-value="8"] .tepetl-difficulty-item-value { color: var(--difficulty-8); }
.tepetl-difficulty-item[data-value="9"] .tepetl-difficulty-item-value { color: var(--difficulty-9); }
.tepetl-difficulty-item[data-value="10"] .tepetl-difficulty-item-value { color: var(--difficulty-10); }

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .tepetl-stats-header {
        height: auto;
        max-height: none;
        padding-bottom: var(--space-lg);
    }
    
    .tepetl-stats-inner {
        flex-direction: column;
        height: auto;
        max-height: none;
        align-items: stretch;
    }
    
    .tepetl-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        height: auto;
    }
    
    .tepetl-stat-value {
        font-size: 32px;
    }
    
    .tepetl-difficulty-breakdown {
        left: 0;
        width: 100%;
    }
    
    .tepetl-difficulty-grid {
        flex-wrap: wrap;
    }
    
    .tepetl-difficulty-item {
        flex: 0 0 48%;
        margin-bottom: var(--space-xs);
    }
}

/* ========================================
   ELEVATION PROFILE (Section 4)
   Positioned so BOTTOM aligns with stats-header bottom
   Profile extends UPWARD into the stats section
   ======================================== */
.tepetl-visual-profile-container {
    position: absolute;
    bottom: 0; /* Bottom aligns with stats-header bottom */
    left: 0;
    right: 0;
    width: 100%;
    max-width: var(--tepetl-content-max);
    margin: 0 auto;
    height: 120px;
    pointer-events: none;
    background: transparent !important;
    z-index: 5;
}

.tepetl-visual-profile {
    width: 100%;
    height: 100%;
    background: transparent;
}

.tepetl-visual-profile svg {
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
}

.tepetl-visual-profile .profile-fill {
    fill: rgba(232, 93, 76, 0.2);
}

.tepetl-visual-profile .profile-line {
    fill: none;
    stroke: var(--tepetl-coral);
    stroke-width: 2.5;
}

/* ----------------------------------------
   CONTRIBUTOR BADGE - SECTION MOVED
   See Phase 3.4 section (~line 1785) for active styles
   ---------------------------------------- */

.tepetl-contributor-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    font-size: 1.5rem;
}

/* ========================================
   QUOTE SECTION - Closer to stats header
   ======================================== */
.tepetl-quote-section {
    position: relative;
    padding: var(--space-lg) var(--space-lg) var(--space-2xl);
    background: var(--tepetl-bg-content);
    z-index: 1;
}

.tepetl-quote-inner {
    max-width: var(--tepetl-content-main);
    margin: 0 auto;
}

.tepetl-quote {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--tepetl-text-dark);
    line-height: 1.5;
    margin: 0;
    padding-left: var(--space-lg);
    border-left: 3px solid var(--tepetl-primary);
}

/* ========================================
   EDITORIAL CONTENT
   ======================================== */
.tepetl-editorial {
    padding: var(--space-xl) var(--space-lg);
}

.tepetl-editorial-inner {
    max-width: var(--tepetl-body-text);
    margin: 0 auto;
}

.tepetl-editorial-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--tepetl-text-body);
}

.tepetl-editorial-content p {
    margin: 0 0 var(--space-lg) 0;
}

.tepetl-editorial-content h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tepetl-text-dark);
    margin: var(--space-2xl) 0 var(--space-md) 0;
}

/* ========================================
   EDITORIAL BOXES
   ======================================== */
.tepetl-editorial-boxes {
    padding: var(--space-2xl) var(--space-lg);
}

.tepetl-editorial-boxes-inner {
    max-width: var(--tepetl-content-main);
    margin: 0 auto;
}

.tepetl-editorial-boxes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
}

@media (max-width: 768px) {
    .tepetl-editorial-boxes-grid {
        grid-template-columns: 1fr;
    }
}

.tepetl-editorial-box {
    background: var(--tepetl-bg-paper);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.tepetl-editorial-box-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tepetl-text-dark);
    margin: 0 0 var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.tepetl-editorial-box-content {
    font-size: 0.95rem;
    color: var(--tepetl-text-body);
    line-height: 1.6;
}

.tepetl-editorial-box-content p {
    margin: 0 0 var(--space-sm);
}

.tepetl-editorial-box-content p:last-child {
    margin-bottom: 0;
}

/* ========================================
   SAFETY BOX
   ======================================== */
.tepetl-safety-section {
    padding: 0 var(--space-lg) var(--space-2xl);
}

.tepetl-safety-inner {
    max-width: var(--tepetl-body-text);
    margin: 0 auto;
}

.tepetl-safety-box {
    background: #fef3c7;
    border-left: 4px solid var(--tepetl-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: var(--space-lg);
}

.tepetl-safety-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 var(--space-md);
}

.tepetl-safety-content {
    color: #78350f;
    font-size: 0.95rem;
}

.tepetl-safety-content p {
    margin: 0 0 var(--space-sm);
}

/* ========================================
   GALLERY (Dark Section)
   ======================================== */
.tepetl-gallery-section {
    background: var(--tepetl-bg-gallery) !important;
    padding: var(--space-3xl) var(--space-lg);
    max-width: none !important;
    margin: 0 !important;
}

.tepetl-gallery-section__inner {
    max-width: var(--tepetl-map-width);
    margin: 0 auto;
}

.tepetl-gallery-section__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tepetl-text-light);
    margin: 0 0 var(--space-xl) 0;
    text-align: center;
}

.tepetl-gallery-swiper {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.tepetl-gallery-swiper .swiper-slide {
    aspect-ratio: 3 / 2;
    background: #0a0a0a;
    position: relative;
    cursor: pointer;
}

.tepetl-gallery-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tepetl-gallery-lightbox-btn {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 10;
}

.tepetl-gallery-swiper .swiper-slide:hover .tepetl-gallery-lightbox-btn {
    opacity: 1;
}

.tepetl-gallery-swiper .swiper-button-prev,
.tepetl-gallery-swiper .swiper-button-next {
    color: white;
    background: rgba(0, 0, 0, 0.6);
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.tepetl-gallery-swiper .swiper-button-prev::after,
.tepetl-gallery-swiper .swiper-button-next::after {
    font-size: 1rem;
    font-weight: bold;
}

.tepetl-gallery-swiper .swiper-pagination-bullet {
    background: var(--tepetl-text-light);
}

.tepetl-gallery-swiper .swiper-pagination-bullet-active {
    background: var(--tepetl-primary);
}

/* ========================================
   LIGHTBOX
   ======================================== */
.tepetl-lightbox {
    position: fixed;
    inset: 0;
    z-index: var(--z-lightbox);
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.tepetl-lightbox.active {
    display: flex;
}

.tepetl-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.tepetl-lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.tepetl-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tepetl-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tepetl-lightbox-prev { left: -70px; }
.tepetl-lightbox-next { right: -70px; }

@media (max-width: 768px) {
    .tepetl-lightbox-prev { left: 10px; }
    .tepetl-lightbox-next { right: 10px; }
}

/* ========================================
   MAP SECTION - 600px height, dynamic sizing, padding
   ======================================== */
.tepetl-map-section {
    padding: var(--space-xl) var(--space-xl) var(--space-3xl);
}

.tepetl-map-section__inner {
    max-width: var(--tepetl-map-width);
    margin: 0 auto;
    position: relative;
}

/* Map Section Title */
.tepetl-map-section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tepetl-text-dark);
    text-align: center;
    margin: 0 0 var(--space-md) 0;
}

/* Map Header Bar with Stats */
.tepetl-map-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--tepetl-bg-paper);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.tepetl-map-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--tepetl-text-dark);
    margin: 0;
}

/* Map Stats Summary (in toolbar) */
.tepetl-map-stats {
    display: flex;
    gap: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--tepetl-text-muted);
}

.tepetl-map-stat {
    padding: var(--space-xs) var(--space-sm);
    background: var(--tepetl-bg-stats-header);
    border-radius: var(--radius-sm);
}

/* Unit Toggle */
.tepetl-unit-toggle {
    display: flex;
    background: var(--tepetl-bg-stats-header);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.tepetl-unit-btn {
    padding: var(--space-xs) var(--space-md);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    background: transparent;
    color: var(--tepetl-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tepetl-unit-btn.active {
    background: var(--tepetl-primary);
    color: white;
}

/* Layer Selector */
.tepetl-layer-select {
    padding: var(--space-xs) var(--space-sm);
    font-family: var(--font-body);
    font-size: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
}

/* Download Button */
.tepetl-map-download {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--tepetl-primary);
    color: white;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.tepetl-map-download:hover {
    background: var(--tepetl-primary-hover);
    color: white;
}

/* Map Container */
.tepetl-map-container {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    overflow: hidden;
}

/* Leaflet Map - 600px with dynamic sizing */
.tepetl-leaflet-map,
#tepetl-leaflet-map {
    width: 100%;
    height: 600px !important;
    min-height: 350px;
    max-height: 75vh;
    background: #1a1a1a;
}

@media (max-width: 1024px) {
    .tepetl-leaflet-map,
    #tepetl-leaflet-map {
        height: 500px !important;
    }
}

@media (max-width: 768px) {
    .tepetl-leaflet-map,
    #tepetl-leaflet-map {
        height: 400px !important;
    }
    .tepetl-map-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .tepetl-map-stats {
        flex-wrap: wrap;
    }
}

/* Selection Popup */
.tepetl-selection-popup {
    position: absolute;
    background: var(--tepetl-bg-paper);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    overflow: hidden;
    z-index: 1000;
}

.tepetl-selection-header {
    background: var(--tepetl-primary);
    color: white;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tepetl-selection-title {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
}

.tepetl-selection-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

.tepetl-selection-close:hover {
    opacity: 1;
}

.tepetl-selection-stats {
    padding: var(--space-md);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-sm);
}

.tepetl-selection-stat {
    text-align: center;
}

.tepetl-selection-stat-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--tepetl-text-dark);
}

.tepetl-selection-stat-value.positive { color: #ef4444; }
.tepetl-selection-stat-value.negative { color: #22c55e; }

.tepetl-selection-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--tepetl-text-muted);
}

.tepetl-selection-footer {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.tepetl-zoom-out-btn {
    color: var(--tepetl-primary);
    font-size: 0.75rem;
    text-decoration: none;
    cursor: pointer;
}

.tepetl-zoom-out-btn:hover {
    text-decoration: underline;
}

/* ========================================
   ELEVATION PROFILE (D3.js)
   ======================================== */
.tepetl-elevation-profile-container {
    background: var(--tepetl-bg-paper);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: var(--space-md);
}

.tepetl-elevation-profile {
    width: 100%;
    height: 200px;
    position: relative;
    cursor: crosshair;
}

@media (max-width: 768px) {
    .tepetl-elevation-profile {
        height: 160px;
    }
}

.tepetl-elevation-profile svg {
    width: 100%;
    height: 100%;
}

.tepetl-profile-hint {
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-md);
    font-size: 0.7rem;
    color: var(--tepetl-text-muted);
    font-style: italic;
}

.tepetl-profile-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    pointer-events: none;
    z-index: var(--z-tooltip);
    white-space: nowrap;
}

.tepetl-profile-tooltip .grade-positive { color: #ef4444; }
.tepetl-profile-tooltip .grade-negative { color: #22c55e; }

.tepetl-crosshair-v,
.tepetl-crosshair-h {
    stroke: var(--tepetl-text-dark);
    stroke-width: 1;
    stroke-dasharray: 4, 3;
    pointer-events: none;
}

.tepetl-crosshair-h {
    stroke: var(--tepetl-coral);
    stroke-width: 1.5;
    stroke-dasharray: none;
    opacity: 0.6;
}

.tepetl-map-marker {
    width: 12px;
    height: 12px;
    background: var(--tepetl-coral);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ========================================
   TABS SECTION
   ======================================== */
.tepetl-tabs-section {
    padding: var(--space-2xl) var(--space-lg);
}

.tepetl-tabs-inner {
    max-width: var(--tepetl-content-max);
    margin: 0 auto;
}

.tepetl-tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    margin-bottom: var(--space-xl);
    overflow-x: auto;
}

.tepetl-tab-btn {
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tepetl-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.tepetl-tab-btn:hover {
    color: var(--tepetl-text-dark);
}

.tepetl-tab-btn.active {
    color: var(--tepetl-primary);
}

.tepetl-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--tepetl-primary);
}

.tepetl-tab-content {
    display: none;
}

.tepetl-tab-content.active {
    display: block;
}

/* ========================================
   CONTRIBUTORS SECTION (Section 17)
   Uses same circular badge style as Section 3b
   ======================================== */
.tepetl-contributors-section {
    padding: var(--space-3xl) var(--space-lg);
}

.tepetl-contributors-inner {
    max-width: var(--tepetl-content-main);
    margin: 0 auto;
}

.tepetl-contributors-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tepetl-text-dark);
    margin: 0 0 var(--space-xl);
    text-align: center;
}

/* Grid of circular badges */
.tepetl-contributors-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xl);
}

/* Badge card in grid - use same seal style */
.tepetl-contributor-card-seal {
    width: 200px;
    height: 220px;
}

.tepetl-contributor-card-seal .tepetl-contributor-badge {
    width: 190px;
    height: 190px;
}

.tepetl-contributor-card-seal .tepetl-contributor-photo {
    width: 130px;
    height: 130px;
    top: 32px;
}

/* Keep old card styles for backwards compatibility */
.tepetl-contributor-card {
    background: var(--tepetl-bg-paper);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.tepetl-contributor-card-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.tepetl-contributor-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tepetl-contributor-card-info {
    flex: 1;
}

.tepetl-contributor-card-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--tepetl-text-dark);
    margin: 0 0 var(--space-xs);
}

.tepetl-contributor-card-role {
    font-size: 0.8rem;
    color: var(--tepetl-text-muted);
    margin: 0 0 var(--space-sm);
}

.tepetl-contributor-card-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tepetl-primary);
    text-decoration: none;
}

.tepetl-contributor-card-link:hover {
    text-decoration: underline;
}

/* ========================================
   LOCATION SECTION (Section 15 - Dark Theme)
   ======================================== */
.tepetl-location-section {
    padding: 0;
    max-width: none !important;
    margin: 0 !important;
}

.tepetl-location-inner {
    max-width: var(--tepetl-body-text);
    margin: 0 auto;
}

.tepetl-location-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tepetl-text-light);
    margin: 0 0 var(--space-sm) 0;
}

.tepetl-location-subtitle {
    font-size: 1rem;
    color: var(--tepetl-text-muted);
    margin: 0 0 var(--space-2xl) 0;
}

.tepetl-location-group {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tepetl-location-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tepetl-location-header {
    margin-bottom: var(--space-md);
}

.tepetl-location-header h4 {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tepetl-text-light);
    margin: 0 0 var(--space-xs) 0;
}

.tepetl-location-subtext {
    font-size: 0.75rem;
    color: var(--tepetl-text-muted);
    margin: 0;
}

.tepetl-location-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-wrap: wrap;
}

.tepetl-location-breadcrumb a {
    color: var(--tepetl-text-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.tepetl-location-breadcrumb a:hover {
    color: var(--tepetl-primary);
}

/* ========================================
   RELATED SECTION
   ======================================== */
.tepetl-related-section {
    padding: var(--space-3xl) var(--space-lg);
}

.tepetl-related-inner {
    max-width: var(--tepetl-content-max);
    margin: 0 auto;
}

.tepetl-related-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tepetl-text-dark);
    margin: 0 0 var(--space-xl) 0;
}

.tepetl-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

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

@media (max-width: 640px) {
    .tepetl-related-grid {
        grid-template-columns: 1fr;
    }
}

.tepetl-card {
    background: var(--tepetl-bg-paper);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.tepetl-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.tepetl-card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.tepetl-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tepetl-card-content {
    padding: var(--space-md);
}

.tepetl-card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 var(--space-sm) 0;
}

.tepetl-card-title a {
    color: var(--tepetl-text-dark);
    text-decoration: none;
}

.tepetl-card-title a:hover {
    color: var(--tepetl-primary);
}

.tepetl-card-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--tepetl-text-muted);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.tepetl-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
    :root {
        --space-lg: 1rem;
        --space-xl: 1.5rem;
        --space-2xl: 2rem;
        --space-3xl: 2.5rem;
    }
}


/* ========================================
   PHASE 3.4 - NEW SECTIONS
   ======================================== */

/* ----------------------------------------
   HERO LOGO (top-right corner)
   ---------------------------------------- */
.tepetl-hero-logo {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    max-width: 120px;
    z-index: 10;
}

.tepetl-hero-logo img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

@media (max-width: 768px) {
    .tepetl-hero-logo {
        max-width: 80px;
        top: var(--space-md);
        right: var(--space-md);
    }
}

/* ----------------------------------------
   BREADCRUMB - Hide/Show Animation Fix
   ---------------------------------------- */
.tepetl-breadcrumb-bar {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tepetl-breadcrumb-bar.tepetl-breadcrumb-hidden {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

/* ----------------------------------------
   STATS SECTION - Prevent Text Wrapping
   ---------------------------------------- */
.tepetl-stat-value {
    white-space: nowrap;
}

.tepetl-stat-primary {
    white-space: nowrap;
}

/* ========================================
   CONTRIBUTOR BADGE - Creative Circular Seal Design
   Fits within 250px stats-inner height
   Option C: Stamp/Badge with circular photo frame
   Replaceable SVG/PNG ring via background-image
   ======================================== */

/* === LARGE SCREENS (>768px) === */
.tepetl-contributor-badge-area {
    flex-shrink: 0;
    width: 200px;
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    background: transparent;
    padding-top: var(--space-xs);
}

/* Route badge image - positioned top right */
.tepetl-route-badge-image {
    position: absolute;
    top: 0;
    right: -5px;
    width: 40px;
    opacity: 0.7;
    z-index: 10;
}

.tepetl-route-badge-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* The Seal/Badge Container - Smaller */
.tepetl-contributor-badge {
    position: relative;
    width: 185px;
    height: 185px;
    background: transparent;
    padding: 0;
    text-align: center;
    z-index: 2;
}

/* Decorative ring - can be replaced with custom SVG/PNG */
.tepetl-contributor-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--tepetl-primary);
    border-radius: 50%;
    opacity: 0.25;
    /* Custom ring: background-image: url('/wp-content/themes/kadence-child/images/contributor-ring.svg'); */
}

/* Inner decorative ring */
.tepetl-contributor-badge::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px dashed var(--tepetl-primary);
    border-radius: 50%;
    opacity: 0.35;
}

/* "CONTRIBUTED BY" title */
.tepetl-contributor-badge-title {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: 0.45rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--tepetl-primary);
    background: var(--tepetl-bg-stats-header);
    padding: 2px 8px;
    z-index: 5;
    white-space: nowrap;
}

/* Circular Photo Frame - 130px, positioned higher to show more */
.tepetl-contributor-badge .tepetl-contributor-photo {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--tepetl-bg-paper);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    z-index: 3;
}

.tepetl-contributor-badge .tepetl-contributor-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info section - positioned BELOW the circle, outside the badge */
.tepetl-contributor-badge .tepetl-contributor-info {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    background: var(--tepetl-bg-stats-header);
    padding: 4px 6px;
    text-align: center;
    z-index: 5;
    border-radius: var(--radius-sm);
}

/* Name */
.tepetl-contributor-badge .tepetl-contributor-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--tepetl-text-dark);
    line-height: 1.2;
    margin-bottom: 1px;
}

/* Role/Type */
.tepetl-contributor-badge .tepetl-contributor-type {
    font-size: 0.55rem;
    color: var(--tepetl-text-muted);
    line-height: 1.2;
}

/* Organization - Highlight color */
.tepetl-contributor-org {
    display: block;
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--tepetl-primary);
    text-decoration: none;
    margin-top: 1px;
}

.tepetl-contributor-org:hover {
    color: var(--tepetl-coral);
}

/* View Contributor Link - Text below Organization, shows on hover */
.tepetl-contributor-badge .tepetl-contributor-link {
    display: block;
    margin-top: 3px;
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--tepetl-text-muted);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.tepetl-contributor-badge:hover .tepetl-contributor-link {
    opacity: 1;
    color: var(--tepetl-primary);
}

/* Override text - replaces ROLE only */
.tepetl-contributor-override {
    font-size: 0.6rem;
    line-height: 1.3;
    color: var(--tepetl-text-body);
}

/* Placeholder for missing photo */
.tepetl-contributor-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    font-size: 2rem;
    color: var(--tepetl-text-muted);
}

/* === MOBILE CONTRIBUTOR SECTION === */
.tepetl-contributor-mobile-section {
    display: none;
    background: var(--tepetl-bg-content);
    padding: var(--space-lg);
}

.tepetl-contributor-mobile-inner {
    max-width: var(--tepetl-content-main);
    margin: 0 auto;
}

.tepetl-contributor-badge-mobile {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.tepetl-contributor-badge-mobile .tepetl-route-badge-image {
    position: static;
    width: 60px;
    max-width: 60px;
    flex-shrink: 0;
    opacity: 1;
}

.tepetl-contributor-badge-mobile .tepetl-contributor-badge {
    position: static;
    width: auto;
    height: auto;
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    text-align: left;
    background: transparent;
}

.tepetl-contributor-badge-mobile .tepetl-contributor-badge::before,
.tepetl-contributor-badge-mobile .tepetl-contributor-badge::after {
    display: none;
}

.tepetl-contributor-badge-mobile .tepetl-contributor-badge-title {
    display: none;
}

.tepetl-contributor-badge-mobile .tepetl-contributor-photo {
    position: static;
    transform: none;
    width: 70px;
    height: 70px;
    margin: 0;
    flex-shrink: 0;
    border-radius: 50%;
}

.tepetl-contributor-badge-mobile .tepetl-contributor-info {
    position: static;
    transform: none;
    width: auto;
    background: transparent;
    padding: 0;
    text-align: left;
}

.tepetl-contributor-badge-mobile .tepetl-contributor-name {
    font-size: 1rem;
}

.tepetl-contributor-badge-mobile .tepetl-contributor-link {
    position: static;
    transform: none;
    display: inline-block;
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: var(--tepetl-primary);
    font-size: 0.7rem;
    opacity: 1;
    margin-top: var(--space-xs);
}

/* === MOBILE SCREENS (<=768px) === */
@media (max-width: 768px) {
    .tepetl-stats-inner .tepetl-contributor-badge-area {
        display: none;
    }
    
    .tepetl-contributor-mobile-section {
        display: block;
    }
}

/* ----------------------------------------
   ROUTE DIFFICULTY SECTION (Section 7)
   ---------------------------------------- */
.tepetl-route-difficulty {
    max-width: var(--tepetl-content-max);
    margin-left: auto;
    margin-right: auto;
    background-color: var(--tepetl-bg-content);
    padding: 0 var(--space-lg) var(--space-2xl);
}

.tepetl-route-difficulty-inner {
    max-width: var(--tepetl-body-text);
    margin: 0 auto;
    background: #f3f4f6;
    border-radius: var(--radius-md);
    padding: var(--space-xl);
}

.tepetl-route-difficulty-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tepetl-text-dark);
    margin: 0 0 var(--space-md);
}

.tepetl-route-difficulty-content {
    font-size: 0.95rem;
    color: var(--tepetl-text-body);
    line-height: 1.6;
}

.tepetl-route-difficulty-content p {
    margin: 0 0 var(--space-sm);
}

.tepetl-route-difficulty-content p:last-child {
    margin-bottom: 0;
}

/* ----------------------------------------
   SAFETY SECTION - Enhanced
   ---------------------------------------- */
.tepetl-safety-item {
    margin-bottom: var(--space-md);
}

.tepetl-safety-item:last-child {
    margin-bottom: 0;
}

.tepetl-safety-additional {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(120, 53, 15, 0.2);
}

/* ----------------------------------------
   GEOGRAPHIC REGIONS SECTION (Section 11)
   11a: Geographic Features - horizontal grouped layout
   11b: Protected Areas - separate cards
   ---------------------------------------- */

/* Section 11a: Geographic Features - horizontal inline layout */
.tepetl-geographic-section.tepetl-geographic-mountains {
    max-width: var(--tepetl-content-max);
    margin-left: auto;
    margin-right: auto;
    background-color: var(--tepetl-bg-content);
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
}

.tepetl-geographic-mountains .tepetl-geographic-inner {
    max-width: var(--tepetl-content-main);
    margin: 0 auto;
}

/* Section title */
.tepetl-geographic-section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tepetl-text-dark);
    margin: 0 0 var(--space-lg) 0;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.tepetl-geographic-mountains .tepetl-geographic-items {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-md) var(--space-2xl);
    align-items: flex-start;
}

/* Each feature card in 11a - inline, compact */
.tepetl-geographic-mountains .tepetl-geographic-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    background: transparent;
    border-radius: 0;
    overflow: visible;
    padding: 0;
    flex: 0 1 auto;
    min-width: 200px;
    max-width: 350px;
}

.tepetl-geographic-mountains .tepetl-geographic-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.tepetl-geographic-mountains .tepetl-geographic-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tepetl-geographic-mountains .tepetl-geographic-content {
    flex: 1;
    padding: 0;
}

.tepetl-geographic-mountains .tepetl-geographic-type {
    display: block;
    font-size: 0.6rem;
    margin-bottom: 2px;
}

.tepetl-geographic-mountains .tepetl-geographic-name {
    font-size: 0.95rem;
    margin-bottom: 0;
    text-transform: uppercase;
}

.tepetl-geographic-mountains .tepetl-geographic-description {
    font-size: 0.8rem;
    line-height: 1.4;
    margin-top: var(--space-xs);
    color: var(--tepetl-text-muted);
    /* Limit description height */
    max-height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Section 11b: Protected Areas - separate cards */
.tepetl-geographic-section.tepetl-geographic-areas {
    max-width: var(--tepetl-content-max);
    margin-left: auto;
    margin-right: auto;
    background-color: #f0efed;
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
}

.tepetl-geographic-areas .tepetl-geographic-inner {
    max-width: var(--tepetl-content-main);
    margin: 0 auto;
}

.tepetl-geographic-areas .tepetl-geographic-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.tepetl-geographic-areas .tepetl-geographic-card {
    display: flex;
    gap: var(--space-lg);
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    padding: var(--space-md);
}

.tepetl-geographic-areas .tepetl-geographic-image {
    width: 100px;
    height: 80px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.tepetl-geographic-areas .tepetl-geographic-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tepetl-geographic-areas .tepetl-geographic-content {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tepetl-geographic-areas .tepetl-geographic-type {
    font-size: 0.6rem;
    margin-bottom: 2px;
}

.tepetl-geographic-areas .tepetl-geographic-name {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
}

.tepetl-geographic-areas .tepetl-geographic-description {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
    color: var(--tepetl-text-body);
    /* Limit description */
    max-height: 3em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Generic geographic styles (fallback) */
.tepetl-geographic-type {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tepetl-primary);
    margin-bottom: var(--space-xs);
}

.tepetl-geographic-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tepetl-text-dark);
    margin: 0 0 var(--space-sm);
    text-transform: uppercase;
}

.tepetl-geographic-name a {
    color: inherit;
    text-decoration: none;
}

.tepetl-geographic-name a:hover {
    color: var(--tepetl-primary);
}

.tepetl-geographic-description {
    font-size: 0.9rem;
    color: var(--tepetl-text-body);
    line-height: 1.6;
    margin: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .tepetl-geographic-mountains .tepetl-geographic-items {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .tepetl-geographic-mountains .tepetl-geographic-card {
        max-width: none;
        width: 100%;
    }
    
    .tepetl-geographic-areas .tepetl-geographic-card {
        flex-direction: column;
    }
    
    .tepetl-geographic-areas .tepetl-geographic-image {
        width: 100%;
        height: 150px;
    }
}

/* ----------------------------------------
   DETAILED INFO TABS (Section 14) - OLD DEFINITION REMOVED
   See Phase 3.4 section (~line 2465) for active styles
   ---------------------------------------- */

/* Tab content - no bounding box */
.tepetl-detailed-tabs-content {
    background: transparent;
    border: none;
    padding: 0;
}

.tepetl-detailed-tab-panel {
    display: none;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--tepetl-text-body);
}

.tepetl-detailed-tab-panel.active {
    display: block;
}

.tepetl-detailed-tab-panel p {
    margin: 0 0 var(--space-md);
}

.tepetl-detailed-tab-panel p:last-child {
    margin-bottom: 0;
}

.tepetl-detailed-tab-panel h3,
.tepetl-detailed-tab-panel h4 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--tepetl-text-dark);
    margin: var(--space-lg) 0 var(--space-sm);
}

.tepetl-detailed-tab-panel h3:first-child,
.tepetl-detailed-tab-panel h4:first-child {
    margin-top: 0;
}

/* Two-column layout for Features tab */
.tepetl-detailed-two-column {
    column-count: 2;
    column-gap: var(--space-2xl);
}

@media (max-width: 768px) {
    .tepetl-detailed-two-column {
        column-count: 1;
    }
    
    .tepetl-detailed-tabs-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .tepetl-detailed-tab-btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.7rem;
    }
}

.tepetl-detailed-empty {
    color: var(--tepetl-text-muted);
    font-style: italic;
}

/* ----------------------------------------
   ATTRIBUTION SECTION (Section 16)
   ---------------------------------------- */
.tepetl-attribution-section {
    max-width: var(--tepetl-content-max);
    margin-left: auto;
    margin-right: auto;
    background-color: var(--tepetl-bg-content);
    padding: var(--space-2xl) var(--space-lg);
}

.tepetl-attribution-inner {
    max-width: var(--tepetl-body-text);
    margin: 0 auto;
}

.tepetl-attribution-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--tepetl-text-dark);
    margin: 0 0 var(--space-md);
}

.tepetl-attribution-content {
    font-size: 0.95rem;
    color: var(--tepetl-text-body);
    line-height: 1.6;
}

.tepetl-attribution-content p {
    margin: 0 0 var(--space-sm);
}

/* ----------------------------------------
   CONTRIBUTORS SECTION - Enhanced (Section 17)
   ---------------------------------------- */
.tepetl-contributors-group {
    margin-bottom: var(--space-2xl);
}

.tepetl-contributors-group:last-child {
    margin-bottom: 0;
}

.tepetl-contributors-group-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tepetl-text-muted);
    margin: 0 0 var(--space-md);
}

.tepetl-contributor-card--primary {
    border-left: 3px solid var(--tepetl-primary);
}

.tepetl-contributor-card--primary .tepetl-contributor-card-photo {
    width: 80px;
    height: 80px;
}

.tepetl-contributor-card--org .tepetl-contributor-card-photo {
    border-radius: var(--radius-md);
}

/* ----------------------------------------
   VIDEO SECTION (Section 18)
   ---------------------------------------- */
.tepetl-video-section {
    background: var(--tepetl-bg-gallery);
    padding: var(--space-3xl) var(--space-lg);
    max-width: none !important;
    margin: 0 !important;
}

.tepetl-video-inner {
    max-width: var(--tepetl-map-width);
    margin: 0 auto;
}

.tepetl-video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.tepetl-video-embed iframe,
.tepetl-video-embed video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ----------------------------------------
   RELATED SECTION - Enhanced (Section 19)
   ---------------------------------------- */
.tepetl-related-group {
    margin-bottom: var(--space-3xl);
}

.tepetl-related-group:last-child {
    margin-bottom: 0;
}

/* ----------------------------------------
   RWGPS EMBED (Section 13b)
   ---------------------------------------- */
.tepetl-rwgps-section {
    padding: var(--space-3xl) var(--space-xl);
}

.tepetl-rwgps-embed {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--tepetl-bg-darker);
}

.tepetl-rwgps-embed iframe {
    display: block;
    width: 100%;
    height: 600px;
    border: none;
}

@media (max-width: 768px) {
    .tepetl-rwgps-embed iframe {
        height: 450px;
    }
}

/* ----------------------------------------
   GALLERY FULLSCREEN BUTTON
   ---------------------------------------- */
.tepetl-gallery-fullscreen {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.tepetl-gallery-fullscreen:hover {
    opacity: 1;
}

/* ----------------------------------------
   LOCATION SECTION (Section 15) 
   Dark background constrained to 1500px
   Text content narrower at 800px
   ---------------------------------------- */
.tepetl-location-section {
    background: var(--tepetl-bg-infinite);
    padding: 0;
    max-width: none !important;
    margin: 0 !important;
    display: flex;
    justify-content: center;
}

/* Inner wrapper - dark background */
.tepetl-location-wrapper {
    background: #1a1a1a;
    max-width: var(--tepetl-content-max);
    width: 100%;
    padding: var(--space-3xl) var(--space-lg);
}

.tepetl-location-inner {
    max-width: var(--tepetl-body-text);
    margin: 0 auto;
}


/* ========================================
   PHASE 3.4 FIXES
   ======================================== */

/* ----------------------------------------
   HERO LOGO - Top Right, 69x69px
   ---------------------------------------- */
.tepetl-hero-logo {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 69px;
    height: 69px;
    z-index: 10;
}

.tepetl-hero-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

@media (max-width: 768px) {
    .tepetl-hero-logo {
        width: 50px;
        height: 50px;
        top: var(--space-md);
        right: var(--space-md);
    }
}

/* ----------------------------------------
   STATS - Prevent text wrapping
   ---------------------------------------- */
.tepetl-stat-value {
    white-space: nowrap;
    font-size: 1.35rem;
}

.tepetl-stat-secondary {
    white-space: nowrap;
}

/* ----------------------------------------
   CONTRIBUTOR BADGE AREA - REMOVED DUPLICATE
   See lines ~1785 for the active definition
   ---------------------------------------- */

/* ----------------------------------------
   ROUTE DIFFICULTY SECTION (Section 7)
   Same styling as editorial boxes
   ---------------------------------------- */
.tepetl-route-difficulty {
    max-width: var(--tepetl-content-max);
    margin-left: auto;
    margin-right: auto;
    background-color: var(--tepetl-bg-content);
    padding: var(--space-xl) var(--space-lg);
}

.tepetl-route-difficulty-inner {
    max-width: var(--tepetl-body-text);
    margin: 0 auto;
    background: var(--tepetl-bg-paper);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.tepetl-route-difficulty .tepetl-section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tepetl-text-dark);
    margin: 0 0 var(--space-md);
}

.tepetl-route-difficulty-content {
    font-size: 0.95rem;
    color: var(--tepetl-text-body);
    line-height: 1.7;
}

.tepetl-route-difficulty-content h1,
.tepetl-route-difficulty-content h2,
.tepetl-route-difficulty-content h3,
.tepetl-route-difficulty-content h4,
.tepetl-route-difficulty-content h5 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--tepetl-text-dark);
    margin: var(--space-lg) 0 var(--space-sm);
}

.tepetl-route-difficulty-content h1 { font-size: 1.5rem; text-transform: uppercase; }
.tepetl-route-difficulty-content h2 { font-size: 1.25rem; text-transform: uppercase; }
.tepetl-route-difficulty-content h3 { font-size: 1.1rem; text-transform: uppercase; }
.tepetl-route-difficulty-content h4 { font-size: 1rem; }
.tepetl-route-difficulty-content h5 { font-size: 0.9rem; }

.tepetl-route-difficulty-content p {
    margin: 0 0 var(--space-md);
}

/* ----------------------------------------
   DETAILED INFO / TABBED SECTION (Section 14)
   Section: 1500px max width, #C7C7C7 background
   Tab nav: #faf9f7 background
   ---------------------------------------- */
.tepetl-detailed-info-section {
    background: var(--tepetl-bg-content); /* Page background continues */
    padding: 0;
    max-width: none;
    margin: 0;
    display: flex;
    justify-content: center;
}

.tepetl-detailed-info-wrapper {
    max-width: var(--tepetl-content-max);
    width: 100%;
    padding: 0;
    background: #C7C7C7; /* Section background within 1500px */
}

/* Tab Navigation - Background #faf9f7 */
.tepetl-detailed-tabs-nav {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping to 2 rows */
    justify-content: center;
    gap: 0;
    border-bottom: 2px solid rgba(0, 0, 0, 0.15);
    margin: 0;
    padding: var(--space-md) var(--space-lg) 0;
    width: 100%;
    background: #faf9f7; /* Requested color */
}

.tepetl-detailed-tab-btn {
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgba(0, 0, 0, 0.35);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.tepetl-detailed-tab-btn:hover {
    color: rgba(0, 0, 0, 0.6);
    background: none;
}

.tepetl-detailed-tab-btn:focus,
.tepetl-detailed-tab-btn:active {
    outline: none;
    box-shadow: none;
    background: none;
}

.tepetl-detailed-tab-btn.active {
    color: var(--tepetl-coral);
    background: none;
}

.tepetl-detailed-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--tepetl-coral);
}

/* Tab Content - 1000px width, same background as wrapper */
.tepetl-detailed-info-inner {
    max-width: var(--tepetl-content-main);
    margin: var(--space-xl) auto 0;
    padding: var(--space-lg);
    background: #C7C7C7; /* Same as wrapper */
}

.tepetl-detailed-tabs-content {
    background: transparent;
    border: none;
    padding: var(--space-lg) 0;
}

.tepetl-detailed-tab-panel {
    display: none;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--tepetl-text-body);
}

.tepetl-detailed-tab-panel.active {
    display: block;
}

.tepetl-detailed-tab-panel p {
    margin: 0 0 var(--space-md);
}

.tepetl-detailed-tab-panel p:last-child {
    margin-bottom: 0;
}

.tepetl-detailed-tab-panel h1,
.tepetl-detailed-tab-panel h2,
.tepetl-detailed-tab-panel h3,
.tepetl-detailed-tab-panel h4,
.tepetl-detailed-tab-panel h5 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--tepetl-text-dark);
    margin: var(--space-lg) 0 var(--space-sm);
}

.tepetl-detailed-tab-panel h1:first-child,
.tepetl-detailed-tab-panel h2:first-child,
.tepetl-detailed-tab-panel h3:first-child,
.tepetl-detailed-tab-panel h4:first-child {
    margin-top: 0;
}

.tepetl-detailed-tab-panel h1 { font-size: 1.5rem; text-transform: uppercase; }
.tepetl-detailed-tab-panel h2 { font-size: 1.25rem; text-transform: uppercase; }
.tepetl-detailed-tab-panel h3 { font-size: 1.1rem; text-transform: uppercase; }
.tepetl-detailed-tab-panel h4 { font-size: 1rem; }
.tepetl-detailed-tab-panel h5 { font-size: 0.9rem; }

.tepetl-detailed-two-column {
    column-count: 2;
    column-gap: var(--space-2xl);
}

@media (max-width: 768px) {
    .tepetl-detailed-two-column {
        column-count: 1;
    }
    
    .tepetl-detailed-tabs-nav {
        justify-content: flex-start;
    }
    
    .tepetl-detailed-tab-btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
    }
    
    .tepetl-detailed-info-wrapper {
        padding: var(--space-2xl) 0;
    }
}

.tepetl-detailed-empty {
    color: var(--tepetl-text-muted);
    font-style: italic;
}

/* Two-column layout for Features tab */
.tepetl-detailed-two-column {
    column-count: 2;
    column-gap: var(--space-2xl);
}

@media (max-width: 768px) {
    .tepetl-detailed-two-column {
        column-count: 1;
    }
    
    .tepetl-detailed-tabs-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }
    
    .tepetl-detailed-tab-btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.7rem;
    }
    
    .tepetl-detailed-info-wrapper,
    .tepetl-location-wrapper {
        padding: var(--space-2xl) var(--space-md);
    }
}

.tepetl-detailed-empty {
    color: var(--tepetl-text-muted);
    font-style: italic;
}

/* ----------------------------------------
   ATTRIBUTION SECTION (Section 16)
   Light grey background, body text styling
   ---------------------------------------- */
.tepetl-attribution-section {
    max-width: var(--tepetl-content-max);
    margin-left: auto;
    margin-right: auto;
    background-color: #f5f5f5;
    padding: var(--space-2xl) var(--space-lg);
}

.tepetl-attribution-inner {
    max-width: var(--tepetl-content-main);
    margin: 0 auto;
}

.tepetl-attribution-section .tepetl-section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tepetl-text-dark);
    margin: 0 0 var(--space-lg);
}

.tepetl-attribution-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--tepetl-text-body);
}

.tepetl-attribution-content p {
    margin: 0 0 var(--space-md);
}

.tepetl-attribution-content h1,
.tepetl-attribution-content h2,
.tepetl-attribution-content h3,
.tepetl-attribution-content h4,
.tepetl-attribution-content h5 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--tepetl-text-dark);
    margin: var(--space-lg) 0 var(--space-sm);
}

/* ----------------------------------------
   VIDEO SECTION (Section 18)
   ---------------------------------------- */
.tepetl-video-section {
    background: var(--tepetl-bg-gallery) !important;
    padding: var(--space-3xl) var(--space-lg);
    max-width: none !important;
    margin: 0 !important;
}

.tepetl-video-inner {
    max-width: var(--tepetl-map-width);
    margin: 0 auto;
}

.tepetl-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.tepetl-video-embed iframe,
.tepetl-video-embed video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ----------------------------------------
   RWGPS EMBED (Section 13b)
   ---------------------------------------- */
.tepetl-rwgps-section {
    padding: var(--space-3xl) var(--space-xl);
}

.tepetl-rwgps-embed {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--tepetl-bg-darker);
}

.tepetl-rwgps-embed iframe {
    display: block;
    width: 100%;
    height: 600px;
    border: none;
}

@media (max-width: 768px) {
    .tepetl-rwgps-embed iframe {
        height: 450px;
    }
}

/* ----------------------------------------
   RELATED GROUPS
   ---------------------------------------- */
.tepetl-related-group {
    margin-bottom: var(--space-3xl);
}

.tepetl-related-group:last-child {
    margin-bottom: 0;
}

/* ----------------------------------------
   SECTION TITLE - Global
   ---------------------------------------- */
.tepetl-section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tepetl-text-dark);
    margin: 0 0 var(--space-lg);
}

/* ----------------------------------------
   RICH TEXT CONTENT - Global typography
   ---------------------------------------- */
.tepetl-editorial-content h1,
.tepetl-editorial-content h2,
.tepetl-editorial-content h3,
.tepetl-editorial-content h4,
.tepetl-editorial-content h5,
.tepetl-editorial-box-content h1,
.tepetl-editorial-box-content h2,
.tepetl-editorial-box-content h3,
.tepetl-editorial-box-content h4,
.tepetl-editorial-box-content h5 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--tepetl-text-dark);
    margin: var(--space-lg) 0 var(--space-sm);
}

.tepetl-editorial-content h1:first-child,
.tepetl-editorial-content h2:first-child,
.tepetl-editorial-box-content h1:first-child,
.tepetl-editorial-box-content h2:first-child {
    margin-top: 0;
}

.tepetl-editorial-content h1,
.tepetl-editorial-box-content h1 { font-size: 1.5rem; text-transform: uppercase; }

.tepetl-editorial-content h2,
.tepetl-editorial-box-content h2 { font-size: 1.25rem; text-transform: uppercase; }

.tepetl-editorial-content h3,
.tepetl-editorial-box-content h3 { font-size: 1.1rem; text-transform: uppercase; }

.tepetl-editorial-content h4,
.tepetl-editorial-box-content h4 { font-size: 1rem; }

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

