/* ==========================================================================
   BuscoPaga.com - Complete Stylesheet (Consolidated & Responsive)
   ========================================================================== */

/* --- Design Tokens & Variables --- */
:root {
    --primary-color: #87c241;    /* Verde Lima Acido */
    --secundary-color: #203faf;   /* Azul Corporativo */
    --text-main: #2d3748;         /* Gris oscuro para textos largos (alta legibilidad) */
    --text-muted: #626c7f;        /* Gris medio para descripciones secundarias */
    --bg-card: #ffffff;           /* Fondo de los contenedores de texto */
    --border-color: #e2e8f0;      /* Gris muy claro para bordes limpios */
    --accent-light: #f0fdf4;      /* Fondo verde muy sutil para énfasis */
}

/* --- Reset & Global Base --- */
*, *:before, *:after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #ededed;
    font-family: "Roboto", sans-serif;
    color: var(--text-main);
    margin: 0;
}

[hidden] {
    display: none!important;
}

/* --- Hero Section --- */
.hero {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 50dvh;
    position: relative;
    padding: 2rem 1rem;
}

.bg-hero-image {
    height: 100%;
    left: 0;
    object-fit: cover;
    object-position: top;
    position: absolute;
    bottom: 0;
    width: 100%;
    z-index: -1;
}

.hero:after {
    content: '';
    background: #d1d1d1;
    background: linear-gradient(0deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.85 ) 100%
    );
    pointer-events: none;
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    width: 100%;
    z-index: -1;
}

/* --- Branding --- */
.brand {
    align-items: center;
    color: var(--secundary-color);
    display: flex;
    flex-direction: column;
    font-family: "Poppins", sans-serif;
    letter-spacing: -0.05rem;
    text-decoration: none;
    transition: opacity .2s ease;
}

.brand:hover {
    opacity: 0.8;
}

.brand svg {
    fill: var(--primary-color);
    width: 3.675rem;
}

.brand span {
    font-size: 1.825rem;
    font-weight: 700;
}

.brand span > span {
    color: var(--primary-color);
}

.brand small {
    font-size: 1.225rem;
}

.hero h1,
.hero h2 {
	font-size: clamp(1.2rem, 1vw, 1.8rem);
    font-weight: 600;
    margin: 0.1rem auto 1.6rem;
    text-align: center;
    text-wrap: balance;
}

#header-blog h1 {
    max-width: 35rem;
}

/* --- Search Engine Bar --- */
.search {
    align-items: center;
    background-color: #ffffff;
    border-radius: 3rem;
    box-shadow: 0 6px 11px 0 rgba(0, 0, 0, 0.16);
    display: flex;
    justify-content: space-between;
    max-width: 40rem;
    width: 100%;
}

#keywords-input, 
#location-input {
    flex: 1;
    transition: flex 0.3s ease;
    position: relative;
}

.search input {
    background-color: transparent;
    border: 0;
    font-weight: 400;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    height: 3.6rem;
    outline: none;
    padding: 1.2rem 1.5rem;
    width: 100%;
}

.search #search-keywords {
    border-right: 1px solid #e2e8f0;
    height: 2rem;
}

#location-dropdown {
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    z-index: 999;
}

.search button {
    background: var(--secundary-color);
    border: none;
    border-radius: 50%;
    box-shadow: 2px 0px 4px 0px rgba(0, 0, 0, 0.35);
    color: #fff;
    cursor: pointer;
    flex: none;
    height: 3rem;
    margin-right: 0.5rem;
    padding: 0;
    width: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.search button svg {
    width: 1.2rem;
    height: 1.2rem;
}

.search button:hover {
    background: var(--primary-color);
    box-shadow: inset 0px 0px 10px rgb(0 0 0 / 8%);
}

/* is-searched */
.hero.is-searched {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 60rem;
    margin: auto;
    min-height: 0;
    padding: 1.5rem;
}

.hero.is-searched .brand {
    align-items: center;
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    gap: 0 0.2rem;
}

.hero.is-searched .brand svg {
    width: 2.7rem;
    height: auto;
}

.hero.is-searched .brand > span,
.hero.is-searched .brand > span > span {
    font-size: 1.4rem;
}

.hero.is-searched .brand > span small {
    font-size: 1rem;   
}

.hero.is-searched .search {
    display: flex;
    flex: 1;
    align-items: center;
    max-width: 42.5rem;
    margin-left: auto;
}

.hero.is-searched .search input {
    height: 3rem;
    padding: 1rem 1.5rem;
}

.hero.is-searched .search button {
    height: 2.5rem;
    width: 2.5rem;
}

.hero.is-searched h1 { 
    display: none; 
}

/* --- Main Content Section --- */
#main {
    position: relative;
    max-width: 60rem;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.content-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    padding: 2.5rem;
}

.content-section h2 {
    color: var(--secundary-color);
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.03rem;
    margin-bottom: 2.5rem;
    margin-top: 4rem;
}

.content-section h3 {
    color: var(--text-main);
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.content-section p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
}

.content-section p:last-child {
    margin-bottom: 0;
}

.content-section strong {
    color: var(--text-main);
    font-weight: 600;
}

.content-section hr {
    border-bottom: 0.1rem solid var(--secundary-color);
    display: block;
    height: 0;
    margin-bottom: 1.5rem;
    width: 100%;
}

.content-section .email-anchor {
	color: inherit; font-weight: 700; text-decoration: underline;
}

.job-box-wrapper {
	max-height: 25rem;
	overflow: hidden;
	position: relative;
	transition: max-height 0.4s ease;
}

.job-box-wrapper::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 150px;
	background: linear-gradient(to bottom, transparent, #fff);
	pointer-events: none;
}

.job-box-wrapper.expanded {
	height: auto;
}

#toggleJobs {
	background: var(--secundary-color);
	border: none;
	border-radius: 0.3rem;
	color: #ffffff;
	display: block;
	cursor: pointer;
	margin: 1.5rem auto 0;
	outline: none;
	padding: 1rem 2rem;

	transition: background 0.2s ease;
}

#toggleJobs:hover {
	background: var(--primary-color);
}

.search-examples ul,
.article-body ul,
.search-examples ol,
.article-body ol {
    list-style: none;
    margin: 2rem;
}

.search-examples li,
.article-body li {
    border-left: 4px solid var(--primary-color);
    background-color: #f8fafc;
    padding: 1rem 1.25rem;
    margin-bottom: 1.45rem;
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.search-examples li:last-child {
    margin-bottom: 0;
}

.search-examples em {
    background-color: var(--accent-light);
    color: #3f6212;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-style: normal;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Consejos Editoriales */
.tips-list {
    padding-left: 1.25rem;
}

.tips-list li {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tips-list li:last-child {
    margin-bottom: 0;
}

.tips-list strong {
    display: block;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.blog-grid:not(.expanded) article.blog-card:nth-child(n+4) {
    display: none;
}

.blog-card {
    border-radius: 0.3rem;
    display: flex;
    flex-direction: column;
    margin: 4rem 0;
    overflow: hidden;
    position: relative;
    padding: 2.6rem 2rem;
}

.blog-card:after {
    content: '';
    background: #000000b3;
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 100%;
    z-index: 1;
}

.blog-card img {
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    z-index: 0;
}

.blog-card h3,
.blog-card span,
.blog-card p,
.blog-card a {
    position: relative;
    z-index: 2;
}

.blog-card h3 {
    color: var(--primary-color);
    font-family: 'Roboto';
    font-size: 1.4rem;
    font-weight: 800;
    max-width: 26rem;
    margin-bottom: 2rem;
}

.blog-card span {
    color: #ffffff;
}

.blog-card p {
    color: #ffffff;
}

#show-articles,
.blog-card a {
    background: var(--secundary-color);
    border-radius: 0.4rem;
    color: #ffffff;
    display: table;
    font-size: 0.9rem;
    margin-left: auto;
    margin-top: 4rem;
    padding: 1rem 2rem;
    transform: translateX(0);
    text-decoration: none;

    transition: background 0.2s ease, transform 0.2s ease;
}

.blog-card a:hover {
    background: var(--primary-color);
    transform: translateX(0.3rem);
}

.table-responsive-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    margin: 4rem 0;
}

.table-info {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    color: #333333;
    background-color: #ffffff;
    white-space: nowrap;
}

.table-info thead tr {
    background-color: var(--secundary-color, #2563eb);
    color: #ffffff;
    text-align: left;
}

.table-info th,
.table-info td {
    padding: 1.6rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.table-info th {
    font-weight: 600;
    letter-spacing: 0.025em;
}

.table-info tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.table-info tbody tr:hover {
    background-color: #f3f4f6;
    transition: background-color 0.2s ease;
}

.table-info tr td {
    color: #4b5563;
}

#show-articles {
    border: none;
    cursor: pointer;
    margin: auto;
}

#show-articles:hover {
    background: var(--primary-color);
}

.category-tag {
    margin-bottom: 1.5rem;
}

#email-anchor {
    color: var(--primary-color);
    display: table;
    font-weight: bold;
    margin: auto;
    text-decoration: none;
}

#email-anchor svg {
    height: 1.5rem;
    vertical-align: middle;
    width: 1.5rem;
}

#results-container {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
}

#results-container button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    outline: none;
}

#results-header {
    flex: min-content;
}

#results-header strong {
    color: #161616;
}

#filters-container {
    align-items: center;
    background-color: #ffffff;
    border-radius: 3rem;
    box-shadow: 0 6px 11px 0 rgba(0, 0, 0, 0.16);
    display: flex;
    justify-content: space-between;
    overflow: hidden;
}

#filters-container button {
    background: #ffffff;
    color: #6a6a6a;
    padding: 0.9rem 0;
    position: relative;
    width: 7rem;
    transition: background .2s ease, color .2s ease;
}

#filters-container button:not(:last-child)::after {
    content: '';
    border-right: 0.1rem solid #e1e1e1;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    margin: auto;
    width: 100%;
    height: 1.8rem;
}

#filters-container button.active,
#filters-container button:hover {
    background: #161616;
    color: #ffffff;
}

#filters-container button.active::after,
#filters-container button:hover::after {
    border-right: none;
}

/* --- Loader --- */
.loader {
    --_m: conic-gradient(#0000 10%, #000), linear-gradient(#000 0 0) content-box;
    aspect-ratio: 1;
    background: #74d73e;
    border-radius: 50%;
    display: block;
    -webkit-mask: var(--_m);
    mask: var(--_m);
    -webkit-mask-composite: source-out;
    mask-composite: subtract;
    margin: auto;
    padding: 0.5rem;
    width: 2.5rem;
    animation: loader 1s infinite linear;
}

@keyframes loader {
    to{
        transform: rotate(1turn)
    }
}

#jobs-container {
    flex: 0 0 100%;
    margin-bottom: 0;
    position: relative;
}

#page-indicator {
    color: #b1b1b1;
    font-weight: 400;
    font-size: 0.9rem;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.job-card {
    border-bottom: 0.1rem solid #e1e1e1;
    padding: 3rem 0;
}

.job-card:last-child {
    border: 0;
}

.job-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.job-company {
    font-weight: bold;
}

.job-details span {
    color: #161616;
    font-size: 1rem;
    font-weight: bold;
}

.job-description {
    text-overflow: ellipsis
}

.job-footer {
    align-content: center;
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
    margin-top: 4rem;
}

.job-footer small {
    color: #545454;
    font-weight: 500;
    background: #e5e5e5;
    padding: 0.5rem 0.8rem;
    border-radius: 1.4rem;
}

.job-footer a {
    background: var(--secundary-color);
    border-radius: 0.3rem;
    color: #ffffff;
    font-size: 0.8rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
    transition: background 0.3s ease;
}

.job-footer a:hover {
    background: var(--primary-color);
}

#pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 28px auto;
}

#pagination button {
    align-items: center;
    background: var(--secundary-color);
    border: 0.2rem solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgb(0 0 0 / 20%);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    height: 2rem;
    justify-content: center;
    padding: 0;
    width: 2rem;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#pagination button svg {
    height: 1.2rem;
    width: 1.2rem;
}

#pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    box-shadow: 0 5px 12px rgb(0 0 0 / 18%);
    transform: translateY(-2px);
}

#pagination button:active:not(:disabled) {
    transform: scale(0.94);
}

#pagination button:disabled {
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.55;
}

#input-page {
    width: auto;
    height: 2rem;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 10px;
    font: inherit;
}

#page-info {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

/* --- Footer --- */
#footer {
    display: flex;
    font-family: 'Poppins', sans-serif;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 2rem 0.5rem;
    position: relative;
}

#footer .footer-links {
    border-top: 0.1rem solid #d5d5d5;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    justify-content: center;
    max-width: 45rem;
    padding-top: 1rem;
    width: 80%;
}

#footer .footer-links a {
    color: #6c6c6c;
    font-weight: 300;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

#footer .footer-links a:hover {
    color: var(--secundary-color);
}

#footer small {
    color: #8f8f8f;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

#footer small span {
    font-weight: 700;
}

/* Botón volver arriba */
#goTop {
    background-color: var(--secundary-color);
    border-radius: 0.3rem;
    border: 0;
    box-shadow: 0 2px 8px #0002;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    height: 2.5rem;
    transition: opacity .2s, transform .2s;
    width: 2.5rem;
    z-index: 5;
}

#goTop:hover {
    transform: translateY(-3px);
}

#goTop[hidden] {
    display: none;
}

/* ==========================================================================
   Responsive Adaptations (Mobile First Adjustments)
   ========================================================================== */

@media (min-width: 48rem) { /* 768px */
    .hero.is-searched {
        flex-direction: row;
        justify-content: space-between;
    }

    #keywords-input:focus-within,
    #location-input:focus-within {
        flex: 1.6;
    }
}

@media (max-width: 48rem) { /* 768px */
    #results-container {
        justify-content: center;
    }

    #results-header {
        flex: 100%;
        text-align: center;
    }
}

@media (max-width: 40rem) { /* 640px */
    .hero {
        min-height: 50dvh;
        padding: 3rem 1rem 1.5rem 1rem;
    }

    .brand span {
        font-size: 1.5rem;
    }

    .brand small {
        font-size: 1rem;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }

    /* Transformación de la barra de búsqueda para pantallas chicas */
    .search {
        flex-direction: column;
        border-radius: 1rem;
        padding: 0.5rem;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    .search input {
        height: 3rem;
        padding: 0.8rem 1rem;
    }

    #keywords-input,
    #location-input {
        width: 100%;
    }

    .search #search-keywords {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        height: auto;
        width: 100%;
    }

    .search button,
    .hero.is-searched .search button {
        width: 100%;
        border-radius: 0.5rem;
        height: 3rem;
        margin-right: 0;
        margin-top: 0.5rem;
    }

    /* Ajustes del contenedor principal de contenido */
    #main {
        padding: 0 1rem 2rem 1rem;
    }

    .content-section {
        padding: 1.5rem;
        border-radius: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .content-section h2 {
        font-size: 1.25rem;
    }

    .search-examples li {
        font-size: 0.9rem;
        padding: 0.85rem 1rem;
    }
}

@media (max-width: 32.5rem) { /* 520px */
    #footer small {
        max-width: 14rem;
        text-align: center;
    }
}

@media (max-width: 26.563rem) { /* 425px */
    .job-footer {
        display: flex;
        flex-direction: column-reverse;
        gap: 1.5rem;
    }
}

@media (max-width: 23.438rem) { /* 375px */
    #footer .footer-links {
        flex-direction: column;
        gap: 1.5rem;
        padding: 3rem 1rem;
    }

    #footer .footer-links a {
        display: table;
        margin: auto;
        width: fit-content;
    }

    #goTop {
        position: initial;
        margin: auto;
        margin-bottom: 2rem;
        display: block;
    }
}