/**
 * Indonesia Project Map – light mode, modern panel
 */

/* ── Layout ─────────────────────────────────────────── */
.proj-map {
    margin-bottom: 48px;
}

.proj-map__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: stretch;
}

/* ── Map canvas ──────────────────────────────────────── */
.proj-map__canvas {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
    min-height: 300px;
    aspect-ratio: 16 / 7;
}

#indonesia-leaflet-map {
    width: 100%;
    height: 100%;
    min-height: 300px;
    border-radius: 16px;
}

/* ── Leaflet controls – light themed ────────────────── */
.leaflet-control-zoom {
    border: none !important;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}

.leaflet-control-zoom a {
    background: #fff !important;
    color: #253C74 !important;
    border: none !important;
    border-bottom: 1px solid #e8ecf4 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    transition: background 0.2s ease !important;
}

.leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

.leaflet-control-zoom a:hover {
    background: #f0f4ff !important;
    color: #1a2d5a !important;
}

.leaflet-control-attribution {
    background: rgba(255,255,255,0.75) !important;
    color: #999 !important;
    font-size: 0.6rem !important;
    backdrop-filter: blur(4px) !important;
    border-radius: 6px 0 0 0 !important;
}

.leaflet-control-attribution a {
    color: #666 !important;
}

/* ── Marker ──────────────────────────────────────────── */
.proj-lf-marker {
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.3));
}

.proj-lf-marker svg circle:first-child {
    animation: projMarkerPulseLight 2.8s ease-out infinite;
}

.proj-lf-marker--active svg circle:first-child,
.proj-lf-marker:hover svg circle:first-child {
    animation: none;
}

.proj-lf-marker:hover {
    transform: scale(1.3);
    filter: drop-shadow(0 4px 10px rgba(37, 60, 116, 0.45));
}

.proj-lf-marker--active {
    transform: scale(1.25);
    filter: drop-shadow(0 4px 14px rgba(37, 60, 116, 0.55));
}

@keyframes projMarkerPulseLight {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}

/* ── Panel ───────────────────────────────────────────── */
.proj-map__panel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 20px;
    padding: 0;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 220px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

/* ── Placeholder state ───────────────────────────────── */
.proj-map__panel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 28px;
    height: 100%;
    gap: 12px;
}

.proj-map__placeholder-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 223, 8, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.proj-map__placeholder-icon .icon {
    font-size: 1.5rem;
    color: #FFdf08;
    line-height: 1;
}

.proj-map__placeholder-title {
    font-family: "Archivo", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.proj-map__placeholder-text {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.65;
    margin: 0;
    max-width: 260px;
}

/* ── Detail card ─────────────────────────────────────── */
.proj-map__detail {
    display: none;
    padding: 0;
    height: 100%;
    animation: projDetailIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.proj-map__detail.is-visible {
    display: flex;
    flex-direction: column;
}

/* Colored accent stripe based on category */
.proj-map__detail::before {
    content: "";
    display: block;
    height: 4px;
    width: 100%;
    background: var(--cat-color, #253C74);
    flex-shrink: 0;
}

.proj-map__detail[data-category="architecture"]  { --cat-color: #253C74; }
.proj-map__detail[data-category="civil"]         { --cat-color: #1a6b45; }
.proj-map__detail[data-category="infrastructure"]{ --cat-color: #b45309; }
.proj-map__detail[data-category="specialty"]     { --cat-color: #6d28d9; }

.proj-map__detail-inner {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

/* Head row: badge + close */
.proj-map__detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}

.proj-map__detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: "Archivo", sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 100px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.proj-map__detail-close {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
    line-height: 1;
    padding: 0;
}

.proj-map__detail-close:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Title */
.proj-map__detail-title {
    font-family: "Archivo", sans-serif;
    font-size: clamp(1.0625rem, 2.2vw, 1.375rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin: 0 0 12px;
}

/* Meta row: city + year */
.proj-map__detail-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.proj-map__detail-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78125rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    white-space: nowrap;
}

.proj-map__detail-meta-item svg {
    flex-shrink: 0;
    opacity: 0.75;
}

.proj-map__detail-meta-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    flex-shrink: 0;
}

/* Divider */
.proj-map__detail-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0 0 14px;
}

/* Description */
.proj-map__detail-text {
    font-size: 0.8125rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    flex: 1;
}

/* ── Animations ──────────────────────────────────────── */
@keyframes projDetailIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Responsive ──────────────────────────────────────── */
@media screen and (min-width: 768px) {
    .proj-map__detail-inner {
        padding: 22px 28px 28px;
    }
}

@media screen and (min-width: 992px) {
    .proj-map__layout {
        grid-template-columns: 1.5fr 1fr;
        gap: 24px;
    }

    .proj-map__canvas {
        min-height: 340px;
    }

    .proj-map__panel {
        min-height: 300px;
    }
}

@media screen and (min-width: 1200px) {
    .proj-map__layout {
        grid-template-columns: 1.6fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .proj-lf-marker,
    .proj-lf-marker svg circle:first-child,
    .proj-map__detail {
        animation: none;
        transition: none;
    }
}
