/* ==================================================
   ARTICLE STYLES - SOCIEDAD COOPERATIVA PROGRESO
   Mejoras de legibilidad manteniendo diseño existente
   ================================================== */

/* ==================================================
   NAVBAR NEGRO FIJO PARA ARTÍCULOS
   ================================================== */

/* Forzar navbar negro en artículos */
.navbar {
    background: #1a2947 !important;
    backdrop-filter: none !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
}

.navbar .nav-link {
    color: white !important;
}

.navbar .nav-link:hover {
    color: #F28123 !important;
}

.navbar .navbar-brand {
    filter: brightness(0) invert(1) !important;
}

/* Desactivar efectos de scroll en navbar para artículos */
.navbar-scroll-effect {
    background: #1a2947 !important;
    backdrop-filter: none !important;
}

/* ==================================================
   FOOTER CON FUENTE BLANCA
   ================================================== */

/* Forzar toda la fuente del footer en blanco */
.footer * {
    color: white !important;
}

.footer h3,
.footer h4,
.footer p,
.footer a,
.footer span,
.footer div {
    color: white !important;
}

.footer a:hover {
    color: #F28123 !important;
}

.footer .social-links a:hover {
    color: #F28123 !important;
}

/* ==================================================
   FAVICON CORRECTIONS FOR ARTICLES
   ================================================== */

/* Corregir favicon en artículos usando JavaScript */
/* Este CSS es para asegurar que el favicon se cargue correctamente */

/* Mejoras específicas para el contenido del artículo */
.article-content .content-center h1 {
    font-family: "Poppins", sans-serif;
    font-weight: bold;
    color: #000 !important;
    font-size: 2.25rem;
}

.article-content .content-center h2 {
    font-family: "Poppins", sans-serif;
    font-weight: bold;
    color: #000 !important;
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #2c5aa0;
    padding-bottom: 0.5rem;
}

.article-content .content-center p {
    font-family: "Poppins", sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 2.2rem;
    color: #000 !important;
    text-align: justify;
    margin-bottom: 1.5rem;
}

/* Mejorar contraste para enlaces dentro del artículo */
.article-content .content-center a {
    color: #2c5aa0 !important;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.article-content .content-center a:hover {
    border-bottom-color: #2c5aa0;
}

/* ==================================================
   ARTICLE CONTROLS
   ================================================== */

.article-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.font-size-btn {
    background: #2c5aa0;
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.font-size-btn:hover {
    background: #1a2947;
    transform: translateY(-2px);
}

.reading-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #666;
    font-size: 0.9em;
}

/* ==================================================
   BACK TO TOP BUTTON
   ================================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2c5aa0;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #1a2947;
    transform: translateY(-3px);
}

/* ==================================================
   RESPONSIVE DESIGN
   ================================================== */

@media (max-width: 768px) {
    .article-content .content-center h2 {
        font-size: 1.5rem;
    }
    
    .article-content .content-center p {
        font-size: 1rem;
    }
    
    .article-controls {
        padding: 0 15px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .article-content .content-center h2 {
        font-size: 1.3rem;
    }
    
    .article-content .content-center p {
        font-size: 0.95rem;
    }
}

/* ==================================================
   FONT SIZE CONTROLS
   ================================================== */

/* Tamaños de fuente para el botón de accesibilidad */
.article-content.font-large .content-center p {
    font-size: 1.3rem !important;
    line-height: 2.4rem !important;
}

.article-content.font-large .content-center h2 {
    font-size: 2rem !important;
}

.article-content.font-xlarge .content-center p {
    font-size: 1.5rem !important;
    line-height: 2.6rem !important;
}

.article-content.font-xlarge .content-center h2 {
    font-size: 2.2rem !important;
}

/* Responsive para tamaños de fuente grandes */
@media (max-width: 768px) {
    .article-content.font-large .content-center p {
        font-size: 1.2rem !important;
    }
    
    .article-content.font-xlarge .content-center p {
        font-size: 1.4rem !important;
    }
}

@media (max-width: 480px) {
    .article-content.font-large .content-center p {
        font-size: 1.1rem !important;
    }
    
    .article-content.font-xlarge .content-center p {
        font-size: 1.3rem !important;
    }
}

.breadcrumb-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    list-style: none;
    background-color: transparent;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    display: inline-block;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
    color: var(--text-muted);
    content: "/";
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-muted);
    font-weight: 500;
}

/* ==================================================
   CONTENT SECTION STYLING
   ================================================== */

.content-center {
    text-align: left;
    margin: 3rem auto;
    max-width: 100%;
    padding: 0 20px;
    position: relative;
}

.content-center h1 {
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    line-height: 1.2;
    color: var(--primary-color);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.content-center h1:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    border-radius: 2px;
}

.content-center h1:empty {
    display: none;
}

.content-center h1:empty + p {
    margin-top: 0;
}

.content-center p {
    font-family: "Poppins", sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: justify;
}

.content-center p:last-child {
    margin-bottom: 0;
}

/* ==================================================
   ARTICLE SPECIFIC ENHANCEMENTS
   ================================================== */

/* Introducción destacada */
.content-center:first-child {
    background: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-light);
    position: relative;
}

.content-center:first-child::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 0%, rgba(44, 90, 160, 0.03) 100%);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    z-index: 0;
}

.content-center:first-child p {
    font-size: 1.2rem;
    font-weight: 500;
    color: #000 !important;
    position: relative;
    padding-left: 1rem;
    border-left: 4px solid var(--accent-color);
    z-index: 1;
}

.content-center:first-child h1,
.content-center:first-child h2,
.content-center:first-child h3 {
    color: var(--primary-color) !important;
    position: relative;
    z-index: 1;
}

/* Separadores entre secciones */
.content-center:not(:first-child):not(:last-child) {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 2rem;
}

/* Último párrafo - conclusión */
.content-center:last-child {
    background: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-light);
    border-top: 4px solid var(--primary-color);
    position: relative;
}

.content-center:last-child::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 0%, rgba(44, 90, 160, 0.03) 100%);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    z-index: 0;
}

.content-center:last-child p {
    color: #000 !important;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.content-center:last-child h1,
.content-center:last-child h2,
.content-center:last-child h3 {
    color: var(--primary-color) !important;
    position: relative;
    z-index: 1;
}

/* Asegurar legibilidad */
.content-center p {
    text-shadow: none;
    background: transparent;
}

/* ==================================================
   IMAGE STYLING
   ================================================== */

.content-img {
    display: block;
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 2rem auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
}

.content-img:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

/* ==================================================
   RESPONSIVE DESIGN
   ================================================== */

/* Desktop */
@media screen and (min-width: 1200px) {
    .content-center {
        padding: 0 40px;
    }
    
    .content-center h1 {
        font-size: 2.8rem;
    }
    
    .content-center p {
        font-size: 1.15rem;
    }
}

/* Tablet */
@media screen and (max-width: 1024px) {
    .content-center {
        padding: 0 30px;
    }
    
    .content-center h1 {
        font-size: 2.2rem;
    }
    
    .content-center p {
        font-size: 1.05rem;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    #main-content {
        padding-top: 60px;
    }
    
    .breadcrumb-nav {
        padding: 0.75rem 15px;
        margin-bottom: 1.5rem;
    }
    
    .breadcrumb-item {
        font-size: 0.9rem;
    }
    
    .content-center {
        margin: 2rem auto;
        padding: 0 15px;
    }
    
    .content-center h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .content-center p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .content-center:first-child,
    .content-center:last-child {
        padding: 1.5rem;
    }
    
    .content-center:first-child::after,
    .content-center:last-child::after {
        width: 80px;
        height: 80px;
    }
    
    .content-img {
        margin: 1.5rem auto;
    }
}

/* Small Mobile */
@media screen and (max-width: 480px) {
    .content-center h1 {
        font-size: 1.5rem;
    }
    
    .content-center p {
        font-size: 0.95rem;
    }
    
    .content-center:first-child,
    .content-center:last-child {
        padding: 1rem;
    }
    
    .content-center:first-child::after,
    .content-center:last-child::after {
        width: 60px;
        height: 60px;
    }
}

/* ==================================================
   ACCESSIBILITY & ANIMATIONS
   ================================================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus states */
.content-center:focus-within {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

/* Animation on scroll */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-center {
    animation: fadeInUp 0.8s ease-out;
}

/* Staggered animation */
.content-center:nth-child(1) { animation-delay: 0.1s; }
.content-center:nth-child(2) { animation-delay: 0.2s; }
.content-center:nth-child(3) { animation-delay: 0.3s; }
.content-center:nth-child(4) { animation-delay: 0.4s; }
.content-center:nth-child(5) { animation-delay: 0.5s; }
.content-center:nth-child(6) { animation-delay: 0.6s; }
.content-center:nth-child(7) { animation-delay: 0.7s; }
.content-center:nth-child(8) { animation-delay: 0.8s; }

/* ==================================================
   PRINT STYLES
   ================================================== */

@media print {
    .content-center {
        box-shadow: none;
        background: white !important;
        margin: 1rem 0;
        padding: 1rem 0;
    }
    
    .content-center h1 {
        color: black !important;
        font-size: 1.5rem;
    }
    
    .content-center p {
        color: black !important;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .content-img {
        max-width: 100%;
        box-shadow: none;
    }
}

/* ==================================================
   DARK MODE SUPPORT
   ================================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e0e0e0;
        --text-light: #cccccc;
        --text-muted: #aaaaaa;
        --light-bg: #2a2a2a;
        --white: #1a1a1a;
    }
    
    /* NO cambiar el fondo de content-center:last-child - mantener blanco siempre */
    .content-center:first-child {
        background: #1a1a1a;
    }
    
    .content-center:first-child::after {
        background: linear-gradient(135deg, transparent 0%, rgba(44, 90, 160, 0.1) 100%);
    }
    
    .content-center:first-child p {
        color: #e0e0e0 !important;
    }
    
    /* content-center:last-child mantiene fondo blanco y texto negro siempre */
    .content-center:last-child {
        background: white !important;
    }
    
    .content-center:last-child p {
        color: #000 !important;
    }
    
    .content-center:last-child h1,
    .content-center:last-child h2,
    .content-center:last-child h3 {
        color: var(--primary-color) !important;
    }
}

/* ==================================================
   PERFORMANCE OPTIMIZATIONS
   ================================================== */

/* GPU acceleration for animations */
.content-center,
.content-img {
    will-change: transform;
    transform: translateZ(0);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .content-center {
        animation: none;
    }
    
    .content-img:hover {
        transform: none;
    }
}
