/* Estilos de la parte pública de Recursos gratuitos (index.php y detalle.php). Reutiliza las
   variables de color/sombra de diplomatura/style.css, mismo criterio que el resto del sitio. */

.rg-hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-main));
    padding: 70px 20px;
    color: white;
    text-align: center;
}

.rg-hero-inner {
    max-width: 700px;
    margin: 0 auto;
}

.rg-hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    padding: 5px 16px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.rg-hero h1 {
    color: white;
    font-size: 2.4rem;
    margin: 0 0 10px;
}

.rg-hero-sub {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    margin: 0;
}

/* --- Grilla --- */
.rg-grid-section {
    padding: 60px 20px 90px;
    background: var(--bg-light);
}

.rg-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 320px));
    justify-content: center;
    gap: 26px;
}

.rg-card {
    background: white;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid #f0f0f0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.rg-card:hover {
    transform: var(--hover-lift);
    box-shadow: var(--shadow-hover);
}

.rg-card-imagen {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

.rg-card-imagen-vacia {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    color: var(--primary-light);
    font-size: 2.4rem;
}

.rg-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: center;
    text-align: center;
}

.rg-card-titulo {
    color: var(--primary-dark);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 16px;
    flex-grow: 1;
}

.rg-btn-ingresar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 28px;
    background: var(--accent-pink);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    transition: background 0.25s ease, transform 0.25s ease;
}

.rg-btn-ingresar:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.rg-vacio {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: var(--radius-card);
    color: var(--text-muted);
    border: 1px dashed var(--primary-light);
}

/* --- Detalle --- */
.rg-detalle-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-main));
    padding: 46px 20px 90px;
    text-align: center;
    color: white;
}

.rg-volver {
    display: inline-block;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.rg-volver:hover {
    color: white;
}

.rg-detalle-titulo {
    font-size: 2.2rem;
    color: white;
    margin: 14px auto 0;
    line-height: 1.25;
    max-width: 800px;
}

.rg-detalle-container {
    max-width: 900px;
    margin: -70px auto 60px;
    padding: 0 20px 20px;
    position: relative;
}

.rg-content-area {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.rg-video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.rg-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.rg-portada-container {
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
}

.rg-portada-container img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.rg-descripcion {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
}

/* Portada/video y descripción quedan SIEMPRE visibles, fuera del área con blur — solo el
   contenido descargable (galería, archivos, links) está detrás del formulario de acceso. */
.rg-descripcion-libre {
    background: white;
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.rg-gateado-vacio {
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
}

/* --- Tarjeta "Este recurso incluye" (siempre visible, reemplaza al gate con blur) --- */
.rg-incluye-card {
    background: var(--bg-light);
    border: 1px solid #ede4ea;
    border-radius: 20px;
    padding: 34px 40px;
    margin-bottom: 24px;
    text-align: center;
}

.rg-incluye-titulo {
    color: var(--primary-dark);
    font-size: 1.15rem;
    margin: 0 0 18px;
}

.rg-incluye-lista {
    list-style: none;
    margin: 0 0 26px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.rg-incluye-lista li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dark);
    font-size: 0.98rem;
}

.rg-incluye-lista i {
    color: var(--accent-pink);
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.rg-incluye-vacio {
    color: var(--text-muted);
    margin: 0 0 26px;
}

.rg-btn-acceder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 36px;
    background: var(--accent-pink);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.02rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.rg-btn-acceder:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.rg-seccion-titulo {
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin: 30px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* El contenido real del recurso (lo que la persona vino a buscar) tiene que pesar más que
   cualquier otra cosa en la página — incluida la invitación a la comunidad de WhatsApp. */
.rg-recurso-card {
    background: linear-gradient(135deg, rgba(124, 74, 143, 0.05), rgba(207, 128, 169, 0.05));
    border: 1px solid #f0e4ec;
    border-radius: 16px;
    padding: 28px;
    margin-top: 24px;
}

.rg-recurso-card:first-child {
    margin-top: 0;
}

.rg-recurso-card .rg-seccion-titulo {
    margin-top: 0;
    font-size: 1.3rem;
}

.rg-recurso-card .rg-seccion-titulo i {
    color: var(--accent-pink);
    font-size: 1.05rem;
}

.rg-recurso-card .rg-archivo-item {
    background: white;
    border: 1px solid #f0e4ec;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    padding: 18px 20px;
    font-weight: 600;
    font-size: 1.02rem;
}

.rg-recurso-card .rg-archivo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.rg-recurso-card .rg-archivo-item > i:first-child {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-pink);
    color: white;
    border-radius: 10px;
    font-size: 1.05rem;
}

.rg-galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.rg-galeria-grid img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.rg-archivo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 10px;
    text-decoration: none;
    color: var(--text-dark);
    transition: background 0.2s;
}

.rg-archivo-item:hover {
    background: var(--bg-alt);
}

.rg-archivo-item i {
    color: var(--primary-main);
    font-size: 1.2rem;
}

.rg-archivo-audio {
    flex-direction: column;
    align-items: flex-start;
}

.rg-archivo-audio audio {
    width: 100%;
}

/* --- CTA "Comunidad de Terapeutas" (WhatsApp) — franja discreta al final del contenido, en
   todos los recursos gratuitos. A propósito más chica y sobria que las secciones de arriba: el
   recurso que la persona vino a buscar tiene que ser lo que más pese en la página. --- */
.rg-comunidad-cta {
    margin-top: 24px;
    padding: 16px 20px;
    background: var(--bg-light);
    border: 1px solid #eee;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.rg-comunidad-icon {
    color: #25d366;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.rg-comunidad-texto {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 200px;
}

.rg-comunidad-texto strong {
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 700;
}

.rg-comunidad-texto span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.rg-btn-comunidad {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 22px;
    background: #25d366;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: background 0.25s ease;
}

.rg-btn-comunidad:hover {
    background: #1da851;
    transform: translateY(-2px);
}

/* --- Modal de acceso (mail + perfil) — mismo lenguaje visual que includes/modal_cuenta.php:
   overlay sólido (sin blur) + caja blanca centrada, oculto hasta que se pide el acceso. --- */
.rg-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(74, 44, 94, 0.55);
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.rg-modal-overlay.open {
    display: flex;
}

.rg-modal-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    text-align: center;
    max-width: 420px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.rg-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.rg-modal-close:hover {
    color: var(--primary-dark);
}

.rg-access-step h3 {
    color: var(--primary-main);
    margin-top: 0;
}

.rg-modal-sub {
    color: var(--text-muted);
    margin: 0 0 22px;
    line-height: 1.6;
}

.rg-form-group {
    margin-bottom: 18px;
    text-align: left;
}

.rg-form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.rg-form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.rg-radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.rg-radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.92rem;
}

.rg-btn-submit {
    display: block;
    width: 100%;
    padding: 13px;
    background: var(--accent-pink);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.rg-btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* intl-tel-input necesita que su contenedor no le recorte el dropdown de países */
.iti {
    width: 100%;
}
