:root {
    --navbar-height: 60px;
    --footer-height: 35px;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html,
body {
    overscroll-behavior-y: none;
}

#info-panel {
    overscroll-behavior: contain;
}

::selection {
    background: rgba(120, 120, 120, 0.18);
}

#map {
    position: fixed;
    top: var(--navbar-height);
    bottom: var(--footer-height);
    left: 0;
    right: 0;
    width: 100%;
    height: calc(100vh - var(--navbar-height) - var(--footer-height));
    z-index: 1;
}

#info-panel {
    position: fixed;
    top: var(--navbar-height);
    right: 0;
    bottom: var(--footer-height);
    width: 380px;
    background: linear-gradient(rgba(255, 255, 255, 0.96), rgba(249, 248, 246, 0.98));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 20;
    padding: 35px;
    box-sizing: border-box;
    overflow-y: auto;
    box-shadow: -18px 0 45px rgba(0, 0, 0, 0.12), -2px 0 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease;
}

#info-panel::-webkit-scrollbar {
    width: 8px;
}

#info-panel::-webkit-scrollbar-track {
    background: transparent;
}

#info-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 100px;
}

#info-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

#panel-resizer{
    position:absolute;
    z-index:100;
    background:transparent;
}

/* Desktop */
@media (min-width: 1025px){

    #panel-resizer{
        left:0;
        top:0;
        width:10px;
        height:100%;
        cursor:ew-resize;
    }

    #panel-resizer::after{
        content:"";
        position:absolute;
        left:3px;
        top:50%;
        transform:translateY(-50%);
        width:4px;
        height:70px;
        border-radius:999px;
        background:rgba(0,0,0,.18);
    }

    #info-panel.collapsed{
        transform: translateX(calc(100% - 18px)); /* leave grab bar visible */
    }
}

/* Portrait (phones/tablets) */
@media (min-width: 701px) and (max-width: 1024px){

#panel-resizer{
    position: absolute;
    top: 0;
    left: 0;

    width: 18px;
    height: 100%;

    cursor: ew-resize;
}

  #panel-resizer::after{
    content: "";

    position: absolute;

    left: 6px;
    top: 50%;

    transform: translateY(-50%);

    width: 5px;
    height: 70px;

    border-radius: 999px;

    background: rgba(0,0,0,.18);
}

#info-panel.collapsed{
        transform: translateX(calc(100% - 18px)); /* leave grab bar visible */
    }
}

@media (max-width: 700px){
 #panel-resizer{
    position: sticky;
    top:0;
    left:0;
    width:100%;
    height:18px;
    cursor:ns-resize;
}

  #panel-resizer::after{
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 5px;
    border-radius: 999px;
    background: rgba(0,0,0,.18);
}

#info-panel.collapsed {
    transform: translateY(calc(100% - 32px - var(--footer-height)));
}
    }


#panel-content h2,
#panel-content p,
#panel-content ul,
#panel-content li,
.panel-back,
.map-popup {
    font-family: "EB Garamond", serif;
}

#panel-content {
    color: #222;
}

#panel-content h2 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #111;
}

#panel-content p {
    font-size: 16px;
    line-height: 1.75;
    color: #2c2b2b;
}

#panel-content ul {
    padding-left: 20px;
}

#panel-content li {
    margin-bottom: 10px;
    line-height: 1.7;
    color: #2c2b2b;
}

.panel-back {
    display: inline-flex;
    align-items: center;
    margin-bottom: 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #666;
    transition: color 0.2s ease;
}

.panel-back:hover {
    color: #111;
}

.maplibregl-ctrl-top-right {
    top: calc(var(--navbar-height) + 20px);
}

.maplibregl-ctrl-bottom-left {
    bottom: calc(var(--footer-height) + 20px);
}

.maplibregl-ctrl-group {
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.maplibregl-ctrl button {
    background: rgba(255, 255, 255, 0.95);
    transition: background 0.15s ease;
}

.maplibregl-ctrl button:hover {
    background: #f4f4f4;
}

.maplibregl-popup {
    z-index: 30;
}

.maplibregl-popup-content {
    background: rgba(250, 249, 247, 0.98);
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #222;
    font-size: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    font-family: "EB Garamond", serif;
}

.maplibregl-popup-tip {
    display: none;
}

.attraction-link,
.attraction-link:visited {
    text-decoration: none;
    font-size: 16px;
    line-height: 1.75;
    color: #2c2b2b;
    font-family: "EB Garamond", serif;
}

.attraction-link:hover {
    text-decoration: underline;
    font-size: 16px;
    line-height: 1.75;
    color: #2c2b2b;
    font-family: "EB Garamond", serif;
}

@media (max-width: 700px) {
    :root {
        --navbar-height: 70px;
        --footer-height: 35px;
    }

    #info-panel {
        left: 0;
        right: 0;
        top: auto;
        bottom: var(--footer-height);
        width: 100%;
        height: 38vh;
        border-radius: 22px 22px 0 0;
        padding: 25px;
        box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
    }

    #panel-content h2 {
        font-size: 23px;
    }

    .maplibregl-ctrl-top-right {
        top: calc(var(--navbar-height) + 10px);
    }
}

@media (max-width: 420px) {
    #info-panel {
        height: 42vh;
        padding: 20px;
    }

    #panel-content h2 {
        font-size: 23px;
    }
}