/* =========================================================
   REPOSITORIO ACADÉMICO - PORTADA INSTITUCIONAL v0.3
   OJS 3.5.x
   ========================================================= */

:root {
    --ra-blue-950: #083e67;
    --ra-blue-900: #0a4e7e;
    --ra-blue-800: #0c6098;
    --ra-blue-700: #1477af;
    --ra-blue-600: #2c91c7;
    --ra-blue-100: #eaf4fa;
    --ra-line: #d6e6f1;
    --ra-text: #123b5b;
    --ra-muted: #6f8493;
    --ra-white: #fff;
}

/* ------- Limpiar elementos nativos solo en la portada ------- */
body.pkp_page_index .pkp_structure_head {
    min-height: 58px !important;
    background: linear-gradient(90deg, var(--ra-blue-950), var(--ra-blue-700)) !important;
    border: 0 !important;
    box-shadow: none !important;
}

body.pkp_page_index .pkp_structure_head .pkp_head_wrapper {
    min-height: 58px !important;
    max-width: 1220px !important;
    margin: 0 auto !important;
    padding: 0 26px !important;
    box-sizing: border-box !important;
}

body.pkp_page_index .pkp_site_name_wrapper,
body.pkp_page_index .pkp_navigation_primary_wrapper,
body.pkp_page_index .pkp_navigation_search_wrapper {
    display: none !important;
}

/* Usuario/Entrar arriba a la derecha */
body.pkp_page_index .pkp_navigation_user_wrapper {
    position: absolute !important;
    top: 10px !important;
    right: 26px !important;
    z-index: 20 !important;
}

body.pkp_page_index .pkp_navigation_user {
    position: static !important;
    margin: 0 !important;
}

body.pkp_page_index .pkp_navigation_user > li > a {
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

/* Contenido OJS full-width en portada */
body.pkp_page_index .pkp_structure_content {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.pkp_page_index .pkp_structure_main {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
}

/* Ocultar bloques OJS que duplican la portada */
body.pkp_page_index .homepage_about,
body.pkp_page_index .current_issue,
body.pkp_page_index .additional_content {
    display: none !important;
}

/* ------- Contenedor portada ------- */
.ra_home {
    width: 100%;
    margin: 0;
    background: #fff;
    color: var(--ra-text);
}

/* ------- Identidad ------- */
.ra_identity {
    position: relative;
    overflow: hidden;
    padding: 42px 20px 0;
    background:
        radial-gradient(circle at 91% -18%, transparent 0 89px, rgba(78,164,218,.55) 90px 92px, transparent 93px),
        radial-gradient(circle at 95% -11%, transparent 0 132px, rgba(156,169,178,.25) 133px 135px, transparent 136px),
        radial-gradient(circle at 29% 75%, transparent 0 188px, rgba(87,158,208,.22) 189px 191px, transparent 192px),
        #fff;
}

.ra_identity::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 100%;
    background: linear-gradient(180deg, var(--ra-blue-700), var(--ra-blue-900));
    border-bottom-right-radius: 72px;
}

.ra_identity_inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    max-width: 1050px;
    margin: 0 auto;
    padding: 24px 0 28px;
}

.ra_identity_mark {
    width: 118px;
    height: 118px;
    object-fit: contain;
}

.ra_identity_rule {
    width: 1px;
    height: 104px;
    background: #84afd0;
}

.ra_identity_text h1 {
    margin: 0;
    color: #0b4f82;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 4vw, 54px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: .01em;
    text-transform: uppercase;
}

.ra_identity_text p {
    margin: 8px 0 0;
    color: #255f8e;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: .22em;
    text-transform: uppercase;
}

/* ------- Navegación propia ------- */
.ra_nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 38px;
    min-height: 56px;
    max-width: 900px;
    margin: 0 auto;
}

.ra_nav a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 56px;
    color: #143f60;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.ra_nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    right: 50%;
    bottom: 0;
    height: 3px;
    background: var(--ra-blue-800);
    transition: left .18s ease, right .18s ease;
}

.ra_nav a:hover::after,
.ra_nav a:focus::after,
.ra_nav a.is-active::after {
    left: 0;
    right: 0;
}

/* ------- Buscador ------- */
.ra_search_band {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 20px 24px;
    background: linear-gradient(90deg, #edf4f9, #e5f0f7);
    border-top: 1px solid #e0eaf0;
    border-bottom: 1px solid #dfeaf2;
}

.ra_search {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 116px;
    align-items: center;
    width: min(900px, 72vw);
    min-height: 52px;
    padding: 4px;
    border: 1px solid #c8d8e4;
    border-radius: 30px;
    background: #fff;
}

.ra_search_icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ra-blue-900);
    font-size: 27px;
}

.ra_search input {
    width: 100%;
    height: 44px;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #234b67;
    font-size: 15px;
}

.ra_search input::placeholder {
    color: #8395a2;
}

.ra_search button {
    height: 44px;
    border: 0;
    border-radius: 24px;
    background: linear-gradient(180deg, var(--ra-blue-800), var(--ra-blue-900));
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.ra_search button:hover,
.ra_search button:focus {
    background: var(--ra-blue-950);
}

.ra_advanced {
    color: var(--ra-blue-900);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

/* ------- Arte arquitectónico ------- */
.ra_architecture {
    position: relative;
    overflow: hidden;
    height: 180px;
    background: #f8fbfd;
}

.ra_architecture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    opacity: .95;
}

/* ------- Comunidades ------- */
.ra_communities {
    padding: 28px 24px 32px;
    background: #fff;
}

.ra_section_title {
    text-align: center;
    margin-bottom: 24px;
}

.ra_section_title h2 {
    margin: 0;
    color: #0d4e7c;
    font-size: 32px;
    font-weight: 500;
}

.ra_section_title span {
    display: block;
    width: 260px;
    max-width: 70vw;
    height: 1px;
    margin: 9px auto 0;
    background: linear-gradient(
        90deg,
        #8bb8d5 0 42%,
        #0b5f94 42% 58%,
        #8bb8d5 58% 100%
    );
}

.ra_community_grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 34px;
    max-width: 1050px;
    margin: 0 auto;
}

.ra_community {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
}

.ra_icon_box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 116px;
    height: 116px;
    border-radius: 24px;
    background: linear-gradient(145deg, #0b4f7d, #075b8a);
    box-shadow: 0 8px 20px rgba(8, 78, 120, .13);
    transition: transform .18s ease, box-shadow .18s ease;
}

.ra_icon_box img {
    width: 78px;
    height: 78px;
    object-fit: contain;
}

.ra_community:hover .ra_icon_box,
.ra_community:focus .ra_icon_box {
    transform: translateY(-4px);
    box-shadow: 0 13px 25px rgba(8, 78, 120, .18);
}

.ra_community_label {
    margin-top: 12px;
    color: #0c4d79;
    font-size: 14px;
    line-height: 1.22;
    font-weight: 700;
    letter-spacing: .035em;
    text-align: center;
    text-transform: uppercase;
}

/* ------- Footer ------- */
.ra_footer {
    background: linear-gradient(90deg, var(--ra-blue-900), var(--ra-blue-700));
    color: #fff;
}

.ra_footer_inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    min-height: 56px;
    margin: 0 auto;
    padding: 0 24px;
}

.ra_footer_brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
}

.ra_footer_brand img {
    width: 28px;
    height: 28px;
}

.ra_footer_links {
    display: flex;
    gap: 22px;
}

.ra_footer_links a {
    color: #fff;
    font-size: 12px;
    text-decoration: none;
}

/* Ocultar footer OJS nativo solo en portada */
body.pkp_page_index .pkp_structure_footer_wrapper {
    display: none !important;
}

/* ------- Responsive ------- */
@media (max-width: 980px) {
    .ra_identity_inner {
        gap: 18px;
    }

    .ra_identity_mark {
        width: 92px;
        height: 92px;
    }

    .ra_identity_rule {
        height: 82px;
    }

    .ra_identity_text h1 {
        font-size: 38px;
    }

    .ra_identity_text p {
        font-size: 13px;
        letter-spacing: .15em;
    }

    .ra_community_grid {
        grid-template-columns: repeat(3, 1fr);
        row-gap: 28px;
    }
}

@media (max-width: 720px) {
    .ra_identity {
        padding-top: 18px;
    }

    .ra_identity::before {
        display: none;
    }

    .ra_identity_inner {
        flex-direction: column;
        text-align: center;
        padding-bottom: 16px;
    }

    .ra_identity_rule {
        width: 90px;
        height: 1px;
    }

    .ra_identity_text h1 {
        font-size: 30px;
    }

    .ra_identity_text p {
        font-size: 11px;
        line-height: 1.5;
    }

    .ra_nav {
        flex-wrap: wrap;
        gap: 12px 24px;
        padding: 8px 16px;
    }

    .ra_nav a {
        min-height: 36px;
        font-size: 13px;
    }

    .ra_search_band {
        flex-direction: column;
        gap: 10px;
    }

    .ra_search {
        grid-template-columns: 40px minmax(0,1fr);
        width: 100%;
        border-radius: 18px;
    }

    .ra_search button {
        grid-column: 1 / -1;
        width: 100%;
        border-radius: 14px;
    }

    .ra_architecture {
        height: 120px;
    }

    .ra_community_grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 26px 18px;
    }

    .ra_footer_inner {
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        padding: 12px 18px;
    }
}

@media (max-width: 430px) {
    .ra_community_grid {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   PARCHE: QUITAR LÍNEA PERSISTENTE AL HACER CLIC
   Portada del Repositorio Académico / OJS 3.5
   Añadir AL FINAL de:
   plugins/generic/repositoryHomepage/styles/homepage.css
   ========================================================= */

/* 1. Navegación:
      la línea inferior aparece solo en hover o en el enlace marcado
      realmente como activo. El clic del mouse no deja una línea pegada. */
.ra_nav a:focus::after,
.ra_nav a:active::after {
    left: 50% !important;
    right: 50% !important;
}

.ra_nav a:hover::after,
.ra_nav a.is-active::after {
    left: 0 !important;
    right: 0 !important;
}

/* 2. Accesibilidad por teclado:
      en vez de una línea inferior, mostrar un foco discreto. */
.ra_nav a:focus-visible {
    outline: 2px solid rgba(12, 96, 152, .45) !important;
    outline-offset: 4px !important;
    border-radius: 3px !important;
}

.ra_nav a:focus-visible::after {
    left: 50% !important;
    right: 50% !important;
}

/* 3. Tarjetas de Comunidades:
      nunca subrayar el texto al hacer clic, visitar o enfocar. */
.ra_community,
.ra_community:hover,
.ra_community:focus,
.ra_community:active,
.ra_community:visited {
    text-decoration: none !important;
    border-bottom: 0 !important;
}

/* 4. Etiquetas bajo los iconos:
      eliminar cualquier subrayado/borde heredado del tema OJS. */
.ra_community_label,
.ra_community:hover .ra_community_label,
.ra_community:focus .ra_community_label,
.ra_community:active .ra_community_label,
.ra_community:visited .ra_community_label {
    text-decoration: none !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
}

/* 5. Eliminar pseudo-elementos heredados en las tarjetas. */
.ra_community::before,
.ra_community::after,
.ra_community_label::before,
.ra_community_label::after {
    content: none !important;
    display: none !important;
}

/* 6. Mantener foco accesible de teclado en la tarjeta completa,
      sin dibujar línea debajo del texto. */
.ra_community:focus {
    outline: none !important;
}

.ra_community:focus-visible {
    outline: 2px solid rgba(12, 96, 152, .40) !important;
    outline-offset: 7px !important;
    border-radius: 26px !important;
}

/* 7. Evitar que estilos generales de enlaces del tema agreguen
      subrayado después del clic. */
.ra_home .ra_nav a,
.ra_home .ra_community,
.ra_home .ra_community_label {
    text-decoration-line: none !important;
    text-decoration-color: transparent !important;
}
