/* Explain: Styles for reusable UI components like buttons, chips, search, and cards. */
/* ---------- Botones ---------- */
.em-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem 1.6rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}

.em-btn--ink {
    background: var(--ink);
    color: #fff;
}

.em-btn--ink:hover {
    background: var(--accent-color);
}

.em-btn--accent {
    background: var(--accent-color);
    color: #fff;
}

.em-btn--accent:hover {
    background: var(--accent-hover);
}

.em-btn--ghost {
    border-color: var(--border-color);
    background: transparent;
    color: var(--text-color);
}

.em-btn--ghost:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.em-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ---------- Etiquetas y chips ---------- */
.em-eyebrow {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .26em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .78);
}

.em-eyebrow--ink {
    color: var(--accent-color);
}

.em-chip {
    display: inline-flex;
    align-items: center;
    padding: .5rem .95rem;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    color: #fff;
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .25s ease, color .25s ease, border-color .25s ease;
}

.em-chip:hover {
    background: #fff;
    border-color: #fff;
    color: var(--ink);
}

/* ---------- Tarjetas de empresa ---------- */
.em-biz__hit {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--background-color);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.em-biz__hit:hover {
    transform: translateY(-4px);
    border-color: var(--ink);
    box-shadow: var(--shadow-md);
}

.em-biz__media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface-alt);
}

.em-biz__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s ease;
}

.em-biz__hit:hover .em-biz__media img {
    transform: scale(1.05);
}

.em-biz__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: .5rem;
    padding: 1.4rem 1.5rem 1.6rem;
}

.em-biz__meta {
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.em-biz__name {
    font-size: 1.45rem;
}

.em-biz__text {
    color: var(--text-muted);
    font-size: .94rem;
}

.em-biz__cta {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-top: auto;
    padding-top: 1rem;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
}

/* ---------- Tarjetas editoriales (vanguardia) ---------- */
.em-art__hit {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: var(--ink);
    color: #fff;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
}

.em-art__media {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface-alt);
}

@media (min-width: 760px) {
    .em-art--lead .em-art__media {
        aspect-ratio: 16 / 9;
    }
}

.em-art__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .9s cubic-bezier(.22, 1, .36, 1);
}

.em-art__hit:hover .em-art__media img {
    transform: scale(1.05);
}

.em-art__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(18, 16, 14, .04) 0%, rgba(18, 16, 14, .5) 52%, rgba(18, 16, 14, .92) 100%);
}

.em-art__body {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1.5rem;
}

@media (min-width: 760px) {
    .em-art__body {
        padding: 2rem;
    }
}

.em-art__tag {
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--accent-soft);
}

.em-art__title {
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    color: #fff;
}

.em-art--lead .em-art__title {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.em-art__excerpt {
    max-width: 46rem;
    color: rgba(255, 255, 255, .82);
    font-size: .95rem;
}

.em-art__more {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: .35rem;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #fff;
}

.em-art__hit:hover .em-art__more {
    color: var(--accent-soft);
}

/* ---------- Lista de categorías ---------- */
.em-cats__list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--border-color);
}

.em-catrow {
    border-bottom: 1px solid var(--border-color);
}

.em-catrow__hit {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: .75rem 1rem;
    padding: 1.35rem .25rem;
    transition: padding-left .3s ease;
}

@media (min-width: 760px) {
    .em-catrow__hit {
        gap: 1.5rem 2rem;
        padding: 1.7rem .5rem;
    }
}

.em-catrow__hit:hover {
    padding-left: .9rem;
}

.em-catrow__num {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .1em;
    color: var(--text-muted);
}

.em-catrow__main {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}

.em-catrow__name {
    font-family: var(--font-heading);
    font-size: clamp(1.35rem, 3vw, 2rem);
    line-height: 1.12;
    color: var(--text-color);
    transition: color .3s ease;
}

.em-catrow__desc {
    font-size: .85rem;
    color: var(--text-muted);
}

.em-catrow__count {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--text-muted);
}

.em-catrow__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--text-muted);
    transition: color .3s ease, transform .3s ease;
}

.em-catrow__hit:hover .em-catrow__name {
    color: var(--accent-color);
}

.em-catrow__hit:hover .em-catrow__arrow {
    color: var(--accent-color);
    transform: translateX(5px);
}

/* ---------- Búsqueda minimalista ---------- */
.em-search {
    display: flex;
    align-items: center;
    gap: .85rem;
    max-width: 40rem;
    margin-top: 2rem;
    padding: .65rem 0;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    transition: border-color .25s ease;
}

.em-search:focus-within {
    border-bottom-color: var(--ink);
}

.em-search__icon {
    flex: 0 0 auto;
    color: var(--text-muted);
}

.em-search__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: .2rem 0;
    border: 0;
    background: transparent;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: clamp(.98rem, 1.4vw, 1.12rem);
    outline: none;
}

.em-search__input::placeholder {
    color: var(--text-muted);
}

.em-search__btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-color);
    font-size: 1.05rem;
    cursor: pointer;
    transition: color .25s ease, transform .25s ease;
}

.em-search__btn:hover {
    color: var(--accent-color);
    transform: translateX(3px);
}

/* Variante para fondos oscuros */
.em-search--hero {
    border-bottom-color: rgba(255, 255, 255, .35);
}

.em-search--hero:focus-within {
    border-bottom-color: #fff;
}

.em-search--hero .em-search__icon,
.em-search--hero .em-search__input,
.em-search--hero .em-search__btn {
    color: #fff;
}

.em-search--hero .em-search__input::placeholder {
    color: rgba(255, 255, 255, .6);
}

/* ---------- Resultados ---------- */
.em-results {
    display: none;
    padding: 3.5rem 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
}

.em-results.is-active {
    display: block;
}

.em-results__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.em-results__title {
    margin-top: .5rem;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.em-results__grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
    .em-results__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .em-results__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.em-result {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--background-color);
}

.em-result__media {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface-alt);
}

.em-result__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.em-result__body {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: 1.25rem 1.35rem 1.4rem;
}

.em-result__meta {
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.em-result__name {
    font-size: 1.25rem;
}

.em-result__summary {
    color: var(--text-muted);
    font-size: .92rem;
}

.em-result__open {
    margin-top: .85rem;
    align-self: flex-start;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-color);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    cursor: pointer;
}

.em-result__open:hover {
    color: var(--accent-color);
}

/* ---------- Estados (carga / sin resultados) ---------- */
.em-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .85rem;
    padding: 3rem 1.5rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    background: var(--background-color);
    text-align: center;
}

.em-state i {
    font-size: 1.6rem;
    color: var(--accent-color);
}

.em-state__title {
    font-size: 1.4rem;
}

.em-state__text {
    max-width: 34rem;
    color: var(--text-muted);
}

.em-state__query {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-weight: 600;
    color: var(--text-color);
}

.em-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: em-spin .9s linear infinite;
}

@keyframes em-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .em-spinner {
        animation-duration: 2.5s;
    }
}

/* ---------- Modal ---------- */
.em-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
}

.em-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.em-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 10, 9, .72);
}

.em-modal__panel {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 46rem;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    background: var(--background-color);
    box-shadow: var(--shadow-md);
}

.em-modal__close {
    position: absolute;
    top: .85rem;
    right: .85rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(253, 252, 250, .92);
    color: var(--ink);
    font-size: 1.05rem;
    cursor: pointer;
    transition: background .25s ease, color .25s ease;
}

.em-modal__close:hover {
    background: var(--ink);
    color: #fff;
}

.em-detail__media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-alt);
}

.em-detail__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.em-detail__spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.em-detail__body {
    display: flex;
    flex-direction: column;
    gap: .8rem;
    padding: 1.75rem clamp(1.25rem, 4vw, 2.5rem) 2.25rem;
}

.em-detail__tag {
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.em-detail__title {
    font-size: clamp(1.6rem, 3.2vw, 2.1rem);
}

.em-detail__text {
    color: var(--text-muted);
}

.em-detail__quote {
    margin: 0;
    padding: 1rem 0 1rem 1.25rem;
    border-left: 2px solid var(--accent-color);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-style: italic;
}

.em-detail__facts {
    display: grid;
    gap: .75rem;
    margin-top: .5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.em-detail__fact {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.em-detail__fact span:first-child {
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.em-detail__fact span:last-child {
    font-weight: 500;
}

.em-detail__note {
    margin-top: .5rem;
    font-size: .78rem;
    color: var(--text-muted);
}