/* Всички настройки за външния вид са тук. */
:root {
    --thumbnail-width: 88px;
    --thumbnail-height: 66px;
    --thumbnail-border: 3px;
    --arrow-length: 35px;
    --arrow-half-width: 11px;
    --marker-color: #ffffff;
    --marker-outline: #3d5961;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #26343a;
    background: #transparent;
}

header {
    padding: 12px 20px;
}

h1 {
    margin: 0 0 6px;
    font-size: 22px;
}

header p {
    margin: 0;
    font-size: 14px;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
}

#coordinates {
    display: none;
}

/* Рамката и снимката са един общ маркер. */
.photo-pin {
    position: relative;
    width: var(--thumbnail-width);
    height: var(--thumbnail-height);
    border: var(--thumbnail-border) solid var(--marker-color);
    border-radius: 7px;
    background: var(--marker-color);
    box-shadow: 0 2px 9px #0007;
    cursor: pointer;
}

/* Контейнер за снимката */

.photo-pin-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 4px;
}


/* Самата снимка */

.photo-pin-image img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
}

/* Стрелката е триъгълник; върхът ѝ е точно iconAnchor. */
.photo-pin::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.photo-pin.bottom::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: var(--arrow-length) var(--arrow-half-width) 0 var(--arrow-half-width);
    border-color: var(--marker-color) transparent transparent transparent;
}

.photo-pin.top::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 var(--arrow-half-width) var(--arrow-length) var(--arrow-half-width);
    border-color: transparent transparent var(--marker-color) transparent;
}

.photo-pin.left::after {
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: var(--arrow-half-width) var(--arrow-length) var(--arrow-half-width) 0;
    border-color: transparent var(--marker-color) transparent transparent;
}

.photo-pin.right::after {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: var(--arrow-half-width) 0 var(--arrow-half-width) var(--arrow-length);
    border-color: transparent transparent transparent var(--marker-color);
}

.photo-pin:focus-within {
    outline: 2px solid #124fbe;
}

.lightbox[hidden] {
    display: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #000b;
}

.lightbox-panel {
    position: relative;
    width: min(95vw, 1200px);
    max-height: 95vh;
    overflow: auto;
    padding: 20px;
    border-radius: 12px;
    background: white;
}

.lightbox-panel h2 {
    margin: 0 40px 14px 0;
}

#large-photo {
    display: block;
    max-width: 100%;
    max-height: 68vh;
    margin: 0 auto;
    object-fit: contain;
}

#photo-description {
    line-height: 1.5;
}

.close-button {
    position: absolute;
    top: 8px;
    right: 12px;
    border: 0;
    background: transparent;
    font-size: 32px;
    cursor: pointer;
}

.photo-icon {
    background: transparent;
    border: none;
}

.photo-pin img {
    box-sizing: border-box;
}

.text-icon {
    background: transparent;
    border: none;
}

.text-icon {
    background: transparent;
    border: none;
}

.text-pin {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
}

.text-pin-content {
    position: absolute;
    width: max-content;
    max-width: 220px;
    padding: 7px 10px;
    border: 2px solid #ffffff;
    border-radius: 7px;
    background: #ffffff;
    color: #26343a;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.25;
    text-align: center;
    box-shadow: 0 2px 9px #0007;
    cursor: pointer;
}

.text-pin.bottom .text-pin-content {
    left: 0;
    bottom: 35px;
    transform: translateX(-50%);
}

.text-pin.bottom .text-pin-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 35px 7px 0 7px;
    border-color: #ffffff transparent transparent transparent;
}

.text-pin.top .text-pin-content {
    left: 0;
    top: 35px;
    transform: translateX(-50%);
}

.text-pin.top .text-pin-content::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 7px 35px 7px;
    border-color: transparent transparent #ffffff transparent;
}

.text-pin.left .text-pin-content {
    left: 35px;
    top: 0;
    transform: translateY(-50%);
}

.text-pin.left .text-pin-content::after {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 7px 35px 7px 0;
    border-color: transparent #ffffff transparent transparent;
}

.text-pin.right .text-pin-content {
    right: 35px;
    top: 0;
    transform: translateY(-50%);
}

.text-pin.right .text-pin-content::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 7px 0 7px 35px;
    border-color: transparent transparent transparent #ffffff;
}

.text-info[hidden] {
    display: none;
}

.text-info {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #000b;
}

.text-info-panel {
    position: relative;
    width: min(90vw, 600px);
    max-height: 80vh;
    overflow: auto;
    padding: 25px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 5px 25px #0008;
}

.text-info-panel h2 {
    margin: 0 40px 15px 0;
}

#text-info-description {
    margin: 0;
    line-height: 1.6;
}
.leaflet-container {
    background: transparent !important;
}
