/*
Theme Name: Béjar.biz 2.0
Theme URI: https://bejar.biz/
Description: Tema editorial de Béjar.biz basado en Blocksy.
Author: 451 Grados
Template: blocksy
Version: 1.0.0
Text Domain: bejarbiz-blocksy
*/

/* Personalizaciones de Béjar.biz 2.0 */

/* Béjar.biz 2.0 — Identidad editorial */

:root {
    --bb-azul: #193f5b;
    --bb-verde: #287b62;
    --bb-azul-claro: #428baa;
}

.entry-card .bb-categorias-historicas,
.single-post .bb-categorias-historicas {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.bb-categorias-historicas a {
    color: var(--bb-verde);
    text-decoration: none;
}

.bb-categorias-historicas a:hover {
    color: var(--bb-azul-claro);
    text-decoration: underline;
}

.entry-card .entry-title {
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -.02em;
}

.entry-card .entry-title a:hover {
    color: var(--bb-azul);
}

/* ==================================================
   BÉJAR.BIZ 2.0 — PORTADA EDITORIAL
   ================================================== */

.bb-portada {
    background: #f5f8f8;
    padding: 38px 20px 70px;
}

.bb-portada-contenedor {
    max-width: 1280px;
    margin: 0 auto;
}

.bb-portada a {
    text-decoration: none;
}

.bb-portada .bb-section-title {
    font-size: clamp(1.6rem, 3vw, 2.15rem);
    font-weight: 800;
    line-height: 1.2;
    color: #193f5b;
    letter-spacing: -.025em;
    margin: 0 0 25px;
}

/* Bloque de noticias */

.bb-noticias {
    margin-bottom: 55px;
}

.bb-noticias-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 24px;
}

.bb-noticia-principal,
.bb-noticias-lista {
    background: #fff;
    border: 1px solid #e0e9e9;
    border-radius: 9px;
    overflow: hidden;
}

.bb-noticia-principal {
    padding: 20px;
}

.bb-noticia-principal img {
    display: block;
    width: 100%;
    max-height: 350px;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 18px;
}

.bb-portada time {
    display: block;
    color: #647d85;
    font-size: .75rem;
    margin-bottom: 7px;
}

.bb-noticia-principal h3 {
    font-size: clamp(1.35rem, 2.3vw, 1.95rem);
    line-height: 1.2;
    font-weight: 750;
    margin: 0 0 12px;
}

.bb-portada h3 a,
.bb-portada h4 a,
.bb-caja-articulo a {
    color: #193f5b;
}

.bb-portada h3 a:hover,
.bb-portada h4 a:hover,
.bb-caja-articulo a:hover {
    color: #287b62;
}

.bb-noticia-principal p {
    color: #4e626a;
    line-height: 1.65;
    margin-bottom: 0;
}

/* Noticias secundarias */

.bb-noticias-lista {
    padding: 6px 22px;
}

.bb-noticias-lista article {
    padding: 14px 0;
    border-bottom: 1px solid #e5eeee;
}

.bb-noticias-lista article:last-child {
    border-bottom: 0;
}

.bb-noticias-lista h3 {
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.35;
    margin: 0;
}

/* Secciones históricas */

.bb-cajas {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.bb-caja {
    background: #fff;
    border: 1px solid #e0e9e9;
    border-top: 3px solid #287b62;
    border-radius: 7px;
    padding: 20px;
    min-width: 0;
}

.bb-caja:nth-child(even) {
    border-top-color: #428baa;
}

.bb-caja > h3 {
    font-size: 1.22rem;
    font-weight: 750;
    line-height: 1.3;
    color: #193f5b;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5eeee;
}

.bb-caja-articulo {
    margin-bottom: 17px;
}

.bb-caja-articulo > a {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.bb-caja-articulo img {
    width: 110px;
    height: 82px;
    max-width: 110px;
    flex: 0 0 110px;
    object-fit: cover;
    border-radius: 4px;
}

.bb-caja-articulo h4 {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    color: #193f5b;
}

.bb-caja-articulo time {
    margin-top: 8px;
}

.bb-caja-articulo p {
    font-size: .88rem;
    color: #5e7077;
    line-height: 1.55;
    margin: 7px 0 0;
}

/* Enlaces a categorías originales */

.bb-caja-enlaces {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding-top: 13px;
    border-top: 1px solid #e5eeee;
}

.bb-caja-enlaces a {
    display: inline-block;
    background: #edf5f2;
    color: #287b62;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 650;
}

.bb-caja-enlaces a:hover {
    background: #dcece5;
    color: #193f5b;
}

/* Adaptación móvil */

@media (max-width: 800px) {
    .bb-noticias-grid,
    .bb-cajas {
        grid-template-columns: 1fr;
    }

    .bb-portada {
        padding: 25px 14px 45px;
    }
}

@media (max-width: 480px) {
    .bb-caja {
        padding: 16px;
    }

    .bb-caja-articulo img {
        width: 88px;
        height: 72px;
        max-width: 88px;
        flex-basis: 88px;
    }
}

/* Béjar.biz — Fotografías históricas y sus leyendas */

.entry-content figure.bb-foto-historica {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    max-width: 100%;
    margin: 1.5rem 0;
    clear: both;
}

.entry-content figure.bb-foto-historica > img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 0;
}

.entry-content figure.bb-foto-historica > figcaption {
    display: block;
    align-self: stretch;
    margin: 0;
    padding: 8px 0 0;
    color: #536e79;
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.5;
    text-align: left;
}


/* BÉJAR.BIZ — ENCUESTAS */

.wp-polls {
    --wp-polls-bar-background: #287b62 !important;
    --wp-polls-bar-border: transparent !important;
    --wp-polls-bar-height: 10px !important;
    --wp-polls-bar-radius: 6px !important;
}

.bb-encuesta-historica .wp-polls {
    padding: 1.5rem;
    background: #f5faf9;
    border: 1px solid #dce9e7;
    border-left: 4px solid #287b62;
    border-radius: 8px;
}

.wp-polls .wp-polls-ul li {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.wp-polls a {
    color: #193f5b;
}

.wp-polls a:hover {
    color: #287b62;
}

.wp-polls .wp-polls-bar {
    border-radius: 6px;
    overflow: hidden;
}

.wp-polls input[type="button"],
.wp-polls input[type="submit"],
.wp-polls button {
    background: #287b62;
    color: #fff;
    border-radius: 5px;
}




/* BÉJAR.BIZ — Encuesta integrada en la portada */

.bb-noticia-principal .bb-encuesta-portada {
    margin: 48px 0 0;
    padding: 26px;
    background: #edf6f1;
    border: 1px solid #d1e4d9;
    border-top: 4px solid #287b62;
    border-radius: 9px;
}

.bb-encuesta-portada-cabecera {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.bb-encuesta-portada-etiqueta {
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #287b62;
}

.bb-encuesta-portada-estado {
    font-size: .75rem;
    color: #52746a;
}

.bb-encuesta-portada .wp-polls {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.bb-encuesta-portada .wp-polls p {
    color: #193f5b;
}

.bb-encuesta-portada-footer {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid #d1e4d9;
    text-align: right;
}

.bb-encuesta-portada-footer a {
    color: #287b62;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
}

.bb-encuesta-portada-footer a:hover {
    color: #193f5b;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .bb-noticia-principal .bb-encuesta-portada {
        padding: 18px;
        margin-top: 32px;
    }
}



/* Índices históricos: anchura normal de Blocksy */
body.page:has(.bb-indice-historico) #main > .ct-container-full {
    width: var(--theme-container-width);
    max-width: var(--theme-normal-container-max-width);
    margin-inline: auto;
}



/* Béjar.biz — Archivos históricos: aprovechar la columna existente */

body:is(.tax-bejar, .tax-secciones, .tax-bejarbiz)
#main .ct-container {
    max-width: var(--theme-normal-container-max-width);
}

body:is(.tax-bejar, .tax-secciones, .tax-bejarbiz)
#main .entries {
    width: 100%;
    max-width: none;
}








/* BB-ESTILO-SECCIONES-CATEGORIAS */

/* Quitar las líneas superior e inferior */
body.category .bejarbiz-secciones {
    border: none !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
}

/* Enlaces con el color de las secciones históricas */
body.category .bejarbiz-secciones a,
body.category .bejarbiz-secciones a:visited {
    color: #38566a !important;
}

body.category .bejarbiz-secciones a:hover {
    color: #278063 !important;
}




/* BB-CATEGORIAS-HERO-BLANCO */
body.single-post .hero-section[data-type="type-2"]
.entry-meta .meta-categories a {
    color: #fff !important;
}

body.single-post .hero-section[data-type="type-2"]
.entry-meta .meta-categories a:hover {
    color: #b5e5d2 !important;
}


/* BB-HEMEROTECA-ESTADISTICAS */
.bbh-numeros {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px 20px;
}
.bbh-numeros span {
    min-width: 0;
}
@media (max-width: 700px) {
    .bbh-numeros {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 14px;
    }
}

/* BB-MENU-SUPERIOR-AZUL */
.ct-header [data-row="middle"] .ct-menu-link {
    color: #1e4052 !important;
}




/* BB-CAPITULAR-DEFINITIVA */
body.single-post .entry-content > p:first-of-type::first-letter,
body.single-post .ct-comment-content > p:first-of-type::first-letter {
    float: left;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 5.1em;
    font-weight: 700;
    line-height: .78;
    margin: .10em .14em 0 0;
    color: #1e4052;
    border-bottom: 3px solid #37876e;
    padding-bottom: 2px;
    text-transform: uppercase;
}

/* ==================================================
   Béjar.biz — Cajas editoriales de portada
   ================================================== */

.bb-caja {
    padding: 22px;
    border-radius: 6px;
}

.bb-caja h3 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.3px;
    padding-bottom: 12px;
}

.bb-caja-articulo {
    position: relative;
    display: flow-root;
    padding: 16px 0;
    margin: 0 !important;
}

.bb-caja-articulo + .bb-caja-articulo {
    border-top: 1px solid #e4eae8;
}

.bb-caja-articulo:has(img) {
    padding-left: 152px !important;
    min-height: 134px;
}

.bb-caja-articulo > a {
    display: block !important;
    position: static !important;
    font-size: 18px !important;
    font-weight: 650;
    line-height: 1.35;
    color: #234451;
}

.bb-caja-articulo:has(img) img {
    position: absolute;
    top: 16px;
    left: 0;
    width: 136px !important;
    height: 102px !important;
    object-fit: cover;
    float: none !important;
    margin: 0 !important;
    border-radius: 4px;
}

.bb-caja-articulo p {
    font-size: 15px;
    line-height: 1.55;
    margin: 7px 0 0;
    color: #5e6d73;
}

@media (max-width: 689px) {

    .bb-caja {
        padding: 16px;
    }

    .bb-caja h3 {
        font-size: 21px;
    }

    .bb-caja-articulo:has(img) {
        padding-left: 112px !important;
        min-height: 104px;
    }

    .bb-caja-articulo:has(img) img {
        width: 100px !important;
        height: 75px !important;
    }

    .bb-caja-articulo > a {
        font-size: 17px !important;
    }

    .bb-caja-articulo p {
        font-size: 14px;
    }
}


/* Igualar altura de las cajas editoriales */

.bb-caja {
    display: flex;
    flex-direction: column;
}

.bb-caja > :last-child {
    margin-top: auto !important;
}

.bb-caja > a:last-child {
    align-self: flex-start;
}

@media (min-width: 690px) {
    .bb-cajas {
        align-items: stretch;
        grid-auto-rows: 1fr;
    }

    .bb-caja {
        height: 100%;
        box-sizing: border-box;
    }
}


/* Imagen de recurso en cajas sin fotografía */

.bb-caja-articulo img {
    max-width: none !important;
}

.bb-caja-articulo:not(:has(img)) {
    padding-left: 152px !important;
    min-height: 134px;
}

.bb-caja-articulo:not(:has(img))::before {
    content: "BÉJAR.BIZ";
    position: absolute;
    top: 16px;
    left: 0;
    width: 136px;
    height: 102px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #d9e8e3;
    color: #28674c;
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    border-radius: 4px;
}

@media (max-width: 689px) {
    .bb-caja-articulo:not(:has(img)) {
        padding-left: 112px !important;
        min-height: 104px;
    }

    .bb-caja-articulo:not(:has(img))::before {
        width: 100px;
        height: 75px;
        font-size: 12px;
    }
}


/* Evitar saltos iniciales que impiden la capitular */
body.single-post .entry-content p.bb-capitular-elegida > br:first-child {
    display: none;
}


/* BB-PORTADA-COLUMNAS-SIMETRICAS */
@media (min-width: 1000px) {
    body.home .bb-noticias-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* BB-PORTADA-EQUILIBRIO-COMENTARIOS */
@media (min-width: 1000px) {

    body.home .bb-noticias-lista {
        display: flex;
        flex-direction: column;
    }

    body.home .bb-noticias-lista .bb-caja-comentarios {
        margin-top: auto;
        padding: 18px;
    }

    body.home .bb-comentario-reciente {
        padding: 7px 0 !important;
        margin: 0 !important;
    }

    body.home .bb-comentario-autor {
        line-height: 1.25;
        margin-bottom: 3px;
    }

    body.home .bb-comentario-noticia {
        -webkit-line-clamp: 1;
        line-height: 1.3;
    }

    body.home .bb-comentario-extracto {
        -webkit-line-clamp: 1;
        line-height: 1.35;
        margin-top: 3px;
    }
}

/* BB-ENCUESTAS-ALTERNANCIA-VISUAL */
.bb-archivo-encuestas .bb-encuestas-grid {
    gap: 30px;
}

.bb-archivo-encuestas .bb-encuesta-tarjeta {
    --bb-acento: #296451;
    --bb-fondo: #edf6f1;
    --bb-barra: #37876e;
    --bb-pista: #d5e5dd;

    display: flex;
    flex-direction: column;
    padding: 26px;
    background: var(--bb-fondo);
    border-left: 5px solid var(--bb-acento);
    box-shadow: 0 3px 8px rgba(30,64,82,.05);
}

.bb-archivo-encuestas .bb-encuesta-tarjeta:nth-child(4n+2),
.bb-archivo-encuestas .bb-encuesta-tarjeta:nth-child(4n+3) {
    --bb-acento: #245568;
    --bb-fondo: #edf4f8;
    --bb-barra: #347d93;
    --bb-pista: #d4e2e9;
}

.bb-archivo-encuestas .bb-encuesta-barra {
    background: var(--bb-pista);
}

.bb-archivo-encuestas .bb-encuesta-barra > span {
    background: var(--bb-barra);
}

.bb-archivo-encuestas .bb-encuesta-porcentaje,
.bb-archivo-encuestas .bb-encuesta-estado {
    color: var(--bb-acento);
}

.bb-archivo-encuestas .bb-encuesta-resultados {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.bb-archivo-encuestas .bb-encuesta-estado {
    margin-top: auto;
    padding-top: 16px;
}

.bb-archivo-encuestas .bb-encuesta-tarjeta:hover {
    background: var(--bb-fondo);
    box-shadow: 0 5px 16px rgba(30,64,82,.12);
}

@media (max-width: 650px) {
    .bb-archivo-encuestas .bb-encuestas-grid {
        gap: 22px;
    }

    .bb-archivo-encuestas .bb-encuesta-tarjeta:nth-child(odd) {
        --bb-acento: #296451;
        --bb-fondo: #edf6f1;
        --bb-barra: #37876e;
        --bb-pista: #d5e5dd;
    }

    .bb-archivo-encuestas .bb-encuesta-tarjeta:nth-child(even) {
        --bb-acento: #245568;
        --bb-fondo: #edf4f8;
        --bb-barra: #347d93;
        --bb-pista: #d4e2e9;
    }
}

/* BB-PULSO-HEMEROTECA-AJUSTE */
#el-pulso-de-bejar {
    width: 100%;
    max-width: none;
    margin: 48px 0;
}

#el-pulso-de-bejar .bbhe-hero h2 {
    color: #fff !important;
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: clamp(34px, 5vw, 54px) !important;
    font-weight: 700;
    line-height: 1.2;
    margin: 15px 0 24px;
}

#el-pulso-de-bejar .bbhe-hero p {
    color: #edf5f2 !important;
}

#el-pulso-de-bejar .bbhe-hero {
    padding: clamp(25px, 4vw, 48px);
}

/* BB - Desplegables del menú de escritorio */

#header [data-device="desktop"] .sub-menu {
    background: #1e4052 !important;
    min-width: 230px;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
}

#header [data-device="desktop"] .sub-menu li > a {
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 500;
}

#header [data-device="desktop"] .sub-menu li > a:hover,
#header [data-device="desktop"] .sub-menu li > a:focus-visible {
    color: #ffffff !important;
    background: #296451 !important;
}

