/* =====================================================
   noticias-seccion.css
   Estilos para seccion/noticias/index.php
   ===================================================== */

/* ====== Encabezado (breadcrumb) ====== */
.heading-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #F1F1F1 !important;
    padding: 10px 20px;
    border-radius: 6px;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.heading-wrapper h3 {
    margin: 0;
    font-size: 14px;
    padding-left: 20px;
    font-weight: normal;
}

.heading-wrapper a {
    color: #3EB447;
    text-decoration: none;
    font-size: 23px;
}

.heading-wrapper li {
    list-style: none;
    color: #606060;
    font-size: 23px;
}

.heading-wrapper li::before {
    content: "›";
    margin: 0 8px;
    color: #888;
}

/* ====== Barra de categorías ====== */
.category-bar {
    background: #606060;
    border-radius: 0 0 90px 90px;
    display: flex;
    justify-content: center;
    height: 5px;
}

.category-item {
    flex: 1 1 0;
    text-align: center;
    padding: 1.25rem .5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.category-item:not(:first-child)::before {
    content: "";
    position: absolute;
    left: 0;
    top: 25%;
    width: 1px;
    height: 50%;
    background: #fff;
    opacity: .75;
}

/* ====== Layout principal ====== */
.main-content {
    display: flex;
    flex-wrap: wrap;
}

.news-column {
    flex: 1;
    padding-right: 5px;
}

.sidebar-column {
    width: 400px;
    margin-left: 20px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

@media (max-width: 992px) {
    .news-column {
        padding-right: 0;
    }

    .sidebar-column {
        width: 100%;
        margin-left: 0;
        margin-top: 30px;
    }
}

/* ====== Lista de noticias ====== */
.lista-noticias {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

@media (max-width: 768px) {
    .lista-noticias {
        grid-template-columns: 1fr;
    }
}

.noticia-resumen {
    margin-bottom: 30px;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.noticia-resumen:nth-child(1) { animation-delay: 0.1s; }
.noticia-resumen:nth-child(2) { animation-delay: 0.2s; }
.noticia-resumen:nth-child(3) { animation-delay: 0.3s; }
.noticia-resumen:nth-child(4) { animation-delay: 0.4s; }

.noticia-resumen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 0;
    background: linear-gradient(to bottom, #3498db, #2c3e50);
    transition: height 0.4s ease;
}

.noticia-resumen:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.noticia-resumen:hover::before {
    height: 100%;
}

@media (max-width: 768px) {
    .noticia-resumen {
        padding: 20px;
    }
}

.noticia-resumen h4 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.3;
}

.noticia-resumen h4 a {
    color: #3498db;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.noticia-resumen h4 a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #e74c3c;
    transition: width 0.3s ease;
}

.noticia-resumen h4 a:hover {
    color: #e74c3c;
}

.noticia-resumen h4 a:hover::after {
    width: 100%;
}

.noticia-resumen .imagen-principal {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 20px;
    border-radius: 8px;
    transition: transform 0.4s ease, filter 0.4s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.noticia-resumen:hover .imagen-principal {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.fecha-resumen {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 25px;
}

.fecha-resumen::before {
    content: '📅';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1em;
}

.intro-resumen {
    color: #495057;
    margin-bottom: 25px;
    font-size: 1.05em;
    line-height: 1.6;
    transition: color 0.3s ease;
    max-width: 100%;
}

.noticia-resumen:hover .intro-resumen {
    color: #343a40;
}

/* ====== Paginación ====== */
.paginacion {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.paginacion a {
    display: inline-block;
    padding: 8px 16px;
    margin: 5px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #3f3f3f;
    transition: all 0.3s ease;
}

.paginacion a:hover,
.paginacion a.activa {
    background: #1ea023;
    color: #fff;
    border-color: #1ea023;
}

.contador-paginas {
    text-align: center;
    color: #777;
    margin: 15px 0;
    width: 100%;
}

/* ====== Sidebar – tabs ====== */
.sidebar-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.sidebar-tabs button {
    flex: 1;
    padding: 10px 0;
    border: none;
    background-color: transparent;
    font-weight: bold;
    cursor: pointer;
    color: #555;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

.sidebar-tabs button.active {
    color: #4CAF50;
    border-bottom: 2px solid #4CAF50;
}

.sidebar-tabs button:hover {
    color: #137516;
}

.tab-content .news-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dotted #eee;
    display: flex;
    align-items: center;
}

.tab-content .news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tab-content .news-item a {
    text-decoration: none;
    color: #333;
    font-size: 0.95em;
    display: block;
}

.tab-content .news-item a:hover {
    color: #0066cc;
}

.tab-content .news-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 3px;
    margin-right: 10px;
    flex-shrink: 0;
}

.tab-content .news-item .item-details {
    flex-grow: 1;
}

.tab-content .news-item .item-date {
    font-size: 0.8em;
    color: #888;
    margin-top: 3px;
}

/* ====== Títulos de noticias ====== */
.card-title {
    
    font-weight: bold;
    margin: 0 0 1rem 0;
    color: #333;
    text-align: center;
}

.titulo-noticia-content {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    text-align: left;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 0.5rem;
}

.titulo-noticia {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #222 !important;
}

.titulo-noticia a {
    color: #4CAF50 !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.titulo-noticia a:hover {
    color: #137516 !important;
    text-decoration: underline;
}

.titulo-lista-noticia {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2e7d32 !important;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

.titulo-lista-noticia:hover {
    color: #1b5e20 !important;
    text-decoration: underline;
}

/* ====== Imagen principal (noticia individual) ====== */
.ib-tamañoImg {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    object-fit: cover;
    filter: brightness(0.98) saturate(1.1) contrast(1.05);
    transform: perspective(1000px) rotateX(0) rotateY(0) scale(1);
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    animation: floatImage 8s ease-in-out infinite;
}

.ib-tamañoImg:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(2deg) scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25), 0 0 40px rgba(82, 255, 168, 0.2);
    filter: brightness(1.05) saturate(1.2) contrast(1.1);
    animation-play-state: paused;
}

.ib-tamañoImg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    transition: opacity 0.4s ease;
    opacity: 0.7;
    z-index: 1;
}

.ib-tamañoImg:hover::before {
    opacity: 1;
}

.ib-tamañoImg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    transition: height 0.4s ease;
    z-index: 1;
}

.ib-tamañoImg:hover::after {
    height: 40%;
}

@keyframes floatImage {
    0%, 100% {
        transform: perspective(1000px) rotateX(0) rotateY(0) translateY(0);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }
    50% {
        transform: perspective(1000px) rotateX(1deg) rotateY(-1deg) translateY(-8px);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2), 0 0 30px rgba(82, 255, 168, 0.15);
    }
}

/* ====== Card (noticia individual) ====== */
.card-body {
    background: linear-gradient(135deg, #f8fff8 0%, #f0f7f0 100%);
    border-radius: 0 0 12px 12px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 80, 20, 0.1);
    border-top: 3px solid #4CAF50;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .card-body {
        padding: 20px;
    }
}

/* ====== Botones de compartir ====== */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(46, 125, 50, 0.2);
    position: relative;
    z-index: 1;
}

.share-buttons > span {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2e7d32;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    letter-spacing: 0.5px;
}

.share-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.share-buttons a i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.share-buttons a.facebook { background: #3b5998; color: white; }
.share-buttons a.facebook:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(59, 89, 152, 0.4);
}
.share-buttons a.facebook:hover i { transform: scale(1.2); }

.share-buttons a.twitter { background: #000000ff; color: white; }
.share-buttons a.twitter:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(29, 161, 242, 0.4);
}
.share-buttons a.twitter:hover i { transform: scale(1.2); }

.share-buttons a.whatsapp { background: #25d366; color: white; }
.share-buttons a.whatsapp:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(37, 211, 102, 0.4);
}
.share-buttons a.whatsapp:hover i { transform: scale(1.2); }

.share-buttons a.envelope { background: #ea4335; color: white; }
.share-buttons a.envelope:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(234, 67, 53, 0.4);
}
.share-buttons a.envelope:hover i { transform: scale(1.2); }

@keyframes pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.share-buttons a:hover {
    animation: pulse 0.5s ease;
}

@media (max-width: 768px) {
    .share-buttons {
        flex-wrap: wrap;
    }
}

/* ====== Contenido de la noticia ====== */
.card-text {
    color: #333;
    font-size: 1.05rem;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

.card-text div {
    margin-bottom: 20px;
    padding-left: 25px;
    position: relative;
}

.card-text div::before {
    content: "•";
    position: absolute;
    left: 10px;
    color: #4CAF50;
    font-size: 1.5rem;
    top: -2px;
}

.card-text font[face="Arial"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: block;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.7);
    border-left: 3px solid #4CAF50;
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
}

.card-text font[face="Arial"]:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.card-text i {
    color: #2e7d32;
    font-weight: 600;
    font-style: italic;
}

@keyframes fadeInContent {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card-text > div {
    animation: fadeInContent 0.6s ease-out forwards;
    opacity: 0;
}

.card-text > div:nth-child(1) { animation-delay: 0.1s; }
.card-text > div:nth-child(2) { animation-delay: 0.2s; }
.card-text > div:nth-child(3) { animation-delay: 0.3s; }
.card-text > div:nth-child(4) { animation-delay: 0.4s; }
.card-text > div:nth-child(5) { animation-delay: 0.5s; }

@media (max-width: 768px) {
    .card-text div {
        padding-left: 20px;
    }
}

/* ====== Enlace de descarga ====== */
.enlace_documento::before {
    content: none !important;
}

.enlace_documento {
    display: inline-flex;
    align-items: center;
    padding: 14px 55px 14px 20px;
    background: linear-gradient(135deg, #2e7d32 0%, #4CAF50 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    margin-top: 25px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 15px rgba(46, 125, 50, 0.4);
    position: relative;
    overflow: hidden;
    z-index: 1;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
}

.enlace_documento::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(135deg, #4CAF50 0%, #2e7d32 100%);
    transition: height 0.5s ease;
    z-index: -1;
}

.enlace_documento::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/></svg>') no-repeat center;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.enlace_documento:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(46, 125, 50, 0.5);
    letter-spacing: 0.8px;
}

.enlace_documento:hover::before {
    height: 100%;
}

.enlace_documento:hover::after {
    animation: downloadPulse 1s infinite;
}

.enlace_documento:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.6);
}

@keyframes downloadPulse {
    0%   { transform: translateY(-50%); }
    50%  { transform: translateY(-50%) translateY(5px); }
    100% { transform: translateY(-50%); }
}

.enlace_documento img {
    margin-right: 15px;
    filter: brightness(0) invert(1);
    transition: all 0.4s ease;
    width: 28px;
    height: 28px;
    z-index: 2;
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.enlace_documento.downloading::after {
    animation: downloading 1.5s infinite;
}

@keyframes downloading {
    0%   { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M6 18h12v2H6zm6-14l-6 6h4v6h4v-6h4l-6-6z"/></svg>'); }
    50%  { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 4l-6 6h4v6h4v-6h4l-6-6zM6 18h12v2H6z"/></svg>'); }
    100% { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M6 18h12v2H6zm0-4h12v2H6zm6-10l-6 6h4v6h4v-6h4l-6-6z"/></svg>'); }
}

/* ====== Filtro de búsqueda ====== */
.filtro-busqueda-noticias {
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.filtro-busqueda-noticias h3 {
    font-weight: 600;
    color: #212529;
}

.filtro-busqueda-noticias .form-label {
    font-size: 0.95rem;
    color: #495057;
}

.filtro-busqueda-noticias .form-control,
.filtro-busqueda-noticias .form-select {
    border-radius: 0.375rem;
}

/* ====== Card sidebar ====== */
.card-title {
    font-weight: 700;
    border-bottom: 2px solid #28a745;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.card {
    border: none;
    background-color: #f8f9fa;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.card-body form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 1rem;
}

.card-body .col-12 {
    flex: 1 1 auto;
    min-width: 100px;
}

@media (max-width: 768px) {
    .card-body form {
        flex-direction: column;
        align-items: stretch;
    }

    .card-body .col-12 {
        width: 100%;
    }

    .card-body .btn {
        width: 100%;
    }
}

/* ====== Badge tipo noticia ====== */
.tipo-noticia-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #2e7d32, #4CAF50);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.3);
    transition: all 0.3s ease;
}

.tipo-noticia-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.4);
}
