body, html {
    height: 100%;
    background-color:  #f1f1f1;
    font-family: Georgia, 'Times New Roman', Times, serif;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scrolling on body */
}

/* Reset for images to prevent gaps */
img {
    border: 0;
    margin: 0;
    padding: 0;
}

.maparea {
    display: inline-block; /* Use inline-block instead of block */

    max-width: 100%;
    height: auto;
    border: 0;
    padding: 0;
    vertical-align: top; /* Prevent baseline alignment issues */
}

h1, h2, h3, h4, h5, h6 {
    color: #533418;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #E8E3DA;
    width: 100%;
    box-sizing: border-box; /* Ensure padding is included in width */
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-image {
    height: 60px;
    width: auto;
    max-width: 100px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: 24px;
    font-weight: bold;
    color: #533418;
    margin: 0;
}

.logo-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Ensure logo text links have no underlines and consistent color */
.logo-title a,
.logo-subtitle a {
    text-decoration: none !important;
    color: inherit;
}

.logo-title a:hover,
.logo-subtitle a:hover {
    text-decoration: none !important;
    color: inherit;
}

/* Mobile-responsive header */
@media (max-width: 768px) {
    .header {
        padding: 8px 15px;
        flex-wrap: wrap;
        width: 100vw; /* Full viewport width */
        margin: 0;
        box-sizing: border-box;
    }
    
    .logo-container {
        gap: 10px;
    }
    
    .logo-image {
        height: 40px;
        max-width: 60px;
    }
    
    .logo-title {
        font-size: 18px;
    }
    
    .logo-subtitle {
        font-size: 14px;
    }
    
    .main-nav {
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
    
    .main-nav li {
        margin: 0 10px;
    }
    
    .main-nav a {
        font-size: 16px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .header {
        padding: 5px 10px;
    }
    
    .logo-container {
        gap: 8px;
        flex-shrink: 0;
    }
    
    .logo-image {
        height: 35px;
        max-width: 50px;
        flex-shrink: 0;
    }
    
    .logo-title {
        font-size: 16px;
    }
    
    .logo-subtitle {
        font-size: 12px;
    }
    
    .main-nav {
        margin-top: 8px;
    }
    
    .main-nav a {
        font-size: 14px;
    }
}

.main-nav {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-size: 18px;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #4CAF50;
}

.city-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr)); /* Responsive grid */
    gap: 20px; /* Space between grid items */
    margin: 20px 40px; /* Add top, bottom, and left margin */
}

/* Mobile-responsive city list */
@media (max-width: 768px) {
    .city-list {
        grid-template-columns: 1fr !important;
        margin: 15px 20px !important;
        gap: 8px !important; /* Much smaller gap */
    }
    
    .city {
        flex-direction: column !important; /* Force column layout on mobile */
        text-align: center !important;
        align-items: center !important; /* Center align items */
        width: 100% !important;
        margin: 0 !important; /* Remove any inherited margins */
        padding: 0 !important; /* Remove any inherited padding */
    }
    
    .teaser-image {
        width: 100% !important;
        max-width: 280px !important; /* Slightly larger on mobile */
        margin: 0 auto 8px auto !important; /* Minimal bottom margin */
    }
    
    .city-text {
        flex: none !important;
        width: 100% !important;
        text-align: center !important; /* Center the text */
        order: 2 !important; /* Ensure text comes after image */
        margin: 0 !important; /* Remove any margins */
        padding: 0 !important; /* Remove any padding */
    }
    
    .city-name {
        font-size: 1.4rem !important; /* Slightly smaller but still prominent */
        margin: 0 0 4px 0 !important; /* Minimal bottom margin only */
        width: 100% !important;
    }
    
    .city-description {
        font-size: 0.95rem !important; /* Slightly smaller text */
        max-width: 280px !important; /* Match image width */
        margin: 0 auto !important; /* Center the description */
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .city-list {
        grid-template-columns: 1fr !important;
        margin: 10px 15px !important;
        gap: 5px !important; /* Very small gap for tiny screens */
    }
    
    .city {
        flex-direction: column !important; /* Force column layout */
        text-align: center !important;
        align-items: center !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .teaser-image {
        width: 100% !important;
        max-width: 260px !important;
        margin: 0 auto 6px auto !important; /* Very small bottom margin */
    }
    
    .city-text {
        width: 100% !important;
        text-align: center !important;
        order: 2 !important; /* Ensure text comes after image */
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .city-name {
        font-size: 1.3rem !important;
        margin: 0 0 2px 0 !important; /* Minimal margin */
        width: 100% !important;
    }
    
    .city-description {
        font-size: 0.9rem !important;
        max-width: 260px !important;
        margin: 0 auto !important;
        line-height: 1.3 !important;
        width: 100% !important;
    }
}

.city {
    display: flex;
    flex-direction: row; /* Align image and text side by side */
    align-items: center; /* Vertically align image and text */
}

.teaser-image {
    width: 300px; /* Fixed width for the image */
    height: auto; /* Maintain aspect ratio */
    margin-right: 20px; /* Add spacing between the image and text */
    padding: 10px; /* Add padding around the image */
    border-radius: 10px; /* Optional: Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Optional: Subtle shadow */
}

.city-text {
    display: flex;
    flex-direction: column; /* Stack city name and description vertically */
    text-align: left; /* Align text to the left */
    flex: 0 0 300px; /* Prevent shrinking and ensure a minimum width of 300px */

}

.city-name {
    font-size: 1.5rem; /* Larger text for the city name */
    font-weight: bold;
    margin-bottom: 5px; /* Add spacing below the city name */
}

.city-name a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

.city-name a:hover {
    color: #4CAF50; /* Highlight color on hover */
}

.city-description {
    font-size: 1rem;
    color: #666;
}



@media (max-width: 768px) {
    .maparea {
        width: 100%;
        margin: 15px auto;
    }
    
    h1 {
        font-size: 1.8rem;
        text-align: center;
        margin: 15px 20px;
    }
    
    p {
        font-size: 1rem;
        text-align: center;
        margin: 10px 20px;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .maparea {
        width: 100%;
        margin: 10px auto;
    }
    
    h1 {
        font-size: 1.5rem;
        margin: 10px 15px;
    }
    
    p {
        font-size: 0.9rem;
        margin: 8px 15px;
    }
}

.tabs {
    display: flex;
    justify-content: space-around; /* Distribute tabs evenly */
    background-color: #f1f1f1; /* Light background for the tab container */
    padding: 10px;
    border-radius: 5px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box; /* Ensure padding is included in width */
}

.tab {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    margin: 2px 5px;
    background-color: #e0e0e0; /* Light grey background for tabs */
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    min-height: 30px; 
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile-responsive tabs */
@media (max-width: 768px) {
    .tabs {
        padding: 8px;
        gap: 5px;
        width: 100vw; /* Full viewport width */
        margin: 0;
        box-sizing: border-box;
    }
    
    .tab {
        padding: 15px 12px;
        margin: 2px;
        font-size: 14px;
        min-height: 30px; /* Larger touch target for mobile */
        flex: 1 1 auto;
    }
}

@media (max-width: 480px) {
    .tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab {
        width: 100%;
        margin: 0;
        padding: 18px 15px;
        font-size: 16px;
        min-height: 30px;
    }
}

#keytab {
    background-color: #E8E3DA;
}

.tab:hover {
    background-color: #d0d0d0; /* Slightly darker grey on hover */
}

.tab.selected {
    background-color: #533418; /* Green background for selected tab */
    color: white;
}

.nav.horizontal {
    text-align: center;
    padding: 0px;
    background-color: #f1f1f1;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    position: relative; /* Ensure consistent positioning */
    z-index: 10; /* Ensure button stays above other elements */
}

.nav.vertical {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    background-color: #f1f1f1;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    user-select: none;
    position: relative; /* Ensure consistent positioning */
    z-index: 10; /* Ensure button stays above other elements */
}

/* Mobile-responsive navigation buttons */
@media (max-width: 768px) {
    .nav.horizontal {
        padding: 0px;
        font-size: 24px;
        height: 15px;
    }
    
    .nav.vertical {
        width: 15px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .nav.horizontal {
        padding: 0px;
        font-size: 24px;
        height: 30px;
    }
    
    .nav.vertical {
        width: 30px;
        font-size: 24px;
    }
}

.nav.disabled {
    background-color: #e0e0e0; /* Light grey background for disabled state */
    color: #a0a0a0; /* Muted text color */
    cursor: not-allowed; /* Change cursor to indicate non-clickable */
    pointer-events: none; /* Disable all pointer events */
    opacity: 0.6; /* Reduce opacity for a "disabled" look */
    -webkit-touch-callout: none; /* Disable callout on iOS */
    -webkit-user-select: none; /* Disable selection on iOS */
    user-select: none; /* Disable selection (standard property) */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.nav:hover {
    background-color: #d0d0d0; /* Slightly darker grey on hover */
}

/* Add active state for better mobile feedback */
.nav:active {
    background-color: #c0c0c0 !important;
    transform: scale(0.98);
}

/* Ensure touch events work properly on mobile */
.nav {
    touch-action: manipulation; /* Optimize for touch interactions */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.mapContainer {
    display: flex;
    height: calc(100vh - 120px); /* Adjust height based on other elements */
    min-height: 400px; /* Minimum height for mobile */
    width: 100%;
    box-sizing: border-box;
}

/* Mobile-responsive map container */
@media (max-width: 768px) {
    .mapContainer {
        height: calc(100vh - 140px);
        min-height: 350px;
        width: 100vw; /* Full viewport width */
        margin: 0;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .mapContainer {
        height: calc(100vh - 160px);
        min-height: 300px;
    }
}

#maps {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center; /* Center when space allows */
    overflow-x: auto; /* Allow horizontal scrolling */
    overflow-y: hidden; /* Prevent vertical scrolling */
    background-color: white;
    gap: 0; /* No gap between maps */
    padding: 0; /* Remove all padding */
    margin: 0; /* Remove all margin */
    scroll-behavior: smooth; /* Smooth scrolling */
    -webkit-overflow-scrolling: touch; /* Enable momentum scrolling on iOS */
}

/* Ensure proper scrolling behavior on mobile when content overflows */
@media (max-width: 768px) {
    #maps {
        justify-content: flex-start; /* Start from left on mobile for better scrolling */
    }
}

#maps img {
    cursor: zoom-in; /* Show magnifier cursor */
    object-fit: contain; /* Preserve aspect ratio */
    height: 100%; /* Fill container height */
    width: auto; /* Let width adjust to maintain aspect ratio */
    flex: none; /* Don't allow flex to change size */
    display: block;
    margin: 0; /* Remove any default margin */
    padding: 0; /* Remove any default padding */
    border: none; /* Remove any border */
    outline: none; /* Remove focus outline */
    float: none; /* Ensure no floating */
    max-width: none; /* Remove max-width constraints */
    min-width: 0; /* Allow shrinking */
}

/* Ensure maps maintain side-by-side layout on all screen sizes */
@media (max-width: 768px) {
    #maps {
        gap: 0; /* Still no gap on mobile */
        padding: 0; /* No padding on mobile either */
    }
    
    #maps img {
        height: 100%;
        flex: 1;
        margin: 0;
        padding: 0;
    }
}

#osm {
    width: 1400px;
    max-width: 1400px;
    display: none;
    margin: 0 auto;
    border: 6px solid #533418;
    height: 100%;
}

/* Mobile-responsive OSM */
@media (max-width: 768px) {
    #osm {
        width: 100%;
        max-width: 100%;
        border-width: 3px;
    }
}

#osm iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8); /* Black background with opacity */
}

.modal-content {
    margin: 5% auto;
    padding: 20px;
    background-color: #fff;
    width: 90%;
    max-width: 1000px;
    max-height: 80vh; /* Ensure the modal fits within the visible page */
    overflow: auto; /* Add internal scrollbars if content is larger than the modal */
    position: relative;
    display: flex;
    justify-content: flex-start; /* Center horizontally */
    align-items: start; /* Center vertically */
}

/* Mobile-responsive modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 2% auto;
        padding: 10px;
        width: 95%;
        max-height: 90vh;
    }
}

.modal-content img {
    max-height: 100%;
    display: block;
    cursor: grab;
    object-fit: contain;
}

.close {
    position: fixed; /* Ensure the close button remains fixed */
    top: 0px;
    right: 25px;
    color: #888;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 101; /* Ensure it stays above other content */
}

/* Mobile-responsive close button */
@media (max-width: 768px) {
    .close {
        right: 15px;
        font-size: 40px;
        top: 5px;
    }
}