/* ============================================================
   PI Sync — Comunas (frontend)
   Template de archivo de comuna + shortcode [pi_comunas]
   ============================================================ */

/* ── Archive / Template de una comuna ───────────────────── */
.pi-comuna-archive { max-width: 1400px; margin: 0 auto; padding: 0 20px 60px; }

/* Hero con imagen */
.pi-comuna-hero {
    position: relative;
    height: 320px;
    border-radius: 16px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    margin-bottom: 40px;
}
.pi-comuna-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, .2) 100%);
}
.pi-comuna-hero__content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px 40px;
}
.pi-comuna-hero__title {
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.pi-comuna-hero__region,
.pi-comuna-hero__count {
    font-size: 16px;
    color: rgba(255, 255, 255, .85);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Header sin imagen */
.pi-comuna-header { padding: 40px 0 24px; border-bottom: 1px solid #eee; margin-bottom: 32px; }
.pi-comuna-header__title { font-size: clamp(24px, 4vw, 42px); font-weight: 800; margin: 0 0 8px; }
.pi-comuna-header__region,
.pi-comuna-header__count {
    font-size: 14px;
    color: #666;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pi-comuna-header__region i,
.pi-comuna-header__count i { color: var(--rb-primary, #1b4f72); }

/* Descripción */
.pi-comuna-desc {
    background: #f8f9fa;
    border-left: 3px solid var(--rb-primary, #1b4f72);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 32px;
}
.pi-comuna-desc p { margin: 0; font-size: 15px; color: #444; line-height: 1.6; }

@media (max-width: 600px) {
    .pi-comuna-hero { height: 220px; }
    .pi-comuna-hero__content { padding: 20px; }
    .pi-comuna-archive { padding: 0 12px 40px; }
}

/* ── Shortcode [pi_comunas] ──────────────────────────────── */
.picm_grid {
    display: grid;
    grid-template-columns: repeat(var(--picm-cols, 3), 1fr);
    gap: 20px;
}
@media (max-width: 1024px) { .picm_grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .picm_grid { grid-template-columns: 1fr; } }

.picm_card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    text-decoration: none;
    color: inherit;
    transition: transform .2s, box-shadow .2s;
    background: #fff;
}
.picm_card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }

.picm_card__img_wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
}
.picm_card__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.picm_card:hover .picm_card__img { transform: scale(1.04); }
.picm_card__no_img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; color: #ccc; background: #f5f5f5; }
.picm_card__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .35) 0%, transparent 60%); }

.picm_card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.picm_card__title { font-size: 16px; font-weight: 700; margin: 0; color: inherit; }
.picm_card__desc { font-size: 13px; color: #666; margin: 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.picm_card__count { font-size: 12px; color: var(--rb-primary, #1b4f72); font-weight: 600; display: flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 6px; border-top: 1px solid #f0f0f0; }
