body { 
    margin: 0; 
    padding: 0; 
    font-family: 'Cardo', serif; 
    font-weight: 400; 
    background-color: #111111; 
    color: rgb(187, 127, 79); 
    overflow-x: hidden; 
}

h1, h2, h3, #detail-title, #artist-statement h1, #bio-wrapper h1, #install-gallery-wrapper h3 {
    font-weight: 700; 
}

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

#hero-section { 
    display: flex; 
    width: 100vw; 
    height: 100vh; 
    border-bottom: 1px solid #333;
    box-sizing: border-box;
}

#sidebar { 
    width: 50%; 
    height: 100vh; 
    background: #111111; 
    border-right: 1px solid #333; 
    padding: 40px;
    box-sizing: border-box; 
    overflow-y: auto; 
    position: relative; 
}

#sidebar-header {
    position: sticky;
    top: -40px; 
    margin: -40px -40px 40px -40px;
    padding: 15px 40px;
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    font-size: 15px;
    font-weight: 400; 
    color: rgb(187, 127, 79);
    height: 60px; 
    box-sizing: border-box;
}

/* UPDATED: Hover effect for topbar back button is now a gray box */
#topbar-back {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-left: -12px; /* Pulls it left so the text still aligns with the edge */
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

#topbar-back:hover {
    background-color: #333333;
}

#topbar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* UPDATED: Hover effect for topbar arrows is now a gray box */
.nav-arrow {
    cursor: pointer;
    font-size: 18px;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.nav-arrow:hover {
    background-color: #333333;
}

.nav-arrow.disabled {
    opacity: 0.3;
    pointer-events: none;
}

#nav-counter {
    font-variant-numeric: tabular-nums;
    min-width: 50px;
    text-align: center;
    user-select: none;
}

#thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 15px; 
    width: 100%;
}

.thumbnail-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    cursor: pointer;
    padding: 0;
    margin: 0;
    position: relative; 
    min-width: 0; 
    overflow: hidden; 
}

.grid-thumbnail {
    width: 100%; 
    aspect-ratio: 1 / 1; 
    object-fit: cover; 
    border-radius: 0; 
    position: relative;
    z-index: 1;
    transition: filter 0.4s ease; 
}

.thumbnail-wrapper:hover .grid-thumbnail {
    filter: grayscale(100%) invert(100%) contrast(200%);
}

.thumbnail-title {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 17, 17, 0.85); 
    color: rgb(187, 127, 79);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.3 !important; 
    opacity: 0; 
    z-index: 2;
    transition: opacity 0.3s ease; 
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.thumbnail-wrapper:hover .thumbnail-title {
    opacity: 1; 
}

#detail-view { 
    display: flex; 
    flex-direction: column; 
    gap: 0; 
    width: 80%; 
    margin: 0 12% 0 8%; 
    position: relative; 
}

#detail-title { 
    line-height: 1.6 !important; 
    margin: 0 0 50px 0; 
}

#slider-container { 
    width: 100%; 
    margin: 0; 
    background-color: #111111; 
}

#slider-caption { 
    text-align: center; 
    margin-bottom: 60px;
}
#slider-container:last-child {
    margin-bottom: 60px;
}

#detail-gallery {
    display: flex;
    flex-direction: column;
    gap: 60px; 
    width: 100%; 
    margin-top: 0; 
    margin-bottom: 80px; 
}

#detail-uranotype {
    width: 100%; 
    height: auto;
    object-fit: cover;
    display: block;
    background-color: #111111;
    margin-bottom: 20px; 
}

#detail-description { line-height: 1.6 !important; margin: 0 0 30px 0; }

img-comparison-slider {
    display: block; width: 100%; outline: none;
    --divider-width: 6px;
    --divider-color: #111111; 
}

img-comparison-slider img { width: 100%; height: auto; display: block; object-fit: cover; }

.custom-handle {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background-color: #111111; color: rgb(187, 127, 79); 
    cursor: ew-resize; 
}

.custom-handle svg { width: 26px; height: 26px; }

.gallery-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    margin-bottom: 10px; 
}

.gallery-caption {
    font-size: 16px;
    margin-top: 0; 
    line-height: 1.5 !important;
    color: rgb(187, 127, 79);
    width: 100%;
}

p sup, .gallery-caption sup { display: none !important; }

#detail-view sup {
    cursor: pointer;
    background-color: #000000; 
    color: rgb(187, 127, 79); 
    border: none !important; 
    font-family: 'Cardo', serif;
    font-style: normal; 
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%; 
    line-height: 0; 
    padding-top: 1px; 
    box-sizing: border-box;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    z-index: 10;
}

#detail-view sup:hover {
    transform: scale(1.15);
    background-color: rgb(187, 127, 79); 
    color: #000000; 
}

#uranotype-wrapper sup, 
#slider-container sup, 
.gallery-item > sup {
    position: absolute;
    top: 15px;
    right: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.8);
}

#citation-popup {
    position: absolute; 
    background-color: #222; 
    color: rgb(187, 127, 79);
    border: none; 
    padding: 12px 16px;
    font-size: 12px;
    line-height: 1.5;
    width: max-content; 
    max-width: 250px; 
    overflow-wrap: break-word; 
    word-wrap: break-word; 
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    border-radius: 0; 
    z-index: 9999;
    pointer-events: none; 
    display: block; 
}

#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(17, 17, 17, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

#lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

#lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: rgb(187, 127, 79);
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
    z-index: 10001;
    display: flex;
}

#lightbox-close:hover {
    transform: scale(1.15);
    color: #fff;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgb(187, 127, 79);
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
    z-index: 10001;
    display: flex;
    padding: 20px;
}

.lightbox-nav:hover {
    transform: translateY(-50%) scale(1.15);
    color: #fff;
}

#lightbox-prev { left: 20px; }
#lightbox-next { right: 20px; }

#detail-uranotype, 
.gallery-item img, 
#install-gallery img,
#sac-gallery img {
    cursor: zoom-in;
}

.hidden { display: none !important; }

#map-container { width: 50%; height: 100vh; position: relative; font-family: Arial, sans-serif !important; }
#map { width: 100%; height: 100%; }

#layer-control-container {
    position: absolute;
    bottom: 10px; 
    right: 10px;  
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-end; 
}

#layer-icon-btn {
    background-color: transparent;
    border: none;
    color: rgb(187, 127, 79);
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

#layer-icon-btn:hover { transform: scale(1.15); }

#layer-menu {
    font-family: Arial, sans-serif !important;
    background-color: #111111;
    border: 1px solid rgb(187, 127, 79);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 5px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

#layer-menu label { cursor: pointer; display: flex; align-items: center; gap: 6px; }
#layer-menu input[type="radio"] { accent-color: rgb(187, 127, 79); cursor: pointer; }

.nuclear-marker { 
    display: block; 
    background-image: url('nuclear_symbol.png'); 
    background-size: cover; 
    background-position: center;
    background-color: transparent; 
    width: 19px; 
    height: 19px; 
    cursor: pointer; 
    border: none;
}

.maplibregl-popup-content { background: #222222; color: rgb(187, 127, 79); border: 1px solid #444; font-family: Arial, sans-serif !important; }

#exhibition-section { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 80px 40px; 
    background-color: #111111; 
}

#statement-container {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

#artist-statement { width: 50%; }

#artist-statement h1, #bio-wrapper h1 { 
    margin-bottom: 30px; 
    font-size: 28px; 
    margin-top: 0; 
}

#artist-statement p, #dynamic-statement p, #dynamic-bio p { 
    line-height: 1.6 !important; 
    margin-bottom: 25px; 
    font-size: 17px; 
}

#artist-statement p:last-child, #dynamic-statement p:last-child, #dynamic-bio p:last-child { 
    margin-bottom: 0; 
}

/* UPDATED: Links in the text now use the gray box hover effect */
#dynamic-statement a, #dynamic-bio a {
    color: rgb(187, 127, 79);
    text-decoration: none;
    padding: 2px 6px;
    margin: 0 -6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

#dynamic-statement a:hover, #dynamic-bio a:hover {
    background-color: #333333;
}

#sac-gallery-wrapper {
    width: 50%;
    margin-top: 68px; 
}

#sac-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

#sac-gallery img {
    width: 100%;
    height: auto;
    display: block;
    background-color: #111111;
}

#install-gallery-wrapper {
    margin-top: 80px; 
    border-top: 1px solid #333; 
    padding-top: 60px;
}

#install-gallery-wrapper h3 { 
    margin-bottom: 30px; 
    font-weight: 700; 
    color: rgb(187, 127, 79); 
    font-size: 18px; 
}

#install-gallery {
    column-count: 3; 
    column-gap: 40px; 
    width: 100%;
}

.install-item {
    break-inside: avoid;
    page-break-inside: avoid; 
    margin-bottom: 40px; 
    margin-top: 0; 
    display: block; 
    width: 100%;
    vertical-align: top;
}

.install-item img {
    width: 100%;
    height: auto;
    display: block;
    background-color: #111111;
}

.install-caption {
    font-size: 13px;
    color: rgb(187, 127, 79);
    line-height: 1.4;
    margin-top: 12px; 
}

#bio-wrapper {
    width: 100%;
    margin-top: 80px;
    border-top: 1px solid #333;
    padding-top: 60px;
}

.maplibregl-ctrl-group {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 52px !important;  
    margin-right: 10px !important;   
    display: flex;
    flex-direction: column;
    gap: 5px; 
}

.maplibregl-ctrl-group button {
    background-color: transparent !important;
    width: 32px !important;
    height: 32px !important;
    transition: transform 0.2s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

.maplibregl-ctrl-group button:hover { background-color: transparent !important; transform: scale(1.15); }
.maplibregl-ctrl-group button + button { border-top: none !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { opacity: 1 !important; filter: none !important; }
.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23BB7F4F' stroke-width='1.5' stroke-linecap='round'%3E%3Cline x1='12' y1='6' x2='12' y2='18'/%3E%3Cline x1='6' y1='12' x2='18' y2='12'/%3E%3C/svg%3E") !important; }
.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23BB7F4F' stroke-width='1.5' stroke-linecap='round'%3E%3Cline x1='6' y1='12' x2='18' y2='12'/%3E%3C/svg%3E") !important; }
.maplibregl-ctrl-compass .maplibregl-ctrl-icon { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23BB7F4F' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpolygon points='12 3 17 20 12 16 7 20'/%3E%3C/svg%3E") !important; }

.maplibregl-ctrl-attrib {
    background-color: transparent !important;
    color: rgb(187, 127, 79) !important;
    margin-bottom: 18px !important;  
    margin-right: 56px !important;   
    font-size: 10px !important;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
    font-family: Arial, sans-serif !important; 
}
.maplibregl-ctrl-attrib a { color: rgb(187, 127, 79) !important; text-decoration: none; }
.maplibregl-ctrl-attrib a:hover { text-decoration: underline; }

@media (max-width: 850px) {
    #hero-section { flex-direction: column-reverse; }
    #map-container { width: 100%; height: 45vh; }
    #sidebar { width: 100%; height: 55vh; border-right: none; border-top: 1px solid #333; padding: 20px; background: #111111; }
    
    #sidebar-header {
        top: -20px;
        margin: -20px -20px 30px -20px;
        padding: 15px 20px;
    }
    
    #thumbnail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
    
    #detail-view { width: 100%; margin: 0; }
    #detail-uranotype { width: 100%; }
    #exhibition-section { padding: 60px 25px; }
    
    #statement-container { flex-direction: column; gap: 40px; }
    #artist-statement, #sac-gallery-wrapper { width: 100%; }
    #sac-gallery-wrapper { margin-top: 0; }
    
    #install-gallery { column-count: 2; }
    
    .maplibregl-ctrl-group { margin-bottom: 60px !important; }
    .maplibregl-ctrl-attrib { margin-bottom: 25px !important; }
}

@media (max-width: 500px) {
    #install-gallery { column-count: 1; }
}
