/* =========================================================
   Sapiens Research – estilos
   Iremos agregando reglas poco a poco, sección por sección.
   ========================================================= */

@font-face {
    font-family: "Bebas";
    src: url("");
    src: url("#iefix") format("embedded-opentype"), url("assets/fonts/bebasneue-webfont.woff") format("woff"), url("assets/fonts/BebasNeue-Regular.ttf") format("truetype"), url("#Bebas") format("svg");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Bebas Neue Regular';
    src: url('assets/fonts/BebasNeue-Regular.ttf');
    font-weight: normal;
}



/* Reset mínimo */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* =========================================================
   Variables (colores y tipografías originales del sitio)
   ========================================================= */
:root {
    --color-bg: #fcfcfc;
    --color-header-bg: #000000;
    --color-accent: #d9534f;
    --color-accent-dark: #c9302c;
    --color-text: #626262;
    --color-text-light: #a8a8a8;
    --color-heading: #444444;
    --color-white: #ffffff;

    --font-heading: 'Bebas Neue', 'Bebas Neue Regular', Arial, Tahoma, sans-serif;
    --font-menu: 'Roboto', Arial, sans-serif;
    --font-body: 'Helvetica Neue', Arial, Tahoma, sans-serif;
}

/* Nota: si tienes los archivos .ttf/.woff de Bebas Neue, agrégalos con @font-face
   aquí y apunta font-family a ellos. Mientras tanto usamos las alternativas del
   sistema como fallback. */

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-heading);
    margin: 0 0 15px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Bebas Neue Regular' !important;
    -webkit-font-family: 'Bebas Neue Regular' !important;
    -moz-font-family: 'Bebas Neue Regular' !important;
    -ms-font-family: 'Bebas Neue Regular' !important;
    -o-font-family: 'Bebas Neue Regular' !important;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    color: var(--color-accent-dark);
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================================================
   Header
   ========================================================= */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
}

/* --- Barra superior: contacto + redes --- */
.top-contact-bar {
    background: var(--color-header-bg);
    font-family: var(--font-body);
    font-size: 13px;
}

.top-contact-bar .container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.contact-list li a,
.social-list li a {
    color: var(--color-white);
}

.contact-list li a:hover,
.social-list li a:hover {
    color: var(--color-accent);
}

.social-list {
    display: flex;
    gap: 14px;
}

/* Oculta el texto de las redes sociales; deja solo el ícono cuando agreguemos
   los íconos reales (por ahora se ve el texto como placeholder). */

/* --- Barra principal: logo + navegación --- */
.top-bar {
    background: rgba(34, 39, 48, .5);
}

.top-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
}

/* Logo */
.logo #logo,
.logo a {
    display: block;
    line-height: 0;
}

.logo img {
    max-height: 60px;
    width: auto;
}

/* Navegación principal */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.menu {
    display: flex;
    align-items: center;
    text-transform: uppercase;
}

.menu-item {
    position: relative;
}

.menu-item>a {
    display: block;
    padding: 0 17px;
    line-height: 90px;
    font-family: var(--font-menu);
    font-size: 15px;
    color: #bababa;
    white-space: nowrap;
    border-bottom: 4px solid transparent;
    transition: color .2s ease-in-out, border-color .2s ease-in-out;
}

.menu-item>a:hover,
.menu-item.current>a {
    color: var(--color-white);
    text-decoration: none;
    border-bottom-color: var(--color-accent);
}

/* --- Submenús (2do nivel) --- */
.has-submenu {
    position: relative;
}

.has-submenu>.submenu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 280px;
    background: #f2f2f2;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, .12);
    z-index: 10;
    padding: 8px 0;
}

.has-submenu:hover>.submenu {
    display: block;
}

.has-submenu>.submenu .menu-item>a,
.has-submenu>.submenu li>a {
    display: block;
    padding: 8px 20px;
    line-height: 1.3;
    font-size: 13px;
    color: #333 !important;
    border-bottom: none;
}

.has-submenu>.submenu .menu-item>a:hover,
.has-submenu>.submenu li>a:hover {
    background: rgba(0, 0, 0, .06);
    color: var(--color-accent) !important;
}

/* --- Submenús (3er nivel, anidados dentro de Rankings) --- */
.has-submenu .has-submenu>.submenu {
    top: 0;
    left: 100%;
}

/* --- Buscador --- */
.search-box {
    display: flex;
    align-items: center;
}

.search-box input[type="text"] {
    border: 1px solid rgba(255, 255, 255, .15);
    background: transparent;
    color: var(--color-white);
    padding: 6px 10px;
    font-size: 13px;
    width: 140px;
}

.search-box input[type="text"]::placeholder {
    color: rgba(255, 255, 255, .4);
}

.search-box button {
    display: none;
    /* icono de lupa se agrega luego */
}

/* --- Botón menú móvil (oculto en escritorio) --- */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* =========================================================
   Botones (traducido de a.button / .btn_estilo03 del tema)
   ========================================================= */
.btn {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 5px;
    background-color: var(--color-accent);
    color: var(--color-white);
    font-family: var(--font-body);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
    transition: background-color .2s ease-in-out;
}

.btn:hover {
    background-color: var(--color-accent-dark);
    color: var(--color-white);
    text-decoration: none;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
    position: relative;
    padding: 110px 0 70px;
    background-image: url('../img/hero-bg.webp');
    background-size: cover;
    background-position: center;
    text-align: center;
}

/* Overlay oscuro sobre la imagen de fondo, igual que el original */
.hero:before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    color: var(--color-white);
    font-size: 60px;
    line-height: 1.15;
    text-shadow: 5px 4px 4px rgba(0, 0, 0, .8);
    margin-bottom: 40px;
}

/* --- Contadores (71 Universidades, 16 Rankings...) --- */
.hero-counters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 50px;
    list-style: none;
}

.hero-counters li {
    flex: 1 1 160px;
    max-width: 220px;
    padding: 20px 10px 12px;
    background: rgba(0, 0, 0, .5);
    border-radius: 15px;
}

.counter-number {
    display: block;
    font-family: "Bebas", Arial, Tahoma, sans-serif;
    font-size: 54px;
    line-height: 1;
    color: var(--color-white);
    margin-bottom: 5px;
    font-weight: bold;
}

.counter-label {
    display: block;
    font-size: 15px;
    line-height: 15px;
    color: var(--color-white);
    font-family: var(--font-body);
    text-transform: uppercase;
}

.hero-subtitle {
    color: var(--color-white);
    font-size: 41px;
    margin-bottom: 30px;
    text-shadow: 5px 4px 4px rgba(0, 0, 0, 0.8);
}

/* --- Selector de rankings (dropdowns tipo botón) --- */
.ranking-picker {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, .5);
    border-radius: 15px;
    padding: 20px;
}

.picker-item {
    position: relative;
    flex: 1 1 31.333%;
    margin-bottom: 25px;
}

.picker-button {
    display: block;
    width: 100%;
    padding: 15px;
    border: 0;
    border-radius: 5px;
    background-color: var(--color-accent);
    color: var(--color-white);
    font-family: var(--font-body);
    font-size: 15px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease-in-out;
}

.picker-button:hover {
    background-color: var(--color-accent-dark);
    text-decoration: none;
    color: var(--color-white);
}

.picker-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    min-width: 220px;
    background: var(--color-white);
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
    z-index: 20;
    padding: 6px 0;
}

.picker-item:hover .picker-menu,
.picker-item.force-open .picker-menu {
    display: block;
}

.picker-menu li {
    text-align: left;
    border-top: 1px solid lightgray;
}

.picker-menu li a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: #333;
}

.picker-menu li a:hover {
    background: rgba(0, 0, 0, .06);
    color: var(--color-accent);
}

.hero {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url(/assets/img/Portada_srg-scaled.webp) !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
}

/* =========================================================
   Responsive: hero
   ========================================================= */
@media only screen and (max-width: 767px) {
    .hero {
        padding: 40px 0 40px;
    }

    .hero-title {
        font-size: 32px;
        margin-bottom: 25px;
    }

    .hero-subtitle {
        font-size: 24px;
    }

    .hero-counters li,
    .picker-item {
        flex: 1 1 45%;
    }
}

@media only screen and (max-width: 1239px) {
    .top-contact-bar {
        display: none;
    }

    #header+main,
    #header~main {
        padding-top: 60px;
    }

    .top-bar .container {
        height: 60px;
    }

    .logo img {
        max-height: 40px;
    }

    .menu-toggle {
        display: block;
        color: var(--color-white);
        font-size: 22px;
    }

    .main-nav {
        position: absolute;
        left: 0;
        top: 100%;
        width: 100%;
        background: #323232;
        display: none;
    }

    .main-nav.is-open {
        display: block;
    }

    .menu {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .menu-item>a {
        line-height: normal;
        padding: 14px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, .05);
    }

    .has-submenu>.submenu {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, .03);
        display: none;
    }

    .has-submenu.is-open>.submenu {
        display: block;
    }

    .has-submenu .has-submenu>.submenu {
        left: 0;
    }

    .search-box {
        display: none;
    }
}

.news {
    padding-top: 35px;
    padding-bottom: 35px;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
}

.news .section-title,
.partners .section-title {
    color: #9a1f24;
    text-align: center;
}

.news-list {
    display: flex;
    gap: 20px;
}