/* ============================================================================
   ESTILOS PROPIOS · Asociación de Vecinos Cal Gravat
   ----------------------------------------------------------------------------
   Aquí se define el aspecto visual de la web. Los COLORES principales están
   agrupados arriba en "variables": cambia un valor y se actualiza toda la web.
   ========================================================================== */

:root {
    --verde:        #2f7d52;   /* color principal */
    --verde-oscuro: #1d5236;
    --verde-claro:  #e8f3ec;
    --tierra:       #c8893b;   /* color de acento (botones secundarios) */
    --texto:        #243029;
    --gris-suave:   #f5f7f5;
    --borde:        #e2e8e3;
    --tipo-titulos: "Poppins", system-ui, sans-serif;
    --tipo-texto:   "Source Sans 3", system-ui, sans-serif;
}

/* ---- Base ---- */
body {
    font-family: var(--tipo-texto);
    color: var(--texto);
    background: #fff;
}
h1, h2, h3, h4, h5, .navbar-brand { font-family: var(--tipo-titulos); }
main { min-height: 60vh; }
a { color: var(--verde); }
a:hover { color: var(--verde-oscuro); }

.text-verde { color: var(--verde) !important; }
.bg-verde-claro { background: var(--verde-claro) !important; }

/* ---- Botones ---- */
.btn-primary {
    --bs-btn-bg: var(--verde);
    --bs-btn-border-color: var(--verde);
    --bs-btn-hover-bg: var(--verde-oscuro);
    --bs-btn-hover-border-color: var(--verde-oscuro);
    --bs-btn-active-bg: var(--verde-oscuro);
}
.btn-outline-primary {
    --bs-btn-color: var(--verde);
    --bs-btn-border-color: var(--verde);
    --bs-btn-hover-bg: var(--verde);
    --bs-btn-hover-border-color: var(--verde);
}
.btn-tierra {
    background: var(--tierra); color: #fff; border: 1px solid var(--tierra);
}
.btn-tierra:hover { background: #ab742f; color: #fff; }

/* ---- Barra superior ---- */
.barra-superior {
    background: var(--verde-oscuro);
    color: #eaf3ed;
    font-size: .82rem;
    letter-spacing: .01em;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.barra-superior a { color: #eaf3ed; text-decoration: none; transition: color .15s; }
.barra-superior a:hover { color: #fff; }
.barra-superior i { color: var(--tierra); }
.barra-superior .bi-instagram,
.barra-superior .bi-facebook,
.barra-superior .bi-whatsapp { color: #eaf3ed; font-size: 1.05rem; transition: color .15s, transform .15s; }
.barra-superior a:hover .bi-instagram,
.barra-superior a:hover .bi-facebook,
.barra-superior a:hover .bi-whatsapp { color: #fff; transform: translateY(-1px); }

/* ---- Menú ---- */
.navbar-principal {
    background: #d8eaff;
    box-shadow: 0 1px 0 var(--borde), 0 4px 18px rgba(20,58,40,.06);
    padding: .35rem 0;
    transition: box-shadow .2s, padding .2s;
}
.navbar-principal .navbar-brand img {
    height: 72px;
    width: auto;
    transition: height .2s;
}
.marca-texto { display: flex; flex-direction: column; line-height: 1.05; }
.marca-texto strong {
    color: var(--verde-oscuro);
    font-size: 1.3rem;
    letter-spacing: -.01em;
}
.marca-texto small {
    color: #6b766f;
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.navbar-principal .nav-link {
    position: relative;
    font-weight: 600;
    font-size: 1rem;
    color: var(--texto);
    padding: .55rem .9rem;
    transition: color .15s;
}
.navbar-principal .nav-link:hover,
.navbar-principal .nav-link.active,
.navbar-principal .nav-item.dropdown:hover > .nav-link { color: var(--verde); }
/* Indicador animado bajo el enlace */
.navbar-principal .nav-link::after {
    content: "";
    position: absolute;
    left: .9rem;
    right: .9rem;
    bottom: .35rem;
    height: 2px;
    background: var(--verde);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .22s ease;
}
.navbar-principal .nav-link:hover::after,
.navbar-principal .nav-link.active::after,
.navbar-principal .nav-item.dropdown:hover > .nav-link::after { transform: scaleX(1); }
.navbar-principal .dropdown-toggle::after { vertical-align: .15em; }

/* ---- Desplegables ---- */
.navbar-principal .dropdown-menu {
    border: 1px solid var(--borde);
    box-shadow: 0 12px 34px rgba(20,58,40,.14);
    border-radius: 14px;
    padding: .45rem;
    margin-top: .55rem;
}
.dropdown-item {
    display: flex;
    align-items: center;
    border-radius: 9px;
    padding: .55rem .8rem;
    font-weight: 500;
    color: var(--texto);
    transition: background .15s, color .15s;
}
.dropdown-item:hover,
.dropdown-item:focus { background: var(--verde-claro); color: var(--verde-oscuro); }
.dropdown-item i {
    width: 1.4rem;
    color: var(--verde);
    margin-right: .45rem;
    font-size: 1rem;
    text-align: center;
}
/* Animación de apertura (solo escritorio) */
@media (min-width: 992px) {
    .navbar-principal .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(6px);
        transition: opacity .18s ease, transform .18s ease, visibility .18s;
        pointer-events: none;
    }
    .navbar-principal .dropdown:hover > .dropdown-menu,
    .navbar-principal .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
    /* Puente invisible que rellena el hueco entre el enlace y el desplegable.
       Sin él, al bajar el ratón hacia el submenú cruza un espacio vacío y el
       menú se cierra antes de poder pulsar una opción. */
    .navbar-principal .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -.75rem;
        left: 0;
        right: 0;
        height: .75rem;
    }
}

/* ---- Selector de idioma ---- */
.selector-idioma {
    font-weight: 700;
    display: flex;
    gap: .25rem;
    align-items: center;
    margin-left: .4rem;
    padding-left: .9rem;
    border-left: 1px solid var(--borde);
}
.selector-idioma a {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .85rem;
    color: var(--texto);
    opacity: .5;
    text-decoration: none;
    padding: .3rem .5rem;
    border-radius: 8px;
    line-height: 1;
    transition: opacity .15s, background .15s;
}
.selector-idioma a:hover { opacity: .85; background: var(--gris-suave); }
.selector-idioma a img {
    width: 22px;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.selector-idioma a.activo { opacity: 1; background: var(--verde-claro); color: var(--verde-oscuro); }

/* ---- Ajustes del menú en móvil ---- */
@media (max-width: 991.98px) {
    .navbar-principal .navbar-collapse {
        margin-top: .5rem;
        padding-top: .5rem;
        border-top: 1px solid var(--borde);
    }
    .navbar-principal .nav-link::after { display: none; }
    .navbar-principal .nav-link { padding: .55rem .25rem; }
    .navbar-principal .dropdown-menu {
        border: none;
        box-shadow: none;
        padding: .1rem 0 .3rem .75rem;
        margin-top: .1rem;
    }
    .selector-idioma {
        margin: .6rem 0 0;
        padding: .6rem 0 0;
        border-left: none;
        border-top: 1px solid var(--borde);
    }
}

/* ---- Cabecera de página interior ---- */
.cabecera-pagina {
    background: linear-gradient(135deg, var(--verde) 0%, var(--verde-oscuro) 100%);
    color: #fff;
    padding: 3rem 0 2.6rem;
}
.cabecera-pagina h1 { font-weight: 700; margin: 0; }
.cabecera-pagina .ruta { color: #d6eade; opacity: .85; font-size: .95rem; }
.cabecera-pagina .ruta a { color: #fff; }

/* ---- Hero portada ---- */
.hero {
    position: relative;
    color: #fff;
    min-height: 84vh;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(to bottom,
                    rgba(0,0,0,.10) 0%,
                    rgba(0,0,0,.10) 40%,
                    rgba(29,82,54,.55) 78%,
                    rgba(29,82,54,.88) 100%),
                url("../img/hero.jpg") center/cover no-repeat;
    padding: 0 0 4rem;
}
.hero h1 {
    font-size: clamp(2.2rem, 6vw, 4.2rem);
    font-weight: 700;
    text-shadow: 0 2px 18px rgba(0,0,0,.55);
}
.hero p.lema {
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    max-width: 720px;
    text-shadow: 0 1px 10px rgba(0,0,0,.55);
}

/* ---- Tarjetas de sección ---- */
.tarjeta-seccion {
    display: block;
    height: 100%;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 16px;
    padding: 1.6rem;
    text-decoration: none;
    color: var(--texto);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.tarjeta-seccion:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(47,125,82,.18);
    border-color: var(--verde);
    color: var(--texto);
}
.tarjeta-seccion .icono {
    width: 56px; height: 56px;
    display: grid; place-items: center;
    background: var(--verde-claro);
    color: var(--verde);
    border-radius: 14px;
    font-size: 1.6rem;
    margin-bottom: 1rem;
}
.tarjeta-seccion h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: .35rem; }
.tarjeta-seccion p { color: #5d6b62; font-size: .95rem; margin: 0; }

/* ---- Secciones generales ---- */
.seccion { padding: 3.5rem 0; }
.seccion-titulo { font-weight: 700; color: var(--verde-oscuro); margin-bottom: .4rem; }
.seccion-subtitulo { color: #6b766f; margin-bottom: 2rem; }

.tarjeta {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 16px;
    overflow: hidden;
}
.tarjeta-cuerpo { padding: 1.5rem; }

/* ---- Tabla de horarios ---- */
.tabla-horarios th { background: var(--verde); color: #fff; vertical-align: middle; }
.tabla-horarios td, .tabla-horarios th { text-align: center; }

/* ---- Tabla de cursos (portada) ---- */
.tabla-cursos {
    background: #fff;
    border: 1px solid #d4eadd;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(47,125,82,.14);
    margin-bottom: 0;
}
.tabla-cursos thead th {
    background: linear-gradient(135deg, var(--verde) 0%, var(--verde-oscuro) 100%);
    color: #fff;
    text-align: center;
    border: 0;
    padding: 1rem .6rem;
    font-family: var(--tipo-titulos);
    font-weight: 600;
    font-size: .82rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.tabla-cursos td {
    text-align: center;
    vertical-align: middle;
    border-color: #e6f3ec;
    padding: .6rem;
}
/* Filas: cebra suave y un filo del color del día a la izquierda.
   Bootstrap pinta el fondo en las celdas (td), así que la cebra va en los td. */
.tabla-cursos tbody td { background: color-mix(in srgb, var(--dia, var(--verde)) 7%, #fff); transition: background .15s ease; }
.tabla-cursos tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--dia, var(--verde)) 16%, #fff); }
.tabla-cursos tbody tr:hover td { background: color-mix(in srgb, var(--dia, var(--verde)) 28%, #fff); }
.tabla-cursos td.dia { border-left: 4px solid var(--dia, transparent); }
/* Día: nombre en el color del día, sin pastilla */
.tabla-cursos td.dia strong {
    color: var(--dia, var(--texto));
    letter-spacing: .03em;
}
/* Curso: emoji dentro de un círculo y nombre destacado */
.tabla-cursos td.curso strong { color: var(--verde-oscuro); }
.tabla-cursos .emoji {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin-right: .35rem;
    border-radius: 50%;
    background: var(--verde-claro);
    font-size: 1.05rem;
    vertical-align: middle;
}
/* Horario */
.tabla-cursos td.horario { color: #5d6b62; font-weight: 600; white-space: nowrap; }
/* Precios (conservan sus colores): socios en pastilla verde, no socios en morado */
.tabla-cursos .precio-socios strong {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: #e3f7ee;
    color: #00a36b;
    font-weight: 700;
}
.tabla-cursos .precio-nosocios { color: #9b51e0; font-weight: 600; }
/* Local: etiqueta gris discreta */
.tabla-cursos td.local span {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 8px;
    background: var(--gris-suave);
    color: #5d6b62;
    font-size: .82rem;
    font-weight: 600;
}

/* ---- Galería ---- */
.galeria img {
    width: 100%; height: 220px; object-fit: cover;
    border-radius: 12px; cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.galeria img:hover { transform: scale(1.02); box-shadow: 0 10px 24px rgba(0,0,0,.18); }

/* ---- Revistas ---- */
.revista { text-align: center; }
.revista img {
    width: 100%; border-radius: 10px; border: 1px solid var(--borde);
    box-shadow: 0 6px 18px rgba(0,0,0,.12); transition: transform .15s;
}
.revista:hover img { transform: translateY(-4px); }
.revista .titulo { font-weight: 600; margin-top: .6rem; }
.revista .fecha { color: #7a857e; font-size: .9rem; }

/* ---- Tarjeta de descarga del PDF (hoja de inscripción) ---- */
.descargar-pdf { position: sticky; top: 90px; }
.descargar-pdf a {
    display: block;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--texto);
}
.descargar-pdf img {
    width: 100%;
    border: 1px solid var(--borde);
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    transition: transform .15s, box-shadow .15s;
}
.descargar-pdf a:hover img {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,.2);
}
.descargar-pdf-pie {
    display: block;
    margin-top: .9rem;
    font-size: .95rem;
    color: #5d6b62;
    line-height: 1.35;
}
.descargar-pdf-pie i { color: #c0392b; font-size: 1.3rem; }
.descargar-pdf-pie strong { color: var(--verde-oscuro); }

/* ---- Bloque destacado / aviso ---- */
.destacado {
    background: var(--verde-claro);
    border-left: 5px solid var(--verde);
    border-radius: 10px;
    padding: 1.2rem 1.4rem;
}

/* ---- Pie ---- */
.pie { background: var(--verde-oscuro); color: #d9e6dd; padding: 3rem 0 1.5rem; margin-top: 3rem; }
.pie-titulo { color: #fff; font-weight: 600; margin-bottom: 1rem; }
.pie a { color: #d9e6dd; }
.pie a:hover { color: #fff; }
.pie-lista { list-style: none; padding: 0; }
.pie-lista li { margin-bottom: .6rem; }
.pie-lista i { color: #9fd3b3; margin-right: .4rem; }
.pie-etiqueta { color: #9fd3b3; font-weight: 600; }
.pie code { color: #fff; }
.pie-redes a { font-size: 1.4rem; margin-right: .8rem; }
.pie-separador { border-color: rgba(255,255,255,.15); margin: 2rem 0 1rem; }
.pie-enlace-legal { text-decoration: underline; }

/* ---- Botón subir ---- */
.boton-subir {
    position: fixed; right: 20px; bottom: 20px;
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--verde); color: #fff; border: none;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
    display: none; place-items: center; font-size: 1.2rem;
    z-index: 1030; cursor: pointer;
}
.boton-subir.visible { display: grid; }

/* ---- Mapa ---- */
.mapa iframe { width: 100%; height: 320px; border: 0; border-radius: 16px; }

/* ---- Visor de imágenes (lightbox) ---- */
.visor-imagen {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,.88);
    display: none; align-items: center; justify-content: center;
    padding: 2rem;
}
.visor-imagen.abierto { display: flex; }
.visor-imagen img { max-width: 92%; max-height: 88%; border-radius: 8px; }
.visor-cerrar {
    position: absolute; top: 18px; right: 28px;
    color: #fff; font-size: 2.6rem; line-height: 1; cursor: pointer;
}

/* ============================================================================
   COMPATIBILIDAD CON EL CONTENIDO MIGRADO DE WORDPRESS
   Estas reglas hacen que el contenido copiado de la web antigua (que usa
   bloques y clases de WordPress) se vea correctamente con este diseño:
   colores de texto, centrado, galerías, columnas, botones, PDF y tablas.
   ========================================================================== */
.contenido { font-size: 1.05rem; line-height: 1.7; }
.contenido img { max-width: 100%; height: auto; border-radius: 8px; }

/* Colores de texto (paleta estándar de WordPress) */
.has-vivid-red-color { color: #cf2e2e; }
.has-vivid-green-cyan-color { color: #00a36b; }
.has-vivid-cyan-blue-color { color: #0693e3; }
.has-vivid-purple-color { color: #9b51e0; }
.has-luminous-vivid-amber-color { color: #d9822b; }
.has-luminous-vivid-orange-color { color: #ff6900; }
.has-pale-pink-color { color: #f78da7; }
.has-pale-cyan-blue-color { color: #5aa9e6; }
.has-cyan-bluish-gray-color { color: #6b7785; }
.has-black-color { color: #111; }
.has-white-color { color: #fff; }

/* Tamaños de fuente */
.has-small-font-size { font-size: .85rem; }
.has-medium-font-size { font-size: 1.15rem; }
.has-large-font-size { font-size: 1.6rem; }
.has-x-large-font-size { font-size: 2.1rem; }

/* Alineación */
.has-text-align-center { text-align: center; }
.has-text-align-right { text-align: right; }
.has-text-align-left { text-align: left; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }

/* Imágenes y pies de foto */
.contenido figure { margin: 1.2rem 0; text-align: center; }
.wp-element-caption, .wp-block-image figcaption {
    font-size: .9rem; color: #6b766f; margin-top: .4rem;
}

/* Galerías */
.wp-block-gallery {
    display: flex; flex-wrap: wrap; gap: .8rem; list-style: none; padding: 0;
}
.wp-block-gallery figure { flex: 1 1 30%; margin: 0; }
.wp-block-gallery img { width: 100%; object-fit: cover; }

/* Columnas */
.wp-block-columns { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.wp-block-column { flex: 1 1 220px; }

/* Texto + media */
.wp-block-media-text {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: center;
}

/* Botones */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; list-style: none; }
.wp-block-button__link, .wp-element-button {
    display: inline-block; background: var(--verde); color: #fff;
    padding: .55rem 1.2rem; border-radius: 8px; text-decoration: none; font-weight: 600;
}
.wp-block-button__link:hover { background: var(--verde-oscuro); color: #fff; }

/* Bloque de archivo (PDF) */
.wp-block-file {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 1.2rem 0;
}
.wp-block-file__embed {
    width: 100%; min-height: 520px; border: 1px solid var(--borde); border-radius: 10px;
}
.wp-block-file__button {
    background: var(--tierra); color: #fff; padding: .45rem 1rem;
    border-radius: 8px; text-decoration: none; font-weight: 600;
}

/* Tablas */
.contenido table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; }
.contenido th, .contenido td { border: 1px solid var(--borde); padding: .55rem .7rem; }
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: var(--gris-suave); }

/* Separador */
.wp-block-separator {
    border: 0; border-top: 2px solid var(--borde); margin: 2rem 0;
}

/* Formulario migrado (Contact Form 7) */
.contenido input[type="text"], .contenido input[type="email"],
.contenido input[type="tel"], .contenido textarea, .contenido select {
    width: 100%; max-width: 440px; padding: .55rem .7rem;
    border: 1px solid var(--borde); border-radius: 8px; margin-top: .25rem;
}
.contenido .wpcf7-submit, .contenido input[type="submit"] {
    background: var(--verde); color: #fff; border: 0; cursor: pointer;
    padding: .6rem 1.6rem; border-radius: 8px; font-weight: 600; font-size: 1rem;
}
.contenido .wpcf7-submit:hover { background: var(--verde-oscuro); }

@media (max-width: 600px) {
    .wp-block-media-text { grid-template-columns: 1fr; }
    .wp-block-gallery figure { flex-basis: 45%; }
}
