:root {
    --primary-color: #ffffff;
    --accent-color: #d4a574;
    --bg-color: #0a0a0a;
    --card-bg: #1a1a1a;
    --text-light: #a0a0a0;
    --border-color: #2a2a2a;
    --shadow: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.6);
    --overlay-dark: rgba(0, 0, 0, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--primary-color);
    background: var(--bg-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(26, 26, 26, 0.85);
}

.nav-container {
    max-width: none;
    margin: 0;
    padding: 1.5rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
}

.site-title {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    color: var(--primary-color);
    transition: opacity 0.3s ease;
}

.site-title:hover {
    opacity: 0.7;
}

.coffee-icon {
    font-size: 1.5rem;
}

.title-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    padding-left: 1rem;
}

.main-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
    transition: font-size 0.3s ease;
}

/* When no breadcrumb is visible, make title larger and center vertically */
.title-content.no-breadcrumb {
    justify-content: center;
    align-items: flex-start;
    height: 100%;
    min-height: 2rem;
}

.title-content.no-breadcrumb .main-title {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    height: 100%;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--text-light);
    margin: 0;
    line-height: 1;
}

.breadcrumb-nav.visible {
    opacity: 1;
    transform: translateY(0);
}

.breadcrumb-link {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: var(--accent-color);
}

.breadcrumb-separator {
    color: var(--text-light);
    opacity: 0.6;
}

/* Hide burger menu and mobile nav on desktop */
.burger-menu {
    display: none;
}

.mobile-nav {
    display: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.instagram-icon {
    width: 20px;
    height: 20px;
    display: block;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: none;
    margin: 0;
    padding: 2rem;
    width: 100%;
    position: relative;
}


/* Map */
#map {
    height: 500px;
    width: calc(100% - 60px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 0 30px 3rem 30px;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 50;
    transform-origin: top center;
    will-change: transform, width, height;
    background: #0a0a0a; /* Match site background to reduce flash */
}

/* Leaflet tile layer background */
.leaflet-tile-pane {
    background: #0a0a0a !important;
}

/* Leaflet container background */
.leaflet-container {
    background: #0a0a0a !important;
}

#map.animating {
    position: fixed;
    z-index: 100;
    margin: 0;
}

#map::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Region Sections */
.region-section {
    margin-bottom: 4rem;
}

.region-title {
    font-size: 1.75rem;
    font-weight: 300;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Coffee Grid */
.coffee-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.coffee-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    display: block;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform, box-shadow;
}

.coffee-card:hover {
    transform: translateY(-4px) translateZ(0);
    box-shadow: var(--shadow-hover);
}

.coffee-card-image {
    width: 100%;
    height: 375px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.coffee-card-content {
    padding: 2.25rem;
}

.coffee-card-title {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.coffee-card-description {
    color: var(--text-light);
    font-size: 1.1rem;
    margin: 0.75rem 0;
    line-height: 1.5;
    opacity: 0.9;
}

.coffee-card-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-light);
    font-size: 1rem;
    margin-top: 1rem;
}

.coffee-card-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.coffee-card-location {
    color: var(--text-light);
    opacity: 0.8;
    font-size: 0.9rem;
}


.coffee-card-date {
    font-weight: 500;
    color: var(--text-light);
}

.coffee-card-rating {
    font-size: 0.9rem;
    color: var(--primary-color);
}

/* Post Page */
.coffee-post {
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
    margin-bottom: 2rem;
}

.back-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-block;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--accent-color);
}

.post-title {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.post-meta {
    display: flex;
    gap: 2rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.post-image {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.post-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Hero Image */
.post-hero-image {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.post-hero-image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 600px;
    object-fit: cover;
}

/* Image gallery for multiple photos */
.post-images-gallery {
    margin: 3rem 0;
}

.post-images-gallery h3 {
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-image {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.gallery-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-image:hover img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-image img {
        height: 300px;
    }
    
    .post-hero-image img {
        max-height: 400px;
    }
}

.post-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--primary-color);
    margin: 2rem 0;
}

.post-description p {
    margin: 0;
}

.instagram-embed {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
}

.post-details {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.detail-item {
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

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

.detail-item strong {
    font-weight: 500;
    min-width: 100px;
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cafe name specific styling */
.detail-item.cafe-name {
    margin-bottom: 1.5rem;
}

.detail-item.cafe-name strong {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: none;
    letter-spacing: normal;
    min-width: unset;
    display: block;
}

.rating {
    filter: sepia(1) saturate(2) hue-rotate(25deg);
    letter-spacing: 2px;
}

.notes p {
    margin-top: 0.5rem;
    line-height: 1.8;
    color: var(--primary-color);
}

#post-map {
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
}

#post-map::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Leaflet popup styling for dark mode */
.leaflet-popup-content-wrapper {
    background: var(--card-bg);
    color: var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.6);
}

.leaflet-popup-tip {
    background: var(--card-bg);
}

.leaflet-popup-close-button {
    color: var(--text-light) !important;
}

.leaflet-popup-close-button:hover {
    color: var(--primary-color) !important;
}

/* Hide zoom controls on mobile */
@media (max-width: 768px) {
    .leaflet-control-zoom {
        display: none !important;
    }
}

/* Footer */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 4rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.loading:after {
    content: '☕';
    display: inline-block;
    animation: spin 2s linear infinite;
    font-size: 2rem;
    margin-top: 1rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    /* Disable body scroll on mobile */
    body.mobile-scroll-disabled {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
        touch-action: none;
    }
    
    .site-header {
        background: rgba(26, 26, 26, 0.75);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
    
    .nav-container {
        padding: 1rem;
        position: relative;
    }
    
    .site-title {
        font-size: 1.1rem;
    }
    
    /* Smaller title font when no breadcrumbs */
    .title-content.no-breadcrumb .main-title {
        font-size: 1.1rem !important;
    }
    
    /* Hide regular nav links on mobile */
    .nav-links {
        display: none;
    }
    
    /* Burger menu */
    .burger-menu {
        display: block;
        background: none;
        border: none;
        color: var(--primary-color);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }
    
    .mobile-nav {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background: var(--card-bg);
        border-left: 1px solid var(--border-color);
        padding: 2rem 1.5rem;
        transition: right 0.3s ease;
        z-index: 1001;
        flex-direction: column;
        gap: 2rem;
    }
    
    .mobile-nav.open {
        right: 0;
    }
    
    .mobile-nav a {
        color: var(--primary-color);
        text-decoration: none;
        font-size: 1.2rem;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .mobile-nav .close-btn {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        color: var(--primary-color);
        font-size: 1.5rem;
        cursor: pointer;
    }
    
    .main-content {
        padding: 0;
        width: 100%;
    }
    
    /* Full-bleed feed, remove all borders on mobile */
    .content-wrapper {
        margin: 0;
        padding: 0;
    }
    
    .posts-content {
        margin: 0;
        padding: 0;
    }
    
    .continent-section,
    .country-section,
    .city-section {
        border: none;
        padding: 1.5rem;
        margin: 0;
        background: var(--bg-color);
    }
    
    .continent-title,
    .country-title,
    .city-title {
        border: none;
        padding: 0.5rem 0;
    }
    
    .coffee-card {
        border: none;
        box-shadow: none;
        border-radius: 0;
        margin: 0;
    }
    
    .coffee-card-content {
        padding: 1.5rem;
    }
    
    .coffee-card-image {
        border-radius: 0;
    }
    
    #map {
        height: 300px;
        margin: 0;
        border-radius: 0;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background: rgba(10, 10, 10, 0.85);
    }
    
    #map.animating {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background: rgba(10, 10, 10, 0.85);
    }
    
    .coffee-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .detail-item {
        flex-direction: column;
    }
}