/* ================================================================
   CAINCO INFORMA — Rediseño editorial moderno
   Inspirado en layouts de revista digital / periódico online
   Fuente: Playfair Display + DM Sans
   Colores: Navy #0D1B3E · Orange #FF6B00 · White
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,800;0,900;1,700&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --n-orange:   #FF6B00;
    --n-orange2:  #ff9500;
    --n-navy:     #0D1B3E;
    --n-navy2:    #1a2f5e;
    --n-black:    #111111;
    --n-dark:     #222222;
    --n-gray:     #6b7280;
    --n-light:    #f9f9f7;
    --n-border:   #e8e4de;
    --n-white:    #ffffff;
    --n-serif:    'Playfair Display', 'Georgia', serif;
    --n-sans:     'DM Sans', 'Montserrat', sans-serif;
    --ease:       cubic-bezier(.4,0,.2,1);
}

/* ================================================================
   BRANDING BAR — estilo periódico
================================================================ */
.ci-branding-bar {
    background: var(--n-navy);
    padding: 130px 0 0; /* 130px = altura del navbar fijo */
    border-bottom: none;
    position: relative;
}
.ci-branding-inner {
    display: flex;
    align-items: flex-end;
    gap: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid rgba(255,255,255,0.25);
    position: relative;
}
.ci-branding-inner::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0; right: 0;
    height: 1px;
    background: rgba(255,255,255,0.1);
}
.ci-brand-name {
    font-family: var(--n-serif);
    font-size: 3.2rem;
    font-weight: 900;
    color: var(--n-white);
    letter-spacing: -2px;
    line-height: 1;
    margin: 0;
}
.ci-brand-name span { color: var(--n-orange); }
.ci-brand-separator {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.3);
    flex-shrink: 0;
    margin-bottom: .25rem;
}
.ci-brand-right {
    font-family: var(--n-sans);
    font-size: .78rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: .3rem;
}

/* ================================================================
   HERO — imagen con overlay editorial
================================================================ */
.ci-hero-wrap {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    background: var(--n-navy);
}
.ci-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: .75;
    transition: transform 8s ease;
}
.ci-hero-wrap:hover .ci-hero-img { transform: scale(1.03); }

/* ================================================================
   TICKER
================================================================ */
.ci-ticker-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 46px;
    background: var(--n-orange);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    z-index: 10;
}
.ci-ticker-label {
    background: var(--n-black);
    color: #fff;
    font-family: var(--n-sans);
    font-weight: 700;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: .4rem;
}
.ci-ticker-overflow { flex: 1; overflow: hidden; display: flex; align-items: center; }
.ci-ticker-track {
    display: flex;
    align-items: center;
    gap: 3rem;
    animation: ciTicker 55s linear infinite;
    white-space: nowrap;
    padding-left: 2rem;
}
.ci-ticker-track a {
    color: #fff;
    text-decoration: none;
    font-family: var(--n-sans);
    font-size: .85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity .2s;
}
.ci-ticker-track a:hover { opacity: .75; text-decoration: underline; }
.ci-ticker-dot { margin-right: .45rem; opacity: .5; font-size: .55rem; }
@keyframes ciTicker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ================================================================
   TABS — estilo barra de periódico
================================================================ */
.ci-tabs-bar {
    background: var(--n-white);
    border-top: 1px solid var(--n-border);
    border-bottom: 1px solid var(--n-border);
    transition: box-shadow .3s;
}
.ci-tabs-bar.sticky {
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
.ci-tabs-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ci-tabs {
    display: flex;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
}
.ci-tabs::-webkit-scrollbar { display: none; }
.ci-tab {
    display: inline-flex;
    align-items: center;
    padding: .9rem 1.1rem;
    color: var(--n-gray);
    text-decoration: none;
    font-family: var(--n-sans);
    font-size: .82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color .2s, border-color .2s;
    margin-bottom: -1px;
}
.ci-tab:hover { color: var(--n-black); text-decoration: none; }
.ci-tab.active {
    color: var(--n-black);
    border-bottom-color: var(--n-orange);
    font-weight: 700;
}
.ci-search-toggle {
    background: none; border: none;
    color: var(--n-gray); font-size: 1rem;
    padding: .7rem 1rem; cursor: pointer;
    flex-shrink: 0; transition: color .2s;
}
.ci-search-toggle:hover { color: var(--n-orange); }

/* ================================================================
   PANEL BÚSQUEDA
================================================================ */
.ci-search-panel {
    display: none;
    background: var(--n-light);
    border-bottom: 1px solid var(--n-border);
    padding: .85rem 0;
}
.ci-search-panel.visible {
    display: block;
    animation: ciSlideDown .2s var(--ease);
}
@keyframes ciSlideDown {
    from { opacity:0; transform:translateY(-6px); }
    to   { opacity:1; transform:translateY(0); }
}
.ci-search-input-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid var(--n-border);
    border-radius: 6px;
    padding: 0 1rem; gap: .7rem;
    transition: border-color .2s;
}
.ci-search-input-wrap:focus-within { border-color: var(--n-orange); }
.ci-search-ico { color: var(--n-gray); font-size: .9rem; flex-shrink: 0; }
.ci-search-input {
    flex: 1; border: none; outline: none;
    padding: .75rem 0; font-size: .97rem;
    color: var(--n-dark); background: transparent;
    font-family: var(--n-sans);
}
.ci-search-close {
    background: none; border: none;
    color: var(--n-gray); font-size: .95rem;
    cursor: pointer; padding: .4rem;
    transition: color .2s;
}
.ci-search-close:hover { color: var(--n-orange); }

/* ================================================================
   SECCIÓN PRINCIPAL
================================================================ */
.ci-noticias-section {
    padding: 3rem 0 5rem;
    background: var(--n-white);
}

/* ================================================================
   GRUPO POR CATEGORÍA
================================================================ */
.ci-cat-group {
    margin-bottom: 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--n-border);
}
.ci-cat-group:last-child {
    border-bottom: none; margin-bottom: 0; padding-bottom: 0;
}
.ci-cat-title {
    font-family: var(--n-sans);
    font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--n-orange);
    margin-bottom: 2rem;
    display: flex; align-items: center; gap: .75rem;
}
.ci-cat-title::before {
    content: '';
    width: 28px; height: 2px;
    background: var(--n-orange);
    flex-shrink: 0;
}
.ci-cat-title::after {
    content: '';
    flex: 1; height: 1px;
    background: var(--n-border);
}

/* ================================================================
   GRID 3 COLUMNAS — todas iguales (estilo La Gaceta)
================================================================ */
.ci-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem 2.5rem;
    align-items: start;
}

/* ================================================================
   ANIMACIÓN DE APARICIÓN
================================================================ */
@keyframes ciFadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ci-card {
    opacity: 0;
    transform: translateY(22px);
}
.ci-card.ci-visible {
    animation: ciFadeUp 0.55s var(--ease) both;
}

/* Delays escalonados dentro de cada fila de 3 */
.ci-grid-3 .ci-card:nth-child(3n+1).ci-visible { animation-delay: 0s; }
.ci-grid-3 .ci-card:nth-child(3n+2).ci-visible { animation-delay: 0.1s; }
.ci-grid-3 .ci-card:nth-child(3n).ci-visible   { animation-delay: 0.2s; }

/* ================================================================
   CARD
================================================================ */
.ci-card { display: flex; flex-direction: column; }
.ci-card-link {
    text-decoration: none; color: inherit;
    display: flex; flex-direction: column; height: 100%;
}
.ci-card-link:hover { text-decoration: none; color: inherit; }

/* Imagen */
.ci-card-img-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--n-light);
    position: relative;
}
.ci-card-img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .5s var(--ease);
}
.ci-card:hover .ci-card-img { transform: scale(1.04); }

/* Placeholder sin imagen */
.ci-card-img-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #e8e4de, #d5d0c8);
    display: flex; align-items: center; justify-content: center;
}
.ci-card-img-placeholder i { font-size: 2rem; color: #bbb; }

/* Cuerpo */
.ci-card-body { flex: 1; }

.ci-card-destacado {
    display: inline-flex; align-items: center; gap: .3rem;
    font-family: var(--n-sans);
    font-size: .65rem; font-weight: 700;
    color: var(--n-orange);
    text-transform: uppercase; letter-spacing: .8px;
    margin-bottom: .4rem;
}

.ci-card-title {
    font-family: var(--n-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--n-black);
    line-height: 1.35;
    margin: 0 0 .4rem;
    transition: color .22s;
}
.ci-card:hover .ci-card-title { color: var(--n-orange); }

/* Card central (pos 1): título más grande + extracto */
.ci-card-center .ci-card-title {
    font-size: 1.35rem;
    line-height: 1.25;
}
.ci-card-excerpt {
    font-family: var(--n-sans);
    font-size: .875rem;
    color: var(--n-gray);
    line-height: 1.7;
    margin: .6rem 0 0;
}

/* Separador y stats */
.ci-card-sep {
    height: 1px; background: var(--n-border);
    margin: .9rem 0 .7rem;
}
.ci-card-stats {
    display: flex; align-items: center; gap: 1.25rem;
    font-family: var(--n-sans);
    font-size: .75rem; color: var(--n-gray);
}
.ci-card-stats i { margin-right: .25rem; }

/* Divisores verticales entre las 3 columnas */
.ci-grid-3 .ci-card:nth-child(3n+1) { padding-right: 1.5rem; border-right: 1px solid var(--n-border); }
.ci-grid-3 .ci-card:nth-child(3n+2) { padding: 0 1.5rem;     border-right: 1px solid var(--n-border); }
.ci-grid-3 .ci-card:nth-child(3n)   { padding-left: 1.5rem; }

/* ================================================================
   EMPTY STATE
================================================================ */
.ci-empty-state {
    text-align: center; padding: 5rem 1rem; color: #aaa;
}
.ci-empty-state i {
    font-size: 3rem; margin-bottom: 1rem;
    display: block; color: #ddd;
}
.ci-empty-state h3 { font-size: 1.3rem; color: #888; margin-bottom: .5rem; }
.ci-empty-state p { color: #aaa; font-size: .95rem; }
.ci-btn-clear {
    margin-top: 1rem;
    background: var(--n-orange); color: #fff; border: none;
    padding: .6rem 1.5rem; border-radius: 4px;
    font-family: var(--n-sans);
    font-size: .88rem; cursor: pointer; transition: opacity .2s;
}
.ci-btn-clear:hover { opacity: .85; }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 992px) {
    .ci-grid-3 { grid-template-columns: repeat(2, 1fr); gap: 1.75rem; }
    .ci-grid-3 .ci-card:nth-child(3n+1),
    .ci-grid-3 .ci-card:nth-child(3n+2),
    .ci-grid-3 .ci-card:nth-child(3n) {
        padding: 0; border-right: none;
        border-bottom: 1px solid var(--n-border);
        padding-bottom: 1.5rem;
    }
    .ci-hero-wrap { height: 380px; }
    .ci-brand-name { font-size: 2.5rem; }
}

@media (max-width: 768px) {
    .ci-grid-3 { grid-template-columns: 1fr; gap: 1.5rem; }
    .ci-hero-wrap { height: 300px; }
    .ci-cat-title { font-size: .65rem; }
}

@media (max-width: 576px) {
    .ci-branding-bar { padding: 90px 0 0; } /* navbar más pequeño en móvil */
    .ci-brand-name { font-size: 1.85rem; letter-spacing: -1px; }
    .ci-brand-separator, .ci-brand-right { display: none; }
    .ci-branding-inner { padding-bottom: .85rem; }
    .ci-hero-wrap { height: 220px; }
    .ci-ticker-bar { height: 40px; }
    .ci-ticker-label { padding: 0 .85rem; font-size: .68rem; }
    .ci-tab { padding: .75rem .8rem; font-size: .75rem; }
    .ci-noticias-section { padding: 2rem 0 3.5rem; }
    .ci-cat-group { margin-bottom: 2.5rem; padding-bottom: 2.5rem; }
}