
/* =============================================
   BLOG STYLES - VERSIÓN LIMPIA
   ============================================= */

/* Contenedor principal del formulario */
.blog-form {
    max-width: 950px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--tacmex-dark-gray);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Grupos de campos del formulario */
.blog-form-group {
    margin-bottom: 1.5rem;
}

/* Labels del formulario */
.blog-form-label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--tacmex-white);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Inputs del formulario */
.blog-form-control {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--tacmex-white);
    background-color: var(--tacmex-dark);
    border: 2px solid var(--tacmex-light-gray);
    border-radius: 4px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.blog-form-control:focus {
    outline: none;
    border-color: var(--tacmex-green);
    background-color: rgba(0, 107, 63, 0.1);
    box-shadow: 0 0 0 3px rgba(0, 107, 63, 0.1);
}

/* Estilo especial para el input de archivo */
.blog-file-input {
    padding: 0.5rem;
    background-color: var(--tacmex-dark);
    color: var(--tacmex-white);
}

.blog-file-input::-webkit-file-upload-button {
    background-color: var(--tacmex-green);
    border: none;
    color: var(--tacmex-white);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.blog-file-input::-webkit-file-upload-button:hover {
    background-color: #005533;
}

/* Imagen actual */
.blog-current-image {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--tacmex-dark);
    border: 1px solid var(--tacmex-light-gray);
    border-radius: 4px;
}

.blog-current-image-text {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--tacmex-light-gray);
}

.blog-thumbnail {
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    border: 2px solid var(--tacmex-light-gray);
}

/* Alertas de error */
.blog-alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid var(--tacmex-red);
}

.blog-alert-danger {
    background-color: rgba(206, 17, 38, 0.1);
    color: var(--tacmex-white);
    border-left-color: var(--tacmex-red);
}

.blog-alert h4 {
    margin: 0 0 0.5rem 0;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--tacmex-red);
}

.blog-alert ul {
    margin: 0;
    padding-left: 1.5rem;
}

.blog-alert li {
    margin-bottom: 0.25rem;
}

/* Acciones del formulario */
.blog-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--tacmex-light-gray);
}

/* Igualar altura de botones del formulario */
.blog-form-actions .button {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Botones específicos del formulario */
.blog-form-actions .blog-submit-btn {
    background-color: var(--tacmex-green);
    border-color: var(--tacmex-green);
    color: var(--tacmex-white);
}

.blog-form-actions .blog-submit-btn:hover {
    background-color: #005533;
    border-color: #005533;
    color: var(--tacmex-white);
}

.blog-form-actions .blog-cancel-btn {
    background-color: transparent;
    color: var(--tacmex-white);
    border: 2px solid var(--tacmex-light-gray);
}

.blog-form-actions .blog-cancel-btn:hover {
    background-color: var(--tacmex-light-gray);
    color: var(--tacmex-dark);
    text-decoration: none;
}

/* Títulos de página */
.blog-page-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--tacmex-white);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.blog-page-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--tacmex-green) 0%, var(--tacmex-white) 50%, var(--tacmex-red) 100%);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Personalización del editor Trix */
trix-toolbar .trix-button-group button {
    background-color: var(--tacmex-white);
    border: 1px solid var(--tacmex-light-gray);
}

/* =============================================
   BLOG INDEX STYLES
   ============================================= */

/* Header de acciones */
.blog-actions-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 3rem;
}

/* Botón estilo texto */
.blog-actions-header .button-text {
    background: none;
    border: none;
    color: #42b082;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.blog-actions-header .button-text::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--tacmex-green);
    transition: width 0.3s ease;
}

.blog-actions-header .button-text:hover {
    color: var(--tacmex-white);
}

.blog-actions-header .button-text:hover::after {
    width: 100%;
}

/* Grid de blogs */
.blogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    justify-items: center;
}

/* Tarjeta de blog */
.blog-card {
    background-color: var(--tacmex-dark-gray);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 450px; /* Ancho máximo para las tarjetas */
    width: 100%; /* Ocupa el ancho disponible hasta el máximo */
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

/* Imagen de la tarjeta */
.blog-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

/* Placeholder para blogs sin imagen */
.blog-card-no-image {
    background: linear-gradient(135deg, var(--tacmex-dark) 0%, var(--tacmex-dark-gray) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-image-placeholder {
    text-align: center;
    color: var(--tacmex-light-gray);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Contenido de la tarjeta */
.blog-card-content {
    padding: 1rem .5rem;
}

.blog-card-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--tacmex-white);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.blog-card-subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--tacmex-light-gray);
    margin: 0 0 1rem 0;
    font-weight: 500;
}

.blog-card-excerpt {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--tacmex-light-gray);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* =============================================
   ESTILOS PARA FUNCIONALIDAD DE VISIBILIDAD
   ============================================= */

/* Indicador de blog oculto */
.blog-visibility-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(206, 17, 38, 0.9);
    color: var(--tacmex-white);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.blog-visibility-indicator i {
    font-size: 0.7rem;
}

/* Estilo para blogs ocultos (solo visible para admin) */
.blog-card-hidden {
    position: relative;
    opacity: 0.7;
    border: 2px dashed rgba(206, 17, 38, 0.5);
    background-color: rgba(26, 26, 26, 0.8);
}

.blog-card-hidden::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(206, 17, 38, 0.05) 10px,
        rgba(206, 17, 38, 0.05) 20px
    );
    pointer-events: none;
    z-index: 1;
}

.blog-card-hidden .blog-card-content {
    position: relative;
    z-index: 2;
}

/* Botones de visibilidad */
.blog-hide-btn {
    background-color: rgba(206, 17, 38, 0.2);
    color: var(--tacmex-red);
    border: 2px solid var(--tacmex-red);
}

.blog-hide-btn:hover {
    background-color: var(--tacmex-red);
    color: var(--tacmex-white);
}

.blog-show-btn {
    background-color: rgba(0, 107, 63, 0.2);
    color: var(--tacmex-green);
    border: 2px solid var(--tacmex-green);
}

.blog-show-btn:hover {
    background-color: var(--tacmex-green);
    color: var(--tacmex-white);
}

/* Iconos en los botones */
.blog-hide-btn i,
.blog-show-btn i {
    margin-right: 0.3rem;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-visibility-indicator {
        top: 5px;
        right: 5px;
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .blog-visibility-indicator span {
        display: none; 
    }
}

/* Acciones de la tarjeta */
.blog-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.blog-card-actions .button {
    flex: 1;
    min-width: 70px;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    text-align: center;
}

/* Botones específicos de las tarjetas */
.blog-card-actions .blog-view-btn {
    background-color: var(--tacmex-green);
    border-color: var(--tacmex-green);
    color: var(--tacmex-white);
}

.blog-card-actions .blog-view-btn:hover {
    background-color: #005533;
    border-color: #005533;
}

.blog-card-actions .blog-edit-btn {
    background-color: transparent;
    color: var(--tacmex-white);
    border: 2px solid var(--tacmex-white);
}

.blog-card-actions .blog-edit-btn:hover {
    background-color: var(--tacmex-white);
    color: var(--tacmex-dark);
}

.blog-card-actions .blog-delete-btn {
    background-color: transparent;
    color: var(--tacmex-red);
    border: 2px solid var(--tacmex-red);
}

.blog-card-actions .blog-delete-btn:hover {
    background-color: var(--tacmex-red);
    color: var(--tacmex-white);
}

/* Estado vacío */
.blog-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--tacmex-light-gray);
}

.blog-empty-state h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--tacmex-white);
    margin-bottom: 1rem;
}

.blog-empty-state p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Responsive para formularios y blog */
@media (max-width: 768px) {
    .blog-form {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .blog-form-actions {
        flex-direction: column;
    }
    
    .blog-page-title {
        font-size: 2rem;
    }
    
    .blogs-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-actions-header {
        justify-content: center;
        margin-bottom: 2rem;
    }
    
    .blog-card-actions {
        flex-direction: column;
    }
    
    .blog-card-actions .button {
        flex: none;
    }
}

@media (max-width: 480px) {
    .blog-card-content {
        padding: .7rem;
    }
    
    .blog-card-title {
        font-size: 1.2rem;
    }
}

/* =============================================
   BLOG SHOW - DISEÑO EDITORIAL TIPO REVISTA
   ============================================= */

.blog-article {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8rem 2rem 2rem 2rem;
    background-color: var(--tacmex-dark-gray);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Header del artículo */
.blog-article-header {
    margin-bottom: 2rem;
    text-align: center;
    background-color: transparent;
}

.blog-article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-article-date {
    font-family: var(--font-body);
    font-size: 0.5rem;
    color: var(--tacmex-light-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-article-actions {
    display: flex;
    gap: 1rem;
}

.blog-action-link {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--tacmex-green);
    transition: color 0.3s ease;
}

.blog-action-link:hover {
    color: var(--tacmex-white);
}

.blog-delete-link {
    color: var(--tacmex-red);
}

.blog-delete-link:hover {
    color: #ff4757;
}

.blog-article-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--tacmex-white);
    margin: 0 0 1rem 0;
    line-height: 1.2;
    position: relative;
}

.blog-article-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--tacmex-green), var(--tacmex-red));
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.blog-article-subtitle {
    font-family: var(--font-body);
    font-size: 1.25rem;
    color: var(--tacmex-light-gray);
    margin: 1.5rem 0 0 0;
    font-weight: 400;
    line-height: 1.4;
}

.blog-article-content {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--tacmex-white);
    margin: 2rem 0;
    text-align: justify;
}

/* Imagen flotante integrada en el texto */
.blog-article-image {
    float: right;
    width: 400px;
    max-width: 45%;
    margin: 0 0 1.2rem 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.blog-article-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-image: linear-gradient(to right, var(--tacmex-green), var(--tacmex-white), var(--tacmex-red)) 1;
    z-index: 2;
    pointer-events: none;
}

.blog-article-img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

/* Estilos para elementos dentro del contenido */
.blog-article-content h1,
.blog-article-content h2,
.blog-article-content h3,
.blog-article-content h4,
.blog-article-content h5,
.blog-article-content h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--tacmex-white);
    margin: 2rem 0 1rem 0;
    clear: both;
}

.blog-article-content h2 {
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.blog-article-content h2::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background-color: var(--tacmex-green);
    bottom: 0;
    left: 0;
}

.blog-article-content h3 {
    font-size: 1.4rem;
    color: var(--tacmex-green);
}

.blog-article-content p {
    margin-bottom: 1.5rem;
}

.blog-article-content ul,
.blog-article-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.blog-article-content li {
    margin-bottom: 0.5rem;
    color: var(--tacmex-light-gray);
}

.blog-article-content strong {
    color: var(--tacmex-white);
    font-weight: 600;
}

.blog-article-content em {
    color: var(--tacmex-green);
    font-style: italic;
}

.blog-article-content blockquote {
    border-left: 4px solid var(--tacmex-green);
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    background-color: rgba(0, 107, 63, 0.1);
    border-radius: 0 4px 4px 0;
    font-style: italic;
    color: var(--tacmex-light-gray);
    clear: both;
}

/* Footer del artículo */
.blog-article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    text-align: center;
    clear: both;
    background: none;
}

/* Botón de navegación estilo texto */
.blog-navigation .blog-back-btn {
    background: none;
    border: none;
    color: var(--tacmex-white);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: .75rem;
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.blog-navigation .blog-back-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--tacmex-green);
    transition: width 0.3s ease;
}

.blog-navigation .blog-back-btn:hover {
    font-size: 1;
    background: none;
}

.blog-navigation .blog-back-btn:hover::after {
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-article {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .blog-article-image {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 2rem 0;
    }
    
    .blog-article-title {
        font-size: 2rem;
    }
    
    .blog-article-subtitle {
        font-size: 1.1rem;
    }
    
    .blog-article-meta {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .blog-article-actions {
        justify-content: center;
    }

    .blog-article-content {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .blog-article-content {
        font-size: 1rem;
    }
}