/* Harta cinematica a proiectelor (portata din site-ul OBA Group): orbita -> Europa -> Dobrogea -> coasta.
   Limitat la .pmap si body.public-projects-page main. --hh = header fix masurat dinamic, --dock = bara mobil. */

/* Asigura afisarea full-bleed si functionalitatea position:sticky pe pagina de proiecte */
html.is-projects-page main,
html[data-theme].is-projects-page main,
body.public-projects-page main,
html[data-theme] body.public-projects-page main,
main:has(.pmap),
html[data-theme] main:has(.pmap) {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.pmap {
    --hh: 84px;
    --dock: 0px;
    --bg: #ffffff;
    --panel: #ffffff;
    --head: rgba(255, 255, 255, .94);
    --text: #1b2b40;
    --muted: #59616d;
    --line: #d5c9b3;
    --gold: #876026;
    --gold-b: #b48d50;
    --glow: rgba(135, 96, 38, .22);
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font: 15px/1.65 var(--sans);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    position: relative;
    height: calc(100svh + 320vh);
    margin: 0;
}
.pmap *, .pmap *::before, .pmap *::after { box-sizing: border-box; }
.pmap img { max-width: 100%; display: block; }
.pmap a { color: inherit; text-decoration: none; }
.pmap .ico { flex-shrink: 0; }
.pmap .eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.pmap .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: transparent !important;
    border: 1px solid var(--gold);
    color: var(--gold);
    transition: box-shadow .25s, transform .25s;
}
.pmap .button:hover {
    box-shadow: 0 0 0 1px var(--gold), 0 0 24px var(--glow);
    transform: translateY(-1px);
}
.pmap .button.ghost { border-color: var(--line); color: var(--text); }
.pmap .button.ghost:hover { border-color: var(--gold-b); box-shadow: none; }

/* Sticky track for cinematic flight */
.pmap-sticky {
    position: sticky;
    top: 0;
    height: 100svh;
    min-height: 520px;
    border: 0;
    border-bottom: 1px solid var(--gold-b);
    border-radius: 0;
    overflow: hidden;
    background: #040912;
    color: #f6f1e6;
    isolation: isolate;
}

.pmap .pmap-canvas,
.pmap .pmap-canvas.maplibregl-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.pmap.pmap-ready .pmap-canvas { opacity: 1; }
.pmap-canvas .maplibregl-canvas { outline: none; }
.pmap-canvas .maplibregl-ctrl-attrib { background: rgba(5, 5, 5, .7); color: #bda57a; }
.pmap-canvas .maplibregl-ctrl-attrib a { color: #e6c98f; }

/* HUD headline positioned neatly below floating site header */
.pmap-hud {
    position: absolute;
    z-index: 3;
    left: clamp(20px, 4.5vw, 64px);
    top: calc(var(--hh, 84px) + clamp(14px, 2vw, 28px));
    max-width: min(620px, 82%);
    pointer-events: none;
    text-shadow: 0 1px 18px rgba(0, 0, 0, .7);
}
.pmap-logo {
    display: block;
    width: clamp(56px, 6vw, 88px);
    height: auto;
    margin-bottom: 18px;
    transition: opacity .6s ease, height .6s ease, margin .6s ease;
}
.pmap-final .pmap-logo,
.pmap-final .pmap-hud .eyebrow {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
}
.pmap-final .pmap-hud h1 { font-size: clamp(20px, 2.4vw, 32px); }
.pmap-hud .eyebrow { color: #e6c98f; }
.pmap-hud h1 {
    font-size: clamp(28px, 4.2vw, 58px);
    color: #fbf7ee;
    line-height: 1.08;
    transition: font-size .8s ease;
}
.pmap-hud h1 em { font-style: normal; color: #e6c98f; }
.pmap-caption {
    margin-top: 12px;
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #e6c98f;
}
.pmap-caption:empty { display: none; }

.pmap-hint {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: clamp(24px, 4vh, 48px);
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #e6c98f;
    transition: opacity .5s;
}
.pmap-started .pmap-hint { opacity: 0; }

.pmap-bar {
    position: absolute;
    z-index: 4;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, #b28e54, #f0d9a4);
}

.pmap-skip {
    position: absolute;
    z-index: 5;
    left: 14px;
    bottom: 12px;
    font-size: 11.5px;
    color: #bda57a;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.pmap-skip:focus-visible,
.pmap-skip:hover { color: #f0d9a4; }

/* Projects sidebar list */
.pmap-list {
    position: absolute;
    z-index: 4;
    right: clamp(16px, 3vw, 40px);
    top: calc(var(--hh, 84px) + clamp(14px, 2vw, 28px));
    bottom: clamp(32px, 5vh, 60px);
    width: min(300px, 34%);
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow: auto;
    opacity: 0;
    pointer-events: none;
    transform: translateX(14px);
    transition: opacity .6s ease, transform .6s ease;
    scrollbar-width: thin;
}
.pmap-final .pmap-list { opacity: 1; pointer-events: auto; transform: none; }
.pmap-list li { margin: 0; }
.pmap-list .gm { display: none; }
.pmap-list a[data-pin] {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border: 1px solid rgba(230, 201, 143, .35);
    border-radius: 10px;
    background: rgba(8, 6, 3, .74);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #f6f1e6;
    transition: border-color .2s, background .2s;
}
.pmap-list a[data-pin]:hover,
.pmap-list a.is-on,
.pmap-list a.is-hot {
    border-color: #e6c98f;
    background: rgba(48, 36, 14, .82);
}
.pmap-list .n {
    flex: 0 0 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid #e6c98f;
    border-radius: 50%;
    font-size: 11.5px;
    color: #e6c98f;
    font-variant-numeric: tabular-nums;
}
.pmap-list .t { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.pmap-list strong { font-weight: 500; font-size: 13.5px; }
.pmap-list small { font-size: 11px; color: #bda57a; }

/* Interactive Map Pins on the Coast */
.pin {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    pointer-events: none;
}
.pin::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 5px;
    width: 18px;
    height: 7px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(0, 0, 0, .85) 0%, transparent 72%);
    opacity: 0;
    transition: opacity .6s ease;
    pointer-events: none;
}
.pmap-pins .pin { pointer-events: auto; }
.pmap-pins .pin::before { opacity: 1; }
.pin-dot {
    position: absolute;
    inset: 9px;
    border: 2px solid #e6c98f;
    border-radius: 50%;
    background: #fff8e8;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .8), 0 0 12px rgba(230, 201, 143, .28);
    opacity: 0;
    transform: scale(.4);
    transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}
.pmap-pins .pin-dot { opacity: 1; transform: none; }
.pin-dot::after {
    content: "";
    position: absolute;
    inset: -7px;
    border: 1px solid #e6c98f;
    border-radius: 50%;
    animation: pin-ring 2.6s ease-out infinite;
}
.pin-tag {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 2px);
    transform: translate(-50%, 2px);
    padding: 3px 9px;
    border: 1px solid #e6c98f;
    border-radius: 6px;
    background: rgba(10, 8, 5, .92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .8), 0 0 10px rgba(230, 201, 143, .25);
    color: #f0d9a4;
    font-size: 11.5px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.pmap-pins .pin-tag {
    opacity: 1;
    transform: translate(-50%, 0);
}
.pin:hover,
.pin:focus-visible,
.pin.is-on {
    z-index: 5;
}
.pin:hover .pin-tag,
.pin:focus-visible .pin-tag,
.pin.is-on .pin-tag {
    opacity: 1;
    transform: translate(-50%, -4px);
}
.pin.is-on .pin-dot {
    background: #ffffff;
    border-color: #f3dca8;
    box-shadow: 0 0 0 2px rgba(230, 201, 143, .18), 0 0 18px rgba(230, 201, 143, .4);
}
@keyframes pin-ring {
    0% { transform: scale(.6); opacity: .9; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* Active Pin Preview Card */
.pmap-card {
    position: absolute;
    z-index: 6;
    left: clamp(16px, 3vw, 36px);
    bottom: clamp(24px, 4vh, 36px);
    width: min(360px, calc(100% - 32px));
    display: flex;
    gap: 14px;
    padding: 12px;
    border: 1px solid #e6c98f;
    border-radius: 12px;
    background: rgba(8, 6, 3, .88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .4s, transform .4s;
}
.has-card .pmap-card { opacity: 1; pointer-events: auto; transform: none; }
.pmap-card img {
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
}
.pmap-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pmap-card strong { font-weight: 500; font-size: 17px; color: #fbf7ee; }
.pmap-card span { font-size: 12px; color: #bda57a; line-height: 1.4; overflow-wrap: anywhere; }
.pmap-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pmap-card .button { padding: 7px 12px; font-size: 12.5px; color: #f0d9a4; border-color: #e6c98f; }
.pmap-card .button.ghost { border-color: rgba(230, 201, 143, .4); color: #e9dfc8; }

@media (max-width: 760px) {
    .pmap-hud {
        top: 76px;
        left: 16px;
        max-width: 90%;
    }
    .pmap-list {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 30px;
        width: auto;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        transform: translateY(14px);
    }
    .pmap-final .pmap-list { transform: none; }
    .pmap-list li { flex: 0 0 auto; }
    .pmap-list a[data-pin] { padding: 8px 11px; }
    .pmap-list small { display: none; }
    .pmap-card {
        bottom: 84px;
        left: 10px;
        width: calc(100% - 20px);
    }
    .pmap-card img { flex-basis: 72px; width: 72px; height: 72px; }
    .pmap-skip { display: none; }
}

/* Reduced motion & non-WebGL fallback */
.pmap-calm { height: auto; }
.pmap-calm .pmap-sticky { position: relative; top: 0; }
.pmap-calm .pmap-hint, .pmap-calm .pmap-bar { display: none; }
.pmap-static { height: auto; }
.pmap-static .pmap-sticky { position: relative; top: 0; height: auto; max-height: none; min-height: 0; padding: clamp(20px, 3vw, 36px); }
.pmap-static .pmap-canvas,
.pmap-static .pmap-hint,
.pmap-static .pmap-bar,
.pmap-static .pmap-card { display: none; }
.pmap-static .pmap-hud { position: static; max-width: none; margin-bottom: 20px; }
.pmap-static .pmap-list {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    width: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
    overflow: visible;
}
.pmap-static .pmap-list .gm {
    display: inline-block;
    margin: 6px 0 0 4px;
    font-size: 12px;
    color: #e6c98f;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.pmap-static .pmap-skip { position: static; display: inline-block; margin-top: 16px; }
@media (prefers-reduced-motion: reduce) {
    .pin-dot::after { animation: none; }
    .pmap-canvas { transition: none; }
}

/* Shading gradients */
.pmap-sticky::before {
    content: "";
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    top: 0;
    height: clamp(220px, 44%, 380px);
    background: linear-gradient(rgba(5, 5, 5, .88), rgba(5, 5, 5, .55) 55%, rgba(5, 5, 5, 0));
    pointer-events: none;
}
.pmap-sticky::after {
    content: "";
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: linear-gradient(rgba(5, 5, 5, 0), rgba(5, 5, 5, .7));
    pointer-events: none;
}
.pmap .maplibregl-ctrl-attrib,
.pmap .maplibregl-ctrl-attrib.maplibregl-compact,
.pmap .maplibregl-ctrl-attrib.maplibregl-compact-show {
    background: rgba(8, 6, 3, .82);
    color: #cdb88c;
    border-radius: 6px;
    margin: 0 8px 8px 0;
    z-index: 6;
}
.pmap .maplibregl-ctrl-attrib a { color: #e6c98f; }
.pmap .maplibregl-ctrl-attrib-button { filter: invert(1) sepia(.6) brightness(.9); }

/* Starry space background */
.pmap-space {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(ellipse at 78% 24%, #31456b24, transparent 50%), url('/assets/oba-project-map/oba-space-v1.svg') center/cover no-repeat;
    opacity: var(--space-opacity, 1);
    mask-image: radial-gradient(circle at 50% 50%, transparent var(--planet-radius, 260px), #000 calc(var(--planet-radius, 260px) + 24px));
    -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent var(--planet-radius, 260px), #000 calc(var(--planet-radius, 260px) + 24px));
}
.pmap-static .pmap-space { mask-image: none; -webkit-mask-image: none; opacity: .55; }
.pmap-sticky::before {
    right: auto;
    width: min(480px, 46%);
    height: clamp(180px, 32%, 260px);
    background: radial-gradient(ellipse at top left, #030811b3, transparent 75%);
}
.pmap-final .pmap-sticky::before {
    height: 180px;
    background: radial-gradient(ellipse at top left, #030811c9, transparent 76%);
}
@media (max-width: 760px) {
    .pmap-sticky::before {
        width: 100%;
        height: 300px;
        background: linear-gradient(#030811b3, transparent);
    }
    .pmap-final .pmap-sticky::before { height: 180px; }
}

/* Intro typography scroll animations */
.pmap-hud h1,
.pmap-hud .eyebrow {
    opacity: var(--intro-alpha, 1);
    transform: translateY(var(--intro-rise, 0px));
    transition: none;
}
.pmap-final .pmap-hud h1 { font-size: clamp(28px, 4.2vw, 58px); }
.pmap-final .pmap-hud .eyebrow { height: auto; margin-bottom: 10px; opacity: var(--intro-alpha, 0); }
.pmap-caption { opacity: var(--caption-alpha, 1); transition: none; }
.pmap-sticky::before { opacity: var(--intro-alpha, 1); }
.pmap-final .pmap-sticky::before { opacity: 0; }
.pmap-static .pmap-hud h1,
.pmap-static .pmap-hud .eyebrow,
.pmap-static .pmap-caption { opacity: 1; transform: none; }
