/* ========================================
   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;
}

/* ========================================
   CONTRIBUTOR BADGE - Redesigned Layout
   Circular photo, name below, NO bounding boxes
   ======================================== */

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

/* 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 Badge Container - NO background */
.tepetl-contributor-badge {
    position: relative;
    width: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    padding: 0;
    text-align: center;
    z-index: 2;
}

/* Outer decorative ring - centered on photo */
.tepetl-contributor-badge::before {
    content: '';
    position: absolute;
    top: 10px; /* Aligned with photo center */
    left: 50%;
    transform: translateX(-50%);
    width: 152px; /* Photo 140px + 6px border spacing each side */
    height: 152px;
    border: 2px solid var(--tepetl-primary);
    border-radius: 50%;
    opacity: 0.3;
}

/* Inner decorative ring - matches photo */
.tepetl-contributor-badge::after {
    content: '';
    position: absolute;
    top: 15px; /* 5px inside outer ring */
    left: 50%;
    transform: translateX(-50%);
    width: 142px;
    height: 142px;
    border: 1px dashed var(--tepetl-primary);
    border-radius: 50%;
    opacity: 0.35;
}

/* "PUBLISHED BY" title - positioned ABOVE everything, transparent background */
.tepetl-contributor-badge-title {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--tepetl-primary);
    background: transparent; /* No background */
    padding: 2px 8px;
    z-index: 5;
    white-space: nowrap;
}

/* Circular Photo Frame - centered */
.tepetl-contributor-badge .tepetl-contributor-photo {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid transparent; /* Transparent border */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    z-index: 3;
    margin-top: 15px; /* Creates space for rings to align */
    flex-shrink: 0;
}

.tepetl-contributor-badge .tepetl-contributor-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center; /* Center the image within the circle */
}

/* NAME - CAPITALS, no bounding box, below photo with more spacing */
.tepetl-contributor-badge .tepetl-contributor-name {
    position: relative;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tepetl-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
    margin-top: var(--space-md); /* More spacing below photo to avoid overlap */
    padding: 0;
    background: transparent;
    border: none;
    z-index: 5;
}

/* Info section - NO bounding box, transparent */
.tepetl-contributor-badge .tepetl-contributor-info {
    position: relative;
    width: auto;
    background: transparent;
    border: none;
    padding: var(--space-xs) 0;
    text-align: center;
    z-index: 5;
    margin-top: var(--space-xs);
}

/* Role/Type */
.tepetl-contributor-badge .tepetl-contributor-type {
    font-size: 0.65rem;
    color: var(--tepetl-text-muted);
    line-height: 1.3;
    margin-bottom: 2px;
}

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

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

/* View Contributor Link - ONLY on hover */
.tepetl-contributor-badge .tepetl-contributor-link {
    display: block;
    margin-top: var(--space-xs);
    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.65rem;
    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: transparent; /* No bounding box */
    border-radius: 0;
    box-shadow: none;
}

.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;
}

/* Show "SUBMITTED BY" on mobile */
.tepetl-contributor-badge-mobile .tepetl-contributor-badge-title {
    display: block;
    position: static;
    transform: none;
    font-size: 0.5rem;
    background: transparent;
    padding: 0;
    margin-bottom: var(--space-xs);
}

.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; /* No bounding box */
    border: none;
    padding: 0;
    text-align: left;
}

/* NAME in CAPITALS on mobile */
.tepetl-contributor-badge-mobile .tepetl-contributor-name {
    font-size: 1rem;
    text-transform: uppercase;
    background: transparent;
    border: none;
    padding: 0;
}

.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);
    border-top: none;
    padding-top: 0;
}

/* ========================================
   PHASE 2.1.2: CONTRIBUTOR IDENTITY RESPONSIVE
   ======================================== */

/* Desktop/Wide: Show expanded rail beside stats grid */
@media (min-width: 1024px) {
    /* Section 3 with rail: flex row layout */
    .tepetl-stats-inner--with-rail {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 32px;
        max-width: var(--tepetl-content-main);
        margin: 0 auto;
    }
    
    .tepetl-stats-inner--with-rail .tepetl-stats-grid {
        flex: 1;
        min-width: 0;
    }
    
    /* Section 3 minimal (no rail): centered layout */
    .tepetl-stats-inner--minimal {
        width: 100%;
        max-width: var(--tepetl-content-main);
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
        min-height: 340px;
    }

    .tepetl-stats-inner--minimal .tepetl-stats-grid {
        width: 100%;
        max-width: 776px;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Hide bridge card on wide screens */
    .tepetl-contributor-bridge-container {
        display: none;
    }
}

/* Tablet/Narrow: Hide rail, show bridge card */
@media (max-width: 1023px) {
    /* Hide the expanded rail */
    .tepetl-contributor-rail-slot {
        display: none;
    }
    
    /* Show bridge card */
    .tepetl-contributor-bridge-container {
        display: block;
    }
}

/* Mobile: Adjust stats grid spacing */
@media (max-width: 768px) {
    .tepetl-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 28px;
        row-gap: 20px;
        padding: 0 var(--space-md);
        width: 100%;
    }

    .tepetl-stat {
        gap: var(--space-sm);
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .tepetl-stats-inner {
        padding-left: var(--space-sm);
        padding-right: var(--space-sm);
    }
    
    .tepetl-stats-inner--minimal {
        padding-left: var(--space-sm);
        padding-right: var(--space-sm);
    }
    
    .tepetl-stats-grid {
        column-gap: 20px;
        row-gap: 18px;
        padding: 0;
    }
    
    .tepetl-stats-inner--minimal .tepetl-stats-grid {
        column-gap: 20px;
        row-gap: 18px;
        padding: 0;
    }
}


/* ========================================
   DIFFICULTY WRAPPER ACTIVE HEIGHT MODEL
   ======================================== */

/* Desktop rail: active height control */
@media (min-width: 1024px) {
    .tepetl-difficulty-wrapper.active,
    .tepetl-stat-difficulty:hover ~ .tepetl-difficulty-wrapper {
        height: 77px;
        opacity: 1;
    }
}

/* Bridge / tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .tepetl-difficulty-wrapper.active,
    .tepetl-stat-difficulty:hover ~ .tepetl-difficulty-wrapper {
        height: 77px;
        opacity: 1;
    }

    .tepetl-stats-inner--with-rail {
        max-width: 776px;
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
    }

    .tepetl-stats-inner--with-rail .tepetl-stats-grid {
        width: 100%;
        max-width: 776px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .tepetl-stats-inner--minimal {
        display: flex;
        flex-direction: row;
        align-items: center;
        max-width: 776px;
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
    }

    .tepetl-stats-inner--minimal .tepetl-stats-grid {
        width: 100%;
        max-width: 776px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Mobile (V6 LOCKED) */
@media (max-width: 767px) {
    .tepetl-difficulty-wrapper.active {
        height: 180px;
        opacity: 1;
    }
    
    .tepetl-stats-inner {
        padding-left: var(--space-md);
        padding-right: var(--space-md);
    }
    
    .tepetl-stats-inner--minimal {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding-left: var(--space-md);
        padding-right: var(--space-md);
    }

    .tepetl-stats-inner--minimal .tepetl-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 28px;
        row-gap: 20px;
        padding: 0;
        width: 100%;
    }
}

/* ========================================
   DIFFICULTY PANEL OFFSET RESET
   ======================================== */

/* Bridge / standard non-rail: panel sits closer to stats grid */
@media (min-width: 768px) and (max-width: 1023px) {
    #difficulty-breakdown,
    .tepetl-difficulty-footer {
        top: -44px;
        width: 769px;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    #difficulty-breakdown {
        margin-top: 0;
    }
}

/* Smallest/mobile only: extra breathing room belongs here only */
@media (max-width: 767px) {
    #difficulty-breakdown,
    .tepetl-difficulty-footer {
        top: 0;
        width: 776px;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    #difficulty-breakdown {
        margin-top: 11px;
    }
}


/* Mobile adjustments for bridge and minimal cards */
@media (max-width: 640px) {
    /* Bridge card stays in grid layout - photo stays left */
    .tepetl-contributor-bridge {
        grid-template-columns: 72px 1fr;
        column-gap: 12px;
    }
    
    .tepetl-contributor-bridge-photo {
        width: 72px;
        height: 72px;
    }
    
    /* Minimal card header stays in grid */
    .tepetl-contributor-minimal-header {
        grid-template-columns: 72px 1fr;
        column-gap: 10px;
    }
    
    .tepetl-contributor-minimal-photo {
        width: 72px;
        height: 72px;
    }
    
    /* Stack quote and minimal card on mobile */
    .tepetl-quote-section--with-minimal .tepetl-quote-inner,
    .tepetl-quote-inner--with-minimal {
        flex-direction: column;
    }
    
    .tepetl-quote-section--with-minimal .tepetl-quote,
    .tepetl-quote-inner--with-minimal .tepetl-quote {
        max-width: 100%;
    }
    
    .tepetl-contributor-minimal {
        margin-top: var(--space-lg);
        width: 100%;
        max-width: 100%;
    }
}

/* === 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);
    }
}

/* ----------------------------------------
   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
   Outside (infinite): dark background
   ---------------------------------------- */
.tepetl-detailed-info-section {
    background: var(--tepetl-bg-infinite); /* DARK outside 1500px */
    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 PHASE 2.1 — BREADCRUMB FIX
   ================================================ */

/* Remove italic from breadcrumb icon (✺) */
.tepetl-breadcrumb-icon {
    font-style: normal !important;
}

/* ================================================
   TEPETL PHASE 2.1 — LANGUAGE SWITCHER
   ================================================ */

/* Language Switcher in Breadcrumb Bar */
.tepetl-breadcrumb-lang-switcher {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    max-height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    z-index: 10;
}

/* Larger size when two rows present */
.tepetl-breadcrumb-lang-switcher.two-row {
    gap: 6px;
    padding: 6px 12px;
    max-height: none;
    font-size: 0.75rem;
}

.tepetl-breadcrumb-lang-switcher:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.7);
    color: white;
}

/* Align to content max width on large screens */
@media (min-width: 1540px) {
    .tepetl-breadcrumb-lang-switcher {
        right: calc((100vw - var(--tepetl-content-max, 1500px)) / 2 + 10px);
    }
}

@media (max-width: 768px) {
    .tepetl-breadcrumb-lang-switcher {
        right: 15px;
        padding: 4px 8px;
        font-size: 0.65rem;
        gap: 3px;
    }
    
    .tepetl-breadcrumb-lang-switcher.two-row {
        padding: 5px 10px;
        font-size: 0.7rem;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .tepetl-breadcrumb-lang-switcher {
        right: 10px;
        padding: 3px 6px;
        font-size: 0.6rem;
    }
    
    .tepetl-breadcrumb-lang-switcher.two-row {
        padding: 4px 8px;
        font-size: 0.65rem;
    }
}

/* ========================================
   PHASE 2.1.2 V7.1: CONTRIBUTOR IDENTITY FIXES
   ======================================== */

/* Contributor Bridge CTA - inline-block, text-width only */
.tepetl-contributor-bridge-contributions {
    cursor: pointer;
    text-decoration: none;
}

/* Guide Badge Priority - order: -1 */
.tepetl-guide-badge {
    order: -1;
    font-weight: 600;
}

