/* ═══════════════════════════════════════════════════════════════════════════
   ZE Guides Grid — v3.0
   Alineado con ze-trips: variables, tipografía editorial, imagen ancho
   completo, lightbox, tooltips sociales.
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;1,500&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────────── */
.ze-guides-wrap {
    --ze-primary:      #4A7F57;
    --ze-accent:       #CFE09B;
    --ze-accent-dark:  #3a6644;
    --ze-accent-light: #f0f7e0;
    --ze-text:         #1a1f14;
    --ze-muted:        #6b7a62;
    --ze-line:         #dde5d5;
    --ze-bg:           #f7f9f4;
    --ze-white:        #ffffff;
    --ze-radius:       12px;
    --ze-shadow:       0 2px 16px rgba(45,80,22,.08);
    --ze-shadow-hover: 0 8px 32px rgba(45,80,22,.16);
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--ze-text);
    box-sizing: border-box;
}

.ze-guides-wrap *,
.ze-guides-wrap *::before,
.ze-guides-wrap *::after {
    box-sizing: inherit;
}

/* ── Grid ───────────────────────────────────────────────────────────────────── */
.ze-guides-grid {
    display: grid;
    grid-template-columns: repeat(var(--ze-cols, 3), 1fr);
    gap: var(--ze-gap, 32px);
    align-items: start;
}

/* ── Card ───────────────────────────────────────────────────────────────────── */
.ze-guide-card {
    display: flex;
    flex-direction: column;
    background: var(--ze-white);
    border-radius: var(--ze-radius);
    overflow: hidden;
    box-shadow: var(--ze-shadow);
    transition: box-shadow .25s, transform .25s;
    will-change: transform;
}

.ze-guide-card:hover {
    box-shadow: var(--ze-shadow-hover);
    transform: translateY(-4px);
}

/* ── Imagen ─────────────────────────────────────────────────────────────────── */
.ze-guide-thumb {
    display: block;
    position: relative;
    width: 100%;
    padding-top: var(--ze-ratio, 100%);
    overflow: hidden;
    background: var(--ze-bg);
    cursor: pointer;
    flex-shrink: 0;
}

.ze-guide-thumb img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center center;
    border-radius: 0 !important;
    display: block;
    transition: transform .5s ease;
}

.ze-guide-card:hover .ze-guide-thumb img {
    transform: scale(1.05);
}

/* Overlay hover imagen */
.ze-guide-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26,31,20,.65) 0%, transparent 55%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    opacity: 0;
    transition: opacity .3s ease;
    z-index: 2;
}

.ze-guide-card:hover .ze-guide-thumb-overlay {
    opacity: 1;
}

.ze-guide-thumb-overlay-label {
    color: var(--ze-white);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ze-guide-thumb-overlay-label svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Cuerpo ─────────────────────────────────────────────────────────────────── */
.ze-guide-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ── Cargo ──────────────────────────────────────────────────────────────────── */
.ze-guide-position {
    margin: 0 0 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--ze-muted);
    line-height: 1.4;
}

/* ── Nombre ─────────────────────────────────────────────────────────────────── */
.ze-guide-name {
    margin: 0 0 10px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
}

.ze-guide-name a {
    text-decoration: none;
    color: var(--ze-text);
    transition: color .2s ease;
}

.ze-guide-name a:hover {
    color: var(--ze-primary);
}

/* ── Extracto ───────────────────────────────────────────────────────────────── */
.ze-guide-excerpt {
    font-size: 13px;
    line-height: 1.65;
    color: var(--ze-muted);
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: var(--ze-excerpt-lines, 3);
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Divisor ────────────────────────────────────────────────────────────────── */
.ze-guide-divider {
    border: none;
    border-top: 1px solid var(--ze-line);
    margin: 0 0 12px !important;
}

/* ── Footer: socials + CTA ──────────────────────────────────────────────────── */
.ze-guide-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

/* ── Sociales ───────────────────────────────────────────────────────────────── */
.ze-guide-socials {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.ze-guide-social-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 13px;
    color: var(--ze-primary);
    text-decoration: none;
    border-radius: 50%;
    transition: color .2s ease, background-color .2s ease;
}

.ze-guide-social-link:hover {
    color: var(--ze-white);
    background-color: var(--ze-primary);
}

/* Tooltip */
.ze-guide-social-link::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(26,31,20,.88);
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 10;
}

.ze-guide-social-link:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── CTA ────────────────────────────────────────────────────────────────────── */
.ze-guide-cta {
    display: inline-block;
    flex-shrink: 0;
    padding: 7px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ze-white);
    background-color: var(--ze-primary);
    border-radius: 20px;
    transition: background-color .2s ease, color .2s ease;
    line-height: 1.4;
    white-space: nowrap;
}

.ze-guide-cta:hover {
    background-color: var(--ze-accent-dark);
    color: var(--ze-white);
}

/* ════════════════════════════════════════════════════════════════════════════
   LIGHTBOX
   ════════════════════════════════════════════════════════════════════════════ */

.ze-guide-lb-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10,14,8,.72);
    backdrop-filter: blur(4px);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}

.ze-guide-lb-backdrop.ze-lb-visible {
    opacity: 1;
    pointer-events: all;
}

.ze-guide-lb {
    background: var(--ze-white, #fff);
    border-radius: 12px;
    overflow: hidden;
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: row;
    box-shadow: 0 24px 64px rgba(0,0,0,.28);
    transform: translateY(16px) scale(.98);
    transition: transform .28s ease;
    position: relative;
    --ze-primary:      #4A7F57;
    --ze-accent-dark:  #3a6644;
    --ze-accent-light: #f0f7e0;
    --ze-text:         #1a1f14;
    --ze-muted:        #6b7a62;
    --ze-line:         #dde5d5;
    --ze-bg:           #f7f9f4;
    --ze-white:        #ffffff;
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--ze-text);
    min-height: 40vh;
}

.ze-guide-lb-backdrop.ze-lb-visible .ze-guide-lb {
    transform: translateY(0) scale(1);
}

/* Cerrar */
.ze-lb-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background .2s;
    padding: 0;
}

.ze-lb-close:hover { background: var(--ze-accent-light); }

.ze-lb-close svg {
    width: 16px;
    height: 16px;
    stroke: var(--ze-text);
    stroke-width: 2;
    fill: none;
}

/* Foto lateral izquierda — ocupa toda la altura del modal */
.ze-lb-header {
    position: relative;
    width: 350px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--ze-bg);
}

.ze-lb-header img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.ze-lb-header-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26,31,20,.75) 0%, transparent 45%);
    z-index: 2;
}

.ze-lb-header-info {
    position: absolute;
    bottom: 20px;
    left: 18px;
    right: 18px;
    z-index: 3;
    color: var(--ze-white);
}

.ze-lb-header-position {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .8;
    margin-bottom: 5px;
}

.ze-lb-header-name {
    font-family: 'Quinlee Sans Regular', Georgia, serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    margin: 0;
    color: var(--ze-white);
}


/* Cuerpo derecho scrollable */
.ze-lb-body {
    flex: 1;
    min-width: 0;
    padding: 28px 26px 28px;
    overflow-y: auto;
    max-height: 90vh;
}

.ze-lb-excerpt {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ze-muted);
    margin: 0 0 20px;
}

/* Socials en lightbox */
.ze-lb-socials {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.ze-lb-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 14px;
    color: var(--ze-primary);
    border: 1px solid var(--ze-line);
    border-radius: 50%;
    text-decoration: none;
    transition: background .2s, color .2s, border-color .2s;
}

.ze-lb-socials a:hover {
    background: var(--ze-primary);
    color: var(--ze-white);
    border-color: var(--ze-primary);
}

/* Viajes */
.ze-lb-trips-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--ze-muted);
    margin: 0 0 12px;
}

.ze-lb-trips-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.ze-lb-trip-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: var(--ze-bg);
    border-radius: 8px;
    border-left: 3px solid var(--ze-primary);
    text-decoration: none;
    transition: background .2s;
}

.ze-lb-trip-row:hover {
    background: var(--ze-accent-light);
}

.ze-lb-trip-info {
    flex: 1;
    min-width: 0;
}

.ze-lb-trip-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ze-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.ze-lb-trip-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ze-lb-trip-date {
    font-size: 11px;
    color: var(--ze-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ze-lb-trip-seats {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--ze-accent-light);
    color: var(--ze-primary);
}

.ze-lb-trip-seats--urgent {
    background: rgba(192,57,43,.1);
    color: #c0392b;
}

.ze-lb-trip-seats--full {
    background: rgba(100,100,100,.1);
    color: var(--ze-muted);
}

.ze-lb-trip-arrow {
    color: var(--ze-muted);
    font-size: 16px;
    flex-shrink: 0;
    transition: transform .2s, color .2s;
    line-height: 1;
}

.ze-lb-trip-row:hover .ze-lb-trip-arrow {
    transform: translateX(3px);
    color: var(--ze-primary);
}

/* CTA perfil */
.ze-lb-profile-cta {
    display: inline-block;
    padding: 10px 24px;
    background: var(--ze-primary);
    color: var(--ze-white);
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: background .2s;
}

.ze-lb-profile-cta:hover {
    background: var(--ze-accent-dark);
    color: var(--ze-white);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .ze-guides-grid {
        grid-template-columns: repeat(var(--ze-cols-tablet, 2), 1fr);
    }
}

@media (max-width: 600px) {

    /* Grid: forzar 1 columna en mobile */
    .ze-guides-grid {
        grid-template-columns: 1fr !important;
    }

    /* Card horizontal: foto izquierda, contenido derecha */
    .ze-guide-card {
        flex-direction: row;
        align-items: stretch;
        min-height: 130px;
    }

    /* Imagen: ancho fijo, altura automática */
    .ze-guide-thumb {
        width: 110px;
        flex-shrink: 0;
        padding-top: 0;          /* anula el ratio 1:1 del desktop */
        height: auto;
        min-height: 130px;
    }

    .ze-guide-thumb img {
        position: absolute;
        inset: 0;
        width: 100% !important;
        height: 100% !important;
    }

    /* Ocultar overlay en mobile (no hay hover táctil real) */
    .ze-guide-thumb-overlay {
        display: none;
    }

    /* Cuerpo derecho */
    .ze-guide-body {
        padding: 12px 14px 12px;
        flex: 1;
        min-width: 0;
    }

    /* Ajustar tipografías para el espacio reducido */
    .ze-guide-name {
        font-size: 15px;
        margin-bottom: 4px;
    }

    .ze-guide-excerpt {
        font-size: 12px;
        -webkit-line-clamp: 2;
        margin-bottom: 8px;
    }

    /* Footer: wrap para que CTA no desborde */
    .ze-guide-footer {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* CTA: texto normal, ocupa el ancho disponible si es necesario */
    .ze-guide-cta {
        white-space: normal;
        text-align: center;
        font-size: 10px;
        padding: 5px 10px;
        flex-shrink: 1;
        min-width: 0;
    }

    /* Lightbox en mobile: columna, foto arriba */
    .ze-guide-lb {
        flex-direction: column;
        max-height: 85vh;
    }

    .ze-lb-header {
        width: 100%;
        height: 45vh;
        flex-shrink: 0;
    }

    .ze-lb-body {
        max-height: none;
        padding: 18px 18px 24px;
    }

    .ze-lb-header-name { font-size: 20px; }
}
