/* ==========================================================================
   Higgs News - sitio publico
   ========================================================================== */
:root {
    --hn-bg: #f6f8fc;
    --hn-surface: #ffffff;
    --hn-border: #e3e6ea;
    --hn-text: #1f1f1f;
    --hn-muted: #5f6368;
    --hn-primary: #1a73e8;
    --hn-hover: #f1f3f4;
    --hn-radius: 16px;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-primary: #1a73e8;
    --bs-primary-rgb: 26, 115, 232;
    --bs-link-color: #1a73e8;
    --bs-link-color-rgb: 26, 115, 232;
}
[data-bs-theme="dark"] {
    --hn-bg: #0f1115;
    --hn-surface: #1b1e24;
    --hn-border: #2c3038;
    --hn-text: #e8eaed;
    --hn-muted: #9aa0a6;
    --hn-primary: #8ab4f8;
    --hn-hover: #262a31;
    --bs-body-bg: #0f1115;
    --bs-link-color: #8ab4f8;
    --bs-link-color-rgb: 138, 180, 248;
}

body { background: var(--hn-bg); color: var(--hn-text); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
.btn-primary { --bs-btn-bg: #1a73e8; --bs-btn-border-color: #1a73e8; --bs-btn-hover-bg: #1765cc; --bs-btn-hover-border-color: #1765cc; }
.btn-icon { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--hn-muted); border: 0; }
.btn-icon:hover { background: var(--hn-hover); color: var(--hn-text); }

/* Header */
.hn-header { background: var(--hn-surface); border-bottom: 1px solid var(--hn-border); }
.hn-logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.25rem; color: var(--hn-text); letter-spacing: -.02em; }
.hn-logo-mark { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; color: #fff; font-weight: 800;
    background: conic-gradient(from 210deg, #4285f4, #34a853, #fbbc05, #ea4335, #4285f4); }
.hn-search { position: relative; max-width: 720px; }
.hn-search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--hn-muted); }
.hn-search .form-control { border-radius: 12px; background: var(--hn-hover); border: 1px solid transparent; padding: .65rem 1rem .65rem 2.75rem; }
.hn-search .form-control:focus { background: var(--hn-surface); border-color: var(--hn-border); box-shadow: 0 1px 6px rgba(32,33,36,.18); }

.hn-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.hn-tabs::-webkit-scrollbar { display: none; }
.hn-tabs .nav-link { color: var(--hn-muted); font-weight: 500; font-size: .92rem; padding: .7rem .9rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.hn-tabs .nav-link:hover { color: var(--hn-text); }
.hn-tabs .nav-link.active { color: var(--hn-primary); border-bottom-color: var(--hn-primary); }
.hn-tabs .nav-divider { width: 1px; background: var(--hn-border); margin: .6rem .4rem; }
.hn-side .list-group-item { border: 0; padding: .8rem 1.25rem; display: flex; gap: .85rem; align-items: center; background: transparent; color: var(--hn-text); }
.hn-side .list-group-item:hover { background: var(--hn-hover); }

/* Layout */
.hn-h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.hn-card { background: var(--hn-surface); border-radius: var(--hn-radius); padding: 1.25rem 1.25rem .5rem; border: 1px solid var(--hn-border); color: var(--hn-text); }
.hn-card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.hn-card-title a { color: var(--hn-primary); }
.hn-sticky { position: sticky; top: 130px; }
@media (max-width: 991.98px) { .hn-sticky { position: static; } }

/* Breaking */
.hn-breaking { display: flex; align-items: center; gap: 1rem; background: #fce8e6; color: #a50e0e; border-radius: 12px; padding: .6rem 1rem; overflow: hidden; }
[data-bs-theme="dark"] .hn-breaking { background: #3c1513; color: #f6aea9; }
.hn-breaking-label { font-weight: 700; white-space: nowrap; font-size: .85rem; text-transform: uppercase; }
.hn-breaking-track { display: flex; gap: 2rem; overflow-x: auto; scrollbar-width: none; }
.hn-breaking-track a { color: inherit; font-weight: 500; white-space: nowrap; }
.hn-breaking-track a:hover { text-decoration: underline; }

/* Lineas de fuente / meta */
.hn-source { display: flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; color: var(--hn-text); margin-bottom: .3rem; min-width: 0; }
.hn-source img { width: 18px; height: 18px; border-radius: 4px; object-fit: contain; }
.hn-source-ini { width: 18px; height: 18px; border-radius: 4px; background: var(--hn-hover); color: var(--hn-muted); font-size: .58rem; display: inline-grid; place-items: center; flex-shrink: 0; border: 1px solid var(--hn-border); }
.hn-meta { font-size: .78rem; color: var(--hn-muted); display: flex; align-items: center; gap: .4rem; }
.hn-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; display: inline-block; }
.hn-title { font-size: 1.02rem; font-weight: 600; line-height: 1.35; margin: 0 0 .35rem; letter-spacing: -.005em; }
.hn-title a { color: var(--hn-text); }
.hn-title a:hover { text-decoration: underline; }
.hn-title-lg { font-size: 1.35rem; line-height: 1.3; }
.hn-title-sm { font-size: .95rem; }

/* Fila de noticia */
.hn-row { position: relative; display: flex; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--hn-border); }
.hn-card > .hn-row:first-of-type, .hn-card-title + .hn-row, #feedList > .hn-row:first-child { border-top: 0; }
.hn-row-body { flex: 1; min-width: 0; }
.hn-row-img { width: 116px; height: 116px; object-fit: cover; border-radius: 12px; flex-shrink: 0; background: var(--hn-hover); }
@media (max-width: 575.98px) { .hn-row-img { width: 88px; height: 88px; } }

/* Historias agrupadas */
.hn-story { padding: 1rem 0; border-top: 1px solid var(--hn-border); }
.hn-card-title + .hn-story { border-top: 0; padding-top: .25rem; }
.hn-story-main { display: flex; gap: 1rem; }
.hn-story-img { flex-shrink: 0; width: 140px; aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; background: var(--hn-hover); display: block; }
.hn-story-img img { width: 100%; height: 100%; object-fit: cover; }
.hn-story-lead .hn-story-main { flex-direction: column; }
.hn-story-lead .hn-story-img { width: 100%; aspect-ratio: 16/8; }
@media (min-width: 768px) {
    .hn-story-lead .hn-story-main { flex-direction: row; }
    .hn-story-lead .hn-story-img { width: 46%; aspect-ratio: 16/10; }
}
.hn-coverage { display: inline-flex; align-items: center; gap: .4rem; margin-top: .6rem; font-size: .82rem; font-weight: 600; color: var(--hn-primary);
    border: 1px solid var(--hn-border); border-radius: 999px; padding: .3rem .8rem; }
.hn-coverage:hover { background: var(--hn-hover); }

.hn-hero { padding-bottom: 1rem; }
.hn-hero-img { display: block; border-radius: 14px; overflow: hidden; margin-bottom: .75rem; aspect-ratio: 16/8; background: var(--hn-hover); }
.hn-hero-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.hn-hero-img:hover img { transform: scale(1.02); }

.hn-section-img { border-radius: 12px; overflow: hidden; aspect-ratio: 16/8; background: var(--hn-hover); }
.hn-section-img img { width: 100%; height: 100%; object-fit: cover; }
.hn-compact { padding: .6rem 0; border-top: 1px solid var(--hn-border); }
.hn-section-img + .hn-compact, .hn-card-title + .hn-compact { border-top: 0; }

.hn-section-head { display: flex; align-items: center; gap: 1rem; }
.hn-section-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; font-weight: 700;
    color: var(--cat, var(--hn-primary)); background: color-mix(in srgb, var(--cat, #1a73e8) 14%, transparent); overflow: hidden; }
.hn-section-icon img { width: 100%; height: 100%; object-fit: contain; }

/* Ranking / chips */
.hn-ranking { counter-reset: r; list-style: none; padding: 0; margin: 0; }
.hn-ranking li { counter-increment: r; position: relative; padding: .6rem 0 .6rem 2.4rem; border-top: 1px solid var(--hn-border); }
.hn-ranking li:first-child { border-top: 0; }
.hn-ranking li::before { content: counter(r); position: absolute; left: 0; top: .45rem; font-size: 1.5rem; font-weight: 800; color: var(--hn-border); line-height: 1; }
.hn-ranking a { color: var(--hn-text); font-weight: 600; font-size: .92rem; line-height: 1.35; display: block; }
.hn-ranking a:hover { text-decoration: underline; }
.hn-ranking small { color: var(--hn-muted); font-size: .75rem; }
.hn-chip { display: inline-block; border: 1px solid var(--hn-border); border-radius: 999px; padding: .3rem .8rem; font-size: .82rem; color: var(--hn-text); background: var(--hn-surface); }
.hn-chip:hover { background: var(--hn-hover); }
.hn-card .hn-card-title + .d-flex, .hn-card p:last-child { margin-bottom: .75rem; }

/* Articulo */
.hn-article { padding: 1.75rem; }
.hn-article-title { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; line-height: 1.18; letter-spacing: -.025em; margin-bottom: .9rem; }
.hn-article-figure { margin: 0 -1.75rem 1.25rem; }
.hn-article-figure img { width: 100%; max-height: 520px; object-fit: cover; }
.hn-lead { font-size: 1.15rem; line-height: 1.6; color: var(--hn-text); font-weight: 500; }
.hn-content { font-size: 1.06rem; line-height: 1.75; }
.hn-content img { max-width: 100%; height: auto; border-radius: 12px; }
.hn-content blockquote { border-left: 4px solid var(--hn-primary); padding-left: 1rem; color: var(--hn-muted); font-style: italic; }
.hn-content h2, .hn-content h3 { font-weight: 700; margin-top: 1.5rem; }
.hn-original { display: flex; align-items: center; gap: 1rem; justify-content: space-between; flex-wrap: wrap; margin-top: 1.5rem; padding: 1rem 1.25rem; border-radius: 14px; background: var(--hn-hover); }

/* Footer */
.hn-footer { border-top: 1px solid var(--hn-border); background: var(--hn-surface); color: var(--hn-muted); }
.hn-footer a { color: var(--hn-muted); }
.hn-footer a:hover { color: var(--hn-text); }

.pagination { --bs-pagination-border-radius: 10px; }
.hn-fade-in { animation: hnFade .35s ease both; }
@keyframes hnFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
