/* style.css - James Stone Glass Theme */

/* --- Variables & Reset --- */
:root {
    --primary-font: 'Montserrat', sans-serif;
    --heading-font: 'Cormorant Garamond', serif;
    --gold: #c9a227;
    --gold-light: #e8d59a;
    --gold-dark: #8a6d14;
    --obsidian: #0a0a0f;
    --charcoal: #1a1a24;
    --cream: #f5f0e8;
    --silver: #b8b8c8;
    --bg-color: var(--cream);
    --container-bg: #ffffff;
    --text-color: var(--charcoal);
    --heading-color: var(--obsidian);
    --accent-color: var(--gold);
    --border-color: #e0d8c8;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --section-bg: rgba(255, 255, 255, 0.95);
}

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

html {
    scroll-behavior: smooth; /* Enable smooth scrolling */
}

body {
    font-family: var(--primary-font);
    line-height: 1.7;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-weight: 400;
    transition: background-color 0.3s ease;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* --- Header --- */
.main-header {
    background: linear-gradient(135deg, var(--obsidian) 0%, var(--charcoal) 100%);
    padding: 40px 20px;
    text-align: center;
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    margin-bottom: 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header h1 {
    font-family: var(--heading-font);
    font-size: 2.8em;
    color: var(--cream);
    letter-spacing: 2px;
    font-weight: 500;
    margin-bottom: 5px;
}

.main-header h1 span {
    color: var(--gold);
}

.main-header h2 {
    font-family: var(--primary-font);
    font-size: 1em;
    color: var(--silver);
    font-weight: 300;
    margin-top: 5px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Back to main site link */
.back-link {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

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

/* --- Main Container --- */
.container {
    max-width: 1000px;
    margin: 0 auto 40px auto;
    padding: 0 20px;
}

/* --- Content Sections Styling --- */
.content-section {
    padding: 35px 30px;
    margin-bottom: 30px;
    background-color: var(--section-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-color);
}

.content-section h2,
.section-title {
    font-family: var(--heading-font);
    font-weight: 500;
    color: var(--heading-color);
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gold);
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.8em;
}

/* Center align h2 within sections */
.project-info, .map-area, #bench-details, .about-collaboration {
    text-align: center;
}

.content-section p {
    font-size: 1.05em;
    margin-bottom: 1em;
    text-align: left;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}
.content-section p strong, .content-section span.gold-highlight {
     font-weight: 600;
}
.content-section span.gold-highlight {
    color: var(--gold);
}


.content-section a {
    color: var(--gold);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}
.content-section a:hover {
    color: var(--gold-dark);
    text-decoration: underline;
}

/* --- Map Area Specific --- */
.map-area {
    padding: 20px 0;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

#map {
    height: 550px;
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-top: 10px;
    margin-bottom: 10px;
    background-color: var(--cream);
}

.map-attribution {
    text-align: center;
    font-size: 0.8em;
    color: var(--silver);
    margin-top: 5px;
}
.map-attribution a {
    color: var(--silver);
    text-decoration: none;
}
.map-attribution a:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* --- Leaflet Popup Styling --- */
.leaflet-popup-content-wrapper {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border: 2px solid var(--gold);
}
.leaflet-popup-content {
    font-family: var(--primary-font);
    font-size: 0.95em;
    line-height: 1.5;
    padding: 10px 14px;
    margin: 0 !important;
    text-align: center;
    min-width: 130px;
}
.leaflet-popup-content b {
    font-family: var(--heading-font);
    color: var(--gold-dark);
    font-weight: 600;
    font-size: 1.1em;
    display: block;
    margin-bottom: 3px;
}
.leaflet-popup-tip-container { display: none; }


/* --- Bench Details Section Styling --- */
#bench-details {
    border-top: 4px solid var(--gold);
    padding-top: 30px;
    padding-bottom: 30px;
    text-align: left;
    position: relative;
    background-color: #fff;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
}
#bench-details h2 {
     margin-bottom: 30px;
     font-size: 1.8em;
}


#bench-details-content {
    max-width: 800px; /* Limit content width */
    margin: 0 auto;
    padding: 0 10px; /* Padding inside the content area */
}

/* --- Image Gallery Styling --- */
.bench-image-gallery {
    text-align: center; /* Center the image block */
    margin-bottom: 25px;
}

.main-image-container {
    margin-bottom: 15px;
    text-align: center;
}

#main-bench-image {
    max-width: 100%;
    max-height: 450px; /* Limit image height */
    height: auto;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.image-thumbnails {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.image-thumbnails .thumbnail {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border: 2px solid var(--border-color);
}

.image-thumbnails .thumbnail:hover {
    transform: scale(1.05);
    opacity: 0.9;
    border-color: var(--gold);
}

#bench-details-content h3 {
    font-family: var(--heading-font);
    font-size: 1.8em;
    color: var(--heading-color);
    margin-bottom: 15px;
    text-align: center;
}

#bench-details-content p {
    font-size: 1.1em;
    margin-bottom: 1em;
    text-align: left;
    max-width: none;
}

#bench-details-content p strong {
    font-weight: 600;
    color: var(--gold-dark);
    margin-right: 5px;
}

#bench-details-story {
    margin-top: 15px;
    font-size: 1.1em;
    line-height: 1.8;
    text-align: justify; /* Justify story text */
    border-top: 1px dashed var(--border-color);
    padding-top: 15px;
}

/* --- Directions Button Styling --- */
.directions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.directions-button, .view-all-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--gold);
    color: var(--obsidian);
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    font-family: var(--primary-font);
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

.directions-button:hover, .view-all-button:hover {
    background-color: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(201, 162, 39, 0.4);
    text-decoration: none;
}

.view-all-button {
    background-color: var(--charcoal);
    color: var(--cream);
}

.view-all-button:hover {
    background-color: var(--obsidian);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.directions-button svg, .view-all-button svg {
    margin-right: 5px;
}

/* --- Tour Modal Styling --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    max-width: 800px;
    width: 90%;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    padding: 25px;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {transform: translateY(30px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #777;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #333;
}

.modal-content h3 {
    font-family: var(--heading-font);
    color: var(--heading-color);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
    text-align: center;
}

.bench-list {
    list-style-type: none;
    margin: 20px 0;
    padding: 0;
}

.bench-list li {
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--cream);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.bench-list h4 {
    margin: 0;
    font-size: 1.1em;
    flex: 1;
    min-width: 180px;
    font-family: var(--heading-font);
}

.bench-list p {
    margin: 0;
    color: var(--silver);
    flex: 1;
    min-width: 150px;
}

.modal-directions-button {
    background-color: var(--gold);
    color: var(--obsidian);
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.modal-directions-button:hover {
    background-color: var(--gold-light);
    text-decoration: none;
}

.tour-buttons {
    margin-top: 25px;
    text-align: center;
}

.full-tour-button {
    background-color: var(--charcoal);
    color: var(--cream);
    border: none;
    padding: 14px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.full-tour-button:hover {
    background-color: var(--gold);
    color: var(--obsidian);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(201, 162, 39, 0.4);
    text-decoration: none;
}

#close-details-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-family: sans-serif;
    font-size: 1.6em;
    font-weight: bold;
    line-height: 1;
    width: 35px;
    height: 35px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#close-details-btn:hover {
    background: #e0e0e0;
    color: #000;
    transform: scale(1.1);
}

/* --- Message Area Styling --- */
#message-area {
    text-align: center;
    padding: 15px;
    margin: 10px 0 15px 0;
    border-radius: 8px;
    display: none;
    font-weight: 400;
    transition: all 0.3s ease;
}
#message-area.loading { display: block; background-color: rgba(201, 162, 39, 0.1); color: var(--charcoal); }
#message-area.error { display: block; background-color: #ffeded; color: #c0392b; font-weight: 600; }

/* --- Footer --- */
.main-footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px 20px;
    font-size: 0.9em;
    color: var(--cream);
    background: linear-gradient(135deg, var(--obsidian) 0%, var(--charcoal) 100%);
    border-top: 3px solid var(--gold);
}
.main-footer p { margin-bottom: 8px; }
.main-footer a { color: var(--gold); text-decoration: none; transition: color 0.3s ease; }
.main-footer a:hover { color: var(--gold-light); text-decoration: underline; }

/* --- Responsive Adjustments --- */
@media (max-width: 980px) {
    .container { padding: 0 15px; }
    .modal-content { width: 95%; padding: 20px; }
    .back-link {
        position: static;
        transform: none;
        margin-bottom: 15px;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .main-header { padding: 25px 15px; }
    .main-header h1 { font-size: 2em; }
    .main-header h2 { font-size: 0.85em; }
    .content-section { padding: 25px 20px; }
    .content-section p { font-size: 1em; }
    #map { height: 450px; }
    #bench-details h2 { font-size: 1.6em; }
    #bench-details-content h3 { font-size: 1.5em; }
    #bench-details-content p, #bench-details-story { font-size: 1em; }
    #close-details-btn { top: 10px; right: 10px; width: 30px; height: 30px; font-size: 1.4em;}
    .image-thumbnails .thumbnail { width: 60px; height: 60px; }
    .bench-list li { flex-direction: column; align-items: flex-start; }
    .bench-list li > * { width: 100%; }
    .modal-directions-button { margin-top: 10px; }
    .tour-highlights {
        margin: 20px auto;
    }
    
    #show-all-benches-btn {
        width: 100%;
        max-width: 350px;
    }
}

@media (max-width: 480px) {
    .main-header h1 { font-size: 1.6em; letter-spacing: 1px; }
    .main-header h2 { font-size: 0.75em; letter-spacing: 1px; }
    .content-section p { font-size: 0.95em; }
    #map { height: 380px; }
    #bench-details h2 { font-size: 1.3em; }
    #bench-details-content h3 { font-size: 1.2em; }
    .directions-container { flex-direction: column; gap: 10px; }
    .directions-button, .view-all-button { width: 100%; }
    .image-thumbnails .thumbnail { width: 50px; height: 50px; }
    .image-thumbnails { gap: 5px; }
}

/* --- Walking Tour Section --- */
.walking-tour {
    text-align: center;
}

.tour-highlights {
    margin: 25px auto;
    text-align: center;
}

#show-all-benches-btn {
    padding: 12px 24px;
    font-size: 1.05em;
}

/* Responsive adjustments for tour section */
@media (max-width: 768px) {
    .tour-highlights {
        margin: 20px auto;
    }
    
    #show-all-benches-btn {
        width: 100%;
        max-width: 350px;
    }
}