/* ============================================================
 *  public/css/page-blocks.css
 *  Estilos para el renderizado de bloques dinámicos (Frontend)
 *  Regla 3: CSS modular y premium
 * ============================================================ */

:root {
    --pb-spacing: 2.5rem;
}

.pb-container {
    display: flex;
    flex-direction: column;
    gap: var(--pb-spacing);
    width: 100%;
    margin-bottom: var(--pb-spacing);
}

/* ── Bloque base ─────────────────────────────────────────── */
.pb-block {
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box;
    position: relative;
    transition: opacity 0.3s;
}

/* ── Heading ─────────────────────────────────────────────── */
.pb-block--heading h1, .pb-block--heading h2, .pb-block--heading h3 {
    margin: 0;
    line-height: 1.2;
    color: var(--primary-dark);
}

/* ── Rich Text ───────────────────────────────────────────── */
.pb-rich-text {
    line-height: 1.6;
    color: var(--text-color);
}

.pb-rich-text p { margin-bottom: 1rem; }
.pb-rich-text p:last-child { margin-bottom: 0; }

/* ── Image ───────────────────────────────────────────────── */
.pb-figure {
    margin: 0 auto;
    overflow: hidden;
}

.pb-figure img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.pb-figure figcaption {
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color: var(--text-soft);
    text-align: center;
    font-style: italic;
}

/* ── Video ───────────────────────────────────────────────── */
.pb-video-wrap {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.pb-video-wrap iframe, .pb-video-wrap video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Button ──────────────────────────────────────────────── */
.pb-btn-wrap {
    margin: 1rem 0;
}

.pb-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pb-btn--primary {
    background: var(--primary-color);
    color: white;
}

.pb-btn--primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 114, 69, 0.3);
}

.pb-btn--secondary {
    background: var(--secondary-color);
    color: white;
}

.pb-btn--outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.pb-btn--outline:hover {
    background: var(--primary-color);
    color: white;
}

/* ── Separator ───────────────────────────────────────────── */
.pb-separator {
    width: 100%;
    height: 1px;
    background: rgba(0,0,0,0.05);
    margin: 1rem 0;
}

.pb-separator--dots {
    background: transparent;
    border-top: 2px dotted rgba(0,0,0,0.1);
    height: 0;
}

.pb-separator--space {
    background: transparent;
    height: 2rem;
}

/* ── Hero ────────────────────────────────────────────────── */
.pb-hero {
    padding: 6rem 2rem;
    border-radius: 20px;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.pb-hero__title {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.pb-hero__sub {
    font-size: 1.25rem;
    max-width: 800px;
    opacity: 0.9;
}

/* ── Card ────────────────────────────────────────────────── */
.pb-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.3s;
}

.pb-card:hover {
    transform: translateY(-5px);
}

.pb-card__icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.pb-card__title {
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

/* ── Columns ─────────────────────────────────────────────── */
.pb-columns {
    display: grid;
    gap: 2rem;
}

.pb-columns--2 { grid-template-columns: 1fr 1fr; }
.pb-columns--3 { grid-template-columns: 1fr 1fr 1fr; }
.pb-columns--4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

@media (max-width: 768px) {
    .pb-columns--2, .pb-columns--3, .pb-columns--4 {
        grid-template-columns: 1fr;
    }
    .pb-hero__title { font-size: 2rem; }
}

/* ── Container Block ─────────────────────────────────────── */
.pb-container-block {
    padding: 1rem;
    border-radius: 12px;
}

/* ── Dynamic Slider ──────────────────────────────────────── */
.pb-dynamic-slider {
    position: relative;
    width: 100%;
    height: 450px;
    border-radius: 16px;
    overflow: hidden;
    background: #f0f0f0;
}

.pb-ds-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pb-ds-slide.active {
    opacity: 1;
    z-index: 1;
}

.pb-ds-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pb-ds-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    font-size: 1.25rem;
    text-align: center;
}

.pb-slider-placeholder {
    padding: 4rem 2rem;
    background: rgba(0,0,0,0.03);
    border: 2px dashed rgba(0,0,0,0.1);
    border-radius: 16px;
    text-align: center;
    color: var(--text-soft);
}
