/**
 * usermap — PlaceMap Article Guide
 * Ruta FTP: templates/usermap/css/placemap-article.css
 *
 * TABLA DE CONTENIDOS:
 * 1. Contrato del archivo
 * 2. Layout base del articulo con mapa
 * 3. Sheet inferior
 * 4. Switch dia/noche
 * 5. Carrusel y tarjetas de pines
 * 6. Controles Leaflet dentro del articulo
 * 7. Popup Leaflet dentro del articulo
 * 8. Popup PlaceMap heredado del componente
 * 9. Responsive
 *
 * CONTRATO:
 * Este CSS afecta solo al layout de articulo Joomla que carga
 * `default_mapa_guide.php` desde el template `usermap`.
 *
 * No debe contener logica del componente ni estilos globales de Joomla.
 * La vista publica del componente conserva su CSS base en:
 * `media/com_placemap/css/placemap.css`.
 */

/* ═══════════════════════════════════════════════════════════════
   2. Layout base del articulo con mapa
   El articulo ocupa viewport completo y deja el mapa como fondo.
═══════════════════════════════════════════════════════════════ */
.pm-article-root {
    background: #050505;
    color: #1d1d1f;
}

.pm-map-layer {
    background: #050505;
}

/* ═══════════════════════════════════════════════════════════════
   3. Sheet inferior del articulo

   Clase legacy usada por el JS: `.pm-sheet`.
   Nombre conceptual: ArticlePlaceSheet.

   Este panel pertenece al articulo Joomla, no a la vista publica generica
   de `com_placemap`. Por eso sus ajustes viven en el template usermap.
═══════════════════════════════════════════════════════════════ */
.pm-sheet {
    --pm-card-width: 168px;
    --pm-card-img-h: 104px;
    --pm-sheet-handle-h: 74px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -18px 52px rgba(0, 0, 0, 0.22);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
}

.pm-sheet-handle {
    height: var(--pm-sheet-handle-h);
    align-items: center !important;
    gap: 12px;
    padding: 16px 18px 10px;
}

.pm-sheet-handle::before {
    top: 8px;
    width: 38px;
    height: 5px;
    background: rgba(60, 60, 67, 0.24);
}

.pm-sheet-thumb {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f5f5f7;
    box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.08);
}

.pm-sheet-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.pm-sheet-title-wrap {
    flex: 1;
    min-width: 0;
}

.pm-sheet-title {
    color: #1d1d1f;
    font-size: 15px;
    font-weight: 760;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-sheet-drag-hint {
    margin-top: 4px;
    color: #6e6e73;
    font-size: 11px;
    font-weight: 520;
}

/* ═══════════════════════════════════════════════════════════════
   4. Control dia/noche del sheet

   Clases legacy usadas por PHP/JS:
   - `.pm-sheet-switch`
   - `.pm-sheet-switch-btn`
   - `.active-day`
   - `.active-night`

   El JS solo alterna clases; la decision visual vive aqui.
═══════════════════════════════════════════════════════════════ */
.pm-sheet-switch {
    background: rgba(118, 118, 128, 0.12);
    border: 1px solid rgba(60, 60, 67, 0.08);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.pm-sheet-switch-btn {
    min-width: 34px;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #6e6e73;
    font-size: 13px;
    line-height: 1;
}

.pm-sheet-switch-btn.active-day,
.pm-sheet-switch-btn.active-night {
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.pm-sheet-switch-btn.active-day {
    background: #ff9f0a;
}

.pm-sheet-switch-btn.active-night {
    background: #1d1d1f;
}

/* ═══════════════════════════════════════════════════════════════
   5. Carrusel y tarjetas de pines del articulo

   Clases legacy usadas por PHP/JS:
   - `.pm-pin-carousel`: rail horizontal de pines.
   - `.pm-pin-card`: tarjeta clicable que enfoca un pin.
   - `.pm-pin-card-img`: foto o icono/emoji del lugar.
   - `.pm-pin-card-body`: contenido textual.
   - `.pm-pin-card-name`: nombre del lugar.
   - `.pm-pin-card-comt`: comentario editorial de la Guide.

   El modo noche reconstruye tarjetas desde JS con estas mismas clases.
═══════════════════════════════════════════════════════════════ */
.pm-pin-carousel {
    gap: 10px;
    padding: 12px 18px 10px;
}

.pm-pin-card {
    width: var(--pm-card-width);
    border: 1px solid rgba(60, 60, 67, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.pm-pin-card:hover,
.pm-pin-card.active {
    border-color: rgba(10, 132, 255, 0.55);
    transform: translateY(-1px);
}

.pm-pin-card.active {
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.14);
}

.pm-pin-card-img {
    height: var(--pm-card-img-h);
    font-size: 28px;
}

.pm-pin-card-body {
    padding: 9px 10px 11px;
}

.pm-pin-card-name {
    color: #1d1d1f;
    font-size: 13px;
    font-weight: 760;
    line-height: 1.25;
}

.pm-pin-card-stars {
    color: #ffcc00;
    font-size: 10px;
}

.pm-pin-card-comt {
    margin-top: 6px;
    padding: 5px 7px;
    border-left: 0;
    border-radius: 9px;
    background: #f5f5f7;
    color: #3a3a3c;
    font-size: 11px;
    font-weight: 560;
}

.pm-article-content {
    padding: 0 18px 42px;
    color: #3a3a3c;
    font-size: 14px;
    line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════
   6. Controles Leaflet dentro del articulo

   El componente emite clases funcionales:
   - `.pm-menu-wrap`
   - `.pm-menu-btn`
   - `.pm-sub`
   - `.pm-mi`

   Aqui vive el acabado visual del visor de articulo: estilo app,
   blanco translucido, blur, radios amplios y sombras limpias.
═══════════════════════════════════════════════════════════════ */
.pm-article-root .pm-menu-wrap {
    gap: 8px;
}

.pm-article-root .pm-menu-btn,
.pm-article-root .pm-mi {
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.pm-article-root .pm-menu-btn {
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0 14px;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(60, 60, 67, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #1d1d1f;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    font-size: 13px;
    line-height: 1;
}

.pm-article-root .pm-menu-btn-icon,
.pm-article-root .pm-mi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #1d1d1f;
}

.pm-article-root .pm-menu-btn-icon svg,
.pm-article-root .pm-mi-icon svg {
    display: block;
}

.pm-article-root .pm-menu-btn-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-article-root .pm-sub {
    gap: 6px;
    min-width: 178px;
    padding: 7px;
    border: 1px solid rgba(60, 60, 67, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.16);
}

.pm-article-root .pm-mi {
    min-height: 38px;
    height: 38px;
    padding: 0 10px;
    gap: 10px;
    border-radius: 12px;
    background: transparent;
    color: #1d1d1f;
    box-shadow: none;
    font-size: 13px;
    font-weight: 650;
    transition: background 0.2s ease, color 0.2s ease;
}

.pm-article-root .pm-mi:hover {
    background: rgba(118, 118, 128, 0.12);
    color: #000;
}

.pm-article-root .pm-mi-danger,
.pm-article-root .pm-mi-danger .pm-mi-icon,
.pm-article-root .pm-mi-danger .pm-mi-label {
    color: #d70015;
}

/* ═══════════════════════════════════════════════════════════════
   7. Popup Leaflet dentro del articulo

   Leaflet genera varias capas propias:
   - `.leaflet-popup-content-wrapper`
   - `.leaflet-popup-content`
   - `.leaflet-popup-tip`

   Estas reglas fuerzan fondo blanco real solo dentro del visor de articulo.
   Evitan que temas externos, modo oscuro o reglas antiguas tiñan el popup.
═══════════════════════════════════════════════════════════════ */
.pm-article-root .leaflet-popup-content-wrapper,
.pm-article-root .leaflet-popup-tip {
    background: #fff !important;
    color: #1d1d1f !important;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.pm-article-root .leaflet-popup-content-wrapper {
    border-radius: 16px;
    overflow: hidden;
}

.pm-article-root .leaflet-popup-content {
    margin: 0 !important;
    background: #fff !important;
    color: #1d1d1f !important;
}

/* ═══════════════════════════════════════════════════════════════
   8. Popup PlaceMap heredado del componente

   `.pm-pop*` viene del template del componente. Aqui no se cambia su HTML:
   solo se adapta cuando aparece dentro del articulo Joomla con mapa.
═══════════════════════════════════════════════════════════════ */
.pm-article-root .pm-pop {
    background: #fff;
    color: #1d1d1f;
    padding: 12px;
    box-sizing: border-box;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.pm-article-root .pm-pop-title {
    color: #1d1d1f;
    font-size: 15px;
    font-weight: 780;
}

.pm-article-root .pm-pop-comt {
    border-left: 0;
    border-radius: 10px;
    background: #f5f5f7;
    color: #3a3a3c;
    font-weight: 560;
}

.pm-article-root .pm-pop-btn {
    border-radius: 10px;
    font-weight: 700;
}

.pm-article-root .pm-pop-btn-main {
    background: #0a84ff;
}

/* ═══════════════════════════════════════════════════════════════
   9. Responsive
   Ajustes moviles para que el sheet no coma demasiado mapa.
═══════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .pm-sheet {
        --pm-card-width: 154px;
        --pm-card-img-h: 92px;
        border-radius: 22px 22px 0 0;
    }

    .pm-pin-carousel {
        padding-left: 14px;
        padding-right: 14px;
    }

    .pm-article-root .pm-menu-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        padding: 0;
    }

    .pm-article-root .pm-menu-btn-label {
        display: none;
    }

    .pm-article-root .pm-menu-btn-icon svg {
        width: 17px;
        height: 17px;
    }
}
